/* SycAdmin. Layout: a navy rail holds the menu and can be hidden; a paper workspace holds dense
   ledger tables. Brass marks state only (active page, default view). */
:root {
  --canvas: #F2F4F7; --paper: #FFFFFF; --paper-2: #F7F8FA; --hover: #F0F3F8;
  --ink: #122033; --ink-2: #46566C; --ink-3: #6E7C90;
  --line: #E1E6ED; --line-2: #CBD3DE;
  --primary: #173A6B; --primary-hover: #102C54; --primary-ink: #FFFFFF;
  --link: #1F4F91; --navy-soft: #E8EEF7;
  --brass: #97702F; --brass-soft: #F6EEDF;
  --rail: #0F1D33; --rail-2: #182A47; --rail-ink: #AEBACB; --rail-ink-hi: #FFFFFF; --rail-dim: #73839B; --rail-line: #22344F;
  --ok: #1E6B48; --ok-soft: #E4F1EA; --warn: #8A5A0C; --warn-soft: #FAF0DC; --bad: #A3332A; --bad-soft: #FBE9E7;
  --neg: #A3332A; --focus: #2F6ACB;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, .10);
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 10px 28px rgba(16, 30, 54, .10);
  --scrim: rgba(10, 18, 32, .42);
  --font-ui: "Commissioner", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --rail-w: 256px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0A111D; --paper: #111B2B; --paper-2: #0E1726; --hover: #172338;
    --ink: #E3E9F2; --ink-2: #A7B4C6; --ink-3: #7D8AA0;
    --line: #1F2B3F; --line-2: #2D3C55;
    --primary: #3463A8; --primary-hover: #3E70BB; --primary-ink: #FFFFFF;
    --link: #8DB2EA; --navy-soft: #16243A;
    --brass: #C9A263; --brass-soft: #2A2416;
    --rail: #070D18; --rail-2: #111C2E; --rail-ink: #95A3B7; --rail-ink-hi: #FFFFFF; --rail-dim: #5F6E84; --rail-line: #18253A;
    --ok: #5CC592; --ok-soft: #10261C; --warn: #E2AF57; --warn-soft: #2A2112; --bad: #EE8B81; --bad-soft: #2D1716;
    --neg: #EE8B81; --focus: #8DB2EA;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px rgba(0, 0, 0, .45);
    --scrim: rgba(0, 0, 0, .58);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0A111D; --paper: #111B2B; --paper-2: #0E1726; --hover: #172338;
  --ink: #E3E9F2; --ink-2: #A7B4C6; --ink-3: #7D8AA0;
  --line: #1F2B3F; --line-2: #2D3C55;
  --primary: #3463A8; --primary-hover: #3E70BB; --primary-ink: #FFFFFF;
  --link: #8DB2EA; --navy-soft: #16243A;
  --brass: #C9A263; --brass-soft: #2A2416;
  --rail: #070D18; --rail-2: #111C2E; --rail-ink: #95A3B7; --rail-ink-hi: #FFFFFF; --rail-dim: #5F6E84; --rail-line: #18253A;
  --ok: #5CC592; --ok-soft: #10261C; --warn: #E2AF57; --warn-soft: #2A2112; --bad: #EE8B81; --bad-soft: #2D1716;
  --neg: #EE8B81; --focus: #8DB2EA;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px rgba(0, 0, 0, .45);
  --scrim: rgba(0, 0, 0, .58);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font-ui); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-3); }
.boot { display: grid; place-items: center; height: 100%; color: var(--ink-3); }
#root { height: 100%; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--rail); overflow: auto; }
.login-card { width: min(400px, 100%); background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); padding: 32px 30px 28px; display: flex; flex-direction: column; gap: 18px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .mark { width: 38px; height: 38px; border: 1px solid var(--brass); color: var(--brass); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 19px; border-radius: 9px; }
.login-brand .word { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.login-brand .word span { font-weight: 500; color: var(--ink-3); }
.login-card p { margin: 0; color: var(--ink-3); font-size: 13.5px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .btn.primary { height: 40px; justify-content: center; font-size: 14px; }
.login-foot { font-size: 12px; color: var(--ink-3); text-align: center; }
/* sign-in again over the application (session expired): above forms, dialogs and notifications; hides the data */
.relogin { position: fixed; inset: 0; z-index: 200; overflow: auto; }
.relogin > div { height: 100%; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); height: 100%; transition: grid-template-columns .18s ease; }
.app.rail-hidden { grid-template-columns: 0 minmax(0, 1fr); }
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: 10px; z-index: 60; }
.app.rail-hidden .rail { padding: 0; visibility: hidden; }
.brand { display: flex; align-items: center; gap: 10px; height: 60px; flex: none; border-bottom: 1px solid var(--rail-line); margin-right: 4px; white-space: nowrap; }
.brand .mark { width: 30px; height: 30px; border: 1px solid var(--brass); color: var(--brass); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 16px; border-radius: 7px; flex: none; }
.brand .word { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--rail-ink-hi); }
.brand .word span { font-weight: 500; color: var(--rail-ink); }
.nav { flex: 1; overflow-y: auto; padding: 6px 4px 16px 0; scrollbar-width: thin; scrollbar-color: var(--rail-line) transparent; }
.nav-sec { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--rail-dim); padding: 18px 10px 6px; font-weight: 600; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border-radius: 7px; color: var(--rail-ink); font-size: 13.5px; width: 100%; background: none; border: 0; text-align: left; text-decoration: none; position: relative; white-space: nowrap; }
.nav-item:hover { background: var(--rail-2); color: var(--rail-ink-hi); }
.nav-item.active { background: var(--rail-2); color: var(--rail-ink-hi); font-weight: 500; }
.nav-item.active::before { content: ""; position: absolute; left: -4px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--brass); }
.nav-item .ni-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item .soon { width: 5px; height: 5px; border-radius: 50%; background: var(--rail-dim); opacity: .7; flex: none; }
.nav-item .chev { width: 15px; height: 15px; transition: transform .15s; }
.nav-group.open > .grp .chev { transform: rotate(90deg); }
.nav-group:not(.open) .nav-sub { display: none; }
.nav-sub { padding: 2px 0 6px; }
.nav-item.sub { padding-left: 38px; min-height: 30px; font-size: 13px; }
.rail-foot { flex: none; font-size: 11.5px; color: var(--rail-dim); padding: 12px 4px max(14px, env(safe-area-inset-bottom, 0px)) 10px; border-top: 1px solid var(--rail-line); margin-right: 4px; white-space: nowrap; }
.rail-scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; height: 60px; flex: none; background: var(--paper); border-bottom: 1px solid var(--line); padding-left: 20px; padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.crumbs-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs-top strong { color: var(--ink); font-weight: 600; }
.tb-sp { flex: 1; }
.user { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-soft); color: var(--link); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.u-txt { display: flex; flex-direction: column; line-height: 1.2; }
.u-name { font-size: 13px; font-weight: 600; }
.u-role { font-size: 11.5px; color: var(--ink-3); }

