/* ============================================================
   Platinum Heritage Design System - "The Luminous Vault"
   Premium Dark Fintech CSS
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,500;1,600;1,700&family=Manrope:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    /* Surface Hierarchy */
    --surface: #ffffff;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f6f7fa;
    --surface-container: #eceff5;
    --surface-container-high: #e2e7f0;
    --surface-container-highest: #d2d9e6;
    --surface-variant: rgba(236, 239, 245, 0.7);

    /* Primary Greens */
    --primary: #0b2a5b;
    --primary-container: #0b2a5b;
    --primary-fixed: #06183a;
    --primary-dim: #1d4a94;
    --on-primary: #ffffff;
    --on-primary-fixed: #ffffff;

    /* Secondary */
    --secondary: #1d4a94;
    --secondary-container: #dfe6f3;
    --on-secondary: #ffffff;
    --on-secondary-container: #0b2a5b;

    /* Tertiary (Neon Lime) */
    --tertiary: #b8891f;
    --tertiary-container: #f6ecd0;
    --tertiary-fixed: #e2b94e;
    --on-tertiary: #ffffff;

    /* Error */
    --error: #c62828;
    --error-container: #fde8e8;
    --on-error: #ffffff;

    /* Warning */
    --warning: #b45309;
    --warning-container: #fef3c7;

    /* Text */
    --on-surface: #0d1b36;
    --on-surface-variant: #55627a;
    --on-surface-dim: #8089a0;
    --outline: rgba(13, 27, 54, 0.14);
    --outline-variant: rgba(13, 27, 54, 0.08);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0b2a5b, #1d4a94);
    --gradient-hero: linear-gradient(135deg, #06183a 0%, #0b2a5b 60%, #0a2150 100%);
    --gradient-card: linear-gradient(145deg, #ffffff, #f6f7fa);
    --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(11, 42, 91, 0.10), transparent 60%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(13, 27, 54, 0.08);
    --shadow-md: 0 8px 24px rgba(13, 27, 54, 0.10);
    --shadow-lg: 0 20px 40px rgba(11, 42, 91, 0.14);
    --shadow-glow: 0 8px 30px rgba(11, 42, 91, 0.10);
    --shadow-glow-strong: 0 10px 40px rgba(11, 42, 91, 0.18);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Typography */
    --font-display: 'Manrope', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --gold: #c9a13b;
    --gold-soft: #f6ecd0;
    --navy: #0b2a5b;
    --navy-deep: #06183a;
    --green: #1f6b3a;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
}

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

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

body {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--on-surface);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

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

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-container-low); }
::-webkit-scrollbar-thumb { background: var(--surface-container-highest); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dim); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--on-surface);
    line-height: 1.2;
    font-weight: 600;
}

.display-lg { font-size: 3.5rem; font-weight: 300; letter-spacing: -0.02em; }
.display-md { font-size: 2.5rem; font-weight: 400; letter-spacing: -0.01em; }
.headline-lg { font-size: 2rem; font-weight: 600; }
.headline-md { font-size: 1.75rem; font-weight: 500; }
.title-lg { font-size: 1.375rem; font-weight: 600; font-family: var(--font-body); }
.title-md { font-size: 1.125rem; font-weight: 600; font-family: var(--font-body); }
.body-lg { font-size: 1rem; line-height: 1.6; }
.body-md { font-size: 0.875rem; line-height: 1.6; }
.body-sm { font-size: 0.8125rem; line-height: 1.5; }
.label-lg { font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.label-md { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.label-sm { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--on-surface-variant); }
.text-dim { color: var(--on-surface-dim); }
.text-success { color: var(--primary); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-tertiary { color: var(--tertiary); }
.text-white { color: #fff; }
.text-center { text-align: center; }
.text-right { text-align: right; }

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

/* ---- Layout ---- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 960px; }
.container-lg { max-width: 1280px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }

.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-12 { grid-column: span 12; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ---- Spacing Utilities ---- */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

/* ---- Glass Cards ---- */
.glass-card {
    background: var(--surface-variant);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--outline);
    transition: all var(--transition-base);
}

.glass-card:hover {
    border-color: rgba(11, 42, 91, 0.15);
    box-shadow: var(--shadow-glow);
}

.glass-card-elevated {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--outline);
    box-shadow: var(--shadow-md);
}

.surface-card {
    background: var(--surface-container-low);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--outline-variant);
}

