/* Inventory Management System UI styles */

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

/* Design Tokens */
:root {
    /* Surfaces */
    --bg:            #F1F5F9;
    --surface:       #FFFFFF;
    --surface-raised:#FFFFFF;
    --surface-inset: #F8FAFC;

    /* Primary – Indigo */
    --primary:        #4F46E5;
    --primary-hover:  #4338CA;
    --primary-active: #3730A3;
    --primary-light:  #EEF2FF;
    --primary-muted:  #818CF8;
    --primary-ring:   rgba(79,70,229,0.18);

    /* Semantic colours */
    --success:        #059669;
    --success-light:  #ECFDF5;
    --success-ring:   rgba(5,150,105,0.15);
    --warning:        #D97706;
    --warning-light:  #FFFBEB;
    --warning-ring:   rgba(217,119,6,0.15);
    --danger:         #DC2626;
    --danger-light:   #FEF2F2;
    --danger-ring:    rgba(220,38,38,0.15);
    --info:           #0284C7;
    --info-light:     #F0F9FF;
    --info-ring:      rgba(2,132,199,0.15);
    --purple:         #7C3AED;
    --purple-light:   #F5F3FF;
    --teal:           #0D9488;
    --teal-light:     #F0FDFA;
    --orange:         #EA580C;
    --orange-light:   #FFF7ED;
    --gold:           #B45309;
    --gold-light:     #FFFBEB;

    /* Text */
    --text:           #0F172A;
    --text-muted:     #64748B;
    --text-subtle:    #94A3B8;
    --text-inverse:   #FFFFFF;

    /* Borders */
    --border:         #E2E8F0;
    --border-strong:  #CBD5E1;
    --border-focus:   var(--primary);

    /* Sidebar */
    --sidebar-bg:        #0F172A;
    --sidebar-border:    rgba(255,255,255,0.06);
    --sidebar-text:      rgba(255,255,255,0.60);
    --sidebar-text-hover:rgba(255,255,255,0.92);
    --sidebar-icon:      rgba(255,255,255,0.45);
    --sidebar-active-bg: rgba(79,70,229,0.18);
    --sidebar-active:    #A5B4FC;
    --sidebar-active-icon:#818CF8;
    --sidebar-section:   rgba(255,255,255,0.30);
    --sidebar-w:         256px;
    --topbar-h:          60px;

    /* Shadows */
    --shadow-xs:  0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm:  0 1px 3px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md:  0 4px 6px -1px rgba(15,23,42,0.07), 0 2px 4px -1px rgba(15,23,42,0.04);
    --shadow-lg:  0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -2px rgba(15,23,42,0.04);
    --shadow-xl:  0 20px 25px -5px rgba(15,23,42,0.10), 0 8px 10px -5px rgba(15,23,42,0.04);

    /* Radii */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 9999px;

    /* Transitions */
    --t-fast:   0.12s ease;
    --t:        0.18s ease;
    --t-slow:   0.28s ease;

    /* legacy aliases kept for backward compat */
    --navy:      var(--primary);
    --navy-dark: var(--primary-hover);
    --transition:var(--t);
}

/* ── Base Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.01em;
}
p { color: var(--text-muted); }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-hover); }

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), width var(--t-slow);
    overflow-x: hidden;
    overflow-y: hidden;
    will-change: transform;
}

/* Brand / Logo Area */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.125rem;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
    flex-shrink: 0;
}
.sidebar-logo {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,0.40);
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.brand-main {
    color: var(--text-inverse);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-sub {
    color: var(--sidebar-text);
    font-size: 0.68rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.625rem 0;
}
.sidebar-nav::-webkit-scrollbar { width: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.10);
    border-radius: 2px;
}

