/* ============================================================
   Oxford Travels and Tours — admin theme
   Re-skinned to the "Shapes Community Club" design language:
   dark-navy dashboard by default, glassy rounded cards, Inter,
   boxed sidebar icons, pill buttons. Light theme via the toggle.
   Accent (red) + gold/blue/purple are drawn from the globe logo.
   Everything themes from the tokens below (single source of truth).
   ============================================================ */

:root {
    /* ---- LIGHT theme (the alternate; dark is the default look) ---- */
    /* Brand accent — logo red. Kept under the legacy --ovs-green* names so
       every component re-themes from these values alone. */
    --ovs-green: #e2453f;      /* accent light (gradient start) */
    --ovs-green-600: #d92d2a;  /* accent (primary) */
    --ovs-green-700: #b01d1d;  /* accent dark */
    --ovs-grad: linear-gradient(135deg, #e2453f 0%, #b01d1d 100%);
    --ovs-green-soft: #fdecea; /* accent tint (hovers) */
    --ovs-primary: #d92d2a;
    --ovs-primary-rgb: 217, 45, 42;

    /* logo palette (secondary accents) */
    --ovs-gold: #c2851f;
    --ovs-blue-accent: #2d6cdf;
    --ovs-purple: #6d2eb6;

    --ovs-bg: #eef0f8;
    --ovs-surface: #ffffff;
    --ovs-surface-2: #f1f3fb;
    --ovs-border: #e5e8f2;
    --ovs-ink: #55608a;        /* body text */
    --ovs-heading: #141a3a;    /* headings */
    --ovs-muted: #8a90b0;
    --ovs-label: #9aa0bd;

    /* Semantic */
    --ovs-success: #0a9d6e;
    --ovs-success-soft: #e3f5ee;
    --ovs-warning: #c2851f;
    --ovs-warning-soft: #f7ecd6;
    --ovs-red: #d64545;
    --ovs-red-soft: #fbe6e6;
    --ovs-blue: #3f7bf6;

    /* Sidebar — dark navy in BOTH themes (constant) */
    --ovs-sidebar: #0b1030;
    --ovs-sidebar-ink: #ffffff;
    --ovs-sidebar-mut: #9aa2c9;
    --ovs-sidebar-hover: rgba(255, 255, 255, .05);

    --ovs-sidebar-w: 260px;
    --ovs-topbar-h: 72px;
    --ovs-radius: 18px;
    --ovs-radius-sm: 12px;
    --ovs-pill: 999px;
    --ovs-shadow: 0 2px 6px rgba(20, 26, 58, .06), 0 14px 36px rgba(20, 26, 58, .08);
    --ovs-shadow-lg: 0 20px 54px rgba(20, 26, 58, .16);

    --ovs-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- DARK navy theme — the DEFAULT look (class added by site.js) ---- */
body.dark-mode {
    --ovs-bg: radial-gradient(1100px 560px at 78% -12%, #26357f 0%, rgba(15, 21, 53, 0) 55%),
              linear-gradient(180deg, #101740 0%, #0a0e29 100%);
    --ovs-surface: #141b44;
    --ovs-surface-2: #1b2356;
    --ovs-border: #2a3268;
    --ovs-ink: #a3aed0;
    --ovs-heading: #ffffff;
    --ovs-muted: #7079a8;
    --ovs-label: #7079a8;

    --ovs-green-soft: rgba(217, 45, 42, .18);
    --ovs-success: #01b574; --ovs-success-soft: rgba(1, 181, 116, .16);
    --ovs-warning: #e2a13a; --ovs-warning-soft: rgba(226, 161, 58, .16);
    --ovs-red: #ef5350;     --ovs-red-soft: rgba(239, 83, 80, .16);
    --ovs-blue: #3f7bf6;
    --ovs-shadow: 0 2px 8px rgba(3, 7, 25, .35), 0 18px 44px rgba(3, 7, 25, .42);
    --ovs-shadow-lg: 0 24px 60px rgba(3, 7, 25, .6);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--ovs-bg);
    background-attachment: fixed;
    color: var(--ovs-ink);
    font-family: var(--ovs-font);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--ovs-green-600); }

/* ---------- Layout shell ---------- */
.layout-wrapper { min-height: 100vh; }

.app-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--ovs-sidebar-w);
    background: var(--ovs-sidebar);
    color: var(--ovs-sidebar-ink);
    display: flex; flex-direction: column;
    z-index: 1030;
    transition: transform .25s ease;
    /* scrollable, hidden scrollbar chrome */
    scrollbar-width: none;
}
.app-sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }

.app-main {
    margin-left: var(--ovs-sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left .25s ease;
}

.page-content { flex: 1; padding: calc(var(--ovs-topbar-h) + 26px) 30px 34px; width: 100%; }

/* ---------- Brand ---------- */
.app-brand {
    height: var(--ovs-topbar-h);
    display: flex; align-items: center; gap: 11px;
    padding: 0 20px; flex: none;
}
.app-brand .brand-mark,
.auth-brand .brand-mark { display: none; }         /* legacy letter mark — replaced by the logo image */
.brand-logo { display: block; width: auto; height: 40px; max-width: 100%; }
.app-brand .brand-name {
    font-size: 18px; font-weight: 800; color: var(--ovs-sidebar-ink);
    letter-spacing: -.02em; line-height: 1.05;
}

/* ---------- Sidebar nav ---------- */
.sidebar-scroll { overflow-y: auto; padding: 6px 14px 24px; flex: 1; scrollbar-width: none; }
.sidebar-scroll::-webkit-scrollbar { width: 0; display: none; }
.nav-label {
    text-transform: uppercase; font-size: 10.5px; font-weight: 700;
    letter-spacing: .16em; color: var(--ovs-sidebar-mut); padding: 18px 12px 8px;
}
.nav-item-link {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; border-radius: var(--ovs-radius-sm);
    color: var(--ovs-sidebar-ink); font-weight: 500; font-size: 14px;
    margin-bottom: 3px; transition: background .14s ease, color .14s ease;
}
.nav-item-link i {
    width: 34px; height: 34px; border-radius: 11px; flex: none;
    display: grid; place-items: center; font-size: 16px;
    background: rgba(255, 255, 255, .06); color: var(--ovs-sidebar-mut);
    transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.nav-item-link:hover { background: var(--ovs-sidebar-hover); color: #fff; }
.nav-item-link:hover i { color: #fff; }
.nav-item-link.active { background: var(--ovs-sidebar-hover); color: #fff; font-weight: 650; }
.nav-item-link.active i {
    background: var(--ovs-green-600); color: #fff;
    box-shadow: 0 6px 16px rgba(var(--ovs-primary-rgb), .5);
}
.nav-item-link .nav-plus { margin-left: auto; font-size: 15px; color: var(--ovs-sidebar-mut); }

/* ---------- Topbar (glassy) ---------- */
.app-topbar {
    position: fixed; top: 0; right: 0; left: var(--ovs-sidebar-w);
    height: var(--ovs-topbar-h);
    background: color-mix(in srgb, var(--ovs-bg) 72%, transparent);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid var(--ovs-border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 30px; z-index: 1020;
    transition: left .25s ease;
}
.topbar-user { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ovs-heading); }
.topbar-user img { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; }
.topbar-branch {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 2px; padding: 6px 13px; border-radius: var(--ovs-pill);
    font-size: 12.5px; font-weight: 650; white-space: nowrap;
    color: var(--ovs-green-600); background: var(--ovs-green-soft);
    border: 1px solid color-mix(in srgb, var(--ovs-green-600) 35%, transparent);
}
.topbar-icon {
    width: 42px; height: 42px; border-radius: var(--ovs-pill);
    display: grid; place-items: center;
    color: var(--ovs-muted); font-size: 18px;
    border: 1px solid var(--ovs-border); background: var(--ovs-surface); cursor: pointer;
    transition: background .14s ease, color .14s ease;
}
.topbar-icon:hover { background: var(--ovs-surface-2); color: var(--ovs-heading); }
.topbar-search { position: relative; }
.topbar-search input {
    border: 1px solid var(--ovs-border); background: var(--ovs-surface); border-radius: var(--ovs-pill);
    padding: 9px 16px 9px 40px; width: 230px; font-size: 13px; color: var(--ovs-ink); outline: none;
}
.topbar-search input:focus { border-color: var(--ovs-green-600); }
.topbar-search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ovs-muted); }
.topbar-links a { color: var(--ovs-muted); font-weight: 600; padding: 0 10px; }
.topbar-links a:hover { color: var(--ovs-green-600); }

.sidebar-toggle { display: none; }

/* ---------- Breadcrumb / page head ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-head .crumb { color: var(--ovs-muted); font-size: 12.5px; letter-spacing: .01em; }
.page-head .crumb b { color: var(--ovs-green-600); }
.page-head h4 { margin: 4px 0 2px; font-size: 24px; font-weight: 750; color: var(--ovs-heading); letter-spacing: -.025em; }

/* ---------- Buttons ---------- */
.btn-ovs {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--ovs-grad); color: #fff; border: none;
    border-radius: var(--ovs-pill); padding: 10px 20px; font-weight: 650; font-size: 13px;
    box-shadow: 0 8px 20px rgba(var(--ovs-primary-rgb), .32); cursor: pointer;
}
.btn-ovs:hover { color: #fff; filter: brightness(1.06); }
.btn-ghost {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--ovs-surface); color: var(--ovs-heading); border: 1px solid var(--ovs-border);
    border-radius: var(--ovs-pill); padding: 10px 18px; font-weight: 650; font-size: 13px; cursor: pointer;
}
.btn-ghost:hover { background: var(--ovs-surface-2); }
.btn-sm { padding: .34rem .7rem !important; font-size: 12px !important; }

/* ---------- Auth pages (branded dark splash) ---------- */
.auth-wrap {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px;
    background: radial-gradient(1100px 560px at 78% -12%, #26357f 0%, rgba(15, 21, 53, 0) 55%),
                linear-gradient(180deg, #101740 0%, #0a0e29 100%);
    background-attachment: fixed;
}
.auth-card {
    width: 100%; max-width: 410px; background: #141b44; border: 1px solid #2a3268;
    border-radius: var(--ovs-radius); box-shadow: var(--ovs-shadow-lg); padding: 2.2rem;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 1.6rem; }
.auth-brand .brand-logo { height: 72px; }
.auth-brand .brand-name { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.auth-title { font-size: 1.6rem; font-weight: 780; color: #fff; margin: 0 0 .3rem; letter-spacing: -.02em; }
.auth-sub { color: #a3aed0; font-size: .9rem; margin: 0 0 1.6rem; }
.auth-foot { color: rgba(255, 255, 255, .55); font-size: .8rem; margin-top: 1.3rem; }
.auth-wrap .form-ctrl { background: #1b2356; border-color: #2a3268; color: #e7eaf6; }
.auth-wrap .form-ctrl::placeholder { color: #7079a8; }
.auth-wrap .form-lbl { color: #cdd3ea; }

/* ---------- Avatars & client details ---------- */
.avatar-sm { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; flex: none; }
.avatar-lg { width: 66px; height: 66px; border-radius: 18px; object-fit: cover; flex: none; border: 1px solid var(--ovs-border); background: var(--ovs-surface-2); }
.client-cell { display: flex; align-items: center; gap: 10px; }
.doc-upload { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.doc-upload .form-ctrl { max-width: 360px; }

/* Filter bar + modals */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; }
.modal-content.ovs-card { border-radius: var(--ovs-radius); background: var(--ovs-surface); }
.modal-title { color: var(--ovs-heading); font-size: 1.05rem; font-weight: 700; }
.modal-header, .modal-footer { border-color: var(--ovs-border); }

/* ID images (CNIC / passport) */
.id-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.id-image { display: flex; flex-direction: column; gap: .4rem; }
.id-thumb { width: 100%; height: 130px; object-fit: cover; border-radius: var(--ovs-radius-sm); border: 1px solid var(--ovs-border); background: var(--ovs-surface-2); }
.id-view { display: block; }
@media (max-width: 768px) { .id-images { grid-template-columns: 1fr; } }

/* ---------- Modern form sections ---------- */
.form-section + .form-section { margin-top: 1.6rem; padding-top: 1.5rem; border-top: 1px solid var(--ovs-border); }
.form-section-title { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ovs-muted); margin-bottom: 1rem; }
.profile-pic-row { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.3rem; }
.profile-pic-meta { min-width: 0; }

/* Compact native file input */
.file-compact { font-size: 12.5px; color: var(--ovs-muted); max-width: 100%; }
.file-compact::file-selector-button {
    border: 1px solid var(--ovs-border); background: var(--ovs-surface); color: var(--ovs-heading);
    border-radius: 8px; padding: .4rem .8rem; font-size: 12.5px; font-weight: 600; cursor: pointer;
    margin-right: .65rem; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.file-compact::file-selector-button:hover { background: var(--ovs-green-soft); border-color: var(--ovs-green-600); color: var(--ovs-green-600); }

/* Compact ID upload tiles */
.upload-tiles { display: flex; flex-direction: column; gap: .7rem; }
.upload-tile { display: flex; align-items: center; gap: .9rem; padding: .65rem .8rem; border: 1px solid var(--ovs-border); border-radius: var(--ovs-radius-sm); background: var(--ovs-surface-2); }
.upload-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid var(--ovs-border); background: var(--ovs-surface); }
.upload-body { display: flex; flex-direction: column; gap: .4rem; flex: 1; min-width: 0; }
.upload-title { font-size: 12.5px; font-weight: 600; color: var(--ovs-heading); }
.upload-title i { color: var(--ovs-green-600); margin-right: .25rem; }

/* Dropzone-style upload */
.upload-drop { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border: 1.5px dashed var(--ovs-border); border-radius: var(--ovs-radius-sm); background: var(--ovs-surface-2); }
.upload-drop > .bi { font-size: 22px; color: var(--ovs-green-600); flex: none; }
.upload-drop-body { flex: 1; min-width: 0; }
.upload-files { font-size: 12px; color: var(--ovs-muted); margin-top: .45rem; }
.doc-upload .file-compact { max-width: 260px; }

/* ---------- Report hub cards ---------- */
.report-card { display: block; text-decoration: none; color: inherit; transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
a.report-card:hover { box-shadow: var(--ovs-shadow); transform: translateY(-3px); border-color: color-mix(in srgb, var(--ovs-green-600) 45%, var(--ovs-border)); }
.report-card .stat-icon { width: 46px; height: 46px; border-radius: 13px; font-size: 18px; background: var(--ovs-green-soft); color: var(--ovs-green-600); margin-bottom: 12px; }
.report-card .report-title { font-weight: 700; color: var(--ovs-heading); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.report-card .report-go { margin-top: 12px; font-weight: 650; font-size: 12.5px; color: var(--ovs-green-600); }
.report-card.is-soon { opacity: .72; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
/* An inner <form> (e.g. the auto-submitting scope/branch selector) must not break the flex row:
   display:contents lets its controls sit inline with the rest of the filter bar. */
.filter-bar form { display: contents; }
/* width:auto so each control sizes to its content and they sit inline (the base .form-ctrl is width:100%). */
.filter-bar .form-ctrl { width: auto; min-width: 150px; height: 40px; padding: 6px 12px; font-size: 13px; }
.filter-bar select.form-ctrl { max-width: 220px; }
.filter-bar input[type="search"] { width: auto; min-width: 240px; }
.ovs-table .sal-in { max-width: 130px; padding: 6px 10px; }
.pay-in { max-width: 120px; padding: 6px 10px; }

/* List card header: title on the left, filters/search grouped on the right (wraps cleanly on mobile) */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.list-toolbar .ovs-card-title { flex: none; }
.list-toolbar .filter-bar { flex: 1 1 auto; }

/* ---------- Searchable select (progressive enhancement of <select>) ---------- */
.ss { position: relative; display: block; width: 100%; }
.filter-bar .ss { width: auto; min-width: 170px; }
.ss-input {
    width: 100%; min-height: 40px; display: flex; align-items: center;
    background: var(--ovs-surface-2); border: 1.5px solid var(--ovs-border); color: var(--ovs-heading);
    border-radius: var(--ovs-radius-sm); padding: .5rem 2.4rem .5rem .9rem; font-size: .92rem; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a90b0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .9rem center;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.filter-bar .ss-input { min-height: 40px; font-size: 13px; }
.ss-input.placeholder { color: var(--ovs-muted); }
.ss.open .ss-input { border-color: var(--ovs-green-600); box-shadow: 0 0 0 3px rgba(var(--ovs-primary-rgb), .2); }
.ss-panel {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1200;
    background: var(--ovs-surface); border: 1px solid var(--ovs-border); border-radius: var(--ovs-radius-sm);
    box-shadow: var(--ovs-shadow-lg); overflow: hidden; display: none; min-width: 210px;
}
.ss.open .ss-panel { display: block; }
.ss-search { padding: .5rem; border-bottom: 1px solid var(--ovs-border); }
.ss-search input { width: 100%; padding: .5rem .7rem; border-radius: 8px; border: 1px solid var(--ovs-border); background: var(--ovs-surface-2); color: var(--ovs-heading); font-family: inherit; font-size: .9rem; outline: none; }
.ss-search input:focus { border-color: var(--ovs-green-600); }
.ss-list { max-height: 260px; overflow-y: auto; }
.ss-opt { padding: .55rem .85rem; font-size: .9rem; cursor: pointer; color: var(--ovs-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-opt:hover, .ss-opt.active { background: var(--ovs-green-soft); color: var(--ovs-green-600); }
.ss-opt.sel { font-weight: 650; color: var(--ovs-green-600); }
.ss-empty { padding: .8rem; color: var(--ovs-muted); font-size: .85rem; text-align: center; }

/* ---------- Segmented branch buttons (dashboard scope) ---------- */
.branch-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--ovs-pill); background: var(--ovs-surface-2); border: 1px solid var(--ovs-border); }
.branch-seg-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .42rem .95rem; border-radius: var(--ovs-pill);
    font-size: 12.5px; font-weight: 650; color: var(--ovs-ink); text-decoration: none;
    transition: background .14s ease, color .14s ease;
}
.branch-seg-btn:hover { color: var(--ovs-heading); }
.branch-seg-btn.on { background: var(--ovs-grad); color: #fff; box-shadow: 0 6px 14px rgba(var(--ovs-primary-rgb), .3); }

/* ---------- Danger button ---------- */
.btn-danger { display: inline-flex; align-items: center; gap: .4rem; background: var(--ovs-red); color: #fff; border: 1px solid var(--ovs-red); border-radius: var(--ovs-pill); padding: .55rem .95rem; font-size: 13px; font-weight: 650; cursor: pointer; transition: filter .15s ease; }
.btn-danger:hover { filter: brightness(.93); color: #fff; }

/* ---------- Toasts ---------- */
.toast-host { position: fixed; top: 18px; right: 18px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.ovs-toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ovs-surface); border: 1px solid var(--ovs-border); border-left: 4px solid var(--ovs-muted); border-radius: var(--ovs-radius-sm); padding: 12px 14px; box-shadow: var(--ovs-shadow); color: var(--ovs-heading); font-size: 13.5px; opacity: 0; transform: translateX(24px); transition: opacity .25s ease, transform .25s ease; }
.ovs-toast.show { opacity: 1; transform: none; }
.ovs-toast > i { font-size: 17px; line-height: 1.35; flex: none; }
.ovs-toast-msg { flex: 1; min-width: 0; line-height: 1.4; }
.ovs-toast-x { background: none; border: none; color: var(--ovs-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; flex: none; }
.ovs-toast-x:hover { color: var(--ovs-heading); }
.ovs-toast-success { border-left-color: var(--ovs-success); } .ovs-toast-success > i { color: var(--ovs-success); }
.ovs-toast-error   { border-left-color: var(--ovs-red); }     .ovs-toast-error > i   { color: var(--ovs-red); }
.ovs-toast-warning { border-left-color: var(--ovs-warning); } .ovs-toast-warning > i { color: var(--ovs-warning); }
.ovs-toast-info    { border-left-color: var(--ovs-green-600); } .ovs-toast-info > i   { color: var(--ovs-green-600); }

/* ---------- Custom confirm modal ---------- */
.ovs-modal { position: fixed; inset: 0; z-index: 1090; }
.ovs-modal-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 25, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s ease; }
.ovs-modal.show .ovs-modal-backdrop { opacity: 1; }
.ovs-modal-dialog { position: relative; max-width: 420px; margin: 14vh auto 0; background: var(--ovs-surface); border: 1px solid var(--ovs-border); border-radius: var(--ovs-radius); box-shadow: var(--ovs-shadow-lg); padding: 22px 24px; transform: translateY(-14px) scale(.98); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
.ovs-modal.show .ovs-modal-dialog { transform: none; opacity: 1; }
.ovs-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ovs-confirm-icon { font-size: 24px; color: var(--ovs-green-600); flex: none; }
.ovs-confirm-icon.danger { color: var(--ovs-red); }
.ovs-confirm-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--ovs-heading); }
.ovs-confirm-msg { color: var(--ovs-ink); font-size: 13.5px; margin: 0 0 22px; line-height: 1.55; }
.ovs-modal-foot { display: flex; justify-content: flex-end; gap: 10px; }
body.ovs-modal-open { overflow: hidden; }

/* ---------- Cards ---------- */
.ovs-card {
    background: var(--ovs-surface); border: 1px solid var(--ovs-border);
    border-radius: var(--ovs-radius); box-shadow: var(--ovs-shadow);
}
.ovs-card .card-inner { padding: 22px 24px; }
.ovs-card-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ovs-muted); }

/* ---------- Stat cards ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-row .card-inner { padding: 18px 20px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--ovs-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 26px; font-weight: 780; color: var(--ovs-heading); letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-caption { color: var(--ovs-muted); font-size: 12px; margin-top: 3px; }
.stat-badge { font-size: 11.5px; font-weight: 700; margin-left: 6px; }
.stat-badge.up { color: var(--ovs-success); }
.stat-badge.down { color: var(--ovs-red); }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 19px; flex: none; color: #fff; background: linear-gradient(135deg, var(--ovs-green), var(--ovs-green-700)); box-shadow: 0 8px 18px rgba(var(--ovs-primary-rgb), .3); }
.stat-icon.up { background: linear-gradient(135deg, #16c988, var(--ovs-success)); box-shadow: 0 8px 18px rgba(1, 181, 116, .28); color: #fff; }
.stat-icon.down { background: linear-gradient(135deg, #f47a78, var(--ovs-red)); box-shadow: 0 8px 18px rgba(239, 83, 80, .28); color: #fff; }

/* ---------- Dashboard grid ---------- */
.dash-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; }
.mini-metric .big { font-size: 24px; font-weight: 800; color: var(--ovs-heading); }
.chart-2col { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; align-items: stretch; }
@media (max-width: 992px) { .chart-2col { grid-template-columns: 1fr; } }
.chart-total { text-align: center; margin-top: 6px; }
.chart-total .n { font-size: 22px; font-weight: 800; color: var(--ovs-heading); }
.chart-total .l { font-size: 12px; color: var(--ovs-muted); }

.tabs-line { display: flex; gap: 26px; border-bottom: 1px solid var(--ovs-border); margin-bottom: 18px; }
.tabs-line a { padding: 4px 0 12px; font-weight: 600; font-size: 13px; color: var(--ovs-muted); border-bottom: 2px solid transparent; }
.tabs-line a.active { color: var(--ovs-heading); border-bottom-color: var(--ovs-green-600); }

/* ---------- List rows ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--ovs-border); }
.list-row:last-child { border-bottom: none; }
.list-row .name { font-weight: 600; color: var(--ovs-heading); font-size: 13.5px; }
.list-row .sub { color: var(--ovs-muted); font-size: 12px; }
.trend-up { color: var(--ovs-success); font-weight: 700; }
.trend-down { color: var(--ovs-red); font-weight: 700; }

/* ---------- Tables ---------- */
.ovs-table { width: 100%; border-collapse: collapse; }
.ovs-table thead th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ovs-muted); font-weight: 700; padding: 12px 16px;
    background: var(--ovs-surface-2); border-bottom: 1px solid var(--ovs-border);
}
.ovs-table thead th:first-child { border-top-left-radius: var(--ovs-radius-sm); }
.ovs-table thead th:last-child { border-top-right-radius: var(--ovs-radius-sm); }
.ovs-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--ovs-border); color: var(--ovs-ink); font-size: 13.5px; }
.ovs-table tbody tr:last-child td { border-bottom: none; }
.ovs-table tbody tr:hover { background: color-mix(in srgb, var(--ovs-green-600) 7%, transparent); }
.ovs-table .ref { font-weight: 700; color: var(--ovs-green-600); }

/* ---------- Status pills ---------- */
.pill { display: inline-block; padding: 4px 12px; border-radius: var(--ovs-pill); font-size: 11.5px; font-weight: 700; }
.pill-new { background: var(--ovs-green-soft); color: var(--ovs-green-600); }
.pill-pending { background: var(--ovs-warning-soft); color: var(--ovs-warning); }
.pill-submitted { background: color-mix(in srgb, var(--ovs-blue) 16%, transparent); color: var(--ovs-blue); }
.pill-review { background: color-mix(in srgb, var(--ovs-purple) 18%, transparent); color: color-mix(in srgb, var(--ovs-purple) 75%, #fff); }
.pill-completed { background: var(--ovs-success-soft); color: var(--ovs-success); }
.pill-rejected { background: var(--ovs-red-soft); color: var(--ovs-red); }

/* ---------- Footer ---------- */
.app-footer { padding: 18px 30px; color: var(--ovs-muted); font-size: 12.5px; border-top: 1px solid var(--ovs-border); background: transparent; }

/* ---------- Alerts ---------- */
.ovs-alert { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.1rem; border-radius: var(--ovs-radius-sm); margin-bottom: 1.2rem; font-size: .9rem; font-weight: 500; border: 1px solid transparent; }
.ovs-alert i { font-size: 1.05rem; }
.ovs-alert-success { background: var(--ovs-success-soft); color: var(--ovs-success); border-color: color-mix(in srgb, var(--ovs-success) 30%, transparent); }
.ovs-alert-error { background: var(--ovs-red-soft); color: var(--ovs-red); border-color: color-mix(in srgb, var(--ovs-red) 30%, transparent); }
.ovs-alert-error:empty { display: none; }
.ovs-alert-info { background: var(--ovs-green-soft); color: var(--ovs-green-600); border-color: color-mix(in srgb, var(--ovs-green-600) 30%, transparent); }
.ovs-alert-info a { color: inherit; font-weight: 700; text-decoration: underline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.15rem 1.5rem; }
.form-field { display: flex; flex-direction: column; gap: .4rem; }
.form-field-full { grid-column: 1 / -1; }
.form-lbl { font-size: .84rem; font-weight: 600; color: var(--ovs-heading); }
.form-ctrl {
    background: var(--ovs-surface-2); border: 1.5px solid var(--ovs-border); color: var(--ovs-heading);
    border-radius: var(--ovs-radius-sm); padding: .7rem .9rem; font-size: .92rem; font-family: inherit; width: 100%;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.form-ctrl::placeholder { color: var(--ovs-muted); }
.form-ctrl:hover { border-color: color-mix(in srgb, var(--ovs-green-600) 35%, var(--ovs-border)); }
.form-ctrl:focus { outline: none; border-color: var(--ovs-green-600); background: var(--ovs-surface); box-shadow: 0 0 0 3px rgba(var(--ovs-primary-rgb), .2); }
select.form-ctrl option { background: var(--ovs-surface); color: var(--ovs-heading); }
textarea.form-ctrl { resize: vertical; }
.form-err { color: var(--ovs-red); font-size: .78rem; }
.form-ctrl.input-validation-error { border-color: var(--ovs-red); }
.field-validation-error { color: var(--ovs-red); font-size: .78rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.5rem; padding-top: 1.3rem; border-top: 1px solid var(--ovs-border); }
.form-check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; color: var(--ovs-heading); font-weight: 500; }
.form-check input { width: 18px; height: 18px; accent-color: var(--ovs-green-600); }

/* ---------- Invoice line-item table + totals ---------- */
.line-table td { padding: .5rem .6rem; }
.line-table .form-ctrl { padding: .5rem .6rem; }
.line-table .li-qty { max-width: 80px; }
.line-table .li-price { max-width: 130px; }
.line-table .li-amount { font-weight: 600; color: var(--ovs-heading); white-space: nowrap; }
.invoice-totals { margin-left: auto; margin-top: 1.2rem; max-width: 340px; display: flex; flex-direction: column; gap: .5rem; }
.totals-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .9rem; color: var(--ovs-ink); }
.totals-row label { color: var(--ovs-muted); font-weight: 500; }
.totals-input { max-width: 140px; text-align: right; }
.totals-grand { border-top: 1px solid var(--ovs-border); padding-top: .5rem; font-size: 1.05rem; font-weight: 800; color: var(--ovs-heading); }
.w-100 { width: 100%; }

/* ---------- Row actions / icon buttons ---------- */
.row-link { color: var(--ovs-heading); font-weight: 600; }
.row-link:hover { color: var(--ovs-green-600); }
.row-actions { display: inline-flex; gap: .35rem; justify-content: flex-end; }
.icon-btn {
    width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--ovs-border); background: var(--ovs-surface-2);
    color: var(--ovs-muted); display: inline-grid; place-items: center; cursor: pointer; font-size: 14px;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--ovs-green-soft); color: var(--ovs-green-600); border-color: color-mix(in srgb, var(--ovs-green-600) 40%, transparent); }
.icon-btn-danger:hover { background: var(--ovs-red-soft); color: var(--ovs-red); border-color: color-mix(in srgb, var(--ovs-red) 40%, transparent); }
.text-end { text-align: right; }

/* ---------- Detail page ---------- */
.detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: .7rem 1rem; margin: 1rem 0 0; }
.detail-list dt { color: var(--ovs-muted); font-size: .82rem; font-weight: 600; }
.detail-list dd { margin: 0; color: var(--ovs-heading); font-size: .88rem; word-break: break-word; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-main { margin-left: 0; }
    .app-topbar { left: 0; }
    body.sidebar-open .app-sidebar { transform: translateX(0); box-shadow: var(--ovs-shadow-lg); }
    .sidebar-toggle { display: grid; }
    .stat-row { grid-template-columns: 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
    .topbar-search input { width: 150px; }
}
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .page-content { padding: calc(var(--ovs-topbar-h) + 18px) 16px 26px; }
}

:focus-visible { outline: 2px solid var(--ovs-green-600); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   Refinements (2026-08-07) — cleaner, more organized cards / lists /
   report pages, plus the global page-header back button. Appended so
   these win over the base rules above.
   ============================================================ */

/* ---- Page header: back button grouped with the title (actions stay right) ---- */
.page-head-lead { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-head-lead > div { min-width: 0; }
.page-back {
    flex: none; width: 40px; height: 40px; border-radius: var(--ovs-radius-sm);
    display: grid; place-items: center; cursor: pointer; font-size: 17px; line-height: 1;
    background: var(--ovs-surface); color: var(--ovs-ink);
    border: 1px solid var(--ovs-border); box-shadow: var(--ovs-shadow);
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.page-back:hover { background: var(--ovs-green-soft); color: var(--ovs-green-600);
    border-color: color-mix(in srgb, var(--ovs-green-600) 40%, transparent); transform: translateX(-2px); }

/* ---- Cards: consistent polish + clean section-title header row ---- */
a.ovs-card, .report-card { transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
a.ovs-card:hover, .report-card:not(.is-soon):hover {
    box-shadow: var(--ovs-shadow-lg); transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--ovs-green-600) 30%, var(--ovs-border));
}
.ovs-card-title { display: inline-flex; align-items: center; gap: 8px; }
/* When a card leads with a title above a table/list, give it a light divider + even spacing */
.ovs-card > .card-inner.pb-0,
.ovs-card > .card-inner.pb-2 {
    padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--ovs-border);
}
.list-toolbar { row-gap: 12px; }

/* ---- Stat cards: equal height, aligned across the row ---- */
.stat-row .ovs-card { min-height: 96px; }
.stat-card { width: 100%; height: 100%; }
.stat-value { line-height: 1.15; }

/* ---- Tables: subtle zebra, tidy numerics, non-wrapping actions ---- */
.ovs-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--ovs-surface-2) 40%, transparent); }
.ovs-table tbody tr:hover td { background: color-mix(in srgb, var(--ovs-green-600) 8%, transparent); }
.ovs-table th.text-end, .ovs-table td.text-end { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ovs-table .row-actions { white-space: nowrap; }
.ovs-table tbody td { vertical-align: middle; }
.ovs-table .sub { font-size: 11.5px; color: var(--ovs-muted); }

/* ---- Totals row (report tables use <tfoot> / .table-total) ---- */
.ovs-table tfoot td,
.ovs-table tr.table-total td {
    border-top: 2px solid var(--ovs-border); background: var(--ovs-surface-2);
    color: var(--ovs-heading); font-variant-numeric: tabular-nums;
}

/* ---- Report tiles grid: even, roomy layout ---- */
.report-card .card-inner { min-height: 148px; display: flex; flex-direction: column; }
.report-card .report-go { margin-top: auto; }

/* ---- Refunded applications: muted "Refunded" pill + grayed-out, frozen row ---- */
.pill-refunded { background: color-mix(in srgb, var(--ovs-muted) 22%, transparent); color: var(--ovs-muted); }
.ovs-table tr.is-refunded td { opacity: .55; }
.ovs-table tr.is-refunded:hover td { opacity: .8; }
.ovs-table tr.is-refunded .ref { color: var(--ovs-muted); }
