/*
 * ITMS — Warm Editorial UI
 * Professional ERP — colour carries meaning, not decoration.
 * Redesigned 2026 · Nine Star Steel Investment Ltd., Zambia
 */

/* ╔══════════════════════════════════════════════╗
   ║  CSS CUSTOM PROPERTIES                       ║
   ╚══════════════════════════════════════════════╝ */
:root {
    /* Brand accent — warm terracotta */
    --primary:          #d97757;
    --primary-hover:    #c25e3f;
    --primary-light:    #fbece4;
    --primary-gradient: linear-gradient(135deg, #e08a63 0%, #d97757 100%);
    --primary-glow:     rgba(217,119,87,0.22);

    /* Semantic status — warm-tuned (carry document workflow meaning) */
    --success:          #4e8a5b;
    --success-light:    #eaf1ea;
    --success-gradient: linear-gradient(135deg, #4e8a5b 0%, #6aad78 100%);
    --warning:          #c8862f;
    --warning-light:    #f8efdd;
    --warning-gradient: linear-gradient(135deg, #c8862f 0%, #dfa045 100%);
    --danger:           #c24b3f;
    --danger-light:     #f8e9e6;
    --danger-gradient:  linear-gradient(135deg, #c24b3f 0%, #d96358 100%);
    --info:             #5b7e96;
    --info-light:       #eaeff3;
    --info-gradient:    linear-gradient(135deg, #5b7e96 0%, #7599b0 100%);
    --teal:             #4e8a8a;
    --teal-light:       #eaf3f3;
    --rose:             #c24b3f;
    --rose-light:       #f8e9e6;
    --amber:            #c8862f;
    --violet:           #8a6ee0;
    --violet-light:     #f0ecfc;

    /* Surfaces — warm off-white canvas, white cards */
    --bg-body:   #f9f8f6;
    --bg-card:   #ffffff;
    --bg-navbar: #ffffff;
    --bg-hover:  #f0efea;
    --bg-input:  #ffffff;
    --bg-muted:  #f4f2ee;

    /* Sidebar — light white with hairline border (Notion/Linear style) */
    --bg-sidebar:        #ffffff;
    --bg-sidebar-active: #fbece4;
    --bg-sidebar-hover:  #f4f2ee;

    /* Text — warm near-blacks, never pure #000 */
    --text-primary:         #242322;
    --text-secondary:       #76736f;
    --text-muted:           #a8a49f;
    --text-sidebar:         #76736f;
    --text-sidebar-heading: rgba(168,164,159,0.80);
    --text-sidebar-active:  #d97757;

    /* Borders — warm hairlines */
    --border-color: #e5e3df;
    --border-light: #efeeea;

    /* Elevation — softer, lower-contrast */
    --shadow-xs:     0 1px 2px rgba(20,24,33,0.04);
    --shadow-sm:     0 1px 2px rgba(20,24,33,0.05), 0 1px 1px rgba(20,24,33,0.03);
    --shadow-md:     0 2px 6px -1px rgba(20,24,33,0.07), 0 1px 3px -1px rgba(20,24,33,0.05);
    --shadow-lg:     0 8px 20px -6px rgba(20,24,33,0.10), 0 4px 8px -4px rgba(20,24,33,0.05);
    --shadow-xl:     0 16px 36px -8px rgba(20,24,33,0.14);
    --shadow-colored: 0 2px 8px -1px var(--primary-glow);

    /* Layout */
    --sidebar-width:           248px;
    --sidebar-collapsed-width: 72px;
    --navbar-height:           56px;
    --radius:    10px;
    --radius-sm: 7px;
    --radius-xs: 6px;
    --transition:        all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast:   all 0.12s ease;
    --transition-spring: all 0.30s cubic-bezier(0.34, 1.40, 0.64, 1);
}

/* ── Dark mode — warm true-black, no cool blue-greys ── */
[data-bs-theme="dark"] {
    --bg-body:   #1a1918;
    --bg-card:   #2d2b2a;
    --bg-navbar: #211f1e;
    --bg-hover:  #383533;
    --bg-input:  #383533;
    --bg-muted:  #2a2826;

    /* Sidebar in dark — use card surface so it reads as elevated vs body */
    --bg-sidebar:        #2d2b2a;
    --bg-sidebar-active: rgba(217,119,87,0.18);
    --bg-sidebar-hover:  rgba(255,255,255,0.06);

    --text-primary:         #ebe9e4;
    --text-secondary:       #96938f;
    --text-muted:           #6e6b67;
    --text-sidebar:         #96938f;
    --text-sidebar-heading: rgba(168,164,159,0.65);
    --text-sidebar-active:  #e58b63;

    --border-color: #403d3b;
    --border-light: #322f2d;

    --primary-light:  rgba(217,119,87,0.18);
    --success-light:  rgba(78,138,91,0.18);
    --warning-light:  rgba(200,134,47,0.18);
    --danger-light:   rgba(194,75,63,0.18);
    --info-light:     rgba(91,126,150,0.18);
    --teal-light:     rgba(78,138,138,0.18);
    --rose-light:     rgba(194,75,63,0.18);
    --violet-light:   rgba(138,110,224,0.18);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.50);
    --shadow-md: 0 3px 8px rgba(0,0,0,0.55);
    --shadow-lg: 0 10px 24px rgba(0,0,0,0.60);
    --shadow-xl: 0 18px 38px rgba(0,0,0,0.65);
}

/* ╔══════════════════════════════════════════════╗
   ║  RESET & GLOBAL                              ║
   ╚══════════════════════════════════════════════╝ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-hover); }
::selection { background: var(--primary); color: #fff; }

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 99px; opacity: 0.4; }
::-webkit-scrollbar-thumb:hover { opacity: 0.7; }

/* ╔══════════════════════════════════════════════╗
   ║  SIDEBAR — Light Editorial (Notion/Linear)   ║
   ╚══════════════════════════════════════════════╝ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0; top: 0;
    z-index: 1040;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 99px; }

/* Sidebar Brand */
.sidebar-header {
    padding: 0 18px;
    display: flex;
    align-items: center;
    min-height: var(--navbar-height);
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}
.sidebar-brand:hover { color: var(--text-primary); }
.sidebar-brand-icon {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
    flex-shrink: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 16px 14px;
    margin: 0;
    flex: 1;
}
.sidebar-heading {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-sidebar-heading);
    padding: 20px 10px 8px;
    margin: 0;
}
.sidebar-item { margin-bottom: 2px; }
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.8125rem;
    font-weight: 500;
    gap: 11px;
    border: none;
    background: none;
    width: 100%;
    position: relative;
    cursor: pointer;
}
.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.65;
    transition: var(--transition);
}
.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}
.sidebar-link:hover i { opacity: 1; color: var(--text-secondary); }
.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}
.sidebar-link.active i { opacity: 1; color: var(--text-sidebar-active); }

