/* ================================================================
   WebManager — Design System
   Font: Inter (Google Fonts)
   Icons: Font Awesome 6
   Theme: Light sidebar, warm neutral palette
   ================================================================ */

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

/* ----------------------------------------------------------------
   CSS CUSTOM PROPERTIES (Design Tokens)
   ---------------------------------------------------------------- */
:root {
    /* Primary — Indigo */
    --primary:        #4F46E5;
    --primary-hover:  #4338CA;
    --primary-50:     #EEF2FF;
    --primary-100:    #E0E7FF;
    --primary-200:    #C7D2FE;

    /* Semantic Colors */
    --success:      #16A34A;
    --success-50:   #F0FDF4;
    --success-100:  #DCFCE7;
    --warning:      #D97706;
    --warning-50:   #FFFBEB;
    --warning-100:  #FEF3C7;
    --danger:       #DC2626;
    --danger-50:    #FEF2F2;
    --danger-100:   #FEE2E2;
    --info:         #0284C7;
    --info-50:      #F0F9FF;
    --info-100:     #E0F2FE;

    /* Neutral Palette */
    --gray-50:   #F9FAFB;
    --gray-100:  #F3F4F6;
    --gray-200:  #E5E7EB;
    --gray-300:  #D1D5DB;
    --gray-400:  #9CA3AF;
    --gray-500:  #6B7280;
    --gray-600:  #4B5563;
    --gray-700:  #374151;
    --gray-800:  #1F2937;
    --gray-900:  #111827;

    /* Layout */
    --sidebar-width:  256px;
    --header-height:  60px;

    /* Background */
    --bg-body:    #F3F4F6;
    --bg-card:    #FFFFFF;
    --bg-sidebar: #FFFFFF;

    /* Text */
    --text-primary:   #111827;
    --text-secondary: #6B7280;
    --text-muted:     #9CA3AF;

    /* Border */
    --border:       #E5E7EB;
    --border-input: #D1D5DB;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius:    10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadow */
    --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
    --shadow:     0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.04);
    --shadow-md:  0 4px 8px rgba(0,0,0,.07), 0 12px 24px rgba(0,0,0,.05);
    --shadow-lg:  0 10px 20px rgba(0,0,0,.08), 0 24px 40px rgba(0,0,0,.06);
    --shadow-focus: 0 0 0 3px rgba(79,70,229,.15);

    /* Transition */
    --transition: 150ms ease;
    --transition-md: 250ms ease;
}

/* ----------------------------------------------------------------
   RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ----------------------------------------------------------------
   APP LAYOUT
   ---------------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ----------------------------------------------------------------
   SIDEBAR
   ---------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform var(--transition-md);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-md);
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

.sidebar-toggle-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--gray-700);
    background: var(--gray-100);
    border: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:active {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-200);
}

.sidebar-toggle-btn i {
    pointer-events: none;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.logo-mark {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 12px 0;
}

.nav-section {
    margin-bottom: 6px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .7px;
    padding: 10px 8px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 2px;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}

.nav-link.active .nav-icon {
    color: var(--primary);
}

.nav-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--gray-400);
    transition: color var(--transition);
    flex-shrink: 0;
}

.nav-link:hover .nav-icon {
    color: var(--gray-600);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    transition: background var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.user-card:hover { background: var(--gray-100); }

.user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 600;
    flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-name {
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--text-muted); }

/* ----------------------------------------------------------------
   MAIN CONTENT
   ---------------------------------------------------------------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
    width: 100%;
    box-sizing: border-box;
}

/* ----------------------------------------------------------------
   PAGE HEADER
   ---------------------------------------------------------------- */
.page-header {
    min-height: 68px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.page-header-title-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.content-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
    flex-wrap: wrap;
}

.content-breadcrumb a {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: color var(--transition);
    font-weight: 500;
}

.content-breadcrumb a:hover {
    color: var(--primary);
}

.content-breadcrumb .breadcrumb-home {
    font-size: 12px;
    color: var(--gray-400);
}

.content-breadcrumb .sep {
    color: var(--gray-300);
    font-size: 8.5px;
    display: inline-flex;
    align-items: center;
}

.content-breadcrumb .current {
    color: var(--gray-600);
    font-weight: 500;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-top: 2px;
    margin-bottom: 0;
    font-weight: 400;
}

.page-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.header-right-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.header-user-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions-mobile {
    display: none;
}

