/**
 * ZABCO Staff Management System
 * Blue & White Theme Styles
 */

:root {
    --primary-red: #2563EB;
    --primary-red-light: #3B82F6;
    --primary-red-dark: #1D4ED8;
    --white: #FFFFFF;
    --gray-light: #F3F4F6;
    --gray-medium: #6B7280;
    --gray-dark: #1F2937;
    --success: #10B981;
    --info: #3B82F6;
    --warning: #F59E0B;
    --danger: #2563EB;
    --purple: #8B5CF6;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;

    /* Light mode (default) */
    --bg-primary: #F3F4F6;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F9FAFB;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: #FFFFFF;
    --card-border: rgba(0, 0, 0, 0.1);
    --input-bg: #FFFFFF;
    --input-border: #D1D5DB;
    --shadow-sm: rgba(0, 0, 0, 0.05);
    --shadow-md: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    /* Dark mode */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: #1E293B;
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: #334155;
    --input-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Global Link Styles - Use default text color */
a[href] {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Icons in links should not inherit link color - override with !important */
a[href] i.fas,
a[href] i.far,
a[href] i.fal,
a[href] i.fab,
a[href] i.fa,
a[href] i,
a[href] .icon,
a[href] [class*="fa-"] {
    color: unset !important;
}

/* Button links - icons should inherit button color with !important */
a[href].btn i,
a[href].btn-primary i,
a[href].btn-success i,
a[href].btn-warning i,
a[href].btn-danger i,
a[href].btn-info i,
a[href].btn-secondary i,
a[href].btn-sm i,
a[href].btn-lg i,
a[href].btn-xs i,
.btn i,
.btn-primary i,
.btn-success i,
.btn-warning i,
.btn-danger i,
.btn-info i,
.btn-secondary i,
.btn-sm i,
.btn-lg i,
.btn-xs i,
button.btn i,
button.btn-primary i,
button.btn-success i,
button.btn-warning i,
button.btn-danger i,
button.btn-info i,
button.btn-secondary i,
button.btn-sm i,
button.btn-lg i,
button.btn-xs i {
    color: inherit !important;
}

/* Table action buttons - ensure icons are white */
.table a[href].btn i,
.table-container a[href].btn i,
.table .btn i,
.table-container .btn i,
.table button.btn i,
.table-container button.btn i {
    color: inherit !important;
}

/* Custom button classes - icons should inherit button color */
.btn-in i,
.btn-out i,
.btn-transfer i,
.task-action-btn i {
    color: inherit !important;
}

a[href]:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Don't underline on hover if it's a button */
a[href].btn:hover,
a[href].btn-primary:hover,
a[href].btn-success:hover,
a[href].btn-warning:hover,
a[href].btn-danger:hover,
a[href].btn-info:hover,
a[href].btn-secondary:hover {
    text-decoration: none;
}

a[href]:visited {
    color: var(--text-primary);
}

/* Table Links - Use default text color */
.table a[href],
.table-container a[href] {
    color: var(--text-primary);
}

.table a[href] i,
.table-container a[href] i {
    color: inherit;
}

.table a[href]:hover,
.table-container a[href]:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Don't underline button links in tables on hover */
.table a[href].btn:hover,
.table-container a[href].btn:hover {
    text-decoration: none;
}

/* Sidebar Navigation - Glassmorphism/Neumorphism Style */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    /* Glassmorphism effect */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    /* Neumorphism effect */
    box-shadow:
        8px 0 32px rgba(0, 0, 0, 0.08),
        inset -1px 0 0 rgba(255, 255, 255, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    z-index: 10001 !important;
    overflow-x: visible !important;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.4s ease,
        backdrop-filter 0.4s ease,
        overflow-x 0s;
}

/* Ensure overflow-x is visible during transition when collapsing */
.sidebar:not(.collapsed) .sidebar-menu-item.has-submenu:hover .sidebar-submenu {
    overflow-x: visible;
}

[data-theme="dark"] .sidebar {
    background: rgba(30, 41, 59, 0.85);
    box-shadow:
        8px 0 32px rgba(0, 0, 0, 0.5),
        inset -1px 0 0 rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    padding: 24px 20px;
    /* Glassmorphic header with gradient overlay */
    background: linear-gradient(135deg,
            rgba(37, 99, 235, 0.85) 0%,
            rgba(29, 78, 216, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--white);
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Sidebar Close Button - Glassmorphism Effect */
.sidebar-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    color: var(--white);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.sidebar-close-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-close-btn i {
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sidebar-close-btn:hover i {
    transform: rotate(90deg);
}

/* Hide close button on mobile */
@media (max-width: 768px) {
    .sidebar-close-btn {
        display: none !important;
    }
}


.sidebar-header::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%);
    pointer-events: none;
}

.sidebar-header-content {
    text-align: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    transition: transform 0.3s ease;
}

.sidebar-header h2:hover {
    transform: scale(1.05);
}

.sidebar-nav {
    padding: 16px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 4px 12px;
}

/* Sidebar Section Headers */
.sidebar-nav-section {
    margin: 20px 12px 8px 12px;
    padding: 8px 0 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    padding: 0 18px;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

[data-theme="dark"] .sidebar-nav-section-title {
    color: var(--text-tertiary);
    opacity: 0.8;
}

.sidebar.collapsed .sidebar-nav-section {
    margin: 16px 8px 8px 8px;
    border-bottom: none;
}

.sidebar.collapsed .sidebar-nav-section-title {
    display: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    /* Neumorphism effect */
    background: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .sidebar-nav a {
    background: rgba(30, 41, 59, 0.5);
    color: var(--text-secondary);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.15) 0%,
            rgba(37, 99, 235, 0.05) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.7);
    border-left-color: var(--primary-red-light);
    border-left-width: 3px;
    color: var(--primary-red);
    transform: translateX(4px);
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(37, 99, 235, 0.05);
    font-weight: 500;
}

[data-theme="dark"] .sidebar-nav a:hover {
    background: rgba(30, 41, 59, 0.8);
    color: var(--primary-red-light);
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(37, 99, 235, 0.1);
    font-weight: 500;
}

.sidebar-nav a:hover::before {
    width: 100%;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.25) 0%,
            rgba(37, 99, 235, 0.15) 100%);
    border-left-color: var(--primary-red);
    border-left-width: 4px;
    color: var(--primary-red);
    font-weight: 700;
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset -3px 0 0 var(--primary-red),
        0 0 0 2px rgba(37, 99, 235, 0.1);
    transform: translateX(2px);
}

[data-theme="dark"] .sidebar-nav a.active {
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.3) 0%,
            rgba(37, 99, 235, 0.2) 100%);
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset -3px 0 0 var(--primary-red),
        0 0 0 2px rgba(37, 99, 235, 0.2);
}