.surface-card-high {
    background: var(--surface-container-high);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* Accent border top */
.card-accent {
    border-top: 2px solid transparent;
    border-image: var(--gradient-primary) 1;
    border-image-slice: 1;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
    background: var(--gradient-primary);
    color: var(--on-primary-fixed);
    box-shadow: 0 4px 16px rgba(11, 42, 91, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(11, 42, 91, 0.4);
    color: var(--on-primary-fixed);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(11, 42, 91, 0.2);
}

.btn-secondary:hover {
    background: rgba(11, 42, 91, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-tertiary {
    background: var(--tertiary);
    color: var(--on-tertiary);
}

.btn-danger {
    background: var(--error-container);
    color: var(--error);
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(147, 0, 10, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--on-surface-variant);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    background: var(--surface-container-high);
    color: var(--on-surface);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-xl { padding: 1.125rem 2.5rem; font-size: 1.0625rem; }
.btn-icon { padding: 0.625rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--on-surface-variant);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.02em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--on-surface);
    background: var(--surface-container-lowest);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: rgba(11, 42, 91, 0.3);
    box-shadow: 0 0 0 4px rgba(11, 42, 91, 0.08);
}

.form-input::placeholder {
    color: rgba(13, 27, 54, 0.5);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-select option {
    background: var(--surface-container);
    color: var(--on-surface);
}

.form-error {
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: var(--space-xs);
}

.form-hint {
    color: var(--on-surface-dim);
    font-size: 0.8125rem;
    margin-top: var(--space-xs);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    margin-top: 2px;
    flex-shrink: 0;
}

.input-icon-wrapper {
    position: relative;
}

.secret-entry {
    display: block;
    position: relative;
    min-width: 0;
}
.secret-entry > input.form-input { padding-inline-end: 3rem; }
.secret-entry-toggle {
    position: absolute;
    inset-inline-end: .35rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--on-surface-variant);
    cursor: pointer;
}
.secret-entry-toggle:hover { color: var(--primary); background: var(--surface-container-high); }
.secret-entry-toggle:focus-visible { outline: 2px solid var(--primary); }
.secret-entry-toggle .material-symbols-outlined { font-size: 1.25rem; }
.secret-entry:has(> input:disabled) .secret-entry-toggle { visibility: hidden; }
.secret-entry > input::-ms-reveal { display: none; }

.input-icon-wrapper .form-input {
    padding-left: 2.75rem;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--on-surface-dim);
    pointer-events: none;
    font-size: 1.125rem;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    line-height: 1.4;
}

.badge-success {
    background: rgba(11, 42, 91, 0.15);
    color: var(--primary);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(198, 40, 40, 0.15);
    color: var(--error);
}

.badge-info {
    background: rgba(11, 42, 91, 0.1);
    color: var(--primary-fixed);
}

.badge-neutral {
    background: var(--surface-container-high);
    color: var(--on-surface-variant);
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: var(--surface-container);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--on-surface-dim);
    white-space: nowrap;
}

.data-table td {
    padding: 0.875rem 1rem;
    color: var(--on-surface);
    border-bottom: 1px solid var(--outline-variant);
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: rgba(11, 42, 91, 0.03);
}

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

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 54, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface-container-low);
    border-radius: var(--radius-xl);
    border: 1px solid var(--outline);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--on-surface-dim);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background: var(--surface-container-high);
    color: var(--on-surface);
}

.modal-body { padding: var(--space-xl); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--outline-variant);
}

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

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: var(--space-xs);
    background: var(--surface-container);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--on-surface-dim);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-btn:hover { color: var(--on-surface); background: var(--surface-container-high); }
.tab-btn.active { background: var(--primary-container); color: #fff; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) 0;
    gap: var(--space-md);
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--on-surface-dim);
}

.pagination-btns {
    display: flex;
    gap: var(--space-xs);
}

.page-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--on-surface-variant);
    background: var(--surface-container);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary-container); color: #fff; border-color: var(--primary-container); }

/* ---- Alerts / Toasts ---- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

.alert-success { background: rgba(11, 42, 91, 0.1); border-left: 3px solid var(--primary); color: var(--primary-fixed); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-left: 3px solid var(--warning); color: var(--warning); }
.alert-error { background: rgba(198, 40, 40, 0.1); border-left: 3px solid var(--error); color: var(--error); }
.alert-info { background: rgba(11, 42, 91, 0.06); border-left: 3px solid var(--primary-dim); color: var(--on-surface); }

/* Toast notifications */
.toast-container {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--surface-container-high);
    border: 1px solid var(--outline);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideInRight 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.toast-exit { animation: slideOutRight 0.3s ease forwards; }