/* ── Sidebar Accordion: Module Buttons ── */
.sidebar-module-item { margin-bottom: 2px; }

.sidebar-module-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--text-sidebar);
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    letter-spacing: 0.01em;
}
.sidebar-module-btn i:first-child {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: var(--transition);
}
.sidebar-module-btn:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}
.sidebar-module-btn:hover i:first-child { opacity: 1; }
.sidebar-module-btn.open {
    background: transparent;
    color: var(--text-primary);
}
.sidebar-module-btn.open i:first-child { opacity: 1; color: var(--primary); }

/* Chevron rotation */
.sidebar-chevron {
    font-size: 0.65rem !important;
    width: auto !important;
    opacity: 0.5 !important;
    transition: transform 0.25s ease !important;
    flex-shrink: 0;
}
.sidebar-module-btn.open .sidebar-chevron {
    transform: rotate(180deg);
    opacity: 0.8 !important;
}

/* Collapsed sidebar: hide chevron and module text */
.sidebar-collapsed .sidebar-module-btn span,
.sidebar-collapsed .sidebar-chevron { display: none; }
.sidebar-collapsed .sidebar-module-btn {
    justify-content: center;
    padding: 11px;
}
.sidebar-collapsed .sidebar-module-btn i:first-child {
    margin: 0;
    font-size: 1.2rem;
}

