/* ==========================================================================
   KC FINANCE FINANCIAL MANAGEMENT SYSTEM
   โรงเรียนคำเขื่อนแก้วชนูปถัมภ์
   Theme: Midnight Blue + Vibrant Cyan (เทคโนโลยี ทันสมัย สะอาดตา)
   Supports: Dark Mode (โทนมืด) & Light Mode (โทนสว่าง)
   Layout: Modern Dashboard with Sidebar & Dock (Image 2)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Prompt:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   1. COLOR PALETTES & THEME DEFINITIONS
   ========================================================================== */

:root {
    /* Base Font & Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 60px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
}

/* --------------------------------------------------------------------------
   LIGHT THEME (Default โทนสว่าง: Clean Soft Slate + Cyan)
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"],
[data-bs-theme="light"],
body.light-mode {
    --kc-bg-dark: #f0f4f9;              /* Soft Cool Slate 50 */
    --kc-bg-navy: #e2e8f0;              /* Slate 200 */
    --kc-bg-card: #ffffff;              /* Crisp White Card */
    --kc-bg-card-hover: #f8fafc;
    --kc-card-border: #e2e8f0;
    --kc-border-subtle: #cbd5e1;
    --kc-sidebar-bg: #0f172a;           /* Professional Dark Navy Sidebar for Contrast */
    --kc-topbar-bg: rgba(255, 255, 255, 0.92);
    --kc-footer-bg: #ffffff;

    /* Cyan Primary Accents */
    --kc-cyan: #0284c7;                 /* Deep Sky / Cyan Blue */
    --kc-cyan-hover: #0369a1;
    --kc-cyan-light: #0ea5e9;
    --kc-cyan-glow: rgba(2, 132, 199, 0.2);
    --kc-cyan-soft: rgba(2, 132, 199, 0.08);

    /* Secondary Accents */
    --kc-gold: #d97706;
    --kc-emerald: #059669;
    --kc-rose: #e11d48;
    --kc-blue: #2563eb;

    /* Typography */
    --kc-text-main: #0f172a;
    --kc-text-white: #0f172a;
    --kc-text-light: #1e293b;
    --kc-text-muted: #64748b;
    --kc-text-dim: #94a3b8;

    /* Shadows & Modals */
    --kc-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    --kc-shadow-glow: 0 0 20px rgba(2, 132, 199, 0.12);
    --kc-input-bg: #ffffff;
    --kc-input-border: #cbd5e1;
    --kc-table-header-bg: #f8fafc;
    --kc-table-row-hover: #f1f5f9;
}

/* --------------------------------------------------------------------------
   DARK THEME (โทนมืด: Midnight Blue + Cyan)
   -------------------------------------------------------------------------- */
[data-theme="dark"],
[data-bs-theme="dark"],
body.dark-mode {
    --kc-bg-dark: #090e18;              /* Deep Midnight Dark */
    --kc-bg-navy: #0d1629;              /* Midnight Navy */
    --kc-bg-card: #121c33;              /* Midnight Blue Card */
    --kc-bg-card-hover: #172442;        /* Card Hover */
    --kc-card-border: rgba(255, 255, 255, 0.08);
    --kc-border-subtle: #1c2c4d;
    --kc-sidebar-bg: #0b1326;
    --kc-topbar-bg: rgba(13, 22, 41, 0.88);
    --kc-footer-bg: #080d17;

    /* Cyan Primary Accents (From Theme 4: Midnight Blue + Cyan) */
    --kc-cyan: #00b4d8;                 /* Electric Vibrant Cyan */
    --kc-cyan-hover: #0096c7;
    --kc-cyan-light: #38bdf8;
    --kc-cyan-glow: rgba(0, 180, 216, 0.28);
    --kc-cyan-soft: rgba(0, 180, 216, 0.12);

    /* Secondary Accents */
    --kc-gold: #f59e0b;
    --kc-emerald: #10b981;
    --kc-rose: #f43f5e;
    --kc-blue: #3b82f6;

    /* Typography */
    --kc-text-main: #f8fafc;
    --kc-text-white: #ffffff;
    --kc-text-light: #e2e8f0;
    --kc-text-muted: #94a3b8;
    --kc-text-dim: #64748b;

    /* Shadows & Modals */
    --kc-shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
    --kc-shadow-glow: 0 0 25px rgba(0, 180, 216, 0.2);
    --kc-input-bg: #0a1120;
    --kc-input-border: rgba(255, 255, 255, 0.14);
    --kc-table-header-bg: #0c152a;
    --kc-table-row-hover: rgba(255, 255, 255, 0.035);
}

