@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Premium Cool Light Theme */
    --bg-main: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --border-glass: rgba(99, 102, 241, 0.08);
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --sidebar-bg-top: #ffffff;
    --sidebar-bg-bottom: #f8fafc;
    --header-bg: rgba(255, 255, 255, 0.85);
    --glow-bg: rgba(255, 255, 255, 0);
    --table-hover: rgba(99, 102, 241, 0.02);
    
    --bg-glass-light: rgba(99, 102, 241, 0.04);
    --bg-glass-hover: rgba(99, 102, 241, 0.08);
    --border-light: rgba(99, 102, 241, 0.05);
    
    --chart-grid: rgba(99, 102, 241, 0.05);
    
    /* Vibrant modern HSL-tailored colors */
    --accent-blue: #0284c7;     /* Sky blue */
    --accent-indigo: #4f46e5;   /* Indigo */
    --accent-purple: #7c3aed;   /* Purple */
    --accent-green: #059669;    /* Emerald green */
    --accent-red: #e11d48;      /* Rose red */
    --accent-orange: #d97706;   /* Amber */

    --sidebar-width: 260px;
    --sidebar-width-collapsed: 80px;
    --header-height: 85px;
    
    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Premium Drop Shadows */
    --shadow-premium: 0 10px 30px -10px rgba(99, 102, 241, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 20px 40px -15px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden; /* We'll scroll inner areas */
    display: flex;
    height: 100vh;
}

/* ══════════════════════════════════════
   PAGE LOADER
══════════════════════════════════════ */
#pageLoader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--bg-main);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}
#pageLoader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: loaderLogoPulse 1.8s ease-in-out infinite;
}
.loader-logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}
.loader-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.loader-spinner-wrap {
    position: relative;
    width: 64px;
    height: 64px;
}
.loader-spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #6366f1;
    border-right-color: #3b82f6;
    animation: loaderSpin 0.9s linear infinite;
}
.loader-spinner-ring::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(99,102,241,0.3);
    animation: loaderSpin 1.4s linear infinite reverse;
}
.loader-status {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    animation: loaderTextFade 1.8s ease-in-out infinite;
}
.loader-dots::after {
    content: '';
    animation: loaderDots 1.5s steps(4, end) infinite;
}
@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}
@keyframes loaderLogoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.75; transform: scale(0.97); }
}
@keyframes loaderTextFade {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
}
@keyframes loaderDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}


/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Dynamic Left accent bar on hover */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(180deg, var(--accent-indigo), var(--accent-blue));
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    opacity: 0.9;
}

