/**
 * ============================================================================
 * GGV System — Main Application Stylesheet
 * ============================================================================
 * Premium dark theme with indigo/purple gradients.
 * Built for a mobile-first, app-like investment management experience.
 * ============================================================================
 */

/* ──────────────────────────────────────────────
   Google Fonts
   ────────────────────────────────────────────── */

/* ──────────────────────────────────────────────
   CSS Custom Properties (Design Tokens)
   ────────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --primary: #15966A;
    --primary-hover: #087F5B;
    --primary-light: rgba(21, 150, 106, 0.1);
    --primary-glow: rgba(21, 150, 106, 0.25);
    --secondary: #34B985;
    --secondary-light: rgba(52, 185, 133, 0.1);

    /* Semantic Colors */
    --success: #10B981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #06B6D4;
    --info-light: rgba(6, 182, 212, 0.1);

    /* Background Colors */
    --bg-body: #0F172A;
    --bg-card: #1E293B;
    --bg-sidebar: #1E293B;
    --bg-input: #334155;
    --bg-hover: #2D3B4F;
    --bg-dark: #0B1120;

    /* Compatibility aliases used by module-level views. */
    --card-bg: var(--bg-card);
    --bg-secondary: var(--bg-input);

    /* Text Colors */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Border Colors */
    --border: #334155;
    --border-light: #475569;
    --border-color: var(--border);
    --table-hover-bg: rgba(21, 150, 106, 0.1);

    /* Effects */
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --shadow-primary: rgba(21, 150, 106, 0.15);

    /* Radii */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;
    --bottom-nav-height: 65px;
}

body[data-theme="light"] {
    --primary: #087F5B;
    --primary-hover: #066449;
    --primary-light: rgba(8, 127, 91, 0.1);
    --primary-glow: rgba(8, 127, 91, 0.2);
    --secondary: #16835F;
    --secondary-light: rgba(22, 131, 95, 0.1);

    /* Darker semantic tones retain contrast on white cards. */
    --success: #047857;
    --warning: #B45309;
    --danger: #DC2626;
    --info: #0369A1;

    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-input: #F1F5F9;
    --bg-hover: #E2E8F0;
    --bg-dark: #E2E8F0;

    --card-bg: var(--bg-card);
    --bg-secondary: var(--bg-input);

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;

    --border: #E2E8F0;
    --border-light: #CBD5E1;
    --border-color: var(--border);
    --table-hover-bg: rgba(8, 127, 91, 0.07);

    --shadow: rgba(15, 23, 42, 0.08);
    --shadow-lg: rgba(15, 23, 42, 0.16);
    --shadow-primary: rgba(8, 127, 91, 0.12);

    color-scheme: light;
}

body[data-theme="dark"] {
    color-scheme: dark;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: var(--primary);
    color: #FFFFFF;
}

::-moz-selection {
    background: var(--primary);
    color: #FFFFFF;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-body);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ──────────────────────────────────────────────
   Layout: App Wrapper
   ────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    position: relative;
}

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

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-header .sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
    backdrop-filter: blur(10px);
}

.sidebar-header .sidebar-title {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sidebar-header .sidebar-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 400;
}

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

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    margin: 2px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
    margin-left: 7px;
    padding-left: 17px;
}

.sidebar-nav-item i {
    width: 24px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar Group (Collapsible) */
.sidebar-nav-group {
    margin: 4px 0;
}

.sidebar-nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    margin: 2px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-nav-group-header:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav-group-header i.group-icon {
    width: 24px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 12px;
}

.sidebar-nav-group-header .group-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.sidebar-nav-group.open .group-arrow {
    transform: rotate(90deg);
}

.sidebar-nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-nav-group.open .sidebar-nav-group-items {
    max-height: 1200px;
}

.sidebar-nav-group-items .sidebar-nav-item {
    padding-left: 56px;
    font-size: 13px;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 20px;
}

.sidebar-section-label {
    padding: 12px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ──────────────────────────────────────────────
   Main Content
   ────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* ──────────────────────────────────────────────
   Top Header
   ────────────────────────────────────────────── */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    background: rgba(30, 41, 59, 0.9);
}

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

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

.top-header .page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.top-header .page-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
}