/* ==========================================================================
   2. GENERAL TYPOGRAPHY & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--kc-bg-dark);
    color: var(--kc-text-main);
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6, .brand-title, .brand-sub, .font-heading {
    font-family: 'Prompt', 'Sarabun', sans-serif;
}

/* ==========================================================================
   3. PUBLIC PORTAL (index.php) - Midnight Blue + Cyan
   ========================================================================== */
.portal-wrapper {
    min-height: 100vh;
    background: radial-gradient(circle at 50% 0%, rgba(0, 180, 216, 0.12) 0%, var(--kc-bg-navy) 45%, var(--kc-bg-dark) 100%);
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .portal-wrapper {
    background: radial-gradient(circle at 50% 0%, #e0f2fe 0%, #f0f4f9 50%, #e2e8f0 100%);
}

[data-theme="light"] .finflow-card .text-white,
[data-theme="light"] .finflow-table .text-white,
[data-theme="light"] .table-custom-navy .text-white,
[data-theme="light"] h5.text-white,
[data-theme="light"] h6.text-white,
[data-theme="light"] .modal-content-navy .text-white,
[data-theme="light"] .login-card .text-white,
[data-bs-theme="light"] .finflow-card .text-white,
[data-bs-theme="light"] .login-card .text-white,
body.light-mode .finflow-card .text-white,
body.light-mode .login-card .text-white {
    color: var(--kc-text-white) !important;
}

[data-theme="light"] .text-white-50,
[data-bs-theme="light"] .text-white-50,
body.light-mode .text-white-50,
.light-mode .text-white-50 {
    color: var(--kc-text-muted) !important;
}

/* Hero Box */
.brand-hero-box {
    background: linear-gradient(180deg, var(--kc-bg-card) 0%, var(--kc-bg-navy) 100%);
    border: 1px solid var(--kc-card-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--kc-shadow-card), 0 0 35px var(--kc-cyan-soft);
    text-align: center;
    max-width: 800px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.brand-hero-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--kc-cyan), transparent);
}

.bank-icon-squircle {
    width: 66px;
    height: 66px;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.2) 0%, rgba(18, 28, 51, 0.8) 100%);
    border: 1.5px solid var(--kc-cyan);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--kc-cyan);
    font-size: 1.9rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35), 0 0 20px var(--kc-cyan-glow);
    margin-bottom: 1.25rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .bank-icon-squircle {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: var(--kc-cyan);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.25);
}

.bank-icon-squircle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px var(--kc-cyan-glow);
}

.hero-main-title {
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--kc-text-white);
    font-size: 1.9rem;
    margin-bottom: 0.35rem;
}

.hero-sub-en {
    color: var(--kc-cyan);
    font-weight: 700;
    letter-spacing: 0.14em;
    font-size: 0.98rem;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 12px var(--kc-cyan-glow);
}

.hero-divider {
    width: 90px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--kc-cyan), transparent);
    margin: 1.25rem auto;
}

.hero-thai-title {
    font-weight: 600;
    font-size: 1.18rem;
    color: var(--kc-text-white);
    margin-bottom: 0.25rem;
}

.hero-school-name {
    color: var(--kc-text-muted);
    font-size: 1rem;
    margin-bottom: 0;
}

/* Stat KPI Cards */
.stat-kpi-card {
    background: var(--kc-bg-card);
    border: 1px solid var(--kc-card-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--kc-shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-kpi-card:hover {
    transform: translateY(-3px);
    border-color: var(--kc-cyan);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 15px var(--kc-cyan-soft);
}

.stat-kpi-card.cyan-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kc-cyan);
}

.stat-kpi-card.gold-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kc-gold);
}

.stat-kpi-card.emerald-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kc-emerald);
}

.stat-kpi-card.blue-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kc-blue);
}

.stat-kpi-card.rose-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kc-rose);
}

.kpi-icon-pill {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: transform 0.2s ease;
}

.kpi-icon-pill:hover {
    transform: scale(1.08);
}

.kpi-icon-cyan { background: var(--kc-cyan-soft); color: var(--kc-cyan); }
.kpi-icon-gold { background: rgba(245, 158, 11, 0.15); color: var(--kc-gold); }
.kpi-icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--kc-emerald); }
.kpi-icon-blue { background: rgba(59, 130, 246, 0.15); color: var(--kc-blue); }
.kpi-icon-rose { background: rgba(244, 63, 94, 0.15); color: var(--kc-rose); }

