/* ==========================================================================
   Arshiva — kurumsal tasarım sistemi (marka turuncusu logodan: #E3602A)
   Bootstrap 5.3 üzerine; renkler ve ölçüler tek yerden (token) yönetilir.
   ========================================================================== */
:root {
    --brand-900: #432010;
    --brand-800: #65280e;
    --brand-700: #88330d;
    --brand-600: #a64110;
    --brand-500: #bd521b;
    --brand-100: #f5e3d6;
    --brand-50: #fcf4ed;
    --accent: #e3602a;
    --accent-600: #a64110;
    --accent-50: #fdf0ea;
    --gold: #f4ad38;
    --ink: #2b211d;
    --ink-2: #493831;
    --muted: #6e5d55;
    --line: #e8ddd4;
    --line-2: #f3eae3;
    --line-strong: #cdb4a2;
    --surface: #ffffff;
    --bg: #faf6f1;
    --shell-top: #35241e;
    --shell-bottom: #211815;
    --shell-text: #f2e3d9;
    --shell-muted: #c9ad9c;
    --success: #13795b;
    --success-50: #e7f5ef;
    --danger: #b42318;
    --danger-50: #fdecea;
    --warning: #a15c07;
    --warning-50: #fff4e0;
    --info: #0b6aa2;
    --info-50: #e6f3fb;
    --primary-tone: var(--brand-700);
    --primary-50: var(--brand-100);
    --secondary-tone: var(--muted);
    --secondary-50: var(--line-2);
    --dark-tone: var(--ink-2);
    --dark-50: #efe5dc;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(54, 29, 14, .07);
    --shadow: 0 4px 14px rgba(54, 29, 14, .10);
    --sidebar-w: 268px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 166, 65, 16;
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 166, 65, 16;
    --bs-link-hover-color: var(--brand-800);
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
}

html {
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: .9375rem;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    color: var(--ink);
    letter-spacing: -.015em;
}

a {
    text-underline-offset: 3px;
}

code {
    color: var(--brand-600);
    background: var(--brand-50);
    padding: .1rem .35rem;
    border-radius: 6px;
    font-size: .82em;
}

.text-muted, .text-secondary {
    color: var(--muted) !important;
}

.small-caps {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
}

:focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 3px;
}

.sidebar :focus-visible, .auth-aside :focus-visible {
    outline-color: var(--gold);
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 2000;
    background: #fff;
    padding: 8px 14px;
    border-radius: 8px;
}

    .skip-link:focus {
        left: 8px;
    }