.sidebar-nav a.active::before {
    width: 100%;
}

.sidebar-nav a i {
    margin-right: 14px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.3s ease;
    font-size: 18px;
}

.sidebar-nav a:hover i {
    transform: scale(1.15) rotate(5deg);
    color: var(--primary-red);
}

.sidebar-nav a.active i {
    transform: scale(1.1);
    color: var(--primary-red);
}

.sidebar-nav a span {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.sidebar-nav a:hover span {
    transform: translateX(2px);
}

.badge-notification {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 6px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 2px 6px rgba(37, 99, 235, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow:
            0 4px 12px rgba(37, 99, 235, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

.sidebar-nav a:hover .badge-notification {
    transform: scale(1.1);
    box-shadow:
        0 4px 12px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
}

.sidebar.collapsed .sidebar-header-content {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 12px;
    position: relative;
}

.sidebar.collapsed .sidebar-nav a i {
    margin-right: 0;
    width: 24px;
    font-size: 20px;
}

.sidebar.collapsed .sidebar-nav a span {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.sidebar.collapsed .badge-notification {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    font-size: 10px;
}

/* Tooltip for collapsed sidebar - Glassmorphic */
.sidebar.collapsed .sidebar-nav a[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 12px;
    background: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--white);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-nav a[data-tooltip]::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 6px;
    border: 6px solid transparent;
    border-right-color: rgba(31, 41, 55, 0.9);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.sidebar.collapsed .sidebar-nav a[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(4px);
}


/* Sub-menu display in collapsed state - Inline Style */
.sidebar.collapsed .sidebar-menu-item.has-submenu {
    position: relative;
    overflow: visible !important;
}

/* Override the default hidden state when active */
.sidebar.collapsed .sidebar-menu-item.has-submenu.active {
    overflow: visible !important;
}

.sidebar.collapsed .sidebar-submenu {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    background: transparent;
    /* Removed background for cleaner look */
    box-shadow: none;
    /* Removed shadow */
    border-radius: 0;
    padding: 0;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: auto;
    margin-left: 0;
    display: block;
}

.sidebar.collapsed .sidebar-submenu.active {
    max-height: 500px;
    /* Arbitrary large height for expansion */
    opacity: 1;
    visibility: visible;
    margin-top: 4px;
    margin-bottom: 4px;
}

/* Center icons in collapsed submenu */
.sidebar.collapsed .sidebar-submenu li a {
    padding: 8px 0;
    justify-content: center;
    display: flex;
}

.sidebar.collapsed .sidebar-submenu li a i {
    margin-right: 0;
    font-size: 16px;
    /* Slightly smaller icons for submenu */
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .sidebar-submenu li a span {
    display: none;
    /* Ensure text is hidden */
}

/* Hide chevron in collapsed mode */
.sidebar.collapsed .submenu-chevron {
    display: none;
}

/* Active state for collapsed submenu item */
.sidebar.collapsed .sidebar-menu-item.has-submenu.active .sidebar-menu-toggle {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-red);
}

/* Remove the popup arrow */
.sidebar.collapsed .sidebar-submenu::before {
    display: none;
}



/* Sub-menu Styles */
.sidebar-menu-item.has-submenu {
    position: relative;
    margin: 4px 12px;
}

.sidebar-menu-toggle {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .sidebar-menu-toggle {
    background: rgba(30, 41, 59, 0.5);
    color: var(--text-secondary);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.7);
    border-left-color: var(--primary-red-light);
    border-left-width: 3px;
    color: var(--primary-red);
    transform: translateX(4px);
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(37, 99, 235, 0.05);
    font-weight: 500;
}

[data-theme="dark"] .sidebar-menu-toggle:hover {
    background: rgba(30, 41, 59, 0.8);
    color: var(--primary-red-light);
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(37, 99, 235, 0.1);
    font-weight: 500;
}

.sidebar-menu-item.has-submenu.active .sidebar-menu-toggle {
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.25) 0%,
            rgba(37, 99, 235, 0.15) 100%);
    border-left-color: var(--primary-red);
    border-left-width: 4px;
    color: var(--primary-red);
    font-weight: 700;
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset -3px 0 0 var(--primary-red),
        0 0 0 2px rgba(37, 99, 235, 0.1);
    transform: translateX(2px);
}

[data-theme="dark"] .sidebar-menu-item.has-submenu.active .sidebar-menu-toggle {
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.3) 0%,
            rgba(37, 99, 235, 0.2) 100%);
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset -3px 0 0 var(--primary-red),
        0 0 0 2px rgba(37, 99, 235, 0.2);
}

.submenu-chevron {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    color: var(--text-tertiary);
}

.sidebar-menu-item.has-submenu:hover .submenu-chevron,
.sidebar-menu-item.has-submenu.active .submenu-chevron,
.sidebar-menu-item.has-submenu .sidebar-submenu.active~.sidebar-menu-toggle .submenu-chevron {
    transform: rotate(90deg);
    color: var(--primary-red);
}

.sidebar-submenu {
    list-style: none;
    padding: 0 0 0 20px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
    display: block;
    pointer-events: none;
    position: relative;
}

.sidebar-submenu.active,
.sidebar-menu-item.has-submenu.active .sidebar-submenu {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Hover-based sub-menu display (desktop only) */
.sidebar-menu-item.has-submenu:hover .sidebar-submenu {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar-menu-item.has-submenu:hover .submenu-chevron {
    transform: rotate(90deg);
}

/* Keep active sub-menus visible even when not hovering */
.sidebar-menu-item.has-submenu.active .sidebar-submenu,
.sidebar-menu-item.has-submenu.active:hover .sidebar-submenu {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar-menu-item.has-submenu.active .submenu-chevron,
.sidebar-menu-item.has-submenu.active:hover .submenu-chevron {
    transform: rotate(90deg);
}

.sidebar-submenu::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    opacity: 0.5;
}

.sidebar-submenu li {
    margin: 2px 12px 2px 20px;
    position: relative;
}

.sidebar-submenu li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 16px;
    height: 2px;
    background: var(--border-color);
    opacity: 0.5;
    transform: translateY(-50%);
}

.sidebar-submenu a {
    padding: 12px 18px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.3);
    border-left: 2px solid transparent;
    position: relative;
}

[data-theme="dark"] .sidebar-submenu a {
    background: rgba(30, 41, 59, 0.4);
}

.sidebar-submenu a:hover {
    background: rgba(255, 255, 255, 0.6);
    border-left-color: var(--primary-red-light);
    border-left-width: 3px;
    color: var(--primary-red);
    transform: translateX(3px);
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

[data-theme="dark"] .sidebar-submenu a:hover {
    background: rgba(30, 41, 59, 0.7);
    color: var(--primary-red-light);
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.sidebar-submenu a.active {
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.2) 0%,
            rgba(37, 99, 235, 0.12) 100%);
    border-left-color: var(--primary-red);
    border-left-width: 3px;
    color: var(--primary-red);
    font-weight: 700;
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset -2px 0 0 var(--primary-red);
    transform: translateX(2px);
}

[data-theme="dark"] .sidebar-submenu a.active {
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.25) 0%,
            rgba(37, 99, 235, 0.18) 100%);
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset -2px 0 0 var(--primary-red);
}