.sidebar-section-header {
    padding: 1rem 1.125rem 0.3rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sidebar-section);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.125rem;
    margin: 0.5px 0.625rem;
    border-radius: var(--r-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-link i {
    width: 17px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--sidebar-icon);
    flex-shrink: 0;
    transition: color var(--t-fast);
}
.sidebar-link span { overflow: hidden; text-overflow: ellipsis; }
.sidebar-link:hover {
    background: rgba(255,255,255,0.07);
    color: var(--sidebar-text-hover);
}
.sidebar-link:hover i { color: rgba(255,255,255,0.70); }
.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
}
.sidebar-link.active i { color: var(--sidebar-active-icon); }

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem 0.625rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar-footer .sidebar-link { margin: 0; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 1039;
}

/* ─── Collapsed sidebar ─── */
body.sidebar-collapsed .sidebar { width: 62px; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0 0; }
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-section-header,
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-footer-text { display: none; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding: 0.55rem; margin: 0.5px 0.5rem; }
body.sidebar-collapsed .sidebar-link i { width: auto; font-size: 0.9rem; }
body.sidebar-collapsed .page-main { margin-left: 62px; }
body.sidebar-collapsed .topbar { left: 62px; }
body.sidebar-collapsed .sidebar-logo { margin: auto; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE -- SIDEBAR OFF-CANVAS (< 1200px)
═══════════════════════════════════════════════════════════ */

/* ── Tablets, split-screen desktops, phones ─────────────── */
@media (max-width: 1199px) {

    /* Lock body scroll while sidebar is open */
    body.sidebar-open { overflow: hidden; }

    /* Off-canvas: slide sidebar fully off-screen by default */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4,0,0.2,1),
                    width var(--t-slow);
    }

    /* Open state -- slide back in */
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,0.25);
    }

    /* Overlay fades in when active */
    .sidebar-overlay {
        display: block;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    }
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        transition: opacity 0.25s ease, visibility 0s linear 0s;
    }

    /* Remove all desktop left-offset from layout elements */
    .topbar {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }
    .page-main {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: var(--topbar-h);
    }

    /* On mobile, ignore the desktop collapsed state completely */
    body.sidebar-collapsed .sidebar  { width: var(--sidebar-w) !important; transform: translateX(-100%); }
    body.sidebar-collapsed .sidebar.mobile-open { transform: translateX(0); }
    body.sidebar-collapsed .topbar,
    body.sidebar-collapsed .page-main { left: 0 !important; margin-left: 0 !important; }

    /* Content padding */
    .page-content { padding: 1.25rem; }
    .kpi-value { font-size: 1.4rem; }
}

/* ── Desktop only: sidebar always visible, no overlay ─────── */
@media (min-width: 1200px) {
    .sidebar { transform: none !important; }
    .sidebar-overlay { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════════ */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 0.75rem;
    z-index: 1030;
    transition: left var(--t-slow);
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    background: none;
    border: none;
    border-radius: var(--r-sm);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-toggle-btn:hover { background: var(--bg); color: var(--text); }

/* Breadcrumb */
.breadcrumb {
    margin: 0;
    font-size: 0.775rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
}
.breadcrumb-item { color: var(--text-subtle); }
.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    color: var(--border-strong);
    padding: 0 0.35rem;
    font-size: 0.7rem;
}
.breadcrumb-item a { color: var(--text-muted); font-weight: 500; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text); font-weight: 500; }
.breadcrumb-item i { font-size: 0.8rem; }

.topbar-spacer { flex: 1; }

/* Topbar icon buttons */
.topbar-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: none;
    border: none;
    border-radius: var(--r-sm);
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    transition: background var(--t-fast), color var(--t-fast);
}
.topbar-icon-btn:hover { background: var(--bg); color: var(--text); }

/* Notification badge */
.notif-badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 17px; height: 17px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: var(--r-full);
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--surface);
    line-height: 1;
}

