/*
 * Preedom Finance — shared design system.
 *
 * Every full page (app shell, login, 404, printed/QR-verify documents)
 * links this file instead of re-declaring its own copy of the palette —
 * see the design audit this consolidates. Change a token here and it
 * changes everywhere the brand shows up.
 *
 * Retheme: aligned to the "LedgerPoint Sovereign" system designed in
 * Stitch for the Requester/Dept-Head/Finance/Admin prepayment & deposit
 * dashboards (indigo primary, slate-900 structural anchor, Inter body,
 * JetBrains Mono for currency/tabular data, low-contrast outlined
 * surfaces instead of heavy drop shadows). Only tokens and shared
 * component rules changed here — every class name below is unchanged,
 * so no Blade template or controller logic was touched.
 */

:root {
    --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
    --font-display: "Inter", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

    --ink: #0f172a;
    --muted: #64748b;
    --primary: #4338ca;
    --primary-700: #3730a3;
    --primary-soft: #eef2ff;
    --accent: #0284c7;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --border: #e2e8f0;
    --border-structural: #cbd5e1;

    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-modal: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --radius: 8px;
    --radius-control: 4px;
    --radius-modal: 12px;

    --sidebar-width: 264px;
    --bottom-nav-height: 62px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ---------- base ---------- */

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface-alt);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .display-6 {
    font-family: var(--font-display);
}

/* ---------- app shell: sidebar (desktop) ---------- */

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

.brand-mark {
    align-items: center;
    display: inline-flex;
    font-family: var(--font-display);
    font-weight: 800;
    gap: 10px;
    letter-spacing: 0.2px;
}

.brand-logo {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(67, 56, 202, 0.22);
    height: 40px;
    object-fit: contain;
    padding: 4px;
    width: 40px;
}

/* "Preedom x MOB" on one line. */
.brand-text {
    align-items: baseline;
    display: flex;
    flex-direction: row;
    gap: 0.3em;
    line-height: 1.05;
    white-space: nowrap;
}

.brand-name {
    font-size: 1.1rem;
}

/* "x MOB" — same size as the brand name, set apart by colour only. */
.brand-subtitle {
    color: rgba(248, 250, 252, 0.72);
    font-size: 1.1rem;
}

.app-sidebar {
    background: linear-gradient(185deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
    backdrop-filter: blur(16px);
    bottom: 0;
    box-shadow: 6px 0 30px rgba(15, 23, 42, 0.16);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    left: 0;
    position: fixed;
    top: 0;
    width: var(--sidebar-width);
    z-index: 1040;
}

.sidebar-brand {
    align-items: center;
    border-bottom: 1px solid rgba(248, 250, 252, 0.1);
    display: flex;
    padding: 20px 18px;
}

.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    padding: 14px 12px;
}

.sidebar-link {
    align-items: center;
    border-radius: 12px;
    color: rgba(248, 250, 252, 0.76);
    display: flex;
    font-weight: 700;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link i.bi {
    font-size: 1.05rem;
    opacity: 0.8;
    text-align: center;
    width: 1.25rem;
}

.sidebar-link:hover {
    background: rgba(248, 250, 252, 0.08);
    color: #ffffff;
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(67, 56, 202, 0.45), rgba(67, 56, 202, 0.08));
    box-shadow: inset 3px 0 0 var(--primary);
    color: #ffffff;
}

.sidebar-link:hover i.bi,
.sidebar-link.active i.bi {
    opacity: 1;
}

.sidebar-group-label {
    border-top: 1px solid rgba(248, 250, 252, 0.1);
    color: rgba(248, 250, 252, 0.68);
    padding-top: 12px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin: 14px 14px 4px;
    text-transform: uppercase;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        display: none;
    }
}

/* ---------- app shell: desktop top bar (account menu lives here) ---------- */