.top-header .sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.top-header .sidebar-toggle:hover {
    background: var(--bg-hover);
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    position: relative;
}

.header-icon-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.header-icon-btn .notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--bg-card);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.header-user:hover {
    background: var(--bg-input);
}

.header-user .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
}

.header-user .user-info {
    display: flex;
    flex-direction: column;
}

.header-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-user .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ──────────────────────────────────────────────
   Content Area
   ────────────────────────────────────────────── */
.content-area {
    padding: 20px 24px;
    margin-top: var(--header-height);
    padding-bottom: 40px;
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.content-area > *,
.tab-content,
.tab-pane,
.row,
.card-body {
    min-width: 0;
    max-width: 100%;
}

.page-header {
    min-width: 0;
    max-width: 100%;
}

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-heading p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.page-heading .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.page-heading .breadcrumb a {
    color: var(--text-secondary);
}

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

.page-heading .breadcrumb .separator {
    color: var(--text-muted);
    font-size: 10px;
}

/* ──────────────────────────────────────────────
   Bottom Navigation (Mobile)
   ────────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: none; /* hidden on desktop */
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(10px);
    background: rgba(30, 41, 59, 0.95);
}

body[data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, 0.95);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.bottom-nav-item i {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav-item span {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
}

.bottom-nav-item .nav-dot {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
}

/* ──────────────────────────────────────────────
   Cards
   ────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 20px;
    min-width: 0;
    max-width: 100%;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

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

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

.card-header .card-title i {
    color: var(--primary);
}

.card-body {
    padding: 20px;
    min-width: 0;
    max-width: 100%;
}

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

/* Card without hover lift (for static containers) */
.card.card-static:hover {
    transform: none;
    box-shadow: none;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--shadow);
}