/* Collapsed sidebar - show sub-menus on hover as popup */
.sidebar.collapsed .sidebar-menu-item.has-submenu {
    position: relative;
    z-index: 10002;
}

.sidebar.collapsed .sidebar-submenu {
    display: block !important;
    position: fixed !important;
    min-width: 200px;
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999 !important;
    max-height: none !important;
    overflow: visible !important;
    list-style: none;
}

.sidebar.collapsed .sidebar-menu-item.has-submenu:hover .sidebar-submenu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.sidebar.collapsed .sidebar-submenu li {
    margin: 0;
}

.sidebar.collapsed .sidebar-submenu a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: var(--white);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar.collapsed .sidebar-submenu a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-red);
    color: var(--primary-red-light);
}

.sidebar.collapsed .sidebar-submenu a.active {
    background: rgba(37, 99, 235, 0.2);
    border-left-color: var(--primary-red);
    color: var(--primary-red-light);
    font-weight: 600;
}

.sidebar.collapsed .sidebar-submenu a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .sidebar-submenu a span {
    opacity: 1;
    visibility: visible;
    position: static;
    pointer-events: auto;
}

.sidebar.collapsed .submenu-chevron {
    display: none;
}

/* Collapsed sidebar: reveal child icons inline only after clicking the parent icon. */
.sidebar.collapsed .sidebar-menu-item.has-submenu .sidebar-submenu,
.sidebar.collapsed .sidebar-menu-item.has-submenu.active .sidebar-submenu,
.sidebar.collapsed .sidebar-menu-item.has-submenu:hover .sidebar-submenu {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: max-height 0.3s ease, opacity 0.2s ease !important;
}

