/* ==========================================================================
   Academix Lite - design system (one stylesheet for every page)
   Brand: deep navy + sky blue with an orange highlight on cool neutrals. Compact, screen-fitting layouts.
   ("gold" variables are the brand accent; the names are kept so every component shares one palette.)
   ========================================================================== */
@import url("../vendor/bootstrap-icons/bootstrap-icons.min.css");

:root {
  --ink: #0b1a33; --ink-2: #16305a; --ink-3: #24497f;
  --gold: #0a8fd0; --gold-2: #4cc3f5; --gold-pale: #e6f5fd;
  --orange: #f07c1a; --orange-pale: #fff1e5;
  --bg: #f2f5f9; --surface: #ffffff; --surface-2: #f8fafc;
  --border: #dde4ee; --border-strong: #c5d0de;
  --text: #16213a; --text-2: #46536b; --muted: #77839a;
  --success: #2d6a4f; --success-bg: #e6f2ec;
  --warning: #9c6400; --warning-bg: #fdf1dc;
  --danger: #a12b3c; --danger-bg: #fbe8eb;
  --info: #1e4d8c; --info-bg: #e5eefa;
  --radius: 9px; --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(11,26,51,.06), 0 1px 3px rgba(11,26,51,.05);
  --shadow: 0 4px 16px rgba(11,26,51,.08);
  --shadow-lg: 0 18px 50px rgba(11,26,51,.22);
  --sidebar-w: 236px; --sidebar-mini: 62px; --topbar-h: 52px;
  --control-h: 34px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, Cambria, "Times New Roman", serif;
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.45; min-height: 100vh; }
a { color: var(--ink-3); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4rem; line-height: 1.25; color: var(--ink); }
h1 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .6rem; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .88em; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; } .text-center { text-align: center; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.hidden, [hidden] { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
::selection { background: var(--gold-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--ink); color: #d9dbe6; position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; z-index: 40; transition: width .18s ease, transform .2s ease; }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 0 .9rem; height: var(--topbar-h); border-bottom: 1px solid rgba(255,255,255,.08); overflow: hidden; white-space: nowrap; }
.sidebar-brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex-shrink: 0; }
.sidebar-brand .name { font-family: var(--font-display); color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.1; }
.sidebar-brand .tag { color: var(--gold-2); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-nav { overflow-y: auto; overflow-x: hidden; padding: .35rem 0 .8rem; flex: 1; scrollbar-width: thin; scrollbar-color: #3a3f5c transparent; }
.nav-section { padding: .7rem 1rem .25rem; font-size: .63rem; letter-spacing: .14em; text-transform: uppercase; color: #8d91ab; font-weight: 600; white-space: nowrap; }
.nav-link { display: flex; align-items: center; gap: .65rem; padding: .42rem .9rem; margin: 1px .5rem; border-radius: 7px; color: #d9dbe6; font-size: .88rem; white-space: nowrap; }
.nav-link i { font-size: 1rem; width: 1.15rem; text-align: center; color: #a9adc5; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-link.active { background: linear-gradient(90deg, rgba(10,143,208,.24), rgba(10,143,208,.06)); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-link.active i { color: var(--gold-2); }
.sidebar-foot { padding: .7rem 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .72rem; color: #8d91ab; white-space: nowrap; overflow: hidden; }

/* icon-only sidebar (toggle, or automatically on medium screens) */
body.nav-mini .sidebar { width: var(--sidebar-mini); }
body.nav-mini .sidebar .nav-link span, body.nav-mini .sidebar .nav-section, body.nav-mini .sidebar-brand div, body.nav-mini .sidebar-foot { display: none; }
body.nav-mini .sidebar .nav-link { justify-content: center; padding: .5rem 0; }
body.nav-mini .sidebar-nav { padding-top: .6rem; }
body.nav-mini .main { margin-left: var(--sidebar-mini); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin-left .18s ease; }
.topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; padding: 0 1.1rem; position: sticky; top: 0; z-index: 30; }
.breadcrumb { display: flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .84rem; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: .5rem; padding: .2rem .45rem .2rem .2rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.user-chip:hover { border-color: var(--border-strong); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink-2); color: var(--gold-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .74rem; flex-shrink: 0; }
.avatar.lg { width: 42px; height: 42px; font-size: .9rem; }
.user-chip .who { text-align: left; line-height: 1.1; max-width: 170px; }
.user-chip .who b { display: block; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 210px; padding: .3rem; display: none; z-index: 60; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; gap: .55rem; align-items: center; width: 100%; padding: .5rem .65rem; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: .25rem 0; }
/* notifications (bell) */
.notif-dropdown { width: min(340px, calc(100vw - 24px)); }
.notif-head { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .4rem .65rem .3rem; }
.notif-dropdown a { font-size: .86rem; line-height: 1.3; }
.notif-icon { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface-2); }
.notif-icon.warning { color: var(--warning); } .notif-icon.danger { color: var(--danger); } .notif-icon.info { color: var(--info, var(--text-2)); }
.notif-empty { padding: .9rem .65rem; color: var(--muted); font-size: .86rem; }
.list li[data-href]:hover { background: var(--surface-2); }
/* client portal pop-up after sign-in: big, bright, short messages */
.client-notice .modal-content { border: 3px solid var(--gold); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.client-notice .modal-head h2 { font-size: 1.35rem; display: flex; gap: .5rem; align-items: center; }
.client-notice .modal-head h2 i { color: var(--gold); animation: cn-ring 1.2s ease-in-out 2; }
.cn-item { display: flex; gap: .8rem; align-items: center; padding: .85rem .9rem; border-radius: 12px; margin-bottom: .65rem;
  background: var(--surface-2); border-left: 6px solid var(--gold); }
.cn-item.success { border-left-color: var(--success); } .cn-item.info { border-left-color: var(--info, #2563eb); }
.cn-item.warning { border-left-color: var(--warning); }
.cn-icon { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem; background: var(--surface); color: var(--gold); }
.cn-item.success .cn-icon { color: var(--success); } .cn-item.info .cn-icon { color: var(--info, #2563eb); } .cn-item.warning .cn-icon { color: var(--warning); }
.cn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.cn-text b { font-size: 1.05rem; } .cn-text span { font-size: .9rem; color: var(--text-2); }
@media (max-width: 520px) { .cn-item { flex-wrap: wrap; } .cn-item .btn { width: 100%; } }
@keyframes cn-ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-18deg); } 40% { transform: rotate(16deg); } 60% { transform: rotate(-10deg); } 80% { transform: rotate(6deg); } }
.pay-box { background: var(--surface-2); border-radius: 10px; padding: .8rem .9rem; white-space: pre-wrap; font-family: var(--font-mono, monospace); font-size: .92rem; }
/* line items: a line that cannot be saved (empty, no description or no amount) */
.items-table tr.line-error td { background: color-mix(in srgb, var(--danger) 7%, transparent); }
.items-table .is-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 20%, transparent); }
.pay-amount { font-size: 1.6rem; font-weight: 800; color: var(--gold); }
.content { padding: 1rem 1.1rem 1.25rem; flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; }
.footer { padding: .6rem 1.1rem; color: var(--muted); font-size: .74rem; text-align: center; }
.scrim { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.page-title { min-width: 0; }
.page-head .eyebrow { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: .1rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--text-2); margin: .1rem 0 0; font-size: .86rem; }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }

/* ---------- Cards / grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 1rem; }
.card-body.flush { padding: 0; }
.card-foot { padding: .7rem 1rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid { display: grid; gap: 1rem; }
.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-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.split-layout { grid-template-columns: 220px minmax(0, 1fr); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .7rem .85rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; display: flex; gap: .7rem; align-items: flex-start; min-width: 0; color: inherit; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--kpi-accent, var(--gold)); }
.kpi > div:not(.kpi-icon):not(.kpi-body) { min-width: 0; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--kpi-accent, var(--gold)) 12%, white); color: var(--kpi-accent, #8a6d1f); font-size: 1rem; flex-shrink: 0; }
.kpi-body { min-width: 0; flex: 1; }
.kpi:not(:has(.kpi-body)) { flex-direction: column; gap: .1rem; }
.kpi .label { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kpi .value { font-size: 1.3rem; font-weight: 700; color: var(--ink); line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kpi .hint { font-size: .75rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kpi.success { --kpi-accent: var(--success); } .kpi.danger { --kpi-accent: var(--danger); } .kpi.info { --kpi-accent: var(--info); } .kpi.warning { --kpi-accent: var(--warning); }
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: var(--control-h); padding: 0 .85rem; border-radius: 8px;
  border: 1px solid transparent; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; line-height: 1; background: var(--ink); color: #fff;
  transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-gold { background: var(--gold); color: var(--ink); } .btn-gold:hover { background: var(--gold-2); color: var(--ink); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--text-2); } .btn-ghost:hover { background: rgba(11,26,51,.06); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; } .btn-danger:hover { background: #86202f; }
.btn-success { background: var(--success); color: #fff; } .btn-success:hover { background: #245a42; }
.btn-sm { height: 28px; padding: 0 .6rem; font-size: .78rem; border-radius: 6px; }
.btn-icon { width: var(--control-h); padding: 0; } .btn-sm.btn-icon { width: 28px; }
.btn-block { width: 100%; }
.spin { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); flex-shrink: 0; }
.seg button { border: 0; background: none; height: calc(var(--control-h) - 2px); padding: 0 .65rem; cursor: pointer; color: var(--text-2); font: inherit; font-size: .82rem; display: inline-flex; align-items: center; gap: .3rem; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--ink); color: #fff; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: .8rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-all, .form-grid > .check, .form-grid > p { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > label, .label { font-size: .78rem; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--danger); }
.field .help { font-size: .74rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=url],
input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; height: var(--control-h); padding: 0 .65rem; border: 1px solid var(--border-strong); border-radius: 8px; background-color: var(--surface);
  color: var(--text); font: inherit; font-size: .88rem; transition: border-color .15s, box-shadow .15s; min-width: 0; }
select { padding-right: 1.8rem; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%237d7f8c' stroke-width='2' d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right .55rem center / 12px; }
textarea { height: auto; min-height: 76px; padding: .5rem .65rem; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(61,79,124,.15); }
input[readonly], input:disabled, select:disabled, textarea[readonly] { background-color: var(--surface-2); color: var(--text-2); }
.is-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(161,43,60,.12) !important; }
.input-group { display: flex; } .input-group > * { border-radius: 0 !important; } .input-group > :first-child { border-radius: 8px 0 0 8px !important; } .input-group > :last-child { border-radius: 0 8px 8px 0 !important; }
.input-icon { position: relative; } .input-icon > i { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: .9rem; }
.input-icon input { padding-left: 2rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .86rem; user-select: none; }
.check input { width: 1rem; height: 1rem; accent-color: var(--ink); margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; margin: 0; }
legend { font-weight: 650; padding: 0 .4rem; color: var(--ink); }
.form-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); font-weight: 700; grid-column: 1 / -1; margin-top: .3rem; border-bottom: 1px solid var(--border); padding-bottom: .3rem; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .6rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.toolbar .search { flex: 1 1 220px; max-width: 360px; }
.toolbar select { width: auto; min-width: 140px; max-width: 220px; }
.toolbar input[type=date] { width: 140px; }
.toolbar input[type=number] { width: 110px; }
.toolbar .label { white-space: nowrap; }
.chips { display: flex; gap: .3rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); height: 28px; padding: 0 .65rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: .78rem; white-space: nowrap; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 290px); min-height: 160px; }
.table-wrap.short { max-height: 360px; min-height: 0; }
.table-wrap.free { max-height: none; min-height: 0; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.table th, .table td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: var(--surface-2); color: var(--text-2); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; position: sticky; top: 0; z-index: 2; white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
/* anything with a page behind it opens with one click */
[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover td { background: var(--surface-2, rgba(0,0,0,.035)); }
.table th.sortable::after { content: "\2195"; opacity: .35; margin-left: .3rem; }
.table th.sort-asc::after { content: "\2191"; opacity: .9; } .table th.sort-desc::after { content: "\2193"; opacity: .9; }
.table tbody tr:hover td { background: #fcfaf5; }
.table tbody tr.qv { cursor: pointer; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.actions-cell { text-align: right; white-space: nowrap; width: 1%; }
.table tfoot td { font-weight: 700; background: var(--surface-2); position: sticky; bottom: 0; }
.table.compact th, .table.compact td { padding: .38rem .6rem; }
.table .primary-text { font-weight: 600; color: var(--ink); }
.table .sub-text { font-size: .76rem; color: var(--muted); }
.table .cell { max-width: var(--cell-max, 260px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .cell > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty i { font-size: 1.8rem; display: block; margin-bottom: .4rem; color: var(--border-strong); }
.loading-row td { text-align: center; color: var(--muted); padding: 1.5rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); border-top: 1px solid var(--border); }
.pager:empty { display: none; }
.pager .pages { display: flex; gap: .25rem; }
.pager .btn { height: 28px; min-width: 28px; padding: 0 .45rem; font-size: .78rem; }

/* ---------- Card (grid) view of lists ---------- */
.card-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); padding: .9rem; overflow: auto; max-height: calc(100vh - 290px); min-height: 160px; align-content: start; }
.card-grid .empty { grid-column: 1 / -1; }
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .85rem; cursor: pointer; display: flex; flex-direction: column; gap: .45rem; min-width: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.item-card:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-1px); }
.item-card .ic-title { font-weight: 650; color: var(--ink); min-width: 0; }
.item-card .ic-title * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .2rem .6rem; margin: 0; font-size: .8rem; }
.item-card dt { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; padding-top: .12rem; white-space: nowrap; }
.item-card dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.item-card dd * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card dd .sub-text { display: none; }
.item-card .ic-actions { display: flex; gap: .3rem; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: .45rem; margin-top: auto; }
.mini-cards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); padding: .8rem; max-height: 330px; overflow: auto; align-content: start; }
.mini-card { border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .65rem; display: flex; gap: .55rem; align-items: center; min-width: 0; cursor: pointer; background: var(--surface); color: inherit; }
.mini-card:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); text-decoration: none; }
.mini-card .mc-body { min-width: 0; flex: 1; }
.mini-card .mc-title { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.mini-card .mc-sub { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card .mc-right { text-align: right; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.mini-cards .empty { grid-column: 1 / -1; padding: 1.2rem; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 650; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge.success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge.warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.gold { background: var(--gold-pale); color: #8a6d1f; border-color: transparent; }
.badge.dark { background: var(--ink); color: #fff; border-color: transparent; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--border); padding: 0 1rem; overflow-x: auto; }
.tab { padding: .6rem .85rem; border: 0; background: none; font: inherit; font-size: .86rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); } .tab.active { color: var(--ink); border-bottom-color: var(--gold); }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* ---------- Detail lists ---------- */
.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1rem; margin: 0; font-size: .86rem; }
.details dt { color: var(--muted); font-size: .8rem; }
.details dd { margin: 0; font-weight: 500; word-break: break-word; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 1rem; border-bottom: 1px solid var(--border); min-width: 0; }
.list li:last-child { border-bottom: 0; }

/* ---------- Alerts ---------- */
.alert { padding: .65rem .85rem; border-radius: var(--radius); border: 1px solid transparent; margin-bottom: .9rem; display: flex; gap: .55rem; align-items: flex-start; font-size: .86rem; }
.alert i { margin-top: .1rem; }
.alert.success { background: var(--success-bg); color: var(--success); }
.alert.danger, .alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.warning { background: var(--warning-bg); color: var(--warning); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }

/* ---------- Bootstrap 5 modals (data-bs-toggle / data-bs-dismiss) ---------- */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 1055; display: none; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal.fade { transition: opacity .16s linear; }
.modal.fade:not(.show) { opacity: 0; }
.modal.fade .modal-dialog { transition: transform .2s ease-out; transform: translateY(-14px) scale(.98); }
.modal.show .modal-dialog { transform: none; }
.modal-dialog { position: relative; width: auto; max-width: 620px; margin: .75rem auto; pointer-events: none; padding: 0 .75rem; }
.modal-dialog.wide { max-width: 980px; } .modal-dialog.narrow { max-width: 440px; } .modal-dialog.xwide { max-width: 1200px; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 1.5rem); }
.modal-dialog-scrollable { height: calc(100% - 1.5rem); }
.modal-dialog-scrollable .modal-content { max-height: 100%; overflow: hidden; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); color: var(--text); outline: 0; }
.modal-content > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(18,18,32,.6); }
.modal-backdrop.fade { opacity: 0; transition: opacity .16s linear; } .modal-backdrop.show { opacity: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-head h2 { margin: 0; font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 1rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-body.flush { padding: 0; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: .45rem; padding: .65rem 1rem; border-top: 1px solid var(--border); background: var(--surface-2); flex-shrink: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }
.modal-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: .6rem; background: var(--info-bg); color: var(--info); }
.modal-icon.danger { background: var(--danger-bg); color: var(--danger); } .modal-icon.success { background: var(--success-bg); color: var(--success); } .modal-icon.warning { background: var(--warning-bg); color: var(--warning); }
/* quick view: the zoomed detail of any clicked row or card */
.qv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .8rem; }
.qv-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem; min-width: 0; }
.qv-item.wide { grid-column: 1 / -1; }
.qv-item .qv-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .15rem; }
.qv-item .qv-value { font-size: .92rem; word-break: break-word; }
.qv-item .qv-value, .qv-item .qv-value * { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; max-width: none !important; }
.qv-item .qv-value .sub-text { display: block; font-size: .8rem; color: var(--muted); }
.qv-title { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.qv-title .t { font-size: 1.1rem; font-weight: 700; color: var(--ink); min-width: 0; word-break: break-word; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .45rem; z-index: 1100; }
.toast { background: var(--ink); color: #fff; padding: .65rem .9rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); display: flex; gap: .55rem; align-items: flex-start; max-width: 400px; animation: toast-in .2s ease; font-size: .86rem; }
.toast.success { background: var(--success); } .toast.error { background: var(--danger); } .toast.warning { background: var(--warning); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Line items editor ---------- */
.items-table td { vertical-align: top; padding: .4rem .5rem; }
.items-table textarea { min-height: var(--control-h); height: var(--control-h); padding: .4rem .6rem; }
.totals { margin-left: auto; width: min(340px, 100%); }
.totals .line { display: flex; justify-content: space-between; padding: .3rem 0; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: .3rem; padding-top: .5rem; font-size: 1.08rem; font-weight: 700; color: var(--ink); }

/* ---------- Progress / charts ---------- */
.progress { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.chart-box { position: relative; height: 230px; }
.chart-box.tall { height: 290px; }
.chart-note { font-size: .74rem; color: var(--muted); padding: .1rem 1rem .7rem; }

/* ---------- Calendar ---------- */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.calendar .dow { padding: .35rem; font-size: .68rem; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar .day { min-height: 82px; padding: .3rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: .74rem; min-width: 0; }
.calendar .day.other { background: var(--surface-2); color: var(--muted); }
.calendar .day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.calendar .day .n { font-weight: 700; margin-bottom: .15rem; }
.calendar .ev { display: block; background: var(--info-bg); color: var(--info); border-radius: 4px; padding: 1px 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.calendar .ev.late { background: var(--danger-bg); color: var(--danger); }
.calendar .ev.done { background: var(--success-bg); color: var(--success); text-decoration: line-through; }

/* ---------- Auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-hero { background: linear-gradient(160deg, rgba(11,26,51,.93), rgba(45,53,97,.88)), url("../img/dds_bg1.jpg") center/cover; color: #fff; padding: 2.5rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero .brand { display: flex; align-items: center; gap: .8rem; }
.auth-hero .brand img { width: 50px; height: 50px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }
.auth-hero .brand b { font-family: var(--font-display); font-size: 1.3rem; display: block; }
.auth-hero .brand span { color: var(--gold-2); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.auth-hero h2 { color: #fff; font-family: var(--font-display); font-size: 2rem; font-weight: 600; max-width: 30rem; }
.auth-hero p { color: #c9cce0; max-width: 30rem; }
.auth-hero ul { list-style: none; padding: 0; margin: 1.3rem 0 0; display: grid; gap: .55rem; color: #e3e5f0; }
.auth-hero li i { color: var(--gold-2); margin-right: .5rem; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: min(380px, 100%); }
.auth-card h1 { font-size: 1.7rem; }
.auth-card .field { margin-bottom: .9rem; }
.auth-card .btn { width: 100%; height: 42px; font-size: .95rem; }
.auth-card input { height: 40px; }
.password-wrap { position: relative; } .password-wrap input { padding-right: 2.5rem; }
.password-wrap button { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: .35rem; }
.pw-rules { list-style: none; padding: 0; margin: .35rem 0 0; font-size: .78rem; display: grid; gap: .15rem; }
.pw-rules li::before { content: "\2022"; margin-right: .4rem; color: var(--muted); }
.pw-rules li.ok { color: var(--success); } .pw-rules li.ok::before { content: "\2713"; color: var(--success); }

/* ---------- Documents (quotation / invoice / receipt / statement / reports) ---------- */
.doc { background: #fff; max-width: 860px; margin: 0 auto; padding: 2.2rem; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); color: #222; font-size: .9rem; }
.doc-head { display: flex; justify-content: space-between; gap: 2rem; border-bottom: 3px solid var(--ink); padding-bottom: 1.1rem; margin-bottom: 1.3rem; }
.doc-brand { display: flex; gap: .9rem; align-items: center; }
.doc-brand img { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.doc-brand h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.doc-brand p { margin: 0; font-size: .78rem; color: #555; }
.doc-title { text-align: right; }
.doc-title h1 { font-family: var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); font-size: 1.7rem; margin: 0; }
.doc-title .no { font-family: var(--mono); color: #555; font-size: .82rem; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 1.3rem; }
.doc-parties h4 { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin-bottom: .3rem; }
.doc table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .86rem; }
.doc th { background: var(--ink); color: #fff; text-align: left; padding: .55rem .7rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.doc td { padding: .55rem .7rem; border-bottom: 1px solid #e8e8e8; vertical-align: top; }
.doc .num { text-align: right; white-space: nowrap; }
.doc h3.doc-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); border-bottom: 1px solid #eee; padding-bottom: .3rem; margin: 1.4rem 0 .6rem; }
.doc-foot { margin-top: 1.6rem; padding-top: .9rem; border-top: 1px solid #ddd; font-size: .76rem; color: #666; text-align: center; }
.doc-stamp { display: inline-block; border: 3px solid var(--success); color: var(--success); padding: .3rem 1rem; font-weight: 800; letter-spacing: .15em; transform: rotate(-6deg); border-radius: 6px; }
.doc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.doc-kpis div { border: 1px solid #e6e0d3; border-radius: 8px; padding: .55rem .7rem; }
.doc-kpis > div > span { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: #888; }
.doc-kpis b { font-size: 1.05rem; color: var(--ink); }
.doc-kpis small { display: block; font-size: .72rem; }
.doc .up { color: var(--success); } .doc .down { color: var(--danger); }
.doc tr.subtotal td { font-weight: 700; background: #faf9f6; }
.doc tr.total td { font-weight: 800; background: var(--gold-pale); font-size: .95rem; }
.doc .chart-box { height: 220px; }

/* ---------- Embedded office tools ---------- */
.tool-frame { width: 100%; height: calc(100vh - var(--topbar-h) - 7.2rem); min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); display: block; }

/* ---------- Error page ---------- */
.error-page { text-align: center; padding: 3.5rem 1rem; }
.error-page .code { font-family: var(--font-display); font-size: 4.5rem; color: var(--gold); line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) and (min-width: 901px) {
  body:not(.nav-full) .sidebar { width: var(--sidebar-mini); }
  body:not(.nav-full) .sidebar .nav-link span, body:not(.nav-full) .sidebar .nav-section, body:not(.nav-full) .sidebar-brand div, body:not(.nav-full) .sidebar-foot { display: none; }
  body:not(.nav-full) .sidebar .nav-link { justify-content: center; padding: .5rem 0; }
  body:not(.nav-full) .main { margin-left: var(--sidebar-mini); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar, body.nav-mini .sidebar { transform: translateX(-100%); width: var(--sidebar-w); }
  body.nav-open .sidebar { transform: none; }
  body.nav-mini .sidebar .nav-link span, body.nav-mini .sidebar .nav-section, body.nav-mini .sidebar-brand div { display: initial; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .main, body.nav-mini .main { margin-left: 0; }
  .grid-2, .grid-3, .grid-4, .grid-main, .split-layout { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .auth-page { grid-template-columns: 1fr; } .auth-hero { display: none; }
  .user-chip .who { display: none; }
  .doc-parties { grid-template-columns: 1fr; } .doc-kpis { grid-template-columns: repeat(2, 1fr); }
  .table-wrap, .card-grid { max-height: none; }
  .toolbar .search { max-width: none; }
  .qv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .content { padding: .75rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .kpi { padding: .55rem .6rem; } .kpi-icon { display: none; } .kpi .value { font-size: 1.1rem; }
  .doc { padding: 1rem; } .doc-head { flex-direction: column; } .doc-title { text-align: left; }
  .page-head .actions { width: 100%; }
  .toolbar select, .toolbar input[type=date] { flex: 1 1 130px; max-width: none; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .footer, .no-print, .page-head .actions, .toasts, .modal, .modal-backdrop { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0; max-width: none; } body { background: #fff; }
  .doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .card { box-shadow: none; } .table-wrap, .card-grid { max-height: none !important; overflow: visible !important; }
  .doc th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.topbar .menu-btn { display: none; }
@media (max-width: 900px) { .topbar .menu-btn { display: inline-flex; } .topbar .mini-btn { display: none; } }
.table:not([data-quickview=off]) tbody tr.qv { cursor: pointer; }
@media (max-width: 1100px) { .seg .seg-l { display: none; } }
/* element being captured to PDF */
.pdf-capture { box-shadow: none !important; border: 0 !important; border-radius: 0 !important; max-width: none !important; margin: 0 !important; }
.pdf-capture .no-print { display: none !important; }
.card-head { min-height: 46px; }
.kpi .label, .kpi .hint { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kpi .label { -webkit-line-clamp: 1; }
.pdf-capture.doc-promo { min-height: 1090px; display: flex; flex-direction: column; justify-content: center; padding: 3rem 2.5rem !important; }

/* ---------- Logo on documents: no gold ring, slightly larger ---------- */
.doc-brand img { width: 92px; height: 92px; border: 0; border-radius: 0; object-fit: contain; flex-shrink: 0; }

/* ---------- Digital seal (stamp) ---------- */
/* The stamp is part of the document flow: it has its own reserved space beside the totals / signature and never
   overlaps text (no negative margins, no overlay). Kept compact so it does not take much room. */
.doc-close { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin: .9rem 0 .4rem; }
.doc-close .totals { margin-left: auto; }
.doc-seal { display: flex; align-items: center; gap: .7rem; color: var(--seal, #b5122b); position: relative; margin: 0; padding: .2rem 0; }
.doc-seal .seal-ring { width: 116px; height: 116px; transform: rotate(-8deg); opacity: .92; flex-shrink: 0; }
.doc-seal .seal-info { display: flex; align-items: center; gap: .5rem; border: 1px dashed currentColor; border-radius: 6px; padding: .3rem .45rem; background: transparent; }
.doc-seal .seal-qr { width: 54px; height: 54px; flex-shrink: 0; }
.doc-seal .seal-qr svg { width: 100%; height: 100%; display: block; }
.doc-seal .seal-qr svg path { fill: #111; }
.doc-seal .seal-text { display: flex; flex-direction: column; font-size: .62rem; line-height: 1.32; color: #333; max-width: 150px; }
.doc-seal .seal-text b { color: var(--seal, #b5122b); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 600px) { .doc-seal .seal-ring { width: 100px; height: 100px; } }

/* ---------- Document footer: rule, stamp + QR verification, closing line (documents/_doc_footer.html) ----------
   In PDFs this footer is repeated at the bottom of every page (static/js/pdf.js). */
.doc-footer { display: flex; align-items: center; gap: .9rem; margin-top: 1.4rem; padding-top: .8rem; border-top: 1.5px solid var(--ink);
  page-break-inside: avoid; break-inside: avoid; }
.doc-footer .doc-seal { flex-shrink: 0; gap: .55rem; padding: 0; margin: 3px 0 4px 5px; }   /* room for the tilted ring */
.doc-footer .doc-seal .seal-ring { width: 78px; height: 78px; }
.doc-footer .doc-seal .seal-info { padding: .25rem .4rem; gap: .4rem; }
.doc-footer .doc-seal .seal-qr { width: 44px; height: 44px; }
.doc-footer .doc-seal .seal-text { font-size: .56rem; max-width: 140px; line-height: 1.28; }
.doc-footer .doc-seal .seal-text b { font-size: .6rem; }
.doc-footer .df-text { margin-left: auto; text-align: right; font-size: .76rem; color: #555; font-style: italic; max-width: 48%; }
.doc-footer.no-seal { justify-content: center; }
.doc-footer.no-seal .df-text { margin: 0; text-align: center; max-width: none; }
.pdf-capture .doc-footer .doc-seal .seal-ring { width: 78px !important; height: 78px !important; }
/* while a PDF is made, the in-page footer is hidden: the PDF draws it at the foot of every page instead */
.pdf-capture [data-doc-footer] { display: none !important; }
.pdf-footer-host { position: fixed; left: -12000px; top: 0; width: 794px; background: #fff; padding: 0 2.2rem 6px; }
.pdf-footer-host .doc-footer { margin-top: 0; }

/* ---------- Full-height tool pages: no outer scrolling, the tool fills the screen ---------- */
body.tool-page { overflow: hidden; }
body.tool-page .content { padding: 0; max-width: none; }
body.tool-page .footer { display: none; }
body.tool-page .tool-frame { height: calc(100vh - var(--topbar-h)); min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
body.tool-page .breadcrumb .small { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Letters ---------- */
.letter-to { margin: .2rem 0 1.1rem; line-height: 1.5; }
.letter-subject { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; text-decoration: underline; margin: .9rem 0 .8rem; color: var(--ink); }
.letter-body p { margin: 0 0 .75rem; text-align: justify; white-space: pre-wrap; }
.letter-sign { margin-top: 1.2rem; }
.letter-sign .line { width: 200px; border-bottom: 1px solid #555; height: 2.2rem; }
.letter-steps .step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--gold-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; margin-right: .45rem; }
.letter-layout { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.letter-layout .preview-pane { position: sticky; top: calc(var(--topbar-h) + .75rem); max-height: calc(100vh - var(--topbar-h) - 1.5rem); overflow: auto; border-radius: var(--radius-lg); }
.letter-layout .preview-pane .doc { box-shadow: var(--shadow-sm); }
.tpl-list { max-height: 230px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.tpl-list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); padding: .45rem .65rem; cursor: pointer; font: inherit; }
.tpl-list button:hover { background: var(--surface-2); }
.tpl-list button.active { background: var(--gold-pale); box-shadow: inset 3px 0 0 var(--gold); }
.tpl-list button b { display: block; font-size: .84rem; } .tpl-list button small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .letter-layout { grid-template-columns: 1fr; } .letter-layout .preview-pane { position: static; max-height: none; } }

/* ---------- Sidebar search ---------- */
.nav-search { position: relative; padding: .6rem .7rem .3rem; }
.nav-search i { position: absolute; left: 1.35rem; top: 50%; transform: translateY(-35%); color: #8d91ab; font-size: .85rem; pointer-events: none; }
.nav-search input { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #fff; height: 32px; padding-left: 2rem; font-size: .84rem; }
.nav-search input::placeholder { color: #8d91ab; }
.nav-search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(10,143,208,.18); background: rgba(255,255,255,.1); }
.nav-results { overflow-y: auto; flex: 1; padding: .2rem 0 .8rem; }
.nav-results .nav-link { flex-wrap: wrap; row-gap: 0; }
.nav-results .nav-link small { flex-basis: 100%; padding-left: 1.8rem; color: #8d91ab; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-results .nav-link.sel { background: rgba(10,143,208,.22); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-results mark { background: none; color: var(--gold-2); font-weight: 700; }
.nav-results .none { color: #8d91ab; padding: .8rem 1rem; font-size: .84rem; }
body.nav-mini .nav-search input { display: none; }
body.nav-mini .nav-search { padding: .6rem 0 .2rem; text-align: center; cursor: pointer; }
body.nav-mini .nav-search i { position: static; transform: none; font-size: 1.05rem; color: #a9adc5; }
@media (max-width: 1100px) and (min-width: 901px) {
  body:not(.nav-full) .nav-search input { display: none; }
  body:not(.nav-full) .nav-search { text-align: center; } body:not(.nav-full) .nav-search i { position: static; transform: none; }
}
.topbar-bell { position: relative; }
.bell-badge { position: absolute; top: 1px; right: 0; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

/* ---------- Searchable select ---------- */
.ss-wrap { position: relative; min-width: 0; }
.toolbar .ss-wrap { min-width: 160px; max-width: 240px; }
.ss-native { position: absolute !important; opacity: 0 !important; pointer-events: none !important; height: 0 !important; width: 0 !important; }
.ss-input { padding-right: 1.8rem !important; cursor: text;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%237d7f8c' stroke-width='2' d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right .55rem center / 12px !important; }
.ss-list { left: 0; right: 0; min-width: 220px; max-height: 280px; overflow-y: auto; z-index: 1080; }
.ss-list button { padding: .4rem .6rem; font-size: .86rem; }
.ss-list button.sel { background: var(--gold-pale); }

/* ---------- Receipt book (formal, same letterhead and stamp as letters) ---------- */
/* Each A4 page holds 1 or 2 slips of a fixed height, so every page of a book has the same layout: the PDF captures
   a page once and only writes the receipt numbers (.rb-no) on top of it. */
.rb-page { padding: 1.1rem 1.5rem; }
.rb-slip { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.rb-page.per-2 .rb-slip { height: 528px; }
.rb-page.per-2 .rb-slip + .rb-slip { border-top: 2px dashed #bbb; margin-top: .9rem; padding-top: .9rem; height: 546px; }
.rb-page.per-1 .rb-slip { height: 1090px; }
.rb-slip .doc-head { padding-bottom: .55rem; margin-bottom: .6rem; gap: 1rem; }
.rb-page.per-2 .doc-brand img { width: 58px; height: 58px; }
.rb-page.per-2 .doc-brand h2 { font-size: 1.1rem; }
.rb-page.per-2 .doc-brand p { font-size: .7rem; }
.rb-page.per-2 .doc-title h1 { font-size: 1.25rem; }
.rb-page.per-2 .doc-title table { font-size: .78rem !important; margin-top: .25rem !important; }
.rb-slip .doc-title .no { font-family: var(--mono); font-size: 1.05rem; font-weight: 800; color: #b5122b; letter-spacing: .04em; }
.rb-no.rb-blank { color: transparent; }
.rb-lines { display: grid; gap: .1rem; margin: 0 0 .55rem; }
.rb-page.per-1 .rb-lines { gap: .55rem; margin-bottom: 1.1rem; }
.rb-line { display: flex; align-items: flex-end; gap: .6rem; font-size: .86rem; }
.rb-line span { white-space: nowrap; font-weight: 600; color: var(--ink); min-width: 0; }
.rb-line i { flex: 1; border-bottom: 1px solid #888; height: 1.75rem; }
.rb-page.per-1 .rb-line i { height: 2.1rem; }
.rb-main { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rb-main > .rb-left { flex: 1; }
.rb-left { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.rb-page.per-1 .rb-left { gap: 1rem; }
.rb-figures { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.rb-amount { display: flex; align-items: center; gap: .45rem; border: 2px solid var(--ink); border-radius: 8px; padding: .35rem .6rem; }
.rb-amount.soft { border-width: 1px; border-color: #999; }
.rb-amount span { font-size: .64rem; text-transform: uppercase; letter-spacing: .07em; color: #666; white-space: nowrap; }
.rb-amount b { font-size: 1.1rem; color: var(--ink); }
.rb-amount i { flex: 1; border-bottom: 1px solid #888; height: 1.25rem; }
.rb-methods { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .8rem; align-items: center; }
.rb-methods span { font-weight: 600; }
.rb-methods label { display: inline-flex; gap: .3rem; align-items: center; }
.rb-box { width: 13px; height: 13px; border: 1.5px solid #555; border-radius: 2px; display: inline-block; }
.rb-notes { flex: 1; min-height: 64px; border: 1px solid #aaa; border-radius: 8px; padding: .3rem .6rem .4rem;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 25px, #cfcfcf 25px, #cfcfcf 26px); background-position: 0 1.25rem; background-origin: content-box; }
.rb-notes > span { display: block; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #8a6d1f; background: #fff; width: max-content; padding-right: .4rem; }
.rb-sign { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
/* the stamp sits in the receipt's footer (under the rule, beside the closing line), a little bigger than on other
   documents; nothing is ever written under or through it */
.rb-footer { margin-top: .7rem; padding-top: .6rem; }
.rb-footer .doc-seal { margin: 3px 0 4px 6px; }
.rb-footer .doc-seal .seal-ring { width: 96px; height: 96px; }
.rb-footer .doc-seal .seal-qr { width: 50px; height: 50px; }
.rb-footer .doc-seal .seal-text { font-size: .58rem; max-width: 150px; }
.rb-footer .df-text { font-size: .74rem; }
.rb-footer .rb-verify { display: block; margin-top: .25rem; font-size: .66rem; font-style: normal; color: #777; }
.rb-page.per-1 .rb-footer { margin-top: 1.1rem; padding-top: .8rem; }
.rb-page.per-1 .rb-footer .doc-seal .seal-ring { width: 118px; height: 118px; }
.rb-page.per-1 .rb-footer .doc-seal .seal-qr { width: 58px; height: 58px; }
.rb-page.per-1 .rb-footer .doc-seal .seal-text { font-size: .64rem; }
.rb-page.per-1 .rb-footer .df-text { font-size: .82rem; }
.rb-only-1 { display: none !important; }
.rb-page.per-1 .rb-only-1 { display: flex !important; }
.nav-results .nav-link > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Client files ---------- */
.cf-drop { display: flex; align-items: center; gap: .8rem; border: 2px dashed var(--border-strong); border-radius: 10px; padding: .8rem 1rem; background: var(--surface-2); transition: border-color .15s, background .15s; }
.cf-drop.over { border-color: var(--gold); background: var(--gold-pale); }
.cf-drop.busy { opacity: .6; pointer-events: none; }

/* PDFs always use the desktop A4 layout, even when generated on a phone */
.pdf-capture .doc-head { flex-direction: row !important; }
.pdf-capture .doc-title { text-align: right !important; }
.pdf-capture .doc-parties { grid-template-columns: 1fr 1fr !important; }
.pdf-capture .doc-kpis { grid-template-columns: repeat(4, 1fr) !important; }
.pdf-capture .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.pdf-capture.doc, .pdf-capture .doc { padding: 2.2rem !important; }
.pdf-capture.rb-page { padding: 1.1rem 1.5rem !important; }
.pdf-capture .doc-seal { margin: 0 !important; }                 /* in its own space, never over text */
.pdf-capture .doc-seal .seal-ring { width: 116px !important; height: 116px !important; }
.pdf-capture .doc-close { flex-wrap: nowrap !important; }
.pdf-capture .rb-footer .doc-seal, .pdf-capture.rb-page .rb-footer .doc-seal { margin: 3px 0 4px 6px !important; }
.pdf-capture .rb-page.per-2 .rb-footer .doc-seal .seal-ring, .pdf-capture.rb-page.per-2 .rb-footer .doc-seal .seal-ring { width: 96px !important; height: 96px !important; }
.pdf-capture .rb-page.per-1 .rb-footer .doc-seal .seal-ring, .pdf-capture.rb-page.per-1 .rb-footer .doc-seal .seal-ring { width: 118px !important; height: 118px !important; }

/* ------------------------------------------------------------------ client portal: personal appearance */
.clip { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-link { display: block; text-decoration: none !important; color: inherit; }
.prewrap { white-space: pre-wrap; }
html.font-small { font-size: 13px; } html.font-large { font-size: 15.5px; }
body.density-compact .content { padding-top: .8rem; } body.density-compact .card-body { padding: .7rem .8rem; }
body.density-compact .table td, body.density-compact .table th { padding-top: .35rem; padding-bottom: .35rem; } body.density-compact .kpis { gap: .5rem; }
.accent-dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: -4px; border: 2px solid rgba(0,0,0,.12); }
.accent-dot.accent-gold, body.accent-gold { --accent: #0a8fd0; --accent-2: #4cc3f5; }
.accent-dot.accent-blue, body.accent-blue { --accent: #2563eb; --accent-2: #60a5fa; }
.accent-dot.accent-green, body.accent-green { --accent: #15803d; --accent-2: #4ade80; }
.accent-dot.accent-purple, body.accent-purple { --accent: #7c3aed; --accent-2: #a78bfa; }
.accent-dot.accent-red, body.accent-red { --accent: #b91c1c; --accent-2: #f87171; }
.accent-dot.accent-teal, body.accent-teal { --accent: #0f766e; --accent-2: #2dd4bf; }
.accent-dot { background: var(--accent); }
body.portal { --gold: var(--accent); --gold-2: var(--accent-2); }
body.portal:not(.accent-gold) .btn-gold { color: #fff; } body.portal:not(.accent-gold) .btn-gold:hover { color: #fff; }
body.portal .doc { --gold: #0a8fd0; --gold-2: #4cc3f5; }      /* printed documents keep the company colours */
body.theme-dark {
  --bg: #12131c; --surface: #1c1e2b; --surface-2: #242737; --border: #31354a; --border-strong: #454a63;
  --text: #e4e6f0; --text-2: #b9bdd0; --muted: #8b90a8; --ink-3: #9fb0e0;
  --success-bg: #173226; --success: #6fd3a0; --warning-bg: #3a2c12; --warning: #f0c060;
  --danger-bg: #3c1a20; --danger: #f28b9b; --info-bg: #182945; --info: #8fb6ff; --gold-pale: #2f2a1a;
  color-scheme: dark;
}
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3, body.theme-dark h4, body.theme-dark legend,
body.theme-dark .kpi .value, body.theme-dark .table .primary-text, body.theme-dark .item-card .ic-title,
body.theme-dark .breadcrumb .current, body.theme-dark .user-chip b { color: #f3f4fa; }
body.theme-dark .topbar { background: var(--surface); border-color: var(--border); }
body.theme-dark .kpi-icon { background: var(--surface-2) !important; color: var(--accent-2) !important; }
body.theme-dark .btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
body.theme-dark .btn-outline:hover, body.theme-dark .btn-ghost:hover { background: var(--surface-2); color: #fff; }
body.theme-dark input, body.theme-dark select, body.theme-dark textarea { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
body.theme-dark a { color: #9fb6ff; } body.theme-dark .dropdown, body.theme-dark .modal-content { background: var(--surface); color: var(--text); }
body.theme-dark .doc { --surface: #fff; --surface-2: #faf9f6; --border: #e6e0d3; --text: #1f2333; --text-2: #4b5165; --muted: #7d7f8c; color-scheme: light; }
body.theme-dark .doc :is(h1, h2, h3, h4) { color: #1a1a2e; } body.theme-dark .doc a { color: #3d4f7c; }
body.theme-dark .doc-parties h4, body.theme-dark .doc h3.doc-section { color: var(--gold); } body.theme-dark .doc-promo h2 { color: #fff; }
@media print { body.theme-dark { --bg: #fff; background: #fff; } }

/* ------------------------------------------------------------------ public pages (project request form) */
.public-page { background: var(--bg); }
.public-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.4rem; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.public-head .brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.public-head .brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.public-head .brand b { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.public-head .brand span { color: var(--gold-2); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; }
.public-head .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.public-main { max-width: 1040px; margin: 0 auto; padding: 1.4rem 1rem 3rem; }
.step { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--gold); color: var(--ink); align-items: center; justify-content: center; font-size: .82rem; margin-right: .35rem; }
.choice-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.choice:hover { border-color: var(--ink-3); } .choice:has(input:checked) { border-color: var(--gold); background: var(--gold-pale); }
.choice input { margin-top: .2rem; width: 1rem; height: 1rem; accent-color: var(--ink); }
.choice small { display: block; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.field.invalid input, .field.invalid textarea, .card.invalid { border-color: var(--danger) !important; }
.auth-request { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); text-align: center; }
.auth-request .btn { width: 100%; }

/* ------------------------------------------------------------------ "How your project will be done" + working terms */
.how-we-work h3 { font-size: .95rem; margin-bottom: .5rem; }
.hw-tile { display: flex; gap: .7rem; padding: .8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.hw-tile i { font-size: 1.4rem; color: var(--gold); } .hw-tile span { display: block; color: var(--text-2); font-size: .85rem; margin-top: .15rem; }
.hw-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .55rem; } .hw-steps li { padding-left: .2rem; } .hw-steps li::marker { font-weight: 700; color: var(--gold); }
.hw-contact .details { margin: 0; }
.terms-list { list-style: none; margin: 0; display: grid; gap: .6rem; }
.terms-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; } .terms-list i { color: var(--gold); font-size: 1.05rem; margin-top: .05rem; }
.hero-how { margin: 1rem 0 .4rem; }
.auth-request .how-link { margin-top: .4rem; width: 100%; }

.type-part { border: 0; padding: 0; margin: 0; min-width: 0; }
.type-part[hidden], #afterType[hidden] { display: none !important; }
.type-choice .choice b i { color: var(--gold); margin-right: .25rem; }
.type-choice .choice { padding: 1rem; }
.login-help { margin-top: 1rem; padding: .75rem .85rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); font-size: .82rem; }
.login-help b.mono { background: var(--gold-pale); padding: 0 .3rem; border-radius: 4px; }
.login-help ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.req-steps { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .35rem; }
.req-steps span { font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.req-steps span.done { background: var(--success-bg); color: var(--success); border-color: transparent; }
.req-steps span.now { background: var(--gold); color: var(--ink); border-color: transparent; font-weight: 600; }

/* ------------------------------------------------------------------ sign-in: "start a new project" call to action */
.cta-project { position: relative; display: flex; align-items: center; gap: .85rem; margin: 0 0 1.4rem; padding: .95rem 1rem; overflow: hidden;
  border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 60%, #4a3d14 100%); color: #fff;
  text-decoration: none; box-shadow: 0 10px 28px rgba(10,143,208,.35); border: 1px solid var(--gold); animation: cta-glow 2.6s ease-in-out infinite; }
.cta-project:hover { color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 14px 34px rgba(10,143,208,.5); }
.cta-project::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  transform: translateX(-100%); animation: cta-shine 3.2s ease-in-out infinite; pointer-events: none; }
.cta-project .cta-icon { flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--ink); font-size: 1.35rem; }
.cta-project b { display: block; font-size: 1.08rem; color: #fff; }
.cta-project small { display: block; color: var(--gold-2); font-size: .78rem; }
.cta-project .cta-go { margin-left: auto; font-size: 1.3rem; color: var(--gold-2); transition: transform .2s; }
.cta-project:hover .cta-go { transform: translateX(4px); }
@keyframes cta-shine { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes cta-glow { 0%, 100% { box-shadow: 0 10px 28px rgba(10,143,208,.28); } 50% { box-shadow: 0 10px 34px rgba(10,143,208,.55); } }
@media (prefers-reduced-motion: reduce) { .cta-project, .cta-project::after { animation: none; } }
.hero-cta { margin-top: 1.2rem; height: 46px; padding: 0 1.3rem; font-size: 1rem; font-weight: 600; }
.auth-hero .hero-how.btn-outline { margin-top: 1.2rem; height: 46px; background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }

/* ------------------------------------------------------------------ request wizard (public) */
.rq-hero { max-width: 860px; margin: 1.5rem auto 0; text-align: center; }
.rq-hero h1 { font-size: 2.1rem; margin-bottom: .3rem; }
.rq-hero .lead { color: var(--text-2); font-size: 1.05rem; margin: 0 auto 1.6rem; max-width: 34rem; }
.rq-pick { display: grid; gap: .9rem; grid-template-columns: repeat(3, 1fr); text-align: left; }
.rq-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.3rem 1.1rem; border-radius: var(--radius-lg); border: 2px solid var(--border);
  background: var(--surface); cursor: pointer; font: inherit; color: inherit; text-align: left; box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s, box-shadow .15s; }
.rq-card:hover, .rq-card:focus-visible { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow); }
.rq-card .ic { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  background: var(--gold-pale); color: #8a6d1f; margin-bottom: .4rem; }
.rq-card b { font-size: 1.12rem; color: var(--ink); }
.rq-card span { color: var(--muted); font-size: .86rem; }
.rq-card .go { margin-top: auto; padding-top: .6rem; color: var(--ink-3); font-weight: 600; font-size: .88rem; }
.rq-card.partner { background: linear-gradient(160deg, var(--surface) 55%, var(--gold-pale)); }
.rq-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.4rem; margin: 1.6rem 0 .6rem; color: var(--text-2); font-size: .88rem; }
.rq-trust i { color: var(--gold); margin-right: .3rem; }
.rq-foot { text-align: center; margin-top: 1rem; }
@media (max-width: 760px) { .rq-pick { grid-template-columns: 1fr; } .rq-hero h1 { font-size: 1.6rem; } }

.rq-modal .modal-content { border-top: 4px solid var(--gold); }
.rq-modal .modal-body { padding: 1.1rem 1.2rem; }
.rq-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; padding: .8rem 1.2rem 0; }
.rq-progress span { height: 5px; border-radius: 3px; background: var(--border); }
.rq-progress span.on { background: var(--gold); }
.rq-title { padding: .7rem 1.2rem 0; }
.rq-title .kicker { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #8a6d1f; font-weight: 700; }
.rq-title h2 { font-family: var(--font-display); font-size: 1.45rem; margin: .1rem 0 0; white-space: normal; }
.rq-title p { color: var(--muted); margin: .15rem 0 0; font-size: .88rem; }
.rq-modal .field { margin-bottom: .75rem; }
.rq-modal .field label { font-weight: 600; }
.rq-modal input, .rq-modal textarea, .rq-modal select { font-size: 1rem; }
.rq-modal input:not([type=radio]):not([type=checkbox]):not([type=file]) { height: 42px; }
.rq-modal .row2 { display: grid; gap: 0 .8rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .rq-modal .row2 { grid-template-columns: 1fr; } }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; }
.pill span { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer; font-size: .9rem; }
.pill input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.rq-want { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.rq-want .choice { padding: .55rem .7rem; }
.rq-want .choice b { font-size: .9rem; }
.rq-drop { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1rem; border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); text-align: center; cursor: pointer; }
.rq-drop:hover { border-color: var(--gold); }
.rq-drop i { font-size: 1.6rem; color: var(--gold); }
.rq-drop input { max-width: 100%; font-size: .85rem; }
.rq-promise { display: grid; gap: .35rem; margin: .4rem 0 0; padding: 0; list-style: none; font-size: .84rem; color: var(--text-2); }
.rq-promise i { color: var(--success); margin-right: .35rem; }
.rq-modal .modal-foot .btn { height: 42px; padding: 0 1.1rem; font-size: .95rem; }
.rq-modal .modal-foot .btn-gold { font-weight: 600; min-width: 9rem; }
.rq-error { margin-bottom: .8rem; }

/* wizard motion: every step arrives (and leaves) in its own way */
.rq-modal.fade { transition: opacity .34s ease; }
.rq-modal.fade .modal-dialog { transition: none; transform: none; }
.rq-modal.show .modal-dialog { animation: rq-bounce-in .7s cubic-bezier(.22,1.4,.36,1) both; }
.rq-modal[data-anim="zoom"].show .modal-dialog { animation: rq-zoom-in .6s cubic-bezier(.18,1.25,.4,1) both; }
.rq-modal[data-anim="flip"].show .modal-dialog { animation: rq-flip-in .7s cubic-bezier(.2,1.2,.35,1) both; }
.rq-modal:not(.show) .modal-dialog { animation: rq-out-left .32s ease-in both; }
.rq-modal.rq-back:not(.show) .modal-dialog { animation: rq-out-right .32s ease-in both; }
.rq-modal.rq-closing:not(.show) .modal-dialog { animation: rq-out-zoom .32s ease-in both; }
@keyframes rq-bounce-in { 0% { opacity: 0; transform: translateY(-60px) scale(.7); } 55% { opacity: 1; transform: translateY(10px) scale(1.04); }
  75% { transform: translateY(-4px) scale(.99); } 100% { transform: none; } }
@keyframes rq-zoom-in { 0% { opacity: 0; transform: scale(.4) rotate(-6deg); } 65% { opacity: 1; transform: scale(1.05) rotate(1deg); } 100% { transform: none; } }
@keyframes rq-flip-in { 0% { opacity: 0; transform: perspective(900px) rotateX(-70deg) translateY(40px); }
  60% { opacity: 1; transform: perspective(900px) rotateX(12deg); } 100% { transform: perspective(900px) rotateX(0); } }
@keyframes rq-out-left { to { opacity: 0; transform: translateX(-90px) scale(.92); } }
@keyframes rq-out-right { to { opacity: 0; transform: translateX(90px) scale(.92); } }
@keyframes rq-out-zoom { to { opacity: 0; transform: scale(.6); } }
/* the questions arrive one after another */
.rq-modal.show .type-part:enabled > *, .rq-modal.show .modal-body > :not(fieldset) { animation: rq-rise .45s ease-out both; }
.rq-modal.show .type-part > :nth-child(1), .rq-modal.show .modal-body > :nth-child(1) { animation-delay: .18s; }
.rq-modal.show .type-part > :nth-child(2), .rq-modal.show .modal-body > :nth-child(2) { animation-delay: .25s; }
.rq-modal.show .type-part > :nth-child(3), .rq-modal.show .modal-body > :nth-child(3) { animation-delay: .32s; }
.rq-modal.show .type-part > :nth-child(4), .rq-modal.show .modal-body > :nth-child(4) { animation-delay: .39s; }
.rq-modal.show .type-part > :nth-child(5), .rq-modal.show .modal-body > :nth-child(5) { animation-delay: .46s; }
.rq-modal.show .type-part > :nth-child(6), .rq-modal.show .modal-body > :nth-child(6) { animation-delay: .53s; }
.rq-modal.show .type-part > :nth-child(n+7), .rq-modal.show .modal-body > :nth-child(n+7) { animation-delay: .6s; }
@keyframes rq-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rq-modal.show .rq-progress span.on { animation: rq-fill .6s .2s ease-out both; transform-origin: left; }
@keyframes rq-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rq-modal.show .rq-title h2 { animation: rq-pop .5s .12s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes rq-pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.rq-modal .modal-foot .btn-gold { animation: rq-pulse 2.2s 1.2s ease-in-out infinite; }
@keyframes rq-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(10,143,208,.55); } 50% { box-shadow: 0 0 0 9px rgba(10,143,208,0); } }
.rq-modal .modal-foot .btn-gold:hover i.bi-arrow-right { transform: translateX(4px); } .rq-modal .modal-foot .btn-gold i { transition: transform .2s; }
.rq-modal.rq-shake .modal-dialog { animation: rq-shake .45s ease both !important; }
@keyframes rq-shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.pill input:checked + span, .choice:has(input:checked) { animation: rq-tick .3s cubic-bezier(.2,1.8,.4,1); }
@keyframes rq-tick { 50% { transform: scale(1.07); } }
.public-page .modal-backdrop.show { backdrop-filter: blur(4px); background: rgba(11,26,51,.55); }
/* the choice screen */
.rq-hero h1 { animation: rq-rise .6s ease-out both; } .rq-hero .lead { animation: rq-rise .6s .1s ease-out both; }
.rq-pick .rq-card { animation: rq-card-in .65s cubic-bezier(.2,1.4,.4,1) both; }
.rq-pick .rq-card:nth-child(1) { animation-delay: .2s; } .rq-pick .rq-card:nth-child(2) { animation-delay: .32s; } .rq-pick .rq-card:nth-child(3) { animation-delay: .44s; }
@keyframes rq-card-in { from { opacity: 0; transform: translateY(40px) scale(.85); } to { opacity: 1; transform: none; } }
.rq-card .ic { animation: rq-float 3s ease-in-out infinite; } .rq-card:nth-child(2) .ic { animation-delay: .5s; } .rq-card:nth-child(3) .ic { animation-delay: 1s; }
@keyframes rq-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.rq-card:hover .ic { animation: rq-wiggle .5s ease; }
@keyframes rq-wiggle { 25% { transform: rotate(-10deg) scale(1.1); } 75% { transform: rotate(10deg) scale(1.1); } }
.rq-trust span { animation: rq-rise .5s ease-out both; } .rq-trust span:nth-child(1) { animation-delay: .6s; } .rq-trust span:nth-child(2) { animation-delay: .7s; }
.rq-trust span:nth-child(3) { animation-delay: .8s; } .rq-trust span:nth-child(4) { animation-delay: .9s; }
.rq-hero.rq-leave { animation: rq-out-zoom .3s ease-in both; }
.rq-done-icon { display: inline-block; animation: rq-zoom-in .8s cubic-bezier(.18,1.6,.4,1) both; }
@media (prefers-reduced-motion: reduce) {
  .rq-modal *, .rq-modal .modal-dialog, .rq-hero *, .rq-hero, .rq-done-icon { animation: none !important; }
}

/* ------------------------------------------------------------------ send documents by WhatsApp / email */
.btn-wa { background: #25d366; color: #fff; border-color: #1fb457; } .btn-wa:hover { background: #1fb457; color: #fff; }
.send-modal.show .modal-dialog { animation: rq-zoom-in .45s cubic-bezier(.18,1.25,.4,1) both; }
.send-channels { display: flex; gap: .5rem; margin-bottom: 1rem; }
.send-ch { position: relative; flex: 1; }
.send-ch input { position: absolute; opacity: 0; inset: 0; }
.send-ch span { display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .65rem; border-radius: var(--radius);
  border: 2px solid var(--border); background: var(--surface-2); font-weight: 650; cursor: pointer; transition: all .15s; }
.send-ch span i { font-size: 1.15rem; }
.send-ch.wa input:checked + span { border-color: #25d366; background: #e9fbf0; color: #128c4a; }
.send-ch.em input:checked + span { border-color: var(--gold); background: var(--gold-pale); color: var(--ink); }
.send-ch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.send-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; }
@media (max-width: 760px) { .send-grid { grid-template-columns: 1fr; } }
.send-grid textarea { font-family: var(--font); font-size: .9rem; line-height: 1.5; min-height: 260px; }
.send-attach { display: grid; grid-template-columns: auto 1fr; gap: .4rem .7rem; align-items: center; padding: .8rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2); }
.send-attach b { display: block; font-size: .86rem; word-break: break-all; } .send-attach small { display: block; }
.send-attach .check { grid-column: 1 / -1; font-size: .84rem; }
.send-file { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--danger-bg);
  color: var(--danger); font-size: 1.4rem; }
.send-history ul { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .3rem; font-size: .82rem; }
.send-history i { color: var(--success); }

/* ------------------------------------------------------------------ work management + sign-in work reminder */
.wm-filters { flex-wrap: wrap; gap: .5rem; }
.wn-list { border: 1px solid var(--border); border-radius: 8px; margin: 0; padding: 0; list-style: none; }
.wn-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: .5rem .9rem; align-items: center; padding: .65rem .8rem; }
.wn-item + .wn-item { border-top: 1px solid var(--border); }
.wn-main b { display: block; } .wn-main small { display: block; margin-bottom: .15rem; }
.wn-set { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: .4rem; }
@media (max-width: 700px) { .wn-item, .wn-set { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ client check-ups */
.ck-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.ck-group { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .75rem .85rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; text-align: left; transition: all .15s; }
.ck-group:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ck-group.active { border-color: var(--gold); background: var(--gold-pale); box-shadow: 0 0 0 2px var(--gold) inset; }
.ck-group:disabled { opacity: .5; cursor: default; }
.ck-group .n { font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.ck-group .l { font-size: .82rem; color: var(--text-2); }
.ck-clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .6rem; max-height: calc(100vh - 360px); overflow: auto; }
.ck-client { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font: inherit; color: inherit; text-align: left; transition: all .15s; }
.ck-client:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.ck-client .b { min-width: 0; flex: 1; } .ck-client .b b, .ck-client .b small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-client .go { color: var(--gold); font-size: 1.2rem; }
.ck-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; flex-wrap: wrap; }
.ck-pdf-host { position: absolute; left: -12000px; top: 0; width: 794px; }
/* dissertation suggestions */
.ds-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; }
.ds-list { display: grid; gap: .6rem; }
.ds-item { display: flex; gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  animation: rq-rise .4s ease-out both; }
.ds-item:nth-child(2) { animation-delay: .05s; } .ds-item:nth-child(3) { animation-delay: .1s; } .ds-item:nth-child(4) { animation-delay: .15s; } .ds-item:nth-child(5) { animation-delay: .2s; }
.ds-n { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--gold); color: var(--ink); display: flex; align-items: center;
  justify-content: center; font-weight: 700; }
.ds-b { min-width: 0; } .ds-b h3 { margin: .1rem 0 .4rem; font-size: 1rem; } .ds-b p { margin: 0 0 .4rem; font-size: .88rem; }
.ds-b ul, .ds-b ol { margin: 0 0 .4rem; padding-left: 1.1rem; font-size: .85rem; color: var(--text-2); }
.ds-private { font-style: italic; }
.ds-letter-list > li { margin-bottom: .7rem; } .ds-letter-list ul { margin: .25rem 0 0; }
/* the suggestions letter: one labelled block per project */
.ds-sugs { display: grid; gap: .85rem; margin: .9rem 0 1rem; }
.ds-sug { border: 1px solid #e3dccb; border-left: 4px solid var(--gold); border-radius: 8px; overflow: hidden; background: #fff; }
.ds-sug-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: var(--ink); color: #fff; padding: .45rem .85rem; }
.ds-sug-no { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; color: var(--gold-2); }
.ds-sug-of { font-size: .7rem; color: #c9cbe0; }
.ds-sug-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: .75rem; padding: .5rem .85rem; border-top: 1px solid #f0ebde; line-height: 1.5; }
.ds-sug-head + .ds-sug-row { border-top: 0; }
.ds-sug-lbl { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #8a6d1f; padding-top: .18rem; }
.ds-sug-title { font-weight: 700; color: var(--ink); font-size: .98rem; }
.ds-sug-obj { margin: 0; padding-left: 1.15rem; display: grid; gap: .22rem; }
.ds-sug-obj li::marker { font-weight: 700; color: #8a6d1f; }
.ds-sug-none { color: #888; font-style: italic; }
.letter-body .ds-sug p { white-space: normal; text-align: left; }
#printOnly { display: none; }
@media print {
  body.print-only > *:not(#printOnly), body.print-only .app { display: none !important; }
  body.print-only #printOnly { display: block !important; position: static; }
}
.mm-summary { margin-bottom: .8rem; }
.mm-table { border-collapse: collapse; margin: 0 0 1rem; min-width: 280px; }
.mm-table td { padding: .35rem .8rem; border: 1px solid var(--border); }
.mm-table td:first-child { color: var(--muted); } .mm-table td:last-child { font-weight: 700; text-align: right; }
.mm-table tr:last-child td:last-child { color: var(--danger); }

/* quotation: the steps from "client said yes" to "work started" */
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; counter-reset: s; }
.flow-steps li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; position: relative; padding: .3rem; }
.flow-steps li + li::before { content: ""; position: absolute; top: 1.15rem; right: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.flow-steps li.done + li::before { background: var(--success); }
.flow-steps .dot { position: relative; z-index: 1; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 2px solid var(--border-strong); color: var(--muted); }
.flow-steps li.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.flow-steps li.now .dot { background: var(--gold); border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 4px var(--gold-pale); }
.flow-steps b { font-size: .84rem; } .flow-steps small { font-size: .78rem; color: var(--muted); word-break: break-word; }
.flow-steps li.now small a { font-weight: 700; }
@media (max-width: 700px) { .flow-steps { grid-template-columns: 1fr; } .flow-steps li { flex-direction: row; text-align: left; gap: .6rem; } .flow-steps li + li::before { display: none; } }

/* sign-in page on phones: the brand panel is hidden, so show a compact brand header above the form */
.auth-mobile-brand { display: none; }
@media (max-width: 900px) {
  .auth-panel { align-items: flex-start; padding: 0 1rem 2rem; }
  .auth-mobile-brand { display: flex; align-items: center; gap: .7rem; margin: 0 -1rem 1.4rem; padding: 1rem 1.1rem;
    background: linear-gradient(135deg, var(--ink), var(--ink-2)); color: #fff; }
  .auth-mobile-brand img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; flex-shrink: 0; }
  .auth-mobile-brand b { display: block; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .02em; text-transform: uppercase; }
  .auth-mobile-brand span { color: var(--gold-2); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }
  .auth-card { width: 100%; max-width: 440px; }
}

/* what a quotation / invoice is for, printed on the document */
.doc-subject { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .7rem; margin: 0 0 1rem; padding: .6rem .8rem;
  border-left: 4px solid var(--gold); background: #faf6ea; border-radius: 0 6px 6px 0; }
.doc-subject span { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #8a6d1f; font-weight: 700; }
.doc-subject b { font-size: 1rem; color: #1a1a2e; }
.doc-subject small { color: #555; }
.sub-text.subject { color: var(--text-2); }

/* referral claims: tall enough to work in, and room for the client search dropdown */
.claims-wrap { min-height: 520px; max-height: none; }
.claims-wrap td { vertical-align: top; padding-top: .75rem; padding-bottom: .75rem; }
.claims-wrap .claim-search { width: 100%; }
@media (max-width: 900px) { .claims-wrap { min-height: 420px; } }

.earn-rules ol { margin: 0; padding-left: 2rem; display: grid; gap: .5rem; font-size: .87rem; }
.earn-rules li::marker { font-weight: 700; color: var(--gold); }

/* ---------- Project objectives: one per line, shown as a numbered list ---------- */
/* numbers are real text (span.obj-no), not list markers, so PDFs (html2canvas) and prints show them exactly */
ol.objectives { margin: 0 0 .4rem; padding: 0; list-style: none; display: block; }
ol.objectives li { display: flex; gap: .5rem; align-items: baseline; line-height: 1.5; margin: 0 0 .35rem; padding: 0; }
ol.objectives li::marker { content: none; }
ol.objectives .obj-no { flex: 0 0 1.9em; text-align: right; font-weight: 700; color: #8a6d1f; }
ol.objectives .obj-text { flex: 1 1 auto; min-width: 0; }

/* ---------- Employee rating ---------- */
.stars { color: var(--gold); letter-spacing: .05em; white-space: nowrap; }
.stars .off { color: var(--border-strong); }

/* ---------- Stock line editor (js/stock-lines.js) ---------- */
.sl-search { position: relative; margin-bottom: .6rem; }
.sl-search .input-icon { width: 100%; }
.sl-search input { width: 100%; }
.sl-results { left: 0; right: 0; max-height: 300px; overflow-y: auto; z-index: 1070; }
.sl-results button { display: flex; gap: .5rem; align-items: center; text-align: left; }
.sl-table input[type=number] { width: 100%; min-width: 64px; }

/* ---------- Start working on a project (assign modal) ---------- */
.as-steps { list-style: none; display: flex; gap: .4rem; padding: 0; margin: 0 0 .9rem; flex-wrap: wrap; counter-reset: as; }
.as-steps li { counter-increment: as; font-size: .78rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.as-steps li::before { content: counter(as) ". "; font-weight: 700; }
.as-steps li.done { background: var(--success-bg); color: var(--success); border-color: transparent; }
.as-steps li.now { background: var(--ink); color: #fff; border-color: var(--ink); }
.as-list { padding: 0; max-height: 52vh; grid-template-columns: minmax(0, 1fr); gap: .5rem; overflow-x: hidden; }
.as-list .mini-card, .myp button.mini-card { width: 100%; text-align: left; background: var(--surface); font: inherit; color: inherit; cursor: pointer;
  align-items: flex-start; overflow: hidden; }
/* the cards are buttons holding <span>s: make them blocks so widths and wrapping apply (long names used to spill over) */
.as-list .mini-card .avatar { flex-shrink: 0; }
.as-list .mini-card .mc-body { display: block; min-width: 0; flex: 1 1 auto; }
.as-list .mini-card .mc-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal;
  overflow: hidden; word-break: break-word; line-height: 1.3; }
.as-list .mini-card .mc-sub { display: block; white-space: normal; overflow-wrap: anywhere; margin-top: .15rem; }
.as-list .mini-card .mc-right { flex-shrink: 0; align-self: center; margin-left: .5rem; }
.mini-card.active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-pale); }

/* ---------- My work: projects assigned to me ---------- */
#myProjects { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.myp { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .7rem .8rem; background: var(--surface); }
.myp-new { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-pale); }
.myp-head { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .4rem; }
.myp-head select { max-width: 170px; }
.myp-sum { display: flex; gap: .35rem; flex-wrap: wrap; margin: .2rem 0 .4rem; }
.myp .table { font-size: .8rem; }
tr.res-new td { background: var(--success-bg); }

/* ---------- Public quotation link (/q/<code>) ---------- */
.ql-wrap { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 1.5rem 1rem; background: var(--bg); }
.ql-card { width: min(560px, 100%); }
.ql-head { justify-content: flex-start; gap: .7rem; }
.ql-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.ql-head b { font-family: var(--font-display); font-size: 1.1rem; }
.ql-for { color: var(--muted); font-size: .85rem; }
.ql-title { font-size: 1.3rem; margin: .1rem 0 .8rem; }
.ql-items td { vertical-align: top; }
.ql-total td { font-weight: 700; border-top: 2px solid var(--ink); }
.ql-pay { display: grid; gap: .45rem; margin: 1rem 0; }
.ql-pay > div { display: flex; justify-content: space-between; align-items: center; padding: .6rem .8rem; border-radius: var(--radius); }
.ql-now { background: var(--gold-pale); border: 1px solid var(--gold); }
.ql-now b { font-size: 1.35rem; color: var(--ink); }
.ql-later { background: var(--surface-2); border: 1px solid var(--border); }
.ql-bank { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: .6rem .8rem; font-size: .9rem; }
.ql-bank .label { margin-bottom: .2rem; }
.ql-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.ql-actions form { flex: 1 1 200px; margin: 0; }
.ql-btn { width: 100%; height: 44px; font-size: .95rem; justify-content: center; }
.ql-actions > a.ql-btn { flex: 1; }

/* ---------- Quotation: Project Details page ---------- */
.doc-project .pd-intro { font-size: .92rem; line-height: 1.6; color: #333; margin: 0 0 1rem; }
.doc-project .pd-text { font-size: .9rem; line-height: 1.6; color: #333; white-space: pre-wrap; margin: 0 0 .6rem; }
.doc-project .pd-small { font-size: .8rem; color: #666; line-height: 1.5; margin: -.4rem 0 .9rem; }
.doc-project .pd-objectives { font-size: .9rem; margin-bottom: 1rem; }
.doc-project .pd-objectives li { line-height: 1.55; }
.doc-project table.pd-terms { margin-bottom: .9rem; }
.doc-project table.pd-terms td:first-child { color: #555; width: 62%; }
.doc-project tr.pd-due td { background: var(--gold-pale); }
.doc-project .pd-bank { border: 1px solid #e6e0d3; border-left: 4px solid var(--gold); border-radius: 8px; padding: .65rem .85rem; font-size: .9rem;
  line-height: 1.6; margin-bottom: .9rem; background: #fdfbf6; }
.doc-project .pd-sign { display: flex; gap: 1.5rem 2.5rem; flex-wrap: wrap; margin-top: 1.4rem; align-items: flex-end; }
.doc-project .pd-sign > div { min-width: 200px; display: flex; flex-direction: column; gap: .15rem; }
.doc-project .pd-sign { flex-wrap: nowrap; }
.doc-project .pd-sign > div { min-width: 0; flex: 1 1 0; }
.doc-project .pd-sign > .pd-seal { flex: 0 0 auto; margin-left: auto; }   /* the stamp's own space, beside the signatures */
.doc-project .pd-seal .seal-info { display: none; }                          /* QR verification is on the quotation page */
.doc-project .pd-seal .seal-ring, .pdf-capture .doc-project .pd-seal .seal-ring { width: 104px !important; height: 104px !important; }
.doc-project .pd-sign span { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: #8a6d1f; font-weight: 700; }
.doc-project .pd-sign small { color: #777; font-size: .75rem; }
.doc-project .pd-line { display: block; border-bottom: 1px solid #999; height: 1.6rem; }

/* ---------- Fonts of the celebration cards (static/vendor/fonts/README.txt) ----------
   Bundled so a card looks the same on a phone as on a Windows PC: Gelasio has Georgia's widths, Selawik has Segoe UI's. */
@font-face { font-family: "DDS Card Serif"; font-weight: 400; font-style: normal; font-display: block; src: url("../vendor/fonts/gelasio-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DDS Card Serif"; font-weight: 400; font-style: italic; font-display: block; src: url("../vendor/fonts/gelasio-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "DDS Card Serif"; font-weight: 700; font-style: normal; font-display: block; src: url("../vendor/fonts/gelasio-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "DDS Card Serif"; font-weight: 700; font-style: italic; font-display: block; src: url("../vendor/fonts/gelasio-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: "DDS Card Sans"; font-weight: 400; font-style: normal; font-display: block; src: url("../vendor/fonts/selawik-400.woff2") format("woff2"); }
@font-face { font-family: "DDS Card Sans"; font-weight: 600; font-style: normal; font-display: block; src: url("../vendor/fonts/selawik-600.woff2") format("woff2"); }
@font-face { font-family: "DDS Card Sans"; font-weight: 700 900; font-style: normal; font-display: block; src: url("../vendor/fonts/selawik-700.woff2") format("woff2"); }

/* ---------- Congratulations card (Adverts > Congratulations) ----------
   540 x 675 on screen, exported at 2x (1080 x 1350, the portrait size WhatsApp status and Instagram use).
   Only what html2canvas draws faithfully: linear/radial gradients, borders, shadows, transforms, inline SVG. */
.cg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 560px; gap: 1.2rem; align-items: start; }
.cg-preview { position: sticky; top: calc(var(--topbar-h) + 1rem); display: flex; justify-content: center; }
.cg-card { --cg-bg1: #0b1030; --cg-bg2: #26336f; --cg-glow: rgba(232,201,110,.38); --cg-accent: #4cc3f5; --cg-accent2: #fff1c1;
  --cg-text: #ffffff; --cg-soft: #c9cde8; --cg-ribbon: #0a8fd0; --cg-ribbon-text: #1a1a2e;
  width: 540px; height: 675px; position: relative; overflow: hidden; border-radius: 18px; color: var(--cg-text);
  background: linear-gradient(160deg, var(--cg-bg1) 0%, var(--cg-bg2) 100%); box-shadow: 0 24px 60px rgba(10,12,40,.35);
  font-family: "DDS Card Serif", Georgia, "Times New Roman", serif; }
.cg-card.theme-plum { --cg-bg1: #22091f; --cg-bg2: #74265f; --cg-glow: rgba(246,199,161,.40); --cg-accent: #f6c7a1; --cg-accent2: #ffe6d6;
  --cg-soft: #ead2e2; --cg-ribbon: #e7a984; --cg-ribbon-text: #3a0f2f; }
.cg-card.theme-emerald { --cg-bg1: #031d18; --cg-bg2: #0e5a49; --cg-glow: rgba(232,201,110,.36); --cg-accent: #4cc3f5; --cg-accent2: #fff4c8;
  --cg-soft: #c6e3da; --cg-ribbon: #3aa9de; --cg-ribbon-text: #062a24; }
.cg-card.theme-ivory { --cg-bg1: #fffdf7; --cg-bg2: #f1e3c3; --cg-glow: rgba(10,143,208,.30); --cg-accent: #b0832a; --cg-accent2: #8a6420;
  --cg-text: #1a1a2e; --cg-soft: #5b5470; --cg-ribbon: #1a1a2e; --cg-ribbon-text: #f6e3a8; }
.cg-glow { position: absolute; inset: 0; background:
  radial-gradient(circle at 50% 30%, var(--cg-glow) 0%, rgba(0,0,0,0) 46%),
  radial-gradient(circle at 12% 96%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 32%),
  radial-gradient(circle at 92% 4%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 28%); }
.cg-frame { position: absolute; inset: 14px; border: 2px solid var(--cg-accent); border-radius: 12px; opacity: .9; }
.cg-frame::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--cg-accent); border-radius: 8px; opacity: .55; }
.cg-confetti { position: absolute; inset: 0; }
.cg-confetti i { position: absolute; display: block; border-radius: 2px; opacity: .92; }
.cg-confetti i.c { border-radius: 50%; }
.cg-confetti i.s { font-style: normal; background: none !important; line-height: 1; }
.cg-inner { position: absolute; inset: 36px 40px 30px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cg-brand { display: flex; align-items: center; gap: .5rem; font-family: "DDS Card Sans", "Segoe UI", Arial, sans-serif; font-size: 11px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--cg-accent); font-weight: 700; }
.cg-brand img { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--cg-accent); background: #fff; object-fit: cover; }
.cg-emblem { width: 150px; height: 128px; margin-top: 8px; }
.cg-emblem svg { width: 100%; height: 100%; display: block; }
.cg-kicker { font-family: "DDS Card Sans", "Segoe UI", Arial, sans-serif; font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--cg-soft); margin-top: 2px; }
.cg-title { font-size: 50px; font-style: italic; color: var(--cg-accent); line-height: 1.05; margin-top: 2px;
  text-shadow: 0 2px 0 rgba(0,0,0,.18), 0 0 26px var(--cg-glow); }
.cg-name { font-size: 34px; font-weight: 700; line-height: 1.12; margin-top: 10px; color: var(--cg-text); max-width: 100%; word-wrap: break-word; }
.cg-line { display: flex; align-items: center; gap: 10px; font-family: "DDS Card Sans", "Segoe UI", Arial, sans-serif; font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cg-soft); margin-top: 12px; }
.cg-line span { display: block; width: 46px; height: 1px; background: var(--cg-accent); opacity: .8; }
.cg-programme { font-size: 22px; font-weight: 700; color: var(--cg-accent2); margin-top: 6px; line-height: 1.22; max-width: 100%; }
.cg-at { font-size: 15px; color: var(--cg-soft); margin-top: 4px; font-style: italic; }
.cg-at b { color: var(--cg-text); font-style: normal; }
.cg-ribbon { margin-top: 16px; background: var(--cg-ribbon); color: var(--cg-ribbon-text); padding: 8px 26px 7px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); font-family: "DDS Card Sans", "Segoe UI", Arial, sans-serif; }
.cg-ribbon div { font-size: 14px; font-weight: 700; letter-spacing: .03em; }
.cg-ribbon small { display: block; font-size: 10px; letter-spacing: .26em; text-transform: uppercase; opacity: .85; }
.cg-quote { font-size: 14.5px; line-height: 1.55; color: var(--cg-soft); margin: 16px 6px 0; font-style: italic; }
.cg-foot { margin-top: auto; font-family: "DDS Card Sans", "Segoe UI", Arial, sans-serif; font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--cg-accent); }
.cg-foot span { margin: 0 .4rem; }
/* the card never shrinks: on a narrow screen its preview is scaled as a picture (DDS.fitCardPreview) */
.cg-card { flex-shrink: 0; min-width: 540px; }
.cg-preview { min-width: 0; overflow: hidden; }
@media (max-width: 1250px) { .cg-layout { grid-template-columns: 1fr; } .cg-preview { position: static; justify-content: center; } }

/* ---------- "Ready for collection" card (shared/_ready_modal.html, js/project-ready.js) ----------
   540 px wide on screen, exported at 2x (1080 px wide PNG). Height follows the content. html2canvas-safe CSS only. */
.pr-layout { display: grid; grid-template-columns: 540px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.pr-preview { min-width: 0; overflow: hidden; }       /* narrow screens: the card is scaled as a picture (DDS.fitCardPreview) */
.pr-card [hidden] { display: none !important; }
.pr-side textarea { font-size: .85rem; }
.pr-card { width: 540px; min-width: 540px; flex-shrink: 0; position: relative; overflow: hidden; border-radius: 22px; color: #fff;
  font-family: "DDS Card Sans", "Segoe UI", Arial, sans-serif; box-shadow: 0 22px 54px rgba(60,10,80,.35); }
.pr-bg { position: absolute; inset: 0; background:
  radial-gradient(circle at 18% 12%, rgba(255,209,102,.55) 0%, rgba(255,209,102,0) 34%),
  radial-gradient(circle at 88% 30%, rgba(6,214,160,.45) 0%, rgba(6,214,160,0) 32%),
  radial-gradient(circle at 12% 88%, rgba(17,138,178,.55) 0%, rgba(17,138,178,0) 36%),
  linear-gradient(155deg, #5a189a 0%, #c9184a 48%, #ff7b00 100%); }
.pr-confetti { position: absolute; inset: 0; }
.pr-confetti i { position: absolute; display: block; border-radius: 2px; opacity: .95; }
.pr-ribbon-v { position: absolute; top: 0; bottom: 0; left: 50%; width: 30px; margin-left: -15px;
  background: linear-gradient(90deg, #f4b400, #ffe08a 50%, #f4b400); opacity: .22; }
.pr-inner { position: relative; padding: 26px 34px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pr-brand { display: flex; align-items: center; gap: .5rem; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; font-weight: 800; color: #fff3c4; }
.pr-brand img { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #ffd166; object-fit: cover; }
.pr-bow { position: relative; width: 110px; height: 46px; margin-top: 10px; }
.pr-bow i { position: absolute; top: 4px; width: 50px; height: 36px; border: 7px solid #ffd166; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: rgba(255,209,102,.25); }
.pr-bow i:first-child { left: 2px; transform: rotate(-18deg); }
.pr-bow i:nth-child(2) { right: 2px; transform: rotate(18deg); }
.pr-bow b { position: absolute; left: 50%; top: 13px; width: 20px; height: 20px; margin-left: -10px; border-radius: 6px; background: #ffd166;
  box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.pr-kicker { margin-top: 4px; font-size: 12px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: #fff3c4; }
.pr-title { margin-top: 4px; font-family: "DDS Card Serif", Georgia, "Times New Roman", serif; font-size: 35px; font-weight: 700; line-height: 1.08;
  color: #ffffff; text-shadow: 0 3px 0 rgba(0,0,0,.18), 0 0 24px rgba(255,209,102,.6); }
.pr-sub { font-size: 13px; letter-spacing: .08em; color: #ffe6f0; margin-top: 2px; }
.pr-name { margin-top: 12px; font-family: "DDS Card Serif", Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 700; line-height: 1.12; color: #ffd166;
  max-width: 100%; word-wrap: break-word; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.pr-box { width: 100%; margin-top: 14px; border-radius: 16px; background: rgba(255,255,255,.95); color: #2b1140; text-align: left;
  padding: 12px 16px; box-shadow: 0 8px 22px rgba(40,0,60,.25); }
.pr-label { font-size: 10.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #c9184a; }
.pr-ptitle { font-size: 19px; font-weight: 800; line-height: 1.25; margin-top: 3px; color: #3c096c; }
.pr-aim { font-size: 12.5px; line-height: 1.45; margin-top: 6px; color: #4a3a5a; }
.pr-aim b { color: #5a189a; }
.pr-objs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12px; line-height: 1.4; color: #4a3a5a; }
.pr-objs li { display: flex; gap: 6px; }
.pr-objs .obj-no { flex: 0 0 auto; font-weight: 800; color: #ff7b00; }
.pr-dates { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pr-dates > div { border-radius: 14px; padding: 8px 10px; background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.55); }
.pr-dates span { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #ffe6f0; font-weight: 700; }
.pr-dates b { display: block; font-size: 13px; margin-top: 2px; color: #fff; }
.pr-timing { margin-top: 10px; padding: 7px 18px; border-radius: 999px; font-size: 14px; font-weight: 800; box-shadow: 0 6px 16px rgba(0,0,0,.22);
  background: #ffd166; color: #3c096c; }
.pr-timing.early, .pr-timing.ontime { background: #06d6a0; color: #053b2e; }
.pr-timing.late { background: #fff3c4; color: #7a2e00; }
.pr-where { display: flex; gap: 12px; align-items: flex-start; }
.pr-pin { flex: 0 0 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px;
  color: #fff; background: linear-gradient(135deg, #c9184a, #ff7b00); }
.pr-place { font-size: 15px; font-weight: 800; color: #3c096c; line-height: 1.3; margin-top: 2px; }
.pr-note { font-size: 11.5px; color: #6a5a7a; margin-top: 3px; line-height: 1.4; }
.pr-refer { margin-top: 14px; font-size: 13.5px; line-height: 1.45; color: #fff; }
.pr-refer b { color: #ffd166; }
.pr-thanks { margin-top: 8px; font-family: "DDS Card Serif", Georgia, "Times New Roman", serif; font-size: 22px; font-style: italic; font-weight: 700; color: #fff; }
.pr-contact { margin-top: 6px; font-size: 11px; letter-spacing: .12em; color: #ffe6f0; }
@media (max-width: 1000px) { .pr-layout { grid-template-columns: 1fr; } }
/* "Project has started" card: same layout, fresh teal / blue / violet colours */
.pr-card.pr-start .pr-bg { background:
  radial-gradient(circle at 16% 10%, rgba(255,209,102,.5) 0%, rgba(255,209,102,0) 32%),
  radial-gradient(circle at 90% 26%, rgba(247,37,133,.38) 0%, rgba(247,37,133,0) 32%),
  radial-gradient(circle at 10% 90%, rgba(6,214,160,.5) 0%, rgba(6,214,160,0) 36%),
  linear-gradient(155deg, #0077b6 0%, #3a0ca3 52%, #7209b7 100%); }
.pr-rocket { margin-top: 10px; width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 36px; background: linear-gradient(135deg, #ffd166, #f78c6b); box-shadow: 0 8px 22px rgba(0,0,0,.28); }
.pr-start .pr-kicker { margin-top: 10px; }
.pr-start .pr-label { color: #0077b6; }
.pr-start .pr-ptitle { color: #3a0ca3; }
.pr-started-line { margin-top: 6px; display: inline-block; padding: 3px 12px; border-radius: 999px; background: #06d6a0; color: #053b2e;
  font-size: 12.5px; font-weight: 800; }
.pr-start .pr-pin { background: linear-gradient(135deg, #0077b6, #7209b7); }
.ps-list { display: grid; gap: .4rem; margin-top: .7rem; }
.ps-item { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .65rem .8rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); cursor: pointer; color: inherit; }
.ps-item:hover, .ps-item:focus-visible { border-color: var(--gold); background: var(--gold-pale); }
.ps-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ps-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-main small, .ps-meta small { color: var(--muted); }
.ps-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex-shrink: 0; }
.ps-chosen { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .8rem; border-radius: 10px; background: var(--surface-2); }
.ps-chosen .btn { align-self: flex-start; margin-top: .3rem; }

/* ---------- Due tomorrow ---------- */
.dl-card { margin-bottom: .9rem; border-left: 4px solid var(--warning); }
.dl-card .card-head { gap: .5rem; justify-content: flex-start; flex-wrap: wrap; }
.dl-card .card-head h3 { margin: 0 auto 0 0; }
.dl-read { border-left-color: var(--border-strong); opacity: .75; }
.dl-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .25rem; }

.print-title { display: none; }
@media print { .print-title { display: block; } .ck-pdf-host { display: none !important; } }
@media (max-width: 700px) { #myProjects { grid-template-columns: 1fr; } .myp-head { flex-wrap: wrap; } }