.stat-card.stat-primary {
    background: linear-gradient(135deg, #15966A, #087F5B);
}

.stat-card.stat-success {
    background: linear-gradient(135deg, #10B981, #059669);
}

.stat-card.stat-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.stat-card.stat-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.stat-card.stat-info {
    background: linear-gradient(135deg, #06B6D4, #0891B2);
}

.stat-card.stat-secondary {
    background: linear-gradient(135deg, #34B985, #16835F);
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card .stat-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.15);
}

.stat-card .stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.stat-card.stat-primary .stat-value,
.stat-card.stat-success .stat-value,
.stat-card.stat-warning .stat-value,
.stat-card.stat-danger .stat-value,
.stat-card.stat-info .stat-value,
.stat-card.stat-secondary .stat-value,
.stat-card[class*="stat-gradient-"] .stat-value {
    color: #FFFFFF;
}

.stat-card.stat-primary .stat-label,
.stat-card.stat-success .stat-label,
.stat-card.stat-warning .stat-label,
.stat-card.stat-danger .stat-label,
.stat-card.stat-info .stat-label,
.stat-card.stat-secondary .stat-label,
.stat-card[class*="stat-gradient-"] .stat-label {
    color: rgba(255, 255, 255, 0.82);
}

/* Some dashboard views define gradient text rules locally. Keep plain cards readable. */
body[data-theme="light"] .stat-card:not([class*="stat-gradient-"]):not(.stat-primary):not(.stat-success):not(.stat-warning):not(.stat-danger):not(.stat-info):not(.stat-secondary) .stat-value:not(.text-primary):not(.text-success):not(.text-warning):not(.text-danger):not(.text-info):not(.text-indigo) {
    color: var(--text-primary) !important;
}

body[data-theme="light"] .stat-card:not([class*="stat-gradient-"]):not(.stat-primary):not(.stat-success):not(.stat-warning):not(.stat-danger):not(.stat-info):not(.stat-secondary) .stat-label {
    color: var(--text-secondary) !important;
}

/* Stat cards grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Searchable employee selector used by proposal workflows. */
.employee-search-select {
    display: grid;
    gap: 8px;
}

.employee-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    gap: 6px;
}

.employee-search-input-wrap {
    position: relative;
}

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

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

.employee-search-row .btn {
    width: 40px;
    height: 40px;
    padding: 0;
}

.employee-search-summary {
    min-height: 17px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ──────────────────────────────────────────────
   Buttons
   ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #FFFFFF;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #066449);
    box-shadow: 0 4px 15px var(--shadow-primary);
}

/* Success */
.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #FFFFFF;
    border-color: var(--success);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

/* Warning */
.btn-warning {
    background: linear-gradient(135deg, var(--warning), #D97706);
    color: #FFFFFF;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #D97706, #B45309);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

/* Danger */
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: #FFFFFF;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

/* Info */
.btn-info {
    background: linear-gradient(135deg, var(--info), #0891B2);
    color: #FFFFFF;
    border-color: var(--info);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891B2, #0E7490);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
}

/* Secondary */
.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

/* Dark */
.btn-dark {
    background: var(--bg-dark);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-dark:hover {
    background: var(--bg-body);
}

/* Outline variants */
.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #FFFFFF;
}

.btn-outline-success {
    background: transparent;
    color: var(--success);
    border-color: var(--success);
}

.btn-outline-success:hover {
    background: var(--success);
    color: #FFFFFF;
}

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

.btn-outline-danger:hover {
    background: var(--danger);
    color: #FFFFFF;
}

.btn-outline-warning {
    background: transparent;
    color: var(--warning);
    border-color: var(--warning);
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: #FFFFFF;
}

.btn-outline-info {
    background: transparent;
    color: var(--info);
    border-color: var(--info);
}

.btn-outline-info:hover {
    background: var(--info);
    color: #FFFFFF;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline-secondary:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Ghost (no border) */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    box-shadow: none;
}

/* Sizes */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 5px;
}

/* Icon button */
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-icon.btn-lg {
    width: 44px;
    height: 44px;
}

/* Button with spinner */
.btn .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

/* Button group */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ──────────────────────────────────────────────
   Forms
   ────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition-fast);
    line-height: 1.5;
}

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

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled,
.form-control[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
    background: var(--bg-hover);
}

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

/* Select */
.form-select {
    display: block;
    width: 100%;
    padding: 10px 38px 10px 14px;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: var(--transition-fast);
    flex-shrink: 0;
    position: relative;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check-input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 10px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.form-check-input[type="radio"]:checked::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #FFFFFF;
    transform: translate(-50%, -50%);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-check-label {
    font-size: 13.5px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Form helper text */
.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Validation */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-light);
}

.invalid-feedback {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    display: none;
}

.is-invalid ~ .invalid-feedback,
.was-validated :invalid ~ .invalid-feedback {
    display: block;
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--success);
}

/* Input group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1;
}

.input-group .form-control:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.input-group-text:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
}

.input-group-text:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}

/* Floating labels */
.form-floating {
    position: relative;
}

.form-floating .form-control {
    padding-top: 24px;
    padding-bottom: 6px;
}

.form-floating label {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-muted);
    transition: var(--transition-fast);
    pointer-events: none;
    background: transparent;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    top: 10px;
    transform: translateY(0);
    font-size: 11px;
    color: var(--primary);
}

/* Toggle / Switch */
.form-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.form-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.form-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: var(--transition-fast);
}

.form-switch .slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.form-switch input:checked + .slider {
    background: var(--primary);
    border-color: var(--primary);
}

.form-switch input:checked + .slider::before {
    transform: translateX(20px);
    background: #FFFFFF;
}

/* ──────────────────────────────────────────────
   Tables
   ────────────────────────────────────────────── */
.table-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-input);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 8px;
}

.data-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead {
    background: var(--bg-input);
}

.data-table thead th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-align: left;
}