/* ---- Status Indicators ---- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.active { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.status-dot.pending { background: var(--warning); }
.status-dot.inactive { background: var(--on-surface-dim); }
.status-dot.error { background: var(--error); }

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ---- Progress Bar ---- */
.progress-bar {
    height: 6px;
    background: var(--surface-container);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--on-surface-dim);
    font-size: 0.875rem;
    max-width: 400px;
    margin: 0 auto var(--space-xl);
}

/* ---- Loader ---- */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-container-high);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-sm { width: 20px; height: 20px; border-width: 2px; }

.page-loader {
    position: fixed;
    inset: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: var(--space-xl);
}

.page-loader .logo-glow {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glowPulse 2s ease-in-out infinite;
}

/* ---- Timeline ---- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: var(--space-xl);
}

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

.timeline-item {
    position: relative;
    padding-bottom: var(--space-lg);
}

.timeline-dot {
    position: absolute;
    left: calc(-1 * var(--space-xl) + 2px);
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface-container-high);
    border: 2px solid var(--on-surface-dim);
}

.timeline-dot.completed { background: var(--primary); border-color: var(--primary); }
.timeline-dot.active { background: var(--warning); border-color: var(--warning); box-shadow: 0 0 8px var(--warning); }

.timeline-content h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: var(--space-xs); }
.timeline-content p { font-size: 0.8125rem; color: var(--on-surface-dim); }
.timeline-content .time { font-size: 0.75rem; color: var(--on-surface-dim); }

/* ---- Avatar ---- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--on-primary-fixed);
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.75rem; }

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

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

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

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

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

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

@keyframes glowPulse {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 10px rgba(11, 42, 91, 0.3)); }
    50% { filter: brightness(1.2) drop-shadow(0 0 20px rgba(11, 42, 91, 0.5)); }
}

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 8px rgba(11, 42, 91, 0.2); }
    50% { box-shadow: 0 0 16px rgba(11, 42, 91, 0.4); }
}

/* ---- Visibility ---- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .container { padding: 0 var(--space-lg); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .display-lg { font-size: 2.5rem; }
    .display-md { font-size: 2rem; }
}

@media (max-width: 768px) {
    .container { padding: 0 var(--space-md); }
    .grid-4 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-12 { grid-template-columns: 1fr; }
    .col-span-3, .col-span-4, .col-span-5,
    .col-span-6, .col-span-7, .col-span-8 { grid-column: span 1; }
    .form-row { grid-template-columns: 1fr; }
    .display-lg { font-size: 2rem; }
    .display-md { font-size: 1.5rem; }
    .headline-lg { font-size: 1.5rem; }
    .headline-md { font-size: 1.25rem; }
    .modal { margin: var(--space-md); max-height: 90vh; }
    .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    .btn-lg { padding: 0.875rem 1.5rem; }
}

/* ============================================================
   Luminous Vault Premium Effects
   (Integrated from stitch design mockups)
   ============================================================ */

/* ---- Glass Panel ---- */
.glass-panel {
    background: #ffffff;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border-top: 1px solid rgba(11, 42, 91, 0.15);
}

/* ---- Rim Light (Edge Highlight) ---- */
.rim-light {
    border-top: 1px solid rgba(11, 42, 91, 0.12);
}

/* ---- Vault Glow Effects ---- */
.vault-glow {
    box-shadow: 0 0 80px rgba(11, 42, 91, 0.15);
}

.emerald-glow {
    box-shadow: 0 0 30px rgba(11, 42, 91, 0.15);
}

.glow-border {
    box-shadow: inset 0 0 0 1px rgba(11, 42, 91, 0.1);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.glow-border:hover {
    box-shadow: inset 0 0 0 1px rgba(11, 42, 91, 0.25), 0 0 20px rgba(11, 42, 91, 0.1);
}

/* ---- Status Pulse (Secure Chip) ---- */
@keyframes statusPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(11, 42, 91, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(11, 42, 91, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(11, 42, 91, 0); }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: statusPulse 2s ease-in-out infinite;
    display: inline-block;
}

.pulse-dot-sm {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: statusPulse 2s ease-in-out infinite;
    display: inline-block;
}

/* ---- Secure Status Chip ---- */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.375rem 0.875rem;
    background: var(--secondary-container);
    border: 1px solid rgba(11, 42, 91, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
}

/* ---- Ambient Background Glow ---- */
.ambient-glow::before,
.ambient-glow::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.ambient-glow::before {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -100px;
    background: radial-gradient(circle, rgba(11, 42, 91, 0.06) 0%, transparent 70%);
}

.ambient-glow::after {
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -100px;
    background: radial-gradient(circle, rgba(11, 42, 91, 0.04) 0%, transparent 70%);
}

/* ---- Gradient Accent Top ---- */
.gradient-border-top {
    border-top: 2px solid transparent;
    border-image: var(--gradient-primary) 1;
}

/* ---- Material Symbols ---- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ---- Bento Grid ---- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
    .bento-grid > * { grid-column: span 1 !important; }
}

/* ---- Detail Grid (for admin modals) ---- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.detail-item {
    padding: var(--space-sm) 0;
}

.detail-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--on-surface-dim);
    margin-bottom: var(--space-xs);
}

.detail-value {
    font-size: 0.875rem;
    color: var(--on-surface);
    font-weight: 500;
}

@media (max-width: 640px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* ---- Outline Button ---- */
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(11, 42, 91, 0.25);
}