/* Curated left-border accent bar colors based on child icon classes */
.glass-panel:has(.icon-green)::before { background: linear-gradient(180deg, var(--accent-green), #34d399); }
.glass-panel:has(.icon-red)::before { background: linear-gradient(180deg, var(--accent-red), #f87171); }
.glass-panel:has(.icon-purple)::before { background: linear-gradient(180deg, var(--accent-purple), #c084fc); }
.glass-panel:has(.icon-blue)::before { background: linear-gradient(180deg, var(--accent-blue), #38bdf8); }
.glass-panel:has(.icon-orange)::before { background: linear-gradient(180deg, var(--accent-orange), #fbbf24); }

.glass-panel:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(99, 102, 241, 0.18);
}

.glass-panel:hover::before {
    width: 4px;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    border-right: 1px solid var(--border-glass);
    background: linear-gradient(180deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bottom) 100%);
    transition: width var(--transition-normal);
    display: flex;
    flex-direction: column;
    z-index: 100;
    position: relative;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-glass);
}

/* Hidden by default — shown via media query on tablet/mobile */
.close-sidebar-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: auto;
    padding: 6px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}
.close-sidebar-btn:hover {
    background: var(--bg-glass-light);
    color: var(--text-main);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar.collapsed .logo span {
    display: none;
}
.sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

.nav-links {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.25s ease, background-color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    z-index: 1;
}

.nav-item span {
    font-weight: 500;
    z-index: 1;
}

.nav-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.nav-item:hover {
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-item:hover::after {
    opacity: 1;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.08) !important;
    color: var(--accent-indigo) !important;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: linear-gradient(180deg, var(--accent-indigo), var(--accent-blue));
    border-radius: 0 4px 4px 0;
    z-index: 2;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}
.sidebar.collapsed .nav-item span {
    display: none;
}

/* Main Content Area */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Subtle background glows */
.bg-glow-1 {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, var(--glow-bg) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-2 {
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, var(--glow-bg) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* ══════════════════════════════════════
   HEADER — Premium Redesign
══════════════════════════════════════ */
header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(248, 250, 252, 0.88) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    z-index: 110;
    position: relative;
    border-bottom: none;
    box-shadow:
        0 1px 0 0 rgba(99, 102, 241, 0.06),
        0 4px 16px -4px rgba(15, 23, 42, 0.05);
}

/* Decorative gradient accent line at the bottom of header */
header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(99, 102, 241, 0.3) 20%,
        rgba(59, 130, 246, 0.4) 50%,
        rgba(139, 92, 246, 0.3) 80%,
        transparent 100%);
    opacity: 0.7;
}

/* Subtle ambient glow behind header */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(99, 102, 241, 0.03) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: -1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.toggle-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toggle-btn:hover {
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.18);
    transform: scale(1.05);
}

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--text-main) 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Search Bar ── */
.search-bar {
    position: relative;
}

.search-bar input {
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.1);
    color: var(--text-main);
    padding: 9px 16px 9px 38px;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 450;
    outline: none;
    width: 220px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-bar input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-bar input:focus {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.08),
        0 4px 12px -2px rgba(99, 102, 241, 0.1);
}

.search-bar i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.82rem;
    transition: color 0.2s ease;
}

.search-bar:focus-within i {
    color: var(--accent-indigo);
}

/* ── Icon Buttons (Notification Bell, etc.) ── */
.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-btn:hover {
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.15);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    color: white;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid #ffffff;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ── User Profile ── */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 12px 6px 6px;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-profile:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.12);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid transparent;
    background-image: linear-gradient(white, white),
                      linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #8b5cf6 100%);
    background-origin: border-box;
    background-clip: content-box, border-box;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.user-profile:hover .avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--text-main);
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 450;
    letter-spacing: 0.1px;
}

/* ── Header Separator (between left/right sections) ── */
.header-right::before {
    content: '';
    width: 1px;
    height: 28px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(99, 102, 241, 0.15) 50%,
        transparent 100%);
    margin-right: 4px;
}

/* ══════════════════════════════════════
   GLOBAL DATE FILTER — Header Component
══════════════════════════════════════ */
.header-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: 8px;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    padding: 6px 12px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-pill:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.16);
}

.filter-pill:focus-within {
    border-color: rgba(99, 102, 241, 0.28);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.06);
    background: rgba(255, 255, 255, 0.95);
}

.filter-pill .filter-icon {
    color: var(--accent-indigo);
    font-size: 0.8rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.filter-pill select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    padding-right: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    min-width: 100px;
}

.filter-pill select option {
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.84rem;
    padding: 8px;
}

.filter-pill input[type="date"] {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    width: 120px;
}

.filter-pill input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    cursor: pointer;
    filter: invert(0.3);
    transition: opacity 0.2s ease;
}

.filter-pill input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0.8;
}

.filter-or {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.6;
    flex-shrink: 0;
}

.filter-dash {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 0 2px;
    opacity: 0.5;
}

/* Responsive: hide filters on small screens */
@media (max-width: 1200px) {
    .header-filters { gap: 8px; }
    .filter-pill input[type="date"] { width: 110px; }
    .filter-pill select { min-width: 90px; font-size: 0.78rem; }
}

@media (max-width: 992px) {
    .header-filters { display: none; }
}