/* ---------- Buttons & forms ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: .55rem 1rem;
}

.btn-sm {
    padding: .35rem .7rem;
    border-radius: 8px;
}

.btn-primary {
    --bs-btn-bg: var(--brand-600);
    --bs-btn-border-color: var(--brand-600);
    --bs-btn-hover-bg: var(--brand-700);
    --bs-btn-hover-border-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-800);
    --bs-btn-active-border-color: var(--brand-800);
    --bs-btn-focus-shadow-rgb: 166, 65, 16;
    --bs-btn-disabled-bg: var(--brand-600);
    --bs-btn-disabled-border-color: var(--brand-600);
}

.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent-600);
    --bs-btn-border-color: var(--accent-600);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent-600);
    --bs-btn-hover-border-color: var(--accent-600);
    --bs-btn-active-bg: var(--accent-600);
    --bs-btn-active-color: #fff;
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-600);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-active-bg: var(--brand-800);
    --bs-btn-active-border-color: var(--brand-800);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
}

.btn-soft {
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-100);
}

    .btn-soft:hover {
        background: var(--brand-100);
        color: var(--brand-800);
    }

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--line-strong);
    padding: .55rem .8rem;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 .2rem rgba(227, 96, 42, .15);
    }

.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--ink-2);
    margin-bottom: .35rem;
}

.form-text {
    color: var(--muted);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-switch .form-check-input {
    width: 2.4em;
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: linear-gradient(180deg, var(--shell-top) 0%, var(--shell-bottom) 100%);
    color: var(--shell-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

    .sidebar .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 22px 22px 18px;
        color: #fff;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #f2a03d);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 6px 16px rgba(227, 96, 42, .35);
    flex: 0 0 40px;
}

.brand-text strong {
    display: block;
    font-size: 1rem;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.brand-text small {
    display: block;
    color: var(--shell-muted);
    font-size: .72rem;
    letter-spacing: .04em;
}

.sidebar nav {
    padding: 14px 12px;
    overflow-y: auto;
    flex: 1;
}

.nav-section {
    color: var(--shell-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 16px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 0;
    color: var(--shell-text);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: .9rem;
    transition: background .15s, color .15s;
}

    .sidebar-link i {
        width: 18px;
        text-align: center;
        color: var(--shell-muted);
        transition: color .15s;
    }

    .sidebar-link:hover {
        background: rgba(255, 255, 255, .07);
        color: #fff;
    }

        .sidebar-link:hover i {
            color: #fff;
        }

    .sidebar-link.active {
        background: rgba(227, 96, 42, .16);
        color: #fff;
        box-shadow: inset 3px 0 0 var(--accent);
    }

        .sidebar-link.active i {
            color: var(--gold);
        }

    .sidebar-link .count {
        margin-left: auto;
        background: var(--accent-600);
        color: #fff;
        font-size: .7rem;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: 99px;
    }

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .74rem;
    color: var(--shell-muted);
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--line);
    height: 64px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
}

    .topbar .page-crumb {
        font-size: .85rem;
        color: var(--muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .topbar .page-crumb strong {
            color: var(--ink);
            font-weight: 600;
        }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 4px;
    border-radius: 99px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
}

    .user-chip:hover {
        border-color: var(--line-strong);
        color: var(--ink);
    }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-100);
    color: var(--brand-700);
    font-weight: 700;
    font-size: .8rem;
    flex: 0 0 32px;
}

.user-chip .who {
    line-height: 1.1;
    font-size: .82rem;
}

    .user-chip .who small {
        display: block;
        color: var(--muted);
        font-size: .7rem;
    }

.content {
    padding: 28px;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

.app-footer {
    padding: 18px 28px;
    color: var(--muted);
    font-size: .78rem;
    border-top: 1px solid var(--line);
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    justify-content: space-between;
}

.menu-btn {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    width: 40px;
    height: 40px;
}

.offcanvas.sidebar-offcanvas {
    background: linear-gradient(180deg, var(--shell-top) 0%, var(--shell-bottom) 100%);
    width: var(--sidebar-w);
}

    .offcanvas.sidebar-offcanvas .sidebar {
        position: static;
        height: 100%;
        width: 100%;
        background: none;
    }

@media (max-width: 991.98px) {
    .app-shell > .sidebar {
        display: none;
    }

    .menu-btn {
        display: inline-grid;
        place-items: center;
    }

    .topbar {
        padding: 0 16px;
    }

    .content {
        padding: 20px 16px;
    }

    .app-footer {
        padding: 16px;
    }

    .user-chip .who {
        display: none;
    }
}

/* ---------- Public (anonymous) pages ---------- */
.public-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

    .public-header .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--ink);
        text-decoration: none;
    }

    .public-header .brand-text small {
        color: var(--muted);
    }

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

.auth-aside {
    background: radial-gradient(1200px 600px at -10% -10%, rgba(227, 96, 42, .35), transparent 60%), linear-gradient(160deg, var(--shell-top), var(--shell-bottom));
    color: var(--shell-text);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

    .auth-aside:after {
        content: "";
        position: absolute;
        right: -120px;
        bottom: -120px;
        width: 360px;
        height: 360px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, .08);
        box-shadow: 0 0 0 40px rgba(255, 255, 255, .02), 0 0 0 80px rgba(255, 255, 255, .02);
    }

    .auth-aside .brand {
        color: #fff;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .auth-aside h2 {
        color: #fff;
        font-weight: 700;
        font-size: clamp(1.6rem, 2.6vw, 2.2rem);
        line-height: 1.2;
        max-width: 520px;
    }

