/* ASA-3D ERP — same family as asa3d.com: warm stone, dark ink, taupe; logo colours as small accents */
:root {
  --stone: #efebe6;
  --stone-2: #e2dcd4;
  --paper: #ffffff;
  --ink: #2a2420;
  --ink-soft: #645a51;
  --taupe: #8c7766;
  --line: rgba(42, 36, 32, .13);
  --blue: #2337c6;
  --red: #c8381f;
  --green: #2a8f45;
  --eur: #2337c6;
  --all: #b9893b;
  --r: 14px;
  --r-sm: 10px;
  --font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(14px, 3.5vw, 32px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--stone); }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.opt { font-weight: 400; color: var(--ink-soft); font-size: .85em; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 .95rem/1 var(--font); text-decoration: none; cursor: pointer; background: none; color: var(--ink);
  transition: background-color .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-line { border-color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); background: rgba(42, 36, 32, .06); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 1rem; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: progress; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 64px; padding: 0 var(--gutter); max-width: 1280px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.brand img { height: 40px; width: auto; }
.brand span { font-size: .9rem; color: var(--taupe); border-left: 1px solid var(--line); padding-left: 8px; }
.mainnav { display: flex; align-items: center; gap: 4px; flex: 1; }
.mainnav > a { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .93rem; color: var(--ink-soft); }
.mainnav > a:hover { color: var(--ink); background: rgba(42, 36, 32, .05); }
.mainnav > a[aria-current="page"] { color: var(--ink); background: var(--stone); font-weight: 600; }
.nav-sep { flex: 1; }
.lang-switch { display: inline-flex; gap: 2px; margin: 0 6px; }
.lang-switch a { font-size: .78rem; font-weight: 700; padding: 6px 7px; border-radius: 6px; text-decoration: none; color: var(--ink-soft); }
.lang-switch a[aria-current] { background: var(--ink); color: #fff; }
.logout button { font: 500 .9rem var(--font); color: var(--ink-soft); background: none; border: 0; padding: 8px 10px; cursor: pointer; border-radius: 999px; }
.logout button:hover { color: var(--red); }
.menu-btn { display: none; margin-left: auto; font: 600 .88rem var(--font); background: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: 8px 14px; cursor: pointer; color: var(--ink); }
.new-btn { margin-left: 4px; }

.mainnav > a, .logout button { white-space: nowrap; }
.brand { flex: none; }
.mainnav > a { padding: 8px 10px; }
@media (max-width: 1440px) {
  .menu-btn { display: inline-block; }
  .new-btn { order: 3; }
  .menu-btn { order: 2; }
  .mainnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; gap: 2px; box-shadow: 0 16px 30px rgba(42,36,32,.12); }
  .mainnav.is-open { display: flex; }
  .mainnav > a { padding: 12px; font-size: 1rem; }
  .nav-sep { height: 1px; background: var(--line); margin: 6px 0; flex: none; }
  .lang-switch { margin: 6px 4px; }
  .logout button { padding: 12px; text-align: left; width: 100%; font-size: 1rem; }
}

/* ---------- Layout ---------- */
.main { padding: clamp(18px, 3vw, 32px) var(--gutter) 110px; max-width: 1280px; margin: 0 auto; }
.page-narrow { max-width: 760px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--paper); border-radius: var(--r); padding: clamp(16px, 2.5vw, 24px); box-shadow: 0 1px 0 rgba(42,36,32,.05); }
.card + .card, .grid-2 + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head a { font-size: .88rem; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.section-title { margin: 26px 0 10px; }
.crumb { margin: 0 0 10px; font-size: .9rem; }
.crumb a { text-decoration: none; color: var(--ink-soft); }
.hide-sm { }
@media (max-width: 900px) { .hide-sm { display: none; } }
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }

