/* SIGMA/TAF — Agency CRM · minimal premium UI (light & dark) */
:root {
  --accent: #5b5bd6;
  --accent-ink: #fff;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --surface-3: #f1f1ee;
  --line: #e7e6e2;
  --line-2: #efeeea;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #8a8a93;
  --sidebar: #fbfbfa;
  --hover: rgba(24, 24, 27, .045);
  --shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 1px 1px rgba(16, 16, 20, .03);
  --shadow-lg: 0 18px 50px -12px rgba(16, 16, 30, .25), 0 2px 6px rgba(16, 16, 30, .06);
  --r: 10px;
  --r-sm: 7px;
  --green: #16a34a; --red: #dc2626; --amber: #d97706;
  /* σειρές γραφημάτων (επικυρωμένη παλέτα) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --chart-grid: #ecebe7; --chart-ax: #8a8a93;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113; --surface: #18181b; --surface-2: #1d1d21; --surface-3: #232328; --line: #2b2b31; --line-2: #26262b;
    --ink: #f2f2f3; --ink-2: #b4b4bc; --ink-3: #7d7d87; --sidebar: #141416; --hover: rgba(255, 255, 255, .05);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 20px 60px -10px rgba(0, 0, 0, .7);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --chart-grid: #2a2a30; --chart-ax: #7d7d87; color-scheme: dark;
    --green: #22c55e; --red: #f05252; --amber: #f59e0b;
  }
}
:root[data-theme="dark"] {
  --bg: #111113; --surface: #18181b; --surface-2: #1d1d21; --surface-3: #232328; --line: #2b2b31; --line-2: #26262b;
  --ink: #f2f2f3; --ink-2: #b4b4bc; --ink-3: #7d7d87; --sidebar: #141416; --hover: rgba(255, 255, 255, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 20px 60px -10px rgba(0, 0, 0, .7);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --chart-grid: #2a2a30; --chart-ax: #7d7d87; color-scheme: dark;
  --green: #22c55e; --red: #f05252; --amber: #f59e0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
p { margin: 0 0 10px; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-3); padding: 2px 5px; border-radius: 4px; word-break: break-all; }
small { font-size: 12px; }
.muted { color: var(--ink-3); }
.sm { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.r { text-align: right; }
.c { text-align: center; }
.txt-red { color: var(--red); } .txt-green { color: var(--green); } .txt-amber { color: var(--amber); }
[hidden] { display: none !important; }
.ico { width: 17px; height: 17px; flex: 0 0 auto; }
.inline { display: inline; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--sidebar); border-right: 1px solid var(--line); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; transition: width .18s, flex-basis .18s; z-index: 40; }
.brand { display: flex; align-items: center; gap: 6px; padding: 12px 10px 10px 14px; }
.brand-link { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.glyph { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: 0 0 30px; overflow: hidden; }
.glyph img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-txt strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { color: var(--ink-3); font-size: 11px; }
.nav { overflow-y: auto; padding: 4px 8px 20px; flex: 1; scrollbar-width: thin; }
.nav-group { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 14px 8px 4px; white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; color: var(--ink-2); font-weight: 500; white-space: nowrap; position: relative; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.nav a.on .ico { color: var(--accent); }
.nav a span { overflow: hidden; text-overflow: ellipsis; }
.nb { margin-left: auto; background: var(--red); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 600; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
html.sb-collapsed .sidebar { width: 64px; flex-basis: 64px; }
html.sb-collapsed .brand-txt, html.sb-collapsed .nav-group, html.sb-collapsed .nav a span { display: none; }
html.sb-collapsed .nav a { justify-content: center; }
html.sb-collapsed .nav a .nb { position: absolute; top: 0; right: 2px; min-width: 15px; height: 15px; font-size: 9px; }
html.sb-collapsed .brand { flex-direction: column; padding: 12px 8px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.6) blur(10px); position: sticky; top: 0; z-index: 30; }
.content { padding: 24px 28px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.mob-menu { display: none; }
.sb-backdrop { display: none; }

/* ---------- Search ---------- */
.gsearch { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; }
.gsearch > .ico { position: absolute; left: 11px; color: var(--ink-3); }
.gsearch input { width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px 0 35px; font: inherit; color: var(--ink); }
.gsearch input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.gs-results { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; padding: 6px; }
.gs-results h4 { margin: 8px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.gs-results a { display: block; padding: 7px 10px; border-radius: 7px; }
.gs-results a:hover, .gs-results a.sel { background: var(--hover); }
.gs-results a small { display: block; color: var(--ink-3); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 13px/1 Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.success { background: var(--green); color: #fff; border-color: transparent; }
.btn.danger { background: var(--red); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.ghost.danger { color: var(--red); background: transparent; border-color: var(--line); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.block { width: 100%; }
.btn .ico { width: 15px; height: 15px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.danger:hover { color: var(--red); }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn .nb { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; font-size: 10px; }
.btn-stack { display: flex; flex-direction: column; gap: 8px; }
.btn-stack form { margin: 0; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; }

/* ---------- Avatars & badges ---------- */
.av { width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 650; flex: 0 0 auto; letter-spacing: .02em; }
.av.sm { width: 22px; height: 22px; font-size: 9.5px; }
.av.lg { width: 46px; height: 46px; font-size: 16px; border-radius: 12px; }
.av.sq { border-radius: 12px; }
.av.lg .ico { width: 22px; height: 22px; }
.who { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 550; white-space: nowrap; }
.b-gray { --c: #71717a; } .b-blue { --c: #2563eb; } .b-indigo { --c: #4f46e5; } .b-violet { --c: #7c3aed; } .b-cyan { --c: #0891b2; } .b-green { --c: #16a34a; } .b-amber { --c: #d97706; } .b-red { --c: #dc2626; }
.badge, .cal-e { background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: color-mix(in srgb, var(--c) 82%, var(--ink)); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 600; }
.dot-ok { color: var(--green); font-weight: 700; }
.swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; vertical-align: middle; border: 1px solid var(--line); }
.req { color: var(--red); font-style: normal; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub, .entity-head .sub { color: var(--ink-3); margin: 4px 0 0; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { color: var(--ink-3); font-size: 12.5px; margin-bottom: 4px; }
.crumbs a:hover { color: var(--ink); }
.entity-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.eh-main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.entity-head h1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 12px; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.tabs.views { border: 0; background: var(--surface-3); display: inline-flex; padding: 3px; border-radius: 9px; margin-bottom: 16px; }
.tabs.views a { border: 0; padding: 5px 12px; border-radius: 7px; margin: 0; font-size: 13px; }
.tabs.views a.on { background: var(--surface); box-shadow: var(--shadow); }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-h h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2 + *, .grid-3 + * { margin-top: 16px; }
.grid-2.flat, .grid-3.flat { gap: 28px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 10px; }
.sec-head h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
* + .sec-head { margin-top: 22px; }
.note { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px; color: var(--ink-2); white-space: normal; line-height: 1.6; }
.note.intro { margin-bottom: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lnk { color: var(--accent); }
.lnk:hover { text-decoration: underline; }
.lnk .ico { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis.tight { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpis.col { grid-template-columns: 1fr; align-content: start; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; transition: border-color .12s; }
a.kpi:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.kpi.warn { border-left: 3px solid var(--amber); }
.k-l { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.k-v { font-size: 23px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-v small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.k-s { color: var(--ink-3); font-size: 12px; }
.spark { position: absolute; right: 12px; top: 14px; width: 74px; height: 26px; }
.spark polyline { fill: none; stroke: var(--s1); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* ---------- Progress ---------- */
.prog { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.prog span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.prog.lg { height: 8px; margin-top: 6px; }
td .prog { display: inline-block; width: 70px; vertical-align: middle; margin-right: 6px; }
.load { height: 10px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.load span { display: block; height: 100%; background: var(--green); border-radius: 5px; }
.load.high span { background: var(--amber); }
.load.over span { background: var(--red); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters select, .filters input[type=text], .filters input[type=date] { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; padding: 0 10px; max-width: 220px; }
.f-search { position: relative; display: flex; align-items: center; }
.f-search .ico { position: absolute; left: 10px; color: var(--ink-3); width: 15px; }
.f-search input { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; padding: 0 10px 0 32px; width: 240px; }
.f-date { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; }
.f-text { width: 140px; }
.period { display: flex; gap: 6px; align-items: center; }
.period select, .period input { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; padding: 0 10px; }
.custom-range { display: inline-flex; gap: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 550; color: var(--ink-3); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl th a:hover { color: var(--ink); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href], .tbl tbody tr[data-modal] { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tfoot td { background: var(--surface-2); border-top: 1px solid var(--line); font-weight: 600; }
.card:not(.flush) .tbl th { background: transparent; padding-left: 8px; padding-right: 8px; }
.card:not(.flush) .tbl td { padding-left: 8px; padding-right: 8px; }
.tbl td.act { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: inline-flex; gap: 2px; align-items: center; opacity: .55; transition: opacity .12s; }
tr:hover .row-actions { opacity: 1; }
.tbl.perm td, .tbl.perm th { padding: 8px; }
.tbl small { color: var(--ink-3); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.pager > div { display: flex; gap: 4px; align-items: center; }
.pg { min-width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-2); }
.pg:hover { background: var(--hover); }
.pg.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- Empty ---------- */
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty.sm { padding: 18px; }
.empty-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 10px; color: var(--ink-3); font-size: 20px; }
.empty.big { padding: 90px 20px; }
.empty.big h2 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Forms ---------- */
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 14px; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld > label { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.fld input, .fld select, .fld textarea, .doc-editor input, .doc-editor select, .doc-editor textarea, .comment-form textarea, .add-inline input, .copy input, .stack select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; padding: 8px 10px; min-height: 36px; transition: border-color .12s, box-shadow .12s; }
.fld textarea { resize: vertical; line-height: 1.5; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .doc-editor :is(input, select, textarea):focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.fld input:disabled, .fld select:disabled { background: var(--surface-3); color: var(--ink-3); }
.fld input[type=color] { padding: 3px; height: 36px; }
.fld .help { color: var(--ink-3); font-size: 11.5px; }
.fld.check { justify-content: center; }
.inp-sfx { position: relative; display: flex; }
.inp-sfx input { padding-right: 30px; }
.sfx { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 12.5px; pointer-events: none; }
.sfx-btn { position: absolute; right: 4px; top: 4px; height: 28px; width: 28px; border: 0; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; user-select: none; }
.switch input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; flex: 0 0 34px; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.chips-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-opt { display: inline-flex; cursor: pointer; }
.chip-opt input { position: absolute; opacity: 0; }
.chip-opt span { border: 1px solid var(--line); border-radius: 16px; padding: 4px 11px; font-size: 12.5px; color: var(--ink-2); background: var(--surface); transition: all .12s; }
.chip-opt input:checked + span { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--ink); }
.chip-opt.sm span { padding: 2px 8px; font-size: 11.5px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.form-errors { background: color-mix(in srgb, var(--red) 9%, var(--surface)); color: var(--red); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.alert { padding: 11px 13px; border-radius: 8px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.alert.error { background: color-mix(in srgb, var(--red) 9%, var(--surface)); border-color: color-mix(in srgb, var(--red) 30%, var(--line)); color: var(--red); }
.reveal[hidden] { display: none; }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--ink); width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal::backdrop { background: rgba(10, 10, 15, .42); backdrop-filter: blur(2px); }
.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal-form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px 4px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-loading { padding: 50px; text-align: center; color: var(--ink-3); }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; z-index: 50; display: none; }
.dd-menu.right { left: auto; right: 0; }
.dropdown.open > .dd-menu { display: block; animation: pop .12s ease-out; }
.dd-menu a, .dd-btn { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.dd-menu a:hover, .dd-btn:hover { background: var(--hover); }
.dd-user { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.dd-user small { color: var(--ink-3); }
.notif-menu { width: 360px; padding: 0; }
.nm-head { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.nm-head a { color: var(--accent); font-size: 12.5px; }
.nm-list { max-height: 420px; overflow-y: auto; }
.nm-list a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); border-radius: 0; }
.nm-list a.unread { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.nm-list a.unread strong::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.nm-list strong { display: block; font-weight: 550; font-size: 13px; }
.nm-list span, .nm-list small { display: block; color: var(--ink-3); font-size: 12px; }
.pad { padding: 14px; }
.notif-full { list-style: none; margin: 0; padding: 0; }
.notif-full li a { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.notif-full li.unread a { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.notif-full li.t-warning a { border-left: 3px solid var(--amber); }
.notif-full span, .notif-full small { color: var(--ink-3); }

/* ---------- Timer ---------- */
.timer-pill { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px 0 12px; border-radius: 17px; background: color-mix(in srgb, var(--green) 12%, var(--surface)); color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-title { color: var(--ink-2); font-weight: 500; font-size: 12.5px; max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast, .toast-static { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; animation: pop .2s ease-out; }
.toast.error, .toast-static.error { background: var(--red); color: #fff; }
.toast-static { position: fixed; bottom: 20px; right: 20px; z-index: 100; }

/* ---------- Tooltip ---------- */
.tip { position: fixed; z-index: 200; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.5; pointer-events: none; max-width: 280px; box-shadow: var(--shadow-lg); font-variant-numeric: tabular-nums; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* ---------- Charts ---------- */
.chart-box { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .zero { stroke: var(--ink-3); stroke-width: 1; }
.chart .ax { fill: var(--chart-ax); font-size: 10.5px; font-family: Inter, system-ui, sans-serif; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .pt { opacity: 0; stroke: var(--surface); stroke-width: 2; transition: opacity .1s; }
.chart .pt.on { opacity: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .xhair { stroke: var(--ink-3); stroke-dasharray: 3 3; opacity: 0; }
.chart .bar { transition: opacity .12s; }
.chart:hover .bar { opacity: .6; }
.chart .bar:hover { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--c, currentColor); }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hb-l a:hover { color: var(--accent); }
.hb-t { height: 14px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hb-t span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hb-v { font-weight: 550; min-width: 74px; text-align: right; }

/* ---------- Lists ---------- */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li > a, .mini-list li > span { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-2); border-radius: 6px; }
.mini-list li > a:hover { background: var(--hover); }
.mini-list li:last-child > * { border-bottom: 0; }
.mini-list li > * > span:first-child { min-width: 0; display: flex; flex-direction: column; }
.mini-list small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list li.muted { padding: 8px 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.timeline li > div { display: flex; flex-direction: column; min-width: 0; }
.timeline small { color: var(--ink-3); }
.timeline.compact li { padding: 7px 0; font-size: 13px; }
.dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; margin: 0 0 16px; }
.dl dt { color: var(--ink-3); font-size: 12.5px; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl.stacked { grid-template-columns: 1fr; gap: 2px; }
.dl.stacked dd { margin-bottom: 10px; }
.people { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.people li { display: flex; gap: 10px; align-items: center; }
.people small { display: block; color: var(--ink-3); }
.milestones, .checklist, .comments { list-style: none; margin: 0; padding: 0; }
.milestones li, .checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.milestones li.done strong, .checklist li.done span { text-decoration: line-through; color: var(--ink-3); }
.ms-b { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ms-b small { color: var(--ink-3); }
.ms-ap { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.ms-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0; margin-top: 1px; }
li.done .ms-check { background: var(--green); border-color: var(--green); }
.checklist li { align-items: center; }
.checklist li span { flex: 1; }
.add-inline { display: flex; gap: 8px; margin-top: 10px; }
.comments li { display: flex; gap: 10px; padding: 10px 0; }
.cm-h { display: flex; gap: 8px; align-items: baseline; }
.cm-h small { color: var(--ink-3); }
.cm-b { color: var(--ink-2); margin-top: 2px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px; color: var(--ink-3); cursor: pointer; margin-bottom: 12px; transition: all .12s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.dropzone input { display: none; }
.copy { display: flex; gap: 6px; }

/* ---------- Datepicker ---------- */
.date-inp { font-variant-numeric: tabular-nums; }
.filters .date-inp, .period .date-inp, .f-date .date-inp { width: 118px; }
.dp { z-index: 300; width: 262px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; user-select: none; }
.dp-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dp-h strong { font-size: 13px; }
.dp button { border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; border-radius: 7px; }
.dp-h button { width: 28px; height: 28px; font-size: 18px; line-height: 1; color: var(--ink-2); }
.dp-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-g span, .dp-g button { height: 32px; display: grid; place-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dp-w { color: var(--ink-3); font-size: 11px !important; font-weight: 600; }
.dp-g button:hover, .dp-h button:hover, .dp-f button:hover { background: var(--hover); }
.dp-g button.today { box-shadow: inset 0 0 0 1px var(--accent); }
.dp-g button.on { background: var(--accent); color: var(--accent-ink); }
.dp-f { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--line-2); padding-top: 6px; }
.dp-f button { padding: 5px 9px; font-size: 12.5px; color: var(--accent); }

/* ---------- Kanban ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: 60vh; }
.col { background: var(--surface-3); border-radius: 12px; width: 286px; flex: 0 0 286px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.col header { display: flex; align-items: center; gap: 8px; padding: 11px 12px 8px; font-size: 13px; }
.col header small { margin-left: auto; }
.col-body { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; flex: 1; border-radius: 0 0 12px 12px; transition: background .12s; }
.col-body.over { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; box-shadow: var(--shadow); cursor: grab; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .12s, transform .12s; }
.kcard:hover { box-shadow: 0 4px 14px -4px rgba(0, 0, 0, .15); }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kc-t { font-weight: 550; line-height: 1.35; }
.kc-s { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-f { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.kc-f .av { margin-left: auto; }
.kc-f .ico { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.kc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.kc-tags span { font-size: 11px; background: var(--surface-3); border-radius: 5px; padding: 1px 6px; color: var(--ink-2); }
.kc-act { font-size: 12px; color: var(--accent); font-weight: 500; }
.kcard.prio-urgent { border-left: 3px solid var(--red); }
.kcard.prio-high { border-left: 3px solid var(--amber); }
.col-add { border: 0; background: none; color: var(--ink-3); padding: 6px; border-radius: 7px; cursor: pointer; display: flex; gap: 6px; align-items: center; font: inherit; font-size: 12.5px; }
.col-add:hover { background: var(--hover); color: var(--ink); }

/* ---------- Calendar ---------- */
.cal-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-bar h2 { min-width: 190px; text-align: center; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.cal-h, .cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-h span { padding: 8px 10px; font-size: 12px; color: var(--ink-3); font-weight: 550; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-d { min-height: 116px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.out { background: var(--surface-2); }
.cal-d.out .cal-n { color: var(--ink-3); opacity: .6; }
.cal-d.wk { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.cal-d[data-cal-new] { cursor: copy; }
.cal-n { font-size: 12px; font-weight: 550; padding: 2px 5px; align-self: flex-start; border-radius: 10px; }
.cal-d.today .cal-n { background: var(--accent); color: var(--accent-ink); }
.cal-e { font-size: 11.5px; border-radius: 5px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-e b { font-weight: 650; }
.cal-more { font-size: 11px; color: var(--ink-3); padding: 0 6px; cursor: default; }
.legend i.b-gray, .legend i.b-blue, .legend i.b-indigo, .legend i.b-violet, .legend i.b-cyan, .legend i.b-green, .legend i.b-amber, .legend i.b-red { background: var(--c); }
.deliv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 14px; }
.deliv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.deliv-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.deliv-card small { color: var(--ink-3); }

/* ---------- Gantt ---------- */
.gantt-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.gantt { min-width: 860px; }
.card.flush:has(.gantt) { overflow-x: auto; }
.g-head, .g-row { display: grid; grid-template-columns: 260px 1fr; }
.g-head { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-3); font-weight: 550; position: sticky; top: 0; }
.g-head .g-label { padding: 9px 14px; }
.g-head .g-track { display: flex; }
.g-head .g-track span { padding: 9px 8px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.g-row { border-bottom: 1px solid var(--line-2); }
.g-row:hover { background: var(--hover); }
.g-label { padding: 8px 14px; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line-2); }
.g-label a { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-label a:hover { color: var(--accent); }
.g-label small { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-row.sub .g-label { padding-left: 30px; }
.g-row.sub .g-label a { font-weight: 450; font-size: 13px; }
.g-track { position: relative; min-height: 46px; }
.g-row.sub .g-track { min-height: 34px; }
.g-bar { position: absolute; top: 12px; height: 22px; border-radius: 6px; background: color-mix(in srgb, var(--s1) 22%, var(--surface)); overflow: hidden; display: flex; align-items: center; }
.g-bar .g-prog { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1); }
.g-bar em { position: relative; font-style: normal; font-size: 11px; font-weight: 600; color: #fff; padding-left: 7px; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.g-bar.late { background: color-mix(in srgb, var(--s8) 22%, var(--surface)); }
.g-bar.late .g-prog { background: var(--s8); }
.g-bar.task { top: 10px; height: 14px; background: color-mix(in srgb, var(--s7) 55%, var(--surface)); }
.g-bar.task.done { background: color-mix(in srgb, var(--s3) 60%, var(--surface)); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); opacity: .55; z-index: 1; }
.g-ms { position: absolute; top: 16px; width: 12px; height: 12px; background: var(--s4); transform: translateX(-6px) rotate(45deg); border: 2px solid var(--surface); z-index: 2; }
.g-ms.done { background: var(--s3); }

/* ---------- Documents editor ---------- */
.doc-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.de-side .sticky { position: sticky; top: 72px; }
.doc-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.doc-actions .card { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.tbl.items td { vertical-align: top; padding: 8px 6px; }
.tbl.items th { padding: 9px 6px; }
.tbl.items textarea { min-height: 36px; resize: vertical; overflow: hidden; }
.tbl.items input.n { width: 92px; text-align: right; }
.tbl.items .sm { width: 74px; }
.tbl.items td[data-line] { padding-top: 16px; font-weight: 550; }
.items-add { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; }
.items-add select { max-width: 380px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; padding: 0 8px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0 0 16px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--ink-3); }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-size: 18px; font-weight: 650; color: var(--ink); padding-top: 8px; border-top: 1px solid var(--line); }

/* ---------- Split / settings ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 72px; }
.set-nav a { padding: 7px 11px; border-radius: 7px; color: var(--ink-2); font-weight: 500; }
.set-nav a:hover { background: var(--hover); }
.set-nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.logo-up { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-up img { height: 48px; max-width: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.convert .card > .switch { margin-bottom: 14px; }

/* ---------- Auth ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg); }
.auth-wrap { width: 100%; padding: 24px; display: grid; place-items: center; }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: var(--shadow-lg); }
.auth-card.wide { width: min(620px, 100%); }
.auth-card h1 { margin-top: 18px; }
.auth-card h3 { margin-top: 18px; }
.auth-card .fld { margin-bottom: 14px; }
.auth-brand { display: flex; gap: 10px; align-items: center; }
.auth-brand .glyph { width: 38px; height: 38px; flex-basis: 38px; font-size: 17px; }
.auth-brand small { display: block; color: var(--ink-3); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-editor, .split { grid-template-columns: 1fr; }
  .de-side .sticky { position: static; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); width: 264px !important; flex-basis: 264px !important; }
  html.sb-open .sidebar { transform: none; }
  html.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  html.sb-collapsed .brand-txt, html.sb-collapsed .nav-group, html.sb-collapsed .nav a span { display: revert; }
  .sb-toggle { display: none; }
  .mob-menu { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 8px; }
  .content { padding: 18px 14px 50px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; }
  .set-nav a { white-space: nowrap; }
  .hide-sm, .tp-title { display: none; }
  .gsearch input::placeholder { color: transparent; }
}
@media (max-width: 640px) {
  .grid-form { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .k-v { font-size: 19px; }
  .spark { display: none; }
  h1 { font-size: 19px; }
  .f-search input { width: 100%; }
  .filters > * { flex: 1 1 140px; max-width: none; }
  .filters .f-search { flex-basis: 100%; }
  .notif-menu { width: calc(100vw - 24px); position: fixed; left: 12px; right: 12px; top: 52px; }
  /* Πίνακες ως κάρτες στο κινητό */
  .tbl:not(.items):not(.perm) thead { display: none; }
  .tbl:not(.items):not(.perm) tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .tbl:not(.items):not(.perm) td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0 !important; border: 0; text-align: right; }
  .tbl:not(.items):not(.perm) td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; text-align: left; flex: 0 0 auto; }
  .tbl:not(.items):not(.perm) td:not([data-label])::before { content: none; }
  .tbl:not(.items):not(.perm) td.act { justify-content: flex-end; }
  .tbl tfoot tr { display: block; }
  .row-actions { opacity: 1; }
  .tbl.items thead { display: none; }
  .tbl.items tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
  .tbl.items td { padding: 0; border: 0; }
  .tbl.items td:first-child { grid-column: 1 / -1; }
  .tbl.items input.n, .tbl.items .sm { width: 100%; }
  .modal { width: 100vw; max-height: 100vh; border-radius: 14px 14px 0 0; margin-bottom: 0; }
  .cal-d { min-height: 74px; padding: 3px; }
  .cal-e { font-size: 10px; padding: 1px 3px; }
  .cal-e b { display: none; }
  .col { width: 82vw; flex-basis: 82vw; }
  .entity-head .ph-actions, .page-head .ph-actions { width: 100%; }
  .hb { grid-template-columns: 1fr auto; }
  .hb-t { grid-column: 1 / -1; grid-row: 2; }
}
.g-bar em.dk { color: var(--ink-2); text-shadow: none; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th.c, .tbl td.c { text-align: center; }
@media (max-width: 640px) { .tbl td.act { width: auto; } .tbl td.act .row-actions { margin-left: auto; } }
