:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --field: #ffffff; /* text boxes, lists: stand out from --surface */
  --text: #1a1d21;
  --muted: #62697a;
  --border: #d5d9e0;
  --accent: #1f5fbf;
  --head: #e8ecf2;
  --stripe: #f7f9fc;
  --hover: #e6effc;
  --ok: #1a7f37;
  --ok-bg: #dafbe1;
  --bad: #b62324;
  --bad-bg: #ffebe9;
  --warn: #9a6700;
  --warn-bg: #fff8c5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --field: #0d1117;
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #30363d;
    --accent: #58a6ff;
    --head: #1f2630;
    --stripe: #1a2029;
    --hover: #1d2a3b;
    --ok: #3fb950;
    --ok-bg: #123321;
    --bad: #f85149;
    --bad-bg: #3c1618;
    --warn: #d29922;
    --warn-bg: #3b2e05;
  }
}

* { box-sizing: border-box; }

/* The root size sets the scale of the whole page (everything is in rem):
   the account page's size setting changes only this. */
html { font-size: 16px; }
html.size-s { font-size: 14px; }
html.size-l { font-size: 18px; }
html.size-xl { font-size: 20px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 0.8125rem/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* font setting (account page); only fonts installed on the device */
html.font-verdana body, .choice.font-verdana { font-family: Verdana, Tahoma, "DejaVu Sans", sans-serif; }
html.font-arial body, .choice.font-arial { font-family: Arial, Helvetica, "Liberation Sans", sans-serif; }
html.font-serif body, .choice.font-serif { font-family: Georgia, "Times New Roman", "DejaVu Serif", serif; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.3rem; margin: 0.4em 0 0.6em; }
h2 { font-size: 1.05rem; margin: 0.2em 0 0.7em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mono { font-family: "DejaVu Sans Mono", "Courier New", monospace; letter-spacing: 0.08em; }
.inline { display: inline; margin: 0; }

button, .button {
  font: inherit;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-block;
}
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button[type=submit] { background: var(--accent); border-color: var(--accent); color: #fff; }
.link-button, button.link-button[type=submit] { background: none; border: none; color: var(--muted); padding: 0; }
.link-button:hover { color: var(--accent); }
/* buttons that look like links (Εκτύπωση, Στήλες) */
.as-link, button.as-link { background: none; border: none; color: var(--accent); padding: 0 0.3rem; }
.as-link:hover { text-decoration: underline; }
/* an action that is off (e.g. deletes, config allow_delete): seen, not clickable */
.link-disabled { color: var(--accent); opacity: 0.4; cursor: not-allowed; }
/* action icons (icons.html): edit, delete, add; the words are the title */
.icon { width: 1.15rem; height: 1.15rem; vertical-align: -0.2em; }
.icon-link { display: inline-flex; padding: 0.15rem; border-radius: 4px; color: var(--accent); }
a.icon-link:hover { background: var(--hover); text-decoration: none; }
a.icon-delete:hover { color: var(--bad); }
.row-actions { display: inline-flex; gap: 0.5rem; }

input[type=text], input[type=password], input[type=search], input[type=date] {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--field);
  color: var(--text);
}
select, textarea { background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }

/* --- top bar --- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.4rem 1.2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand a:hover { text-decoration: none; }
.brand-logo-link { display: flex; }
.brand-home { color: inherit; }
.brand-logo { height: 34px; width: auto; border-radius: 3px; }
/* the receiving centre's logo (logo.go): fixed height, so nothing moves
   while it loads; width follows, up to a limit */
.site-logo { height: 34px; width: auto; max-width: 180px; object-fit: contain; }
.brand-sub { font-weight: 400; color: var(--muted); }
.topbar nav { flex: 1; display: flex; gap: 1.2rem; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
/* language switch (layout.html): the other language, [EN] / [EL] - a
   plain inline button, on the same baseline as the other words */
.lang-switch button { display: inline-block; padding: 0; }

.container { padding: 1rem 1.2rem 2rem; }
.footer { padding: 0.6rem 1.2rem 1.2rem; color: var(--muted); font-size: 0.8rem; }

/* --- toolbar / search --- */
/* Top bar + (on the panel list) the search bar: always visible. */
/* left: 0 + body min-width: the top area also stays put when a wide
   table scrolls the page sideways; its width is the window's (app.js sets
   --sbw to the vertical scrollbar's width). */
body { min-width: fit-content; }
.sticky-head { position: sticky; top: 0; left: 0; z-index: 20; max-width: calc(100vw - var(--sbw, 0px)); }
.sticky-head .toolbar { margin: 0; padding: 0.45rem 1.2rem; background: var(--bg); border-bottom: 1px solid var(--border); }
.sticky-head .history-form { margin: 0; }
/* the combined history's form sits in a flex toolbar: let it shrink so the
   date presets scroll inside it instead of widening the page (phones) */
.toolbar > .history-form { flex: 1; min-width: 0; }
.history-form .presets { min-width: 0; max-width: 100%; }
.panel-sticky { background: var(--bg); padding: 0.4rem 1.2rem 0; border-bottom: 1px solid var(--border); }
.panel-sticky-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.back-link { white-space: nowrap; align-self: stretch; display: flex; align-items: center; gap: 0.3rem; }
.panel-sticky .panel-header { flex: 1; margin: 0; padding: 0.35rem 0.9rem; }
.panel-sticky .tabs { border-bottom: none; }
.panel-sticky .tab { padding: 0.3rem 0.65rem; }
.panel-sticky .history-bar { background: var(--surface); border: 1px solid var(--border); border-bottom: none; padding: 0.35rem 0.9rem; }
.toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.toolbar .search { display: flex; gap: 0.4rem; align-items: center; flex: 1; }
.toolbar .search input[type=search] { width: min(28rem, 100%); }

/* --- data grid (F2Suite ETable look) --- */
/* No overflow on the wrapper: a scrolling wrapper would trap the sticky
   header. A table wider than the window scrolls the page sideways instead. */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; width: fit-content; min-width: 100%; }
.grid td { background: var(--surface); }
table.grid { border-collapse: collapse; width: 100%; }
.grid th, .grid td { padding: 0.3rem 0.55rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
/* Table headers stick right under the sticky top area; app.js keeps
   --sticky-top equal to its height (it changes with wrapping and text size). */
.grid th { background: var(--head); font-weight: 600; white-space: nowrap; position: sticky; top: var(--sticky-top, 0); z-index: 5; }
.grid td + td, .grid th + th { border-left: 1px solid var(--border); }
.grid tbody tr:nth-child(even) td { background: var(--stripe); }
.grid tbody tr.row-link { cursor: pointer; }
.grid tbody tr.row-link:hover td { background: var(--hover); }
.grid a.sort { color: var(--text); }
.grid a.sort.active { color: var(--accent); }
.grid .empty, p.empty { color: var(--muted); padding: 1rem; text-align: center; }
.grid.wait th.week { vertical-align: middle; }
.grid.wait th.slot { font-weight: 400; }
.grid.wait tr.week-start th, .grid.wait tr.week-start td { border-top: 2px solid var(--border); }
/* Fixed layouts: columns keep their width whatever the data (no layout shift). */
.grid.history, .grid.list, .grid.fixed { table-layout: fixed; }
.grid.history { min-width: 72rem; } /* > the fixed columns (66rem) so Περιγραφή keeps room */
.grid.list { min-width: 72rem; }
.grid.fixed { min-width: 48rem; }
.grid.history td, .grid.list td, .grid.fixed td { overflow-wrap: anywhere; }
.grid.history th, .grid.list th, .grid.fixed th { white-space: normal; overflow-wrap: anywhere; }
.grid col.w-dt { width: 10.5rem; }
.grid col.w-date { width: 6.5rem; }
.grid col.w-xs { width: 3.2rem; }
.grid col.w-onoff { width: 7.2rem; } /* Συνδεδεμένο / Οπλισμένο */
/* a header that shortens as its column narrows (window or dragged width):
   Συνδεδεμένο -> Συνδ -> Σ; older browsers keep the word */
.grid th.fit > a { display: block; container-type: inline-size; } /* not on the th: no containment for table cells */
.fit-mid, .fit-short { display: none; }
@container (max-width: 5.3rem) { .fit-long { display: none; } .fit-mid { display: inline; } }
@container (max-width: 2.4rem) { .fit-mid { display: none; } .fit-short { display: inline; } }
.grid col.w-sm { width: 5.5rem; }
.grid col.w-rowact { width: 6.5rem; } /* Ενέργειες: the action icons (screen only) */
.grid col.w-md { width: 9rem; }
.grid col.w-lg { width: 12rem; }
/* tab grid column widths (a class, not style="": the CSP allows no inline style) */
.grid col.cw-2_5 { width: 2.5rem; }
.grid col.cw-3 { width: 3rem; }
.grid col.cw-4 { width: 4rem; }
.grid col.cw-5 { width: 5rem; }
.grid col.cw-6 { width: 6rem; }
.grid col.cw-7_5 { width: 7.5rem; }
.grid col.cw-9 { width: 9rem; }
.grid col.cw-10 { width: 10rem; }
.grid col.cw-14 { width: 14rem; }
.grid col.cw-16 { width: 16rem; }
.invisible { visibility: hidden; }
.warn-text { color: var(--warn); }
.grid.history tr.actions td { background: var(--surface); border-top: none; }
.grid.history tr.actions pre { margin: 0; font: inherit; white-space: pre-wrap; color: var(--muted); }

.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0.2rem;
  color: var(--muted);
}
.pager a { margin: 0 0.5rem; }

/* --- panel page --- */
.panel-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.panel-code { font-size: 1.2rem; }
.panel-names { flex: 1; }
.panel-sub { font-weight: 600; }
.panel-state { display: flex; gap: 0.5rem; }
.pill { padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.85rem; background: var(--head); }
.pill-ΝΑΙ { background: var(--ok-bg); color: var(--ok); }
/* a word in full, or one letter on phones (state pills, list headers) */
.lbl-short { display: none; }
.panel-header .print-all { white-space: nowrap; }
.pill-ΟΧΙ { background: var(--bad-bg); color: var(--bad); }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: var(--head);
  color: var(--text);
  margin-bottom: -1px;
}
.tab:hover { text-decoration: none; background: var(--hover); }
.tab.active { background: var(--surface); font-weight: 600; border-bottom: 1px solid var(--surface); }
.tab-print { margin-left: auto; }
.tab-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.9rem;
}
.tab-body .table-wrap { border-radius: 0; }