.sidebar.collapsed .sidebar-menu-item.has-submenu.submenu-open .sidebar-submenu {
    max-height: 600px !important;
    padding: 4px 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.sidebar.collapsed .sidebar-submenu li {
    width: 100%;
    margin: 2px 0 !important;
}

.sidebar.collapsed .sidebar-submenu li::before {
    display: none;
}

.sidebar.collapsed .sidebar-submenu a {
    width: 100%;
    min-height: 38px;
    justify-content: center !important;
    padding: 8px 0 !important;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
    border: 0 !important;
    border-radius: 10px;
}

.sidebar.collapsed .sidebar-submenu a i {
    width: 20px;
    margin: 0 !important;
    font-size: 16px;
    text-align: center;
}

.sidebar.collapsed .sidebar-submenu a span,
.sidebar.collapsed .sidebar-submenu .badge-notification {
    display: none !important;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 20px;
    min-height: 100vh;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.4s ease;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Header */
.top-header {
    background-color: var(--card-bg);
    padding: 15px 30px;
    margin: -20px -20px 30px -20px;
    box-shadow: 0 2px 8px var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    position: relative;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .top-header {
    box-shadow: 0 2px 8px var(--shadow-lg);
}

/* Hide mobile menu button on desktop */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden;
    }
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-toggle {
    display: none;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: var(--white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow:
        0 4px 12px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.mobile-menu-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, var(--primary-red) 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 6px 20px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mobile-menu-toggle:hover::before {
    width: 300px;
    height: 300px;
}

.mobile-menu-toggle:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mobile-menu-toggle i {
    font-size: 22px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.3s ease;
}

.header-datetime {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.header-datetime i {
    color: var(--primary-red);
    font-size: 0.85rem;
}

.header-datetime span {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .header-datetime {
        display: none;
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    box-shadow: 0 2px 4px var(--shadow-sm);
}

.dark-mode-toggle:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
    box-shadow: 0 4px 8px var(--shadow-md);
}

[data-theme="dark"] .dark-mode-toggle {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .dark-mode-toggle:hover {
    background: var(--bg-secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.user-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-md);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--card-border);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .card {
    box-shadow: 0 2px 8px var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    gap: 20px;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.card-header-actions-left,
.card-header-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-actions-left {
    justify-content: flex-start;
}

.card-header-actions-right {
    justify-content: flex-end;
    margin-left: auto;
}

.card-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.3s ease;
}

/* KPI Cards */
.kpi-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px var(--shadow-md);
    border-left: 4px solid var(--primary-red);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .kpi-card {
    box-shadow: 0 2px 8px var(--shadow-lg);
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.kpi-card.success {
    border-left-color: var(--success);
    background: linear-gradient(135deg,
            var(--card-bg) 0%,
            rgba(16, 185, 129, 0.05) 50%,
            var(--card-bg) 100%);
    background-size: 200% 200%;
    animation: kpiGradient 8s ease infinite;
}

.kpi-card.info {
    border-left-color: var(--info);
    background: linear-gradient(135deg,
            var(--card-bg) 0%,
            rgba(37, 99, 235, 0.05) 50%,
            var(--card-bg) 100%);
    background-size: 200% 200%;
    animation: kpiGradient 8s ease infinite;
}

.kpi-card.warning {
    border-left-color: var(--warning);
    background: linear-gradient(135deg,
            var(--card-bg) 0%,
            rgba(217, 119, 6, 0.05) 50%,
            var(--card-bg) 100%);
    background-size: 200% 200%;
    animation: kpiGradient 8s ease infinite;
}

.kpi-card.danger {
    border-left-color: var(--danger);
    background: linear-gradient(135deg,
            var(--card-bg) 0%,
            rgba(37, 99, 235, 0.05) 50%,
            var(--card-bg) 100%);
    background-size: 200% 200%;
    animation: kpiGradient 8s ease infinite;
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-light) 100%);
    color: var(--white);
}

.kpi-card.success .kpi-icon {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.kpi-card.info .kpi-icon {
    background: linear-gradient(135deg, var(--info) 0%, #2563EB 100%);
}

.kpi-card.warning .kpi-icon {
    background: linear-gradient(135deg, var(--warning) 0%, #D97706 100%);
}

.kpi-card.danger .kpi-icon {
    background: linear-gradient(135deg, var(--danger) 0%, var(--primary-red-dark) 100%);
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 10px 0;
    transition: color 0.3s ease;
}

.kpi-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

/* KPI Card Animated Backgrounds */
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: left 0.5s ease;
    z-index: 0;
}

.kpi-card:hover::before {
    left: 100%;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.05) 0%,
            transparent 70%);
    animation: kpiPulse 4s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.kpi-card.success::after {
    background: radial-gradient(circle,
            rgba(16, 185, 129, 0.1) 0%,
            transparent 70%);
}

.kpi-card.info::after {
    background: radial-gradient(circle,
            rgba(37, 99, 235, 0.1) 0%,
            transparent 70%);
}

.kpi-card.warning::after {
    background: radial-gradient(circle,
            rgba(217, 119, 6, 0.1) 0%,
            transparent 70%);
}

.kpi-card.danger::after {
    background: radial-gradient(circle,
            rgba(37, 99, 235, 0.1) 0%,
            transparent 70%);
}

.kpi-icon,
.kpi-value,
.kpi-label {
    position: relative;
    z-index: 1;
}

@keyframes kpiPulse {

    0%,
    100% {
        transform: scale(1) translate(0, 0);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1) translate(10%, 10%);
        opacity: 0.8;
    }
}

@keyframes kpiGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

[data-theme="dark"] .kpi-card.success {
    background: linear-gradient(135deg,
            var(--card-bg) 0%,
            rgba(16, 185, 129, 0.1) 50%,
            var(--card-bg) 100%);
    background-size: 200% 200%;
}

[data-theme="dark"] .kpi-card.info {
    background: linear-gradient(135deg,
            var(--card-bg) 0%,
            rgba(37, 99, 235, 0.1) 50%,
            var(--card-bg) 100%);
    background-size: 200% 200%;
}

[data-theme="dark"] .kpi-card.warning {
    background: linear-gradient(135deg,
            var(--card-bg) 0%,
            rgba(217, 119, 6, 0.1) 50%,
            var(--card-bg) 100%);
    background-size: 200% 200%;
}

[data-theme="dark"] .kpi-card.danger {
    background: linear-gradient(135deg,
            var(--card-bg) 0%,
            rgba(37, 99, 235, 0.1) 50%,
            var(--card-bg) 100%);
    background-size: 200% 200%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-light) 100%);
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, var(--primary-red) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: var(--primary-red-dark);
}

.btn-warning {
    background-color: var(--warning);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--gray-medium);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    position: relative;
    background-color: var(--card-bg);
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .table-container {
    background-color: var(--card-bg) !important;
}

/* Branch Dropdown Menu */
.branch-dropdown-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.branch-dropdown-menu {
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    min-width: 220px;
    box-shadow: 0 4px 12px var(--shadow-lg);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: visible;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: none;
}

.branch-dropdown-menu.show {
    display: block !important;
}

.branch-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.branch-dropdown-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.branch-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.branch-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg) !important;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .table {
    background-color: var(--card-bg) !important;
}

.table thead {
    background-color: var(--bg-tertiary) !important;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .table thead {
    background-color: var(--bg-tertiary) !important;
}

.table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--primary-red);
    transition: color 0.3s ease;
    background-color: var(--bg-tertiary) !important;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary) !important;
    background-color: var(--card-bg) !important;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

[data-theme="dark"] .table td {
    background-color: var(--card-bg) !important;
}

.table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.15);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Detail view tables with transparent background */
.table.detail-table {
    background-color: transparent !important;
    font-size: 14px;
}