/* Notification dropdown */
.notif-dropdown {
    min-width: 340px;
    max-width: 380px;
    border: 1px solid var(--border) !important;
    border-radius: var(--r-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    padding: 0 !important;
    overflow: hidden;
}
.notif-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-inset);
}
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--t-fast);
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: var(--text);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-inset); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #E0E7FF; }
.notif-title { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.notif-msg { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 0.68rem; color: var(--text-subtle); margin-top: 3px; }
.notif-footer {
    padding: 0.625rem 1rem;
    background: var(--surface-inset);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.78rem;
}

/* User menu button */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.625rem;
    background: none;
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    color: var(--text);
    font-size: 0.8rem;
    transition: background var(--t-fast);
}
.user-menu-btn:hover { background: var(--bg); }
.user-menu-btn .fa-chevron-down { font-size: 0.625rem; color: var(--text-subtle); }

.user-avatar-sm {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: var(--r-full);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-name-mini { font-weight: 600; font-size: 0.8rem; color: var(--text); line-height: 1.2; }
.user-role-mini { font-size: 0.68rem; color: var(--text-muted); line-height: 1.2; }

/* Dropdown menu */
.dropdown-menu {
    border: 1px solid var(--border) !important;
    border-radius: var(--r-md) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0.375rem !important;
    min-width: 200px;
}
.dropdown-item {
    border-radius: var(--r-sm) !important;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem !important;
    color: var(--text) !important;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast) !important;
}
.dropdown-item:hover { background: var(--bg) !important; }
.dropdown-item.text-danger:hover { background: var(--danger-light) !important; color: var(--danger) !important; }
.dropdown-item i { width: 16px; text-align: center; }
.dropdown-header { padding: 0.625rem 0.75rem; font-size: 0.78rem; color: var(--text-muted); }
.dropdown-divider { margin: 0.25rem 0; border-color: var(--border); }

/* ═══════════════════════════════════════════════════════════
   PAGE LAYOUT
═══════════════════════════════════════════════════════════ */
.main-wrapper { display: flex; }

.page-main {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: calc(100% - var(--sidebar-w));
    transition: margin-left var(--t-slow), width var(--t-slow);
}
body.sidebar-collapsed .page-main { width: calc(100% - 62px); }

.page-content {
    flex: 1;
    padding: 1.75rem 1.75rem 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.875rem;
}
.page-header-left { display: flex; flex-direction: column; gap: 0.25rem; }
.page-title {
    font-size: 1.225rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}
.page-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 400;
}
.page-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Page Footer */
.page-footer {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.73rem;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   KPI / STAT CARDS
═══════════════════════════════════════════════════════════ */
.kpi-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    padding: 1.25rem 1.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--t), transform var(--t);
    text-decoration: none;
    color: inherit;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Icon row */
.kpi-card .kpi-icon {
    width: 42px; height: 42px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* Color variants */
.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}
.kpi-card .kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}
.kpi-card .kpi-data { display: flex; flex-direction: column; }

/* Color variants for kpi icons */
.kpi-blue  .kpi-icon { background: var(--primary-light); color: var(--primary); }
.kpi-green .kpi-icon { background: var(--success-light); color: var(--success); }
.kpi-orange .kpi-icon { background: var(--orange-light); color: var(--orange); }
.kpi-red   .kpi-icon { background: var(--danger-light);  color: var(--danger); }
.kpi-purple .kpi-icon { background: var(--purple-light); color: var(--purple); }
.kpi-teal  .kpi-icon { background: var(--teal-light);   color: var(--teal); }
.kpi-yellow .kpi-icon { background: var(--warning-light);color: var(--warning); }
.kpi-gold  .kpi-icon { background: var(--gold-light);   color: var(--gold); }

/* Top indicator line variants */
.kpi-blue  { border-top: 3px solid var(--primary); }
.kpi-green { border-top: 3px solid var(--success); }
.kpi-orange { border-top: 3px solid var(--orange); }
.kpi-red   { border-top: 3px solid var(--danger); }
.kpi-purple { border-top: 3px solid var(--purple); }
.kpi-teal  { border-top: 3px solid var(--teal); }
.kpi-yellow { border-top: 3px solid var(--warning); }
.kpi-gold  { border-top: 3px solid var(--gold); }