/* Dashboard Content Area */
.content-area {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

/* Prevent any grid child from blowing out its column */
.dashboard-grid > * {
    min-width: 0;
    min-height: 0;
}

/* KPI Cards */
.kpi-card {
    grid-column: span 3;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    min-width: 0;           /* prevent grid blowout */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: radial-gradient(circle 100px at calc(100% - 15px) 15px, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%), var(--bg-glass);
    border: 1px solid var(--border-glass);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.kpi-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;   /* never squeeze the icon */
}

/* Gradient backgrounds for KPI icons */
.icon-blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.icon-green { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.icon-purple { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }
.icon-orange { background: rgba(245, 158, 11, 0.1); color: var(--accent-orange); }
.icon-red { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }

.kpi-value {
    font-size: clamp(0.95rem, 1.6vw, 1.45rem);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    letter-spacing: -0.5px;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    min-width: 0;
    overflow: hidden;
}
.kpi-trend span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.trend-up { color: var(--accent-green); }
.trend-down { color: var(--accent-red); }

.trend-text {
    color: var(--text-muted);
}

/* Charts & Main Sections */
.chart-card {
    grid-column: span 8;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-glass);
}
.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
    border-color: rgba(99, 102, 241, 0.15);
}

.side-card {
    grid-column: span 4;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-glass);
}
.side-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
    border-color: rgba(99, 102, 241, 0.15);
}

.full-width-card {
    grid-column: span 12;
    padding: 24px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-glass);
}
.full-width-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
    border-color: rgba(99, 102, 241, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-action {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-action:hover {
    background: var(--bg-glass-hover);
}

.chart-container {
    flex-grow: 1;
    position: relative;
    height: 300px;
}

/* Lists and Tables */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-glass-light);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.list-item:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass);
}

.item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg-glass-light);
}

.item-icon img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.item-details {
    flex-grow: 1;
}

.item-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.item-action {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2;
}

.offcanvas-body .data-table th {
    top: 52px; /* Sticks below the sticky filter bar in off-canvas panels */
    background: #ffffff;
    backdrop-filter: none;
}

.data-table td {
    padding: 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--table-hover);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }
.status-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.status-info { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }

/* Progress Bars */
.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
}

/* ==========================================
   RESPONSIVE GRID & LAYOUT
   ========================================== */

/* ── Tablet (max 1200px) ── */
@media (max-width: 1200px) {
    .kpi-card  { grid-column: span 6 !important; }
    .chart-card { grid-column: span 12 !important; }
    .side-card  { grid-column: span 12 !important; }

    .content-area { padding: 24px; }
    .dashboard-grid { gap: 20px; }
}

/* ── Small Tablet (max 992px) ── */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 300;
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
        transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .sidebar.active {
        left: 0;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100%;
    }

    .close-sidebar-btn { display: flex !important; }

    header { padding: 0 20px; }

    .kpi-card  { grid-column: span 6 !important; }
    .chart-card { grid-column: span 12 !important; }
    .side-card  { grid-column: span 12 !important; }
    .full-width-card { grid-column: span 12 !important; }

    .search-bar { display: none; }
    .header-right::before { display: none; }
}

/* ── Mobile (max 768px) ── */
@media (max-width: 768px) {
    /* Content */
    .content-area {
        padding: 16px;
        overflow-x: hidden;
    }
    .dashboard-grid { gap: 14px; }

    /* Header */
    header {
        padding: 0 16px;
        height: 72px;
    }
    .page-title { font-size: 1rem; }
    .header-right { gap: 10px; }
    .header-right::before { display: none; }
    .search-bar  { display: none; }
    .user-info   { display: none; }
    .user-profile { padding: 4px; }
    .toggle-btn { width: 34px; height: 34px; font-size: 1rem; }
    .icon-btn { width: 34px; height: 34px; font-size: 1rem; }

    /* KPI Cards – 2-column grid on mobile */
    .kpi-card {
        grid-column: span 6 !important;
        padding: 12px !important;
        gap: 8px !important;
    }
    .kpi-title  { font-size: 0.72rem !important; }
    .kpi-value  { font-size: 1.15rem !important; margin: 4px 0 !important; }
    .kpi-icon   { width: 28px !important; height: 28px !important; font-size: 0.8rem !important; }

    /* Charts & sections – full width */
    .chart-card, .side-card {
        grid-column: span 12 !important;
        padding: 16px !important;
    }
    .full-width-card { grid-column: span 12 !important; padding: 16px !important; }

    /* Tables – horizontal scroll on small screens */
    .doc-table-wrapper,
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table th, .data-table td { padding: 10px 12px; font-size: 0.8rem; }

    /* Off-Canvas – full width on mobile */
    .offcanvas-panel {
        max-width: 100% !important;
        border-left: none !important;
    }
    .offcanvas-header { padding: 16px 20px; }
    .offcanvas-body   { padding: 16px 20px; }
    .offcanvas-footer { padding: 14px 20px; }

    /* Approval section */
    .approval-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }
    .approval-actions-wrapper {
        flex-wrap: wrap;
        gap: 8px;
    }
    .approval-search-container { flex-grow: 1; }
    .approval-search-container input { width: 100%; }

    /* Nav item hover – no translateX on touch devices */
    .nav-item:hover { transform: none; }
}