.app-topbar-desktop {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: none;
    justify-content: space-between;
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

@media (min-width: 992px) {
    .app-topbar-desktop {
        display: flex;
    }
}

.topbar-context {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-weight: 700;
    gap: 8px;
}

.topbar-context i.bi {
    color: var(--primary);
}

.topbar-user-toggle {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink);
    padding: 6px 14px 6px 6px;
}

.topbar-user-toggle:hover,
.topbar-user-toggle:focus {
    background: var(--primary-soft);
}

/* ---------- app shell: main content ---------- */

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

@media (min-width: 992px) {
    .app-main {
        margin-left: var(--sidebar-width);
    }
}

@media (max-width: 991.98px) {
    .app-main {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 18px);
    }
}

.app-content {
    animation: fadeUp 0.6s ease-out both;
    position: relative;
    z-index: 1;
}

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

/* ---------- app shell: mobile top bar ---------- */

.app-topbar {
    align-items: center;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    color: #f8fafc;
    display: none;
    justify-content: space-between;
    padding: calc(10px + var(--safe-top)) 14px 10px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-icon-btn {
    align-items: center;
    background: rgba(248, 250, 252, 0.1);
    border: 0;
    border-radius: 12px;
    color: #f8fafc;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

/* Mobile top-bar account button — replaces the old hamburger icon. Opens a
   dropdown (company switch / password / logout), same content and pattern
   as the desktop topbar-user-toggle, just sized for the app bar's tight
   height. The caret is Bootstrap's own .dropdown-toggle::after, which
   inherits this button's (light) color so it stays visible on the dark bar. */
.topbar-account-btn {
    align-items: center;
    background: rgba(248, 250, 252, 0.1);
    border: 0;
    border-radius: 999px;
    color: #f8fafc;
    display: inline-flex;
    flex-shrink: 0;
    gap: 6px;
    height: 38px;
    max-width: 46vw;
    padding: 3px 10px 3px 3px;
}

.topbar-account-btn .user-avatar-sm {
    height: 30px;
    width: 30px;
}

.topbar-account-btn .user-avatar-sm svg {
    height: 16px;
    width: 16px;
}

.topbar-account-name {
    font-size: 0.8rem;
    font-weight: 700;
    max-width: 90px;
}

@media (max-width: 991.98px) {
    .app-topbar {
        display: flex;
    }
}

/* ---------- app shell: bottom nav (Android-style) ---------- */

.app-bottom-nav {
    background: var(--surface);
    border-top: 1px solid var(--border);
    bottom: 0;
    box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.1);
    display: none;
    left: 0;
    padding: 6px 4px calc(6px + var(--safe-bottom));
    position: fixed;
    right: 0;
    z-index: 1045;
}

@media (max-width: 991.98px) {
    .app-bottom-nav {
        display: flex;
    }
}

.bottom-nav-item {
    align-items: center;
    border-radius: 14px;
    color: var(--muted);
    display: flex;
    flex: 1;
    flex-direction: column;
    font-size: 0.66rem;
    font-weight: 700;
    gap: 2px;
    padding: 7px 2px 6px;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.bottom-nav-item i.bi {
    font-size: 1.32rem;
    line-height: 1;
}

.bottom-nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-700);
}

.bottom-nav-item:active {
    transform: scale(0.94);
}

/* ---------- app shell: floating action button ---------- */

.app-fab {
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
    display: none;
    position: fixed;
    right: 18px;
    z-index: 1046;
}

@media (max-width: 991.98px) {
    .app-fab {
        display: block;
    }
}