.auth-feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 18px;
    max-width: 480px;
}

    .auth-feature i {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border-radius: 10px;
        display: grid;
        place-items: center;
        background: rgba(255, 255, 255, .08);
        color: var(--gold);
    }

    .auth-feature strong {
        color: #fff;
        display: block;
        font-size: .92rem;
    }

    .auth-feature span {
        font-size: .84rem;
        color: var(--shell-muted);
    }

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

    .auth-card h1 {
        font-size: 1.6rem;
        font-weight: 700;
    }

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        padding: 24px 20px;
    }

        .auth-aside .auth-features, .auth-aside .aside-foot {
            display: none;
        }

        .auth-aside h2 {
            font-size: 1.25rem;
            margin: 14px 0 0;
        }

    .auth-main {
        padding: 28px 16px 40px;
        align-items: flex-start;
    }
}

/* ---------- Page header ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

    .page-header h1 {
        font-size: clamp(1.35rem, 2.4vw, 1.75rem);
        font-weight: 700;
        margin: 0 0 4px;
    }

    .page-header p {
        margin: 0;
        color: var(--muted);
    }

.eyebrow {
    color: var(--accent-600);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 12px;
}

    .back-link:hover {
        color: var(--brand-600);
    }

/* ---------- Surfaces ---------- */
.card-surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

    .card-surface > .card-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
        padding: 16px 20px;
        border-bottom: 1px solid var(--line-2);
    }

        .card-surface > .card-head h2, .card-surface > .card-head h3 {
            font-size: 1rem;
            font-weight: 650;
            margin: 0;
        }

    .card-surface > .card-body {
        padding: 20px;
    }

    .card-surface > .card-foot {
        padding: 14px 20px;
        border-top: 1px solid var(--line-2);
        background: var(--brand-50);
        border-radius: 0 0 var(--radius) var(--radius);
    }

.section-title {
    font-size: 1rem;
    font-weight: 650;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .section-title i {
        color: var(--accent-600);
    }

/* KPI tiles */
.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    height: 100%;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, transform .15s;
}

a.kpi:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
    color: inherit;
}

.kpi .kpi-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
}

.kpi .kpi-label {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 500;
}

.kpi .kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
}

.kpi .kpi-sub {
    font-size: .75rem;
    color: var(--muted);
    margin-top: 2px;
}

.tone-success {
    background: var(--success-50);
    color: var(--success);
}

.tone-danger {
    background: var(--danger-50);
    color: var(--danger);
}

.tone-warning {
    background: var(--warning-50);
    color: var(--warning);
}

.tone-info {
    background: var(--info-50);
    color: var(--info);
}

.tone-primary {
    background: var(--primary-50);
    color: var(--primary-tone);
}

.tone-secondary {
    background: var(--secondary-50);
    color: var(--secondary-tone);
}

.tone-dark {
    background: var(--dark-50);
    color: var(--dark-tone);
}

.tone-accent {
    background: var(--accent-50);
    color: var(--accent-600);
}

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: .76rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

    .status-pill.tone-success {
        border-color: #c6e9db;
    }

    .status-pill.tone-danger {
        border-color: #f7cbc6;
    }

    .status-pill.tone-warning {
        border-color: #f6dfb5;
    }

    .status-pill.tone-info {
        border-color: #c4e2f4;
    }

    .status-pill.tone-primary {
        border-color: var(--brand-100);
    }

    .status-pill.tone-secondary {
        border-color: var(--line);
    }

    .status-pill.tone-dark {
        border-color: var(--line);
    }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: .74rem;
    font-weight: 600;
    background: var(--line-2);
    color: var(--ink-2);
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Progress */
.progress {
    height: 8px;
    border-radius: 99px;
    background: var(--line-2);
}

.progress-bar {
    background: var(--accent-600);
}

.progress-stacked {
    display: flex;
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    background: var(--line-2);
}

    .progress-stacked span {
        display: block;
        height: 100%;
    }

/* Application cards */
.app-card {
    display: block;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}

    .app-card:hover {
        border-color: var(--line-strong);
        box-shadow: var(--shadow);
        color: inherit;
    }

    .app-card .title {
        font-weight: 650;
        font-size: 1rem;
    }