.table.detail-table th {
    color: var(--text-primary);
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
}

.table.detail-table td {
    color: var(--text-primary);
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

/* Date Columns - Wider width to prevent wrapping */
.table th[data-column="date"],
.table th[data-column="borrow_date"],
.table th[data-column="due_date"],
.table th[data-column="payment_date"],
.table th[data-column="transaction_date"],
.table th[data-column="submission_date"],
.table th[data-column="created_at"],
.table th[data-column="updated_at"] {
    min-width: 120px;
    width: 120px;
}

.table td[data-column="date"],
.table td[data-column="borrow_date"],
.table td[data-column="due_date"],
.table td[data-column="payment_date"],
.table td[data-column="transaction_date"],
.table td[data-column="submission_date"],
.table td[data-column="created_at"],
.table td[data-column="updated_at"] {
    min-width: 120px;
    width: 120px;
    white-space: nowrap;
}

/* License information boxes */
.license-box,
[style*="background: #f9fafb"],
[style*="background:#f9fafb"] {
    background-color: var(--bg-tertiary) !important;
    transition: background-color 0.3s ease;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.form-text,
small.form-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

[data-theme="dark"] .form-text,
[data-theme="dark"] small.form-text {
    color: var(--text-secondary) !important;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.bg-success {
    background-color: var(--success);
    color: var(--white);
}

.bg-danger {
    background-color: var(--danger);
    color: var(--white);
}

.bg-warning {
    background-color: var(--warning);
    color: var(--white);
}

.bg-secondary {
    background-color: var(--gray-medium);
    color: var(--white);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.alert-success {
    background-color: #D1FAE5;
    border-color: var(--success);
    color: #065F46;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
}

.alert-danger {
    background-color: #FEE2E2;
    border-color: var(--danger);
    color: #991B1B;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(37, 99, 235, 0.2);
    color: #FCA5A5;
}

.alert-warning {
    background-color: #FEF3C7;
    border-color: var(--warning);
    color: #92400E;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #FCD34D;
}

.alert-info {
    background-color: #DBEAFE;
    border-color: var(--info);
    color: #1E40AF;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93C5FD;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--input-border);
    background-color: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 6px;
    text-decoration: none;
}

.pagination a:hover {
    background-color: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

.pagination .active {
    background-color: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

/* Charts Container */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

/* Mobile Dropdown Menu */
.mobile-dropdown-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s ease,
        background 0.3s ease;
    opacity: 0;
    visibility: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .mobile-dropdown-menu {
    background: rgba(30, 41, 59, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.mobile-dropdown-menu.open {
    max-height: 90vh;
    opacity: 1;
    visibility: visible;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.mobile-dropdown-content {
    padding: 20px 0;
    overflow-y: auto;
    max-height: 90vh;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-list li {
    margin: 0;
}

/* Mobile Navigation Section Headers */
.mobile-nav-section {
    margin: 16px 0 8px 0;
    padding: 8px 0 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    padding: 0 20px;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

[data-theme="dark"] .mobile-nav-section-title {
    color: var(--text-tertiary);
    opacity: 0.8;
}

/* Mobile Sub-menu Styles */
.mobile-menu-item.has-submenu {
    position: relative;
}

.mobile-menu-toggle {
    cursor: pointer;
    position: relative;
}

.mobile-submenu-chevron {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
    color: var(--text-tertiary);
}

.mobile-menu-item.has-submenu.active .mobile-submenu-chevron {
    transform: rotate(90deg);
    color: var(--primary-red);
}

.mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    display: block;
    position: relative;
    padding-left: 20px;
}

.mobile-submenu::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    opacity: 0.5;
}

.mobile-submenu.active,
.mobile-menu-item.has-submenu.active .mobile-submenu {
    max-height: 1000px;
    opacity: 1;
}

.mobile-submenu li {
    margin: 0;
    position: relative;
}

.mobile-submenu li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 16px;
    height: 2px;
    background: var(--border-color);
    opacity: 0.5;
    transform: translateY(-50%);
}

.mobile-submenu a {
    padding: 14px 24px 14px 50px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.3);
    border-left: 2px solid transparent;
    position: relative;
}

[data-theme="dark"] .mobile-submenu a {
    background: rgba(30, 41, 59, 0.4);
}

.mobile-submenu a:hover,
.mobile-submenu a:active {
    background: rgba(255, 255, 255, 0.5);
    border-left-color: var(--primary-red-light);
}

[data-theme="dark"] .mobile-submenu a:hover,
[data-theme="dark"] .mobile-submenu a:active {
    background: rgba(30, 41, 59, 0.6);
}

.mobile-submenu a.active {
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.15) 0%,
            rgba(37, 99, 235, 0.08) 100%);
    border-left-color: var(--primary-red);
    color: var(--primary-red);
    font-weight: 600;
}

.mobile-nav-list a {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
    margin: 2px 12px;
    border-radius: 12px;
}

[data-theme="dark"] .mobile-nav-list a {
    background: rgba(30, 41, 59, 0.5);
    color: var(--text-secondary);
}

.mobile-nav-list a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.15) 0%,
            rgba(37, 99, 235, 0.05) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.mobile-nav-list a:hover,
.mobile-nav-list a:active {
    background: rgba(255, 255, 255, 0.8);
    border-left-color: var(--primary-red-light);
    color: var(--primary-red);
    transform: translateX(4px);
    box-shadow:
        0 4px 12px rgba(37, 99, 235, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mobile-nav-list a:hover::before,
.mobile-nav-list a:active::before {
    width: 100%;
}

.mobile-nav-list a.active {
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.2) 0%,
            rgba(37, 99, 235, 0.1) 100%);
    border-left-color: var(--primary-red);
    color: var(--primary-red);
    font-weight: 600;
    box-shadow:
        0 4px 12px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mobile-nav-list a.active::before {
    width: 100%;
}

.mobile-nav-list a i {
    margin-right: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.3s ease;
    font-size: 20px;
}

.mobile-nav-list a:hover i,
.mobile-nav-list a:active i {
    transform: scale(1.15) rotate(5deg);
    color: var(--primary-red);
}

.mobile-nav-list a.active i {
    transform: scale(1.1);
    color: var(--primary-red);
}

.mobile-nav-list a span {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
    flex: 1;
}

.mobile-nav-list a:hover span,
.mobile-nav-list a:active span {
    transform: translateX(2px);
}

.mobile-nav-list a .badge-notification {
    margin-left: auto;
    position: relative;
    z-index: 1;
}

/* Backdrop overlay when mobile dropdown is open */
body.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Ensure button is visible and positioned well on mobile */
    .top-header-left {
        position: relative;
    }

    /* Hide desktop sidebar on mobile */
    .sidebar {
        display: none !important;
        visibility: hidden;
    }

    .main-content {
        margin-left: 0;
    }

    .top-header {
        flex-direction: row;
        gap: 15px;
        padding: 15px 20px;
        position: relative;
        z-index: 1003;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .top-header h1 {
        font-size: 20px;
    }

    .user-menu {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Mobile dropdown menu positioning */
    .mobile-dropdown-menu {
        top: 70px;
        /* Adjust based on header height */
    }

    /* Ensure smooth transitions on mobile */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Improve touch interactions */
    .mobile-nav-list a {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }
}

/* Desktop view - ensure sidebar is visible */
@media (min-width: 769px) {
    .mobile-dropdown-menu {
        display: none !important;
        visibility: hidden !important;
        max-height: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: fixed !important;
        top: -9999px !important;
        left: -9999px !important;
    }

    .sidebar {
        display: block !important;
        visibility: visible;
        transform: translateX(0) !important;
    }

    body.mobile-menu-open::before {
        display: none !important;
    }
}

/* Smooth scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.5);
}

/* Smooth scrollbar for mobile dropdown */
.mobile-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-dropdown-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.mobile-dropdown-content::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.mobile-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.5);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--gray-light);
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* Dropdown menu */
.dropdown-menu.show {
    display: block !important;
}

/* Close dropdown when clicking outside */
body {
    position: relative;
}

/* Settings Page Tab Navigation */
.settings-tabs {
    display: flex;
    gap: 8px;
    padding: 20px 20px 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .settings-tabs {
    background: var(--card-bg) !important;
    border-bottom-color: var(--border-color) !important;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--card-bg);
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    margin-bottom: -1px;
}

[data-theme="dark"] .settings-tab {
    background: var(--card-bg) !important;
    color: var(--text-secondary) !important;
}

.settings-tab i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.settings-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .settings-tab:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.settings-tab:hover i {
    transform: scale(1.1);
}

.settings-tab.active {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    z-index: 1;
}

.settings-tab.active i {
    color: var(--white);
}

.settings-content {
    padding: 30px;
    background: var(--card-bg);
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .settings-content {
    background: var(--card-bg) !important;
}

.settings-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive tabs */
@media (max-width: 768px) {
    .settings-tabs {
        padding: 15px 15px 0;
        gap: 4px;
    }

    .settings-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .settings-tab span {
        display: none;
    }

    .settings-tab i {
        font-size: 18px;
    }

    .settings-content {
        padding: 20px 15px;
    }
}

/* ============================================
   LOGIN PAGE - Modern Glassmorphism Design
   ============================================ */

/* Animated Background */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            #667eea 0%,
            #764ba2 25%,
            #f093fb 50%,
            #4facfe 75%,
            #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 0;
    overflow: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-bg-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.login-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -50px;
    animation-delay: 2s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    bottom: -50px;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 180px;
    height: 180px;
    top: 20%;
    right: 20%;
    animation-delay: 6s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }

    25% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.4;
    }

    50% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.35;
    }

    75% {
        transform: translate(20px, 30px) scale(1.05);
        opacity: 0.4;
    }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Login Card - Glassmorphism */
.login-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2);
    padding: 48px 40px;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9) 0%, rgba(29, 78, 216, 0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 24px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 8px 24px rgba(37, 99, 235, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow:
            0 12px 32px rgba(37, 99, 235, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.logo-icon i {
    font-size: 36px;
    color: var(--white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.login-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Alert Message */
.login-alert {
    background: rgba(37, 99, 235, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(37, 99, 235, 0.4);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    font-size: 14px;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.login-alert i {
    font-size: 18px;
    color: #ff6b6b;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-input-group {
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.05) 100%);
    transition: width 0.3s ease;
    z-index: 0;
}

.input-wrapper:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.input-wrapper:hover::before {
    width: 100%;
}

.input-wrapper.focused {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.input-wrapper.focused::before {
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    z-index: 1;
    transition: all 0.3s ease;
}

.input-wrapper.focused .input-icon {
    color: var(--white);
    transform: scale(1.1);
}

.login-input {
    width: 100%;
    padding: 16px 18px 16px 50px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-size: 15px;
    font-weight: 400;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.login-input:focus {
    color: var(--white);
}

/* Login Button */
.login-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg,
            rgba(37, 99, 235, 0.9) 0%,
            rgba(29, 78, 216, 0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    transition: left 0.5s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.95) 0%,
            rgba(37, 99, 235, 1) 100%);
}

.login-button:hover::before {
    left: 100%;
}

.login-button:active {
    transform: translateY(0);
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-icon {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.login-button:hover .button-icon {
    transform: translateX(4px);
}

/* Login Footer */
.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.login-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-align: center;
}

.login-info i {
    font-size: 14px;
    opacity: 0.7;
}

.login-info strong {
    color: var(--white);
    font-weight: 600;
}

/* Staff Count Button */
.staff-count-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.staff-count-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.staff-count-btn i {
    font-size: 14px;
}

[data-theme="dark"] .staff-count-btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .staff-count-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Category Type Tabs Styling */
.category-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.category-tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    border-radius: 6px 6px 0 0;
}

.category-tab-btn.active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: var(--primary-red);
}

[data-theme="dark"] .category-tab-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .category-tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .category-tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-red);
}

.category-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 15px;
    }

    .login-card {
        padding: 36px 28px;
        border-radius: 20px;
    }

    .login-title {
        font-size: 28px;
    }

    .logo-icon {
        width: 70px;
        height: 70px;
    }

    .logo-icon i {
        font-size: 32px;
    }

    .login-subtitle {
        font-size: 13px;
    }

    .shape-1,
    .shape-2,
    .shape-3,
    .shape-4 {
        opacity: 0.2;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }

    .login-title {
        font-size: 24px;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
    }

    .logo-icon i {
        font-size: 28px;
    }
}