/* ── Small Mobile (max 576px) ── */
@media (max-width: 576px) {
    header { height: 64px; }
    .page-title { font-size: 0.9rem; }
    .avatar { width: 32px; height: 32px; border-radius: 10px; }

    /* Hide notification badge label, keep icon */
    .icon-btn .badge { font-size: 0.55rem; padding: 1px 4px; }

    /* KPI values tighter */
    .kpi-card  { grid-column: span 6 !important; padding: 10px !important; }
    .kpi-value { font-size: 1rem !important; }
    .kpi-title { font-size: 0.68rem !important; line-height: 1.2; }

    /* Approval action buttons: icon-only on tiny screens */
    .btn-action-reject span,
    .btn-action-approve span,
    .btn-refresh span { display: none; }
    .btn-action-reject,
    .btn-action-approve,
    .btn-refresh { padding: 8px; }

    .card-title  { font-size: 0.95rem; }
    .data-table th, .data-table td { padding: 8px 10px; font-size: 0.75rem; }
}

/* ── Very Small Mobile (max 480px) ── */
@media (max-width: 480px) {
    /* Single-column KPI cards on very narrow screens */
    .kpi-card { grid-column: span 12 !important; }
    .content-area { padding: 12px; }
    .dashboard-grid { gap: 12px; }
}

/* Login Page Styles */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: var(--bg-main);
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-header {
    text-align: center;
    margin-bottom: 10px;
}

.login-header .logo-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    margin: 0 auto 16px;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.2s ease, 
                background 0.2s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.login-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 20px;
}

.login-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ─── MODAL & BANK CARDS ─── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-main);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title { font-size: 1.25rem; font-weight: 600; color: var(--text-main); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.25rem; cursor: pointer; }
.modal-close:hover { color: var(--text-main); }
.modal-body { padding: 24px; overflow-y: auto; }

/* ─── Premium Off-Canvas Panel Styles ─── */
.offcanvas-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1100;
    opacity: 0;
    display: none;
    transition: opacity 0.3s ease;
}
.offcanvas-backdrop.show {
    opacity: 1;
}

.offcanvas-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    width: 100%;
    max-width: 750px;
    background: #ffffff;
    box-shadow: -15px 0 45px rgba(15, 23, 42, 0.08);
    z-index: 1101;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Left Gradient Accent Line for Depth */
    border-left: 4px solid transparent;
    border-image: linear-gradient(180deg, var(--accent-indigo) 0%, var(--accent-blue) 100%) 1;
}
.offcanvas-panel.show {
    transform: translateX(0);
}

.offcanvas-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}
.offcanvas-title {
    font-size: 1.4rem;
    font-weight: 750;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}
.offcanvas-title i {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-indigo);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}
.offcanvas-close {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.offcanvas-close:hover {
    background: var(--bg-glass-hover);
    color: var(--text-main);
    transform: rotate(90deg);
}

.offcanvas-body {
    padding: 32px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Slick Custom Scrollbar for Drawer Body */
.offcanvas-body::-webkit-scrollbar {
    width: 5px;
}
.offcanvas-body::-webkit-scrollbar-track {
    background: transparent;
}
.offcanvas-body::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}
.offcanvas-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-indigo);
}