.data-table tbody td {
    padding: 12px 16px;
    font-size: 13.5px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

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

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

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

.table-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

/* DataTables Override Styles */
.dataTables_wrapper {
    color: var(--text-secondary);
    font-size: 13px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dt-buttons {
    padding: 12px 16px;
    color: var(--text-secondary);
}

.dataTables_wrapper .dt-header,
.dataTables_wrapper .datatable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.dataTables_wrapper .dt-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.dataTables_wrapper .dt-button,
.dataTables_wrapper .buttons-html5,
.dataTables_wrapper .buttons-print {
    margin: 0;
    box-shadow: none;
}

.dataTables_wrapper .dt-footer,
.dataTables_wrapper .datatable-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    outline: none;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px;
    margin: 0 2px;
    border-radius: 6px;
    border: 1px solid var(--border) !important;
    background: var(--bg-input) !important;
    color: var(--text-secondary) !important;
    cursor: pointer;
    transition: var(--transition-fast);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-light) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    border-color: var(--primary) !important;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row > .form-group,
.form-row > [class*="col-"] {
    min-width: 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dataTables_wrapper .dataTables_empty {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: 0.5;
}

/* ──────────────────────────────────────────────
   Badges & Status
   ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-secondary {
    background: var(--secondary-light);
    color: var(--secondary);
}

.badge-dark {
    background: var(--bg-input);
    color: var(--text-secondary);
}

/* Status dot */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.status-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.dot-success::before { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.dot-warning::before { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-dot.dot-danger::before  { background: var(--danger);  box-shadow: 0 0 6px var(--danger);  }
.status-dot.dot-info::before    { background: var(--info);    box-shadow: 0 0 6px var(--info);    }
.status-dot.dot-primary::before { background: var(--primary); box-shadow: 0 0 6px var(--primary); }
.status-dot.dot-muted::before   { background: var(--text-muted); }

/* ──────────────────────────────────────────────
   Modals
   ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 40px);
    box-shadow: 0 25px 60px var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-container.modal-sm {
    max-width: 400px;
}

.modal-container.modal-lg {
    max-width: 800px;
}

.modal-container.modal-xl {
    max-width: 1100px;
}

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

.modal-header .modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header .modal-title i {
    color: var(--primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger);
    color: #FFFFFF;
}

.modal-body {
    padding: 24px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

/* ──────────────────────────────────────────────
   Page Loader
   ────────────────────────────────────────────── */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.4s ease;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* AJAX Overlay */
.ajax-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    pointer-events: none;
}

.ajax-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.ajax-overlay .ajax-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Inline loader */
.inline-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.inline-loader .mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ──────────────────────────────────────────────
   Toast / Alerts
   ────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    box-shadow: 0 8px 25px var(--shadow);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-danger  { border-left-color: var(--danger);  }
.toast.toast-info    { border-left-color: var(--info);    }

.toast .toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-warning .toast-icon { color: var(--warning); }
.toast.toast-danger  .toast-icon { color: var(--danger);  }
.toast.toast-info    .toast-icon { color: var(--info);    }

.toast .toast-message {
    flex: 1;
    font-size: 13.5px;
    color: var(--text-primary);
}

.toast .toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

.toast .toast-close:hover {
    color: var(--text-primary);
}

/* ──────────────────────────────────────────────
   Wizard / Steps
   ────────────────────────────────────────────── */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 30px;
    counter-reset: wizard;
    position: relative;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 1;
    counter-increment: wizard;
}

.wizard-step::before {
    content: counter(wizard);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.wizard-step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 24px);
    width: calc(100% - 48px);
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.wizard-step:last-child::after {
    display: none;
}

.wizard-step .wizard-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    transition: var(--transition);
}

/* Active step */
.wizard-step.active::before {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.wizard-step.active .wizard-label {
    color: var(--primary);
    font-weight: 600;
}

/* Completed step */
.wizard-step.completed::before {
    content: '\f00c'; /* Font Awesome check icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    background: var(--success);
    border-color: var(--success);
    color: #FFFFFF;
    font-size: 14px;
}

.wizard-step.completed::after {
    background: var(--success);
}

.wizard-step.completed .wizard-label {
    color: var(--success);
}

.wizard-content {
    padding: 20px 0;
    transition: var(--transition);
}

.wizard-content .wizard-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-content .wizard-pane.active {
    display: block;
}

/* ──────────────────────────────────────────────
   Timeline (Status Tracker)
   ────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding: 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 48px;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 8px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 3px solid var(--border);
    z-index: 2;
}

.timeline-dot.dot-primary { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.timeline-dot.dot-success { background: var(--success); border-color: var(--success); box-shadow: 0 0 0 4px var(--success-light); }
.timeline-dot.dot-warning { background: var(--warning); border-color: var(--warning); box-shadow: 0 0 0 4px var(--warning-light); }
.timeline-dot.dot-danger  { background: var(--danger);  border-color: var(--danger);  box-shadow: 0 0 0 4px var(--danger-light);  }
.timeline-dot.dot-info    { background: var(--info);    border-color: var(--info);    box-shadow: 0 0 0 4px var(--info-light);    }

.timeline-content {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
}

.timeline-content .timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-content .timeline-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.timeline-content .timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ──────────────────────────────────────────────
   Animations / Keyframes
   ────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* Animation utility classes */
.fade-in          { animation: fadeIn 0.3s ease; }
.slide-up         { animation: slideUp 0.4s ease; }
.slide-down       { animation: slideDown 0.4s ease; }
.slide-in-right   { animation: slideInRight 0.4s ease; }
.slide-in-left    { animation: slideInLeft 0.4s ease; }
.scale-in         { animation: scaleIn 0.3s ease; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-input) 25%,
        var(--bg-hover) 50%,
        var(--bg-input) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
}

/* ──────────────────────────────────────────────
   Utility Classes
   ────────────────────────────────────────────── */

/* Text colors */
.text-primary   { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.text-danger    { color: var(--danger) !important; }
.text-info      { color: var(--info) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-light     { color: var(--text-primary) !important; }
.text-white     { color: #FFFFFF !important; }
.text-body      { color: var(--text-primary) !important; }

/* Background colors (light variants) */
.bg-primary   { background: var(--primary-light) !important; }
.bg-success   { background: var(--success-light) !important; }
.bg-warning   { background: var(--warning-light) !important; }
.bg-danger    { background: var(--danger-light) !important; }
.bg-info      { background: var(--info-light) !important; }
.bg-secondary { background: var(--secondary-light) !important; }
.bg-card      { background: var(--bg-card) !important; }
.bg-body      { background: var(--bg-body) !important; }
.bg-input     { background: var(--bg-input) !important; }
.bg-slate-800 { background: var(--bg-input) !important; }
.bg-slate-900 { background: var(--bg-body) !important; }
.border-slate-700,
.border-slate-800 { border-color: var(--border) !important; }

/* Flexbox */
.d-flex            { display: flex !important; }
.d-inline-flex     { display: inline-flex !important; }
.d-block           { display: block !important; }
.d-inline-block    { display: inline-block !important; }
.d-none            { display: none !important; }
.d-grid            { display: grid !important; }
.flex-column       { flex-direction: column !important; }
.flex-row          { flex-direction: row !important; }
.flex-wrap         { flex-wrap: wrap !important; }
.flex-1            { flex: 1 !important; }
.justify-between   { justify-content: space-between !important; }
.justify-center    { justify-content: center !important; }
.justify-end       { justify-content: flex-end !important; }
.justify-start     { justify-content: flex-start !important; }
.align-center      { align-items: center !important; }
.align-start       { align-items: flex-start !important; }
.align-end         { align-items: flex-end !important; }
.align-stretch     { align-items: stretch !important; }
.gap-4             { gap: 4px !important; }
.gap-6             { gap: 6px !important; }
.gap-8             { gap: 8px !important; }
.gap-10            { gap: 10px !important; }
.gap-12            { gap: 12px !important; }
.gap-16            { gap: 16px !important; }
.gap-20            { gap: 20px !important; }
.gap-24            { gap: 24px !important; }

/* Spacing — Margins */
.m-0    { margin: 0 !important; }
.mt-0   { margin-top: 0 !important; }
.mb-0   { margin-bottom: 0 !important; }
.ml-0   { margin-left: 0 !important; }
.mr-0   { margin-right: 0 !important; }
.mt-4   { margin-top: 4px !important; }
.mt-8   { margin-top: 8px !important; }
.mt-10  { margin-top: 10px !important; }
.mt-12  { margin-top: 12px !important; }
.mt-16  { margin-top: 16px !important; }
.mt-20  { margin-top: 20px !important; }
.mt-24  { margin-top: 24px !important; }
.mt-30  { margin-top: 30px !important; }
.mb-4   { margin-bottom: 4px !important; }
.mb-8   { margin-bottom: 8px !important; }
.mb-10  { margin-bottom: 10px !important; }
.mb-12  { margin-bottom: 12px !important; }
.mb-16  { margin-bottom: 16px !important; }
.mb-20  { margin-bottom: 20px !important; }
.mb-24  { margin-bottom: 24px !important; }
.mb-30  { margin-bottom: 30px !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* Spacing — Padding */
.p-0    { padding: 0 !important; }
.p-10   { padding: 10px !important; }
.p-12   { padding: 12px !important; }
.p-16   { padding: 16px !important; }
.p-20   { padding: 20px !important; }
.p-24   { padding: 24px !important; }
.pt-0   { padding-top: 0 !important; }
.pb-0   { padding-bottom: 0 !important; }
.px-10  { padding-left: 10px !important; padding-right: 10px !important; }
.px-16  { padding-left: 16px !important; padding-right: 16px !important; }
.px-20  { padding-left: 20px !important; padding-right: 20px !important; }
.py-10  { padding-top: 10px !important; padding-bottom: 10px !important; }
.py-16  { padding-top: 16px !important; padding-bottom: 16px !important; }
.py-20  { padding-top: 20px !important; padding-bottom: 20px !important; }

/* Text alignment */
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }
.text-left   { text-align: left !important; }

/* Sizing */
.w-100  { width: 100% !important; }
.w-50   { width: 50% !important; }
.h-100  { height: 100% !important; }
.mw-100 { max-width: 100% !important; }

/* Visibility */
.hidden    { display: none !important; }
.visible   { visibility: visible !important; }
.invisible { visibility: hidden !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }
.overflow-x-auto { overflow-x: auto !important; }

/* Position */
.relative { position: relative !important; }
.absolute { position: absolute !important; }

/* Border & Radius */
.rounded     { border-radius: var(--radius) !important; }
.rounded-sm  { border-radius: var(--radius-sm) !important; }
.rounded-lg  { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: 50% !important; }
.border      { border: 1px solid var(--border) !important; }
.border-0    { border: none !important; }
.border-top  { border-top: 1px solid var(--border) !important; }
.border-bottom { border-bottom: 1px solid var(--border) !important; }

/* Shadow */
.shadow     { box-shadow: 0 4px 15px var(--shadow) !important; }
.shadow-lg  { box-shadow: 0 10px 30px var(--shadow-lg) !important; }
.shadow-none { box-shadow: none !important; }

/* Font weight */
.fw-300 { font-weight: 300 !important; }
.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

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

/* Cursor */
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }

/* User select */
.select-none { user-select: none !important; }

/* Truncate */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ──────────────────────────────────────────────
   SweetAlert2 Dark Theme Overrides
   ────────────────────────────────────────────── */
.swal2-popup {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
}

.swal2-html-container {
    color: var(--text-secondary) !important;
}

.swal2-input,
.swal2-textarea,
.swal2-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}

.swal2-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
}

.swal2-cancel {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
}

.swal2-timer-progress-bar {
    background: var(--primary) !important;
}

/* ──────────────────────────────────────────────
   Flatpickr Dark Theme Overrides
   ────────────────────────────────────────────── */
.flatpickr-calendar {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 8px 30px var(--shadow-lg) !important;
    border-radius: var(--radius) !important;
}

.flatpickr-months .flatpickr-month {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
}

.flatpickr-current-month input.cur-year {
    color: var(--text-primary) !important;
}

.flatpickr-weekdays {
    background: var(--bg-card) !important;
}

span.flatpickr-weekday {
    color: var(--text-muted) !important;
    font-weight: 600;
}

.flatpickr-day {
    color: var(--text-primary) !important;
    border-radius: 6px !important;
}

.flatpickr-day:hover {
    background: var(--bg-hover) !important;
    border-color: var(--bg-hover) !important;
}

.flatpickr-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #FFFFFF !important;
}

.flatpickr-day.today {
    border-color: var(--primary) !important;
}

.flatpickr-day.today:hover {
    background: var(--primary) !important;
    color: #FFFFFF !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-muted) !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: var(--text-secondary) !important;
    color: var(--text-secondary) !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--primary) !important;
}