dl.fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.1rem 1.5rem;
  margin: 0.8rem 0;
}
.field { display: flex; gap: 0.6rem; padding: 0.25rem 0; border-bottom: 1px dotted var(--border); }
.field dt { color: var(--muted); min-width: 9rem; }
.field dd { margin: 0; font-weight: 500; }

/* --- history --- */
.history-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin-bottom: 0.8rem; }
.history-form .check { display: flex; align-items: center; gap: 0.3rem; }
.presets { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.preset { padding: 0.15rem 0.5rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; }
.preset:hover { text-decoration: none; border-color: var(--accent); }

.warning-banner {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.8rem;
}

/* --- login --- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.6rem 1.8rem;
  width: min(22rem, 92vw);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.login-form h1 { text-align: center; margin: 0; }
.login-logo { align-self: center; width: 96px; border-radius: 4px; }
.login-logo-site { width: auto; height: 96px; max-width: 280px; object-fit: contain; border-radius: 0; }
.login-form label { display: flex; flex-direction: column; gap: 0.25rem; }
.login-form .login-role { text-align: center; margin: -0.4rem 0 0; color: var(--muted); font-weight: 600; }
.login-form .warning-banner { margin: 0; }
.login-lang { text-align: center; margin: 0; font-size: 0.9rem; }
.login-version { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 0; }
.login-logo-link { align-self: center; display: flex; }
.login-company { text-align: center; margin: -0.2rem 0 0; font-weight: 600; font-size: 1.05rem; }
.copyright-link { color: inherit; text-decoration: none; }
.copyright-link:hover { text-decoration: underline; }

/* the copyright notice (templates/common/copyright.html) */
.legal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.6rem 1.8rem;
  width: min(48rem, 94vw);
  margin: 1.5rem 0;
  line-height: 1.5;
}
.legal h1 { margin: 0 0 0.4rem; text-align: center; }
.legal h2 { font-size: 1.05rem; margin: 1.2rem 0 0.3rem; }
.legal p { margin: 0 0 0.6rem; }
.legal-logo { text-align: center; }
.legal-owner { text-align: center; color: var(--muted); }
.legal-links { margin: 0 0 0.6rem; padding-left: 1.4rem; }
.legal-links li { margin-bottom: 0.3rem; }
.legal-back { margin-top: 1.2rem; }