/* Staggered Slide-up Children Entry Animations */
@keyframes offcanvasContentEntry {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
.offcanvas-panel.show .offcanvas-body > * {
    animation: offcanvasContentEntry 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.offcanvas-panel.show .offcanvas-body > *:nth-child(1) { animation-delay: 0.04s; }
.offcanvas-panel.show .offcanvas-body > *:nth-child(2) { animation-delay: 0.08s; }
.offcanvas-panel.show .offcanvas-body > *:nth-child(3) { animation-delay: 0.12s; }
.offcanvas-panel.show .offcanvas-body > *:nth-child(4) { animation-delay: 0.16s; }
.offcanvas-panel.show .offcanvas-body > *:nth-child(5) { animation-delay: 0.2s; }

/* Sticky Premium Card-style Filter Bar */
.offcanvas-filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    position: sticky;
    top: -32px;
    background: #ffffff;
    padding: 16px 20px !important;
    margin-bottom: 24px !important;
    z-index: 10;
    border: 1px solid var(--border-glass) !important;
    border-radius: 14px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: border-color 0.25s, box-shadow 0.25s;
}
.offcanvas-filter-bar:hover {
    border-color: rgba(99, 102, 241, 0.25) !important;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.04), 0 4px 6px -2px rgba(99, 102, 241, 0.02);
}

.offcanvas-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    background: #ffffff;
}

.offcanvas-panel.wide {
    max-width: 900px;
}
.offcanvas-panel.narrow {
    max-width: 550px;
}

@media (max-width: 768px) {
    .offcanvas-panel {
        max-width: 100% !important;
    }
}

.bank-kpi-card {
    display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 16px;
    border-radius: 12px; background: var(--bg-glass-light); min-height: 140px;
    border: 1px solid var(--border-light); cursor: pointer;
    transition: all var(--transition-fast); margin-bottom: 12px;
}
.bank-kpi-card:hover { background: var(--bg-glass-hover); border-color: var(--border-glass); transform: translateY(-2px); }
.bank-kpi-header { display: flex; justify-content: space-between; align-items: flex-start; }
.bank-kpi-stats {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
    font-size: 0.8rem; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border-light);
}
.bank-kpi-stat-col { display: flex; flex-direction: column; }
.bank-kpi-stat-label { color: var(--text-muted); font-size: 0.65rem; text-transform: uppercase; font-weight:600; letter-spacing:0.5px; }

/* ─── Approval Center Responsive Styles ─── */
.approval-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.approval-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.approval-actions-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.approval-search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 6px 14px;
    transition: all 0.2s;
}

.approval-search-container:focus-within {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
}

.approval-search-container input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    padding-left: 8px;
    width: 140px;
    font-size: 0.9rem;
}

.btn-action-reject {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
                background-color 0.2s ease, 
                border-color 0.2s ease, 
                box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}
.btn-action-reject:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.12);
}
.btn-action-reject:active {
    transform: translateY(0) scale(0.97);
}

.btn-action-approve {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
                background-color 0.2s ease, 
                border-color 0.2s ease, 
                box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}
.btn-action-approve:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.12);
}
.btn-action-approve:active {
    transform: translateY(0) scale(0.97);
}

.btn-action-icon {
    padding: 8px;
    width: 32px;
    height: 32px;
    justify-content: center;
    gap: 0;
}


.btn-refresh {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
                background-color 0.2s ease, 
                border-color 0.2s ease, 
                box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-refresh:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.btn-refresh:active {
    transform: translateY(0) scale(0.97);
}

.approval-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 12px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.approval-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
                background-color 0.2s ease, 
                color 0.2s ease, 
                border-color 0.2s ease,
                box-shadow 0.2s ease;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}
.tab-btn:active {
    transform: translateY(0) scale(0.96);
}
.tab-btn.active {
    background: rgba(59, 130, 246, 0.1) !important;
    color: var(--accent-blue) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    font-weight: 600 !important;
}
.badge-count {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 6px;
}
.tab-btn.active .badge-count {
    background: var(--accent-blue) !important;
    color: white !important;
}
.tab-btn:not(.active) .badge-count {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-muted) !important;
}

