/* ==========================================================================
   Swiss Finance Group CRM — interface stylesheet
   Brand: navy #0A1F3D, gold #C9A227. Written as a single dependency-free file
   so the interface renders identically on any host without a build step.
   ========================================================================== */

:root {
    --navy: #0a1f3d;
    --navy-dark: #020b18;
    --navy-mid: #12305c;
    --navy-soft: #1c4478;
    --gold: #c9a227;
    --gold-soft: #e2c86b;
    --gold-light: #f3e7c2;

    --ink: #101828;
    --ink-soft: #475467;
    --ink-mute: #667085;
    --line: #e4e7ec;
    --line-soft: #f2f4f7;
    --surface: #ffffff;
    --canvas: #f6f8fb;

    --success: #067647;
    --success-bg: #ecfdf3;
    --warning: #b54708;
    --warning-bg: #fffaeb;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --info: #175cd3;
    --info-bg: #eff8ff;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 4px 12px rgba(16, 24, 40, .08);
    --shadow-lg: 0 16px 40px rgba(10, 31, 61, .16);

    --sidebar-w: 264px;
    --topbar-h: 64px;

    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-head: "Cormorant Garamond", "Times New Roman", Georgia, serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[dir="rtl"] {
    --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

/* --------------------------------------------------------------- foundation */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0 0 .5rem; font-weight: 600; color: var(--navy); line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
a { color: var(--navy-soft); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }
small { font-size: .8125rem; }

hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

::selection { background: var(--gold-light); color: var(--navy-dark); }

:focus-visible {
    outline: 2px solid var(--navy-soft);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus { left: 1rem; top: 1rem; z-index: 100; background: #fff; padding: .5rem 1rem; border-radius: var(--radius-sm); }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }

/* ------------------------------------------------------------------- layout */

.app { display: block; }

.sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: #dbe4f0;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform .25s ease;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 1.05rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand { display: flex; align-items: center; gap: .65rem; color: #fff; }
.brand:hover { text-decoration: none; }

.brand__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--gold);
    color: var(--navy-dark);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .04em;
}

.brand__mark--lg { width: 64px; height: 64px; font-size: 1.15rem; border-radius: 14px; }

.brand__text strong { display: block; font-size: .9rem; color: #fff; }
.brand__text small { display: block; font-size: .7rem; color: rgba(255, 255, 255, .55); }

.sidebar__close {
    display: none;
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar__nav { flex: 1; overflow-y: auto; padding: .9rem .65rem 1.5rem; }
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }

.nav-group { margin-bottom: 1.15rem; }

.nav-group__title {
    margin: 0 0 .4rem;
    padding-inline-start: .6rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(255, 255, 255, .42);
}

.nav-list { list-style: none; margin: 0; padding: 0; }

.nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem;
    border-radius: 8px;
    color: #c8d4e4;
    font-size: .875rem;
    font-weight: 500;
}

.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }

.nav-link.is-active {
    background: rgba(201, 162, 39, .16);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar__footer {
    padding: .85rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .7rem;
    color: rgba(255, 255, 255, .45);
}
.sidebar__footer p { margin: 0; }

.app__main {
    margin-inline-start: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.topbar__burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: .35rem;
}
.topbar__burger span { display: block; width: 20px; height: 2px; background: var(--navy); border-radius: 2px; }

.search {
    position: relative;
    flex: 1;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-mute);
}
.search:focus-within { border-color: var(--navy-soft); background: #fff; box-shadow: 0 0 0 3px rgba(28, 68, 120, .1); }
.search input {
    flex: 1;
    border: 0;
    background: none;
    font: inherit;
    color: var(--ink);
    outline: none;
}

.search__results {
    position: absolute;
    top: calc(100% + .4rem);
    inset-inline-start: 0;
    width: 100%;
    max-height: 340px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    padding: .35rem;
}

.search__item { display: block; padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--ink); }
.search__item:hover, .search__item.is-active { background: var(--line-soft); text-decoration: none; }
.search__item strong { display: block; font-size: .875rem; }
.search__item small { color: var(--ink-mute); }

.topbar__actions { display: flex; align-items: center; gap: .75rem; margin-inline-start: auto; }

.user-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .3rem .55rem;
    cursor: pointer;
    font: inherit;
    text-align: start;
}
.user-chip:hover { border-color: var(--line); background: var(--canvas); }
.user-chip__text strong { display: block; font-size: .8rem; color: var(--navy); }
.user-chip__text small { display: block; font-size: .7rem; color: var(--ink-mute); }

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
}

.avatar--sm { width: 26px; height: 26px; font-size: .7rem; }

.content { flex: 1; padding: 1.5rem; max-width: 1560px; width: 100%; }