.content { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; padding-block: 16px 20px; padding-left: 28px; padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.page { display: flex; flex-direction: column; gap: 12px; flex: 1 0 auto; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
/* one line: section · title · description (the full description is the tooltip) */
.ph-text { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 12px; }
.eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); font-weight: 600; margin-bottom: 4px; }
.ph-text .eyebrow { margin: 0; flex: none; }
.page-head h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.005em; line-height: 1.2; flex: none; }
.ph-sub { margin: 0; color: var(--ink-3); font-size: 13px; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.empty-state { margin: auto; max-width: 52ch; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 48px 16px; color: var(--ink-2); }
.empty-state .es-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--brass-soft); color: var(--brass); display: grid; place-items: center; }
.empty-state h2 { font-family: var(--font-display); font-size: 21px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13.5px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); border-radius: 8px; font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--paper); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: default; }
.ib { width: 32px; height: 32px; border-radius: 7px; display: inline-grid; place-items: center; color: var(--ink-2); background: transparent; border: 0; flex: none; }
.ib:hover { background: var(--hover); color: var(--ink); }
.ib svg.i { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; color: var(--link); font-size: 12.5px; padding: 4px 2px; text-decoration: underline; text-underline-offset: 2px; }

.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > label, .lbl { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.inp { height: 36px; width: 100%; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 0 11px; font-size: 13.5px; min-width: 0; }
.inp:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.inp.sm { height: 30px; font-size: 13px; }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; gap: 9px; align-items: flex-start; }
.alert svg.i { width: 17px; height: 17px; margin-top: 1px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.search { position: relative; min-width: 0; }
.search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.search .inp { padding-left: 32px; height: 34px; }

/* menus / popovers */
.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 70; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 240px; max-width: min(360px, calc(100vw - 32px)); padding: 6px; }
.menu.right { left: auto; right: 0; }
.mh { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 8px 10px 4px; }
.mi { display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 7px; padding: 8px 10px; font-size: 13.5px; color: var(--ink); }
.mi:hover { background: var(--hover); }
.mi[disabled] { opacity: .45; cursor: default; background: none; }
.mi .mi-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mi .mi-sub { font-size: 12px; color: var(--ink-3); }
.mi .mi-check { width: 16px; flex: none; color: var(--link); display: grid; place-items: center; padding-top: 1px; }
.mi .mi-check svg.i { width: 15px; height: 15px; }
.mi .mi-star { color: var(--brass); }
.mi .mi-star svg.i { width: 15px; height: 15px; fill: currentColor; }
.mi.danger { color: var(--bad); }
.msep { height: 1px; background: var(--line); margin: 6px 4px; }
.mi-form { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.mi-form label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.mi-form .row { display: flex; gap: 6px; }
.ck-empty { font-size: 12.5px; color: var(--ink-3); padding: 8px; }

/* checklist (multi-select filters) */
.mf { width: 300px; padding: 10px; display: flex; flex-direction: column; gap: 8px; font-family: var(--font-ui); }
.mf-list { max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 1px; margin: 2px 0; }
.mf-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.mf-count { font-size: 12px; color: var(--ink-3); }
.mf-sep { font-size: 11px; color: var(--ink-3); padding: 6px 7px 2px; text-transform: uppercase; letter-spacing: .06em; }
.ck { display: flex; align-items: center; gap: 9px; padding: 6px 7px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink); }
.ck:hover { background: var(--hover); }
.ck input { accent-color: var(--primary); width: 15px; height: 15px; flex: none; margin: 0; }
.ck .ck-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck .ck-h { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.mff { width: 100%; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px; font-size: 12.5px; color: var(--ink-3); }
.mff span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mff svg.i { width: 14px; height: 14px; }
.mff.on { color: var(--link); border-color: var(--link); background: var(--navy-soft); }
/* from–to filters: two inputs above date and amount columns */
.rff { width: 100%; display: flex; flex-direction: column; gap: 3px; }
.rff-in { width: 100%; height: 22px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--paper); color: var(--ink); padding: 0 4px; font: 11.5px/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: -.01em; min-width: 0; }
.rff-in::placeholder { color: var(--ink-3); }
.rff-in:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.rff.on .rff-in:not(:placeholder-shown) { border-color: var(--link); background: var(--navy-soft); color: var(--link); }
.rff-in.bad { border-color: var(--bad); background: var(--bad-soft); }
.rf { width: 300px; padding: 10px; display: flex; flex-direction: column; gap: 10px; font-family: var(--font-ui); }
.rf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rf-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); }
.rf-presets { display: flex; flex-wrap: wrap; gap: 4px; }

/* grid toolbar */
.gridhost { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 180px; max-width: 340px; }
.views { display: flex; align-items: center; gap: 6px; }
.view-btn .lbl { color: var(--ink-3); font-weight: 400; font-size: 13px; }
@media (max-width: 1540px) { .view-btn .lbl { display: none; } } /* «Βασική προβολή» already says it; keeps the toolbar on one line */
.view-btn strong { font-weight: 600; color: var(--ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.dirty { font-size: 11px; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 1px 8px; font-weight: 500; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1 1 100%; min-width: 0; order: 10; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--navy-soft); color: var(--link); font-size: 12.5px; max-width: 100%; }
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; }
.chip button:hover { background: var(--paper); }
.chip button svg.i { width: 13px; height: 13px; }
.tb-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cols-list { max-height: 340px; overflow: auto; padding: 2px 0; }