/* --- printing --- */
.print-only { display: none; }
.print-brand { align-items: center; gap: 0.6rem; margin: 0 0 0.6rem; font-weight: 700; }
.print-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
.print-head .js-print { margin-left: auto; }
.print-title { font-size: 1.2rem; font-weight: 700; }
.print-section { margin-top: 1.2rem; }

@media print {
  :root {
    --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --border: #999;
    --head: #e6e6e6; --stripe: #f5f5f5;
  }
  body { font-size: 10pt; }
  .no-print { display: none !important; }
  .print-only { display: block; }
  .print-only.print-brand { display: flex; }
  .container { padding: 0; }
  .table-wrap { overflow: visible; border: none; }
  .grid th { position: static; }
  .tab-body { border: none; padding: 0; }
  .grid tr { break-inside: avoid; }
  .print-section { break-inside: avoid-page; }
  a { color: inherit; }
}

/* --- 2FA steps --- */
.login-form.login-setup { width: min(26rem, 92vw); }
.login-help { margin: 0; color: var(--muted); font-size: 0.92rem; text-align: center; }
.qr-box { align-self: center; width: 13rem; height: 13rem; background: #fff; padding: 0.3rem; border-radius: 4px; }
.qr-box svg.qr { width: 100%; height: 100%; display: block; }
.otp-open { align-self: center; }
code.secret span + span { margin-left: 0.45em; } /* groups by CSS: a copied key has no spaces */
.offscreen { position: absolute; left: -9999px; }
code.secret { font-family: "DejaVu Sans Mono", "Courier New", monospace; letter-spacing: 0.05em; color: var(--text); overflow-wrap: anywhere; }
input.otp { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; font-family: "DejaVu Sans Mono", "Courier New", monospace; }
.login-form label.check-row { flex-direction: row; align-items: flex-start; gap: 0.4rem; font-size: 0.92rem; }

/* --- account page --- */
.account-section { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0.8rem 1rem; margin-bottom: 1rem; max-width: 60rem; }
.account-section h2 { margin-top: 0; color: var(--text); }
.prefs-form fieldset { border: none; padding: 0; margin: 0 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.prefs-form legend { font-weight: 600; margin-bottom: 0.3rem; padding: 0; }
.prefs-form .choice { display: flex; align-items: center; gap: 0.3rem; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.6rem; flex-wrap: wrap; }
.ok-text { color: var(--ok); }
button.small { padding: 0.15rem 0.5rem; font-size: 0.9em; }
button[disabled] { opacity: 0.5; cursor: default; }
.grid.devices td { vertical-align: middle; }

/* GDPR mask indicator in the top bar */
.mask-badge { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); border-radius: 999px; padding: 0.05rem 0.6rem; font-size: 0.85rem; }
.mask-badge:hover { text-decoration: none; }
.mask-badge .short { display: none; }

/* --- resizable columns (app.js) --- */
.col-resizer { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 6; touch-action: none; }
.col-resizer:hover, .col-resizer.active { background: var(--accent); opacity: 0.35; }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none; }
/* printouts ignore the dragged widths (they must fit the paper) */
@media print {
  .col-resizer { display: none; }
  table.grid[data-cols] { width: 100% !important; }
  table.grid[data-cols] col { width: auto !important; }
  /* ...but not equal widths: the default ones as shares of the paper, the
     plain column (Περιγραφή) takes the rest; date and time on two lines */
  table.grid[data-cols] { min-width: 0; }
  table.grid[data-cols] col.w-dt { width: 10.5% !important; }
  table.grid[data-cols] col.w-date { width: 10% !important; }
  table.grid[data-cols] col.w-xs { width: 5% !important; }
  table.grid[data-cols] col.w-onoff { width: 9% !important; }
  table.grid[data-cols] col.w-sm { width: 9% !important; }
  table.grid[data-cols] col.w-md { width: 10% !important; }
  table.grid[data-cols] col.w-lg { width: 11% !important; }
  .grid td.dt { overflow-wrap: normal; } /* date and time: break at the space */
  table.grid[data-cols] { font-size: 8.5pt; }
  table.grid[data-cols] th { font-size: 8pt; overflow-wrap: anywhere; }
  table.grid[data-cols] th, table.grid[data-cols] td { padding: 2pt 3pt; }
}