.app-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--ink-mute);
    font-size: .75rem;
}
.app-footer p { margin: 0; }

/* --------------------------------------------------------------- page heads */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-title { font-family: var(--font-head); font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.page-subtitle { color: var(--ink-soft); margin: .25rem 0 0; font-size: .875rem; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.breadcrumbs { display: flex; gap: .4rem; font-size: .78rem; color: var(--ink-mute); margin-bottom: .35rem; }
.breadcrumbs a { color: var(--ink-mute); }

/* ------------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .55rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    font-size: .875rem;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}
.btn:hover { background: var(--line-soft); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-mid); border-color: var(--navy-mid); color: #fff; }

.btn--gold { background: var(--gold); border-color: var(--gold); color: var(--navy-dark); }
.btn--gold:hover { background: #b8901f; border-color: #b8901f; }

.btn--ghost { background: transparent; border-color: transparent; color: var(--navy-soft); }
.btn--ghost:hover { background: var(--line-soft); }

.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #9a1c12; }

.btn--sm { padding: .38rem .7rem; font-size: .8rem; }
.btn--lg { padding: .7rem 1.35rem; font-size: .95rem; }
.btn--block { width: 100%; }
.btn--icon { padding: .4rem; }

.btn-group { display: inline-flex; gap: .35rem; flex-wrap: wrap; }

/* -------------------------------------------------------------------- cards */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #fcfdfe);
}
.card__title { margin: 0; font-size: .95rem; font-weight: 600; color: var(--navy); }
.card__subtitle { margin: .1rem 0 0; font-size: .78rem; color: var(--ink-mute); }
.card__body { padding: 1.15rem; }
.card__body--flush { padding: 0; }
.card__foot { padding: .8rem 1.15rem; border-top: 1px solid var(--line); background: #fcfdfe; }

/* ------------------------------------------------------------------- grids  */

.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

.stack { display: flex; flex-direction: column; gap: .75rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }

/* -------------------------------------------------------------------- stats */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }

.stat {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 3px;
    background: var(--navy);
}
.stat--gold::after { background: var(--gold); }
.stat--success::after { background: var(--success); }
.stat--warning::after { background: var(--warning); }
.stat--danger::after { background: var(--danger); }

.stat__label { display: block; font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); }
.stat__value { display: block; font-size: 1.55rem; font-weight: 600; color: var(--navy); margin-top: .3rem; line-height: 1.15; }
.stat__meta { display: block; font-size: .76rem; color: var(--ink-soft); margin-top: .25rem; }

.delta { font-weight: 600; }
.delta--up { color: var(--success); }
.delta--down { color: var(--danger); }

/* ------------------------------------------------------------------- tables */

.table-wrap { width: 100%; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { padding: .7rem .9rem; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table thead th {
    background: var(--line-soft);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-soft);
    font-weight: 600;
    white-space: nowrap;
}
.table tbody tr:hover { background: #fbfcfe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: end; font-variant-numeric: tabular-nums; }
.table--compact th, .table--compact td { padding: .5rem .65rem; }

.table__primary { font-weight: 600; color: var(--navy); }
.table__secondary { display: block; font-size: .76rem; color: var(--ink-mute); }

.empty-state { padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-mute); }
.empty-state h3 { color: var(--ink-soft); }

/* ------------------------------------------------------------------ badges  */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .01em;
    background: var(--line-soft);
    color: var(--ink-soft);
    white-space: nowrap;
}
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger  { background: var(--danger-bg); color: var(--danger); }
.badge--info    { background: var(--info-bg); color: var(--info); }
.badge--navy    { background: rgba(10, 31, 61, .08); color: var(--navy); }
.badge--gold    { background: rgba(201, 162, 39, .16); color: #8a6d12; }

.pill { display: inline-block; padding: .15rem .5rem; border: 1px solid var(--line); border-radius: 999px; font-size: .72rem; color: var(--ink-soft); }

/* -------------------------------------------------------------------- forms */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.form-grid--single { grid-template-columns: 1fr; }
.form-section { margin-bottom: 1.5rem; }
.form-section__title {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-mute);
    border-bottom: 1px solid var(--line);
    padding-bottom: .4rem;
    margin-bottom: 1rem;
}

.field { display: flex; flex-direction: column; gap: .3rem; }
.field--wide { grid-column: 1 / -1; }

.label { font-size: .8rem; font-weight: 500; color: var(--ink-soft); }
.label .req { color: var(--danger); }

.input, .select, .textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit;
    font-size: .875rem;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--navy-soft);
    box-shadow: 0 0 0 3px rgba(28, 68, 120, .12);
}
.input[readonly], .input:disabled, .select:disabled { background: var(--line-soft); color: var(--ink-mute); }
.textarea { min-height: 96px; resize: vertical; }

