:root {
    /* Royal Blue Light Theme Color Palette */
    --primary: #1e40af;          /* Royal Blue */
    --primary-light: #3b82f6;    /* Lighter Royal Blue */
    --primary-dark: #1e3a8a;     /* Darker Royal Blue */
    --secondary: #1e40af;        /* Royal Blue as secondary */
    --secondary-light: #3b82f6;  /* Light Royal Blue */
    --secondary-dark: #1e3a8a;   /* Dark Royal Blue */
    --accent: #f59e0b;           /* Warm Amber accent */
    --accent-light: #fbbf24;     /* Light Amber */
    --accent-dark: #d97706;      /* Dark Amber */

    /* Status Colors */
    --success: #059669;          /* Emerald Green */
    --success-light: #10b981;    /* Light Emerald */
    --success-dark: #047857;     /* Dark Emerald */
    --warning: #d97706;          /* Amber */
    --warning-light: #f59e0b;    /* Light Amber */
    --warning-dark: #b45309;     /* Dark Amber */
    --danger: #dc2626;           /* Red */
    --danger-light: #ef4444;     /* Light Red */
    --danger-dark: #b91c1c;      /* Dark Red */
    --info: #0891b2;             /* Cyan */
    --info-light: #06b6d4;       /* Light Cyan */
    --info-dark: #0e7490;        /* Dark Cyan */

    /* Neutral Colors - Light Theme */
    --gray-50: #fafafa;          /* Very Light Gray */
    --gray-100: #f4f4f5;         /* Light Gray */
    --gray-200: #e5e7eb;         /* Light Medium Gray */
    --gray-300: #d1d5db;         /* Medium Light Gray */
    --gray-400: #9ca3af;         /* Medium Gray */
    --gray-500: #6b7280;         /* Medium Dark Gray */
    --gray-600: #4b5563;         /* Dark Medium Gray */
    --gray-700: #374151;         /* Dark Gray */
    --gray-800: #1f2937;         /* Very Dark Gray */
    --gray-900: #111827;         /* Almost Black */

    /* Surface Colors - Light Theme */
    --surface-white: rgba(255, 255, 255, 0.98);
    --surface-gray: rgba(248, 250, 252, 0.95);
    --surface-elevated: rgba(255, 255, 255, 0.99);
    --surface-primary: rgba(30, 64, 175, 0.02); /* Very subtle royal blue tint */

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 64px;
    --border-radius-sm: 6px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;

    /* Shadows - More refined */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.025);
    --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 20px 0 rgba(59, 130, 246, 0.08);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Typography improvements */
    --font-primary: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Line heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.6;
    --leading-loose: 2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    font-size: 14px;
    line-height: var(--leading-normal);
    font-weight: 400;
    color: var(--gray-900);
    background: var(--surface-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Subtle background patterns for depth */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.015) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.01) 0%, transparent 50%);
    z-index: -2;
    pointer-events: none;
}