.grid-wrap { flex: 1 1 auto; min-height: 460px; position: relative; min-width: 0; }
.grid { position: absolute; inset: 0; }
.grid .ag-cell { font-variant-numeric: tabular-nums; }
.grid .ag-cell.neg { color: var(--neg); }
.grid .ag-row.pinned-total .ag-cell { font-weight: 600; background: var(--paper-2); }
.cell-name { overflow: hidden; text-overflow: ellipsis; }
.with-tag { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tag-group { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--brass); border: 1px solid var(--brass); border-radius: 4px; padding: 0 5px; line-height: 16px; flex: none; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; vertical-align: middle; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.mute { color: var(--ink-3); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }

.row-actions { display: flex; gap: 2px; align-items: center; height: 100%; }
.row-actions .ib { width: 30px; height: 30px; color: var(--ink-3); }
.row-actions .ib svg.i { width: 17px; height: 17px; }
.ib.danger:hover { color: var(--bad); background: var(--bad-soft); }
.ib.muted { color: var(--ink-3); opacity: .7; } /* e.g. «money back» on a paid expense (legacy grey button) */
.ib.muted:hover { opacity: 1; }
.pill.bad { color: var(--bad); background: var(--bad-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }

/* side-panel form */
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer-scrim { position: absolute; inset: 0; background: var(--scrim); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--canvas); box-shadow: var(--shadow); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.drawer-panel form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 24px 14px; padding-right: max(24px, env(safe-area-inset-right, 0px)); background: var(--paper); border-bottom: 1px solid var(--line); }
.dr-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.dr-body { flex: 1; overflow: auto; padding: 20px 24px 28px; padding-right: max(24px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 16px; }
.dr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; padding-right: max(24px, env(safe-area-inset-right, 0px)); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 1px solid var(--line); }
.dr-actions { display: flex; gap: 8px; }
.danger-text { color: var(--bad); }
.danger-text:hover { background: var(--bad-soft); color: var(--bad); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.fld.span2 { grid-column: 1 / -1; }
.fld-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.fld-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.req { color: var(--bad); }
.fld .hint { font-size: 12px; color: var(--ink-3); }
.fld .err { font-size: 12px; color: var(--bad); }
.fld .err:empty { display: none; }
.fld.invalid .inp, .fld.invalid .cbx-field .inp { border-color: var(--bad); background: var(--bad-soft); }
.fld textarea.inp { height: auto; min-height: 72px; padding: 8px 11px; resize: vertical; }
.inp.num { text-align: right; font-variant-numeric: tabular-nums; }
select.inp { padding-right: 28px; }
.inp[disabled] { background: var(--paper-2); color: var(--ink-3); }
.ro { min-height: 36px; display: flex; align-items: center; padding: 0 11px; border-radius: 8px; background: var(--paper-2); border: 1px dashed var(--line-2); color: var(--ink-2); }
.alert.info { background: var(--navy-soft); color: var(--link); }
.seg { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; gap: 2px; height: 36px; max-width: 100%; }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: flex; align-items: center; padding: 0 14px; border-radius: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg input:disabled + span { cursor: default; opacity: .7; }

/* smart-search dropdown */
.cbx { position: relative; }
.cbx-field { position: relative; }
.cbx-input { padding-right: 52px; }
.cbx-clear, .cbx-caret { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; color: var(--ink-3); }
.cbx-clear { right: 28px; width: 22px; height: 22px; border: 0; background: transparent; border-radius: 5px; padding: 0; }
.cbx-clear:hover { background: var(--hover); color: var(--ink); }
.cbx-clear svg.i { width: 14px; height: 14px; }
.cbx-caret { right: 8px; pointer-events: none; }
.cbx-caret svg.i { width: 15px; height: 15px; }
/* the list floats over the page (fixed; Combobox.place() sets where, how wide and how high): no table or form cuts it */
.cbx-list { position: fixed; z-index: 90; top: 0; left: 0; width: max-content; box-sizing: border-box; margin: 0; padding: 4px; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.cbx-opt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.cbx-opt.active, .cbx-opt:hover { background: var(--hover); }
.cbx-opt[aria-selected="true"] .cbx-l { font-weight: 600; }
/* the name comes first: when the row is short, the hint (company, ΑΦΜ, unit…) gives way down to a few letters with «…»,
   and only then is the name shortened */
.cbx-l { flex: 0 0 auto; min-width: 0; max-width: calc(100% - 3.5em - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbx-l:only-child { max-width: 100%; }
.cbx-h { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; flex: 0 1 auto; min-width: 3.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.cbx-msg { padding: 8px 9px; font-size: 12.5px; color: var(--ink-3); }
.cbx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cbx-chips:empty { display: none; }
.cbx.disabled .cbx-caret { opacity: .5; }

/* rights matrix */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.params { padding: 14px 16px; }
.matrix-card { min-height: 200px; }
.matrix-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.matrix-scroll { overflow-x: auto; }
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.matrix th, .matrix td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.matrix thead th { font-size: 12px; color: var(--ink-3); font-weight: 500; position: sticky; top: 0; background: var(--paper-2); }
.matrix .c { text-align: center; }
.matrix tr.sec th { background: var(--paper-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); font-weight: 600; padding-top: 12px; }
.matrix tbody th { font-weight: 500; }
.matrix .m-label { display: block; }
.matrix .m-key { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.matrix tr.restricted { background: var(--warn-soft); }
.matrix input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }

/* dialog */
.dialog { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.dlg-scrim { position: absolute; inset: 0; background: var(--scrim); }
.dlg { position: relative; width: min(460px, 100%); max-height: calc(100% - 16px); display: flex; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.dlg-form { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.dlg-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 10px; }
.dlg-h h2 { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.dlg-b { padding: 4px 18px 16px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--paper-2); }
.dlg-p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* toasts */
.toasts { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: calc(100vw - 32px); }
/* Toasts carry no controls: clicks pass through, and with a form open they sit above its button bar. */
body:has(.drawer) .toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.toast { pointer-events: none; display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: var(--paper); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px; max-width: 440px; transition: opacity .2s, transform .2s; }
.toast svg.i { width: 17px; height: 17px; margin-top: 1px; }
.toast.out { opacity: 0; transform: translateY(6px); }
.t-sub { opacity: .75; font-size: 12px; margin-top: 2px; }

/* ---- documents & payments: wider panels, sections, lines, totals, details view */
.drawer-panel.dw-md { width: min(760px, 100%); }
.drawer-panel.dw-lg { width: min(1000px, 100%); }
.drawer-panel.dw-xl { width: min(1220px, 100%); }
/* «Όλο το πλάτος» (the user's choice, Drawer.js bindWidth): over the whole screen, whatever the panel's own width */
.drawer-panel.dw-full { width: 100%; }
.dr-btns { display: flex; align-items: center; gap: 2px; flex: none; }
/* a narrow screen: every panel already takes the whole width */
@media (max-width: 720px) { .dr-wide { display: none; } }
.dr-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kbd-hint { font-size: 12px; color: var(--ink-3); }
.fsec { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.fsec > .fgrid { background: none; border: 0; border-radius: 0; padding: 0; }
.fsec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fsec-h h3 { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.fsec-h h3 svg.i { width: 16px; height: 16px; color: var(--brass); }
.fsec.ig { border-color: var(--brass); background: linear-gradient(var(--brass-soft), var(--paper) 70%); }
.fgrid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fgrid.g1 { grid-template-columns: minmax(0, 1fr); }
.fld.span3 { grid-column: 1 / -1; }
.fld .hint.warn { color: var(--warn); }
.fld .hint.similar { color: var(--warn); display: flex; gap: 6px; align-items: flex-start; }
.fld .hint.similar[hidden] { display: none; }
.fld .hint.similar svg.i { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.fld.locked .cbx-field .inp { background: var(--paper-2); border-style: dashed; }
.party-switch { display: flex; }

.lines-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.lines-wrap > .err { font-size: 12px; color: var(--bad); }
.lines-wrap > .err:empty { display: none; }
.lines-wrap.invalid { outline: 1px solid var(--bad); border-radius: 8px; }
table.lines { width: 100%; border-collapse: separate; border-spacing: 0 6px; min-width: 860px; }
table.lines th { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-align: left; padding: 0 6px 2px; white-space: nowrap; }
table.lines td { padding: 0 3px; vertical-align: middle; }
table.lines .c-cc { width: 22%; }
table.lines .c-vp { width: 92px; }
table.lines .c-num { width: 112px; }
table.lines th.c-num { text-align: right; }
table.lines .c-x { width: 36px; text-align: center; }
table.lines .c-scc { display: none; }
table.lines.with-scc .c-scc { display: table-cell; }
.lockbtn { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; padding: 0; vertical-align: middle; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--ink-3); cursor: pointer; }
.lockbtn .i { width: 13px; height: 13px; }
.lockbtn:hover { border-color: var(--line-2); color: var(--ink); }
.lockbtn.on { color: var(--warn); border-color: var(--warn); background: var(--warn-soft, transparent); }
table.lines .cbx-field .inp { height: 30px; font-size: 13px; }
table.lines td.invalid .inp { border-color: var(--bad); background: var(--bad-soft); }
.line-total { display: block; text-align: right; font-variant-numeric: tabular-nums; padding: 0 8px; color: var(--ink-2); font-weight: 500; }
tr.line-err td { font-size: 12px; color: var(--bad); padding: 0 6px 4px; }

/* purchase lines (Αγορές): product, quantity, price, discount, VAT %, amounts, cost centre; the product's details under */
table.pl-lines { min-width: 1040px; }
table.pl-lines .c-q { width: 84px; }
table.pl-lines .c-p { width: 100px; }
table.pl-lines .c-d { width: 136px; }
table.pl-lines .c-vp { width: 58px; }
table.pl-lines td.c-vp { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; padding-right: 8px; }
table.pl-lines .c-num { width: 92px; }
table.pl-lines .c-cc { width: 18%; }
table.pl-lines th.c-vp, table.pl-lines th.c-q, table.pl-lines th.c-p { text-align: right; padding-right: 10px; }
table.pl-lines td.invalid .cbx-field .inp { border-color: var(--bad); background: var(--bad-soft); }
.pl-disc { display: flex; gap: 4px; }
.pl-disc .inp:first-child { flex: 1; min-width: 0; }
.pl-disc select.inp { width: 50px; flex: none; padding: 0 2px 0 8px; }
.line-total.pl-total { color: var(--ink); font-weight: 600; }
tr.pl-info td { padding: 0 6px; }
tr.pl-info.empty { display: none; }
.pl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--ink-2); margin-top: -4px; }
.pl-meta .pill { height: 20px; font-size: 11.5px; }
.pl-meta .pill svg.i { width: 12px; height: 12px; }
.pl-meta .pill[data-cmp]::before { display: none; }
.pl-read { display: flex; gap: 5px; align-items: center; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; padding-left: 2px; min-width: 0; }
.pl-read svg.i { width: 12px; height: 12px; flex: none; }
.pl-read span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* «Σύνδεση με δαπάνη» of a purchase the legacy app entered */
.lk-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; margin: 10px 0; }
.lk-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 78px 92px 44px; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; }
.lk-row:has(input:checked) { border-color: var(--link); background: var(--navy-soft); }
.lk-doc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-amt { text-align: right; font-variant-numeric: tabular-nums; }
.lk-amt.eq { color: var(--ok); font-weight: 600; }
.lk-row .muted { font-size: 12px; text-align: right; }

.doc-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.doc-bottom > .fgrid { grid-template-columns: minmax(0, 1fr) 180px; }
.totals-card { margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.totals-card div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.totals-card dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.totals-card .grand { border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 2px; font-size: 15px; font-weight: 600; color: var(--ink); }
.totals-card .grand dd { font-family: var(--font-display); font-size: 19px; }
.tag { display: inline-block; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; line-height: 16px; vertical-align: middle; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 12px; color: var(--ink-3); }
.kpi strong { font-family: var(--font-display); font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi.open strong { color: var(--warn); }
.kpi.closed strong { color: var(--ok); }
dl.facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; }
dl.facts div { min-width: 0; }
dl.facts .wide { grid-column: 1 / -1; }
dl.facts dt { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
dl.facts dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl tfoot td { font-weight: 600; border-bottom: 0; }
table.tbl td.act { width: 40px; text-align: right; padding: 2px; }
table.tbl tr.muted-row td { color: var(--ink-3); }
.cheque-sec .fsec-h { flex-wrap: wrap; }
.ib-slot { display: inline-block; width: 30px; height: 30px; flex: none; }
/* Δαπάνες → Σάρωση QR (module scanner) */
.sc-row { display: flex; gap: 8px; align-items: center; }
.sc-row .sc-url { flex: 1; height: 40px; font-size: 14px; }
.sc-row .btn { height: 40px; }
.sc-video { width: 100%; max-height: 320px; border-radius: 10px; background: #000; object-fit: cover; }
.sc-bad { color: var(--bad); }
.sc-lines td.sc-cc, .sc-lines th.sc-cc { width: 34%; min-width: 200px; }
.sc-lines .cbx-field .inp { height: 32px; font-size: 13px; }
.sc-lines td.invalid .inp { border-color: var(--bad); background: var(--bad-soft); }
.sc-lines .err { font-size: 12px; color: var(--bad); }
.sc-lines .err:empty { display: none; }
.sc-code { font-size: 11.5px; }
.sc-all { min-width: 260px; }
.sc-mode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-lines.sc-purchase td.sc-cc, .sc-lines.sc-purchase th.sc-cc { width: 22%; min-width: 180px; }
.sc-lines td.sc-prod, .sc-lines th.sc-prod { width: 28%; min-width: 220px; }
.sc-newp { font-size: 12px; margin-top: 4px; }
.bad-text { color: var(--bad); font-weight: 500; }
/* Σφάλματα δεδομένων: result of a correction */
.er-fixres { margin: 0 0 10px; }
.er-fixres > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.er-fixres ul { margin: 2px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; font-size: 12.5px; }
.er-fixres li { margin: 2px 0; overflow-wrap: anywhere; }
.er-fixprog { font-weight: 500; color: var(--ink); }
/* «Από myDATA»: period, list of the documents received */
.md-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 160px auto; gap: 10px; align-items: end; }
.md-row .fld { gap: 4px; }
.md-row .btn { height: 38px; }
.md-only { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; color: var(--ink-2); cursor: pointer; width: fit-content; }
.md-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.md-table thead th { position: sticky; top: 0; z-index: 1; background: var(--paper-2); }
.md-table td { vertical-align: middle; }
.md-table td.act { text-align: right; white-space: nowrap; }
.md-table tr.on td { background: var(--navy-soft); }
.md-iss { font-weight: 500; }
@media (max-width: 640px) { .md-row { grid-template-columns: 1fr 1fr; } .md-row .fld:first-child, .md-row .btn { grid-column: 1 / -1; } }
.alert .btn.sm { margin-left: auto; flex: none; }
@media (max-width: 640px) { .sc-row { flex-wrap: wrap; } .sc-row .sc-url { flex-basis: 100%; } .sc-lines td.sc-cc { min-width: 160px; } }
/* Αγορές → Είδη: categories tree and supplier codes */
.ct-add { display: flex; gap: 8px; }
.ct-add .inp { flex: 1; }
.ctree, .ctree ul { list-style: none; margin: 0; padding: 0; }
.ctree { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.ctree ul { margin-left: 14px; padding-left: 12px; border-left: 1px dashed var(--line-2); }
.ct-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; min-width: 0; }
.ct-row .inp { height: 32px; flex: 1; min-width: 140px; }
.ct-row .inp.invalid { border-color: var(--bad); background: var(--bad-soft); }
.ct-new .inp { border-style: dashed; border-color: var(--brass); }
.ct-n { flex: none; min-width: 74px; text-align: right; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-acts { display: flex; gap: 1px; flex: none; }
.ct-acts .ib { width: 28px; height: 28px; }
.ct-acts .ib svg.i { width: 16px; height: 16px; }
.ct-acts .ib:disabled { opacity: .3; cursor: default; background: transparent; }
.ct-empty { color: var(--ink-3); padding: 10px 2px; font-size: 13px; }
table.pcodes { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
table.pcodes th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 0 6px 2px; white-space: nowrap; }
table.pcodes td { padding: 0 3px; vertical-align: top; }
table.pcodes .c-code { width: 34%; }
table.pcodes .c-x { width: 36px; text-align: center; }
table.pcodes .cbx-field .inp, table.pcodes .inp { height: 32px; font-size: 13px; }
table.pcodes td.invalid .inp { border-color: var(--bad); background: var(--bad-soft); }
table.pcodes .err { font-size: 12px; color: var(--bad); padding: 2px 4px 0; }
table.pcodes .err:empty { display: none; }
@media (max-width: 640px) { .ct-n { display: none; } .ctree ul { margin-left: 6px; padding-left: 8px; } }
.fld.is-hidden { display: none; }
/* payroll bulk entry */
.pay-head { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)) auto; gap: 12px 14px; align-items: start; }
.pay-head .fld-btn .btn { height: 36px; }
.pay-totals { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.pay-totals em { font-style: normal; color: var(--ink-3); margin-right: 4px; }
table.pay-table { min-width: 1120px; table-layout: fixed; }
table.pay-table .c-emp { width: 168px; }
table.pay-table .c-d { width: 120px; }
table.pay-table .c-days { width: 52px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }
table.pay-table .c-rs { width: 144px; }
table.pay-table .c-num { width: 84px; }
table.pay-table .c-cm { width: 104px; }
table.pay-table input[type="date"] { padding: 0 6px; font-size: 12.5px; }
.count-note { color: var(--ink-3); }
table.pay-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; padding-right: 8px; }
table.pay-table .emp { font-weight: 500; font-size: 13px; line-height: 1.25; }
table.pay-table .hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
table.pay-table input[readonly] { background: var(--paper-2); color: var(--ink-2); }
/* Μισθοδοσία/Ημέρα (module daily_payroll) */
.dp-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.dp-month { display: flex; align-items: center; gap: 2px; }
.dp-month .inp { width: 170px; }
svg.i.flip { transform: rotate(180deg); }
.dp-company { width: 260px; }
.dp-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.dp-month-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dp-runs .btn.sm { margin-left: 8px; }
table.dp-table > thead > tr > th, table.dp-table > tbody > tr > td, table.dp-table > tfoot > tr > td { white-space: nowrap; }
table.dp-table > tbody > tr > td { padding: 5px 8px; }
table.dp-table > tbody > tr > td:first-child { white-space: normal; min-width: 160px; }
table.dp-table .emp { font-weight: 500; }
table.dp-table .hint { font-size: 11.5px; color: var(--ink-3); }
table.dp-table .inp.sm { height: 30px; width: 88px; text-align: right; font-size: 12.5px; padding: 0 8px; }
table.dp-table td.invalid .inp { border-color: var(--bad); background: var(--bad-soft); }
table.dp-table td.act { width: 76px; text-align: right; padding: 2px 4px; }
table.dp-table tfoot td { font-weight: 600; }
tr.dp-days > td { background: var(--paper-2); padding: 6px 10px 10px; white-space: normal; }
table.dp-sub { font-size: 12.5px; table-layout: auto; }
table.dp-sub td:nth-child(9) { white-space: normal; overflow-wrap: anywhere; }
table.dp-sub td, table.dp-sub th { padding: 4px 8px; }
table.dp-sub tr.dp-done td { color: var(--ink-3); }
.dp-head { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)) auto minmax(120px, 1fr); gap: 12px 14px; align-items: start; }
.dp-head .fld-btn .btn { height: 36px; }
table.dp-entry { min-width: 1120px; table-layout: fixed; }
table.dp-entry .c-emp { width: 200px; }
table.dp-entry .c-d { width: 128px; }
table.dp-entry .c-t { width: 100px; }
table.dp-entry .c-h { width: 56px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }
table.dp-entry .c-num { width: 92px; }
table.dp-entry .c-cm { width: 150px; }
table.dp-entry input[type="date"], table.dp-entry input[type="time"] { padding: 0 6px; font-size: 12.5px; }
table.dp-entry .emp { font-weight: 500; font-size: 13px; line-height: 1.25; }
table.dp-entry .hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
@media (max-width: 900px) { .dp-actions { margin-left: 0; } .dp-company { width: 100%; } .dp-head { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
tr.grp-row td { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brass); padding: 10px 6px 2px; }
.warn-text { color: var(--warn); }
/* filter totals can reach millions: slightly smaller type so they fit the money columns */
.grid .ag-row.pinned-total .ag-cell { font-size: 12.5px; padding-left: 6px; padding-right: 8px; }

/* contracts: «Νέο συμβόλαιο» wizard, documents of a contract */
.cw-split, .cw-tools, .cw-tool { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cw-tools { gap: 10px 22px; padding: 2px 0; }
.cw-lbl { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.cw-split .btn.on { border-color: var(--brass); background: var(--brass-soft); color: var(--ink); font-weight: 600; }
.cw-split select { width: auto; }
.cw-tool select { width: auto; }
.cw-tool input { width: 130px; }
.fgrid.cw-all { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; background: none; border: 0; }
table.cw-lines { min-width: 1060px; table-layout: fixed; }
table.cw-lines .c-no { width: 34px; text-align: right; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; padding-right: 6px; }
table.cw-lines .c-d { width: 138px; }
table.cw-lines .c-days { width: 40px; text-align: center; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
table.cw-lines .c-doc { width: 150px; }
table.cw-lines .c-num { width: 112px; }
table.cw-lines .c-cc { width: auto; }
table.cw-lines .c-cm { width: 150px; }
table.cw-lines .inp { height: 30px; font-size: 13px; }
table.cw-lines input[type="date"] { padding: 0 6px; font-size: 12.5px; }
table.cw-lines td.invalid .inp { border-color: var(--bad); background: var(--bad-soft); }
.cw-empty { font-size: 13px; color: var(--ink-3); margin: 6px 2px; }
.cw-sum { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.cw-sum:empty { display: none; }
.cw-sum em { font-style: normal; color: var(--ink-3); margin-right: 5px; }
.cw-sum .warn-text { display: inline-flex; align-items: center; gap: 5px; }
.cw-sum .warn-text svg.i { width: 15px; height: 15px; }
table.cd-docs tbody tr.cd-row { cursor: pointer; }
table.cd-docs tbody tr.cd-row:hover td, table.cd-docs tbody tr.cd-row:focus-visible td { background: var(--paper-2); }

/* imports (myDATA) */
.im-queue { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.im-q-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.im-q-h h2 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; margin: 0; }
.im-q-h h2 svg.i { width: 16px; height: 16px; color: var(--brass); }
.im-q-sub { font-size: 12.5px; color: var(--ink-3); }
.im-q-list { display: flex; flex-wrap: wrap; gap: 8px; }
.im-q-item { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--paper-2); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; color: var(--ink); font-size: 13px; }
.im-q-item:hover, .im-q-item:focus-visible { border-color: var(--brass); }
.im-q-item .im-q-k { color: var(--ink-3); font-size: 12px; }
.im-q-item strong { font-variant-numeric: tabular-nums; color: var(--warn); }
.im-help { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin: 0; }
.im-report { margin-top: 14px; }
.im-sub { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.im-list { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.im-tabs { margin-bottom: 4px; align-self: flex-start; }
table.im-check td { vertical-align: top; }
table.im-check tr.im-wait td { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.im-probs { margin: 4px 0 0; padding-left: 16px; font-size: 12px; color: var(--warn); }
table.im-map td { vertical-align: top; }
table.im-map select { width: 100%; min-width: 180px; }
.im-other { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.im-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.im-filter .inp { width: 230px; }
.im-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.im-fill { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.im-fill select { width: 200px; }
/* module erp: the format of a profile, the outlet / category matches and the rules */
.im-format { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.im-format select { width: 300px; max-width: 100%; }
.im-erp-rules { margin-top: 10px; }
/* module import_rules: the rules of a myDATA profile */
.im-rules .fgrid { margin-bottom: 12px; }
.im-rules .im-sub { margin-top: 10px; }
.im-rules table.im-map .inp { width: 100%; }
.im-rules table.im-map td.c-chk { width: 130px; text-align: center; vertical-align: middle; }
.im-rules table.im-map td.c-x { width: 44px; vertical-align: middle; }
.im-rules table.im-map th.c-afm, .im-rules table.im-map td.c-afm { width: 190px; }
.im-rules > .btn.sm { margin-top: 6px; align-self: flex-start; }

/* module stock_valuation: «Καρτέλα είδους» */
.pcard-head { display: flex; align-items: center; gap: 10px; }
.pcard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; }
.pcard-i { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pcard-i.wide { grid-column: span 2; }
.pcard-i strong { font-weight: 500; overflow-wrap: anywhere; }
.pcard-i .chip { padding-right: 10px; margin: 0 4px 4px 0; }
.pcard-moves tbody tr.pcard-count td { background: var(--paper-2); }
.pcard-moves tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); }
@media (max-width: 760px) { .pcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pcard-i.wide { grid-column: span 2; } }

/* data errors */
.er-bar { margin-bottom: 14px; }
.er-hint { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--ink-3); }
.er-kpis { margin-bottom: 14px; }
.kpi.bad-kpi strong { color: var(--bad); }
.kpi .er-prog { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.er-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.er-list { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 8px; max-height: calc(100vh - 120px); overflow: auto; }
.er-group { display: flex; flex-direction: column; gap: 2px; }
.er-gh { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brass); padding: 8px 8px 4px; }
.er-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.er-item:hover { background: var(--paper-2); }
.er-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.er-item.on { background: var(--paper-2); border-color: var(--line-2); font-weight: 500; }
.er-item.clean .er-t { color: var(--ink-3); }
.er-dot { width: 8px; height: 8px; border-radius: 50%; }
.er-dot.error { background: var(--bad); }
.er-dot.warning { background: var(--warn); }
.er-t { line-height: 1.3; }
.er-n { font-size: 12px; font-variant-numeric: tabular-nums; border-radius: 10px; padding: 1px 8px; font-weight: 600; white-space: nowrap; }
.er-n.error { background: var(--bad-soft); color: var(--bad); }
.er-n.warning { background: var(--warn-soft, var(--paper-2)); color: var(--warn); }
.er-n.ok { color: var(--ok); padding: 0 4px; }
.er-n.ok svg.i { width: 15px; height: 15px; }
.er-n.busy { color: var(--ink-3); font-weight: 400; }
.er-n.bad { color: var(--bad); }
.er-detail { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-height: 420px; }
.er-head h2 { font-size: 18px; margin: 8px 0 4px; }
.er-why { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; max-width: 900px; }
.er-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.er-cnt { font-size: 13px; color: var(--ink-2); }
.er-grid { height: 520px; }
.er-grid .ag-cell.num { text-align: right; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.er-grid .ag-cell.neg { color: var(--bad); }
.er-grid .ag-header-cell.num-h .ag-header-cell-label { justify-content: flex-end; }
@media (max-width: 1100px) { .er-layout { grid-template-columns: minmax(0, 1fr); } .er-list { position: static; max-height: none; } }

/* responsive */
@media (max-width: 1100px) {
  .pay-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dl.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app, .app.rail-hidden { grid-template-columns: minmax(0, 1fr); }
  .rail, .app.rail-hidden .rail { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease; padding: env(safe-area-inset-top, 0px) 10px 0 max(14px, env(safe-area-inset-left, 0px)); visibility: visible; }
  .app.rail-open .rail { transform: none; }
  .app.rail-open .rail-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 55; }
  .topbar, .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .u-txt { display: none; }
  .user { padding-left: 8px; }
  .page-head h1 { font-size: 20px; }
  .ph-text .eyebrow, .ph-sub { display: none; }
  .toolbar .search { flex: 1 1 100%; }
}
@media (max-width: 600px) {
  .grid .ag-paging-page-size, .grid .ag-paging-row-summary-panel { display: none; }
  .fgrid { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .fgrid.g3, .fgrid.g2, .doc-bottom > .fgrid, .pay-head { grid-template-columns: minmax(0, 1fr); }
  .fsec { padding: 14px; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  .kbd-hint { display: none; }
  .dr-head, .dr-body, .dr-foot { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------ record history (Ctrl+click on a row button) */
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.hist-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; font-size: 13px; margin-bottom: 10px; }
.hist-sum > span:first-child { font-weight: 600; }
.hist-sum .chk { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.hist-wrap { border: 1px solid var(--line); border-radius: 10px; max-height: calc(100vh - 230px); overflow: auto; }
table.hist { width: auto; min-width: 100%; }
table.hist thead th { position: sticky; top: 0; z-index: 2; background: var(--paper-2); vertical-align: top; }
table.hist th.fl { position: sticky; left: 0; z-index: 1; background: var(--paper); font-weight: 500; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; border-right: 1px solid var(--line); }
table.hist thead th.fl { z-index: 3; background: var(--paper-2); }
table.hist th.ev { min-width: 190px; font-weight: 500; color: var(--ink-2); white-space: normal; }
table.hist .ev-n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
table.hist .ev-d { font-size: 12.5px; color: var(--ink); margin-top: 3px; font-variant-numeric: tabular-nums; }
table.hist .ev-u { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
table.hist td { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 340px; vertical-align: top; }
table.hist td.na { color: var(--ink-3); }
table.hist td.chg { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); }
table.hist.only-chg tbody tr:not(.has-chg) { display: none; }
.tag.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.empty-note { display: flex; gap: 12px; align-items: flex-start; padding: 18px; border: 1px dashed var(--line-2); border-radius: 10px; color: var(--ink-2); }
.empty-note > svg.i { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.empty-note p { margin: 4px 0 0; font-size: 13px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.dlg-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
@media (max-width: 1400px) and (min-width: 901px) { .tb-right .bt { display: none; } .tb-right .btn:has(.bt) { padding-inline: 9px; } }
/* name days in the top bar (legacy «εορτολόγιο») */
.tb-sp { display: flex; align-items: center; min-width: 0; padding-inline: 12px; }
.namedays { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 560px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.namedays svg.i { width: 14px; height: 14px; flex: none; color: var(--warn); }
.namedays .nd-l { flex: none; }
.namedays .nd-n { color: var(--ink-2); font-style: italic; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .namedays { display: none !important; } }
/* licence of the installation (legacy header): warning chip in the top bar, line in the menu footer */
.tb-sp #license { flex: none; margin-left: 12px; }
.rail-foot.lic-warn { color: var(--warn); }
.dlg-stack { display: grid; gap: 12px; }

/* ------------------------------------------------------------ reports (Αναφορές) */
.rp-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.rp-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-f.rp-company, .rp-f.rp-employee { width: 250px; }
.rp-f.rp-party { width: 300px; }
.rp-f.rp-date { width: 150px; }
.rp-f.rp-enum { width: auto; min-width: 150px; max-width: 280px; }
.rp-f.rp-enum .inp { width: auto; min-width: 100%; max-width: 100%; } /* as wide as its longest choice */
.rp-f.rp-text { width: 160px; }
.rp-f .inp { height: 34px; }
.rp-f.invalid .inp, .rp-f.invalid .cbx-field .inp { border-color: var(--bad); background: var(--bad-soft); }
.rp-actions { display: flex; gap: 6px; margin-left: auto; }
/* saved views of a report's parameters (e.g. the pivot) */
.rp-views { flex-basis: 100%; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--line); }
.rp-views select.inp { height: 34px; width: 280px; max-width: 100%; }
.btn.busy { opacity: .7; pointer-events: none; }
.rp-host { flex: 1; min-height: 0; display: flex; }
.rp-grid { flex: 1; height: calc(100vh - 250px); min-height: 360px; }
.rp-empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 8px; padding: 48px 16px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--ink-3); text-align: center; }
.rp-empty svg.i { width: 28px; height: 28px; }
.rp-empty p { margin: 0; font-size: 13.5px; }
.rp-notes { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.rp-grid .ag-header-group-cell.rp-group { justify-content: center; font-weight: 600; border-bottom: 1px solid var(--line); }
.rp-grid .ag-row.rp-open { background: var(--paper-2); font-style: italic; }
.rp-grid .ag-row.rp-sum { background: var(--paper-2); font-weight: 600; }
.rp-grid .ag-row.rp-total { background: var(--navy-soft); font-weight: 700; }
.rp-grid .ag-row.rp-head { background: var(--paper-2); font-weight: 600; }
.rp-grid .ag-row.rp-link { cursor: pointer; }
/* a group that opens with a click (e.g. a cost centre of the payroll report); lines for information only */
.rp-grid .ag-row.rp-grp { background: var(--paper-2); font-weight: 600; color: var(--link); cursor: pointer; }
.rp-grid .ag-row.rp-grp:hover { background: var(--hover); }
.rp-grid .ag-row.rp-info { color: var(--ink-2); font-style: italic; }
.rp-grp-mark { display: inline-block; width: 1.1em; color: var(--ink-3); }
.rp-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-tools:empty, .rp-tools:not(:has(> :not([hidden]))) { display: none; }
/* a column left out of the printout (a click on its title, legacy .col) */
.rp-grid .ag-header-cell { cursor: pointer; }
.rp-grid .ag-header-cell.rp-noprint, .rp-grid .ag-cell.rp-noprint { opacity: .42; }
.rp-grid .ag-header-cell.rp-noprint .ag-header-cell-text { text-decoration: line-through; }
.rp-noprint-note { font-size: 12.5px; color: var(--ink-3); }
.linkish { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-decoration: underline; }
.rp-grid .ag-cell.neg { color: var(--bad); }
.rp-print-head h2 { margin: 0 0 6px; font-size: 16px; }
.rp-print-head dl { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 8px; font-size: 12px; }
.rp-print-head dt { color: #555; display: inline; }
.rp-print-head dd { display: inline; margin: 0 0 0 4px; font-weight: 600; }
@media (max-width: 900px) {
  .rp-f.rp-company, .rp-f.rp-employee, .rp-f.rp-party, .rp-f.rp-date, .rp-f.rp-enum, .rp-f.rp-text { width: 100%; }
  .rp-actions { margin-left: 0; width: 100%; }
}
@media print {
  body.printing-report .rail, body.printing-report .topbar, body.printing-report .rp-bar, body.printing-report .page-head,
  body.printing-report .toasts, body.printing-report .rp-notes, body.printing-report .rp-tools { display: none !important; }
  body.printing-report .rp-print-head { display: block !important; }
  body.printing-report .app, body.printing-report .main, body.printing-report .content { display: block !important; height: auto !important; overflow: visible !important; padding: 0 !important; }
  body.printing-report .rp-grid { height: auto !important; }
  body.printing-report .rp-print-head[hidden] { display: block !important; }
}
.drawer-panel:focus { outline: none; }
.rp-f.rp-section, .rp-f.rp-cost_center, .rp-f.rp-method, .rp-f.rp-tour { width: 250px; }
.rp-f.rp-contract { width: 340px; }
.rp-f.rp-method { width: 300px; }
.rp-f.rp-bank { width: 220px; }
.rp-grid .ag-cell.num { text-align: right; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.rp-grid .ag-header-cell.num-h .ag-header-cell-label { justify-content: flex-end; }
.rp-grid .ag-header-cell.num-h .ag-header-cell-text { text-align: right; }
.rp-f.rp-etype { width: 220px; }
/* report chart (one series, sign by direction); colours validated for the light / dark surfaces */
:root { --chart-pos: #2a78d6; --chart-neg: #e34948; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-pos: #3987e5; --chart-neg: #e66767; } }
:root[data-theme="dark"] { --chart-pos: #3987e5; --chart-neg: #e66767; }
.rp-view { align-self: flex-start; }
.rp-chart { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.ch-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.ch-row { display: grid; grid-template-columns: minmax(120px, 260px) minmax(0, 1fr) 120px; align-items: center; gap: 12px; padding: 3px 4px; border-radius: 6px; }
.ch-row:hover { background: var(--hover); }
.ch-l { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-track { position: relative; height: 18px; }
.ch-zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.ch-bar { position: absolute; top: 2px; height: 14px; }
.ch-bar.pos { background: var(--chart-pos); border-radius: 0 4px 4px 0; }
.ch-bar.neg { background: var(--chart-neg); border-radius: 4px 0 0 4px; }
.ch-v { font-size: 12.5px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
/* ---------- Tickets · Έλεγχος κινήσεων ---------- */
.pill.info { color: var(--link); background: var(--navy-soft); }
/* legacy colours of a task's deadline: red under 3 days (or past), yellow under 5 */
.grid .ag-row.row-red { background: var(--bad-soft); }
.grid .ag-row.row-yellow { background: var(--warn-soft); }
.grid .ag-row.row-red .ag-cell[col-id="deadline"] { color: var(--bad); font-weight: 600; }
.grid .ag-row.row-yellow .ag-cell[col-id="deadline"] { color: var(--warn); font-weight: 600; }
/* a task with comments: a dot on its conversation button (legacy: with_history) */
.row-actions .ib.has-dot { position: relative; }
.row-actions .ib.has-dot::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 2px var(--paper); }
/* top bar: «Οι εργασίες μου» (the legacy start page) */
.tb-tasks { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 12.5px; font-weight: 600; flex: none; }
.tb-tasks:hover { background: var(--hover); color: var(--ink); }
.tb-tasks svg.i { width: 18px; height: 18px; }
.tb-tasks-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--navy-soft); color: var(--link); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tb-tasks.urgent .tb-tasks-n { background: var(--bad); color: var(--paper); }
/* a task: who, to whom, when; then its conversation (the user's own comments on the right, as the legacy screen) */
.tk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); font-size: 13px; }
.tk-head > span { display: inline-flex; align-items: center; gap: 6px; }
.tk-head svg.i { width: 15px; height: 15px; color: var(--ink-3); }
.tk-dl.row-red, .tk-dl.row-red svg.i { color: var(--bad); font-weight: 600; }
.tk-dl.row-yellow, .tk-dl.row-yellow svg.i { color: var(--warn); font-weight: 600; }
.tk-count { font-size: 11.5px; color: var(--ink-3); text-align: right; margin-top: 2px; }
.tk-thread { list-style: none; margin: 8px 0 0; padding: 2px; display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow: auto; }
.tk-msg { max-width: 80%; align-self: flex-start; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.tk-msg.own { align-self: flex-end; background: var(--navy-soft); border-color: transparent; border-radius: 12px 12px 4px 12px; }
.tk-meta { font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; }
.tk-meta strong { color: var(--ink-2); font-weight: 600; }
.tk-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.tk-empty { padding: 4px 2px; font-size: 13px; }
.tk-new { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.tk-new.invalid .inp { border-color: var(--bad); background: var(--bad-soft); }
.tk-new .err { font-size: 12px; color: var(--bad); }
.tk-new .err:empty { display: none; }
.tk-new-a { display: flex; justify-content: flex-end; }
/* Έλεγχος κινήσεων: one entry with every field it logged */
dl.zl-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 4px; }
table.zl-fields th { width: 38%; white-space: normal; font-size: 12.5px; font-weight: 500; color: var(--ink-2); vertical-align: top; }
table.zl-fields td { overflow-wrap: anywhere; }
/* ---------- Διαχείριση έργων: υλικά, εργασίες, προβολή έργου ---------- */
table.dl-lines .c-prod { min-width: 220px; }
table.dl-lines .c-desc { min-width: 160px; }
table.dl-lines .c-q, table.dl-lines .c-p { width: 110px; }
table.dl-lines .c-u { width: 96px; font-size: 12.5px; }
table.dl-lines .c-ch { width: 64px; text-align: center; }
table.dl-lines .dl-ch { width: 16px; height: 16px; accent-color: var(--primary); vertical-align: middle; }
/* a line only for the cost (υλικό κατασκευής): not charged */
table.dl-lines tr.cost-only td { background: var(--paper-2); }
table.dl-lines tr.cost-only .inp[data-c="price"]::placeholder { color: var(--ink-3); font-style: italic; }
table.dl-lines td { padding: 4px 4px; }
table.dl-lines td.invalid .inp, table.dl-lines td.invalid .cbx-field .inp { border-color: var(--bad); background: var(--bad-soft); }
table.dl-lines tr.dl-info td { padding: 0 6px 6px; font-size: 12px; border-bottom: 1px solid var(--line); }
table.dl-lines tr.dl-line:has(+ tr.dl-info) td { border-bottom: 0; }
table.pv-mat td { font-size: 12.5px; }
table.pv-mat .muted { color: var(--ink-3); }
table.pv-mat .pv-co { height: 18px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.kpi .kpi-sub { font-size: 11.5px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* segmented control with buttons (tabs) */
.seg > button { display: flex; align-items: center; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.seg > button.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.seg > button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* project page: correction mode, PDF columns */
.pv-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pv-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
table.pv-mat.editing .pv-in { width: 92px; height: 30px; padding: 0 6px; text-align: right; }
table.pv-mat.editing .pv-disc { width: 64px; }
table.pv-mat td.invalid .pv-in { border-color: var(--bad); background: var(--bad-soft); }
.pv-note { margin: 4px 2px 0; font-size: 12px; }
.pv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
/* Πελάτες (module mobile) */
.cu-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.cu-bar .search { position: relative; flex: 1 1 280px; max-width: 420px; }
.cu-bar .search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.cu-bar .search .inp { padding-left: 34px; }
.cu-found { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.cu-found-h { font-size: 12px; margin-bottom: 4px; }
.cu-list { list-style: none; margin: 0; padding: 0; }
.cu-list li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; position: relative; }
.cu-list li:last-child { border-bottom: 0; }
.cu-day { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin-bottom: 10px; }
.cu-day summary { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 4px 0; }
.cu-day .cu-list li { flex-direction: column; gap: 2px; }
.cu-l1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cu-aside { font-size: 12px; }
.cu-empty { text-align: center; padding: 24px 0; }
.cu-body { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px; }
.cu-body:has(.cu-day), .cu-body:has(.cu-empty) { background: none; border: 0; padding: 0; }
table.cu-tbl th[scope="row"] { font-weight: 500; }
tr.cc-link { cursor: pointer; }
tr.cc-link:hover td, tr.cc-link:hover th { background: var(--hover); }
.cc-head { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); font-size: 13px; }
.cc-head .muted { font-size: 12px; margin-right: 4px; }
.cc-tabs { margin-top: 2px; overflow-x: auto; }
.cc-ledger-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
table.cc-ledger .chk-col { width: 34px; text-align: center; }
table.cc-ledger tr.cc-receipt td { color: var(--ok); }
table.cc-ledger tfoot td { font-weight: 600; }
@media (max-width: 600px) {
  .cu-bar .search { max-width: none; }
  .cu-bar .seg { width: 100%; overflow-x: auto; }
  /* the customers as cards */
  table.cu-tbl thead { display: none; }
  table.cu-tbl, table.cu-tbl tbody, table.cu-tbl tr, table.cu-tbl th, table.cu-tbl td { display: block; width: 100%; }
  table.cu-tbl tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  table.cu-tbl td, table.cu-tbl th { border: 0; padding: 2px 4px; text-align: left; }
  table.cu-tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: 12px; }
  table.cu-tbl tfoot { display: none; }
  .pv-actions { width: 100%; }
}
/* top bar on a phone: the licence warning shrinks (whole text in its tooltip), the name days give way */
@media (max-width: 600px) {
  .topbar { gap: 6px; }
  .tb-sp { overflow: hidden; padding-inline: 4px; }
  .tb-sp .namedays { display: none !important; }
  .tb-sp #license { flex: 0 1 auto; min-width: 0; margin-left: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 22px; }
  .tb-sp #license::before { display: none; }
}
@media (max-width: 600px) {
  table.cc-tbl { font-size: 12.5px; }
  table.cc-tbl th:last-child, table.cc-tbl td:last-child { display: none; } /* the comments: on the wider screens */
  table.cc-tbl th, table.cc-tbl td { padding: 6px 5px; }
}