/* ═══════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--r-lg) !important;
    box-shadow: var(--shadow-xs);
    overflow: visible;
}
.card-header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1rem 1.25rem !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
}
.card-header-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.card-header-title i { font-size: 0.85rem; color: var(--text-muted); }
.card-body { padding: 1.25rem; }
.card-footer {
    background: var(--surface-inset) !important;
    border-top: 1px solid var(--border) !important;
    padding: 0.875rem 1.25rem !important;
}

/* Section card variant -- for form sections */
.card-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.card-section-header {
    background: var(--surface-inset);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-section-body { padding: 1.25rem; }

/* ═══════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════ */
.table {
    font-size: 0.8125rem;
    color: var(--text);
    border-color: var(--border);
    margin-bottom: 0;
}
.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
    border-bottom-color: var(--border);
    vertical-align: middle;
}
.table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--surface-inset);
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
    padding: 0.625rem 1rem;
}
.table tbody tr { transition: background var(--t-fast); }
.table-hover tbody tr:hover { background: var(--bg); }
.table-responsive {
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.table-responsive > .table {
    min-width: 100%;
}

/* Dark-navy themed table header */
.table-dark-navy thead th {
    background: var(--primary) !important;
    color: #ffffff !important;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: none !important;
    white-space: nowrap;
}

/* DataTables overrides */
div.dataTables_wrapper { padding: 0; }
div.dataTables_wrapper div.dataTables_filter input {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
div.dataTables_wrapper div.dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    outline: none;
}
div.dataTables_wrapper div.dataTables_length select {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--surface);
}
div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_length label,
div.dataTables_wrapper div.dataTables_filter label { font-size: 0.78rem; color: var(--text-muted); }
div.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--r-sm) !important;
    font-size: 0.78rem !important;
    padding: 0.25rem 0.6rem !important;
    border: none !important;
}
div.dataTables_wrapper .dataTables_paginate .paginate_button.current,
div.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border: none !important;
}
div.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg) !important;
    color: var(--text) !important;
}
div.dataTables_wrapper .dt-buttons .btn {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.75rem !important;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: var(--r-sm);
    padding: 0.45rem 0.9rem;
    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.01em;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 2px; }

/* Primary */
.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(79,70,229,0.20);
}
.btn-primary:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: 0 2px 8px rgba(79,70,229,0.30);
}

/* Outline primary */
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    background: transparent !important;
}
.btn-outline-primary:hover {
    background: var(--primary-light) !important;
    color: var(--primary-hover) !important;
}