/* Subtle grid pattern overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.01) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.01) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
}

/* Modern Sidebar - Matching ACCOUNT.HTML colors */
/* Modern Sidebar - Matching ACCOUNT.HTML colors */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all var(--transition-normal);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Allow submenus to overflow sidebar */
.sidebar .menu-item.has-submenu {
    overflow: visible;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo i {
    font-size: 28px;
}

.sidebar-menu {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Allow submenus to overflow the menu container */
.sidebar-menu .menu-item.has-submenu {
    overflow: visible;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    cursor: pointer;
    overflow: visible;
}

.menu-item:hover,
.menu-item.active {
    background-color: rgba(255,255,255,0.1);
    border-left: 4px solid #f39c12;
    color: white !important;
}

.menu-item i:not(.submenu-arrow) {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.menu-item:hover i,
.menu-item.active i {
    opacity: 1;
    transform: scale(1.1);
}

/* Submenu Styles */
.menu-item.has-submenu {
    cursor: pointer;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.menu-item.has-submenu:hover .submenu-arrow {
    transform: translateX(3px);
    opacity: 1;
}

.submenu {
    position: fixed;
    left: 13%;
    min-width: 200px;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1001;
    padding-left: 4px;
    pointer-events: none;
    display: block;
}

.submenu-content {
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px 0;
    max-height: 400px;
    overflow-y: auto;
    white-space: nowrap;
    display: block;
    visibility: inherit;
}

.menu-item.has-submenu:hover .submenu,
.submenu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    display: block;
}

.menu-item.has-submenu:hover .submenu-content,
.submenu:hover .submenu-content {
    pointer-events: auto;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #1a1a1a !important;
    text-decoration: none;
    transition-property: background-color, color;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.submenu-item:hover {
    background-color: #f8f9fa;
    color: #1a1a1a !important;
}

.submenu-item i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    color: #1a1a1a;
}

.submenu-item:hover i {
    color: #1a1a1a;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    margin-top: auto;
}

.sidebar-logo {
    margin-bottom: 15px;
    text-align: center;
}

.sidebar-logo img {
    max-width: 180px;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    background-color: white;
    border-radius: 50%;
    padding: 15px;
    display: block;
    margin: 0 auto;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.logo-placeholder i {
    font-size: 24px;
    color: #f39c12;
}

.contact-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.contact-support:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    color: white !important;
}

.contact-support i {
    font-size: 16px;
}

/* Modern Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Modern Header */
.header {
    height: var(--header-height);
    background: var(--surface-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.header:hover {
    box-shadow: var(--shadow-md);
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.3px;
    font-family: var(--font-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* User Profile Dropdown */
.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    position: relative;
}

.user-profile::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.user-profile:hover {
    background: var(--surface-white);
    border-color: rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.user-profile:hover::before {
    opacity: 1;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.user-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: inherit;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Notification Styles */
.notification-dropdown {
    position: relative;
}

.notification-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-white);
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    cursor: pointer;
}

.notification-icon:hover {
    background: var(--surface-elevated);
    border-color: rgba(15, 23, 42, 0.1);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.notification-icon i {
    font-size: 18px;
    line-height: 1;
}

.notification-badge-header {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 9px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    background-color: #dc3545 !important;
    color: white !important;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

.notification-badge-header:empty {
    display: none !important;
}

.notification-badge-sidebar {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.notification-dropdown-menu {
    max-height: 500px;
    overflow: visible;
    flex-direction: column;
}

/* Ensure dropdown is hidden by default (Bootstrap will add 'show' class when opened) */
.notification-dropdown-menu:not(.show) {
    display: none !important;
}

.notification-dropdown-menu.show {
    display: flex !important;
}

.notification-list-container {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* Custom scrollbar for notification list */
.notification-list-container::-webkit-scrollbar {
    width: 6px;
}

.notification-list-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.notification-list-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.notification-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.notification-dropdown-item {
    transition: background-color 0.2s ease;
}

.notification-dropdown-item:hover {
    background-color: var(--surface-elevated);
}

.notification-dropdown-item:last-child {
    border-bottom: none !important;
}

.notification-dropdown-item.unread-notification {
    background-color: rgba(13, 110, 253, 0.05);
    border-left: 3px solid #0d6efd;
}

.notification-dropdown-item.unread-notification:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

.badge-admin {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-operator {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Minimal Content Area */
.content {
    flex: 1;
    padding: 12px 24px 0;
    overflow-y: auto;
    background: transparent;
}

/* Modern Section Styling */
.section {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    z-index: 0;
    pointer-events: none;
}

.section > * {
    position: relative;
    z-index: 1;
}

.section:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
    border-color: rgba(0, 102, 204, 0.1);
}

.section:last-child {
    margin-bottom: 0;
}

.section h2 {
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.25px;
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 16px;
}

.section h2 i {
    color: var(--secondary);
    font-size: 20px;
}

.section > *:not(h2):first-child {
    padding-top: 20px;
}

.section > *:last-child {
    padding-bottom: 20px;
}

.section > * {
    padding-left: 24px;
    padding-right: 24px;
}

/* Card styles removed - now in dashboard.css */

/* Modern Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;
    background: white;
}

thead th {
    background: var(--gray-50);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-900) !important;
    background-color: white !important;
}

tbody tr {
    background-color: white !important;
}

tbody tr:hover {
    background-color: var(--gray-50) !important;
}

tbody tr td {
    color: var(--gray-900) !important;
    background-color: inherit !important;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Empty state styling */
.table tbody .text-muted {
    color: var(--gray-400) !important;
    font-style: italic;
    font-size: 14px;
    padding: 40px 20px !important;
}

/* Ensure all table text is dark and visible */
.flex-row table tbody td,
.section table tbody td,
table tbody td,
.table tbody td,
.dataTable tbody td {
    color: var(--gray-900) !important;
    font-weight: 500 !important;
    background-color: white !important;
}

.flex-row table tbody tr,
.section table tbody tr,
table tbody tr,
.table tbody tr,
.dataTable tbody tr {
    background-color: white !important;
}


/* Table headers with better styling */
thead th {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--gray-600) !important;
    background: var(--gray-50) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Modern Form Elements */
h3 {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.25px;
}

h3 i {
    color: var(--secondary);
    font-size: 18px;
}

/* Flex Row for Tables */
.flex-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 0;
    padding: 0 !important;
}

.flex-row > div {
    background: white !important;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 0;
    overflow: hidden;
}

.flex-row h3 {
    padding: 20px 20px 16px;
    margin: 0 0 0 0;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.flex-row table {
    margin: 0;
    box-shadow: none;
    background: white !important;
}

.flex-row thead th {
    background: var(--gray-50) !important;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700) !important;
}

/* Modern Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: var(--border-radius-lg);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(-1px);
    transition: transform var(--transition-fast);
}

.btn:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.btn i {
    font-size: 14px;
    transition: transform var(--transition-fast);
}

.btn:hover i {
    transform: scale(1.1);
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: white;
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
    border-color: var(--success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success) 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-light) 0%, var(--danger) 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    color: white;
    border-color: var(--warning);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning) 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, var(--info-light) 100%);
    color: white;
    border-color: var(--info);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--info-light) 0%, var(--info) 100%);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
    color: white;
    border-color: var(--gray-600);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-600) 100%);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
    color: white !important;
}

.btn-outline-primary {
    background: transparent;
    color: var(--secondary);
    border-color: var(--secondary);
    box-shadow: none;
}

.btn-outline-primary:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--gray-700);
    border-color: var(--gray-300);
    box-shadow: none;
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

/* Green background + black foreground button */
.btn-green-black {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white !important;
    border-color: var(--success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-green-black:hover {
    background: linear-gradient(135deg, var(--success-light) 0%, var(--success) 100%);
    color: white !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Blue background + white foreground button */
.btn-blue-black {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white !important;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-blue-black:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* CSV Import Modal - 80vw width and 80vh height, centered in both directions */
.csv-import-modal .modal-dialog {
    width: 75vw;
    max-width: 90vw;
    min-width: 75vw;
    height: 80vh;
    max-height: 90vh;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csv-import-modal .modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.csv-import-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 25px;
}

.csv-import-modal .modal-body .alert {
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

.csv-import-modal .modal-body .table-responsive {
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 0;
}

.csv-import-modal .modal-body .table-responsive table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.csv-import-modal .modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    line-height: 1.2;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 16px;
    line-height: 1.2;
}

/* Button States */
.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.btn-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Legacy support */
button {
    font-family: inherit;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Inputs */
input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-900);
    background: white;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

/* Labels */
label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fff4;
    border-color: #9ae6b4;
    color: #22543d;
}

.alert-error {
    background-color: #fed7d7;
    border-color: #feb2b2;
    color: #742a2a;
}

.alert-warning {
    background-color: #fefcbf;
    border-color: #f6e05e;
    color: #744210;
}

.alert-info {
    background-color: #bee3f8;
    border-color: #90cdf4;
    color: #1a365d;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: white;
}

.footer-content {
    text-align: center;
}

.footer-content small {
    color: var(--gray-500);
    font-size: 13px;
}

.footer-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

.footer-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Dropdown Menu */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    padding: 8px 0;
    margin-top: 8px;
    min-width: 200px;
}

.dropdown-header {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin: 0;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.dropdown-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--gray-200);
    border: none;
    margin: 8px 0;
}

.text-danger {
    color: var(--danger) !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        padding: 0 16px;
        box-shadow: var(--shadow-sm);
    }

    .header-left h1 {
        font-size: 16px;
    }

    .content {
        padding: 8px 16px 0;
    }

    .section {
        margin-bottom: 16px;
        border-radius: var(--border-radius);
    }

    .section h2 {
        font-size: 18px;
        padding: 16px 16px 0;
        padding-bottom: 12px;
    }

    .section > * {
        padding-left: 16px;
        padding-right: 16px;
    }

    .section > *:not(h2):first-child {
        padding-top: 16px;
    }

    .section > *:last-child {
        padding-bottom: 16px;
    }


    .flex-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .user-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 12px;
    }

    .content {
        padding: 8px 12px 0;
    }

    .footer {
        padding: 12px;
    }


    thead th,
    tbody td {
        padding: 12px 16px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #111827;
        --gray-100: #1f2937;
        --gray-200: #374151;
        --gray-900: #f9fafb;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }

    input,
    select,
    textarea {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Utilities */
.d-none {
    display: none !important;
}
.d-block {
    display: block !important;
}
.d-inline {
    display: inline !important;
}
.d-inline-block {
    display: inline-block !important;
}
.d-flex {
    display: flex !important;
}

.text-center {
    text-align: center !important;
}
.text-left {
    text-align: left !important;
}
.text-right {
    text-align: right !important;
}

.fw-bold {
    font-weight: 700 !important;
}
.fw-semibold {
    font-weight: 600 !important;
}
.fw-normal {
    font-weight: 400 !important;
}

.text-muted {
    color: var(--gray-500) !important;
}
.text-primary {
    color: var(--primary) !important;
}
.text-secondary {
    color: var(--secondary) !important;
}
.text-success {
    color: var(--success) !important;
}
.text-warning {
    color: var(--warning) !important;
}
.text-info {
    color: var(--info) !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}
.mb-1 {
    margin-bottom: 4px !important;
}
.mb-2 {
    margin-bottom: 8px !important;
}
.mb-3 {
    margin-bottom: 12px !important;
}
.mb-4 {
    margin-bottom: 16px !important;
}
.mb-5 {
    margin-bottom: 20px !important;
}

.mt-0 {
    margin-top: 0 !important;
}
.mt-1 {
    margin-top: 4px !important;
}
.mt-2 {
    margin-top: 8px !important;
}
.mt-3 {
    margin-top: 12px !important;
}
.mt-4 {
    margin-top: 16px !important;
}
.mt-5 {
    margin-top: 20px !important;
}

.ms-2 {
    margin-left: 8px !important;
}
.me-2 {
    margin-right: 8px !important;
}

/* Text Visibility Fixes for Better Contrast */
.container-fluid,
.main-content,
.content,
div,
span,
p,
td,
th,
label,
.form-label,
.filter-label {
    color: var(--gray-900) !important;
}

/* Filter Sidebar Text Fixes */
.filter-sidebar .filter-body,
.filter-sidebar .filter-group,
.filter-sidebar .filter-label {
    color: var(--gray-800) !important;
}

.filter-sidebar input,
.filter-sidebar select,
.filter-sidebar textarea {
    color: var(--gray-900) !important;
    background: white !important;
}

/* Alert Message Fixes */
.alert {
    color: var(--gray-900) !important;
}

.alert-success {
    color: #155724 !important;
    background-color: #d4edda !important;
}

.alert-danger {
    color: #721c24 !important;
    background-color: #f8d7da !important;
}

.alert-warning {
    color: #856404 !important;
    background-color: #fff3cd !important;
}

.alert-info {
    color: #0c5460 !important;
    background-color: #d1ecf1 !important;
}

/* Button Text Fixes */
.btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(
        .btn-info:not(.btn-secondary)
    ) {
    color: var(--gray-800) !important;
}

/* Form Control Text Fixes */
.form-control,
.form-select,
input,
select,
textarea {
    color: var(--gray-900) !important;
    background-color: white !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    color: var(--gray-900) !important;
}

/* Badge Text Fixes - Ensure white text on colored backgrounds */
.badge {
    color: white !important;
}

/* Bootstrap 5 badge variants - ensure white text on colored backgrounds */
.badge.bg-primary,
.badge.bg-success,
.badge.bg-info,
.badge.bg-danger,
.badge.bg-warning,
.badge.bg-secondary,
.badge.bg-dark {
    color: white !important;
}

/* Light badges that should have dark text */
.badge.bg-light,
.badge-light {
    color: var(--gray-900) !important;
    background-color: #f8f9fa !important;
}

/* Warning badge - use dark text if background is light yellow, white if dark orange */
.badge.bg-warning {
    background-color: var(--warning) !important;
    color: white !important;
}

/* Main Content Area Text */
.main-table-content,
.table-card {
    color: var(--gray-900) !important;
}

/* Modal Content Text Fixes */
.modal-content,
.modal-body,
.modal-header,
.modal-footer {
    color: var(--gray-900) !important;
}

/* List Group Text Fixes */
.list-group-item {
    color: var(--gray-900) !important;
}

/* Card Text Fixes */
.card-body,
.card-text,
.card-title {
    color: var(--gray-900) !important;
}

/* Nav Text Fixes */
.nav-link:not(.active) {
    color: var(--gray-700) !important;
}

/* Ensure all text elements have proper contrast */
* {
    color: inherit;
}

body,
html {
    color: var(--gray-900) !important;
}

/* Override any light text colors */
.text-light,
.text-white,
.text-muted {
    color: var(--gray-600) !important;
}

/* Specific fixes for common problematic elements */
small,
.small {
    color: var(--gray-600) !important;
}

.dropdown-item {
    color: var(--gray-800) !important;
}

.dropdown-item:hover {
    color: var(--gray-900) !important;
}

/* Tab content text fixes */
.tab-content {
    color: var(--gray-900) !important;
}

/* Breadcrumb text fixes */
.breadcrumb-item {
    color: var(--gray-700) !important;
}

.breadcrumb-item.active {
    color: var(--gray-900) !important;
}

/* Pagination text fixes */
.page-link {
    color: var(--primary) !important;
}

/* Status indicators with proper contrast */
.status-active {
    color: var(--success) !important;
    font-weight: 600;
}

.status-inactive {
    color: var(--danger) !important;
    font-weight: 600;
}

/* Search and filter input placeholders */
::placeholder {
    color: var(--gray-500) !important;
    opacity: 1;
}

/* Date picker and select2 text fixes */
.select2-container--bootstrap-5 .select2-selection__rendered {
    color: var(--gray-900) !important;
}

.flatpickr-input {
    color: var(--gray-900) !important;
}

/* Ensure toolbar and action bar text is visible */
.toolbar,
.action-bar,
.btn-toolbar {
    color: var(--gray-900) !important;
}

/* Glass morphism effects for modern browsers */
@supports (backdrop-filter: blur(10px)) {
    .section,
    .card,
    .dropdown-menu {
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.25);
    }

    .header {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

/* Dashboard animation delays removed - now in dashboard.css */

/* Center CSV Preview Modal in main-content area */
#csvPreviewModal.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

#csvPreviewModal .modal-dialog.modal-dialog-centered {
    margin: auto;
    position: relative;
    top: 0;
    transform: none;
}

/* Ensure modal backdrop is below SweetAlert */
.modal-backdrop {
    z-index: 1050;
}

/* Ensure SweetAlert2 has the greatest z-index to appear above all elements */
.swal2-container {
    z-index: 999999 !important;
}

.swal2-popup {
    z-index: 999999 !important;
}

.swal2-backdrop-show {
    z-index: 999998 !important;
}