/* ──────────────────────────────────────────────
   Scroll to Top Button
   ────────────────────────────────────────────── */
.scroll-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 50;
    box-shadow: 0 4px 15px var(--shadow-primary);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* ──────────────────────────────────────────────
   Grid Helpers
   ────────────────────────────────────────────── */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col { flex: 1; padding: 0 10px; }
.col-1  { width: calc(100% / 12 * 1);  padding: 0 10px; }
.col-2  { width: calc(100% / 12 * 2);  padding: 0 10px; }
.col-3  { width: calc(100% / 12 * 3);  padding: 0 10px; }
.col-4  { width: calc(100% / 12 * 4);  padding: 0 10px; }
.col-5  { width: calc(100% / 12 * 5);  padding: 0 10px; }
.col-6  { width: calc(100% / 12 * 6);  padding: 0 10px; }
.col-7  { width: calc(100% / 12 * 7);  padding: 0 10px; }
.col-8  { width: calc(100% / 12 * 8);  padding: 0 10px; }
.col-9  { width: calc(100% / 12 * 9);  padding: 0 10px; }
.col-10 { width: calc(100% / 12 * 10); padding: 0 10px; }
.col-11 { width: calc(100% / 12 * 11); padding: 0 10px; }
.col-12 { width: 100%;                  padding: 0 10px; }

