/* ============================================
   BULLION MONIE DASHBOARD — MAIN STYLESHEET
   White & gold luxury fintech theme
   ============================================ */

:root {
    /* Gold palette */
    --gold-50: #FFF9E6;
    --gold-100: #FFF0BF;
    --gold-200: #FFE699;
    --gold-300: #FFD666;
    --gold-400: #FFC733;
    --gold-500: #C9A44A;
    --gold-600: #B08D35;
    --gold-700: #8B6D1F;
    --gold-800: #6B5317;
    --gold-900: #4A3A10;

    /* Light surfaces */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F7F4;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F9F8F5;
    --bg-elevated: #FFFFFF;
    --bg-input: #F8F7F4;
    --bg-sidebar: #FDFCFA;
    --bg-tertiary: #F3F1EC;

    /* Borders */
    --border-subtle: #F0EDE5;
    --border-default: #E5E0D5;
    --border-strong: #D4CFC2;
    --border-gold: rgba(201, 164, 74, 0.4);
    --border-primary: #E5E0D5;

    /* Text */
    --text-primary: #1A1A1A;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-gold: #B08D35;
    --text-white: #FFFFFF;

    /* Accent colors */
    --accent-green: #10B981;
    --accent-red: #EF4444;

    /* Status colors */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.08);

    /* Gold primary for buttons */
    --gold-primary: #C9A44A;
    --gold-hover: #B08D35;

    /* Dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-gold: 0 4px 20px rgba(201, 164, 74, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-primary: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

a { color: var(--text-gold); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--gold-400); }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--transition-base);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.75rem; }
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-default);
}

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

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.logo-text strong { font-weight: 700; color: var(--text-gold); }

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.sidebar-toggle:hover { color: var(--text-gold); background: var(--bg-tertiary); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.nav-section { margin-bottom: 0.5rem; }

.nav-label {
    display: block;
    padding: 0.75rem 0.75rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    margin-bottom: 2px;
}
.nav-item i { width: 20px; text-align: center; font-size: 0.95rem; }
.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(201, 164, 74, 0.12), rgba(201, 164, 74, 0.05));
    color: var(--text-gold);
    border: 1px solid var(--border-default);
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-default);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFFFFF;
}
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }

.logout-btn {
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.logout-btn:hover { color: var(--danger); background: var(--danger-bg); }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-base);
    background: var(--bg-secondary);
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

.top-bar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.top-bar-left { display: flex; align-items: center; gap: 1rem; }
.top-bar-right { display: flex; align-items: center; gap: 1rem; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.page-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.top-bar-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.notification-btn {
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}
.notification-btn:hover { border-color: var(--border-default); color: var(--text-gold); }

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.content-area {
    padding: 1.5rem;
    max-width: 1400px;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: var(--transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.card-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.card-body { }

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.kpi-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-500), transparent);
}
.kpi-card.success::before { background: linear-gradient(90deg, var(--success), transparent); }
.kpi-card.warning::before { background: linear-gradient(90deg, var(--warning), transparent); }
.kpi-card.danger::before { background: linear-gradient(90deg, var(--danger), transparent); }
.kpi-card.info::before { background: linear-gradient(90deg, var(--info), transparent); }

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    background: rgba(201, 164, 74, 0.1);
    color: var(--text-gold);
}
.kpi-card.success .kpi-icon { background: var(--success-bg); color: var(--success); }
.kpi-card.warning .kpi-icon { background: var(--warning-bg); color: var(--warning); }
.kpi-card.danger .kpi-icon { background: var(--danger-bg); color: var(--danger); }
.kpi-card.info .kpi-icon { background: var(--info-bg); color: var(--info); }

.kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 0.15rem;
    font-variant-numeric: tabular-nums;
}
.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 2px 8px;
    border-radius: 20px;
}
.kpi-change.up { color: var(--success); background: var(--success-bg); }
.kpi-change.down { color: var(--danger); background: var(--danger-bg); }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }

/* ===== TABLES ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
}
.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}
.data-table tbody tr { transition: var(--transition-fast); }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
    outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201, 164, 74, 0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--danger); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-card); color: var(--text-primary); }

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}
.form-error {
    font-size: 0.72rem;
    color: var(--danger);
    margin-top: 0.3rem;
    display: none;
}
.form-error.visible { display: block; }

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-500);
    flex-shrink: 0;
    margin-top: 2px;
}
.form-check label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
}

/* File upload */
.file-upload-zone {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    background: var(--bg-input);
}
.file-upload-zone:hover { border-color: var(--gold-500); background: rgba(201, 164, 74, 0.03); }
.file-upload-zone.dragover { border-color: var(--gold-500); background: rgba(201, 164, 74, 0.05); }
.file-upload-zone i { font-size: 2rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.file-upload-zone p { color: var(--text-muted); font-size: 0.85rem; }
.file-upload-zone .browse-link { color: var(--text-gold); font-weight: 600; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
    color: #FFFFFF;
}
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-gold); transform: translateY(-1px); }

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--gold-500); color: var(--text-gold); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #DC2626; }