.flash { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: #e3f1e7; color: #1d6b33; }
.flash-warn { background: #fbf0d9; color: #7a5410; }
.form-error { background: #fbe6e2; color: #9f2a17; padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; }

/* ---------- Auth ---------- */
.auth { min-height: 80vh; display: grid; place-items: center; }
.auth-card { width: min(420px, 100%); background: var(--paper); border-radius: 20px; padding: 32px 28px; box-shadow: 0 20px 50px rgba(42,36,32,.1); }
.auth-logo { height: 70px; width: auto; margin-bottom: 18px; }
.auth-lang { text-align: center; margin: 18px 0 0; font-size: .88rem; color: var(--ink-soft); }

/* ---------- Forms ---------- */
.stack { display: grid; gap: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .85rem; font-weight: 600; }
.field small { font-size: .78rem; color: var(--ink-soft); }
.field .field-error { color: #9f2a17; font-weight: 600; }
input, select, textarea { font: inherit; color: var(--ink); background: #faf8f6; border: 1px solid #cbc2b8; border-radius: var(--r-sm); padding: 11px 12px; width: 100%; min-height: 46px; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; background: #fff; border-color: var(--ink); }
[aria-invalid="true"] { border-color: #b3261e; background: #fdf3f1; }
input[name="amount"] { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--ink); }

.seg { display: flex; background: #f3efea; border-radius: 999px; padding: 4px; border: 1px solid #cbc2b8; min-height: 46px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg span { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 36px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--ink-soft); }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--blue); }

.seg-from span { font-size: .92rem; padding: 0 10px; text-align: center; }
.seg-from input[value="personal"]:checked + span { background: #b9893b; }
.vehicle-field { background: #f6f3ef; border-radius: var(--r-sm); padding: 12px; }
.tag-personal { background: #f6ead3; color: #7a5410; font-size: .7rem; vertical-align: middle; }
.receipts-box { border: 1.5px dashed #c9bfb4; border-radius: var(--r); padding: 16px; margin: 0; }
.receipts-box { position: relative; transition: background-color .15s, border-color .15s; }
.drop-hint { margin: 10px 0 0; text-align: center; font-weight: 600; color: var(--ink-soft); font-size: .9rem; }
.receipts-box.is-drop { background: #f3ede4; border-color: var(--ink); border-style: solid; }
.receipts-box.is-drop::after {
  content: attr(data-drop-now); position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--r);
  background: rgba(243, 237, 228, .92); font-weight: 700; font-size: 1.1rem; color: var(--ink); pointer-events: none;
}
@media (hover: none) { .drop-hint { display: none; } }   /* phones: no drag and drop, the buttons are enough */
.receipts-box legend { font-weight: 700; padding: 0 6px; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.receipt-actions .btn { flex: 1 1 200px; }
.hint { font-size: .8rem; color: var(--ink-soft); margin: 10px 0 0; }
.receipt-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.receipt-item { display: flex; align-items: center; gap: 12px; background: #f6f3ef; border-radius: var(--r-sm); padding: 8px; }
.receipt-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.receipt-name { flex: 1; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.receipt-item .btn, .remove-check { flex: none; font-size: .82rem; }
.remove-check { display: flex; gap: 6px; align-items: center; }
.remove-check input { width: 16px; height: 16px; min-height: 0; }
.pdf-badge { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 8px; background: var(--red); color: #fff; font-weight: 800; font-size: .8rem; flex: none; }
.receipt-item.is-busy { opacity: .6; }

/* ---------- Overview ---------- */
.totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px; }
.dash-dividends { margin-top: 16px; border-top: 4px solid var(--green); }
.total-card { background: var(--paper); border-radius: var(--r); padding: 18px 20px; text-decoration: none; display: grid; gap: 6px; border-top: 4px solid var(--eur); }
.total-card:nth-child(2) { border-top-color: var(--all); }
.total-card.total-count { border-top-color: var(--taupe); }
.total-card .label { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.total-card strong { font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
@media (max-width: 700px) { .totals { grid-template-columns: 1fr 1fr; } .total-count { grid-column: span 2; } }

.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.bars a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 8px; border-radius: var(--r-sm); text-decoration: none; }
.bars a:hover { background: #f6f3ef; }
.bar-name { font-weight: 600; font-size: .92rem; }
.bar-vals { display: flex; gap: 10px; font-size: .88rem; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.bar-track { grid-column: span 2; display: grid; gap: 3px; }
.bar-track i, .legend i { display: block; height: 6px; border-radius: 3px; }
.bar-eur { background: var(--eur); }
.bar-all { background: var(--all); }
.legend { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-soft); margin: 10px 0 0; }
.legend i { width: 18px; display: inline-block; }

/* ---------- Expense rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows.card { padding: 6px; }
.row { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-sm); text-decoration: none; }
.rows li + li .row { border-top: 1px solid var(--line); border-radius: 0; }
.row:hover { background: #f6f3ef; }
.row-date { font-size: .85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.row-main { min-width: 0; display: grid; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: .82rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-amount { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; display: grid; justify-items: end; gap: 2px; white-space: nowrap; }
.clip { display: inline-flex; align-items: center; gap: 2px; font-size: .75rem; font-weight: 600; color: var(--taupe); }
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .row-date { grid-column: 1; grid-row: 2; font-size: .78rem; }
  .row-main { grid-column: 1; grid-row: 1; }
  .row-amount { grid-column: 2; grid-row: 1 / span 2; }
  .row-sub { display: none; }
}

/* ---------- Filters ---------- */
.filters { margin-bottom: 14px; }
.period-links { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.period-links a { font-size: .84rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--stone); text-decoration: none; }
.period-links a:hover { background: var(--stone-2); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.field-wide { grid-column: span 2; }
@media (max-width: 420px) { .field-wide { grid-column: auto; } .filter-grid { grid-template-columns: 1fr 1fr; } .filter-grid .field-wide { grid-column: span 2; } }
.filter-actions { display: flex; gap: 8px; margin-top: 14px; }
.sum-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 6px 12px; font-size: .92rem; color: var(--ink-soft); }
.sum-vals { display: flex; gap: 18px; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.export-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.export-status { background: #fff; border-radius: var(--r-sm); padding: 10px 14px; font-weight: 600; margin: -6px 0 14px; }

/* ---------- Expense detail ---------- */
.amount-title { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); font-variant-numeric: tabular-nums; }
.details { margin: 0; display: grid; }
.details > div { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--ink-soft); font-size: .88rem; }
.details dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 560px) { .details > div { grid-template-columns: 1fr; gap: 2px; } }
.receipt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.receipt-card { margin: 0; padding: 10px; display: grid; gap: 8px; }
.receipt-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 8px; background: var(--stone); }
.pdf-preview { display: grid; place-items: center; height: 220px; background: #f6f3ef; border-radius: 8px; text-decoration: none; }
.pdf-preview .pdf-badge { width: 76px; height: 76px; font-size: 1rem; }
.receipt-card figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; }
.receipt-card figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-card figcaption a { font-weight: 700; text-decoration: none; }
.delete-banner { background: #fdecea; border-left: 4px solid var(--red); border-radius: var(--r-sm); padding: 12px 16px; margin: -6px 0 16px; }
.delete-banner p { margin: 0 0 6px; }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tag-del { background: #fbe0db; color: #9f2a17; font-size: .7rem; vertical-align: middle; }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; margin-left: 4px; }
.queue { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.queue-item { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 20px; align-items: start; }
.queue-amount { font-size: 1.5rem; font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.queue-what { margin: 2px 0 6px; font-weight: 600; }
.queue-main p { margin-bottom: 4px; }
.queue-reason { background: #f6f3ef; border-radius: 8px; padding: 8px 10px; font-size: .92rem; }
.queue-actions { display: grid; gap: 10px; }
.queue-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .queue-item { grid-template-columns: 1fr; } }
.decisions { list-style: none; margin: 0; padding: 0; }
.decisions li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.decisions li:last-child { border-bottom: 0; }
.decisions li .small { grid-column: 2; }
/* Reimbursements */
.count-badge-gold { background: #b9893b; }
.tabs { display: flex; gap: 6px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab-count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--stone-2); font-size: .75rem; text-align: center; }
.person-filter { max-width: 280px; margin-bottom: 14px; }
.people-totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.person-card { background: var(--paper); border-radius: var(--r); padding: 14px 16px; text-decoration: none; display: grid; gap: 4px; border-top: 4px solid #b9893b; }
.person-card .label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.person-card strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.reimb-list { list-style: none; margin: 0; padding: 6px; }
.reimb-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: 12px; }
.reimb-item + .reimb-item { border-top: 1px solid var(--line); }
.reimb-main { display: grid; gap: 2px; text-decoration: none; min-width: 0; }
.reimb-amount { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.reimb-what { font-weight: 600; }
.reimb-action { justify-self: end; }
.reimb-form summary { list-style: none; cursor: pointer; }
.reimb-form summary::-webkit-details-marker { display: none; }
.reimb-form[open] summary { display: none; }
.reimb-form form { background: #f6f3ef; border-radius: var(--r-sm); padding: 12px; min-width: 260px; }
.tag-ok { background: #e3f1e7; color: #1d6b33; }
.person-card a { display: grid; gap: 4px; text-decoration: none; }
.person-card .btn { justify-self: start; margin-top: 6px; }
.bulk-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 4px 10px; }
.bulk-tools .check { font-weight: 600; }
.reimb-item.has-check { grid-template-columns: auto 1fr auto; }
.pick { display: grid; place-items: center; padding: 4px 2px; cursor: pointer; }
.pick input { width: 22px; height: 22px; min-height: 0; accent-color: var(--ink); cursor: pointer; }
.reimb-item.is-picked { background: #fbf6ec; border-radius: var(--r-sm); }
.bulk-bar {
  position: sticky; bottom: 12px; z-index: 35; margin-top: 16px;
  display: grid; grid-template-columns: auto minmax(200px, 260px) minmax(160px, 220px) auto; gap: 12px 16px; align-items: end;
  background: var(--ink); color: #fff; border-radius: var(--r); padding: 14px 18px; box-shadow: 0 16px 40px rgba(42,36,32,.35);
}
.bulk-bar .field > span { color: rgba(255,255,255,.75); }
.bulk-bar select, .bulk-bar input { background: #fff; }
.bulk-sum { align-self: center; display: grid; font-variant-numeric: tabular-nums; }
.bulk-sum span { font-size: 1.15rem; font-weight: 700; }
.bulk-btns { display: flex; gap: 6px; }
.bulk-bar .btn-primary { background: #fff; color: var(--ink); }
.bulk-bar .btn-primary:hover { background: var(--stone); }
.bulk-bar .btn-ghost { color: rgba(255,255,255,.8); }
.bulk-note { grid-column: 1 / -1; margin: 0; color: rgba(255,255,255,.65) !important; }
body.has-bulk .fab { display: none; }
@media (max-width: 900px) {
  .bulk-bar { grid-template-columns: 1fr; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .reimb-item.has-check { grid-template-columns: auto 1fr; }
  .reimb-item.has-check .reimb-action { grid-column: 2; }
}
.reimb-box { border-radius: var(--r-sm); padding: 12px 16px; margin: -6px 0 16px; }
.reimb-box.unpaid { background: #fbf0d9; border-left: 4px solid #b9893b; }
.reimb-box.paid { background: #e3f1e7; border-left: 4px solid var(--green); }
.reimb-box p { margin: 0 0 6px; }
.reimb-box .reimb-form form { background: #fff; }
@media (max-width: 560px) { .reimb-item { grid-template-columns: 1fr; } .reimb-action { justify-self: start; } .reimb-form form { min-width: 0; } }
.tag-pending { background: #e5e9fb; color: #1f2f9e; }
.tab-count-alert { background: var(--blue); color: #fff; }
.reimb-box.pending { background: #eef0fd; border-left: 4px solid var(--blue); }
.decide { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.decide form { margin: 0; }
.reject-box summary { list-style: none; cursor: pointer; }
.reject-box summary::-webkit-details-marker { display: none; }
.reject-box[open] summary { display: none; }
.reject-box form { background: #f6f3ef; border-radius: var(--r-sm); padding: 10px; min-width: 240px; }
.approve-all { margin: 0 0 12px; }
.reimb-history { background: var(--paper); border-radius: var(--r-sm); padding: 10px 14px; margin: -6px 0 16px; font-size: .9rem; }
.reimb-history summary { font-weight: 700; cursor: pointer; }
.reimb-history ol { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.reimb-history li { position: relative; padding: 4px 0 8px 10px; display: grid; gap: 1px; }
.reimb-history li::before { content: ""; position: absolute; left: -20px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--stone-2); border: 2px solid #fff; }
.reimb-history li.ev-approved::before, .reimb-history li.ev-paid::before { background: var(--green); }
.reimb-history li.ev-requested::before { background: var(--blue); }
.reimb-history li.ev-rejected::before, .reimb-history li.ev-unpaid::before { background: var(--red); }
.reimb-history time { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: .8rem; font-weight: 600; }
/* Dividends */
.div-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.div-card { background: var(--paper); border-radius: var(--r); padding: 14px 16px; text-decoration: none; display: grid; gap: 4px; border-top: 4px solid var(--green); }
.div-card .label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.div-card strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.div-card-all { background: var(--ink); color: #fff; border-top-color: var(--ink); }
.div-card-all .label { color: rgba(255,255,255,.75); }
.recip-name { flex: 1; font-weight: 600; }
.div-summary.is-fuel .div-card { border-top-color: #c47a1c; }
.div-summary.is-fuel .div-card-all { border-top-color: var(--ink); }
.tag-fuel { background: #fbecd6; color: #8a4f07; }
.readonly-note { background: #fff; border-left: 4px solid var(--taupe); border-radius: var(--r-sm); padding: 10px 14px; color: var(--ink-soft); font-size: .92rem; margin: -6px 0 16px; }
.danger-zone { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Projects */
.tabs-main { margin-bottom: 18px; }
.tabs-scroll { overflow-x: auto; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll a { white-space: nowrap; }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.pill-tabs a { font-size: .86rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--paper); text-decoration: none; color: var(--ink-soft); }
.pill-tabs a[aria-current] { background: var(--ink); color: #fff; }
.pill-tabs a[aria-current] .tab-count { background: rgba(255,255,255,.2); }
.pill-tabs .pill-owed { margin-left: auto; background: #fbf0d9; color: #7a5410; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.proj-card { display: grid; gap: 8px; text-decoration: none; border-top: 4px solid var(--taupe); transition: box-shadow .15s; }
.proj-card:hover { box-shadow: 0 10px 26px rgba(42,36,32,.1); }
.proj-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.proj-name { font-size: 1.15rem; line-height: 1.25; }
.proj-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.proj-figs span { display: grid; }
.proj-figs small { font-size: .75rem; color: var(--ink-soft); font-weight: 600; }
.proj-figs b { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.progress { display: block; height: 8px; border-radius: 4px; background: var(--stone-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.tag-st-active { background: #e3f1e7; color: #1d6b33; }
.tag-st-completed { background: #e5e9fb; color: #1f2f9e; }
.tag-st-suspended { background: #fbf0d9; color: #7a5410; }
h1 .tag { vertical-align: middle; font-size: .8rem; }
.period-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.period-bar .field { width: 170px; }
.period-bar .muted { flex-basis: 100%; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--paper); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; align-content: start; border-top: 4px solid var(--taupe); }
.kpi .label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.kpi strong { font-size: clamp(1.15rem, .9rem + 1vw, 1.55rem); font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi small { font-size: .78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.kpi-dark { background: var(--ink); color: #fff; border-top-color: var(--ink); }
.kpi-dark .label, .kpi-dark small { color: rgba(255,255,255,.75); }
.kpi-warn { border-top-color: var(--red); }
.kpi-ok { border-top-color: var(--green); }
.kpi-cash { border-top-color: var(--green); }
.kpi-klering { border-top-color: var(--blue); }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .kpis-3 { grid-template-columns: 1fr; } }
.tbl-wrap { overflow-x: auto; padding: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl tbody tr:hover { background: #f8f6f3; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { text-decoration: none; }
.tbl tr.is-off { opacity: .6; }
.grid-2 > * { min-width: 0; }
.tbl-scroll { overflow-x: auto; }
.tbl-compact th, .tbl-compact td { padding: 8px 6px; }
.tbl-compact tbody th { font-weight: 600; font-size: .88rem; }
.neg { color: var(--red); }
.pos { color: var(--green); }
.cash-verdict { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; }
.cash-verdict.is-ok { background: #e3f1e7; color: #1d6b33; }
.cash-verdict.is-short { background: #fbe6e2; color: #9f2a17; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li span { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.mini-list a { text-decoration: none; font-weight: 600; min-width: 0; }
.mini-list .mini-total { font-weight: 700; border-top: 2px solid var(--ink); }
.tag-cash { background: #e3f1e7; color: #1d6b33; }
.tag-klering { background: #e5e9fb; color: #1f2f9e; }
.tag-inv-paid { background: #e3f1e7; color: #1d6b33; }
.tag-inv-partial { background: #fbf0d9; color: #7a5410; }
.tag-inv-unpaid { background: #fbe0db; color: #9f2a17; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 640px) { .row-3 { grid-template-columns: 1fr; } }
.input-money { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.crew-box { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0; background: #faf8f6; }
.crew-box legend { font-weight: 700; padding: 0 6px; }
.crew-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.crew-input { display: grid; gap: 4px; }
.crew-input > span:first-child { font-size: .85rem; font-weight: 600; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 46px; background: #fff; font-variant-numeric: tabular-nums; font-weight: 600; }
.input-suffix i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: .8rem; color: var(--ink-soft); font-weight: 700; }
.crew-sum { margin: 12px 0 0; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.method-opt { position: relative; }
.method-opt input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; min-height: 0; }
.method-opt span { display: grid; gap: 2px; padding: 12px 14px; border: 1.5px solid #cbc2b8; border-radius: var(--r-sm); cursor: pointer; background: #faf8f6; height: 100%; }
.method-opt small { font-size: .75rem; color: var(--ink-soft); }
.method-cash input:checked + span { border-color: var(--green); background: #e3f1e7; }
.method-klering input:checked + span { border-color: var(--blue); background: #eef0fd; }
.method-opt input:focus-visible + span { outline: 3px solid var(--blue); }
@media (max-width: 420px) { .method-grid { grid-template-columns: 1fr; } }

/* Tools */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tool-card { display: grid; gap: 6px; text-decoration: none; border-top: 4px solid var(--blue); transition: box-shadow .15s; }
.tool-card:hover { box-shadow: 0 10px 26px rgba(42,36,32,.1); }
.tool-card strong { font-size: 1.1rem; }
.tool-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #e5e9fb; color: var(--blue); }
.page-wide { max-width: 900px; }
.static-value { margin: 0; min-height: 46px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.offer-items { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0; background: #faf8f6; }
.offer-items legend { font-weight: 700; padding: 0 6px; }
.offer-cur { max-width: 320px; margin-bottom: 12px; }
.offer-table { display: grid; gap: 6px; margin-bottom: 12px; }
.offer-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 84px 140px 36px; gap: 8px; align-items: center; }
.offer-row input { min-height: 40px; padding: 8px 10px; background: #fff; }
.offer-row .input-suffix input { font-weight: 700; text-align: right; padding-right: 42px; }
.offer-head { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.offer-name { font-size: .92rem; font-weight: 600; }
.offer-row.is-off .offer-name, .offer-row.is-off input { opacity: .45; }
.offer-row.is-off .offer-name { text-decoration: line-through; }
.offer-row.is-bad input { border-color: #b3261e; }
.offer-err { grid-column: 2 / -1; }
.offer-notes { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0; background: #faf8f6; }
.offer-notes legend { font-weight: 700; padding: 0 6px; }
.note-list { display: grid; gap: 6px; }
.note-pick { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 8px 10px; background: #fff; border-radius: var(--r-sm); font-size: .88rem; cursor: pointer; }
.note-pick input { width: 18px; height: 18px; min-height: 0; margin: 1px 0 0; accent-color: var(--ink); }
.note-pick:has(input:not(:checked)) span { color: var(--ink-soft); text-decoration: line-through; }
.offer-notes-view { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .9rem; }
@media (max-width: 640px) {
  .offer-head { display: none; }
  .offer-row { grid-template-columns: 30px minmax(0, 1fr) 36px; background: #fff; border-radius: var(--r-sm); padding: 8px; }
  .offer-row > :nth-child(3), .offer-row > :nth-child(4) { grid-column: 2 / 3; }
  .offer-row > :nth-child(5) { grid-row: 1; grid-column: 3; }
}

/* ---------- Admin ---------- */
.user-list, .list-edit { list-style: none; margin: 0; padding: 0; }
.user-list li { border-bottom: 1px solid var(--line); }
.user-list summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px; cursor: pointer; list-style: none; }
.user-list summary::-webkit-details-marker { display: none; }
.user-name { font-weight: 600; }
.tag { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--stone); white-space: nowrap; }
.tag-off { background: #f3d9d4; color: #9f2a17; }
.user-edit { padding: 4px 4px 16px; }
.list-edit li { display: flex; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.list-edit li.is-hidden input { color: var(--ink-soft); text-decoration: line-through; }
.inline-form { display: flex; gap: 6px; flex: 1; min-width: 0; }
.inline-form input { min-height: 38px; padding: 7px 10px; font-size: .9rem; }
.drag-handle {
  flex: none; width: 30px; min-height: 38px; border: 0; background: none; color: var(--ink-soft); font-size: 1.05rem;
  letter-spacing: -3px; cursor: grab; border-radius: 6px; touch-action: none; line-height: 1;
}
.drag-handle:hover { background: var(--stone); color: var(--ink); }
.is-sorting, .is-sorting * { cursor: grabbing !important; user-select: none; }
.list-edit li.is-dragging { background: #fff; box-shadow: 0 10px 24px rgba(42,36,32,.18); border-radius: var(--r-sm); position: relative; z-index: 2; outline: 2px solid var(--ink); }
.sort-status { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; margin: 0; box-shadow: 0 10px 24px rgba(42,36,32,.2); }
.plate-input { text-transform: uppercase; font-weight: 700; letter-spacing: .04em; max-width: 160px; }
.add-form { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.add-form input { flex: 1 1 140px; min-height: 42px; }
@media (max-width: 560px) { .inline-form { flex-wrap: wrap; } }

/* ---------- Floating add button (phones) ---------- */
.fab { display: none; }
@media (max-width: 900px) {
  .new-btn { display: none; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40;
    width: 62px; height: 62px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 2rem; font-weight: 300; text-decoration: none;
    box-shadow: 0 12px 26px rgba(42,36,32,.35);
  }
}