.app-fab .btn {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(67, 56, 202, 0.4);
    color: #ffffff;
    display: flex;
    font-size: 1.5rem;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.app-fab .btn:active {
    transform: scale(0.95);
}

.app-fab .dropdown-menu {
    border-radius: 16px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
    padding: 8px;
}

/* ---------- offcanvas "more" sheet (mobile) ---------- */

.offcanvas-bottom.app-sheet {
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    max-height: 82vh;
    padding-bottom: var(--safe-bottom);
}

.app-sheet .offcanvas-header {
    padding-bottom: 4px;
}

.sheet-handle {
    background: var(--border);
    border-radius: 999px;
    height: 4px;
    margin: 6px auto 2px;
    width: 40px;
}

.sheet-link {
    align-items: center;
    border-radius: 12px;
    color: var(--ink);
    display: flex;
    font-weight: 700;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
}

.sheet-link i.bi {
    color: var(--muted);
    font-size: 1.05rem;
    width: 1.25rem;
}

.sheet-link:hover,
.sheet-link.active {
    background: var(--primary-soft);
    color: var(--primary-700);
}

.sheet-link.active i.bi,
.sheet-link:hover i.bi {
    color: var(--primary-700);
}

/* generic dropdown polish reused by sidebar/topbar/sheet controls */

.dropdown-menu {
    border: 1px solid var(--border-structural);
    border-radius: var(--radius-modal);
    box-shadow: var(--shadow-modal);
    margin-top: 10px;
    max-width: min(320px, 90vw);
    width: 280px;
    z-index: 2000;
}

/* A percentage width inside a shrink-to-fit (auto-width) dropdown-menu is
   ambiguous — the box above pins an explicit width so this has something
   definite to resolve against, instead of the browser falling back to the
   select's own intrinsic (truncated) size. */
.company-switch-select {
    box-sizing: border-box;
    width: 100%;
}

.dropdown-item {
    align-items: center;
    border-radius: 10px;
    display: flex;
    gap: 0.55rem;
    margin: 2px 6px;
    width: calc(100% - 12px);
}

.dropdown-item i.bi {
    color: var(--muted);
    font-size: 0.95rem;
    width: 1.1rem;
}

.dropdown-item.active,
.dropdown-item:hover {
    background: var(--primary-soft);
    color: var(--primary-700);
}

.dropdown-item.active i.bi,
.dropdown-item:hover i.bi {
    color: var(--primary-700);
}

/* ---------- cards, tables, forms ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-stat {
    border: 0;
    box-shadow: var(--shadow-soft);
}

/* General-purpose card used by the dashboard widgets and the document
   detail pages (prepayment/deposit show) alike. */
.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 18px;
}

@media (max-width: 767.98px) {
    .app-card {
        border-radius: var(--radius);
        padding: 16px;
    }
}

.card-title-row {
    align-items: center;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.card-title-row h5 {
    align-items: center;
    display: flex;
    font-size: 1rem;
    font-weight: 800;
    gap: 8px;
}

.card-title-row h5 i.bi {
    color: var(--primary);
}

.table {
    border-color: var(--border);
}

.table thead th {
    background: var(--surface-alt);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table td, .table th {
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--surface-alt);
}

.btn {
    border-radius: var(--radius-control);
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-700);
    border-color: var(--primary-700);
}

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--muted);
}

.btn-outline-secondary:hover {
    background: #e2e8f0;
    color: var(--ink);
}

/* Icon-only action buttons (table "Aksi" columns): square, no label —
   the action is identified by icon + a title/aria-label tooltip instead
   of visible text, matching Stitch's dense inline table operations. */
.btn-icon {
    align-items: center;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    width: 32px;
}

.btn-icon.btn-sm {
    height: 28px;
    width: 28px;
}

.btn-icon i.bi {
    font-size: 0.95rem;
}

.action-cell {
    white-space: nowrap;
}

.action-cell > * + * {
    margin-left: 6px;
}

.form-control,
.form-select {
    border-color: var(--border-structural);
    border-radius: var(--radius-control);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(67, 56, 202, 0.16);
}