.empty-state {
    text-align: center;
    padding: 42px 20px;
    color: var(--muted);
}

    .empty-state .icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        margin: 0 auto 12px;
        display: grid;
        place-items: center;
        background: var(--brand-50);
        color: var(--brand-500);
        font-size: 1.4rem;
    }

/* Document cards (applicant) */
.doc-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

    .doc-card.is-approved {
        border-left: 4px solid var(--success);
    }

    .doc-card.is-rejected {
        border-left: 4px solid var(--danger);
    }

    .doc-card.is-review {
        border-left: 4px solid var(--warning);
    }

    .doc-card.is-progress {
        border-left: 4px solid var(--info);
    }

    .doc-card .doc-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: grid;
        place-items: center;
        flex: 0 0 40px;
    }

    .doc-card .doc-title {
        font-weight: 650;
    }

.reason-box {
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: .85rem;
}

    .reason-box ul {
        margin: 4px 0 0;
        padding-left: 18px;
    }

    .reason-box.danger {
        background: var(--danger-50);
        color: #7a1a12;
    }

    .reason-box.warning {
        background: var(--warning-50);
        color: #6b3d05;
    }

    .reason-box.info {
        background: var(--brand-50);
        color: var(--brand-800);
    }

/* Dropzone */
.dropzone {
    position: relative;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--brand-50);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

    .dropzone:hover, .dropzone.is-over {
        border-color: var(--accent);
        background: var(--accent-50);
    }

    .dropzone input[type=file] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
        width: 100%;
    }

    .dropzone .dz-icon {
        color: var(--brand-500);
        font-size: 1.3rem;
    }

    .dropzone .dz-text {
        font-size: .85rem;
        color: var(--ink-2);
    }

    .dropzone .dz-file {
        font-size: .82rem;
        font-weight: 600;
        color: var(--accent-600);
        word-break: break-all;
    }

/* Stepper */
.stepper {
    display: flex;
    gap: 0;
    counter-reset: step;
}

    .stepper .step {
        flex: 1;
        position: relative;
        text-align: center;
        font-size: .76rem;
        color: var(--muted);
        padding-top: 34px;
    }

        .stepper .step:before {
            content: counter(step);
            counter-increment: step;
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid var(--line);
            display: grid;
            place-items: center;
            font-weight: 700;
            font-size: .75rem;
            z-index: 1;
        }

        .stepper .step:after {
            content: "";
            position: absolute;
            top: 12px;
            left: calc(-50% + 14px);
            right: calc(50% + 14px);
            height: 2px;
            background: var(--line);
        }

        .stepper .step:first-child:after {
            display: none;
        }

        .stepper .step.done {
            color: var(--ink-2);
        }

            .stepper .step.done:before {
                content: "✓";
                background: var(--accent-600);
                border-color: var(--accent-600);
                color: #fff;
            }

            .stepper .step.done:after, .stepper .step.current:after {
                background: var(--accent);
            }

        .stepper .step.current {
            color: var(--ink);
            font-weight: 600;
        }

            .stepper .step.current:before {
                border-color: var(--accent);
                color: var(--accent-600);
            }

/* Tabs / segmented */
.seg-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
}

    .seg-tabs a {
        padding: 10px 14px;
        color: var(--muted);
        text-decoration: none;
        font-weight: 600;
        font-size: .88rem;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

        .seg-tabs a:hover {
            color: var(--ink);
        }

        .seg-tabs a.active {
            color: var(--brand-700);
            border-bottom-color: var(--accent);
        }

    .seg-tabs .count {
        background: var(--line-2);
        color: var(--ink-2);
        border-radius: 99px;
        padding: 1px 8px;
        font-size: .72rem;
    }

    .seg-tabs a.active .count {
        background: var(--accent-50);
        color: var(--accent-600);
    }

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

    .filter-bar > * {
        flex: 1 1 180px;
    }

    .filter-bar > .actions {
        flex: 0 0 auto;
        display: flex;
        gap: 8px;
    }

/* Tables: become stacked cards on small screens */
.table {
    --bs-table-border-color: var(--line-2);
    margin-bottom: 0;
}

    .table > thead th {
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--muted);
        font-weight: 650;
        background: var(--bg);
        border-bottom-color: var(--line);
        white-space: nowrap;
    }

    .table > :not(caption) > * > * {
        padding: .8rem .9rem;
    }