.btn-success { background: var(--success); color: white; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--border-default); color: var(--text-primary); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 0.95rem; }
.btn-block { width: 100%; }

/* Loading spinner in button */
.btn .spinner { display: none; width: 16px; height: 16px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; }
.btn.loading .spinner { display: block; }
.btn.loading .btn-text { display: none; }

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

/* ===== BADGES & TAGS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-gold { background: rgba(201, 164, 74, 0.15); color: var(--text-gold); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: rgba(107, 114, 128, 0.15); color: var(--text-muted); }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-400));
    transition: width var(--transition-slow);
}
.progress-bar.success .progress-fill { background: var(--success); }
.progress-bar.warning .progress-fill { background: var(--warning); }
.progress-bar.danger .progress-fill { background: var(--danger); }

/* ===== STATUS PIPELINE ===== */
.pipeline {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.pipeline-stage {
    flex: 1;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem;
}
.pipeline-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}
.pipeline-stage-title { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.pipeline-stage-count { font-size: 0.7rem; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 8px; border-radius: 10px; }

.pipeline-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.pipeline-card:hover { border-color: var(--border-default); }
.pipeline-card-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.pipeline-card-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 450px;
    animation: toastSlide 0.3s ease-out;
    font-size: 0.85rem;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; margin-left: auto; }

@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFade 0.25s ease-out;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1.25rem; border-top: 1px solid var(--border-subtle); display: flex; gap: 0.75rem; justify-content: flex-end; }

@keyframes modalFade {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== STEPPER (Multi-step form) ===== */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0 1rem;
}
.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition-base);
}
.step.active .step-number { border-color: var(--gold-500); background: var(--gold-500); color: #FFFFFF; }
.step.completed .step-number { border-color: var(--success); background: var(--success); color: white; }
.step-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.step.active .step-label { color: var(--text-gold); }
.step.completed .step-label { color: var(--success); }
.step-connector { width: 40px; height: 2px; background: var(--border-default); margin: 0 0.25rem; flex-shrink: 0; }
.step-connector.active { background: var(--gold-500); }

/* Step panels */
.step-panel { display: none; animation: fadeIn 0.3s ease; }
.step-panel.active { display: block; }

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

/* ===== AUTH PAGES (Login / Signup) ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-primary);
}

.auth-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    max-width: 560px;
    margin: 0 auto;
}

.auth-right {
    flex: 1;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-right::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
    border-radius: 50%;
    animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.auth-right-content { text-align: center; z-index: 1; padding: 2rem; }
.auth-right-content h2 { font-size: 2rem; font-weight: 800; color: #FFFFFF; margin-bottom: 0.5rem; }
.auth-right-content p { color: rgba(255, 255, 255, 0.85); font-size: 1rem; }

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}
.auth-logo span { font-size: 1.3rem; font-weight: 400; }
.auth-logo strong { color: var(--text-gold); font-weight: 700; }

.auth-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.4rem; letter-spacing: -0.03em; }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

.auth-form .form-group { margin-bottom: 1.1rem; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== OTP INPUT ===== */
.otp-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 2rem 0;
}
.otp-input {
    width: 54px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: var(--bg-input);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-gold);
    outline: none;
    transition: var(--transition-fast);
}
.otp-input:focus { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201, 164, 74, 0.15); }

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.85rem; }