/* Column Toggle Styles */
.column-toggle-wrapper {
    position: relative;
    display: inline-block;
}

.column-toggle-btn {
    background-color: var(--gray-medium);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s ease;
}

.column-toggle-btn:hover {
    background-color: var(--primary-red);
}

.column-toggle-btn i {
    font-size: 14px;
}

.column-toggle-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-lg);
    z-index: 1000;
    min-width: 200px;
    margin-top: 5px;
    padding: 10px;
    display: none;
    /* Hidden by default */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.column-toggle-dropdown.show {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

.column-toggle-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.column-toggle-item {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.column-toggle-item:hover {
    background-color: var(--gray-light);
}

.column-toggle-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.column-toggle-item span {
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}

/* Category Type Tabs Styling */
.category-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.category-tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    border-radius: 6px 6px 0 0;
}

.category-tab-btn.active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: var(--primary-red);
}

[data-theme="dark"] .category-tab-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .category-tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .category-tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-red);
}

.category-section {
    animation: fadeIn 0.3s ease;
}

.column-toggle-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.column-toggle-actions .btn-link {
    background: none;
    border: none;
    color: var(--primary-red);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.column-toggle-actions .btn-link:hover {
    color: var(--primary-red-dark);
    text-decoration: underline;
}

/* Hide columns when toggled */
table th[data-column][style*="display: none"],
table td[data-column][style*="display: none"] {
    display: none !important;
}

/* ============================================
   MOBILE DROPDOWN MENU
   ============================================ */
.mobile-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 15px;
    z-index: 1000;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
}

