/* Extracted from index.html so the page can ship a CSP without 'unsafe-inline'.
 * Loaded from <link> in index.html; keep the ?v= query in step with edits. */
    :root {
      --bg: #070b18;
      --panel: rgba(12, 17, 34, 0.6);
      --line: rgba(110, 130, 190, 0.16);
      --line-strong: rgba(110, 130, 190, 0.32);
      --text: #eceef4;
      --body: #aab4d0;
      --muted: #8d97b5;
      --accent: #7c5cff;
      --accent-soft: #a99dff;
      --gold: #c9a84c;
      --gold-soft: #e7d194;
      --in: #34d399;
      --in-soft: #a7f3d6;
      --out: #fb7185;
      --out-soft: #fecdd3;
      --error: #fb7185;
    }
    * { box-sizing: border-box; }
    html, body { height: 100%; }
    body {
      margin: 0; min-height: 100vh;
      display: flex; flex-direction: column;
      font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
      background: var(--bg); color: var(--text);
      -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
      overflow-x: hidden;
    }

    /* Ambient glow as a pre-blurred gradient — a filter: blur() here forced
       expensive repaints on every scroll and made the whole page feel heavy. */
    .glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
    .glow::before {
      content: ""; position: absolute; width: 100vw; height: 90vh;
      left: 50%; bottom: -35vh; transform: translateX(-50%);
      background: transparent;
    }

    /* ---- top bar ---- */
    /* Sticky rather than relative so the sidebar has a stable edge to anchor
       against — without it the sidebar would slide up under a scrolled-away bar. */
    .topbar {
      position: sticky; top: 0; z-index: 3;
      display: flex; align-items: center; gap: 1rem;
      min-height: var(--topbar-h);
      padding: 0.8rem clamp(1rem, 3vw, 1.6rem);
      border-bottom: 1px solid var(--line);
      background: var(--bg);
    }
    .wordmark { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
    .wordmark img { width: 26px; height: 26px; border-radius: 7px; display: block; }
    .wordmark .name { font-size: 0.9rem; font-weight: 700; }
    .wordmark .name b { color: var(--gold-soft); }
    .spacer { flex: 1; }
    .nav-top { display: flex; align-items: center; gap: 0.7rem; }
    .tbtn {
      font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-decoration: none;
      padding: 0.42rem 0.8rem; border: 1px solid var(--line); border-radius: 9px;
      background: transparent; cursor: pointer;
      transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }
    .tbtn:hover { color: var(--text); border-color: var(--line-strong); }
    .tbtn.signout:hover { color: #fecdd3; border-color: #7f2436; background: rgba(190, 60, 82, 0.1); }
    .tbtn[hidden] { display: none; }

    /* ---- centered stage (login / picker) ---- */
    .stage {
      position: relative; z-index: 1;
      flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: 1.1rem; text-align: center;
      width: 100%; max-width: 40rem; margin: 0 auto;
      padding: clamp(1rem, 3vh, 2.5rem) 1.25rem clamp(2.5rem, 7vh, 4.5rem);
    }
    .stage[hidden] { display: none; }
    /* Fade the login screen out to the shared #070b18 background before leaving
       for parals.net, so the cross-site jump reads as a crossfade, not a pop. */
    .stage { transition: opacity 0.32s ease; }
    .stage.leaving { opacity: 0; }
    .view { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; width: 100%;
      opacity: 0; transform: translateY(14px);
      transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
    .view.on { opacity: 1; transform: none; }
    .view[hidden] { display: none; }
    .badge { width: clamp(84px, 10vw, 104px); height: clamp(84px, 10vw, 104px); border-radius: 24%; display: block; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
    h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
    h1 .fam { color: var(--muted); font-weight: 500; }
    .line { margin: 0; color: var(--body); font-size: 0.95rem; line-height: 1.55; max-width: 34ch; text-wrap: balance; }

    form.login { display: flex; flex-direction: column; gap: 0.9rem; width: min(20rem, 100%); margin-top: 0.6rem; }
    .field { position: relative; }
    .field input {
      width: 100%; padding: 1.05rem 1rem 0.5rem;
      background: rgba(9, 13, 28, 0.6);
      border: 1px solid var(--line-strong); border-radius: 12px;
      color: var(--text); font: inherit; outline: none;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(64, 87, 197, 0.15); }
    .field label { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.92rem; pointer-events: none; transition: all 0.18s ease; }
    .field input:focus + label,
    .field input:not(:placeholder-shown) + label { top: 0.55rem; transform: none; font-size: 0.64rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gold-soft); }

    .go {
      position: relative; font: inherit; font-size: 0.95rem; font-weight: 700;
      padding: 0.82rem 1.2rem; border: 0; border-radius: 12px; cursor: pointer;
      background: linear-gradient(135deg, #d8b862, #a8842e); color: #17130a;
      box-shadow: none;
      transition: transform 0.15s ease, filter 0.2s ease;
    }
    .go:hover { transform: translateY(-2px); filter: brightness(1.06); }
    .go:active { transform: none; }
    .go:disabled { opacity: 0.45; cursor: default; transform: none; }
    .go.loading { color: transparent; pointer-events: none; }
    .go.loading::after {
      content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px;
      margin: -9px 0 0 -9px; border: 2.5px solid rgba(23, 19, 10, 0.3); border-top-color: #17130a;
      border-radius: 50%; animation: spin 0.7s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .go.sso { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; text-decoration: none; width: min(20rem, 100%); margin: 1rem auto 0; }
    .msg { min-height: 1.2rem; margin: 0; font-size: 0.85rem; color: var(--error); }
    .alt { margin: 0.4rem 0 0; font-size: 0.82rem; color: var(--muted); }
    .alt a { color: var(--accent-soft); text-decoration: none; }
    .alt a:hover { text-decoration: underline; }

    /* ---- company picker ---- */
    .companies { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.2rem, 4vw, 2.2rem); margin-top: 0.8rem; width: 100%; }
    .co { display: flex; flex-direction: column; align-items: center; gap: 0.65rem; width: 7.4rem; padding: 0.4rem 0; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
    .co-mark {
      width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center;
      background: color-mix(in srgb, var(--accent) 10%, transparent);
      border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
      font-size: 1.55rem; font-weight: 700; color: var(--gold-soft); text-transform: uppercase;
      transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.2s ease;
    }
    .co:hover .co-mark { transform: translateY(-2px); border-color: var(--accent); box-shadow: none; }
    .co:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 14px; }
    .co-name { font-size: 0.88rem; font-weight: 600; color: var(--body); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .co:hover .co-name { color: var(--text); }
    .co.new .co-mark { background: none; border: 1.5px dashed var(--line-strong); color: var(--muted); font-size: 1.8rem; font-weight: 400; }
    .co.new:hover .co-mark { border-color: var(--gold); color: var(--gold-soft); box-shadow: none; }
    form.newco { display: flex; flex-direction: column; gap: 0.6rem; width: min(22rem, 100%); margin-top: 0.4rem; }
    form.newco .row { display: flex; gap: 0.6rem; }
    form.newco input { flex: 1; min-width: 0; padding: 0.7rem 0.9rem; background: rgba(9, 13, 28, 0.6); border: 1px solid var(--line-strong); border-radius: 11px; color: var(--text); font: inherit; outline: none; text-align: center; }
    form.newco input:focus { border-color: var(--gold); }
    form.newco .go { padding: 0.7rem 1.1rem; }
    form.newco[hidden], form.newco .row[hidden] { display: none; }
    .vies-status { margin: 0; min-height: 1.1rem; font-size: 0.8rem; color: var(--muted); }
    .vies-status.ok { color: var(--in-soft); }
    .vies-status.warn { color: var(--gold-soft); }
    .vies-status.err { color: var(--out-soft); }
    .linklike { font: inherit; font-size: 0.82rem; background: none; border: 0; color: var(--accent-soft); cursor: pointer; padding: 0; }
    .linklike:hover { text-decoration: underline; }

    /* ================= app shell ================= */
    .app { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: 15.5rem 1fr; width: 100%; max-width: 82rem; margin: 0 auto; min-height: 0; }
    .app[hidden] { display: none; }

    /* The sidebar is a fixed frame, not part of the scrolling document: it is as
       tall as the viewport below the top bar and holds still while the main
       column scrolls. Fifteen destinations only fit that frame at a genuinely
       dense row height, which is what a tool nav wants anyway. */
    .snav {
      position: sticky; top: var(--topbar-h); align-self: start;
      height: calc(100vh - var(--topbar-h));
      display: flex; flex-direction: column;
      padding: var(--space-3) var(--space-2) var(--space-3) var(--space-3);
      border-right: 1px solid var(--line);
      overflow: hidden;
    }

    /* Only this scrolls, and only when the viewport is too short to hold the
       whole nav — a safety valve, not the normal state. */
    .snav-list {
      flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
      display: flex; flex-direction: column; gap: 1px;
      scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
    }
    .snav-list::-webkit-scrollbar { width: 6px; }
    .snav-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

    /* Rhythm: siblings sit tight (1px), groups are separated generously. That
       ratio is what makes the groups legible; a uniform gap made 15 items read
       as one undifferentiated stripe. */
    .snav-section {
      margin: var(--space-4) var(--space-2) var(--space-1);
      color: var(--muted); font-size: 0.66rem; font-weight: 700;
      letter-spacing: 0.07em; text-transform: uppercase;
    }
    .snav-list > .snav-section:first-child { margin-top: 0; }

    .sitem {
      display: flex; align-items: center; gap: var(--space-2);
      min-height: 1.9rem;
      font: inherit; font-size: 0.845rem; font-weight: 600; color: var(--muted); text-align: left;
      padding: var(--space-1) var(--space-2); border: 0; border-radius: 7px;
      background: transparent; cursor: pointer;
      transition: color 0.15s ease, background 0.15s ease;
    }
    .sitem:hover { color: var(--text); background: rgba(110, 130, 190, 0.08); }
    .sitem.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
    .sitem:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
    .sitem svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }

    /* Mobile "more" sheet — secondary sections that don't fit the bottom bar. */
    .more-sheet { width: 100%; max-width: 34rem; margin: auto auto 0; border: 0; border-top: 1px solid var(--line);
      border-radius: 18px 18px 0 0; background: var(--panel); color: var(--text);
      padding: 0.5rem 0.9rem calc(1rem + env(safe-area-inset-bottom)); box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.5); }
    .more-sheet::backdrop { background: rgba(4, 6, 14, 0.5); }
    .more-sheet[open] { animation: sheet-up 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
    @keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
    .more-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 6px auto 10px; }
    .more-item { display: flex; align-items: center; gap: 0.85rem; width: 100%; font: inherit; font-size: 0.96rem; font-weight: 600;
      color: var(--body); text-align: left; padding: 0.85rem 0.6rem; border: 0; background: none; cursor: pointer; border-radius: 10px; }
    .more-item:hover, .more-item:active { background: color-mix(in srgb, var(--accent) 8%, transparent); }
    .more-item.on { color: var(--accent); }
    .more-item svg { width: 22px; height: 22px; flex-shrink: 0; opacity: 0.85; }
    @media (prefers-reduced-motion: reduce) { .more-sheet[open] { animation: none; } }

    /* Activity feed — readable rows with an action-coloured dot + relative time. */
    #activity-list { display: flex; flex-direction: column; }
    .act-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--line); }
    .act-row:last-child { border-bottom: 0; }
    .act-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
    .act-dot.act-create { background: var(--in-soft); }
    .act-dot.act-update { background: var(--gold-soft); }
    .act-dot.act-delete { background: var(--out-soft); }
    .act-dot.act-restore { background: var(--accent); }
    .act-main { flex: 1; min-width: 0; }
    .act-title { font-size: 0.92rem; font-weight: 600; color: var(--text); }
    .act-time { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

    /* Εκκρεμότητες (outstanding / overdue) */
    .out-groups { display: flex; flex-direction: column; gap: 1.7rem; }
    .out-group { display: flex; flex-direction: column; }
    .out-ghead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0 0.2rem 0.55rem; border-bottom: 1px solid var(--line); }
    .out-glabel { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
    .out-gtotal { font-size: 1.15rem; font-weight: 750; font-variant-numeric: tabular-nums; }
    .out-gtotal.is-out { color: var(--out-soft); }
    .out-gtotal.is-in { color: var(--in-soft); }
    .out-row { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 0.2rem; border-bottom: 1px solid var(--line); }
    .out-row:last-child { border-bottom: 0; }
    .out-main { flex: 1; min-width: 0; }
    .out-name { font-size: 0.95rem; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .out-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }
    .out-row.overdue .out-sub { color: var(--out-soft); }
    .out-right { display: flex; align-items: center; gap: 0.7rem; flex: none; }
    .out-amt { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
    .out-badge { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.12rem 0.5rem; border-radius: 999px; color: var(--out-soft); background: color-mix(in srgb, var(--out-soft) 16%, transparent); white-space: nowrap; }

    /* Κατηγορίες */
    .cat-groups { display: flex; flex-direction: column; gap: 1.7rem; }
    .cat-group { display: flex; flex-direction: column; }
    .cat-glabel { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0 0.2rem 0.55rem; border-bottom: 1px solid var(--line); }
    .cat-glabel.is-out { color: var(--out-soft); }
    .cat-glabel.is-in { color: var(--in-soft); }
    .cat-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.72rem 0.2rem; border-bottom: 1px solid var(--line); }
    .cat-row:last-child { border-bottom: 0; }
    .cat-main { flex: 1; min-width: 0; }
    .cat-name { font-size: 0.95rem; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }
    .cat-edit { min-height: 2.15rem; padding: 0 0.9rem; font-size: 0.8rem; flex: none; }
    .cat-input { flex: 1; min-width: 0; padding: 0.55rem 0.8rem; background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; color: var(--text); font: inherit; font-size: 0.92rem; outline: none; }
    .cat-row .cat-save, .cat-row .ghost { min-height: 2.4rem; padding: 0 0.95rem; flex: none; }

    /* Εξαγωγή / Backup */
    .export-cards { display: flex; flex-direction: column; gap: 0.9rem; max-width: 46rem; }
    .export-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
    .export-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
    .export-info b { font-size: 0.95rem; color: var(--text); }
    .export-info span { font-size: 0.8rem; color: var(--muted); }
    .export-card .go, .export-card .ghost { flex: none; min-height: 2.4rem; padding: 0 1.15rem; }

    /* Σημειώσεις (sticky notes) — always light/colourful regardless of theme */
    .section-heading.with-action { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
    .section-heading.with-action .go { flex: none; min-height: 2.5rem; padding: 0 1.1rem; }
    .notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin-top: 1.3rem; }
    .note { display: flex; flex-direction: column; border-radius: 12px; padding: 0.8rem; min-height: 168px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); border: 1px solid rgba(0, 0, 0, 0.12); }
    .note-body { flex: 1; resize: none; border: 0; background: transparent; color: #1c1a12; font: inherit; font-size: 0.92rem; line-height: 1.42; outline: none; width: 100%; }
    .note-body::placeholder { color: rgba(0, 0, 0, 0.34); }
    .note-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0.55rem; }
    .note-colors { display: flex; gap: 0.35rem; }
    .note-dot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, 0.18); cursor: pointer; padding: 0; }
    .note-dot.on { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); }
    /* Truncation notices: the ledger and the outstanding view show a bounded window. */
    .ledger-trunc td, .out-trunc { padding: 0.5rem 0.6rem; font-size: 0.76rem; color: var(--muted); font-style: italic; }
    .doc-note { font-size: 0.75rem; font-style: italic; }
    .note-status { flex: 1; text-align: right; margin-right: 0.5rem; font-size: 0.7rem; color: rgba(0, 0, 0, 0.45); }
    .note-status.s-error { color: #b5474f; font-weight: 700; }
    .note-del { border: 0; background: transparent; color: rgba(0, 0, 0, 0.42); font-size: 0.9rem; cursor: pointer; border-radius: 6px; padding: 0.1rem 0.45rem; }
    .note-del:hover { color: #b5474f; }
    .note-del.armed { color: #fff; background: #d9534f; font-size: 0.72rem; font-weight: 700; }
    .note-yellow { background: #fef3b7; } .dot-yellow { background: #fbe38a; }
    .note-pink { background: #ffd6e0; } .dot-pink { background: #ffb3c7; }
    .note-blue { background: #cfe6ff; } .dot-blue { background: #a9d3ff; }
    .note-green { background: #d3f2d0; } .dot-green { background: #aee5a8; }
    .note-purple { background: #e6d9ff; } .dot-purple { background: #cdb4ff; }
    .note-skel { background: var(--panel); border: 1px solid var(--line); box-shadow: none; animation: skelPulse 1.2s ease-in-out infinite; }

    /* Τηλεφωνικός κατάλογος */
    .dir-add { display: flex; gap: 0.6rem; margin: 1.2rem 0 0.8rem; flex-wrap: wrap; }
    .dir-add input { flex: 1; min-width: 8rem; padding: 0.6rem 0.85rem; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); font: inherit; font-size: 0.92rem; outline: none; }
    .dir-add input:focus, .dir-search:focus { border-color: var(--accent); }
    .dir-add .go { flex: none; min-height: 2.6rem; padding: 0 1.1rem; }
    .dir-search { width: 100%; max-width: 22rem; padding: 0.55rem 0.85rem; margin-bottom: 1rem; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); font: inherit; font-size: 0.9rem; outline: none; }
    .dir-list { display: flex; flex-direction: column; }
    .dir-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.68rem 0.2rem; border-bottom: 1px solid var(--line); }
    .dir-row:last-child { border-bottom: 0; }
    .dir-av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 0.9rem; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); text-transform: uppercase; }
    .dir-main { flex: 1; min-width: 0; }
    .dir-name { font-size: 0.95rem; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dir-phone { font-size: 0.82rem; color: var(--accent); text-decoration: none; }
    .dir-phone.dim { color: var(--muted); }
    .dir-phone:hover { text-decoration: underline; }
    .dir-actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }
    .dir-edit { min-height: 2.05rem; padding: 0 0.75rem; font-size: 0.78rem; }
    .dir-del { border: 0; background: transparent; color: var(--muted); font-size: 0.9rem; cursor: pointer; border-radius: 7px; padding: 0.25rem 0.5rem; }
    .dir-del:hover { color: var(--out); }
    .dir-del.armed { color: #fff; background: rgba(251, 113, 133, 0.3); font-size: 0.72rem; font-weight: 700; }
    .dir-input { min-width: 6rem; flex: 1; padding: 0.5rem 0.7rem; background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; color: var(--text); font: inherit; font-size: 0.9rem; outline: none; }
    .dir-row.editing .go, .dir-row.editing .ghost { min-height: 2.3rem; padding: 0 0.85rem; flex: none; }

    .main { min-width: 0; padding: clamp(1.1rem, 3vw, 2rem) clamp(1rem, 3.5vw, 2.4rem) 4rem; }
    .sub[hidden] { display: none; }
    /* view enter: replays automatically when a section flips display:none → block */
    .sub { animation: subIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
    @keyframes subIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
    .tile, .entry, .ledger tbody tr { animation: rowIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
    @keyframes rowIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
    .tile:hover { transform: translateY(-2px); }
    .tile { transition: background 0.15s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
    .amount.pop { animation: amtPop 0.18s cubic-bezier(0.22, 1, 0.36, 1); }
    @keyframes amtPop { 50% { transform: scale(1.035); } }
    .sub h2 { margin: 0 0 0.2rem; font-size: clamp(1.35rem, 2.6vw, 1.8rem); font-weight: 700; letter-spacing: -0.02em; }
    .sub .subline { margin: 0 0 1.4rem; color: var(--muted); font-size: 0.88rem; }

    /* dashboard tiles: open, hairline-divided */
    .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 1.6rem; }
    .tile { background: var(--bg); padding: 1.1rem 1.2rem; text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; transition: background 0.15s ease; }
    .tile:hover { background: rgba(12, 17, 34, 0.85); }
    .tile .tl { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
    .tile .tv { font-size: 1.45rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
    .tile .ts { font-size: 0.76rem; color: var(--muted); margin-top: 0.25rem; }

    /* list rows — obviously clickable */
    .toolrow { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; flex-wrap: wrap; }
    .search { flex: 1; min-width: 10rem; padding: 0.62rem 0.9rem; background: rgba(9, 13, 28, 0.6); border: 1px solid var(--line); border-radius: 11px; color: var(--text); font: inherit; font-size: 0.9rem; outline: none; }
    .search:focus { border-color: var(--line-strong); }
    .rows { display: flex; flex-direction: column; }
    .rowi {
      display: flex; align-items: center; gap: 0.9rem; width: 100%; text-align: left;
      padding: 0.85rem 0.9rem; border: 0; border-radius: 12px; background: transparent;
      font: inherit; color: inherit; cursor: pointer;
      border-bottom: 1px solid var(--line);
      transition: background 0.13s ease;
      content-visibility: auto;
      contain-intrinsic-size: 64px;
    }
    .rowi:hover { background: rgba(110, 130, 190, 0.07); }
    .rowi:last-child { border-bottom: 0; }
    .rowi .pm {
      width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
      background: rgba(110, 130, 190, 0.1); border: 1px solid var(--line-strong);
      font-size: 0.95rem; font-weight: 700; color: var(--body); text-transform: uppercase;
    }
    .rowi .rmain { flex: 1; min-width: 0; }
    .rowi .rn { font-size: 0.95rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rowi .rs { font-size: 0.76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rowi .rb { text-align: right; }
    .rowi .rbv { font-size: 0.98rem; font-weight: 700; font-variant-numeric: tabular-nums; }
    .rowi .rbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
    .rowi .chev { color: var(--muted); flex-shrink: 0; transition: transform 0.15s ease; }
    .rowi:hover .chev { transform: translateX(3px); color: var(--gold-soft); }
    .empty { color: var(--muted); font-size: 0.9rem; padding: 2rem 0.5rem; text-align: center; }

    /* inline create panel */
    .panel { border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; margin-bottom: 1.2rem; background: var(--panel); }
    .panel[hidden] { display: none; }
    .panel .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
    .panel input {
      width: 100%; padding: 0.66rem 0.85rem; background: rgba(9, 13, 28, 0.6);
      border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font: inherit; font-size: 0.9rem; outline: none;
    }
    .panel input:focus { border-color: var(--gold); }
    .panel .lab { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.3rem 0.15rem; }
    .panel .actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.9rem; }
    .ghost { font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 1rem; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease; }
    .ghost:hover { color: var(--text); border-color: var(--line-strong); }

    /* καρτέλα */
    .khead { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
    .khead .pm { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); font-size: 1.25rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }
    .khead .km { flex: 1; min-width: 12rem; }
    .khead h2 { margin: 0; }
    .khead .ks { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
    .k-edit-btn { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; padding: 0.3rem 0.6rem; font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
    .k-edit-btn:hover { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
    .k-edit-btn svg { width: 15px; height: 15px; }
    .khead .kb { text-align: right; }
    .khead .kbv { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; }
    .khead .kbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
    .kactions { display: flex; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 1.1rem; }

    /* tx add form */
    .txform { display: grid; grid-template-columns: auto 1fr auto auto; gap: 0.6rem; align-items: center; margin-bottom: 1.1rem; }
    .kindseg { display: flex; background: rgba(9, 13, 28, 0.7); border: 1px solid var(--line-strong); border-radius: 11px; padding: 3px; gap: 3px; }
    .kindseg button { font: inherit; font-size: 0.82rem; font-weight: 700; padding: 0.5rem 0.8rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: color 0.15s ease, background 0.15s ease; }
    .kindseg button.on { color: #17130a; background: var(--gold-soft); }
    .methodseg { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
    .methodseg[hidden] { display: none; }
    .methodseg-l { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-right: 0.15rem; }
    .methodseg button { font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.42rem 0.85rem; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease; }
    .methodseg button.on { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
    .tx-method { display: inline-block; margin-left: 0.5rem; padding: 0.05rem 0.5rem; font-size: 0.66rem; font-weight: 700; border-radius: 999px; vertical-align: middle; }
    .tx-method-cash { color: var(--in-soft); background: color-mix(in srgb, var(--in-soft) 16%, transparent); }
    .tx-method-bank { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
    .txform input { padding: 0.6rem 0.8rem; background: rgba(9, 13, 28, 0.6); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font: inherit; font-size: 0.9rem; outline: none; min-width: 0; }
    .txform input:focus { border-color: var(--gold); }
    .txform input[type="date"] { color-scheme: dark; }

    /* ledger table */
    .ledger { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
    .ledger th { text-align: left; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line-strong); }
    .ledger td { padding: 0.6rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
    .ledger .num { text-align: right; white-space: nowrap; }
    .ledger .open td { color: var(--muted); font-style: italic; }
    .ledger .xdel { font: inherit; background: none; border: 0; color: rgba(141, 151, 181, 0.5); cursor: pointer; padding: 0.2rem 0.35rem; border-radius: 6px; font-size: 0.8rem; }
    .ledger .xdel:hover { color: var(--out); }
    .ledger .xdel.armed { color: #fff; background: rgba(251, 113, 133, 0.25); font-weight: 700; }
    .lwrap { overflow-x: auto; }

    .k-in { color: var(--in-soft); }
    .k-out { color: var(--out-soft); }
    .k-gold { color: var(--gold-soft); }

    /* ---- ταμείο (cash pad) ---- */
    .cash { width: min(23.5rem, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; text-align: center; }
    .seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: rgba(9, 13, 28, 0.7); border: 1px solid var(--line-strong); border-radius: 14px; padding: 4px; }
    .seg .spill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 11px; background: rgba(52, 211, 153, 0.16); border: 1px solid rgba(52, 211, 153, 0.45); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease, border-color 0.25s ease; }
    .seg.out .spill { transform: translateX(100%); background: rgba(251, 113, 133, 0.14); border-color: rgba(251, 113, 133, 0.45); }
    .seg > button { position: relative; z-index: 1; border: 0; background: transparent; font: inherit; font-size: 1rem; font-weight: 700; padding: 0.75rem; cursor: pointer; color: var(--muted); transition: color 0.2s ease; border-radius: 11px; }
    .seg > button.on-in { color: var(--in-soft); }
    .seg > button.on-out { color: var(--out-soft); }
    .amount { font-size: clamp(2.6rem, 9vw, 3.4rem); font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; padding: 0.4rem 0 0.1rem; }
    .amount.zero { color: var(--muted); }
    .amount .cur { font-size: 0.55em; font-weight: 600; color: var(--muted); margin-left: 0.15em; }
    .pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
    .pad button { font: inherit; font-size: 1.35rem; font-weight: 600; color: var(--text); padding: 0.72rem 0; border-radius: 14px; cursor: pointer; background: rgba(16, 22, 43, 0.75); border: 1px solid var(--line); transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease; -webkit-tap-highlight-color: transparent; user-select: none; }
    .pad button:hover { border-color: var(--line-strong); background: rgba(20, 27, 51, 0.9); }
    .pad button:active { transform: scale(0.96); }
    .pad button.fn { color: var(--muted); font-size: 1.15rem; }
    .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; }
    .chip { font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--body); padding: 0.42rem 0.85rem; border-radius: 999px; cursor: pointer; background: transparent; border: 1px solid var(--line-strong); transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease; -webkit-tap-highlight-color: transparent; }
    .chip:hover { color: var(--text); }
    .chip.sel { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
    .note-in { width: 100%; padding: 0.65rem 0.9rem; background: rgba(9, 13, 28, 0.55); border: 1px solid var(--line); border-radius: 11px; color: var(--text); font: inherit; font-size: 0.88rem; outline: none; text-align: center; }
    .note-in:focus { border-color: var(--line-strong); }
    .go.submit { font-size: 1.05rem; padding: 0.95rem; }
    .mrow { display: flex; align-items: center; justify-content: center; gap: 0.8rem; margin-top: 0.6rem; }
    .mrow .mn { font: inherit; background: none; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); width: 30px; height: 30px; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease; }
    .mrow .mn:hover { color: var(--text); border-color: var(--line-strong); }
    .mrow .mn:disabled { opacity: 0.3; cursor: default; }
    .mrow .ml { font-size: 0.9rem; font-weight: 700; min-width: 11ch; }
    .mtot { display: flex; justify-content: center; gap: 1.4rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
    .mtot .t-in { color: var(--in-soft); }
    .mtot .t-out { color: var(--out-soft); }
    .mtot .t-net { color: var(--text); font-weight: 700; }
    .entries { width: 100%; display: flex; flex-direction: column; margin-top: 0.2rem; text-align: left; }
    .e-empty { color: var(--muted); font-size: 0.88rem; padding: 1.2rem 0; text-align: center; }
    .entry { display: flex; align-items: center; gap: 0.8rem; padding: 0.65rem 0.2rem; border-bottom: 1px solid var(--line); }
    .entry:last-child { border-bottom: 0; }
    .e-main { flex: 1; min-width: 0; }
    .e-cat { font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .e-sub { font-size: 0.74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .e-amt { font-size: 0.98rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .e-amt.in { color: var(--in-soft); }
    .e-amt.out { color: var(--out-soft); }
    .e-del { font: inherit; font-size: 0.8rem; background: none; border: 0; color: rgba(141, 151, 181, 0.55); cursor: pointer; padding: 0.3rem 0.35rem; border-radius: 7px; flex-shrink: 0; transition: color 0.15s ease, background 0.15s ease; }
    .e-del:hover { color: var(--out); }
    .e-del.armed { color: #fff; background: rgba(251, 113, 133, 0.25); font-weight: 700; }
    .cash-today { display: flex; justify-content: space-between; align-items: baseline; }
    .cash-today .l { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
    .cash-today .v { font-size: 1.1rem; font-weight: 750; font-variant-numeric: tabular-nums; }

    /* mobile: bottom tab bar */
    .tabbar { display: none; }
    @media (max-width: 860px) {
      .app { grid-template-columns: 1fr; }
      .snav { display: none; }
      .main { padding-bottom: 6rem; }
      .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
        display: grid; grid-template-columns: repeat(5, 1fr);
        /* opaque instead of backdrop-filter: the live blur repainted the whole
           bar on every scroll frame, which is what made phones feel sluggish */
        background: #080d1c; border-top: 1px solid var(--line);
        padding: 0.35rem 0.3rem calc(0.45rem + env(safe-area-inset-bottom));
      }
      .tabbar[hidden] { display: none; }
      .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-size: 0.62rem; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 0.3rem 0; cursor: pointer; border-radius: 10px; white-space: nowrap; }
      .tabbar button.on { color: var(--gold-soft); }
      .txform { grid-template-columns: 1fr 1fr; }
      .kindseg { grid-column: 1 / -1; justify-content: stretch; }
      .kindseg button { flex: 1; }
      .txform .go { grid-column: 1 / -1; }
      .panel .grid2 { grid-template-columns: 1fr; }
    }

    .footer { position: relative; z-index: 1; padding: 1rem 1.5rem 1.4rem; display: flex; justify-content: center; font-size: 0.75rem; color: rgba(141, 151, 181, 0.6); }
    .footer a { color: var(--muted); text-decoration: none; }
    .footer a:hover { color: var(--text); }

    /* print: the καρτέλα becomes a clean white sheet */
    #print-root { display: none; }
    @media print {
      body > *:not(#print-root) { display: none !important; }
      body { background: #fff; color: #000; }
      #print-root { display: block; padding: 24px; font-size: 12px; color: #000; }
      #print-root h1 { font-size: 18px; margin: 0 0 2px; color: #000; }
      #print-root h2 { font-size: 13px; margin: 0 0 2px; color: #000; }
      #print-root .sub { color: #444; margin: 0 0 14px; }
      #print-root .doc-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin: 0 0 16px; padding: 0 0 12px; border-bottom: 2px solid #000; }
      #print-root .doc-head p { margin: 2px 0 0; color: #444; font-size: 11px; line-height: 1.5; }
      #print-root .doc-co { max-width: 45%; }
      #print-root .doc-card { text-align: right; max-width: 55%; }
      #print-root .doc-lbl { text-transform: uppercase; letter-spacing: .05em; font-size: 9px; color: #888; margin: 0 0 1px; }
      #print-root table { width: 100%; border-collapse: collapse; }
      #print-root th, #print-root td { border: 1px solid #bbb; padding: 5px 7px; text-align: left; }
      #print-root .num { text-align: right; }
      #print-root .tot td { font-weight: 700; }
    }

    /* company tile delete (picker) */
    .co { position: relative; }
    .co .co-del {
      position: absolute; top: -6px; right: 6px; z-index: 2;
      font: inherit; font-size: 0.72rem; font-weight: 700;
      min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
      background: rgba(7, 11, 24, 0.9); border: 1px solid var(--line-strong);
      color: var(--muted); cursor: pointer; opacity: 0.45;
      transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }
    .co:hover .co-del, .co .co-del:focus-visible { opacity: 1; }
    .co .co-del:hover { color: var(--out); border-color: rgba(251, 113, 133, 0.5); }
    .co .co-del.armed { opacity: 1; color: #fff; background: rgba(251, 113, 133, 0.3); border-color: var(--out); }

    @media (prefers-reduced-motion: reduce) {
      .view, .co-mark, .seg .spill, .rowi .chev, .tile, .stage { transition: none; }
      .view { opacity: 1; transform: none; }
      .sub, .tile, .entry, .ledger tbody tr, .amount.pop { animation: none; }
    }
    /* ---- professional workspace refresh ---- */
    :root { --bg:#f7f8fa; --panel:#fff; --line:#dfe3ea; --line-strong:#c4ccd8; --text:#172033; --body:#3f4a5d; --muted:#657084; --accent:#4057c5; --accent-soft:#4057c5; --gold:#4057c5; --gold-soft:#4057c5; --in:#167a5c; --in-soft:#167a5c; --out:#b5474f; --out-soft:#b5474f; --error:#b5474f; --space-1:.25rem; --space-2:.5rem; --space-3:.75rem; --space-4:1rem; --space-5:1.5rem; --space-6:2rem; }
    body[data-theme="dark"] { --bg:#111827; --panel:#182234; --line:#2a3649; --line-strong:#3a4a63; --text:#f3f6fb; --body:#c2cbd9; --muted:#9aa8bc; --accent:#7184e8; --accent-soft:#9cacef; --gold:#7184e8; --gold-soft:#9cacef; --in:#43b58b; --in-soft:#8adbb8; --out:#dc727c; --out-soft:#f3abb2; }
    html[data-text-size="large"] { font-size:112.5%; } html[data-text-size="small"] { font-size:93.75%; }
    .glow, .glow::before { display:none; } body { background:var(--bg); color:var(--text); line-height:1.45; }
    .topbar { z-index:20; min-height:4rem; background:var(--panel); border-color:var(--line); padding:.7rem clamp(1rem, 3vw, 2rem); }
    .wordmark .name b { color:var(--accent); } .tbtn { min-height:2.5rem; border-radius:7px; border-color:var(--line); color:var(--body); }
    .tbtn:hover { color:var(--text); background:color-mix(in srgb, var(--accent) 7%, transparent); border-color:var(--line-strong); }
    .go { min-height:2.75rem; border-radius:7px; background:var(--accent); color:#fff; box-shadow:none; } .go:hover { transform:none; filter:brightness(.94); }
    .field input, form.newco input, .search, .panel input, .txform input, .note-in { background:var(--panel); color:var(--text); border-color:var(--line-strong); border-radius:7px; }
    .field input:focus, form.newco input:focus, .panel input:focus, .txform input:focus { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 17%, transparent); }
    .app { max-width:96rem; grid-template-columns:14rem minmax(0, 1fr); } .snav { background:var(--panel); border-color:var(--line); padding:var(--space-5) var(--space-3) var(--space-5) var(--space-4); gap:var(--space-1); }
    .snav .co-line { padding:var(--space-2) var(--space-2) var(--space-5); } .snav .co-line .mark, .khead .pm { background:color-mix(in srgb, var(--accent) 12%, transparent); border-color:color-mix(in srgb, var(--accent) 28%, var(--line)); color:var(--accent); }
    .sitem { min-height:2.75rem; border-radius:7px; color:var(--body); font-size:.875rem; } .sitem:hover { color:var(--text); background:color-mix(in srgb, var(--accent) 7%, transparent); } .sitem.on { color:var(--accent); background:color-mix(in srgb, var(--accent) 11%, transparent); }
    .main { padding:var(--space-6) clamp(1.25rem,3.5vw,3rem) 5rem; } .sub h2 { font-size:1.75rem; letter-spacing:-.025em; } .sub .subline { font-size:.875rem; margin-bottom:var(--space-6); }
    .tiles { grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; border-radius:8px; margin-bottom:var(--space-6); background:var(--line); } .tile { background:var(--panel); padding:var(--space-5); } .tile:hover { background:color-mix(in srgb,var(--accent) 4%,var(--panel)); transform:none; } .tile .tl, .panel .lab, .ledger th, .cash-today .l { font-size:.75rem; letter-spacing:.045em; } .tile .tv { font-size:1.65rem; font-weight:700; }
    .panel { background:var(--panel); border-color:var(--line); border-radius:8px; padding:var(--space-5); } .rowi { border-radius:6px; padding:var(--space-3) var(--space-4); } .rowi:hover { background:color-mix(in srgb,var(--accent) 6%,transparent); } .rowi .pm { border-radius:7px; background:color-mix(in srgb,var(--accent) 9%,transparent); border-color:color-mix(in srgb,var(--accent) 18%,var(--line)); color:var(--accent); }
    .ghost { min-height:2.5rem; border-radius:7px; color:var(--body); border-color:var(--line-strong); } .ghost:hover { color:var(--accent); border-color:var(--accent); } .kindseg, .seg { background:var(--panel); border-color:var(--line-strong); border-radius:8px; } .kindseg button.on { background:color-mix(in srgb,var(--accent) 14%,var(--panel)); color:var(--accent); }
    .pad button { background:var(--panel); border-color:var(--line); border-radius:7px; color:var(--text); } .pad button:hover { background:color-mix(in srgb,var(--accent) 6%,var(--panel)); border-color:var(--line-strong); } .chip.sel { color:var(--accent); border-color:var(--accent); background:color-mix(in srgb,var(--accent) 8%,transparent); }
    .cash { width:min(30rem,100%); padding:var(--space-5); background:var(--panel); border:1px solid var(--line); border-radius:8px; }
    .prefs-dialog { width:min(28rem,calc(100vw - 2rem)); color:var(--text); background:var(--panel); border:1px solid var(--line-strong); border-radius:10px; padding:0; box-shadow:0 18px 50px rgba(11,18,33,.22); } .prefs-dialog::backdrop { background:rgba(12,18,32,.42); } .prefs-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:var(--space-5); border-bottom:1px solid var(--line); } .prefs-head h2 { margin:0; font-size:1.125rem; } .icon-close { width:2.5rem; height:2.5rem; border:0; background:transparent; color:var(--muted); font:inherit; cursor:pointer; border-radius:7px; } .icon-close:hover { color:var(--text); background:color-mix(in srgb,var(--accent) 7%,transparent); } .prefs-body { display:grid; gap:var(--space-5); padding:var(--space-5); } .pref-field { display:grid; gap:var(--space-2); } .pref-field label { font-size:.875rem; font-weight:700; } .pref-field select { min-height:2.75rem; width:100%; padding:0 .75rem; color:var(--text); background:var(--bg); border:1px solid var(--line-strong); border-radius:7px; font:inherit; } .choice-row { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--space-2); } .choice-row button { min-height:2.75rem; padding:.5rem; border:1px solid var(--line-strong); border-radius:7px; color:var(--body); background:var(--panel); font:inherit; cursor:pointer; } .choice-row button[aria-pressed="true"] { border-color:var(--accent); color:var(--accent); background:color-mix(in srgb,var(--accent) 9%,transparent); }
    :focus-visible { outline:3px solid color-mix(in srgb,var(--accent) 55%,white); outline-offset:2px; } @media (max-width:980px) { .app { grid-template-columns:12.5rem minmax(0,1fr); } .tiles { grid-template-columns:1fr; } } @media (max-width:860px) { .cash { padding:var(--space-4); border-radius:8px; } .tabbar { background:var(--panel); border-color:var(--line); } .tabbar button.on { color:var(--accent); } }
    /* ---- professional workspace refresh ---- */
    :root {
      --bg: #f7f8fa; --panel: #ffffff; --line: #dfe3ea; --line-strong: #c4ccd8;
      --text: #172033; --body: #3f4a5d; --muted: #657084; --accent: #4057c5;
      --accent-soft: #4057c5; --gold: #4057c5; --gold-soft: #4057c5;
      --in: #167a5c; --in-soft: #167a5c; --out: #b5474f; --out-soft: #b5474f; --error: #b5474f;
      --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
      --space-5: 1.5rem; --space-6: 2rem; --space-8: 3rem;
      /* The app shell is a fixed frame: the top bar and the sidebar hold still
         while only the main column scrolls. Both need to agree on this height. */
      --topbar-h: 4rem;
    }
    body[data-theme="dark"] { --bg:#111827; --panel:#182234; --line:#2a3649; --line-strong:#3a4a63; --text:#f3f6fb; --body:#c2cbd9; --muted:#9aa8bc; --accent:#7184e8; --accent-soft:#9cacef; --gold:#7184e8; --gold-soft:#9cacef; --in:#43b58b; --in-soft:#8adbb8; --out:#dc727c; --out-soft:#f3abb2; }
    html[data-text-size="large"] { font-size:112.5%; } html[data-text-size="small"] { font-size:93.75%; }
    .glow, .glow::before { display:none; }
    body { background:var(--bg); color:var(--text); line-height:1.45; }
    .topbar { z-index:20; min-height:4rem; background:var(--panel); border-color:var(--line); padding:.7rem clamp(1rem,3vw,2rem); }
    .wordmark .name b { color:var(--accent); }
    .tbtn { min-height:2.5rem; border-radius:7px; border-color:var(--line); color:var(--body); }
    .tbtn:hover { color:var(--text); background:color-mix(in srgb,var(--accent) 7%,transparent); border-color:var(--line-strong); }
    .go { min-height:2.75rem; border-radius:7px; background:var(--accent); color:#fff; box-shadow:none; }
    .go:hover { transform:none; filter:brightness(.94); }
    .field input, form.newco input, .search, .panel input, .txform input, .note-in { background:var(--panel); color:var(--text); border-color:var(--line-strong); border-radius:7px; }
    .field input:focus, form.newco input:focus, .panel input:focus, .txform input:focus { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 17%,transparent); }
    .app { max-width:96rem; grid-template-columns:14rem minmax(0,1fr); }
    body.app-mode > .topbar { display:none; }
    body.app-mode > .footer { display:none; }
    .appbar { display:flex; align-items:center; gap:1rem; min-height:3.5rem; margin:-.35rem 0 var(--space-6); }
    .appbar-search { width:min(21rem,42vw); min-height:2.5rem; padding:0 .9rem 0 2.4rem; color:var(--text); background:var(--panel); border:1px solid var(--line); border-radius:7px; font:inherit; }
    .appbar-search::placeholder { color:var(--muted); }
    .appbar-search-wrap { position:relative; }
    /* No ::before magnifier glyph here: the real icon is the .appbar-search-icon
       SVG. The old "⌕" glyph rendered a second, overlapping icon. */
    .appbar-actions { display:flex; align-items:center; gap:.6rem; margin-left:auto; }
    .appbar-icon { width:2.5rem; height:2.5rem; display:grid; place-items:center; color:var(--muted); background:transparent; border:1px solid transparent; border-radius:7px; font:inherit; cursor:pointer; }
    .appbar-icon:hover { color:var(--text); background:color-mix(in srgb,var(--accent) 7%,transparent); border-color:var(--line); }
    .appbar-user { display:flex; align-items:center; gap:.65rem; padding:.3rem .5rem .3rem .35rem; color:var(--body); background:var(--panel); border:1px solid var(--line); border-radius:7px; font:inherit; text-align:left; }
    .appbar-avatar { width:2rem; height:2rem; display:grid; place-items:center; border-radius:50%; color:#fff; background:var(--accent); font-size:.75rem; font-weight:800; }
    .appbar-user small { display:block; color:var(--muted); font-size:.7rem; }
    .snav { background:var(--panel); border-color:var(--line); padding:var(--space-3) var(--space-2) var(--space-3) var(--space-3); }
    .snav-brand { display:flex; align-items:center; gap:.6rem; padding:.1rem var(--space-2) var(--space-3); color:var(--text); font-size:.875rem; font-weight:750; }
    .snav-brand img { width:1.6rem; height:1.6rem; border-radius:6px; }
    .snav-section { color:var(--muted); font-weight:750; }
    .khead .pm { background:color-mix(in srgb,var(--accent) 12%,transparent); border-color:color-mix(in srgb,var(--accent) 28%,var(--line)); color:var(--accent); }
    .sitem { color:var(--body); }
    .sitem:hover { color:var(--text); background:color-mix(in srgb,var(--accent) 7%,transparent); }
    .sitem.on { color:var(--accent); background:color-mix(in srgb,var(--accent) 11%,transparent); }
    .main { padding:var(--space-6) clamp(1.25rem,3.5vw,3rem) 5rem; background:var(--bg); }
    .sub h2 { font-size:1.75rem; letter-spacing:-.025em; } .sub .subline { font-size:.875rem; margin-bottom:var(--space-6); }
    .tiles { grid-template-columns:repeat(3,minmax(0,1fr)); border-radius:8px; margin-bottom:var(--space-6); background:var(--line); }
    .tile { background:var(--panel); padding:var(--space-5); } .tile:hover { background:color-mix(in srgb,var(--accent) 4%,var(--panel)); transform:none; }
    .tile .tl, .panel .lab, .ledger th, .cash-today .l { font-size:.75rem; letter-spacing:.045em; }
    .tile .tv { font-size:1.65rem; font-weight:700; } .panel { background:var(--panel); border-color:var(--line); border-radius:8px; padding:var(--space-5); }
    .rowi { border-radius:6px; padding:var(--space-3) var(--space-4); } .rowi:hover { background:color-mix(in srgb,var(--accent) 6%,transparent); }
    .rowi .pm { border-radius:7px; background:color-mix(in srgb,var(--accent) 9%,transparent); border-color:color-mix(in srgb,var(--accent) 18%,var(--line)); color:var(--accent); }
    .ghost { min-height:2.5rem; border-radius:7px; color:var(--body); border-color:var(--line-strong); } .ghost:hover { color:var(--accent); border-color:var(--accent); }
    .kindseg, .seg { background:var(--panel); border-color:var(--line-strong); border-radius:8px; } .kindseg button.on { background:color-mix(in srgb,var(--accent) 14%,var(--panel)); color:var(--accent); }
    .pad button { background:var(--panel); border-color:var(--line); border-radius:7px; color:var(--text); } .pad button:hover { background:color-mix(in srgb,var(--accent) 6%,var(--panel)); border-color:var(--line-strong); }
    .chip.sel { color:var(--accent); border-color:var(--accent); background:color-mix(in srgb,var(--accent) 8%,transparent); }
    .cash { width:min(30rem,100%); padding:var(--space-5); background:var(--panel); border:1px solid var(--line); border-radius:8px; }
    #s-dash .subline { display:flex; align-items:center; gap:.5rem; }
    #s-dash .subline::before { content:""; width:.42rem; height:.42rem; border-radius:50%; background:var(--in); }
    #s-cash .cash { width:min(62rem,100%); margin:0; }
    #s-cash .cash-today { padding-bottom:var(--space-4); border-bottom:1px solid var(--line); }
    #s-cash .amount { margin:.45rem 0; }
    #s-cash .entries { border-top:1px solid var(--line); padding-top:var(--space-3); }
    .prefs-dialog { width:min(28rem,calc(100vw - 2rem)); color:var(--text); background:var(--panel); border:1px solid var(--line-strong); border-radius:10px; padding:0; box-shadow:0 18px 50px rgba(11,18,33,.22); }
    .prefs-dialog::backdrop { background:rgba(12,18,32,.42); } .prefs-head { display:flex; align-items:center; justify-content:space-between; padding:var(--space-5); border-bottom:1px solid var(--line); }
    .prefs-head h2 { margin:0; font-size:1.125rem; } .icon-close { width:2.5rem; height:2.5rem; border:0; background:transparent; color:var(--muted); font:inherit; cursor:pointer; border-radius:7px; }
    .icon-close:hover { color:var(--text); background:color-mix(in srgb,var(--accent) 7%,transparent); } .prefs-body { display:grid; gap:var(--space-5); padding:var(--space-5); }
    .pref-field { display:grid; gap:var(--space-2); } .pref-field label { font-size:.875rem; font-weight:700; }
    .pref-field select { min-height:2.75rem; width:100%; padding:0 .75rem; color:var(--text); background:var(--bg); border:1px solid var(--line-strong); border-radius:7px; font:inherit; }
    .choice-row { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--space-2); } .choice-row button { min-height:2.75rem; border:1px solid var(--line-strong); border-radius:7px; color:var(--body); background:var(--panel); font:inherit; cursor:pointer; }
    .choice-row button[aria-pressed="true"] { border-color:var(--accent); color:var(--accent); background:color-mix(in srgb,var(--accent) 9%,transparent); }
    :focus-visible { outline:3px solid color-mix(in srgb,var(--accent) 55%,white); outline-offset:2px; }
    @media (max-width:980px) { .app { grid-template-columns:12.5rem minmax(0,1fr); } .tiles { grid-template-columns:1fr; } }
    @media (max-width:860px) { .cash { padding:var(--space-4); } .tabbar { background:var(--panel); border-color:var(--line); } .tabbar button.on { color:var(--accent); } }

/* Utility classes replacing former inline style="" attributes, which a CSP
   without 'unsafe-inline' for style-src would otherwise block. */
.no-margin { margin: 0; }
.span-full { grid-column: 1 / -1; }
.doc-group { margin-top: 16px; }

/* ---- Restore, bin, API keys, bank feed, myDATA ---- */
.section-heading.tight { margin-top: 2rem; }
.warn-note { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--muted); max-width: 46rem; }

.bin-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; max-width: 46rem; }
.bin-row, .key-row, .bank-conn, .staged-row {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.bin-row:last-child, .key-row:last-child, .bank-conn:last-child, .staged-row:last-child { border-bottom: 0; }
.bin-main, .key-main, .bank-main, .staged-main { flex: 1; min-width: 0; }
.bin-name, .key-name, .bank-name, .staged-name {
  font-size: 0.92rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bin-sub, .key-sub, .bank-sub, .staged-sub { font-size: 0.78rem; color: var(--muted); }
.bin-err { font-size: 0.76rem; color: #b5474f; margin-top: 0.2rem; }

.key-add, .bank-link, .mydata-range { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; margin: 0.8rem 0; max-width: 46rem; }
.key-add input, .bank-link select { flex: 1; min-width: 12rem; padding: 0.6rem 0.85rem; border-radius: 9px; }
.key-list { max-width: 46rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.key-token {
  max-width: 46rem; margin: 0.8rem 0; padding: 0.9rem 1rem; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line-strong);
}
.key-token p { margin: 0 0 0.5rem; font-size: 0.84rem; }
.key-token code {
  display: block; padding: 0.6rem 0.75rem; margin-bottom: 0.6rem; border-radius: 8px;
  background: rgba(9, 13, 28, 0.55); font-size: 0.82rem; word-break: break-all; color: var(--text);
}
.armed { color: #fff !important; background: #d9534f !important; }

.bank-conns { max-width: 46rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.bank-conn.expired { border-left: 3px solid #d9534f; }
.staged-amt { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.staged-acts { display: flex; gap: 0.45rem; flex: none; }
#bank-staged { max-width: 46rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }

.mydata-status { max-width: 46rem; }
.mydata-env { margin-top: 0.7rem; font-size: 0.8rem; color: var(--muted); }
.mydata-env.is-prod { color: #d9534f; font-weight: 700; }
.mydata-range label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--muted); }
.mydata-range input { padding: 0.55rem 0.7rem; border-radius: 9px; }
.mydata-line { padding: 0.55rem 0; font-size: 0.86rem; color: var(--text); }
.mydata-line.warn { color: #d9a13a; }

/* ---- myDATA: credentials, document inbox, classify modal ---- */
.cred-panel {
  max-width: 46rem; margin: 0.4rem 0 1.4rem; padding: 1rem 1.1rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.cred-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.cred-head b { font-size: 0.95rem; color: var(--text); }
.cred-state { font-size: 0.78rem; color: var(--muted); }
.cred-state.ok { color: #167a5c; font-weight: 700; }
.cred-help { margin: 0.35rem 0 0.8rem; font-size: 0.8rem; color: var(--muted); }
.cred-help a { color: var(--accent); }
.cred-form { display: flex; flex-direction: column; gap: 0.7rem; }
.cred-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--muted); }
.cred-form input, .cred-form select {
  padding: 0.6rem 0.85rem; border-radius: 9px; background: var(--panel);
  color: var(--text); border: 1px solid var(--line-strong); font: inherit; font-size: 0.88rem;
}
.cred-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.2rem; }

#mydata-docs, #mydata-entries {
  max-width: 46rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
#mydata-docs:empty, #mydata-entries:empty { display: none; }
#mydata-docs .mydata-line { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line); }

.modal { border: 0; padding: 0; background: transparent; max-width: 32rem; width: calc(100% - 2rem); }
.modal::backdrop { background: rgba(4, 6, 14, 0.55); }
.modal-card {
  display: flex; flex-direction: column; gap: 0.7rem; padding: 1.2rem;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px;
}
.modal-card h3 { margin: 0 0 0.2rem; font-size: 1rem; color: var(--text); }
.modal-card label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--muted); }
.modal-card input, .modal-card select {
  padding: 0.6rem 0.85rem; border-radius: 9px; background: var(--bg);
  color: var(--text); border: 1px solid var(--line-strong); font: inherit; font-size: 0.88rem;
}
.cls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.cls-calc { margin: 0; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.3rem; }

/* ---- Παραστατικά: issuers grouped from myDATA documents ---- */
#docs-issuers { max-width: 46rem; }
.docs-hint { padding: 0.6rem 0.2rem 0.8rem; font-size: 0.8rem; color: var(--muted); font-style: italic; }
.issuer-row {
  display: flex; align-items: center; gap: 0.85rem; width: 100%;
  padding: 0.75rem 0.85rem; margin-bottom: 0.5rem; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  font: inherit; color: inherit; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.issuer-row:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.issuer-main { flex: 1; min-width: 0; }
.issuer-name {
  font-size: 0.94rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.issuer-sub { font-size: 0.78rem; color: var(--muted); }
.issuer-total { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
#di-docs { max-width: 46rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