@media (max-width: 992px) {
    .approval-header {
        flex-direction: column;
        align-items: stretch;
    }
    .approval-actions-wrapper {
        justify-content: flex-start;
        width: 100%;
    }
    .approval-search-container {
        flex-grow: 1;
    }
    .approval-search-container input {
        width: 100%;
    }
    .btn-action-reject,
    .btn-action-approve,
    .btn-refresh {
        flex-grow: 1;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .close-sidebar-btn {
        display: block !important;
    }
}

@media (max-width: 576px) {
    .btn-action-reject span,
    .btn-action-approve span,
    .btn-refresh span {
        display: none;
    }
    .btn-action-reject,
    .btn-action-approve,
    .btn-refresh {
        padding: 10px;
    }
    
    .approval-tabs {
        gap: 4px;
        padding-bottom: 8px;
        margin-bottom: 16px;
    }
    .tab-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ─── Premium Native Document View Styles ─── */
.doc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--bg-main);
    padding-bottom: 24px;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.doc-modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.doc-modal-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.doc-modal-title i {
    color: var(--accent-indigo);
}
.doc-modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.doc-status-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
}

.doc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 36px;
}
.doc-info-card {
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.doc-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    border-color: rgba(99, 102, 241, 0.2);
}
.doc-info-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.doc-info-icon.blue { background: rgba(59, 130, 246, 0.08); color: var(--accent-blue); }
.doc-info-icon.green { background: rgba(16, 185, 129, 0.08); color: var(--accent-green); }
.doc-info-icon.orange { background: rgba(245, 158, 11, 0.08); color: var(--accent-orange); }
.doc-info-icon.purple { background: rgba(139, 92, 246, 0.08); color: var(--accent-purple); }

.doc-info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.doc-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.8px;
}
.doc-info-value {
    font-size: 1rem;
    font-weight: 650;
    color: var(--text-main);
}

.doc-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.doc-section-title i {
    color: var(--accent-indigo);
}

.doc-table-wrapper {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 32px;
}

.doc-table-wrapper .data-table th {
    position: static;
    background: #f9fafb;
    border-bottom: 2px solid var(--bg-main);
    color: var(--text-main);
    font-weight: 600;
}
.doc-table-wrapper .data-table td {
    border-bottom: 1px solid var(--bg-main);
}
.doc-table-wrapper .data-table tbody tr:hover {
    background: #f9fafb;
}

.doc-summary-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 36px;
}
.doc-summary-box {
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 24px;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}
.doc-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}
.doc-summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    border-top: 2px solid var(--bg-main);
    padding-top: 16px;
    margin-top: 6px;
}

.doc-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    border-top: 2px solid var(--bg-main);
    padding-top: 28px;
    margin-top: 28px;
}

.doc-modal-actions button {
    font-weight: 600;
    padding: 10px 24px !important;
    font-size: 0.9rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.doc-remarks-box, .doc-narrative-box {
    background: #ffffff !important;
    border: 1px solid var(--border-glass) !important;
    border-left: 4px solid var(--accent-indigo) !important;
    border-radius: 12px;
    padding: 20px;
    font-size: 0.925rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.approval-modal-panel {
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 48px;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 24px !important;
}

.approval-modal-close {
    position: absolute;
    top: 36px;
    right: 36px;
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}
.approval-modal-close:hover {
    background: var(--bg-glass-hover);
    color: var(--text-main);
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .approval-modal-panel {
        padding: 24px 20px;
    }
    .approval-modal-close {
        top: 20px;
        right: 20px;
    }
}

/* ─── Approval Center View Switcher ─── */
.view-switcher-group {
    display: inline-flex;
    background: var(--bg-main);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.view-switch-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.view-switch-btn:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.02);
}
.view-switch-btn.active {
    background: #ffffff;
    color: var(--accent-indigo);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* Card View */
.approval-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 8px 0;
}
.approval-card {
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}
.approval-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    border-color: rgba(99, 102, 241, 0.25);
}
.approval-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.approval-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.approval-card-id {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}
.approval-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.approval-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}
.approval-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.approval-card-info i {
    color: var(--accent-indigo);
    width: 14px;
    text-align: center;
}
.approval-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: 4px;
}
.approval-card-amount {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}
.approval-card-actions {
    display: flex;
    gap: 8px;
}

/* Kanban View */
.approval-kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 8px 0;
    overflow-x: auto;
    min-height: 480px;
    align-items: start;
}
.kanban-column {
    background: #f9fafb;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
}
.kanban-column-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
}
.kanban-column-header .badge {
    background: var(--accent-indigo);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.kanban-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 150px;
    padding: 4px 2px;
}