/* Danger */
.btn-danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}
.btn-danger:hover { background: #B91C1C !important; border-color: #B91C1C !important; }

.btn-outline-danger {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
    background: transparent !important;
}
.btn-outline-danger:hover { background: var(--danger-light) !important; }

/* Secondary */
.btn-secondary {
    background: var(--text-muted) !important;
    border-color: var(--text-muted) !important;
    color: #fff !important;
}
.btn-secondary:hover { background: #475569 !important; border-color: #475569 !important; }

.btn-outline-secondary {
    color: var(--text-muted) !important;
    border-color: var(--border-strong) !important;
    background: var(--surface) !important;
}
.btn-outline-secondary:hover { background: var(--bg) !important; border-color: var(--border-strong) !important; }

/* Success */
.btn-success { background: var(--success) !important; border-color: var(--success) !important; color: #fff !important; }
.btn-success:hover { background: #047857 !important; }
.btn-outline-success { color: var(--success) !important; border-color: var(--success) !important; background: transparent !important; }
.btn-outline-success:hover { background: var(--success-light) !important; }

/* Warning */
.btn-warning { background: var(--warning) !important; border-color: var(--warning) !important; color: #fff !important; }
.btn-warning:hover { background: #B45309 !important; }

/* Info */
.btn-info { background: var(--info) !important; border-color: var(--info) !important; color: #fff !important; }
.btn-outline-info { color: var(--info) !important; border-color: var(--info) !important; background: transparent !important; }
.btn-outline-info:hover { background: var(--info-light) !important; }

/* Light */
.btn-light {
    background: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
.btn-light:hover { background: var(--border) !important; }

/* Sizes */
.btn-sm  { padding: 0.3rem 0.65rem; font-size: 0.75rem; border-radius: var(--r-xs); gap: 0.3rem; }
.btn-lg  { padding: 0.65rem 1.25rem; font-size: 0.9375rem; border-radius: var(--r-md); }
.btn-xs  { padding: 0.18rem 0.5rem; font-size: 0.7rem; border-radius: var(--r-xs); gap: 0.25rem; }

/* Icon-only button */
.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: var(--r-sm);
}
.btn-icon.btn-sm { width: 28px; height: 28px; }

/* ═══════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════ */
.badge {
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    padding: 0.3em 0.65em;
    border-radius: var(--r-xs);
}
/* Custom soft badges */
.badge-soft-primary { background: var(--primary-light); color: var(--primary); }
.badge-soft-success { background: var(--success-light); color: var(--success); }
.badge-soft-warning { background: var(--warning-light); color: var(--warning); }
.badge-soft-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-soft-info    { background: var(--info-light);    color: var(--info); }
.badge-soft-purple  { background: var(--purple-light);  color: var(--purple); }
.badge-soft-teal    { background: var(--teal-light);    color: var(--teal); }

/* ═══════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════ */
.form-label {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text);
    margin-bottom: 0.35rem;
    display: block;
}
.required-label::after { content: ' *'; color: var(--danger); }

.form-control,
.form-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 0.8125rem;
    font-family: inherit;
    padding: 0.5rem 0.75rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    line-height: 1.5;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    outline: none;
    background: var(--surface);
    color: var(--text);
}
.form-control::placeholder { color: var(--text-subtle); }
.form-control-sm, .form-select-sm { padding: 0.35rem 0.65rem; font-size: 0.775rem; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-ring); }
.form-control.is-valid { border-color: var(--success); }
.form-control.is-valid:focus { box-shadow: 0 0 0 3px var(--success-ring); }
.invalid-feedback { font-size: 0.75rem; color: var(--danger); }
.valid-feedback { font-size: 0.75rem; color: var(--success); }
.form-text { font-size: 0.73rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Input group */
.input-group .form-control:focus { z-index: 3; }
.input-group-text {
    background: var(--surface-inset);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
}

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

/* Checkbox / Radio */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-check-input:focus { box-shadow: 0 0 0 3px var(--primary-ring); }
.form-check-label { font-size: 0.8125rem; color: var(--text); }

/* Form section dividers */
.section-sub-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   ALERTS / FLASH MESSAGES
═══════════════════════════════════════════════════════════ */
.alert {
    border-radius: var(--r-md);
    border-width: 0;
    border-left: 4px solid transparent;
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: #065f46; border-left-color: var(--success); }
.alert-danger,
.alert-error   { background: var(--danger-light); color: #7f1d1d; border-left-color: var(--danger); }
.alert-warning { background: var(--warning-light); color: #7c2d12; border-left-color: var(--warning); }
.alert-info    { background: var(--info-light); color: #0c4a6e; border-left-color: var(--info); }
.alert-flash   { margin-bottom: 1.25rem; }
.alert .btn-close { width: 24px; height: 24px; background-size: 12px; margin-left: auto; padding: 0; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════ */
.modal-content {
    border: none !important;
    border-radius: var(--r-xl) !important;
    box-shadow: var(--shadow-xl) !important;
    overflow: hidden;
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border) !important;
    background: var(--surface);
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.modal-header .btn-close { width: 28px; height: 28px; }
.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border) !important;
    background: var(--surface-inset);
    gap: 0.5rem;
}
.modal-backdrop { backdrop-filter: blur(4px); }
.modal-backdrop.show { opacity: 0.6; }

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════════════════ */
#toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 380px;
    pointer-events: none;
}
.toast-notif {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
    overflow: hidden;
    pointer-events: all;
    animation: toastIn 0.28s cubic-bezier(0.21,1.02,0.73,1) forwards;
    min-width: 300px;
}
.toast-notif.toast-hide {
    animation: toastOut 0.22s ease-in forwards;
}
.toast-notif-body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
}
.toast-notif-icon {
    width: 34px; height: 34px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.toast-notif-content { flex: 1; min-width: 0; }
.toast-notif-title { font-size: 0.8125rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.toast-notif-msg { font-size: 0.775rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.toast-notif-close {
    background: none;
    border: none;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-subtle);
    cursor: pointer;
    border-radius: var(--r-xs);
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 0;
    transition: background var(--t-fast), color var(--t-fast);
}
.toast-notif-close:hover { background: var(--bg); color: var(--text); }
.toast-notif-progress {
    height: 3px;
    background: var(--border);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.toast-notif-progress-bar {
    height: 100%;
    border-radius: 0 0 var(--r-lg) 0;
    transition: width linear;
}

/* Toast variants */
.toast-success .toast-notif-icon { background: var(--success-light); color: var(--success); }
.toast-success .toast-notif-progress-bar { background: var(--success); }
.toast-success { border-left: 4px solid var(--success); }
.toast-error .toast-notif-icon { background: var(--danger-light); color: var(--danger); }
.toast-error .toast-notif-progress-bar { background: var(--danger); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning .toast-notif-icon { background: var(--warning-light); color: var(--warning); }
.toast-warning .toast-notif-progress-bar { background: var(--warning); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info .toast-notif-icon { background: var(--info-light); color: var(--info); }
.toast-info .toast-notif-progress-bar { background: var(--info); }
.toast-info { border-left: 4px solid var(--info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); max-height: 200px; margin-bottom: 0.625rem; }
    to   { opacity: 0; transform: translateX(60px); max-height: 0; margin-bottom: 0; padding: 0; }
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
}
.empty-state-icon {
    width: 64px; height: 64px;
    border-radius: var(--r-xl);
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem;
    color: var(--text-subtle);
    margin-bottom: 1.25rem;
}
.empty-state-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.375rem;
}
.empty-state-desc { font-size: 0.8125rem; color: var(--text-muted); max-width: 320px; }

/* ═══════════════════════════════════════════════════════════
   WARRANTY / STATUS COMPONENTS
═══════════════════════════════════════════════════════════ */
.warranty-list { divide-y: 1px solid var(--border); }
.warranty-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--t-fast);
    gap: 0.75rem;
}
.warranty-item:last-child { border-bottom: none; }
.warranty-item:hover { background: var(--surface-inset); }
.warranty-info { flex: 1; min-width: 0; }
.warranty-name { font-size: 0.8125rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warranty-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.warranty-badge .badge { font-size: 0.7rem; }

.warranty-status-bar {
    padding: 0.5rem 0.875rem;
    border-radius: var(--r-md);
    font-size: 0.78rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.warranty-status-bar.valid    { background: var(--success-light); color: var(--success); border: 1px solid rgba(5,150,105,0.2); }
.warranty-status-bar.expiring { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }
.warranty-status-bar.expired  { background: var(--danger-light);  color: var(--danger);  border: 1px solid rgba(220,38,38,0.2); }

/* ═══════════════════════════════════════════════════════════
   ACTIVITY FEED
═══════════════════════════════════════════════════════════ */
.activity-feed { padding: 0; }
.activity-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
    transition: background var(--t-fast);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--surface-inset); }
.activity-avatar {
    width: 30px; height: 30px;
    border-radius: var(--r-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 0.7875rem; color: var(--text); line-height: 1.4; }
.activity-text strong { color: var(--text); }
.activity-time { font-size: 0.68rem; color: var(--text-subtle); margin-top: 2px; }
.activity-dot {
    width: 8px; height: 8px;
    background: var(--primary-muted);
    border-radius: var(--r-full);
    flex-shrink: 0;
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════
   DETAIL / SHOW PAGES
═══════════════════════════════════════════════════════════ */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem 1.5rem;
}
.detail-item { display: flex; flex-direction: column; gap: 0.2rem; }
.detail-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
}
.detail-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}
.xsmall { font-size: 0.68rem; }

/* Document items */
.doc-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}
.doc-item:last-child { border-bottom: none; }
.doc-icon { color: var(--primary); font-size: 1rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   STATUS BADGES (consistent across the app)
═══════════════════════════════════════════════════════════ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25em 0.7em;
    border-radius: var(--r-full);
}
.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.status-active    { background: var(--success-light); color: var(--success); }
.status-available { background: var(--success-light); color: var(--success); }
.status-issued    { background: var(--info-light); color: var(--info); }
.status-repair    { background: var(--warning-light); color: var(--warning); }
.status-faulty    { background: var(--danger-light); color: var(--danger); }
.status-condemned { background: #F1F5F9; color: var(--text-muted); }
.status-pending   { background: var(--warning-light); color: var(--warning); }
.status-completed { background: var(--success-light); color: var(--success); }

/* ═══════════════════════════════════════════════════════════
   FILTER PANEL
═══════════════════════════════════════════════════════════ */
.filter-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    background: var(--surface-inset);
    border-bottom: 1px solid var(--border);
    user-select: none;
    transition: background var(--t-fast);
}
.filter-panel-header:hover { background: var(--bg); }
.filter-panel-title { font-size: 0.78rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.filter-panel-body { padding: 1rem 1.25rem; display: none; }
.filter-panel.open .filter-panel-body { display: block; }
.filter-panel .chevron-icon { transition: transform var(--t); color: var(--text-muted); font-size: 0.75rem; }
.filter-panel.open .chevron-icon { transform: rotate(180deg); }

/* ═══════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════ */
.pagination { gap: 0.25rem; }
.page-link {
    border-radius: var(--r-sm) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem !important;
    transition: all var(--t-fast);
    background: var(--surface);
}
.page-link:hover { background: var(--bg); color: var(--primary); border-color: var(--primary) !important; }
.page-item.active .page-link { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff; }
.page-item.disabled .page-link { opacity: 0.45; }

/* ═══════════════════════════════════════════════════════════
   AUTH LAYOUT
═══════════════════════════════════════════════════════════ */
.auth-body { background: var(--bg); }
.auth-wrapper { min-height: 100vh; display: flex; }

/* Left brand panel */
.auth-brand-panel {
    width: 460px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}
.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(79,70,229,0.12);
}
.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(79,70,229,0.08);
}
.auth-brand-content { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-emblem {
    width: 62px; height: 62px;
    background: var(--primary);
    border-radius: var(--r-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.625rem;
    color: #fff;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 20px rgba(79,70,229,0.45);
}
.auth-brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}
.auth-brand-subtitle { font-size: 0.85rem; color: rgba(255,255,255,0.55); line-height: 1.6; }
.auth-brand-features { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.72);
}
.auth-feature-item i { color: #818CF8; font-size: 0.875rem; width: 16px; text-align: center; }
.auth-brand-footer {
    position: relative; z-index: 1;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    margin-top: auto;
    padding-top: 1.5rem;
}

/* Right form panel */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg);
}
.auth-form-inner { width: 100%; max-width: 440px; }
.auth-emblem-sm {
    width: 44px; height: 44px;
    background: var(--primary);
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    margin: 0 auto;
}
.auth-card {
    background: var(--surface);
    border-radius: var(--r-xl);
    padding: 2.25rem 2.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.auth-card-header { margin-bottom: 1.75rem; }
.auth-card-title { font-size: 1.375rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; margin-bottom: 0.3rem; }
.auth-card-subtitle { font-size: 0.8125rem; color: var(--text-muted); }
.auth-footer-text { font-size: 0.73rem; color: var(--text-subtle); line-height: 1.5; }

/* btn for judiciary = btn-primary large */
.btn-judiciary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(79,70,229,0.30) !important;
}
.btn-judiciary:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 4px 14px rgba(79,70,229,0.40) !important;
}

/* ═══════════════════════════════════════════════════════════
   MISC COMPONENTS
═══════════════════════════════════════════════════════════ */

/* Dashboard chart container */
.chart-container { position: relative; min-height: 200px; }

/* Topbar search */
.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
}
.topbar-search-input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 0.375rem 0.875rem 0.375rem 2.25rem;
    font-size: 0.78rem;
    color: var(--text);
    width: 220px;
    transition: all var(--t);
    font-family: inherit;
}
.topbar-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    width: 280px;
    background: var(--surface);
}
.topbar-search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-subtle);
    font-size: 0.75rem;
    pointer-events: none;
}

