/* =====================================================================
   ERC · Expense manager — European Resuscitation Council theme
   ---------------------------------------------------------------------
   Brand tokens live here (navy-blue lungs + heart red). Swap the values
   in :root (and the logo in index.html / app.js) to rebrand. Everything
   else derives from these variables.
   ===================================================================== */
:root {
  /* --- ERC brand palette (navy-blue lungs + heart red) --- */
  --erc-blue: #164194;       /* ERC navy blue */
  --erc-blue-dark: #0f2f6e;
  --erc-red: #e2001a;        /* ERC heart red */
  --ink: #1a2230;            /* dark navy — main nav / logo background */
  --ink-2: #24324d;          /* lighter navy — top utility bar */
  --brand: var(--erc-blue);  /* brand == ERC blue */
  --brand-dark: var(--erc-blue-dark);
  --accent: var(--erc-red);  /* accent == ERC heart red */
  --steel: #667085;          /* neutral slate */

  /* --- Functional colors --- */
  --ok: #1f9d57;
  --warn: #c9821a;
  --danger: #d64550;

  /* --- Surfaces & text --- */
  --bg: #eef1f6;             /* cool light blue-grey body */
  --surface: #ffffff;
  --surface-2: #f5f7fb;      /* cool off-white */
  --line: #e0e5ee;           /* cool border */
  --text: #1a2230;           /* navy text */
  --muted: #667085;          /* slate muted grey */

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .07);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 940px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 480px at 100% -10%, rgba(22, 65, 148, .08), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(226, 0, 26, .05), transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--brand-dark); text-decoration: none; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .6rem clamp(1rem, 4vw, 2rem);
  background: rgba(35, 35, 34, .95);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--brand);
}
.brand { display: flex; flex-direction: column; gap: .15rem; color: #fff; line-height: 1; }
.brand__word { font-size: 1.28rem; font-weight: 800; letter-spacing: .04em; }
.mc-orange { color: var(--brand); }
.mc-grey { color: var(--steel); }
.brand__word sup { font-size: .5em; top: -.7em; color: var(--brand); }
.brand__tag {
  display: block; font-size: .6rem; letter-spacing: .32em; text-transform: uppercase;
  color: #b7b2ab; border-top: 1.5px solid var(--brand); padding-top: .2rem; margin-top: .1rem;
}
.topnav { display: flex; gap: .3rem; }
.topnav a {
  color: #c9d3db; padding: .5rem .9rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; transition: background .15s, color .15s;
}
.topnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topnav a.is-active { background: var(--brand); color: #fff; }

/* ---------- layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; }
.page-head { margin-bottom: .2rem; }
.page-head h1 { margin-bottom: .25rem; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem 1.2rem; box-shadow: var(--shadow-sm);
}

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: .32rem; min-width: 0; }
.field label, .field-label {
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
input, select, textarea, .file-btn {
  font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .6rem .7rem; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 65, 148, .18);
}
select { appearance: none; background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235c6b77' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; padding-right: 1.9rem; }
.textarea { resize: vertical; }
.field--desc { grid-column: 1 / -1; }

/* ---------- expense item cards ---------- */
.items { display: flex; flex-direction: column; gap: .8rem; }
.item-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); overflow: hidden;
  border-left: 4px solid var(--brand);
}
.item-card[data-cat="kilometervergoeding"] { border-left-color: var(--accent); }
.item-card[data-cat="brandstof"] { border-left-color: #c9821a; }
.item-card[data-cat="maaltijden"] { border-left-color: #d0603f; }
.item-card[data-cat="hotel"] { border-left-color: #7a5cc0; }
.item-card[data-cat="materiaal"] { border-left-color: #1f9d57; }
.item-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .8rem; background: rgba(13,20,24,.03);
}
.item-card__badge { font-weight: 700; font-size: .88rem; }
.item-grid {
  display: grid; grid-template-columns: 1.3fr .9fr 1.1fr .7fr; gap: .7rem .8rem;
  padding: .8rem;
}
.item-card__foot {
  display: flex; gap: 1.2rem; justify-content: flex-end; flex-wrap: wrap;
  padding: .55rem .8rem; border-top: 1px dashed var(--line);
  font-size: .85rem; color: var(--muted);
}
.item-card__foot strong { color: var(--text); }
.item-card__incl strong { color: var(--brand-dark); }
.km-inputs { display: flex; align-items: center; gap: .35rem; }
.km-inputs input { padding: .6rem .5rem; }
.km-x, .km-eur { color: var(--muted); font-size: .85rem; white-space: nowrap; }

.file-btn {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  background: var(--surface); border: 1px dashed var(--line); color: var(--brand-dark);
  font-weight: 600; font-size: .85rem; width: auto;
}
.file-btn:hover { border-color: var(--brand); }
.field--receipt { grid-column: 1 / -1; flex-direction: column; align-items: flex-start; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }

/* ---------- receipt preview lightbox ---------- */
.preview-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(20, 18, 16, .72); }
.preview { display: flex; flex-direction: column; overflow: hidden; max-width: min(920px, 96vw); max-height: 92vh; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.preview__bar { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.preview__name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview__img { max-width: 100%; max-height: calc(92vh - 3.2rem); object-fit: contain; background: #f4f1ec; }
.preview__frame { width: min(860px, 92vw); height: calc(92vh - 3.2rem); border: 0; background: #fff; }

.add-row { margin-top: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: inherit; font-size: .92rem; font-weight: 700; cursor: pointer;
  border-radius: var(--radius-sm); padding: .68rem 1.1rem; border: 1px solid transparent;
  transition: transform .06s, box-shadow .15s, background .15s; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  color: #fff; border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  box-shadow: 0 6px 16px rgba(22, 65, 148, .32);
}
.btn--primary:hover { box-shadow: 0 8px 22px rgba(22, 65, 148, .42); }
.btn--primary:disabled { opacity: .6; cursor: default; box-shadow: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn--danger { color: #fff; background: var(--danger); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.icon-btn {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: .3rem .45rem; border-radius: 8px;
}
.icon-btn:hover { background: rgba(214, 69, 80, .1); color: var(--danger); }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; font-size: .8rem; padding: 0; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; align-items: center; }

/* ---------- totals ---------- */
.totals { display: flex; flex-direction: column; gap: .45rem; }
.totals__row { display: flex; justify-content: space-between; align-items: baseline; font-size: .95rem; }
.totals__row span { color: var(--muted); }
.totals__row--grand {
  border-top: 2px solid var(--ink); margin-top: .35rem; padding-top: .6rem; font-size: 1.15rem;
}
.totals__row--grand strong { color: var(--brand-dark); }

/* ---------- signature ---------- */
.sig-wrap {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(transparent, transparent 27px, rgba(13,20,24,.06) 28px),
    var(--surface-2);
  height: 150px; overflow: hidden;
}
.sig-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sig-clear {
  position: absolute; top: .5rem; right: .5rem; font-size: .75rem; font-weight: 600;
  background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 7px;
  padding: .25rem .55rem; cursor: pointer; color: var(--muted);
}
.sig-hint {
  position: absolute; left: 0; right: 0; bottom: .5rem; text-align: center;
  color: var(--muted); font-size: .78rem; pointer-events: none; opacity: .8;
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: .28rem .6rem; border-radius: 999px; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.is-concept { background: #eef1f4; color: #64727d; }
.is-pending { background: rgba(201, 130, 26, .14); color: #a9700f; }
.is-approved { background: rgba(31, 157, 87, .14); color: #178048; }
.is-rejected { background: rgba(214, 69, 80, .14); color: #b83641; }

/* ---------- overview rows ---------- */
.row-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1.1rem; box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .15s;
}
.row-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: #cfdae4; }
.row-card--draft { border-style: dashed; background: var(--surface-2); }
.row-card__main { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.row-card__main strong { font-size: .98rem; }
.row-card__go { color: var(--brand-dark); font-weight: 700; font-size: .88rem; white-space: nowrap; }

/* ---------- detail / report document ---------- */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.back { font-weight: 600; color: var(--muted); }
.back:hover { color: var(--text); }
.banner {
  border-radius: var(--radius); padding: .8rem 1.1rem; font-size: .95rem;
  border: 1px solid rgba(22,65,148,.32); background: rgba(22,65,148,.08); color: var(--brand-dark);
}
.banner--action strong { color: var(--brand-dark); }

.report-doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 2rem); box-shadow: var(--shadow);
}
.report-doc__top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding-bottom: 1rem; border-bottom: 3px solid var(--ink); margin-bottom: 1.1rem; flex-wrap: wrap;
}
.report-doc__wordmark { display: flex; align-items: center; gap: .6rem; }
.report-doc__wordmark .erc-logo { width: 46px; height: 46px; flex-shrink: 0; }
.report-doc__wordmark strong { font-weight: 800; font-size: 1.05rem; color: var(--erc-blue); letter-spacing: -.01em; }
.report-doc__meta { text-align: right; display: flex; flex-direction: column; gap: .35rem; align-items: flex-end; }
.report-doc__parties {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.2rem;
}
.info-block { font-size: .9rem; }
.info-block__label {
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: .3rem;
}

.report-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.report-table th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: .5rem .55rem; border-bottom: 2px solid var(--line);
}
.report-table td { padding: .6rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-table .num { text-align: right; white-space: nowrap; }
.report-table .strong { font-weight: 700; }
.report-table tfoot td { border-top: 2px solid var(--ink); border-bottom: none; font-weight: 700; padding-top: .7rem; }
.report-table .grand { color: var(--brand-dark); font-size: 1.05rem; }
.cat-tag { font-weight: 600; }

.report-doc__note {
  background: var(--surface-2); border-left: 3px solid var(--brand);
  padding: .6rem .8rem; border-radius: 0 8px 8px 0; margin-top: 1rem; font-size: .9rem;
}

/* ---------- signatures on the doc ---------- */
.sign-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 1.6rem; }
.sign-plate { display: flex; flex-direction: column; }
.sign-plate__area {
  height: 84px; display: flex; align-items: flex-end; padding: .3rem;
}
.sign-plate__area img { max-height: 78px; max-width: 100%; }
.sign-stamp {
  color: var(--danger); border: 2px solid var(--danger); border-radius: 8px;
  font-weight: 800; letter-spacing: .1em; padding: .2rem .6rem; transform: rotate(-6deg);
}
.sign-plate__line { border-bottom: 1.5px solid var(--ink); }
.sign-plate__meta { display: flex; flex-direction: column; gap: .05rem; margin-top: .35rem; }
.sign-plate__meta strong { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* ---------- receipts ---------- */
.receipts { margin-top: 1.6rem; }
.receipts__grid { display: flex; flex-wrap: wrap; gap: .7rem; }
.receipt {
  display: block; width: 130px; height: 130px; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; background: var(--surface-2);
}
.receipt img { width: 100%; height: 100%; object-fit: cover; }
.receipt--pdf { display: grid; place-items: center; text-align: center; font-size: .8rem; color: var(--brand-dark); padding: .5rem; height: auto; min-height: 60px; }

.approval-panel { border: 2px solid var(--brand); }
.approval-panel h2 { color: var(--brand-dark); }

/* ---------- misc states ---------- */
.empty { text-align: center; padding: 3rem 1rem; }
.empty__icon { font-size: 2.6rem; }
.empty h2 { margin: .6rem 0 .3rem; }
.empty .btn { margin-top: 1rem; }
.loading { text-align: center; color: var(--muted); padding: 2.5rem; }
.error-box { background: rgba(214,69,80,.1); color: #b83641; padding: .8rem 1rem; border-radius: 10px; }

.foot {
  text-align: center; color: var(--muted); font-size: .8rem;
  padding: 2rem 1rem 3rem;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 200%);
  background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  z-index: 50; transition: transform .3s cubic-bezier(.2,.8,.2,1); max-width: 90vw;
}
.toast--show { transform: translate(-50%, 0); }
.toast--err { background: var(--danger); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .item-grid { grid-template-columns: 1fr 1fr; }
  .field--desc { grid-column: 1 / -1; }
  .report-doc__parties { grid-template-columns: 1fr; }
  .sign-row { grid-template-columns: 1fr; }
  .brand__text strong { font-size: .9rem; }
  .topnav a { padding: .45rem .7rem; }
  .report-table { font-size: .82rem; }
  .report-table th:nth-child(5), .report-table td:nth-child(5) { display: none; } /* hide btw€ col on mobile */
}

/* ---------- print ---------- */
@media print {
  .sidebar, .no-print, .actions--print, .approval-panel, .toast, .add-row, .view-head .btn { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
  .content { padding: 0; max-width: none; }
  .report-doc { box-shadow: none; border: none; border-radius: 0; padding: 0; }
  a { color: inherit; }
  .receipt { break-inside: avoid; }
}

/* =====================================================================
   App shell, auth, dashboard & lists  (accounts / Rydoo-style layout)
   ===================================================================== */

/* ---------- brand wordmark (auth + sidebar) ---------- */
.brand-word { display: flex; align-items: center; gap: .6rem; line-height: 1.15; }
.erc-logo { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand-word__text { display: flex; flex-direction: column; min-width: 0; }
.brand-word__text strong { color: var(--erc-blue); font-weight: 800; font-size: .92rem; letter-spacing: -.01em; }
.brand-word__text span { color: var(--muted); font-size: .72rem; }
.brand-word--sm .erc-logo { width: 34px; height: 34px; }
.brand-word--sm .brand-word__text strong { font-size: .82rem; }
.brand-word--sm .brand-word__text span { font-size: .66rem; }
.brand-word--lg { gap: .8rem; }
.brand-word--lg .erc-logo { width: 58px; height: 58px; }
.brand-word--lg .brand-word__text strong { font-size: 1.1rem; }
.brand-word--lg .brand-word__text span { font-size: .8rem; }

/* ---------- auth screen ---------- */
.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem; gap: 1rem;
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(22,65,148,.28), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(226,0,26,.10), transparent 55%),
    var(--ink);
}
.auth__card {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px;
  padding: 2rem 1.8rem; box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.auth__card .brand-word { flex-direction: column; align-items: center; text-align: center; gap: .5rem; margin-bottom: .3rem; }
.auth__card .brand-word__text { align-items: center; }
.auth__sub { color: var(--muted); font-size: .92rem; margin: .3rem 0 1.3rem; text-align: center; }
.auth__form { display: flex; flex-direction: column; gap: .8rem; }
.auth__switch { text-align: center; margin-top: 1rem; font-size: .88rem; }
.auth__foot { color: #b7b2ab; font-size: .78rem; }
.btn--block { width: 100%; margin-top: .3rem; }

/* ---------- layout: sidebar + content ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 258px; flex-shrink: 0; background: var(--ink); color: #e7e4df;
  display: flex; flex-direction: column; padding: 1.1rem .9rem;
  position: sticky; top: 0; height: 100vh; border-right: 3px solid var(--brand);
}
.sidebar__brand { padding: .3rem .5rem 1.1rem; color: #fff; display: block; }
.sidebar__brand .brand-word__text strong { color: #fff; }
.sidebar__brand .brand-word__text span { color: #aeb9d0; }
.sidebar__nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: 10px;
  color: #c7c2bb; font-weight: 600; font-size: .93rem; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.is-active { background: var(--brand); color: #fff; }
.nav-item__icon { width: 1.2rem; text-align: center; font-size: .95rem; }
.nav-badge {
  margin-left: auto; background: #fff; color: var(--brand-dark); font-size: .72rem; font-weight: 800;
  min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px; display: grid; place-items: center;
}
.nav-item.is-active .nav-badge { background: #fff; color: var(--brand-dark); }
.sidebar__user {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .5rem; margin-top: .6rem;
  border-top: 1px solid rgba(255,255,255,.1); color: #e7e4df;
}
.sidebar__user:hover { color: #fff; }
.sidebar__user-info { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sidebar__user-info strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex-shrink: 0;
}
.avatar--ghost { background: var(--steel); }

.content { flex: 1; min-width: 0; padding: clamp(1.1rem, 3vw, 2.2rem); max-width: 1000px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.view-head h1 { margin-bottom: .2rem; }
.section-title { margin: 1.6rem 0 .8rem; }
.spacer { flex: 1; }

/* ---------- dashboard stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; }
.stat-card-link { display: block; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .15rem;
  transition: transform .08s, box-shadow .15s; height: 100%;
}
.stat-card-link:hover .stat-card { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card__icon { font-size: 1.2rem; }
.stat-card__value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.stat-card__label { font-size: .82rem; color: var(--muted); }
.stat-card--hot { border-color: var(--brand); background: linear-gradient(180deg, rgba(22,65,148,.08), var(--surface)); }
.stat-card--hot .stat-card__value { color: var(--brand-dark); }

.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: rgba(22,65,148,.08); border: 1px solid rgba(22,65,148,.3); color: var(--brand-dark);
  padding: .8rem 1.1rem; border-radius: var(--radius); margin-top: 1.2rem; font-weight: 600;
}
.callout--warn, .callout--ok { display: block; margin: 0 0 .8rem; color: var(--text); }
.callout--warn { background: rgba(214,69,80,.08); border-color: rgba(214,69,80,.35); }
.callout--ok { background: rgba(60,160,90,.10); border-color: rgba(60,160,90,.35); }
.callout__list { margin: .4rem 0 0; padding-left: 1.15rem; font-weight: 500; }
.callout__list li { margin: .2rem 0; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.confirm-row { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.confirm-eur { font-weight: 700; }
.confirm-amt { width: 8rem; padding: .4rem .55rem; border: 1px solid var(--line, #cfd6df); border-radius: .5rem; font-size: 1rem; font-weight: 700; }

/* ---------- cost-line views (cards / table) ---------- */
.lines-head { display: flex; justify-content: flex-end; margin-bottom: .7rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg__btn { border: 0; background: var(--surface); color: var(--muted); cursor: pointer; padding: .35rem .75rem; font-size: .82rem; font-weight: 600; }
.seg__btn + .seg__btn { border-left: 1px solid var(--line); }
.seg__btn.is-on { background: var(--ink); color: #fff; }
.items-table-wrap { overflow-x: auto; }
.items-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.items-table th {
  text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: .3rem .4rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.items-table td { padding: .25rem .35rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.items-table th.num, .items-table td.num { text-align: right; white-space: nowrap; }
.items-table input, .items-table select { padding: .35rem .4rem; font-size: .85rem; }
.items-table select { min-width: 90px; padding-right: 1.6rem; }
.items-table td:nth-child(2) select { min-width: 150px; }
.items-table input[type="text"] { width: 100%; min-width: 150px; }
.items-table input[type="number"] { max-width: 96px; }
.items-table input[type="date"] { min-width: 138px; }

/* ---------- form list rows ---------- */
.form-list { display: flex; flex-direction: column; gap: .55rem; }
.form-row {
  display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: .8rem 1rem; box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .15s, border-color .15s;
}
.form-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: #d8d3cc; }
.form-row__main { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.form-row__main strong { font-size: .96rem; }
.form-row__amount { font-weight: 800; color: var(--text); white-space: nowrap; }
.form-row__go { color: var(--muted); font-size: 1.4rem; line-height: 1; }
.form-row__del {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
  border-radius: 8px; padding: .3rem .5rem; font-size: 1rem; line-height: 1; transition: border-color .15s, color .15s, background .15s;
}
.form-row__del:hover { border-color: var(--danger); color: var(--danger); background: #fff5f2; }

.empty-inline { text-align: center; padding: 2.4rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); }
.empty-inline .btn { margin-top: .8rem; }

/* ---------- team ---------- */
.invite-form { display: flex; align-items: flex-end; gap: .8rem; flex-wrap: wrap; }
.invite-form .field { min-width: 180px; }
.invite-link { margin-top: 1rem; }
.invite-link__row { display: flex; gap: .5rem; margin-top: .4rem; }
.invite-link__row input { font-family: monospace; font-size: .82rem; }
.team-list { display: flex; flex-direction: column; gap: .5rem; }
.team-row { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.team-row:last-child { border-bottom: none; }
.team-row.is-inactive { opacity: .5; }
.team-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.team-row__actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-left: auto; }
.team-row__edit { flex-direction: row; gap: .4rem; flex-wrap: wrap; }
.team-row__edit input { flex: 1; min-width: 120px; }
.team-row select { width: auto; }
.you-tag { font-size: .66rem; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); padding: .05rem .4rem; border-radius: 6px; margin-left: .4rem; font-weight: 700; }
.btn--sm { padding: .4rem .7rem; font-size: .82rem; }

/* ---------- admin: all forms ---------- */
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: .4rem .8rem; border-radius: 999px; font-size: .84rem; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.admin-search { width: 240px; max-width: 100%; }
.list-count { margin: 0 0 .7rem; }
.edited-chip { color: var(--brand); font-weight: 800; margin-left: .4rem; }
.admin-stamp {
  margin-top: 1rem; font-size: .82rem; color: var(--brand-dark);
  background: rgba(22,65,148,.08); border: 1px dashed rgba(22,65,148,.4);
  padding: .5rem .7rem; border-radius: 8px;
}
.btn--danger-ghost:hover { border-color: var(--danger); color: var(--danger); }
.editor-actions { flex-wrap: wrap; }
.view-head h1 .badge { margin-left: .6rem; vertical-align: middle; }

/* ---------- responsive: sidebar → top bar ---------- */
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: auto; height: auto; position: sticky; top: 0; z-index: 20; flex-direction: row;
    align-items: center; gap: .5rem; padding: .55rem .8rem; border-right: none; border-bottom: 3px solid var(--brand);
    overflow-x: auto;
  }
  .sidebar__brand { padding: 0 .6rem 0 .2rem; }
  .sidebar__brand .brand-word__text { display: none; }
  .sidebar__nav { flex-direction: row; flex: 1; gap: .1rem; }
  .nav-item span:not(.nav-item__icon):not(.nav-badge) { display: none; } /* icons only on mobile */
  .nav-item { padding: .55rem .6rem; }
  .nav-badge { margin-left: .2rem; }
  .sidebar__user { margin-top: 0; border-top: none; padding: .3rem; }
  .sidebar__user-info { display: none; }
  .content { max-width: none; }
}