@media (max-width: 1024px) {
    .approval-kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .approval-kanban-board {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   PREMIUM MODERN ANIMATIONS & POLISHING
   ========================================== */

/* Page-Load Entrance Anim */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered entrance for all content elements when dashboards load */
.content-area > * {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-grid > * {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-grid > *:nth-child(1) { animation-delay: 0.02s; }
.dashboard-grid > *:nth-child(2) { animation-delay: 0.04s; }
.dashboard-grid > *:nth-child(3) { animation-delay: 0.06s; }
.dashboard-grid > *:nth-child(4) { animation-delay: 0.08s; }
.dashboard-grid > *:nth-child(5) { animation-delay: 0.10s; }
.dashboard-grid > *:nth-child(6) { animation-delay: 0.12s; }
.dashboard-grid > *:nth-child(7) { animation-delay: 0.14s; }
.dashboard-grid > *:nth-child(8) { animation-delay: 0.16s; }
.dashboard-grid > *:nth-child(9) { animation-delay: 0.18s; }
.dashboard-grid > *:nth-child(10) { animation-delay: 0.20s; }
.dashboard-grid > *:nth-child(11) { animation-delay: 0.22s; }
.dashboard-grid > *:nth-child(12) { animation-delay: 0.24s; }

/* Status Badges & Critical Alerts Pulsing Glimmer */
.status-danger {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
    animation: statusPulseDanger 2.5s infinite ease-in-out;
}
.status-warning {
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
    animation: statusPulseWarning 2.5s infinite ease-in-out;
}

@keyframes statusPulseDanger {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35);
    }
}
@keyframes statusPulseWarning {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
    }
}

/* Custom Scrollbars Styling on Main Area and Sidebar */
.content-area::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.content-area::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.content-area::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}
.content-area::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-indigo);
}

/* ══════════════════════════════════════
   PREMIUM INTERACTIONS & ANIMATIONS
   ══════════════════════════════════════ */

/* Additional background glow lighting */
.bg-glow-3 {
    position: absolute;
    top: 45%;
    left: 25%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, var(--glow-bg) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
}

/* Staggered Slide-up Card Entrance Animation */
@keyframes dashboardCardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dashboard-grid > *,
.kpi-row-5 > *,
.tables-row > *,
.charts-row > * {
    animation: dashboardCardEntrance 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Staggered Delay for grid child elements */
.dashboard-grid > *:nth-child(1), .kpi-row-5 > *:nth-child(1) { animation-delay: 0.03s; }
.dashboard-grid > *:nth-child(2), .kpi-row-5 > *:nth-child(2) { animation-delay: 0.06s; }
.dashboard-grid > *:nth-child(3), .kpi-row-5 > *:nth-child(3) { animation-delay: 0.09s; }
.dashboard-grid > *:nth-child(4), .kpi-row-5 > *:nth-child(4) { animation-delay: 0.12s; }
.dashboard-grid > *:nth-child(5), .kpi-row-5 > *:nth-child(5) { animation-delay: 0.15s; }
.dashboard-grid > *:nth-child(6), .tables-row > *:nth-child(1) { animation-delay: 0.18s; }
.dashboard-grid > *:nth-child(7), .tables-row > *:nth-child(2) { animation-delay: 0.21s; }
.dashboard-grid > *:nth-child(8), .tables-row > *:nth-child(3) { animation-delay: 0.24s; }
.dashboard-grid > *:nth-child(9), .charts-row > *:nth-child(1)  { animation-delay: 0.27s; }
.dashboard-grid > *:nth-child(10), .charts-row > *:nth-child(2) { animation-delay: 0.30s; }
.dashboard-grid > *:nth-child(11) { animation-delay: 0.33s; }
.dashboard-grid > *:nth-child(12) { animation-delay: 0.36s; }

/* Interactive Hover for Table Rows */
.data-table tbody tr {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.data-table tbody tr:hover {
    background: var(--table-hover) !important;
    transform: scale(1.004) translateX(4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.02);
}

/* Interactive Navigation Items */
.nav-item {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.nav-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 3px;
    background: var(--accent-indigo);
    border-radius: 4px;
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-item.active::after,
.nav-item:hover::after {
    transform: scaleY(1);
}