/* Loading spinner overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--border) 0%, var(--bg) 50%, var(--border) 100%);
    background-size: 200% 100%;
    border-radius: var(--r-sm);
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══════════════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════════════ */
.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-subtle    { color: var(--text-subtle) !important; }
.text-navy      { color: var(--primary) !important; }
.bg-navy        { background-color: var(--primary) !important; }
.bg-surface     { background-color: var(--surface) !important; }
.bg-inset       { background-color: var(--surface-inset) !important; }
.border-top-0   { border-top: none !important; }
.rounded-sm     { border-radius: var(--r-sm) !important; }
.rounded-md     { border-radius: var(--r-md) !important; }
.rounded-lg     { border-radius: var(--r-lg) !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fs-xs  { font-size: 0.7rem !important; }
.fs-sm  { font-size: 0.78rem !important; }
.divider { border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── Accessibility ─────────────────────────────────────────── */
.skip-nav {
    position: absolute; left: -9999px; top: 0; z-index: 9999;
    background: var(--primary); color: #fff;
    padding: 0.5rem 1rem; border-radius: 0 0 var(--r-sm) 0;
}
.skip-nav:focus { left: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Small screens ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .auth-brand-panel { display: none !important; }
    .auth-card { padding: 1.5rem 1.25rem; }
    .page-header { flex-direction: column; align-items: stretch; }
    .page-title { font-size: 1.05rem; }
    .topbar-search-input { display: none; }
    .topbar { padding: 0 0.75rem; }
    .page-content { padding: 1rem 0.9rem 1.5rem; }
    .table-responsive { margin: 0 -0.9rem; padding: 0 0.9rem; }
    #toast-container { right: 0.75rem; left: 0.75rem; max-width: none; }
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .btn, .pagination, .no-print,
    .sidebar-overlay, .filter-panel .filter-panel-header,
    .page-actions, .page-footer,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate,
    .dataTables_wrapper .dt-buttons,
    .modal { display: none !important; }
    .main-wrapper { display: block !important; }
    .page-main { margin-left: 0 !important; padding-top: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; break-inside: avoid; border-radius: 0 !important; }
    .table { font-size: 9pt; }
    /* Show all DataTable rows including those hidden by pagination */
    table.dataTable tbody tr { display: table-row !important; }
    /* Prevent cell content from overflowing / being clipped */
    td, th { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; word-break: break-word; }
    body { background: #fff !important; color: #000 !important; font-size: 10pt; }
    a[href]:after { content: none !important; }
    .print-header { display: block !important; }
}
.print-header { display: none; }

/* ── Notification list rows (used in notifications/index.php) ── */
.notif-row { transition: background var(--t-fast); }
.notif-row:hover { background: var(--surface-inset); }
.notif-unread { background: var(--primary-light); }
.notif-icon-sm { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; margin-top: 2px; }

/* ── Flash alerts ───────────────────────────────────────────── */
.flash-alert { border-radius: 8px; font-size: 0.82rem; }