[data-theme="dark"] .mobile-dropdown-menu {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
}

.mobile-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-list, .mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-item {
    margin-bottom: 5px;
}

.mobile-nav-link, .mobile-nav-list > li > a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mobile-nav-link:hover, .mobile-nav-list > li > a:hover {
    background: var(--bg-tertiary);
    color: var(--primary-red);
}

.mobile-menu-item.active > .mobile-nav-link,
.mobile-nav-list > li > a.active {
    background: linear-gradient(135deg, rgba(37,99,235,0.1) 0%, rgba(37,99,235,0.05) 100%);
    color: var(--primary-red);
    font-weight: 600;
}

.mobile-nav-link i:first-child, .mobile-nav-list > li > a i:first-child {
    width: 24px;
    margin-right: 10px;
    text-align: center;
    color: var(--text-secondary);
}

.mobile-menu-item.active > .mobile-nav-link i:first-child,
.mobile-nav-list > li > a.active i:first-child,
.mobile-nav-link:hover i:first-child, 
.mobile-nav-list > li > a:hover i:first-child {
    color: var(--primary-red);
}

.mobile-submenu-chevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.mobile-menu-item.active > .mobile-nav-link .mobile-submenu-chevron {
    transform: rotate(90deg);
}

.mobile-submenu {
    padding-left: 34px;
    display: none;
    margin-top: 5px;
}

.mobile-menu-item.active > .mobile-submenu {
    display: block;
}

.mobile-submenu a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mobile-submenu a:hover {
    background: var(--bg-tertiary);
    color: var(--primary-red);
}

.mobile-submenu a.active {
    color: var(--primary-red);
    font-weight: 600;
}

.mobile-submenu a i {
    width: 20px;
    margin-right: 8px;
    font-size: 12px;
}