.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: var(--brand-50);
}

tr.row-link {
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .table-stack thead {
        display: none;
    }

    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td {
        display: block;
        width: 100%;
    }

        .table-stack tr {
            border: 1px solid var(--line);
            border-radius: var(--radius-sm);
            margin: 10px 0;
            padding: 6px 4px;
            background: #fff;
        }

        .table-stack td {
            border: 0 !important;
            padding: .35rem .8rem !important;
            display: flex;
            justify-content: space-between;
            gap: 12px;
            text-align: right;
        }

            .table-stack td:before {
                content: attr(data-label);
                font-size: .72rem;
                text-transform: uppercase;
                letter-spacing: .05em;
                color: var(--muted);
                font-weight: 650;
                text-align: left;
                flex: 0 0 auto;
            }

            .table-stack td[data-label=""]:before {
                display: none;
            }

            .table-stack td.td-actions {
                justify-content: flex-end;
            }
}

/* Review detail */
.preview-frame {
    width: 100%;
    height: min(78vh, 900px);
    border: 0;
    border-radius: var(--radius-sm);
    background: #525659;
}

.preview-img {
    max-width: 100%;
    max-height: 78vh;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.preview-wrap {
    background: var(--line-2);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.kv {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px 14px;
    font-size: .86rem;
    margin: 0;
}

    .kv dt {
        color: var(--muted);
        font-weight: 500;
    }

    .kv dd {
        margin: 0;
        color: var(--ink);
        word-break: break-word;
    }

@media (max-width: 575.98px) {
    .kv {
        grid-template-columns: 1fr;
        gap: 2px;
    }

        .kv dd {
            margin-bottom: 8px;
        }
}

.decision-panel {
    position: sticky;
    top: 84px;
}

.decision-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

    .decision-choice input {
        display: none;
    }

    .decision-choice label {
        border: 1.5px solid var(--line);
        border-radius: var(--radius-sm);
        padding: 12px;
        text-align: center;
        cursor: pointer;
        font-weight: 600;
        font-size: .88rem;
        transition: all .15s;
    }

        .decision-choice label i {
            display: block;
            font-size: 1.2rem;
            margin-bottom: 4px;
        }

    .decision-choice input:checked + label.approve {
        border-color: var(--success);
        background: var(--success-50);
        color: var(--success);
    }

    .decision-choice input:checked + label.reject {
        border-color: var(--danger);
        background: var(--danger-50);
        color: var(--danger);
    }

.quick-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .quick-reasons button {
        border: 1px solid var(--line);
        background: #fff;
        border-radius: 99px;
        font-size: .74rem;
        padding: 3px 10px;
        color: var(--ink-2);
    }

        .quick-reasons button:hover {
            border-color: var(--accent);
            color: var(--accent-600);
        }

/* Timeline */
.timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .timeline li {
        position: relative;
        padding: 0 0 18px 28px;
    }

        .timeline li:before {
            content: "";
            position: absolute;
            left: 7px;
            top: 18px;
            bottom: 0;
            width: 2px;
            background: var(--line);
        }

        .timeline li:last-child:before {
            display: none;
        }

    .timeline .dot {
        position: absolute;
        left: 0;
        top: 4px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #fff;
        border: 3px solid var(--brand-500);
    }

        .timeline .dot.success {
            border-color: var(--success);
        }

        .timeline .dot.danger {
            border-color: var(--danger);
        }

        .timeline .dot.warning {
            border-color: var(--gold);
        }

    .timeline .t-title {
        font-weight: 600;
        font-size: .88rem;
    }

    .timeline .t-meta {
        font-size: .76rem;
        color: var(--muted);
    }

/* Admin sub navigation */
.subnav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    margin-bottom: 20px;
    scrollbar-width: thin;
}

    .subnav a {
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        border-radius: 99px;
        font-size: .84rem;
        font-weight: 600;
        color: var(--ink-2);
        background: #fff;
        border: 1px solid var(--line);
        text-decoration: none;
    }

        .subnav a:hover {
            border-color: var(--line-strong);
            color: var(--brand-700);
        }

        .subnav a.active {
            background: var(--brand-700);
            border-color: var(--brand-700);
            color: #fff;
        }

/* Service status */
.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 4px rgba(19, 121, 91, .15);
    background: var(--success);
}

    .health-dot.down {
        background: var(--danger);
        box-shadow: 0 0 0 4px rgba(180, 35, 24, .15);
    }

    .health-dot.warn {
        background: var(--gold);
        box-shadow: 0 0 0 4px rgba(196, 154, 58, .18);
    }