.header-nav-divider {
    width: 1px;
    height: 26px;
    background: var(--border);
    margin: 0 4px;
}

/* Header Dropdowns */
.header-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Notification Icon Button */
.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border);
    color: #4B5563;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all var(--transition);
}

.header-icon-btn i {
    color: #F59E0B;
}

.header-icon-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.06);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #EF4444;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(239,68,68,0.3);
    animation: pulse 2s infinite;
}

/* Header User Profile Button */
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 3px 12px 3px 4px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all var(--transition);
}

.header-user-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.06);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px var(--primary-100);
}

.header-user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-chevron {
    font-size: 10px;
    color: #9CA3AF;
    transition: transform var(--transition);
}

.header-dropdown.show .header-user-chevron {
    transform: rotate(180deg);
}

/* Dropdown Popover */
.dropdown-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.04);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.header-dropdown.show .dropdown-popover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Notification Popover Specifics */
.notif-popover {
    width: 350px;
    max-width: 90vw;
}

.dropdown-popover-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.popover-title {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-primary);
}

.popover-badge {
    background: var(--primary-50);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.notif-empty i {
    font-size: 24px;
    color: #D1D5DB;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid #F3F4F6;
    text-decoration: none;
    transition: background var(--transition);
    position: relative;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: #F8FAFC;
}

.notif-item.unread {
    background: var(--primary-50);
}

.notif-item.unread:hover {
    background: var(--primary-100);
}

.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    flex-shrink: 0;
}

.notif-icon-danger  { background: #FEE2E2; color: #DC2626; }
.notif-icon-warning { background: #FEF3C7; color: #D97706; }
.notif-icon-info    { background: var(--primary-50); color: var(--primary); }

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.notif-item-desc {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.4;
}

.notif-item-time {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.notif-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-shrink: 0;
}

.notif-read-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: #9CA3AF;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
}

.notif-item:hover .notif-read-btn {
    opacity: 1;
}

.notif-read-btn:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-100);
}

.notif-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.dropdown-popover-footer {
    padding: 10px 18px;
    background: #F9FAFB;
    border-top: 1px solid var(--border);
    text-align: center;
}

.notif-mark-read-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background var(--transition);
}

.notif-mark-read-btn:hover {
    background: var(--primary-50);
}

/* Profile Popover Specifics */
.profile-popover {
    width: 280px;
    max-width: 90vw;
}

.profile-card-top {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    padding: 24px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: 2px solid rgba(255,255,255,0.6);
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.profile-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.profile-card-role {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    margin-top: 2px;
}

.profile-card-biz {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    margin-top: 4px;
}

.profile-card-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.profile-menu-item {
    padding: 12px 10px;
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border-right: 1px solid var(--border);
    transition: background var(--transition);
}

.profile-menu-item:last-child {
    border-right: none;
}

.profile-menu-item:hover {
    background: #F8FAFC;
}

.profile-menu-item i {
    font-size: 15px;
}

.profile-card-footer {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    gap: 10px;
}

/* ----------------------------------------------------------------
   CONTENT AREA
   ---------------------------------------------------------------- */
.content-area {
    flex: 1;
    padding: 24px 28px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* ----------------------------------------------------------------
   CARDS
   ---------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
    font-size: 13px;
}

.card-body { padding: 20px; }
.card-body-lg { padding: 24px; }
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ----------------------------------------------------------------
   STAT CARDS (Dashboard)
   ---------------------------------------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: box-shadow var(--transition-md), transform var(--transition-md);
    min-width: 0;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.stat-icon.indigo  { background: var(--primary-50);  color: var(--primary); }
.stat-icon.green   { background: var(--success-50);  color: var(--success); }
.stat-icon.amber   { background: var(--warning-50);  color: var(--warning); }
.stat-icon.red     { background: var(--danger-50);   color: var(--danger); }
.stat-icon.sky     { background: var(--info-50);     color: var(--info); }

.stat-info { 
    flex: 1; 
    min-width: 0; 
}
.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 3px;
    line-height: 1.3;
}
.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: break-word;
}
.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.3;
}