/* ===== SEARCH / FILTER BAR ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.search-input-wrapper i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.search-input-wrapper input {
    padding-left: 2.5rem;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
}
.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-primary);
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-gold); border-bottom-color: var(--gold-500); }

.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

/* ===== SETTINGS SECTION ===== */
.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}
.settings-section:last-child { border-bottom: none; }
.settings-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}
.settings-section-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* ===== ALERT BOX ===== */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.2); }

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ===== LIVENESS CHECK ===== */
/* Liveness — see bottom of file for active styles */

/* ===== ADDITIONAL FORM & UTILITY CLASSES ===== */
.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
    outline: none;
}
.form-control:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201, 164, 74, 0.1);
}
.form-control::placeholder { color: var(--text-muted); }

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (max-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

.btn-outline {
    background: transparent;
    color: var(--gold-600);
    border: 1px solid var(--gold-500);
}
.btn-outline:hover:not(:disabled) {
    background: var(--gold-500);
    color: #FFFFFF;
}

.data-table-wrapper { overflow-x: auto; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        z-index: 200;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
    .kpi-grid { grid-template-columns: 1fr; }
    .content-area { padding: 1rem; }
    .auth-right { display: none; }
    .auth-left { padding: 1.5rem; }
    .stepper { flex-wrap: wrap; gap: 0.5rem; }
    .step-connector { display: none; }
    .otp-inputs { gap: 0.5rem; }
    .otp-input { width: 44px; height: 50px; font-size: 1.2rem; }
    .filter-bar { flex-direction: column; }
    .pipeline { flex-direction: column; }
    .pipeline-stage { min-width: auto; }
}

/* ===== CLICKABLE STEPPER ===== */
.step-number {
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.step-number:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 4px rgba(201, 164, 74, 0.15);
}
.step-number:active {
    transform: scale(0.96);
}
.step-label { cursor: pointer; user-select: none; }

/* ===== SIGNATURE CANVAS ===== */
.signature-area {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: var(--bg-main);
    text-align: center;
    margin-top: 0.5rem;
}
.signature-area canvas {
    width: 100%;
    height: 160px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    cursor: crosshair;
    touch-action: none;
    display: block;
}
.signature-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}
.signature-actions .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.btn-clear-sig {
    background: none;
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
}
.btn-clear-sig:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ===== LIVENESS CHECK — FACE-SHAPED, COMPACT ===== */
.liveness-container {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    box-sizing: border-box;
}
.liveness-frame {
    position: relative;
    width: 160px;
    height: 200px;
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    border: 3px solid var(--border-default);
    overflow: hidden;
    background: #111;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}
.liveness-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    display: block;
}
.liveness-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}
.liveness-frame.scanning {
    border-color: var(--gold-500);
    animation: liveness-pulse 1.5s infinite;
}
.liveness-frame.success {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}
.liveness-frame.failed { border-color: var(--danger); }

@keyframes liveness-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 164, 74, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(201, 164, 74, 0); }
}

.liveness-prompt {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    min-height: 1.4em;
}
.liveness-prompt .dir {
    color: var(--gold-500);
    font-weight: 700;
}
.liveness-progress-bar {
    width: 100%;
    max-width: 200px;
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    overflow: hidden;
}
.liveness-progress-bar .fill {
    height: 100%;
    background: var(--gold-500);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}
.liveness-progress-bar .fill.done {
    background: var(--success);
}
.liveness-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}
#livenessOverlayCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: inherit;
    pointer-events: none;
    transform: scaleX(-1);
    z-index: 3;
}
.btn-success-state {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}
@media (max-width: 480px) {
    .liveness-frame { width: 130px; height: 165px; }
    .liveness-container { padding: 0.75rem; }
}

/* ===== REGISTRATION TYPE GRID (login page) ===== */
.login-reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}
.login-reg-grid .btn {
    font-size: 0.82rem;
    padding: 0.7rem 0.5rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid #E8E4DA;
    border-radius: 12px;
    background: #fff;
    color: #444;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}
.login-reg-grid .btn:hover {
    border-color: #B08D35;
    color: #B08D35;
    background: #FDFBF5;
}
.login-reg-grid .btn i {
    font-size: 0.85rem;
    color: #888;
}
.login-reg-grid .btn:hover i {
    color: #B08D35;
}