.bar-row {
    display: grid;
    grid-template-columns: 190px 1fr 36px;
    gap: 12px;
    align-items: center;
    font-size: .84rem;
    padding: 6px 0;
}

    .bar-row .bar {
        height: 8px;
        border-radius: 99px;
        background: var(--line-2);
        overflow: hidden;
    }

        .bar-row .bar span {
            display: block;
            height: 100%;
            background: var(--brand-500);
            border-radius: 99px;
        }

.id-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: 8px;
    padding: 3px 4px 3px 9px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--brand-700);
    margin: 2px;
}

    .id-tag button {
        border: 0;
        background: none;
        color: var(--muted);
        padding: 0 4px;
        line-height: 1;
    }

        .id-tag button:hover {
            color: var(--danger);
        }

.min-w-0 {
    min-width: 0;
}

.card-surface form, .card-surface label {
    min-width: 0;
    max-width: 100%;
}

.card-surface input, .card-surface select {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .bar-row {
        grid-template-columns: 1fr 44px;
    }

        .bar-row .bar {
            grid-column: 1 / -1;
            grid-row: 2;
        }

    .page-header .progress {
        width: 100% !important;
    }

    .page-header > .text-end {
        width: 100%;
        text-align: left !important;
    }
}

/* Alerts */
.alert {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: .9rem;
}

.alert-success {
    background: var(--success-50);
    border-color: #c6e9db;
    color: #0b5640;
}

.alert-danger {
    background: var(--danger-50);
    border-color: #f7cbc6;
    color: #7a1a12;
}

.alert-warning {
    background: var(--warning-50);
    border-color: #f6dfb5;
    color: #6b3d05;
}

.alert-info {
    background: var(--brand-50);
    border-color: var(--brand-100);
    color: var(--brand-800);
}

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
}

    .toast-stack .alert {
        box-shadow: var(--shadow);
        margin: 0;
        display: flex;
        gap: 10px;
        align-items: flex-start;
    }

.modal-content {
    border-radius: var(--radius);
    border: 0;
}

.dropdown-menu {
    border-radius: var(--radius-sm);
    border-color: var(--line);
    box-shadow: var(--shadow);
}

.spin-slow {
    animation: spin 1.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Arshiva logo ---------- */
.brand-logo {
    display: block;
    height: 34px;
    width: auto;
}

.sidebar .brand {
    display: block;
    padding: 10px 20px 10px;
    background: var(--surface);
    border-bottom: 3px solid var(--accent);
    border-right: 1px solid var(--line);
}

    .sidebar .brand:focus-visible {
        outline-color: var(--brand-600);
        outline-offset: -5px;
    }

.sidebar .brand-logo {
    width: 68%;
    height: auto;
    margin: 0 auto;
}

.sidebar .brand-text small {
    color: var(--muted);
}

.auth-aside .brand-text {
    max-width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius);
}

.auth-aside .brand-logo {
    width: min(240px, 100%);
    height: auto;
}

.auth-aside .brand-text small {
    color: var(--muted);
}

.public-header .brand-logo {
    height: 32px;
}

.brand-text small {
    margin-top: 7px;
}