.btn-outline:hover {
    background: rgba(11, 42, 91, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- Approval Section (admin) ---- */
.approval-section {
    background: var(--surface-container);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.approval-section h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--on-surface-variant);
    margin-bottom: var(--space-md);
}

/* ---- Admin Note ---- */
.admin-note {
    background: var(--surface-container);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: var(--space-md);
}

.admin-note .note-meta {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--on-surface-dim);
    margin-bottom: var(--space-xs);
}

.admin-note .note-text {
    font-size: 0.875rem;
    color: var(--on-surface-variant);
    line-height: 1.5;
}
.support-widget {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 900;
    width: max-content;
    max-width: calc(100vw - 2rem);
}

.support-widget-launcher {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
    width: max-content;
    min-height: 44px;
    padding: .65rem 1rem;
    border-radius: 2rem;
    background: #0b2a5b;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 14px #0003;
    list-style: none;
}

.support-widget-launcher::-webkit-details-marker { display: none; }
.support-widget[open] { padding-bottom: 3.5rem; }
.support-widget[open] .support-widget-launcher { position: absolute; bottom: 0; right: 0; }

.support-widget-panel {
    width: min(22rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 5.5rem);
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    background: var(--surface-container);
    color: var(--on-surface);
    box-shadow: 0 5px 22px #0003;
}

.support-widget-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.support-widget-heading { margin-bottom: .75rem; }
.support-widget-heading h2 { font-size: 1rem; margin: 0; }
.support-widget-panel form { display: grid; gap: .4rem; }
.support-widget-panel form button { justify-self: start; margin-top: .35rem; }
.support-widget-panel [role="status"]:not([hidden]) { margin-top: .65rem; }
.support-widget [hidden] { display: none; }
.support-widget-unread { font-size: .75rem; background: #fff; color: #0b2a5b; padding: .15rem .45rem; border-radius: 1rem; }
#supportWidgetTopic { font-weight: 700; margin-bottom: .5rem; overflow-wrap: anywhere; }
.support-widget-thread {
    display: grid;
    gap: .5rem;
    max-height: min(16rem, 35dvh);
    overflow-y: auto;
    padding: .25rem .25rem .5rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--outline-variant);
}
.support-message {
    width: fit-content;
    max-width: 90%;
    padding: .5rem .65rem;
    border-radius: .65rem;
    background: var(--surface-container-high);
    overflow-wrap: anywhere;
}
.support-message-own { justify-self: end; background: #dce8f9; color: #0b2a5b; }
.support-message strong { font-size: .75rem; }
.support-message p { margin: .15rem 0 0; white-space: pre-wrap; }

.notification-toolbar,
.notification-row,
.notification-dialog-heading,
.notification-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.notification-toolbar,
.notification-dialog-heading {
    justify-content: space-between;
    flex-wrap: wrap;
}

.notification-toolbar { margin-bottom: var(--space-lg); }
.notification-toolbar .tabs { margin: 0; }
.notification-list { padding: 0; }
.notification-row { padding: .75rem 1rem; }
.notification-row + .notification-row { border-top: 1px solid var(--outline-variant); }
.notification-unread { background: var(--surface-container-low); }
.notification-open {
    display: grid;
    gap: .2rem;
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    padding: .25rem 0;
    text-align: left;
    color: inherit;
    font: inherit;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.notification-open:hover strong { text-decoration: underline; }
.notification-open time,
.notification-dialog time,
.notification-state { font-size: .8rem; color: var(--on-surface-variant); }
.notification-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(32rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 1.25rem;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    background: var(--surface-container);
    color: var(--on-surface);
}

.notification-dialog::backdrop { background: #0007; }
.notification-dialog h2 { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.notification-message { margin: 1rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notification-actions { flex-wrap: wrap; }