.kpi-val {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Prompt', sans-serif;
    color: var(--kc-text-white);
    line-height: 1.2;
    margin: 0.4rem 0 0.15rem 0;
}

.kpi-lbl {
    font-size: 0.85rem;
    color: var(--kc-text-muted);
    font-weight: 500;
}

/* ==========================================================================
   4. ADMIN DASHBOARD (admin.php) - Image 2 Layout + Midnight Blue & Cyan
   ========================================================================== */
.admin-layout-body {
    background-color: var(--kc-bg-dark);
    color: var(--kc-text-main);
    overflow-x: hidden;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Fixed Left Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    background: var(--kc-sidebar-bg);
    border-right: 1px solid var(--kc-card-border);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s ease, background 0.25s ease;
}

/* Sidebar Brand Header */
.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--kc-card-border);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.25) 0%, #162444 100%);
    border: 1.5px solid var(--kc-cyan);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kc-cyan);
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--kc-cyan-glow);
}

.brand-text-block {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.brand-sub {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--kc-cyan) 0%, #0077b6 100%);
    padding: 2px 7px;
    border-radius: 9999px;
    box-shadow: 0 2px 8px var(--kc-cyan-glow);
}

/* Sidebar Nav Scroll */
.sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-nav-scroll::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.85rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-item {
    margin-bottom: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.sidebar-link.active,
.sidebar-link.active-parent {
    background: linear-gradient(90deg, var(--kc-cyan-soft) 0%, transparent 100%);
    color: var(--kc-cyan);
    font-weight: 600;
    border-left: 3px solid var(--kc-cyan);
}

.sidebar-icon {
    font-size: 1.05rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon {
    color: var(--kc-cyan);
}

.sidebar-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: #64748b;
}

.sidebar-link[aria-expanded="true"] .sidebar-arrow {
    transform: rotate(180deg);
}

.sidebar-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 0.25rem 0 0.35rem 1.85rem;
    margin: 0;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    gap: 0.5rem;
}

.sidebar-sublink i {
    font-size: 0.45rem;
    color: #64748b;
}

.sidebar-sublink:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-sublink.active {
    color: var(--kc-cyan);
    font-weight: 600;
}

.sidebar-sublink.active i {
    color: var(--kc-cyan);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--kc-card-border);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-footer-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--kc-card-border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-footer-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ffffff;
    padding: 2px;
    object-fit: contain;
}

.sidebar-footer-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-sub {
    font-size: 0.7rem;
    color: var(--kc-text-dim);
    margin: 0;
}

/* Main Content Area */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--kc-bg-dark);
    transition: margin-left 0.25s ease, background 0.25s ease;
}

/* Topbar */
.admin-topbar {
    height: var(--topbar-height);
    background: var(--kc-topbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--kc-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.btn-sidebar-toggle {
    background: transparent;
    border: 1px solid var(--kc-card-border);
    color: var(--kc-text-white);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.term-pill-badge {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--kc-card-border);
    color: var(--kc-text-light);
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

[data-theme="light"] .topbar-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-btn:hover {
    background: var(--kc-cyan-soft);
    border-color: var(--kc-cyan);
    color: var(--kc-cyan);
}

/* Fiscal Year Badge Pill */
.fiscal-year-pill {
    font-size: 0.82rem;
    height: 34px;
    letter-spacing: 0.02em;
    background: rgba(0, 180, 216, 0.08);
    border-color: rgba(0, 180, 216, 0.28) !important;
    color: var(--kc-cyan);
    transition: all 0.2s ease;
}

[data-theme="light"] .fiscal-year-pill {
    background: #e0f2fe;
    border-color: #7dd3fc !important;
    color: #0369a1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .fiscal-year-pill {
    background: rgba(0, 180, 216, 0.12);
    border-color: rgba(0, 180, 216, 0.35) !important;
    color: #38bdf8 !important;
}

/* Theme Toggle Button (🌙 Dark / ☀️ Light) */
.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--kc-card-border);
    color: var(--kc-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-theme="light"] .theme-toggle-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.theme-toggle-btn:hover {
    transform: scale(1.08);
    background: var(--kc-cyan-soft);
    box-shadow: 0 0 12px var(--kc-cyan-glow);
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--kc-card-border);
    color: var(--kc-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

[data-theme="light"] .topbar-icon-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--kc-cyan);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--kc-card-border);
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s ease;
}