/* ----------------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-input);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover:not(:disabled) {
    background: #15803D;
    box-shadow: 0 4px 12px rgba(22,163,74,.3);
    transform: translateY(-1px);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: #B91C1C;
    box-shadow: 0 4px 12px rgba(220,38,38,.3);
    transform: translateY(-1px);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) { background: #B45309; color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 11px 22px; font-size: 15px; border-radius: var(--radius-md); }
.btn-icon {
    padding: 7px; width: 34px; height: 34px;
    border-radius: var(--radius-sm);
}
.btn-icon.btn-sm { width: 28px; height: 28px; padding: 5px; font-size: 11px; }

/* ----------------------------------------------------------------
   BADGES
   ---------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary   { background: var(--primary-100); color: var(--primary); }
.badge-success   { background: var(--success-100); color: var(--success); }
.badge-warning   { background: var(--warning-100); color: var(--warning); }
.badge-danger    { background: var(--danger-100);  color: var(--danger); }
.badge-info      { background: var(--info-100);    color: var(--info); }
.badge-secondary { background: var(--gray-100);    color: var(--gray-600); }

.project-url-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--primary);
    background: var(--primary-50);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--primary-100);
}

.project-url-badge:hover {
    background: var(--primary-100);
    color: var(--primary-hover);
    border-color: var(--primary-200);
}

/* ----------------------------------------------------------------
   FORMS
   ---------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    line-height: 1.5;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--gray-50);
    color: var(--text-muted);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

select.form-control { cursor: pointer; }

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.form-row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, 1fr);
}
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Input with icon */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group .input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}
.input-group .form-control { padding-left: 36px; }
.input-group .input-icon-right {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 14px;
}
.input-group .form-control.has-right-icon { padding-right: 36px; }

/* ----------------------------------------------------------------
   TABLES
   ---------------------------------------------------------------- */
.table-wrapper,
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block;
    box-sizing: border-box;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.table-wrapper::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 3px;
    width: 3px;
}
.table-wrapper::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}
.table-wrapper::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 999px;
}
.table-wrapper::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 10px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

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

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

.table .td-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Invoice Table Input Fields */
.item-qty {
    text-align: center;
    min-width: 70px;
    padding: 8px 6px;
    font-weight: 500;
}

.item-unit {
    text-align: center;
    min-width: 70px;
    padding: 8px 6px;
}

.item-price {
    min-width: 130px;
    padding: 8px 10px;
    font-weight: 500;
}

/* Make number spinner subtle and comfortable */
input[type="number"].item-qty::-webkit-inner-spin-button,
input[type="number"].item-qty::-webkit-outer-spin-button {
    opacity: 0.75;
    height: 24px;
}

/* ----------------------------------------------------------------
   PAGINATION
   ---------------------------------------------------------------- */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.pagination-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pagination-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-item {
    display: inline-block;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    user-select: none;
}

.pagination-link:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--primary);
}

.pagination-item.active .pagination-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px var(--primary-100);
}

.pagination-item.disabled .pagination-link {
    color: var(--text-muted);
    background: var(--gray-50);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-item.ellipsis .pagination-link {
    border: none;
    background: transparent;
    cursor: default;
    color: var(--text-muted);
}

/* ----------------------------------------------------------------
   PROGRESS BAR
   ---------------------------------------------------------------- */
.progress {
    height: 6px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), #7C3AED);
    transition: width .4s ease;
}