.alert {
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.user-avatar {
    align-items: center;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(67, 56, 202, 0.16);
    color: var(--primary);
    display: inline-flex;
    flex-shrink: 0;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.user-avatar svg {
    height: 20px;
    width: 20px;
}

/* ---------- status pills ---------- */

/* Status pills follow the LedgerPoint Sovereign semantic status matrix:
   Draft (slate) / Pending-Review (amber) / Approved (blue) /
   Paid-Disbursed (emerald) / Closed-Reconciled (dark slate) /
   Rejected-Overdue (rose). Preedom's workflow states map onto those six
   buckets below — the bucket a status belongs to is unchanged from
   before, only the token/dot styling is new. */
.status-pill {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 700;
    gap: 6px;
    justify-content: center;
    letter-spacing: 0.02em;
    line-height: 1.3;
    max-width: 100%;
    min-width: 0;
    padding: 0.28rem 0.6rem;
    text-align: center;
    text-transform: uppercase;
}

.status-pill::before {
    background: var(--status-dot, currentColor);
    border-radius: 50%;
    content: "";
    flex-shrink: 0;
    height: 6px;
    width: 6px;
}

/* Draft — uncommitted records. */
.status-draft   { background: #f1f5f9; color: #475569; border-color: #cbd5e1; --status-dot: #94a3b8; }

/* Pending / in review — sits with the approver, needs action. */
.status-submitted,
.status-dept_head_review,
.status-finance_review,
.status-return_pending { background: #fffbeb; color: #b45309; border-color: #fde68a; --status-dot: #f59e0b; }

/* Approved — authorized, queued for disbursement/reconciliation. */
.status-approved { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; --status-dot: #3b82f6; }

/* Rejected / overdue — non-compliance or blocked. */
.status-rejected { background: #fff1f2; color: #be123c; border-color: #fecdd3; --status-dot: #ef4444; }

/* Paid / disbursed — settled monetary movement (payout, or a deposit
   successfully returned to the company). */
.status-returned,
.status-paid { background: #ecfdf5; color: #047857; border-color: #a7f3d0; --status-dot: #10b981; }

/* Closed / reconciled — finalized, archived lifecycle. */
.status-closed,
.status-locked { background: #f8fafc; color: #334155; border-color: #e2e8f0; --status-dot: #64748b; }

/* ---------- return due calendar ---------- */

.calendar-nav {
    align-items: center;
    display: flex;
    gap: 8px;
}

.calendar-month-label {
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 800;
    min-width: 9ch;
    text-align: center;
}

.calendar-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 360px) 1fr;
    margin-top: 14px;
}

.calendar-weekdays {
    color: var(--muted);
    display: grid;
    font-size: 0.72rem;
    font-weight: 800;
    grid-template-columns: repeat(7, 1fr);
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    text-align: center;
    text-transform: uppercase;
}

.calendar-grid {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    aspect-ratio: 1;
    background: var(--surface-alt);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.calendar-day:hover {
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.calendar-day.is-blank {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.calendar-day.is-today {
    border-color: var(--primary-700);
}

.calendar-day.has-events {
    background: #fff7ed;
    color: #c2410c;
    font-weight: 800;
}

.calendar-day.is-selected {
    background: var(--primary-700);
    border-color: var(--primary-700);
    color: #fff;
}

.calendar-day-badge {
    align-items: center;
    background: #c2410c;
    border-radius: 999px;
    bottom: 3px;
    color: #fff;
    display: flex;
    font-size: 0.62rem;
    font-weight: 800;
    height: 15px;
    justify-content: center;
    min-width: 15px;
    padding: 0 3px;
    position: absolute;
    right: 3px;
}

.calendar-day.is-selected .calendar-day-badge {
    background: #fff;
    color: var(--primary-700);
}

.calendar-detail {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.calendar-event-item {
    border-bottom: 1px solid var(--border);
    color: inherit;
    display: block;
    padding: 10px 0;
    text-decoration: none;
}

.calendar-event-item:last-child { border-bottom: 0; padding-bottom: 0; }
.calendar-event-item:first-child { padding-top: 0; }

.calendar-event-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.calendar-event-type {
    color: var(--ink);
    font-weight: 700;
}

.calendar-event-amount {
    color: #c2410c;
    font-weight: 800;
    white-space: nowrap;
}

.calendar-event-desc {
    color: var(--ink);
    display: block;
    font-size: 0.85rem;
    margin-top: 2px;
}

.calendar-event-meta {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .calendar-layout {
        grid-template-columns: 1fr;
    }
}

/* ---------- notification bell ---------- */

.notification-bell-toggle {
    align-items: center;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    height: 38px;
    justify-content: center;
    position: relative;
    width: 38px;
}

.notification-bell-toggle:hover,
.notification-bell-toggle:focus {
    background: var(--primary-soft);
}

.notification-bell-toggle::after {
    display: none;
}

/* Mobile topbar is a dark bar (see .app-topbar) — match its translucent
   icon-button treatment instead of the light desktop toggle above. */
.app-topbar .notification-bell-toggle {
    background: rgba(248, 250, 252, 0.1);
    border: 0;
    color: #f8fafc;
}

.app-topbar .notification-bell-toggle:hover,
.app-topbar .notification-bell-toggle:focus {
    background: rgba(248, 250, 252, 0.18);
}

.notification-bell-badge {
    align-items: center;
    background: #c2410c;
    border: 2px solid var(--surface);
    border-radius: 999px;
    color: #fff;
    display: flex;
    font-size: 0.6rem;
    font-weight: 800;
    height: 17px;
    justify-content: center;
    min-width: 17px;
    padding: 0 3px;
    position: absolute;
    right: -4px;
    top: -4px;
}

.app-topbar .notification-bell-badge {
    border-color: #0f172a;
}

.notification-panel {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
    width: min(380px, 92vw);
}

.notification-panel-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
}

.notification-empty {
    padding: 1.5rem 1rem;
}

.notification-item-form {
    display: block;
    margin: 0;
}

.notification-item {
    align-items: flex-start;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    text-align: left;
    width: 100%;
}

.notification-item-form:last-child .notification-item {
    border-bottom: 0;
}

.notification-item:hover {
    background: var(--surface-alt);
}

.notification-item.is-unread {
    background: var(--primary-soft);
}

.notification-item-icon {
    align-items: center;
    background: var(--surface);
    border-radius: 10px;
    color: var(--primary-700);
    display: flex;
    flex-shrink: 0;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.notification-item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.notification-item-message {
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: normal;
}

.notification-item-meta {
    color: var(--muted);
    font-size: 0.75rem;
}

/* ---------- empty states ---------- */

.empty-state {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 2.75rem 1rem;
    text-align: center;
}

.empty-state i.bi {
    color: #cbd5e1;
    font-size: 2rem;
    margin-bottom: 0.35rem;
}

.empty-state strong {
    color: var(--ink);
    font-size: 0.98rem;
}

.empty-state span {
    font-size: 0.88rem;
    max-width: 32ch;
}

/* ---------- standalone auth-style pages (login) ---------- */

.auth-shell {
    padding: 24px;
    width: 100%;
}

.auth-grid {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 1024px;
}

.login-card {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.12);
    max-width: 440px;
    overflow: hidden;
    width: 100%;
}

/* ---------- responsive table -> stacked cards ---------- */

@media (max-width: 768px) {
    .table-mobile thead {
        display: none;
    }

    .table-mobile,
    .table-mobile tbody,
    .table-mobile tr,
    .table-mobile td {
        display: block;
        width: 100%;
    }

    .table-mobile tr {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow-soft);
        margin-bottom: 12px;
        padding: 12px 14px;
    }

    .table-mobile td {
        border: 0;
        display: flex;
        gap: 12px;
        justify-content: space-between;
        padding: 6px 0;
    }

    .table-mobile td::before {
        color: var(--muted);
        content: attr(data-label);
        flex: 0 0 130px;
        font-weight: 600;
    }

    .table-mobile .action-cell {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
    }

    .table-mobile .status-cell {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        justify-content: flex-start;
    }

    .table-mobile .status-cell::before {
        margin-bottom: 4px;
    }

    .table-mobile .empty-row td {
        justify-content: center;
        text-align: center;
    }

    .table-mobile .empty-row td::before {
        content: "";
        flex: 0 0 0;
    }
}

/* ---------- document detail pages (prepayment/deposit show) ---------- */

.doc-header {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px;
}

.doc-header-icon {
    align-items: center;
    background: var(--primary-soft);
    border-radius: 16px;
    color: var(--primary-700);
    display: flex;
    flex-shrink: 0;
    font-size: 1.5rem;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.doc-header-meta {
    flex: 1;
    min-width: 0;
}

.doc-header-eyebrow {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.doc-header-number {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0.1rem 0 0.35rem;
}

.doc-alert {
    align-items: center;
    border-radius: 14px;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 18px;
}

.doc-alert i.bi {
    font-size: 1.3rem;
}

.doc-alert.doc-alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.doc-alert.doc-alert-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Approval progress stepper */
.approval-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    position: relative;
}

.approval-steps::before {
    background: var(--border);
    content: "";
    height: 2px;
    left: 5%;
    position: absolute;
    right: 5%;
    top: 17px;
    z-index: 0;
}

.approval-step {
    align-items: center;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    position: relative;
    text-align: center;
    z-index: 1;
}

.approval-step-dot {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    display: flex;
    font-size: 0.85rem;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.approval-step-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    max-width: 80px;
}

.approval-step.is-done .approval-step-dot {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.approval-step.is-done .approval-step-label {
    color: var(--ink);
}

.approval-step.is-active .approval-step-dot {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    color: #ffffff;
}

.approval-step.is-active .approval-step-label {
    color: var(--primary-700);
    font-weight: 800;
}

@media (max-width: 575.98px) {
    .approval-step-label { display: none; }
}

/* Label/value detail grid */
.detail-grid {
    display: grid;
    gap: 14px 20px;
    grid-template-columns: repeat(2, 1fr);
}

.detail-item {
    min-width: 0;
}

.detail-label {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.7rem;
    font-weight: 800;
    gap: 6px;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.detail-value {
    color: var(--ink);
    font-weight: 600;
    overflow-wrap: break-word;
}

/* Person/process timeline */
.timeline {
    display: flex;
    flex-direction: column;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 18px;
    position: relative;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    background: var(--border);
    bottom: 0;
    content: "";
    left: 13px;
    position: absolute;
    top: 28px;
    width: 2px;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    align-items: center;
    background: var(--surface-alt);
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    display: flex;
    flex-shrink: 0;
    font-size: 0.8rem;
    height: 28px;
    justify-content: center;
    width: 28px;
    z-index: 1;
}

.timeline-item.is-done .timeline-dot {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.timeline-item.is-rejected .timeline-dot {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

.timeline-title {
    font-size: 0.86rem;
    font-weight: 700;
}

.timeline-sub {
    color: var(--muted);
    font-size: 0.78rem;
}

.timeline-note {
    background: var(--surface-alt);
    border-radius: 10px;
    color: var(--ink);
    font-size: 0.82rem;
    margin-top: 4px;
    padding: 8px 10px;
}

/* Action panel (approve/reject/etc forms) */
.action-panel .app-card + .app-card {
    margin-top: 14px;
}

.action-form {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.action-form + .action-form {
    margin-top: 10px;
}

.items-table thead th {
    background: var(--surface-alt);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.items-table td.text-end,
.items-table th.text-end {
    font-family: var(--font-mono);
}

.items-table tfoot th {
    background: var(--primary-soft);
    color: var(--primary-700);
    font-size: 1rem;
}