[data-theme="light"] .user-profile-badge {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--kc-cyan) 0%, #0077b6 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-name-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--kc-text-white);
}

/* Admin Content Area */
.admin-content-area {
    flex: 1;
    padding: 1.5rem;
}

/* Page Header Breadcrumbs & Action Toolbar */
.page-title-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title-block {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.page-main-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--kc-text-white);
    margin: 0;
}

.page-sub-badge {
    background: var(--kc-cyan-soft);
    color: var(--kc-cyan);
    border: 1px solid var(--kc-cyan);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 9999px;
}

/* Modern Tab Pill Switcher */
.nav-pills-modern {
    background: var(--kc-bg-card);
    border: 1px solid var(--kc-card-border);
    border-radius: 9999px;
    padding: 4px;
    display: inline-flex;
    gap: 4px;
    box-shadow: var(--kc-shadow-card);
}

.nav-pills-modern .nav-link {
    color: var(--kc-text-muted);
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.35rem 1.15rem;
    border-radius: 9999px;
    transition: all 0.15s ease;
    border: none;
}

.nav-pills-modern .nav-link:hover {
    color: var(--kc-cyan);
}

.nav-pills-modern .nav-link.active {
    background: linear-gradient(135deg, var(--kc-cyan) 0%, #0077b6 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px var(--kc-cyan-glow);
}

/* Filter Card / Toolbar */
.filter-card {
    background: var(--kc-bg-card);
    border: 1px solid var(--kc-card-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--kc-shadow-card);
}

/* Tables in Midnight Blue + Cyan Theme */
.table-modern-card {
    background: var(--kc-bg-card);
    border: 1px solid var(--kc-card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--kc-shadow-card);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.table-modern-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--kc-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--kc-table-header-bg);
}

.table-modern-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--kc-text-white);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-custom-navy {
    margin: 0;
    color: var(--kc-text-light);
    border-color: var(--kc-card-border);
}

.table-custom-navy th {
    background: var(--kc-table-header-bg);
    color: var(--kc-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--kc-card-border);
    white-space: nowrap;
}

.table-custom-navy td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--kc-card-border);
}

.table-custom-navy tbody tr:hover {
    background: var(--kc-table-row-hover);
}

/* Modals & Forms */
.modal-content-navy {
    background: var(--kc-bg-card);
    border: 1px solid var(--kc-card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.65);
    color: var(--kc-text-main);
}

.modal-header-navy {
    border-bottom: 1px solid var(--kc-card-border);
    background: var(--kc-table-header-bg);
    padding: 1.15rem 1.5rem;
}

.modal-footer-navy {
    border-top: 1px solid var(--kc-card-border);
    background: var(--kc-table-header-bg);
    padding: 1rem 1.5rem;
}

.form-control-navy, .form-select-navy {
    background: var(--kc-input-bg);
    border: 1px solid var(--kc-input-border);
    color: var(--kc-text-main);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}

.form-control-navy:focus, .form-select-navy:focus {
    background: var(--kc-input-bg);
    border-color: var(--kc-cyan);
    color: var(--kc-text-main);
    box-shadow: 0 0 0 0.2rem var(--kc-cyan-glow);
}

.form-control-navy::placeholder {
    color: var(--kc-text-dim);
}

/* Admin Bottom Status Bar */
.admin-bottom-bar {
    height: 38px;
    background: var(--kc-footer-bg);
    border-top: 1px solid var(--kc-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-size: 0.75rem;
    color: var(--kc-text-dim);
}

/* Collapsed Sidebar on Desktop */
.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-text-block,
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-heading,
.sidebar-collapsed .sidebar-arrow,
.sidebar-collapsed .sidebar-badge,
.sidebar-collapsed .sidebar-submenu,
.sidebar-collapsed .sidebar-footer {
    display: none !important;
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.65rem 0;
}

.sidebar-collapsed .sidebar-icon {
    margin: 0;
    font-size: 1.15rem;
}

.sidebar-collapsed .admin-main {
    margin-left: var(--sidebar-collapsed-width);
}

/* Responsive Breakpoints */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .admin-sidebar.show-sidebar {
        transform: translateX(0);
    }
    
    .admin-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1035;
    }
    
    .admin-sidebar-overlay.show-overlay {
        display: block;
    }
    
    .admin-main {
        margin-left: 0 !important;
    }
}