.progress-bar.success { background: linear-gradient(90deg, var(--success), #22D3A3); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #F97316); }
.progress-bar.danger  { background: linear-gradient(90deg, var(--danger),  #F472B6); }

/* ----------------------------------------------------------------
   MODAL
   ---------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-md);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    transform: scale(.96) translateY(8px);
    transition: transform var(--transition-md);
}

.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 380px; }

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

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ----------------------------------------------------------------
   ALERTS / FLASH MESSAGES
   ---------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert i { font-size: 15px; margin-top: 1px; flex-shrink: 0; }

.alert-success { background: var(--success-50); border-color: #BBF7D0; color: #166534; }
.alert-error   { background: var(--danger-50);  border-color: #FECACA; color: #991B1B; }
.alert-warning { background: var(--warning-50); border-color: #FDE68A; color: #92400E; }
.alert-info    { background: var(--info-50);    border-color: #BAE6FD; color: #075985; }

/* ----------------------------------------------------------------
   TOAST NOTIFICATIONS
   ---------------------------------------------------------------- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-900);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    min-width: 260px;
    max-width: 360px;
    pointer-events: all;
    transform: translateX(120%);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}

.toast.show { transform: translateX(0); }

.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-text { flex: 1; }
.toast.toast-success .toast-icon { color: #4ADE80; }
.toast.toast-error   .toast-icon { color: #F87171; }
.toast.toast-warning .toast-icon { color: #FCD34D; }
.toast.toast-info    .toast-icon { color: #60A5FA; }

/* ----------------------------------------------------------------
   EMPTY STATE
   ---------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 16px;
    color: var(--gray-300);
}

.empty-state-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 13.5px;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto 20px;
    line-height: 1.7;
}

/* ----------------------------------------------------------------
   SEARCH & FILTER BAR
   ---------------------------------------------------------------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.search-input-wrapper input {
    padding-left: 36px;
}

/* ----------------------------------------------------------------
   TABS (CLEAN WHITE PILL / CARD DESIGN)
   ---------------------------------------------------------------- */
.tabs-nav-wrapper {
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.tabs-nav-wrapper::-webkit-scrollbar {
    height: 4px;
}
.tabs-nav-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.tabs-nav-wrapper::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 999px;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    min-width: max-content;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: #64748B;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.15s ease;
    user-select: none;
}

.tab-btn i {
    font-size: 13.5px;
    color: #94A3B8;
    transition: color 0.15s ease;
}

.tab-btn:hover:not(.active) {
    color: #0F172A;
    background: #FFFFFF;
    border-color: #E2E8F0;
}

.tab-btn:hover:not(.active) i {
    color: #475569;
}

.tab-btn.active {
    color: var(--primary, #4F46E5);
    background: #FFFFFF;
    border-color: #CBD5E1;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tab-btn.active i {
    color: var(--primary, #4F46E5);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}


/* ----------------------------------------------------------------
   GRID LAYOUTS
   ---------------------------------------------------------------- */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
    max-width: 100%;
}

.detail-grid > *,
.dashboard-grid > *,
.info-grid > *,
.invoice-form-grid > * {
    min-width: 0;
    max-width: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    max-width: 100%;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 100%;
}

.invoice-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
    max-width: 100%;
}

.invoice-totals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 100%;
}

.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 100%;
}
@media (max-width: 860px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

.stat-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    max-width: 100%;
}

.detail-item { margin-bottom: 14px; }
.detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 3px;
}
.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

/* ----------------------------------------------------------------
   LOGIN PAGE
   ---------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body, #F3F4F6);
    padding: 24px;
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--radius-xl, 16px);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* ----------------------------------------------------------------
   PRINT STYLES (Invoice)
   ---------------------------------------------------------------- */
@media print {
    .sidebar, .page-header, .btn, .breadcrumb { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
    body { background: white !important; font-size: 12px; }
    .card { border: none !important; box-shadow: none !important; }
}

/* ----------------------------------------------------------------
   SCROLLBAR
   ---------------------------------------------------------------- */
* {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .invoice-form-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 100;
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    .sidebar-toggle-btn {
        display: inline-flex;
    }
    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    .detail-grid,
    .dashboard-grid,
    .info-grid,
    .invoice-form-grid,
    .invoice-totals-grid,
    .account-grid,
    .form-responsive-grid,
    .form-responsive-grid-3,
    .form-row {
        grid-template-columns: 1fr !important;
    }
    .stat-grid,
    .stat-grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .stat-card {
        position: relative;
        padding: 12px 12px 12px 14px;
        display: block;
        min-height: auto;
    }
    .stat-icon {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        border-radius: 7px;
        font-size: 12px;
        margin: 0;
    }
    .stat-info {
        width: 100%;
        min-width: 0;
    }
    .stat-label {
        font-size: 11.5px;
        line-height: 1.25;
        margin-bottom: 2px;
        padding-right: 28px;
    }
    .stat-value {
        font-size: 15px;
        font-weight: 700;
        line-height: 1.2;
        word-break: break-word;
        overflow-wrap: break-word;
        margin-top: 1px;
    }
    .stat-sub {
        font-size: 10.5px;
        line-height: 1.25;
        margin-top: 2px;
    }
    .content-area {
        padding: 14px 12px;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .card {
        max-width: 100%;
        box-sizing: border-box;
    }
    .page-header {
        padding: 10px 14px;
        display: flex;
        align-items: center;
        min-height: 52px;
    }
    .page-header-main {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 10px;
    }
    .page-header-left {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
    }
    .sidebar-toggle-btn {
        margin-top: 0;
        flex-shrink: 0;
    }
    .page-header-title-box {
        flex: 1;
        min-width: 0;
    }
    .page-title {
        font-size: 16px;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .page-subtitle {
        font-size: 11.5px;
        margin-top: 1px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .breadcrumb {
        font-size: 11px;
        margin-bottom: 4px;
    }
    .header-right-nav {
        margin-left: auto;
        flex-shrink: 0;
    }
    .header-actions-desktop {
        display: none !important;
    }
    .header-nav-divider-desktop {
        display: none !important;
    }
    .header-user-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .header-user-btn {
        padding: 3px 8px 3px 4px;
        gap: 6px;
    }
    .header-user-name {
        max-width: 90px;
    }
    .header-actions-mobile {
        display: flex !important;
        width: 100%;
        gap: 8px;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        margin-bottom: 14px;
        margin-top: 0;
    }
    .header-actions-mobile .btn {
        flex: 0 0 auto;
        width: auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 14px;
        font-size: 12.5px;
        font-weight: 600;
        border-radius: 8px;
        white-space: nowrap;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    .header-nav-divider {
        display: none;
    }
    .notif-popover, .profile-popover {
        right: -10px;
        max-width: 92vw;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .filter-bar .search-input-wrapper {
        width: 100% !important;
        min-width: 0 !important;
    }
    .filter-bar select {
        width: 100% !important;
        min-width: 0 !important;
    }
    .card-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }
    .card-header .card-title {
        font-size: 13.5px;
    }
    .card-header .btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    .card-body {
        padding: 14px 12px;
    }
    .card-body-lg {
        padding: 16px 14px;
    }
    .detail-item {
        margin-bottom: 12px;
    }
    .detail-value {
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 480px) {
    .header-user-name { display: none; }
    .header-user-btn { padding: 3px 6px 3px 3px; }
    .header-actions-mobile {
        gap: 6px;
    }
    .header-actions-mobile .btn {
        padding: 6px 10px;
        font-size: 11.5px;
    }
    .card-header {
        padding: 10px 12px;
    }
    .card-body {
        padding: 12px 10px;
    }
    .stat-grid,
    .stat-grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }
    .stat-card {
        position: relative;
        padding: 10px 10px 10px 12px;
        display: block;
        min-height: auto;
    }
    .stat-icon {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 25px;
        height: 25px;
        border-radius: 6px;
        font-size: 11px;
        margin: 0;
    }
    .stat-label {
        font-size: 11px;
        line-height: 1.2;
        margin-bottom: 2px;
        padding-right: 26px;
    }
    .stat-value {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
        word-break: break-word;
        overflow-wrap: break-word;
        margin-top: 1px;
    }
    .stat-sub {
        font-size: 10px;
        line-height: 1.2;
        margin-top: 2px;
    }
    .login-card { padding: 28px 24px; }
}

/* ----------------------------------------------------------------
   UTILITIES
   ---------------------------------------------------------------- */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-danger    { color: var(--danger) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.text-info      { color: var(--info) !important; }

.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

.fs-11 { font-size: 11px !important; }
.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }
.fs-14 { font-size: 14px !important; }
.fs-16 { font-size: 16px !important; }
.fs-18 { font-size: 18px !important; }
.fs-20 { font-size: 20px !important; }
.fs-24 { font-size: 24px !important; }

.d-flex        { display: flex !important; }
.align-center  { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-end   { justify-content: flex-end !important; }
.flex-1        { flex: 1 !important; }
.gap-4   { gap: 4px !important; }
.gap-6   { gap: 6px !important; }
.gap-8   { gap: 8px !important; }
.gap-10  { gap: 10px !important; }
.gap-12  { gap: 12px !important; }
.gap-16  { gap: 16px !important; }

.mb-0  { margin-bottom: 0 !important; }
.mb-4  { margin-bottom: 4px !important; }
.mb-8  { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-24 { margin-bottom: 24px !important; }
.mt-4  { margin-top: 4px !important; }
.mt-8  { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-24 { margin-top: 24px !important; }
.ms-auto { margin-left: auto !important; }

.p-0   { padding: 0 !important; }
.p-8   { padding: 8px !important; }
.p-12  { padding: 12px !important; }
.p-16  { padding: 16px !important; }
.p-20  { padding: 20px !important; }

.w-full { width: 100% !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }

.rounded { border-radius: var(--radius) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.border-top { border-top: 1px solid var(--border) !important; }
.pt-16 { padding-top: 16px !important; }

.opacity-50 { opacity: .5; }

/* Loading spinner */
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* Page fade in */
.content-area {
    animation: fadeIn .2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