/* --- column chooser (app.js) --- */
.table-tools { display: flex; justify-content: flex-end; margin: 0 0 0.3rem; }
.grid.cols-custom { min-width: 0; } /* columns hidden: fit the window */
dialog.col-chooser { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); padding: 1rem 1.2rem; max-width: min(26rem, 94vw); max-height: 85vh; overflow-y: auto; }
dialog.col-chooser::backdrop { background: rgba(0, 0, 0, 0.35); }
dialog.col-chooser h2 { margin: 0 0 0.6rem; color: var(--text); }
dialog.col-chooser ul { list-style: none; margin: 0; padding: 0; }
dialog.col-chooser li { display: flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0; border-bottom: 1px dotted var(--border); }
dialog.col-chooser li label { flex: 1; display: flex; align-items: center; gap: 0.4rem; }

/* --- tablets and phones: the panel tabs on one line, scrolling sideways --- */
@media (max-width: 1099px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .tab { white-space: nowrap; }
}

/* --- phones --- */
@media (max-width: 699px) {
  html { font-size: 15px; }
  input[type=text], input[type=password], input[type=search], input[type=date] { font-size: 16px; } /* no iOS zoom */
  .container { padding: 0.6rem 0.6rem 1.5rem; }
  .topbar { gap: 0.7rem; padding: 0.35rem 0.6rem; flex-wrap: nowrap; }
  .brand-name, .brand-sub, .who-role, .mask-badge .long { display: none; }
  .mask-badge .short { display: inline; }
  .brand-logo { height: 28px; }
  .site-logo { height: 28px; max-width: 64px; }
  /* phones: both logos don't fit next to the menu - the centre's only */
  .brand.with-site-logo .brand-logo, .brand.with-site-logo .brand-logo-link:first-child { display: none; }
  .who strong { display: inline-block; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
  .topbar nav { gap: 0.7rem; }
  .topbar-right { gap: 0.6rem; }
  .sticky-head .toolbar { padding: 0.35rem 0.6rem; }
  .toolbar .search { flex-wrap: nowrap; }
  .toolbar .search input[type=search] { flex: 1; min-width: 0; width: auto; }
  .print-list, .print-all, .js-print { display: none; }
  .panel-sticky { padding: 0.3rem 0.6rem 0; }
  .back-text { display: none; }
  .panel-header { gap: 0.6rem; padding: 0.3rem 0.6rem; }
  .panel-sticky .panel-header { padding: 0.3rem 0.6rem; }
  .panel-code { font-size: 1rem; white-space: nowrap; }
  .panel-names .muted { display: none; }
  .panel-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
  .pill { font-size: 0.75rem; padding: 0.05rem 0.4rem; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  /* date presets: one line, scroll sideways; Στήλες next to Εμφάνιση */
  .presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; order: 2; }
  .history-actions { order: 1; }
  .panel-sticky .history-bar { padding: 0.3rem 0.5rem; }
  .history-form { gap: 0.35rem 0.5rem; }
  .history-form input[type=date] { width: 9.5rem; }
  .presets { width: 100%; }
  .preset { white-space: nowrap; }
  .tab-body { padding: 0.5rem; }
  dl.fields { grid-template-columns: 1fr; }
  /* narrower fixed columns: date and time on two lines, short codes */
  .grid col.w-dt { width: 5.8rem; }
  .grid col.w-sm { width: 4.2rem; }
  .grid col.w-md { width: 6.5rem; }
  .grid col.w-lg { width: 8rem; }
  .grid col.w-onoff { width: 3.2rem; }
  .field dt { min-width: 7rem; }
}

/* section title with its Στήλες / Εκτύπωση buttons on the right */
.section-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.section-head h2 { margin: 0; }
.section-new { display: inline-flex; align-items: center; }
.section-new .icon { width: 1.35rem; height: 1.35rem; }
.section-actions { margin-left: auto; } /* Στήλες · Εκτύπωση at the right */
.section-actions, .history-actions { display: inline-flex; align-items: center; gap: 0.4rem; }
.history-actions { margin-left: auto; } /* Στήλες · Εκτύπωση at the right end, apart from the date presets */
.js-cols-slot:empty { display: none; }
.account-section h3 { font-size: 0.95rem; margin: 0.8rem 0 0; }
.small-note { font-size: 0.8rem; font-weight: 400; }

/* the panel last opened, marked in the list (app.js): a tint and a bar
   on the left edge - no bold/arrow, which would change widths */
.grid tbody tr.last-visited td { background: var(--hover); }
.grid tbody tr.last-visited td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.cell-sub { font-size: 0.85em; color: var(--muted); }

/* --- change requests (installer zones: installer_zones.go) --- */
.change-msg { margin: 0 0 0.6rem; }
.grid tr.row-pending td { background: var(--warn-bg); }
.st-pending { color: var(--warn); font-weight: 600; }
.st-applied { color: var(--ok); font-weight: 600; }
.st-rejected { color: var(--bad); font-weight: 600; }
.st-cancelled { color: var(--muted); }
.change-note { color: var(--muted); margin-top: 0.2rem; }
.changes-title { font-size: 1rem; font-weight: 600; margin: 1.4rem 0 0.5rem; cursor: pointer; color: var(--accent); }
details.changes:not([open]) .changes-title { margin-bottom: 0; }
.inline-form { display: inline; margin: 0; }
.inline-form button[type=submit] { background: var(--surface); color: var(--accent); border-color: var(--border); }
.change-form { display: flex; flex-direction: column; gap: 0.8rem; max-width: 40rem; }
.change-form label { display: flex; flex-direction: column; gap: 0.25rem; }
.change-form input[type=text], .change-form select, .change-form textarea { font: inherit; padding: 0.35rem 0.5rem;
  background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.change-form .fixed-field { display: flex; flex-direction: column; gap: 0.25rem; }
.change-form .fixed-field strong { font-weight: 600; padding: 0.35rem 0; }
.change-form .input-code { width: 6rem; }
.form-error { color: var(--bad); min-height: 1.2em; margin: 0; }
.form-actions { display: flex; gap: 0.6rem; }

/* ===== f2web-ng-admin (templates/admin/): everything under .adm ===== */
.adm { padding-top: 0.3rem; }
.adm-count { display: inline-block; min-width: 1.4rem; padding: 0 0.3rem; border-radius: 0.7rem;
  background: var(--bad); color: #fff; font-size: 0.7rem; font-weight: 700; text-align: center; }
.adm-count.invisible { visibility: hidden; }
.adm .flash { min-height: 2.4rem; padding: 0.4rem 0; }
.adm .flash div { padding: 0.3rem 0.7rem; border-radius: 4px; }
.adm .flash .ok { background: var(--ok-bg); color: var(--ok); }
.adm .flash .err { background: var(--bad-bg); color: var(--bad); }
.adm .titlebar { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.adm .titlebar h2 { margin: 0; }
.adm .search { display: flex; gap: 0.3rem; }
.adm .search input[type=search] { width: 20rem; max-width: 60vw; }
.adm .tabs { display: flex; gap: 0.2rem; }
.adm .tabs a { padding: 0.25rem 0.7rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.adm .tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.adm input, .adm button, .adm .button { font: inherit; }
.adm input { padding: 0.3rem 0.45rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); }
.adm button, .adm .button { display: inline-block; padding: 0.3rem 0.7rem; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.adm .button:hover { text-decoration: none; background: var(--hover); }
.adm button:hover:not(:disabled) { background: var(--hover); }
.adm button.primary, .adm .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.adm button.dangerous { color: var(--bad); border-color: var(--bad); }
.adm button:disabled, .adm .button.disabled { opacity: 0.45; cursor: not-allowed; }
.adm button.small { padding: 0.1rem 0.45rem; font-size: 0.75rem; }
.adm .invisible { visibility: hidden; }
.adm .pager { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.adm .count { min-width: 14rem; text-align: center; color: var(--muted); }
.adm .note { color: var(--warn); }
.adm table.grid { border-collapse: collapse; width: 100%; table-layout: fixed; background: var(--surface); }
.adm .grid th, .adm .grid td { padding: 0.3rem 0.55rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.adm .grid th { background: var(--head); font-weight: 600; }
.adm .grid td + td, .adm .grid th + th { border-left: 1px solid var(--border); }
.adm .grid tbody tr:nth-child(even) td { background: var(--stripe); }
.adm .grid tr.row-link { cursor: pointer; }
.adm .grid tr.row-link:hover td { background: var(--hover); }
.adm .grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.adm .grid td.empty { text-align: center; color: var(--muted); padding: 1.2rem; }
.adm .w-code { width: 5rem; }
.adm .w-user { width: 14rem; }
.adm .w-pass { width: 9rem; }
.adm .w-2fa { width: 7rem; }
.adm .w-flags { width: 13rem; }
.adm .w-key { width: 18rem; }
.adm .w-state { width: 8rem; }
.adm .w-date { width: 9.5rem; }
.adm .w-dev { width: 6rem; }
.adm .w-ip { width: 16rem; }
.adm .w-actions { width: 18.5rem; }
.adm .w-check { width: 2.2rem; }
/* the account page's admin accounts (nav.html roleAccount): one form per
   row through the inputs' form="" attribute; wider than the other sections */
.account-section.accounts-admin { max-width: 72rem; scroll-margin-top: 5rem; } /* #admins: below the sticky top bar */
.adm .w-acc { width: 10rem; }
.adm .w-right { width: 6.6rem; }
.adm .w-pass2 { width: 10rem; }
.adm .w-accact { width: 12.5rem; }
.adm table.accounts th.check { text-align: center; }
.adm table.accounts input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }
.adm table.accounts tr.new-account input[name=password2] { margin-top: 0.25rem; }
.adm table.accounts td:last-child { white-space: nowrap; }
/* the logins page (logins.html): installers / subscribers on the left,
   the chosen one's logins on the right, both starting at the same height:
   one fixed-height line above each (never wrapping); stacked on phones */
.adm .md-search { margin: 0 0 0.6rem; }
.adm .master-detail { display: grid; grid-template-columns: minmax(20rem, 2fr) minmax(24rem, 3fr); gap: 1.2rem; align-items: start; }
.adm .md-head { height: 2.2rem; margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; overflow: hidden; }
.adm .md-name { font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.adm .md-head .icon-link { flex: none; }
.adm .md-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 100; } /* cut before the name */
.adm .w-city { width: 9rem; }
.adm .w-logins { width: 4.5rem; }
.adm table.parties { margin: 0 0 0.4rem; }
.adm .grid tr.row-link.on td { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
.adm .grid tr.row-link.on td + td { box-shadow: none; }
.adm .md-sub { margin: 0.1rem 0 0.7rem; }
.adm .card h2 { margin: 0; font-size: 1.1rem; }
.adm .md-empty { margin: 0; padding: 2rem 1rem; border: 1px dashed var(--border); border-radius: 6px; text-align: center; }
@media (max-width: 899px) { .adm .master-detail { grid-template-columns: 1fr; } }
/* pending changes by panel (changes.html) */
.adm .change-group { margin: 0 0 1.4rem; }
.adm .group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.9rem; margin-bottom: 0.4rem; }
.adm .group-head h2 { margin: 0; font-size: 1.05rem; }
.adm .group-act { margin-left: auto; display: inline-flex; gap: 0.4rem; }
.adm .group-act input { width: 20rem; max-width: 50vw; }
.adm .grid td.check { text-align: center; }
.adm .problem-text { color: var(--bad); }
.adm .badge { display: inline-block; padding: 0 0.4rem; border-radius: 3px; background: var(--head); font-size: 0.75rem; white-space: nowrap; }
.adm .badge.good { background: var(--ok-bg); color: var(--ok); }
.adm .badge.warn { background: var(--warn-bg); color: var(--warn); }
.adm .badge.bad { background: var(--bad-bg); color: var(--bad); }
.adm .muted { color: var(--muted); }
.adm .hint { color: var(--muted); font-size: 0.75rem; margin: 0.3rem 0 0.6rem; }
.adm .facts { display: grid; grid-template-columns: 9rem 1fr; gap: 0.35rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.8rem 1rem; margin: 0 0 1rem; }
.adm .facts dt { color: var(--muted); }
.adm .facts dd { margin: 0; }
.adm .secret { font-family: ui-monospace, Menlo, Consolas, monospace; display: inline-block; min-width: 10rem; }
.adm .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; }
.adm .card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.8rem 1rem; }
.adm .card.wide { max-width: 34rem; }
.adm .card.danger { border-color: var(--bad); }
.adm .card label { display: block; }
.adm .card label input:not([type=checkbox]) { display: block; width: 100%; margin-top: 0.2rem; }
.adm .card label.check { display: flex; gap: 0.4rem; align-items: center; }
.adm .stack label { margin-bottom: 0.5rem; }
.adm .codename { min-height: 1.2em; font-weight: 600; color: var(--text); }
.adm form.inline { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; }
.adm .appblock { margin-bottom: 1.5rem; }
.adm .w-id { width: 3.5rem; }
.adm .w-inst { width: 12rem; }
.adm .w-panel { width: 8rem; }
.adm .w-action { width: 8rem; }
.adm .w-label { width: 9rem; }
.adm table.diff { margin-bottom: 0.4rem; }
.adm table.diff th[scope=row] { text-align: left; background: var(--head); }
.adm table.diff td.changed { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.adm table.diff td.drift { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.adm .problem { min-height: 2.2rem; padding: 0.2rem 0 0.6rem; }
.adm .problem .err { padding: 0.3rem 0.7rem; border-radius: 4px; background: var(--bad-bg); color: var(--bad); }
@media (max-width: 699px) { .adm .facts { grid-template-columns: 1fr; } .adm .search input[type=search] { width: 12rem; } }

/* Colour themes (account page, per user: "theme" in 2fa.json, themes.go):
   pale backgrounds instead of white, from salist's. On <html> as
   class theme-<id>, so the account page's samples (class theme-<id>)
   show their own colours. Screen only: printouts keep the print colours.
   "" = the colours above (light, or dark with the device). */
@media screen {
  /* the classic colours (light) - only the picker's sample: <html> never has it */
  .theme-classic { color-scheme: light; --bg: #f3f4f6; --surface: #ffffff; --field: #ffffff; --text: #1a1d21; --muted: #62697a; --border: #d5d9e0; --accent: #1f5fbf;
    --head: #e8ecf2; --stripe: #f7f9fc; --hover: #e6effc; }
  .theme-mist { color-scheme: light; --bg: #dfe4e9; --surface: #e8ecf0; --field: #ffffff; --text: #262c33; --muted: #5e6873; --border: #cbd2da; --accent: #43627f;
    --head: #d5dbe2; --stripe: #e4e8ec; --hover: #d4dbe2;
    --ok: #1a7f37; --ok-bg: #cbddd6; --bad: #b62324; --bad-bg: #e2d4d8; --warn: #9a6700; --warn-bg: #e4ddc5; }
  .theme-sky { color-scheme: light; --bg: #dbe5f0; --surface: #e5edf6; --field: #ffffff; --text: #1f2a36; --muted: #56657a; --border: #c6d3e3; --accent: #3a68a3;
    --head: #d0dcea; --stripe: #e0e9f3; --hover: #d0ddec;
    --ok: #1a7f37; --ok-bg: #c9dedb; --bad: #b62324; --bad-bg: #dfd5dd; --warn: #9a6700; --warn-bg: #e1deca; }
  .theme-nord { color-scheme: light; --bg: #e5e9f0; --surface: #eceff4; --field: #ffffff; --text: #2e3440; --muted: #5f6b7d; --border: #d3d9e3; --accent: #5e81ac;
    --head: #dce1ea; --stripe: #e8ecf2; --hover: #dbe2eb;
    --ok: #1a7f37; --ok-bg: #cfdfda; --bad: #b62324; --bad-bg: #e6d7db; --warn: #9a6700; --warn-bg: #e7dfc8; }
  .theme-sea { color-scheme: light; --bg: #d9e6e8; --surface: #e4eef0; --field: #ffffff; --text: #1f2e31; --muted: #56696d; --border: #c3d5d8; --accent: #2f6f7a;
    --head: #cedee0; --stripe: #deeaec; --hover: #cedfe2;
    --ok: #1a7f37; --ok-bg: #c8ded6; --bad: #b62324; --bad-bg: #ded6d8; --warn: #9a6700; --warn-bg: #e0dec5; }
  .theme-sage { color-scheme: light; --bg: #dde5df; --surface: #e7ede8; --field: #ffffff; --text: #232c26; --muted: #5b6860; --border: #c8d3cb; --accent: #3b6f5f;
    --head: #d2dcd5; --stripe: #e2e9e4; --hover: #d2ded8;
    --ok: #1a7f37; --ok-bg: #cadecf; --bad: #b62324; --bad-bg: #e1d5d0; --warn: #9a6700; --warn-bg: #e3debf; }
  .theme-mint { color-scheme: light; --bg: #dcebe4; --surface: #e6f2ec; --field: #ffffff; --text: #20302a; --muted: #58695f; --border: #c6dbd0; --accent: #2f7a5f;
    --head: #d1e3da; --stripe: #e1eee8; --hover: #d0e4db;
    --ok: #1a7f37; --ok-bg: #c9e2d3; --bad: #b62324; --bad-bg: #e0d9d4; --warn: #9a6700; --warn-bg: #e2e2c2; }
  .theme-olive { color-scheme: light; --bg: #e2e3d3; --surface: #eaebdd; --field: #ffffff; --text: #2b2d22; --muted: #64665a; --border: #d0d2bd; --accent: #5e6b3a;
    --head: #d9dac8; --stripe: #e6e7d8; --hover: #d9dcc9;
    --ok: #1a7f37; --ok-bg: #cddcc6; --bad: #b62324; --bad-bg: #e4d3c7; --warn: #9a6700; --warn-bg: #e5dcb6; }
  .theme-sand { color-scheme: light; --bg: #e7dfd2; --surface: #eee8dd; --field: #ffffff; --text: #33291f; --muted: #6e6253; --border: #d7ccba; --accent: #6e4f33;
    --head: #dfd6c6; --stripe: #eae4d8; --hover: #dfd6c9;
    --ok: #1a7f37; --ok-bg: #d0d9c6; --bad: #b62324; --bad-bg: #e7d0c7; --warn: #9a6700; --warn-bg: #e8dab6; }
  .theme-cream { color-scheme: light; --bg: #efe8d5; --surface: #f5f0e2; --field: #ffffff; --text: #33301f; --muted: #6f6a55; --border: #e0d7bd; --accent: #7b6a2e;
    --head: #e8e0c9; --stripe: #f2ecdc; --hover: #e6e0cc;
    --ok: #1a7f37; --ok-bg: #d6e0ca; --bad: #b62324; --bad-bg: #edd7cb; --warn: #9a6700; --warn-bg: #eee0ba; }
  .theme-lavender { color-scheme: light; --bg: #e2e0e8; --surface: #eae8ef; --field: #ffffff; --text: #2a2732; --muted: #625d6e; --border: #d0ccda; --accent: #5a4e85;
    --head: #d9d6e1; --stripe: #e6e4ec; --hover: #d9d6e2;
    --ok: #1a7f37; --ok-bg: #cdd9d5; --bad: #b62324; --bad-bg: #e4d0d7; --warn: #9a6700; --warn-bg: #e5dac4; }
  .theme-latte { color-scheme: light; --bg: #e6e9ef; --surface: #eff1f5; --field: #ffffff; --text: #4c4f69; --muted: #6c6f85; --border: #ccd0da; --accent: #1e66f5;
    --head: #d9dce4; --stripe: #eaedf2; --hover: #d6e0f5;
    --ok: #1a7f37; --ok-bg: #d1e1da; --bad: #b62324; --bad-bg: #e8d8dc; --warn: #9a6700; --warn-bg: #e9e1c9; }
  .theme-graphite { color-scheme: light; --bg: #d5d8db; --surface: #dfe2e5; --field: #ffffff; --text: #202326; --muted: #575c62; --border: #c1c6cb; --accent: #3d4c5c;
    --head: #cbcfd3; --stripe: #dadde0; --hover: #ccd0d5;
    --ok: #1a7f37; --ok-bg: #c3d4cd; --bad: #b62324; --bad-bg: #dacbce; --warn: #9a6700; --warn-bg: #ddd5bc; }
}

/* the account page's theme picker: a small sample of each */
.theme-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; width: 100%; }
.theme-pick { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.35rem; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.theme-pick:has(input:checked) { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-pick input { margin: 0; }
.theme-sample { display: block; border-radius: 5px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.theme-sample .ts-top { display: block; height: 0.55rem; background: var(--accent); }
.theme-sample .ts-card { display: block; margin: 0.3rem; padding: 0.15rem 0.3rem; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: var(--text); font-size: 0.75rem; line-height: 1.35; }
.theme-sample .ts-head { display: block; background: var(--head); color: var(--muted); margin: -0.15rem -0.3rem 0.1rem; padding: 0 0.3rem; }
.theme-sample .ts-link { color: var(--accent); }
.theme-name { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; }
.theme-note { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