/* Forms list under each module */
.sidebar-module-forms {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-module-forms.show { max-height: 800px; }
.sidebar-collapsed .sidebar-module-forms { display: none; }

/* Sub-links (form links inside modules) */
.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 7px 12px 7px 36px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.775rem;
    font-weight: 500;
    gap: 9px;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
    margin: 1px 0;
    border-left: 2px solid transparent;
}
.sidebar-sublink i {
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.6;
}
.sidebar-sublink:hover {
    color: var(--text-primary);
    background: var(--bg-sidebar-hover);
    border-left-color: var(--border-color);
    padding-left: 38px;
}
.sidebar-sublink:hover i { opacity: 1; }
.sidebar-sublink.active {
    color: var(--text-sidebar-active);
    background: var(--bg-sidebar-active);
    border-left-color: var(--primary);
    font-weight: 600;
}
.sidebar-sublink.active i { opacity: 1; color: var(--primary); }

/* Collapsed tooltip for sub-links */
.sidebar-collapsed .sidebar-sublink::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: var(--bg-card);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
    margin-left: 10px;
    z-index: 1050;
    box-shadow: var(--shadow-md);
}
.sidebar-collapsed .sidebar-sublink:hover::after { opacity: 1; }
.sidebar-collapsed .sidebar-sublink {
    padding: 9px 12px;
    justify-content: center;
    position: relative;
}
.sidebar-collapsed .sidebar-sublink span { display: none; }
.sidebar-collapsed .sidebar-sublink i {
    font-size: 1rem;
    width: auto;
    margin: 0;
}

/* ╔══════════════════════════════════════════════╗
   ║  MAIN CONTENT & TOP NAVBAR                   ║
   ╚══════════════════════════════════════════════╝ */
/* Sidebar Collapsed */
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
.sidebar-collapsed .sidebar-brand span { display: none; }
.sidebar-collapsed .sidebar-link span { display: none; }
.sidebar-collapsed .sidebar-link { justify-content: center; padding: 11px; }
.sidebar-collapsed .sidebar-link i { margin: 0; font-size: 1.2rem; }
.sidebar-collapsed .sidebar-header { justify-content: center; padding: 18px 10px; }
.sidebar-collapsed .sidebar-brand { justify-content: center; }

#page-content-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    background: var(--bg-body);
}
.sidebar-collapsed #page-content-wrapper {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}
.main-content { flex: 1; padding: 0; }

/* Top Navbar */
.top-navbar {
    height: var(--navbar-height);
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-xs);
}
.top-navbar .btn-icon {
    width: 38px; height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}
.top-navbar .btn-icon:hover {
    background: var(--bg-hover);
    color: var(--primary);
    transform: scale(1.05);
}

/* Company Badge */
.company-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    border: 1px solid transparent;
}
.company-badge:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-colored);
}

/* User Menu */
.navbar-right { display: flex; align-items: center; gap: 6px; }
.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
}
.user-dropdown-btn:hover { background: var(--bg-hover); }
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* ╔══════════════════════════════════════════════╗
   ║  CARDS & STAT CARDS                          ║
   ╚══════════════════════════════════════════════╝ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.9rem;
}
.card-body { padding: 20px; }

/* Dashboard Stat Cards — Vibrant Gradient Icons */
.stat-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0;
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-card:hover::before { opacity: 1; }
.stat-card.stat-primary::before { background: var(--primary-gradient); }
.stat-card.stat-success::before { background: var(--success-gradient); }
.stat-card.stat-warning::before { background: var(--warning-gradient); }
.stat-card.stat-danger::before { background: var(--danger-gradient); }
.stat-card.stat-info::before { background: var(--info-gradient); }
.stat-card.stat-teal::before { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }

.stat-icon {
    width: 50px; height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: var(--transition);
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-3deg); }
.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Quick Action Cards */
.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--primary);
}
.action-card-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition-spring);
}
.action-card:hover .action-card-icon { transform: scale(1.15); }
.action-card-label {
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ╔══════════════════════════════════════════════╗
   ║  TABLES                                      ║
   ╚══════════════════════════════════════════════╝ */
.table { margin-bottom: 0; color: var(--text-primary); }
.table th {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 16px;
    white-space: nowrap;
    background: var(--bg-muted);
}
.table td {
    vertical-align: middle;
    border-color: var(--border-light);
    padding: 11px 16px;
    font-size: 0.875rem;
}
.table-hover tbody tr { transition: var(--transition-fast); }
.table-hover tbody tr:hover { background: var(--bg-hover); }
.table thead.table-light th { background: var(--bg-muted); }

/* ╔══════════════════════════════════════════════╗
   ║  BUTTONS                                     ║
   ╚══════════════════════════════════════════════╝ */
.btn {
    font-weight: 600;
    padding: 9px 18px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--primary);
    border: none;
    color: #fff;
    box-shadow: none;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-colored);
}
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-xs { padding: 4px 8px; font-size: 0.7rem; border-radius: 5px; }
.btn-outline-primary {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

/* ╔══════════════════════════════════════════════╗
   ║  FORMS                                       ║
   ╚══════════════════════════════════════════════╝ */
.form-control, .form-select {
    border-radius: var(--radius-xs);
    border: 1.5px solid var(--border-color);
    padding: 9px 13px;
    font-size: 0.875rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-input);
    color: var(--text-primary);
}
.form-label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.form-text { font-size: 0.72rem; color: var(--text-muted); }
.form-control-sm, .form-select-sm { padding: 6px 10px; font-size: 0.8125rem; }

