:root {
    --bg: #0b1326;
    --bg-alt: #060e20;
    --surface-low: #131b2e;
    --surface: #171f33;
    --surface-high: #222a3d;
    --surface-variant: #2d3449;
    --outline: #8c909f;
    --outline-variant: #424754;
    --text: #dae2fd;
    --text-muted: #c2c6d6;
    --primary: #adc6ff;
    --primary-strong: #4d8eff;
    --secondary: #c0c1ff;
    --tertiary: #ffb786;
    --success: #34d399;
    --danger: #ffb4ab;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

[data-bs-theme="light"] {
    --bg: #edf3ff;
    --bg-alt: #ffffff;
    --surface-low: rgba(255, 255, 255, 0.92);
    --surface: rgba(255, 255, 255, 0.9);
    --surface-high: #eef4ff;
    --surface-variant: #d8e2f4;
    --outline: #8f9ab2;
    --outline-variant: #ccd8ea;
    --text: #122038;
    --text-muted: #50607b;
    --primary: #005ac2;
    --primary-strong: #005ac2;
    --secondary: #3838b8;
    --tertiary: #a95000;
    --success: #0f9f6e;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(77, 142, 255, 0.14), transparent 22%),
        radial-gradient(circle at bottom left, rgba(192, 193, 255, 0.1), transparent 20%),
        linear-gradient(160deg, var(--bg), var(--bg-alt) 65%);
    color: var(--text);
    font-family: "Inter", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

.font-geist {
    font-family: "Geist", system-ui, sans-serif;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    width: 272px;
    background: rgba(19, 27, 46, 0.86);
    border-right: 1px solid rgba(140, 144, 159, 0.16);
    backdrop-filter: blur(16px);
}

.sidebar-brand {
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    border-radius: 999px;
    transition: 0.2s ease;
    font-size: 0.92rem;
    font-weight: 500;
}

.nav-pill:hover,
.nav-pill.active {
    background: rgba(49, 49, 192, 0.2);
    color: var(--text);
}

.main-column {
    flex: 1;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 19, 38, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(140, 144, 159, 0.12);
}

[data-bs-theme="light"] .topbar {
    background: rgba(237, 243, 255, 0.88);
}

.icon-btn,
.theme-btn {
    border: 1px solid rgba(140, 144, 159, 0.18);
    background: rgba(45, 52, 73, 0.35);
    color: var(--text-muted);
    border-radius: 999px;
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-shell {
    position: relative;
}

.search-shell .material-symbols-outlined {
    position: absolute;
    inset: 50% auto auto 0.9rem;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input,
.form-control,
.form-select,
textarea {
    background: rgba(6, 14, 32, 0.84) !important;
    border: 1px solid rgba(140, 144, 159, 0.18) !important;
    color: var(--text) !important;
    border-radius: 1rem !important;
    box-shadow: none !important;
}

[data-bs-theme="light"] .search-input,
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select,
[data-bs-theme="light"] textarea {
    background: rgba(255, 255, 255, 0.94) !important;
}

.search-input {
    padding-left: 2.75rem;
}

.form-control::placeholder,
textarea::placeholder,
.search-input::placeholder {
    color: var(--text-muted);
}

.glass-panel,
.stat-card,
.data-panel {
    background: rgba(23, 31, 51, 0.72);
    border: 1px solid rgba(140, 144, 159, 0.14);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    border-radius: 1.15rem;
}

[data-bs-theme="light"] .glass-panel,
[data-bs-theme="light"] .stat-card,
[data-bs-theme="light"] .data-panel {
    background: rgba(255, 255, 255, 0.85);
}

.stat-card {
    padding: 1.4rem;
    height: 100%;
}

.metric-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.metric-primary { background: rgba(77, 142, 255, 0.16); color: var(--primary); }
.metric-secondary { background: rgba(49, 49, 192, 0.18); color: var(--secondary); }
.metric-tertiary { background: rgba(223, 116, 18, 0.18); color: var(--tertiary); }

.drop-zone {
    border: 2px dashed rgba(140, 144, 159, 0.32);
    border-radius: 1.2rem;
    padding: 1.25rem;
    background: rgba(6, 14, 32, 0.38);
    transition: 0.2s ease;
}

.drop-zone.dragover {
    border-color: var(--primary-strong);
    background: rgba(77, 142, 255, 0.08);
}

.upload-hero {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
}

.upload-hero .hero-icon {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 999px;
    background: rgba(77, 142, 255, 0.18);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.section-title {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-subtitle { color: var(--text-muted); }

.pill-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(45, 52, 73, 0.5);
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: "Geist", system-ui, sans-serif;
}

.btn-primary,
.btn-outline-primary,
.btn-outline-light,
.btn-outline-warning,
.btn-outline-danger,
.btn-danger {
    border-radius: 1rem !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--primary-strong) !important;
    border-color: var(--primary-strong) !important;
    color: #f7fbff !important;
}

.btn-outline-primary { color: var(--primary) !important; border-color: rgba(77, 142, 255, 0.4) !important; }
.btn-outline-light { color: var(--text) !important; border-color: rgba(140, 144, 159, 0.2) !important; }
.btn-outline-warning { color: var(--tertiary) !important; border-color: rgba(223, 116, 18, 0.3) !important; }
.btn-outline-danger,
.btn-danger { color: var(--danger) !important; border-color: rgba(255, 180, 171, 0.3) !important; background: rgba(147, 0, 10, 0.08) !important; }

.table-wrap {
    overflow: hidden;
    border-radius: 1.1rem;
    border: 1px solid rgba(140, 144, 159, 0.12);
}

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(34, 42, 61, 0.18);
    --bs-table-hover-bg: rgba(77, 142, 255, 0.06);
    --bs-table-border-color: rgba(140, 144, 159, 0.12);
    color: var(--text);
    margin: 0;
}

.table-dark thead th {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.74rem;
    font-family: "Geist", system-ui, sans-serif;
}

.file-card {
    border-radius: 1rem;
    border: 1px solid rgba(140, 144, 159, 0.14);
    background: rgba(19, 27, 46, 0.75);
    padding: 0.9rem;
}

.file-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(45, 52, 73, 0.55);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.preview-thumb {
    width: 3.5rem;
    height: 4.4rem;
    object-fit: cover;
    border-radius: 0.85rem;
    border: 1px solid rgba(140, 144, 159, 0.18);
}

.file-order-list { display: grid; gap: 0.6rem; }

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: rgba(23, 31, 51, 0.82);
    border: 1px solid rgba(140, 144, 159, 0.14);
    border-radius: 1rem;
    cursor: move;
}

.timeline-list { display: grid; gap: 0.8rem; }

.timeline-item {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(19, 27, 46, 0.75);
    border-left: 3px solid rgba(77, 142, 255, 0.8);
}

.mobile-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
    background: rgba(23, 31, 51, 0.95);
    border-top: 1px solid rgba(140, 144, 159, 0.14);
    backdrop-filter: blur(18px);
}

.dock-link {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.75rem;
    font-family: "Geist", system-ui, sans-serif;
}

.dock-link.active { color: var(--text); }
.dock-link .material-symbols-outlined { display: block; margin-bottom: 0.15rem; }

.hero-panel { padding: 2rem; }
.auth-shell { min-height: calc(100vh - 88px); display: grid; align-items: center; }
.auth-card { padding: 2rem; }
.auth-side { max-width: 34rem; }
.alert { border-radius: 1rem; border: 1px solid rgba(140, 144, 159, 0.14); }
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24; }

@media (max-width: 991.98px) {
    .main-column { padding-bottom: 5.25rem; }
    .section-title { font-size: 1.6rem; }
}