/* ──────────────────────────────────────────────
   Tabs
   ────────────────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.nav-tab {
    flex: 0 0 auto;
    padding: 12px 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-nav {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    padding: 20px 0;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

/* ──────────────────────────────────────────────
   Accordion
   ────────────────────────────────────────────── */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-header {
    padding: 14px 18px;
    background: var(--bg-input);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.accordion-header:hover {
    background: var(--bg-hover);
}

.accordion-header .accordion-arrow {
    transition: transform 0.3s ease;
    font-size: 12px;
    color: var(--text-muted);
}

.accordion-item.open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.open .accordion-body {
    padding: 18px;
    max-height: 1000px;
}

/* ──────────────────────────────────────────────
   Misc
   ────────────────────────────────────────────── */

/* Divider with text */
.divider-text {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Amount display */
.amount {
    font-family: 'Inter', monospace;
    font-weight: 600;
}

.amount-lg {
    font-size: 24px;
}

/* Code block */
.code-block {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    overflow-x: auto;
}

/* Popover */
.popover {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: 0 8px 25px var(--shadow-lg);
    z-index: 50;
    min-width: 200px;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    pointer-events: none;
    z-index: 50;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ──────────────────────────────────────────────
   Sidebar — New HTML Class Mappings
   Maps classes used in sidebar.php to the
   existing visual styles (dark theme, indigo).
   ────────────────────────────────────────────── */

/* --- Brand Header --- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #FFFFFF;
    flex: 1;
    min-width: 0;
}

.sidebar-brand:hover {
    color: #FFFFFF;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
}

/* --- Sidebar Close Button --- */
.sidebar-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

/* Hide on desktop (≥992px), show on mobile */
.d-lg-none {
    display: none;
}

/* --- Nav List (reset) --- */
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* --- Nav Item --- */
.nav-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --- Nav Link (primary sidebar link styling) --- */
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    margin: 2px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

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

.sidebar-nav .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
    margin-left: 7px;
    padding-left: 17px;
}

/* --- Nav Icon & Nav Text --- */
.nav-icon {
    width: 24px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
}

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

/* --- Nav Group (collapsible section) --- */
.nav-group {
    margin: 4px 0;
    list-style: none;
}

/* --- Nav Group Toggle (the clickable header) --- */
.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 20px;
    margin: 2px 10px;
    /* width needs to account for margin */
    width: calc(100% - 20px);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
}

.nav-group-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* --- Nav Group Label (icon + text wrapper) --- */
.nav-group-label {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* --- Nav Arrow (chevron) --- */
.nav-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.nav-group-toggle.open .nav-arrow {
    transform: rotate(180deg);
}

/* --- Nav Group Items (collapsible panel) --- */
.nav-group-items {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-group-items.open,
.nav-group-toggle.open + .nav-group-items,
.nav-group.open > .nav-group-items {
    max-height: 1200px;
}

/* Sub-items inside group are indented */
.nav-group-items .nav-link {
    padding-left: 56px;
    font-size: 13px;
}

/* --- Sidebar Footer Content --- */
.sidebar-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Sidebar User Compact --- */
.sidebar-user-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Avatar --- */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

/* --- Sidebar Backdrop (mobile overlay) --- */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ──────────────────────────────────────────────
   Responsive — Mobile Sidebar
   ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .d-lg-none {
        display: inline-flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
    }

    .top-header {
        left: 0;
    }

    .top-header .sidebar-toggle {
        display: flex;
    }

    .bottom-nav {
        display: flex;
    }

    .content-area {
        padding-bottom: calc(var(--bottom-nav-height) + 20px);
    }
}

/* ============================================================
   Header Dropdowns Styling (User & Notifications)
   ============================================================ */
.header-notifications {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px var(--shadow-lg);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.notification-header h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-header .btn-link {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}

.notification-header .btn-link:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: var(--primary-glow);
}

.notification-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.notification-item-content {
    flex: 1;
}

.notification-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-word;
}

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

.notification-item-link {
    display: inline-flex;
    margin-top: 6px;
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
}

.notification-load-state {
    padding: 10px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.notification-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-muted);
}