.hint { font-size: .75rem; color: var(--ink-mute); }
.error-text { font-size: .75rem; color: var(--danger); }

.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .85rem; }
.check input { margin-top: .2rem; }

.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 38px; height: 21px; border-radius: 999px; background: var(--line); position: relative; transition: background .18s ease; }
.switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease;
}
.switch input:checked + .switch__track { background: var(--navy); }
.switch input:checked + .switch__track::after { transform: translateX(17px); }
html[dir="rtl"] .switch input:checked + .switch__track::after { transform: translateX(-17px); }

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .75rem;
    align-items: end;
}

/* ------------------------------------------------------------------ alerts  */

.alert {
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    margin-bottom: 1rem;
    font-size: .875rem;
}
.alert--success { background: var(--success-bg); border-color: #abefc6; color: #05603a; }
.alert--danger  { background: var(--danger-bg); border-color: #fecdca; color: #912018; }
.alert--warning { background: var(--warning-bg); border-color: #fedf89; color: #93370d; }
.alert--info    { background: var(--info-bg); border-color: #b2ddff; color: #194185; }
.alert__list { margin: 0; padding-inline-start: 1.1rem; }

/* -------------------------------------------------------------- pagination  */

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.pagination__info { margin-inline-end: auto; font-size: .8rem; color: var(--ink-mute); }
.pagination a, .pagination span {
    min-width: 34px;
    padding: .3rem .55rem;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .8rem;
    color: var(--ink-soft);
}
.pagination a:hover { background: var(--line-soft); text-decoration: none; }
.pagination .is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination .is-disabled { opacity: .45; }

/* ---------------------------------------------------------------- dropdowns */

.dropdown { position: relative; }
.dropdown__menu {
    position: absolute;
    top: calc(100% + .35rem);
    inset-inline-end: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .3rem;
    z-index: 60;
}
.dropdown__menu a, .dropdown__menu button {
    display: block;
    width: 100%;
    text-align: start;
    padding: .45rem .6rem;
    border: 0;
    background: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: .85rem;
    color: var(--ink);
    cursor: pointer;
}
.dropdown__menu a:hover, .dropdown__menu button:hover { background: var(--line-soft); text-decoration: none; }
.dropdown__divider { height: 1px; background: var(--line); margin: .3rem 0; }

/* -------------------------------------------------------------------- tabs  */

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tab {
    padding: .6rem .9rem;
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink-mute);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border-top: 0; border-inline: 0;
    font-family: inherit;
}
.tab:hover { color: var(--navy); text-decoration: none; }
.tab.is-active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-panel[hidden] { display: none; }

/* ---------------------------------------------------------------- timeline  */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: "";
    position: absolute;
    inset-block: .5rem;
    inset-inline-start: 7px;
    width: 2px;
    background: var(--line);
}
.timeline__item { position: relative; padding-inline-start: 1.75rem; padding-bottom: 1.1rem; }
.timeline__dot {
    position: absolute;
    inset-inline-start: 0;
    top: .3rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--navy-soft);
}
.timeline__item--gold .timeline__dot { border-color: var(--gold); }
.timeline__item--success .timeline__dot { border-color: var(--success); }
.timeline__item--danger .timeline__dot { border-color: var(--danger); }
.timeline__title { font-weight: 600; font-size: .875rem; color: var(--navy); margin: 0; }
.timeline__meta { font-size: .75rem; color: var(--ink-mute); }
.timeline__body { font-size: .85rem; color: var(--ink-soft); margin: .2rem 0 0; }

/* ------------------------------------------------------------------ stepper */

.stepper { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 1.5rem; }
.step {
    flex: 1 1 110px;
    padding: .6rem .7rem;
    border-radius: var(--radius-sm);
    background: var(--line-soft);
    border: 1px solid var(--line);
    font-size: .76rem;
    color: var(--ink-mute);
    text-align: center;
}
.step.is-done { background: rgba(10, 31, 61, .06); border-color: rgba(10, 31, 61, .2); color: var(--navy); font-weight: 600; }
.step.is-current { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.step__index { display: block; font-size: .68rem; opacity: .75; }

.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-soft)); border-radius: 999px; transition: width .3s ease; }
.progress--gold .progress__bar { background: linear-gradient(90deg, var(--gold), #e0bd4d); }

/* -------------------------------------------------------------------- board */

.board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .75rem; }
.board__column { flex: 0 0 272px; background: var(--line-soft); border-radius: var(--radius); padding: .7rem; }
.board__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.board__count { background: #fff; border-radius: 999px; padding: .05rem .45rem; font-size: .72rem; }
.board__card {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .65rem .7rem;
    margin-bottom: .5rem;
    box-shadow: var(--shadow-sm);
    color: var(--ink);
}
.board__card:hover { border-color: var(--navy-soft); text-decoration: none; box-shadow: var(--shadow); }
.board__ref { font-size: .72rem; color: var(--ink-mute); font-family: var(--font-mono); }
.board__name { font-weight: 600; font-size: .85rem; color: var(--navy); margin: .1rem 0; }
.board__amount { font-size: .8rem; color: var(--ink-soft); }

/* -------------------------------------------------------------------- misc  */

.chart { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .76rem; color: var(--ink-soft); margin-top: .5rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.definition { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: .1rem .9rem; font-size: .85rem; }
.definition dt { color: var(--ink-mute); padding: .35rem 0; }
.definition dd { margin: 0; padding: .35rem 0; color: var(--ink); font-weight: 500; }

.mono { font-family: var(--font-mono); font-size: .82rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.text-mute { color: var(--ink-mute); }
.text-soft { color: var(--ink-soft); }
.text-navy { color: var(--navy); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-end { text-align: end; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: .8rem; }
.fs-xs { font-size: .72rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; }
.gap-sm { gap: .35rem; }

.note {
    border-inline-start: 3px solid var(--gold);
    background: #fffdf6;
    padding: .7rem .9rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
}

.note--private { border-inline-start-color: var(--navy-soft); background: #f8fafd; }

.file-row { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.file-row:last-child { border-bottom: 0; }
.file-row__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--line-soft); color: var(--navy); }
.file-row__body { min-width: 0; flex: 1; }
.file-row__name { font-weight: 500; font-size: .85rem; display: block; }
.file-row__meta { font-size: .74rem; color: var(--ink-mute); }

.dropzone {
    border: 1.5px dashed var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    color: var(--ink-mute);
    background: #fcfdfe;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone.is-over { border-color: var(--navy-soft); background: #f4f8ff; color: var(--navy); }

/* ----------------------------------------------------------- auth + portal  */

.auth-body { background: var(--navy-dark); }

.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; }

.auth-aside {
    background:
        radial-gradient(circle at 15% 15%, rgba(201, 162, 39, .18), transparent 45%),
        linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 3rem;
}
.auth-aside__inner { max-width: 420px; }
.auth-aside h1 { color: #fff; font-family: var(--font-head); font-size: 2.1rem; margin: 1.5rem 0 .5rem; }
.auth-aside__tagline { color: rgba(255, 255, 255, .72); font-size: .95rem; }
.auth-aside__list { list-style: none; padding: 0; margin: 1.75rem 0; }
.auth-aside__list li { padding: .4rem 0 .4rem 1.4rem; position: relative; color: rgba(255, 255, 255, .8); font-size: .875rem; }
.auth-aside__list li::before { content: ""; position: absolute; inset-inline-start: 0; top: .95rem; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.auth-aside__note { font-size: .76rem; color: rgba(255, 255, 255, .5); }

.auth-panel { background: #fff; display: flex; flex-direction: column; justify-content: center; padding: 3rem; }
.auth-panel__inner { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-panel--wide .auth-panel__inner { max-width: 760px; }
.auth-title { font-family: var(--font-head); font-size: 1.9rem; margin-bottom: .35rem; }
.auth-sub { color: var(--ink-soft); margin-bottom: 1.75rem; }
.auth-footer { max-width: 420px; margin: 2rem auto 0; display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-mute); }
.auth-footer p { margin: 0; }

.portal-shell { max-width: 1000px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.portal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.portal-hero {
    background: linear-gradient(150deg, var(--navy), var(--navy-dark));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    margin-bottom: 1.5rem;
}
.portal-hero h1 { color: #fff; font-family: var(--font-head); font-size: 1.6rem; margin-bottom: .25rem; }
.portal-hero__meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.1rem; }
.portal-hero__meta div span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .55); }
.portal-hero__meta div strong { font-size: 1rem; }

/* ------------------------------------------------------------------- print  */

@media print {
    .sidebar, .topbar, .app-footer, .page-head__actions, .btn, .filters { display: none !important; }
    .app__main { margin: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    body { background: #fff; font-size: 11pt; }
}

/* -------------------------------------------------------------- responsive  */

@media (max-width: 1200px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    html[dir="rtl"] .sidebar { transform: translateX(100%); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar__close { display: block; }
    .app__main { margin-inline-start: 0; }
    .topbar__burger { display: flex; }
    .grid--2, .grid--3 { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-panel { padding: 2rem 1.25rem; }
}

@media (max-width: 640px) {
    .content { padding: 1rem; }
    .grid--4 { grid-template-columns: 1fr; }
    .page-title { font-size: 1.4rem; }
    .user-chip__text { display: none; }
    .stat__value { font-size: 1.35rem; }
    .table th, .table td { padding: .55rem .6rem; }
}
