/* OkiDoki Mileage – app theme (sits on top of Bootstrap 5.3) */
:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --ink: #231f20;
    --muted: #64748b;
    --line: #e5e9f2;
    --brand: #c8202a;
    --brand-dark: #a81a23;
    --brand-soft: #fcecee;
    --side: #ffffff;
    --side-ink: #4b5563;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);

    --bs-primary: var(--brand);
    --bs-primary-rgb: 200, 32, 42;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-border-color: var(--line);
    --bs-progress-bar-bg: var(--brand);
}

body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: #8f151d;
    --bs-btn-active-border-color: #8f151d;
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 200, 32, 42;
}
.btn { border-radius: 10px; font-weight: 500; }
.form-control, .form-select { border-radius: 10px; padding: .6rem .85rem; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(200, 32, 42, .15); }

/* ---------- Shell ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 1040;
    background: var(--side); color: var(--side-ink); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 1.25rem .85rem;
    transition: transform .2s ease;
}
.sidebar .brand { display: block; padding: .5rem .65rem 1.5rem; }
.sidebar .brand img { width: 100%; max-width: 170px; height: auto; display: block; }
.sidebar .nav-label {
    font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
    padding: .25rem .75rem; margin-bottom: .25rem; color: #9ca3af;
}
.sidebar .nav-link {
    display: flex; align-items: center; gap: .75rem; color: var(--side-ink);
    padding: .65rem .75rem; border-radius: 10px; font-weight: 500; font-size: .93rem;
}
.sidebar .nav-link i { font-size: 1.1rem; }
.sidebar .nav-link:hover { background: #f3f4f6; color: var(--ink); }
.sidebar .nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: .75rem; font-size: .75rem; color: #9ca3af; }

.main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1020; height: 64px; padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(244, 245, 248, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.user-chip {
    display: flex; align-items: center; gap: .6rem; background: var(--surface);
    border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem .3rem .3rem;
    color: var(--ink); font-weight: 500; font-size: .9rem;
}
.avatar {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .8rem;
}
.content { padding: 1.75rem 1.5rem 2rem; flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; }
.app-footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .8rem; text-align: center; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    body.sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1030;
    }
}

/* ---------- Components ---------- */
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 .25rem; }
.page-head p { color: var(--muted); margin: 0; }

.panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.5rem;
}
.panel h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .25rem; }
.panel .sub { color: var(--muted); font-size: .88rem; margin-bottom: 1.1rem; }

.stat { display: flex; align-items: center; gap: 1rem; }
.stat-icon {
    width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-size: 1.3rem; flex: none;
}
.stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }

.dropzone-box {
    display: block; cursor: pointer; text-align: center; padding: 2rem 1rem;
    border: 2px dashed #cbd5e1; border-radius: var(--radius); background: #f8fafc;
    transition: border-color .15s, background .15s;
}
.dropzone-box:hover, .dropzone-box.dragging { border-color: var(--brand); background: var(--brand-soft); }
.dropzone-box i { font-size: 2rem; color: var(--brand); }
.dropzone-box .dz-title { font-weight: 600; margin-top: .35rem; }
.dropzone-box .dz-hint { color: var(--muted); font-size: .85rem; }
.dropzone-box input[type=file] { display: none; }
.dropzone-box.has-file { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }

.progress { height: 12px; border-radius: 999px; background: #ececef; --bs-progress-bar-bg: var(--brand); }
.progress-bar { border-radius: 999px; transition: width .4s ease; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.kv .k { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.kv .v { font-weight: 600; word-break: break-word; }

.status-badge { font-weight: 600; font-size: .78rem; padding: .4em .8em; border-radius: 999px; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-art {
    background: radial-gradient(circle at 15% 15%, rgba(200, 32, 42, .75) 0, transparent 45%),
                radial-gradient(circle at 85% 90%, rgba(200, 32, 42, .45) 0, transparent 40%), #231f20;
    color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-logo { background: #fff; border-radius: 14px; padding: .9rem 1.25rem; display: inline-block; align-self: flex-start; }
.auth-logo img { height: 40px; display: block; }
.auth-art h2 { font-size: 2.2rem; font-weight: 700; max-width: 420px; line-height: 1.2; }
.auth-art p { color: #d1d5db; max-width: 420px; }
.auth-form { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-form .inner { width: 100%; max-width: 380px; }
@media (max-width: 899.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}

.auth-form-logo { display: none; height: 38px; margin-bottom: 2rem; }
@media (max-width: 899.98px) { .auth-form-logo { display: block; } }