.notification-empty i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.notification-empty p {
    margin: 0;
    font-size: 13px;
}

.notification-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.notification-footer a {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

.finance-review-alert-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: grid;
    gap: 10px;
    width: min(390px, calc(100vw - 32px));
    pointer-events: none;
}

.finance-review-alert {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 30px;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: 0 14px 38px var(--shadow-lg);
    color: var(--text-primary);
    pointer-events: auto;
    animation: finance-alert-enter 180ms ease-out;
}

.finance-review-alert.is-leaving {
    opacity: 0;
    transform: translateX(18px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.finance-review-alert-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.14);
    color: var(--success);
    font-size: 19px;
}

.finance-review-alert-content {
    min-width: 0;
}

.finance-review-alert-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.35;
}

.finance-review-alert-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.finance-review-alert-action {
    display: inline-flex;
    align-items: center;
    margin-top: 9px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.finance-review-alert-close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.finance-review-alert-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

@keyframes finance-alert-enter {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
    .finance-review-alert-stack {
        right: 16px;
        bottom: calc(var(--bottom-nav-height) + 14px);
    }
}

/* User Dropdown */
.header-user {
    position: relative;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px var(--shadow-lg);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    padding: 6px 0;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-dropdown-info strong {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-info span {
    font-size: 11px;
    color: var(--text-muted);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13.5px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.user-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-dropdown-item.text-danger:hover {
    background: var(--danger-light);
}

.user-dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Proposal action toolbar */
.proposal-action-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: min(100%, 980px);
}

.proposal-action-bar .proposal-action-btn {
    min-height: 40px;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
}

@media (max-width: 768px) {
    .proposal-page-header {
        align-items: stretch;
        gap: 14px;
    }

    .proposal-action-bar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .proposal-action-bar .proposal-action-btn {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding-left: 10px;
        padding-right: 10px;
        font-size: 12.5px;
    }

    .proposal-action-bar .proposal-action-btn i {
        flex: 0 0 auto;
    }
}

@media (max-width: 420px) {
    .proposal-action-bar {
        grid-template-columns: 1fr;
    }
}
/* GGV green surfaces, shared by every authenticated module. */
:root{--bg-body:#101e18;--bg-card:#1b2c23;--bg-sidebar:#14271d;--bg-input:#293d31;--bg-hover:#304838;--bg-dark:#0b1710;--border:#344b3c;--border-light:#496551;--text-secondary:#a4b9ac;--text-muted:#90a698}
body[data-theme="light"]{--bg-body:#f2f7f3;--bg-sidebar:#fbfdfb;--bg-input:#f2f7f3;--bg-hover:#e6f1e9;--bg-dark:#e6f1e9;--border:#dce8df;--border-light:#c7d9cc;--text-primary:#183626;--text-secondary:#476352;--text-muted:#60786a}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
.push-notification-control{padding:12px 14px;border-top:1px solid var(--border);background:var(--bg-hover);display:flex;gap:8px;align-items:center;flex-wrap:wrap}.push-notification-control[hidden]{display:none}.push-notification-control small{display:block;width:100%;font-size:11px;line-height:1.35}.push-notification-control .btn{font-size:12px}
