[hidden] { display: none !important; }
:root {
  color-scheme: light;
  --bg: #f6f6f4; --surface: #fcfcfb; --border: #e3e2de;
  --text: #0b0b0b; --text-2: #52514e; --muted: #8a8984;
  --accent: #1f7389; --accent-ink: #ffffff;
  --series-1: #2a78d6; --series-2: #eb6834;
  --good: #1a7f37; --warn: #9a6700; --bad: #c62828; --info: #1f7389;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --border: #2e2e2c;
    --text: #ffffff; --text-2: #c3c2b7; --muted: #8f8e88;
    --accent: #23a8cc; --accent-ink: #0b0b0b;
    --series-1: #3987e5; --series-2: #d95926;
    --good: #4ac26b; --warn: #d4a72c; --bad: #f47067; --info: #23a8cc;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --border: #2e2e2c;
  --text: #ffffff; --text-2: #c3c2b7; --muted: #8f8e88;
  --accent: #23a8cc; --accent-ink: #0b0b0b;
  --series-1: #3987e5; --series-2: #d95926;
  --good: #4ac26b; --warn: #d4a72c; --bad: #f47067; --info: #23a8cc;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header.top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
header.top .brand { font-weight: 700; margin-right: auto; }
header.top nav a { margin-right: 12px; text-decoration: none; }
header.top form { margin: 0; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.sub { color: var(--text-2); margin: 0 0 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tiles.six { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile .label { color: var(--text-2); font-size: 13px; }
.tile .value { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .hint { color: var(--muted); font-size: 12px; }
.chart-wrap { position: relative; height: 300px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid currentColor; white-space: nowrap; }
.badge.ready { color: var(--info); } .badge.posted { color: var(--good); }
.badge.needs_review { color: var(--bad); } .badge.uploaded { color: var(--warn); }
.badge.rejected { color: #fff; background: var(--bad); border-color: var(--bad); } .rejected-text { color: var(--bad); font-weight: 650; }
.badge.awaiting_approval { color: var(--info); }
.flash { background: var(--surface); border-left: 4px solid var(--accent); padding: 10px 14px; margin-bottom: 16px; border-radius: 6px; }
.error { color: var(--bad); }
.notes { color: var(--text-2); font-size: 13px; white-space: pre-line; }
form.stack { display: grid; gap: 10px; max-width: 420px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%; }
button, .button { font: inherit; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.drop { border: 2px dashed var(--border); border-radius: 10px; padding: 28px 16px; text-align: center; }
.drop.over { border-color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.login-box { max-width: 380px; margin: 10vh auto; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
details summary { cursor: pointer; color: var(--accent); }
.field-error { color: var(--bad); font-size: 13px; }
.camera-button { font-size: 18px; padding: 16px 22px; width: 100%; max-width: 420px; cursor: pointer; }
.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 6px; }
.upload-actions form { margin: 0; }
.big-action { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 64px;
  font-size: 18px; font-weight: 600; border-radius: 12px; cursor: pointer; text-align: center; }
.big-action .big-icon { font-size: 26px; line-height: 1; }
.secondary-action { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); }
.big-action.busy { opacity: .7; pointer-events: none; }
.upload-hint { margin: 0 0 18px; font-size: 13px; }
/* Η κάμερα μόνο σε κινητό/tablet· στον υπολογιστή μένει μόνο το «Ανέβασμα αρχείων» */
@media (hover: hover) and (pointer: fine) { .camera-only { display: none; } .upload-actions { grid-template-columns: minmax(0, 360px); } }
@media (max-width: 480px) { .upload-actions { grid-template-columns: 1fr; } }
.install-card { margin-bottom: 16px; border-left: 4px solid var(--accent); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 44px; }
.password-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; align-items: center;
  background: transparent; color: var(--muted); padding: 6px; border-radius: 6px; opacity: .75; line-height: 0; }
.password-eye:hover, .password-eye:focus-visible { opacity: 1; color: var(--text-2); }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand img { height: 28px; width: auto; }
.login-logo { display: block; height: 72px; width: auto; margin: 0 auto 12px; }
.login-box h1, .login-box > .sub { text-align: center; }
.install-page { max-width: 560px; margin: 4vh auto; }
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
ol.steps li { counter-increment: step; position: relative; padding: 4px 0 18px 48px; line-height: 1.9; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; margin: 2px 0; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); white-space: nowrap; line-height: 1.6; vertical-align: middle; }
.chip .ico { width: 20px; height: 20px; color: var(--accent); flex: none; }
.chip .en { color: var(--muted); font-size: 13px; }
.chip:has(.ico):not(:has(b:not(:empty))) { padding: 2px 6px; }
@media (max-width: 420px) { .chip { white-space: normal; } }
body.viewer { display: flex; flex-direction: column; height: 100vh; height: 100dvh; margin: 0; background: #111; }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border); flex: none; }
.viewer-close { font-size: 16px; font-weight: 600; padding: 10px 16px; white-space: nowrap; }
.viewer-name { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-body { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 0; max-width: none; }
.viewer-body img { max-width: 100%; height: auto; margin: auto; }
.viewer-body iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer-fallback { color: #ccc; font-size: 13px; margin: 6px; }
body.no-scroll { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 10px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); color: var(--text); width: 100%; max-width: 640px; max-height: 96dvh; border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.modal-head { padding: 14px 16px 8px; } .modal-head h2 { margin: 0 0 2px; } .modal-head .sub { margin: 0; }
/* «Περιβάλλον PDF»: γκρι φόντο, λευκές σελίδες με σκιά, όπως σε πρόγραμμα PDF */
.pdf-stage { flex: 1; overflow: auto; background: #525659; padding: 12px; min-height: 240px; }
.pdf-doc + .pdf-doc { margin-top: 18px; }
.pdf-doc-title { color: #eee; font-size: 13px; margin: 0 2px 8px; word-break: break-all; }
.pdf-stage .pdf-pages { display: grid; gap: 12px; margin: 0; }
.pdf-stage .pdf-page { border: 0; border-radius: 2px; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.pdf-stage .pdf-pages-info, .pdf-stage .sub { color: #ddd; text-align: center; }
.pdf-wait { color: #eee; text-align: center; margin: 60px 0; font-size: 17px; }
.pdf-error { color: #ffd7d7; background: rgba(0,0,0,.25); padding: 8px 10px; border-radius: 6px; }
.modal-actions { display: grid; gap: 8px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.modal-actions .big-action { min-height: 52px; border: 0; }
.modal-actions .secondary-action { border: 2px solid var(--accent); }
.modal-actions button[hidden] { display: none; }
.modal-actions button:disabled { opacity: .55; }
.done-box { align-items: center; text-align: center; padding: 26px 20px 20px; max-width: 420px; }
.done-box h2 { margin: 6px 0; font-size: 22px; } .done-box p { margin: 4px 0; } .done-box .sub { word-break: break-all; }
.done-icon { font-size: 56px; line-height: 1; }
.done-box .big-action { margin-top: 16px; min-height: 52px; border: 0; }
.pdf-pages { display: grid; gap: 8px; margin-top: 8px; }
.pdf-page { display: block; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.pdf-pages-info { margin: 2px 0 0; font-size: 13px; }
.viewer-pdf { width: 100%; max-width: 900px; display: grid; gap: 10px; padding: 10px; }
.viewer-pdf .sub { color: #ccc; }
.upload-success { display: flex; gap: 14px; align-items: center; padding: 16px; margin-bottom: 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--good) 12%, var(--surface)); border: 2px solid var(--good); color: var(--text); }
.upload-success strong { font-size: 19px; display: block; margin-bottom: 2px; }
.upload-success-icon { font-size: 34px; line-height: 1; }
.upload-success .sub { margin: 4px 0 0; font-size: 13px; word-break: break-all; }

/* ---------- Κινητό ---------- */
.tabbar, .top-client, .inv-cards { display: none; }
.inv-cards { list-style: none; margin: 0; padding: 0; }
@media (max-width: 720px) {
  body { font-size: 16px; }
  input, select, textarea, button { font-size: 16px; } /* χωρίς ζουμ του iPhone όταν γράφεις */
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  body:not(.is-client) main { padding-bottom: 32px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; margin: 22px 0 8px; }

  header.top { position: sticky; top: 0; z-index: 20; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); gap: 10px; flex-wrap: nowrap; }
  body.is-client header.top nav, body.is-client .top-user { display: none; }
  body.is-client .top-client { display: block; margin-left: auto; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  body.is-client .top-logout { flex: none; margin: 0; }
  body.is-client .top-logout button { font-size: 14px; padding: 7px 10px; }
  body.is-client .client-title { display: none; } /* το όνομα είναι ήδη στην κεφαλίδα */

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar { overflow-x: auto; scrollbar-width: none; }
  .tabbar a, .tabbar form, .tabbar button { flex: 1 0 auto; min-width: 62px; }
  .tabbar form { margin: 0; display: flex; }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px 9px;
    color: var(--text-2); text-decoration: none; font-size: 12px; background: none; border: 0; border-radius: 0; min-height: 56px; width: 100%; }
  .tabbar span { font-size: 21px; line-height: 1; }
  .tabbar a.active { color: var(--accent); font-weight: 600; }

  .tiles, .tiles.six { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 12px; border-radius: 10px; }
  .tile .label { font-size: 12px; }
  .tile .value { font-size: 19px; }
  .tile .hint { font-size: 11px; }
  .chart-wrap { height: 220px; }
  .install-card .row { flex-wrap: nowrap; gap: 10px; font-size: 14px; }

  .inv-table { display: none; }
  .inv-cards { display: block; }
  .inv-cards li + li { border-top: 1px solid var(--border); }
  .inv-cards a { display: block; padding: 11px 2px; color: var(--text); text-decoration: none; }
  .inv-card-main { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
  .inv-card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inv-card-amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
  .inv-card-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 3px; color: var(--muted); font-size: 13px; }
  .inv-card-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inv-card-empty { padding: 10px 0; }

  .upload-actions { margin-top: 4px; }
  .big-action { min-height: 60px; font-size: 17px; }
}

/* Σελίδα «Ανέβασμα» και αυτόματη ανάγνωση */
.upload-steps { margin: 0 0 16px; padding: 16px 16px 16px 36px; line-height: 1.6; }
.upload-steps li + li { margin-top: 6px; }
.upload-tips { margin-top: 18px; }
.upload-tips h2 { margin-top: 0; font-size: 1.05rem; }
.upload-tips ul { margin: 0 0 10px; padding-left: 20px; line-height: 1.6; }
.read-check { margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; font-size: .95rem; line-height: 1.45;
  background: var(--surface); color: var(--text); border-left: 5px solid var(--muted); }
.read-check.good { border-left-color: var(--good); }
.read-check.warn { border-left-color: var(--warn); }
.read-check.good::first-line { color: var(--good); font-weight: 700; }
.read-check.warn { font-weight: 600; }
.read-facts { margin-top: 4px; color: var(--text-2); font-weight: 600; }
.read-tip { margin-top: 6px; color: var(--text-2); font-weight: 400; }
.done-box .done-list { margin-top: 10px; width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; }
.portal-version { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 8px; }
@media (max-width: 720px) { .portal-version { margin-bottom: 90px; } }

/* Σαρωτής εγγράφων */
.scanner { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; display: flex; flex-direction: column; }
.scanner.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; pointer-events: none; }
.scan-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
.scan-top .scan-hint { flex: 1; text-align: center; font-size: 15px; line-height: 1.3; }
.scan-btn { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 20px; padding: 0; }
.scan-view { position: relative; flex: 1; min-height: 0; }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.scan-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 14px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.scan-thumbs { display: flex; gap: 4px; overflow-x: auto; }
.scan-thumbs img { height: 52px; border-radius: 4px; border: 2px solid #fff; background: #fff; }
.scan-shot { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: #23a8cc; padding: 0; box-shadow: 0 0 0 3px rgba(0,0,0,.4) inset; }
.scan-done { justify-self: end; background: #fff; color: #0b0b0b; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 700; font-size: 16px; }
.scan-done:disabled { opacity: .4; }
.scan-adjust, .scan-fail, .scan-review, .scan-busy { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); gap: 10px; }
.scan-adjust[hidden], .scan-fail[hidden], .scan-review[hidden], .scan-busy[hidden] { display: none; }
.scan-review .scan-hint { text-align: center; margin: 4px 0; font-size: 16px; }
.scan-review-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.scan-review-stage img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 4px; }
.scan-review-actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.scan-review-actions .big-action { padding-left: 6px; padding-right: 6px; font-size: 15px; }
.scan-busy { align-items: center; justify-content: center; background: rgba(0,0,0,.75); font-size: 18px; }
.scan-adjust .scan-hint { text-align: center; margin: 4px 0; }
.scan-adjust-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.scan-adjust-stage canvas { touch-action: none; }
.scan-adjust-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scan-fail { justify-content: center; text-align: center; padding: 24px; }
.scan-fail .sub { color: #c3c2b7; }

/* Εκκρεμότητες από myDATA */
.pending-banner { display: block; margin: 16px 0; color: var(--text); text-decoration: none; border-left: 5px solid var(--good); }
.pending-banner.has { border-left-color: var(--warn); }
.pending-title { margin: 16px 0 6px; font-size: 1.05rem; }
.pending-month { margin: 12px 0 4px; font-weight: 700; color: var(--text-2); }
.pending-list { list-style: none; margin: 0; padding: 0; }
.pending-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pending-party { font-weight: 600; }
.pending-meta { grid-column: 1; color: var(--text-2); font-size: .9rem; }
.pending-amount { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; white-space: nowrap; }

/* Μήνας-μήνας */
.month-chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; scrollbar-width: thin; }
.month-chips a { flex: none; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 14px; }
.month-chips a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.month-table tr.selected td, #pick-table tr.selected td { background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.month-table td a { color: var(--text); }
.month-table tfoot th { border-top: 2px solid var(--border); }
.period-select { gap: 8px; flex-wrap: nowrap; }
.period-select select[name=month] { min-width: 150px; }
@media (max-width: 720px) { .period-select { width: 100%; } .period-select select[name=month] { flex: 1; } }

/* Σελίδα myDATA */
.md-bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin: 8px 0 14px; }
.md-sync { display: flex; align-items: center; gap: 10px; }
.md-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.md-panel { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.md-panel.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.md-panel-title { display: block; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 18px; text-decoration: none; }
.md-panel ul { list-style: none; margin: 0; padding: 0; }
.md-panel li a { display: flex; justify-content: space-between; padding: 9px 14px; color: var(--text); text-decoration: none; border-top: 1px solid var(--border); }
.md-panel li a b { font-variant-numeric: tabular-nums; }
.md-panel li a.on { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.md-panel li a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.md-table td, .md-table th { white-space: nowrap; }
.md-table td:nth-child(2) { white-space: normal; min-width: 150px; max-width: 220px; }
.md-table td:nth-child(5) { white-space: normal; min-width: 160px; }
.md-table tfoot th { border-top: 2px solid var(--border); }
.md-state a { color: var(--accent); }
@media (max-width: 720px) { .md-panels { grid-template-columns: 1fr; } .md-sync { width: 100%; justify-content: space-between; } }
.md-cards li { padding: 11px 2px; }
.md-cards .md-cards-total { font-weight: 700; }
@media (max-width: 720px) { #md-search { max-width: none !important; width: 100%; } }
.md-open { width: auto; min-height: 44px; padding: 10px 18px; }

/* Εκκρεμότητες ανά προμηθευτή */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg a { padding: 8px 16px; color: var(--text-2); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--border); }
.seg a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pg-group { border-top: 1px solid var(--border); }
.pg-group summary { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 11px 4px; cursor: pointer; list-style: none; }
.pg-group summary::-webkit-details-marker { display: none; }
.pg-group summary::before { content: "▸"; color: var(--muted); margin-right: -6px; grid-row: 1; }
.pg-group[open] summary::before { content: "▾"; }
.pg-group summary { grid-template-columns: 14px 1fr auto auto; }
.pg-name { font-weight: 600; }
.pg-count { color: var(--text-2); font-size: .92rem; white-space: nowrap; }
.pg-total { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.pg-docs { width: 100%; margin: 0 0 10px; font-size: .93rem; }
.pg-docs td { padding: 6px 4px 6px 22px; border-top: 1px dashed var(--border); color: var(--text-2); }
.pg-docs td.num { color: var(--text); }
@media (max-width: 720px) {
  .pg-group summary { grid-template-columns: 14px 1fr auto; }
  .pg-count { grid-column: 2; grid-row: 2; }
  .pg-total { grid-column: 3; grid-row: 1 / span 2; }
  .pg-type { display: none; }
  #pg-search { max-width: none !important; width: 100%; }
}
.pending-summary { border-left: 5px solid var(--good); }
.pending-summary.has { border-left-color: var(--warn); }
.ps-list { list-style: none; margin: 0; padding: 0; }
.ps-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); }
.ps-name { font-weight: 600; }
.ps-count { color: var(--text-2); }
.ps-count::after { content: " τιμ."; }
.ps-total { font-weight: 700; min-width: 90px; text-align: right; white-space: nowrap; }

/* Chat πελάτη ↔ γραφείου */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.tab-icon { position: relative; }
.tab-badge { position: absolute; top: -4px; right: -10px; min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 16px; }
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: min(68vh, 680px); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-empty { margin: auto; text-align: center; }
.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(78%, 560px); padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.chat-row.mine .chat-bubble { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); border-bottom-right-radius: 4px; }
.chat-row.theirs .chat-bubble { border-bottom-left-radius: 4px; }
.chat-who { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.chat-file { display: block; margin-top: 4px; color: inherit; font-weight: 600; overflow-wrap: anywhere; }
.chat-meta { font-size: 11px; opacity: .75; margin-top: 3px; text-align: right; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-attach { font-size: 22px; cursor: pointer; padding: 6px 4px; }
.chat-input { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.chat-input textarea { width: 100%; resize: none; min-height: 42px; max-height: 140px; padding: 10px 12px; border-radius: 20px; font: inherit; }
.chat-file-name { font-size: 13px; color: var(--text-2); cursor: pointer; }
#chat-send { width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 18px; flex: none; }
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li + li { border-top: 1px solid var(--border); }
.inbox a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 4px; color: var(--text); text-decoration: none; }
.inbox a:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.inbox-name { font-weight: 600; }
.inbox-time { color: var(--muted); font-size: 13px; }
.inbox-last { grid-column: 1 / -1; color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox li.unread .inbox-last { color: var(--text); font-weight: 600; }
@media (max-width: 720px) { .chat { height: calc(100dvh - 250px); min-height: 360px; } .chat-bubble { max-width: 86%; } }
.md-check { margin-top: 14px; } .md-check summary { cursor: pointer; font-weight: 600; }
.pg-activity { display: block; font-weight: 400; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.md-activity { font-size: 12px; }
.pagination { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; }
.pagination li a, .pagination li span { display: inline-block; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-decoration: none; }
.pagination li.active span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pagination li.disabled span { color: var(--muted); }
.afm-filter input, .afm-filter select, .afm-filter button { width: auto; }
.afm-filter input[type=search] { min-width: 280px; }
@media (max-width: 720px) { .afm-filter, .afm-filter input[type=search] { width: 100%; min-width: 0; } }
.chips-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.chips-row .month-chips { margin-top: 0; flex: 1; min-width: 0; }
.refresh-form { display: flex; align-items: center; gap: 6px; flex: none; }
.refresh-form button { border-radius: 999px; padding: 7px 14px; white-space: nowrap; }
.refresh-time { font-size: 12px; white-space: nowrap; }
@media (max-width: 720px) { .refresh-time { display: none; } }
.refresh-form { align-self: center; } .refresh-time { line-height: 1; }
.db-error { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); border-left: 5px solid var(--bad); } .db-error code { font-size: 12px; overflow-wrap: anywhere; }
.type-custom { border-color: var(--accent); font-weight: 600; }

.scanner .scan-what { position: relative; z-index: 2; margin: 0 12px 6px; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.92); color: #123; font-weight: 650; font-size: 14px; text-align: center; }

.upload-actions.needs-pick .big-action { opacity: .45; }

/* Λίστα επιλογής λογαριασμού (dropdown με αναζήτηση) */
input.acc-pick { background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px; cursor: pointer; }
.acc-panel { position: absolute; z-index: 1000; max-height: 340px; max-width: min(640px, 95vw); overflow-y: auto; background: var(--card, #fff); color: inherit; border: 1px solid var(--line, #ccd); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); font-size: 14px; }
.acc-item { padding: 6px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-item b { font-variant-numeric: tabular-nums; margin-right: 6px; }
.acc-item span { opacity: .8; }
.acc-item.active, .acc-item:hover { background: rgba(31,115,138,.12); }
.acc-item.current b::after { content: ' ✓'; }
.acc-empty { padding: 8px 10px; opacity: .7; }

/* Μενού στο πλάι στον υπολογιστή (στο κινητό μένει η πάνω κεφαλίδα + κάτω μπάρα) */
@media (min-width: 721px) {
  body.with-side { padding-left: 232px; }
  body.with-side header.top { position: fixed; top: 0; left: 0; bottom: 0; width: 232px; z-index: 25; flex-direction: column; align-items: stretch;
    flex-wrap: nowrap; gap: 8px; padding: 16px 12px; border-bottom: 0; border-right: 1px solid var(--border); overflow-y: auto; }
  body.with-side header.top .brand { margin: 0 0 8px 6px; }
  body.with-side header.top nav { display: flex; flex-direction: column; gap: 2px; }
  body.with-side header.top nav a { margin: 0; padding: 8px 10px; border-radius: 8px; color: var(--text); display: flex; align-items: center; gap: 6px; }
  body.with-side header.top nav a:hover { background: var(--bg); }
  body.with-side header.top nav a.active { background: var(--accent-bg, rgba(31, 115, 137, .12)); color: var(--accent); font-weight: 600; }
  body.with-side header.top nav .nav-badge { margin-left: auto; }
  body.with-side header.top .top-user { margin-top: auto !important; padding: 0 6px; }
  body.with-side header.top .top-logout button { width: 100%; }
  body.with-side header.top .nav-sub { display: flex; flex-direction: column; margin: 0 0 6px 18px; padding-left: 8px; border-left: 2px solid var(--border); }
  body.with-side header.top .nav-sub a { padding: 5px 8px; font-size: 14px; color: var(--text-2); font-weight: 400; }
  body.with-side header.top .nav-sub a.active { color: var(--accent); background: var(--accent-bg, rgba(31, 115, 137, .12)); font-weight: 600; }
  body.with-side header.top .nav-client { border-left: 0; margin-bottom: 2px; font-size: 13px; color: var(--text-2); }
}
@media (max-width: 720px) { header.top .nav-sub { display: none; } }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; }
@media (max-width: 720px) { .sticky-save { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.drop-zone { display: block; border: 2px dashed var(--border); border-radius: 10px; padding: 10px; text-align: center; cursor: pointer; color: var(--text-2); }
.dz.drag-over, body.dragging .dz { outline: 3px dashed var(--accent); outline-offset: 3px; }
.dz.drag-over { background: var(--accent-bg, rgba(31, 115, 137, .12)); }
.drop-names { display: block; font-size: 13px; color: var(--accent); }
.drop-hint { display: block; font-size: 13px; font-weight: 400; opacity: .8; }
@media (hover: none) { .drop-hint { display: none; } }
/* Μενού: απόκρυψη/εμφάνιση και επιλογή πελάτη */
.side-show, .side-hide { display: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-client { max-width: 260px; }
@media (min-width: 721px) {
  body.with-side header.top .side-head { margin: 0 0 4px; }
  body.with-side header.top .side-head .brand { margin: 0 0 0 6px; }
  body.with-side .side-hide { display: inline-block; padding: 2px 10px; font-size: 18px; line-height: 1.2; }
  body.with-side header.top .side-client { width: 100%; max-width: none; margin: 0 0 8px; font-size: 14px; }
  html.side-hidden body.with-side { padding-left: 0; }
  html.side-hidden body.with-side header.top { display: none; }
  html.side-hidden body.with-side .side-show { display: block; position: fixed; top: 12px; left: 12px; z-index: 30; padding: 6px 12px; font-size: 20px; line-height: 1; }
  html.side-hidden body.with-side main { padding-top: 56px; }
}
/* Συμφωνητικά: λίστα αριστερά, προβολή δεξιά */
.contracts-grid { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 16px; align-items: start; }
.contract-item { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.contract-item:hover { background: var(--bg); }
.contract-item.active { background: var(--accent-bg, rgba(31, 115, 137, .12)); }
.contract-kind { font-weight: 700; padding: 6px 10px 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.contract-topic { padding: 6px 10px 2px; font-weight: 600; font-size: .92em; }
.contract-item.in-topic { margin-left: 14px; border-left: 2px solid var(--border); border-radius: 0 8px 8px 0; }
@media (max-width: 900px) { .contracts-grid { grid-template-columns: 1fr; } }
.side-client-row { display: flex; gap: 6px; align-items: center; }
.side-client-row .side-client { flex: 1; min-width: 0; }
.side-clear { padding: 4px 10px; }
@media (min-width: 721px) { body.with-side header.top .side-client-row { margin: 0 0 8px; } body.with-side header.top .side-client-row .side-client { margin: 0; } }
.nav-sep { height: 1px; background: var(--border); margin: 6px 4px; }