/* ╔══════════════════════════════════════════════╗
   ║  BADGES, ALERTS, BREADCRUMB                  ║
   ╚══════════════════════════════════════════════╝ */
.badge {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}
.badge-soft-success { background: var(--success-light); color: var(--success); }
.badge-soft-danger { background: var(--danger-light); color: var(--danger); }
.badge-soft-warning { background: var(--warning-light); color: var(--warning); }
.badge-soft-primary { background: var(--primary-light); color: var(--primary); }
.badge-soft-info { background: var(--info-light); color: var(--info); }

.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    padding: 14px 18px;
    border-left: 4px solid;
}
.alert-success { background: var(--success-light); border-left-color: var(--success); color: #065f46; }
.alert-danger { background: var(--danger-light); border-left-color: var(--danger); color: #991b1b; }
.alert-warning { background: var(--warning-light); border-left-color: var(--warning); color: #92400e; }
.alert-info { background: var(--info-light); border-left-color: var(--info); color: #155e75; }
[data-bs-theme="dark"] .alert-success { color: #6ee7b7; }
[data-bs-theme="dark"] .alert-danger { color: #fca5a5; }
[data-bs-theme="dark"] .alert-warning { color: #fcd34d; }
[data-bs-theme="dark"] .alert-info { color: #67e8f9; }

.breadcrumb { background: transparent; padding: 0; margin-bottom: 0; font-size: 0.8rem; }
.breadcrumb-item a { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ╔══════════════════════════════════════════════╗
   ║  FOOTER                                      ║
   ╚══════════════════════════════════════════════╝ */
.footer {
    padding: 14px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ╔══════════════════════════════════════════════╗
   ║  DROPDOWN                                    ║
   ╚══════════════════════════════════════════════╝ */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 6px;
    font-size: 0.875rem;
    animation: dropdownFade 0.15s ease;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
    border-radius: var(--radius-xs);
    padding: 9px 14px;
    color: var(--text-primary);
    transition: var(--transition-fast);
    font-weight: 500;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-header { color: var(--text-muted); font-size: 0.72rem; padding: 6px 14px; }
.dropdown-divider { border-color: var(--border-color); margin: 4px 0; }

/* ╔══════════════════════════════════════════════╗
   ║  MODALS                                      ║
   ╚══════════════════════════════════════════════╝ */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
}
.modal-header { border-radius: var(--radius) var(--radius) 0 0; border-color: var(--border-color); }
.modal-footer { border-color: var(--border-color); }

/* ╔══════════════════════════════════════════════╗
   ║  LOGIN PAGE — Professional Split Screen      ║
   ╚══════════════════════════════════════════════╝ */

/* Outer wrapper — full-height flex row */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-card);
}

/* Left brand panel — warm charcoal with subtle accent glow */
.login-brand {
    flex: 1;
    background: #242322;   /* warm charcoal — same palette as sidebar dark */
    color: #fff;
    padding: 52px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
/* Subtle radial glow using the accent colour — no animation, calm */
.login-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(700px circle at 80% 10%,
        rgba(217,119,87,0.20) 0%,
        transparent 60%
    );
    pointer-events: none;
}
.login-brand > * { position: relative; z-index: 1; }

/* Logo + wordmark */
.login-brand-mark {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: #fff;
}
.login-brand-mark .lbm-icon {
    width: 46px; height: 46px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(217,119,87,0.40);
}

/* Headline — large, uses the full panel width */
.login-brand h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    margin-top: 8px;
    color: #fff;
    max-width: 20ch;
}
.login-brand p {
    color: rgba(255,255,255,0.60);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 44ch;
}

/* Feature bullet list */
.login-points {
    list-style: none;
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.login-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.80);
    font-size: 0.95rem;
}
.login-points li i {
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Brand panel footer */
.login-meta {
    color: rgba(255,255,255,0.35);
    font-size: 0.82rem;
}

/* Right form panel */
.login-form-wrap {
    flex: 0 0 46%;
    max-width: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--bg-card);
}
.login-card {
    width: 100%;
    max-width: 380px;
}

/* Small logo on form side */
.login-logo {
    width: 52px; height: 52px;
    background: var(--primary);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.login-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}
.login-btn {
    padding: 11px 20px;
    font-size: 0.9rem;
    width: 100%;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-xs);
    box-shadow: none;
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.login-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-colored);
}
.login-btn:active { transform: scale(0.97); }
.login-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* Mobile — hide brand panel, full-width form */
@media (max-width: 860px) {
    .login-brand { display: none; }
    .login-form-wrap { flex: 1; max-width: none; padding: 32px 24px; }
}

/* ╔══════════════════════════════════════════════╗
   ║  DASHBOARD — Welcome Banner & Widgets        ║
   ╚══════════════════════════════════════════════╝ */
.welcome-banner {
    background: var(--primary-gradient);
    border-radius: var(--radius);
    padding: 28px 32px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(99,102,241,0.25);
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -40px; right: -20px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -50px; right: 60px;
    width: 140px; height: 140px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.welcome-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.welcome-subtitle { opacity: 0.85; font-size: 0.875rem; }

/* Module Summary Cards (dashboard) */
.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
}
.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.module-card.mod-admin::before { background: var(--primary-gradient); }
.module-card.mod-finance::before { background: var(--success-gradient); }
.module-card.mod-inventory::before { background: var(--warning-gradient); }
.module-card.mod-sales::before { background: var(--info-gradient); }

/* Activity Feed */
.activity-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-hover); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: var(--radius-xs); }
.activity-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

/* ╔══════════════════════════════════════════════╗
   ║  DARK MODE OVERRIDES                         ║
   ╚══════════════════════════════════════════════╝ */
/* All dark mode overrides use CSS variables — no hardcoded hex values */
[data-bs-theme="dark"] body { background: var(--bg-body); color: var(--text-primary); }
[data-bs-theme="dark"] .sidebar { background: var(--bg-sidebar) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .top-navbar { background: var(--bg-navbar) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .card { background: var(--bg-card) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .card-header { border-color: var(--border-light) !important; background: var(--bg-card) !important; color: var(--text-primary); }
[data-bs-theme="dark"] .card-body { background: var(--bg-card); }
[data-bs-theme="dark"] .table { color: var(--text-primary); }
/* table-light catches thead, tfoot totals rows, and any row using the class */
[data-bs-theme="dark"] .table thead.table-light th,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light td,
[data-bs-theme="dark"] .table-light th,
[data-bs-theme="dark"] tr.table-light td,
[data-bs-theme="dark"] tr.table-light th,
[data-bs-theme="dark"] .table-secondary { background: var(--bg-muted) !important; color: var(--text-secondary) !important; }
[data-bs-theme="dark"] .table tfoot td,
[data-bs-theme="dark"] .table tfoot th { background: var(--bg-muted) !important; color: var(--text-primary) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .table td { border-color: var(--border-light); color: var(--text-primary); }
/* readonly inputs and bg-light containers in forms */
[data-bs-theme="dark"] .form-control.bg-light,
[data-bs-theme="dark"] input.bg-light,
[data-bs-theme="dark"] .bg-light { background: var(--bg-muted) !important; color: var(--text-secondary) !important; }
[data-bs-theme="dark"] .table-hover tbody tr:hover { background: var(--bg-hover); }
[data-bs-theme="dark"] .footer { background: var(--bg-navbar) !important; border-color: var(--border-color) !important; color: var(--text-muted); }
/* Buttons */
[data-bs-theme="dark"] .btn-outline-primary { color: var(--primary); border-color: var(--primary); }
[data-bs-theme="dark"] .btn-outline-primary:hover { background: var(--primary); color: #fff; }
[data-bs-theme="dark"] .btn-outline-secondary { color: var(--text-secondary); border-color: var(--border-color); }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }
[data-bs-theme="dark"] .btn-outline-info { color: var(--info); border-color: var(--info); }
[data-bs-theme="dark"] .btn-outline-danger { color: var(--danger); border-color: var(--danger); }
[data-bs-theme="dark"] .btn-outline-warning { color: var(--warning); border-color: var(--warning); }
[data-bs-theme="dark"] .btn-outline-success { color: var(--success); border-color: var(--success); }
[data-bs-theme="dark"] .btn-outline-dark { color: var(--text-secondary); border-color: var(--border-color); }
/* Text */
[data-bs-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-bs-theme="dark"] .text-dark { color: var(--text-primary) !important; }
[data-bs-theme="dark"] .text-secondary { color: var(--text-secondary) !important; }
/* Backgrounds */
[data-bs-theme="dark"] .bg-white { background: var(--bg-card) !important; }
[data-bs-theme="dark"] .bg-light { background: var(--bg-muted) !important; }
[data-bs-theme="dark"] .bg-body { background: var(--bg-body) !important; }
/* Borders */
[data-bs-theme="dark"] .border { border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .border-bottom { border-color: var(--border-light) !important; }
[data-bs-theme="dark"] hr { border-color: var(--border-color); opacity: 1; }
/* Modal */
[data-bs-theme="dark"] .modal-content { background: var(--bg-card); border-color: var(--border-color); }
[data-bs-theme="dark"] .modal-header { background: var(--bg-muted) !important; border-color: var(--border-color); }
[data-bs-theme="dark"] .modal-footer { border-color: var(--border-color); background: var(--bg-card); }
[data-bs-theme="dark"] .modal-body { background: var(--bg-card); }
/* Forms */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background: var(--bg-input) !important;
}
[data-bs-theme="dark"] .form-control[readonly],
[data-bs-theme="dark"] input[readonly] { background: var(--bg-muted) !important; color: var(--text-muted) !important; }
[data-bs-theme="dark"] .input-group-text { background: var(--bg-muted); border-color: var(--border-color); color: var(--text-secondary); }
[data-bs-theme="dark"] .form-label { color: var(--text-secondary); }
/* Dropdown */
[data-bs-theme="dark"] .dropdown-menu { background: var(--bg-card); border-color: var(--border-color); }
[data-bs-theme="dark"] .dropdown-item { color: var(--text-primary); }
[data-bs-theme="dark"] .dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--border-color); }
[data-bs-theme="dark"] .dropdown-header { color: var(--text-muted); }
/* Company badge */
[data-bs-theme="dark"] .company-badge { background: var(--primary-light); color: var(--primary); }
[data-bs-theme="dark"] .company-badge:hover { background: var(--primary); color: #fff; }
/* Alerts */
[data-bs-theme="dark"] .alert-success { background: var(--success-light); color: var(--success); }
[data-bs-theme="dark"] .alert-danger  { background: var(--danger-light);  color: var(--danger); }
[data-bs-theme="dark"] .alert-warning { background: var(--warning-light); color: var(--warning); }
[data-bs-theme="dark"] .alert-info    { background: var(--info-light);    color: var(--info); }
/* Badges */
[data-bs-theme="dark"] .badge.bg-light { background: var(--bg-muted) !important; color: var(--text-primary) !important; }
[data-bs-theme="dark"] .badge.bg-secondary { background: var(--bg-hover) !important; }
/* Login — dark mode */
[data-bs-theme="dark"] .login-page { background: var(--bg-card); }
[data-bs-theme="dark"] .login-form-wrap { background: var(--bg-card); }
[data-bs-theme="dark"] .login-brand { background: #131211; }  /* deeper charcoal in dark */
[data-bs-theme="dark"] .login-card { background: var(--bg-card); }
[data-bs-theme="dark"] .login-title { color: var(--text-primary); }
[data-bs-theme="dark"] .login-subtitle { color: var(--text-secondary); }
[data-bs-theme="dark"] .login-footer { border-color: var(--border-color); color: var(--text-muted); }
/* Breadcrumb */
[data-bs-theme="dark"] .breadcrumb-item.active { color: var(--text-muted); }
[data-bs-theme="dark"] nav[aria-label="breadcrumb"] { background: transparent; }
/* Miscellaneous */
[data-bs-theme="dark"] small, [data-bs-theme="dark"] .small { color: inherit; }
[data-bs-theme="dark"] .card[style*="border-left"] { background: var(--bg-card) !important; }
/* Favourites grid */
[data-bs-theme="dark"] .fav-item { background: var(--bg-card) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .fav-item span { color: var(--text-primary) !important; }
[data-bs-theme="dark"] .fav-item:hover { border-color: var(--primary) !important; background: var(--primary-light) !important; }
[data-bs-theme="dark"] .fav-item.selected { border-color: var(--primary) !important; background: var(--primary-light) !important; }
[data-bs-theme="dark"] #favGrid a { border-color: var(--border-color) !important; background: var(--bg-card) !important; }
[data-bs-theme="dark"] #favGrid a:hover { border-color: var(--primary) !important; background: var(--primary-light) !important; }
[data-bs-theme="dark"] #favGrid .text-dark,
[data-bs-theme="dark"] #favGrid .fw-medium { color: var(--text-primary) !important; }
/* ── Theme Toggle Pill ── */
.theme-toggle-pill {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}
.theme-pill-track {
    display: flex;
    align-items: center;
    width: 52px;
    height: 28px;
    background: #d0d7de;
    border-radius: 99px;
    padding: 2px;
    transition: background 0.3s ease;
    position: relative;
}
[data-bs-theme="dark"] .theme-pill-track {
    background: linear-gradient(135deg, #238636, #2ea043);
}
.theme-pill-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    transform: translateX(0);
    position: relative;
    font-size: 0.75rem;
}
[data-bs-theme="dark"] .theme-pill-thumb {
    transform: translateX(24px);
    background: #161b22;
}
.theme-icon-dark  { color: #57606a; display: block; }
.theme-icon-light { color: #f0e68c; display: none; }
[data-bs-theme="dark"] .theme-icon-dark  { display: none; }
[data-bs-theme="dark"] .theme-icon-light { display: block; color: #fbbf24; }

/* ── Dark mode: Fav-item tiles ── */
[data-bs-theme="dark"] .fav-item {
    background: #1e293b !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: var(--text-primary);
}
[data-bs-theme="dark"] .fav-item span { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .fav-item .rounded-2 { background: rgba(255,255,255,0.06) !important; }
[data-bs-theme="dark"] .fav-item:hover {
    border-color: #6366f1 !important;
    background: rgba(99,102,241,0.15) !important;
}
[data-bs-theme="dark"] .fav-item.selected {
    border-color: #6366f1 !important;
    background: rgba(99,102,241,0.2) !important;
}

/* ── Dark mode: dashboard fav panel tiles ── */
[data-bs-theme="dark"] #favGrid a {
    border-color: rgba(255,255,255,0.08) !important;
    background: #1e293b !important;
}
[data-bs-theme="dark"] #favGrid a:hover {
    border-color: #6366f1 !important;
    background: rgba(99,102,241,0.15) !important;
}
[data-bs-theme="dark"] #favGrid .text-dark { color: #e2e8f0 !important; }
[data-bs-theme="dark"] #favGrid .fw-medium { color: #e2e8f0 !important; }

/* ╔══════════════════════════════════════════════╗
   ║  ANIMATIONS                                  ║
   ╚══════════════════════════════════════════════╝ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in { animation: fadeIn 0.4s ease; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease; }
.animate-slide-in { animation: slideInLeft 0.3s ease; }

/* Staggered card animations */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ╔══════════════════════════════════════════════╗
   ║  RESPONSIVE                                  ║
   ╚══════════════════════════════════════════════╝ */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar-open .sidebar { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,0.3); }
    .sidebar-open .sidebar-overlay { display: block; }
    #page-content-wrapper { margin-left: 0; width: 100%; }
    .sidebar-collapsed #page-content-wrapper { margin-left: 0; width: 100%; }
    .welcome-title { font-size: 1.2rem; }
}
@media (max-width: 575.98px) {
    .login-card { padding: 32px 22px; border-radius: 16px; }
    .top-navbar { padding: 0 14px; }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    backdrop-filter: blur(4px);
}

/* ╔══════════════════════════════════════════════╗
   ║  UTILITY CLASSES                             ║
   ╚══════════════════════════════════════════════╝ */
.cursor-pointer { cursor: pointer; }
.gap-2 { gap: 0.5rem; }
.page-header { margin-bottom: 24px; }
.page-title { font-size: 1.375rem; font-weight: 800; margin-bottom: 2px; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-muted); font-size: 0.8125rem; }

.empty-state {
    text-align: center;
    padding: 52px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 14px; display: block; opacity: 0.3; }
.empty-state p { font-size: 0.875rem; }

/* Fieldset legend (used in forms like ssgroup GL accounts) */
fieldset.border { border-color: var(--border-color) !important; }
fieldset legend { font-size: 0.875rem !important; color: var(--text-secondary); }

/* Gradient text utility */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Status dots */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.active { background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.status-dot.inactive { background: var(--text-muted); }

/* ── Screen pattern classes (kit.css) ── */

/* Read-only tag — shown in page header when user has view but no edit/add */
.ro-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-xs);
}

/* Read-only banner — shown at top of form page when user can't edit */
.ro-banner {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--warning);
    background: var(--warning-light);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius) var(--radius) 0 0;
}
.ro-banner i { font-size: 0.95rem; }

/* Sticky form action bar — sits at bottom of create/edit forms */
.form-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    margin-top: 8px;
    background: linear-gradient(to top, var(--bg-body) 70%, transparent);
    z-index: 10;
}

/* List page header — sits above the card, contains title + action */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.list-header .page-title { margin-bottom: 0; }

/* Report pattern — summary tiles */
.rep-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.rep-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.rep-tile .rl { font-size: 0.72rem; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.rep-tile .rv { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 3px; color: var(--text-primary); }
.rep-tile .rd { font-size: 0.72rem; font-weight: 600; margin-top: 3px; display: inline-flex; align-items: center; gap: 3px; }

/* Report table — grouped rows */
.tbl-group td { background: var(--bg-muted); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }

/* Tooltip for sidebar collapsed */
.sidebar-collapsed .sidebar-link { position: relative; }
.sidebar-collapsed .sidebar-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: var(--bg-card);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
    margin-left: 10px;
    z-index: 1050;
    box-shadow: var(--shadow-md);
}
.sidebar-collapsed .sidebar-link:hover::after { opacity: 1; }

/* ── Number inputs: hide spin buttons on all forms globally ── */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ── Coloured selects: apply .sel-colored + data-color on options ── */
/* Usage: <select class="form-select sel-colored" onchange="colorSelect(this)"> */
/* Option: <option value="L" data-color="info">Local</option> */
.sel-colored { transition: background-color 0.2s ease, border-color 0.2s ease; }
.sel-colored.sel-c-primary  { background-color: #eef2ff; border-color: #6366f1; color: #4338ca; }
.sel-colored.sel-c-info     { background-color: #ecfeff; border-color: #06b6d4; color: #0e7490; }
.sel-colored.sel-c-success  { background-color: #ecfdf5; border-color: #10b981; color: #065f46; }
.sel-colored.sel-c-warning  { background-color: #fffbeb; border-color: #f59e0b; color: #92400e; }
.sel-colored.sel-c-danger   { background-color: #fef2f2; border-color: #ef4444; color: #991b1b; }
.sel-colored.sel-c-violet   { background-color: #f5f3ff; border-color: #8b5cf6; color: #5b21b6; }
.sel-colored.sel-c-teal     { background-color: #f0fdfa; border-color: #14b8a6; color: #0f766e; }
/* Dark mode overrides */
[data-bs-theme="dark"] .sel-colored.sel-c-primary  { background-color: rgba(99,102,241,0.15); border-color: #6366f1; color: #a5b4fc; }
[data-bs-theme="dark"] .sel-colored.sel-c-info     { background-color: rgba(6,182,212,0.12);   border-color: #06b6d4; color: #67e8f9; }
[data-bs-theme="dark"] .sel-colored.sel-c-success  { background-color: rgba(16,185,129,0.12);  border-color: #10b981; color: #6ee7b7; }
[data-bs-theme="dark"] .sel-colored.sel-c-warning  { background-color: rgba(245,158,11,0.12);  border-color: #f59e0b; color: #fcd34d; }
[data-bs-theme="dark"] .sel-colored.sel-c-danger   { background-color: rgba(239,68,68,0.12);   border-color: #ef4444; color: #fca5a5; }
[data-bs-theme="dark"] .sel-colored.sel-c-violet   { background-color: rgba(139,92,246,0.12);  border-color: #8b5cf6; color: #c4b5fd; }
[data-bs-theme="dark"] .sel-colored.sel-c-teal     { background-color: rgba(20,184,166,0.12);  border-color: #14b8a6; color: #5eead4; }
