/* Gladius e-Sign — shop-owner archive.
   Identity: deep navy + signature-ink blue, paper-white content. A real
   product dashboard, not a bare utility page. */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* The UA's [hidden]{display:none} loses to our own display:flex on
   .login-wrap/.app — without this override BOTH views render at once
   (login stays on screen, the archive scrolls in below it). */
[hidden] { display: none !important; }

:root {
  --navy: #10203c;
  --navy-2: #182c4f;
  --ink: #1b2333;
  --ink-soft: #5b6575;
  --ink-faint: #98a1b3;
  --line: #e2e6ee;
  --paper: #f3f5f9;
  --card: #ffffff;
  --accent: #2563ba;
  --accent-soft: #e8f0fb;
  --danger: #b3372f;
  --ok: #2e7d4f;
  --amber: #9a6b1f;
}

html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.muted { color: var(--ink-soft); }
.error { color: var(--danger); font-size: 13.5px; margin-top: 10px; }

/* ── logo ────────────────────────────────────────────────── */
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff; font-size: 19px;
}
.logo-mark .ico { width: 20px; height: 20px; }
.logo-word { font-size: 17px; letter-spacing: .01em; color: inherit; }
.logo-word b { font-weight: 700; }

/* ── buttons / chips / inputs ─────────────────────────────── */
.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 18px;
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, filter .12s;
}
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(127, 146, 176, .12); }
.btn.wide { width: 100%; margin-top: 20px; padding: 12px; font-size: 15.5px; }
.btn:disabled { opacity: .55; cursor: default; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  transition: all .12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.method-chips .chip { display: inline-flex; align-items: center; gap: 6px; }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
        margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
input[type="email"], input[type="password"], input[type="search"],
input[type="text"], input[type="date"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus { outline: 2px solid #b9cfec; border-color: var(--accent); }

/* ── login ───────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(37, 99, 186, .18), transparent 60%),
    var(--navy);
}
.login-panel {
  display: grid; grid-template-columns: 1.15fr 1fr;
  width: 100%; max-width: 880px;
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(5, 12, 25, .45);
}
.login-brand {
  background: linear-gradient(160deg, var(--navy-2), var(--navy));
  color: #e8edf6;
  padding: 46px 42px;
  display: flex; flex-direction: column;
}
.login-brand h1 { font-size: 26px; line-height: 1.2; margin: 34px 0 14px; color: #fff; }
.login-brand p { font-size: 14.5px; line-height: 1.55; color: #b9c4d8; max-width: 34ch; }
.brand-points { list-style: none; margin-top: auto; padding-top: 30px; }
.brand-points li {
  font-size: 13.5px; color: #cbd5e6; padding: 7px 0; display: flex; align-items: center; gap: 10px;
}
.login-form { padding: 46px 40px; }
.login-form h2 { font-size: 22px; }
.login-form .muted { font-size: 13.5px; margin-top: 3px; }

@media (max-width: 760px) {
  .login-panel { grid-template-columns: 1fr; max-width: 430px; }
  .login-brand { display: none; }
}

/* ── app shell ───────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.side {
  width: 232px; flex: 0 0 232px;
  background: var(--navy);
  color: #dbe3f0;
  display: flex; flex-direction: column;
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh;
}
.side-logo { padding: 2px 8px 22px; color: #fff; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  font-size: 14.5px; color: #b7c3d8; cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); }
.nav-item.active { background: rgba(59, 118, 199, .32); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 #7fb0ea; }
.nav-ico { font-size: 15px; }
.side-foot { margin-top: auto; }
.user-chip {
  font-size: 13px; color: #9fb0ca; padding: 0 8px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-btn { width: 100%; color: #cdd7e6; border-color: rgba(255,255,255,.18); }

.main { flex: 1; padding: 30px 36px 80px; min-width: 0; }

.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; letter-spacing: -.01em; }
#head-sub { font-size: 13.5px; }

/* ── stats ───────────────────────────────────────────────── */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px 18px;
}
.stat-num { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px;
            text-transform: uppercase; letter-spacing: .05em; }

/* ── panel / toolbar / table ─────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.toolbar input[type="search"] { max-width: 320px; flex: 1 1 220px; }
.toolbar input[type="date"] { width: 150px; font-size: 13.5px; color: var(--ink-soft); }

.list-status { padding: 34px 4px; text-align: center; }

.table-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; padding: 12px 14px; font-size: 14px; }
th {
  color: var(--ink-faint); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .06em; border-bottom: 1px solid var(--line);
}
tbody tr { border-bottom: 1px solid #eef1f6; cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f5f8fd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-weight: 600; }
th.actions-col { text-align: right; }
td.actions-cell { text-align: right; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 12px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.status-pending   { background: #fdf3e3; color: var(--amber); }
.status-pending::before   { background: var(--amber); }
.status-signed    { background: var(--accent-soft); color: var(--accent); }
.status-signed::before    { background: var(--accent); }
.status-delivered { background: #e7f3ec; color: var(--ok); }
.status-delivered::before { background: var(--ok); }
.status-cancelled { background: #efefef; color: var(--ink-faint); }
.status-cancelled::before { background: var(--ink-faint); }
.status-failed    { background: var(--danger-soft, #fbeae8); color: var(--danger); }
.status-failed::before    { background: var(--danger); }

.row-actions { display: inline-flex; gap: 6px; }
.row-actions .btn { padding: 5px 13px; font-size: 13px; border-radius: 8px; }

/* ── dialogs ─────────────────────────────────────────────── */
dialog {
  border: none; border-radius: 16px; padding: 0;
  width: min(560px, 94vw);
  box-shadow: 0 24px 70px rgba(10, 18, 34, .3);
}
dialog::backdrop { background: rgba(12, 20, 36, .45); }
.dialog-body { padding: 26px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-body h2 { font-size: 19px; }
.dialog-body h3 { font-size: 13px; color: var(--ink-soft); text-transform: uppercase;
                  letter-spacing: .05em; margin: 20px 0 10px; }
.dialog-body .method-chips { margin: 14px 0 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 18px; margin-top: 16px;
}
.detail-grid .dg-lbl { font-size: 11.5px; color: var(--ink-faint);
                       text-transform: uppercase; letter-spacing: .05em; }
.detail-grid .dg-val { font-size: 14.5px; margin-top: 2px; }

.timeline { list-style: none; }
.timeline li {
  position: relative; padding: 0 0 14px 24px;
  border-left: 2px solid var(--line); margin-left: 7px;
}
.timeline li:last-child { padding-bottom: 2px; border-left-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
}
.timeline .tl-title { font-size: 14px; font-weight: 600; }
.timeline .tl-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.timeline li.tl-fail::before { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* ── v2 polish (§2.11) ───────────────────────────────────── */
/* driver line under a status pill: which driver holds the invoice */
.row-driver { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; white-space: nowrap; }

/* Live run tracking cards (Παραδόσεις) */
.run-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 12px; background: #fbfcfe;
}
.run-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap;
}
.run-driver { font-size: 15px; font-weight: 700; color: var(--ink); }
.run-card table.mini { min-width: 0; }
.run-card table.mini th, .run-card table.mini td { padding: 8px 10px; font-size: 13px; }
.run-card tbody tr { cursor: default; }
.run-card tbody tr:hover { background: transparent; }

/* Stop-status pills (reuse the pill base) */
.stop-assigned            { background: #eef1f6; color: var(--ink-soft); }
.stop-assigned::before    { background: var(--ink-faint); }
.stop-out_for_delivery    { background: var(--accent-soft); color: var(--accent); }
.stop-out_for_delivery::before { background: var(--accent); }
.stop-arrived             { background: #e9edfd; color: #4553c8; }
.stop-arrived::before     { background: #4553c8; }
.stop-delivered           { background: #e7f3ec; color: var(--ok); }
.stop-delivered::before   { background: var(--ok); }
.stop-partially_delivered { background: #fdf3e3; color: var(--amber); }
.stop-partially_delivered::before { background: var(--amber); }
.stop-failed              { background: #fbeae8; color: var(--danger); }
.stop-failed::before      { background: var(--danger); }

/* General love: crisper focus, calmer buttons, dialog headers */
.btn:hover { border-color: #cdd5e3; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
select {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--ink);
}
.panel h2 { font-size: 17px; }
.panel > .muted { line-height: 1.5; max-width: 68ch; }

/* Password show/hide eye */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; padding: 6px; color: var(--ink-faint);
}
.pw-eye:hover { color: var(--ink); }

/* Self-signup (v2 §2.12) */
.signup-cta { font-size: 13.5px; color: var(--ink-soft); margin-top: 16px; text-align: center; }
.signup-cta a { color: var(--accent); font-weight: 600; text-decoration: none; }
.signup-cta a:hover { text-decoration: underline; }
.activation-code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 22px; font-weight: 700; letter-spacing: 2px;
  color: var(--navy); background: var(--accent-soft);
  border: 1px dashed var(--accent); border-radius: 10px;
  padding: 14px 16px; text-align: center; user-select: all;
}

/* ── UX restructure 2026-07-17: icons + utilities ────────── */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none;
       stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
       vertical-align: -4px; flex: none; }
.ico-sm { width: 13px; height: 13px; vertical-align: -2px; }
.icon-btn { padding: 8px 10px; line-height: 0; }
.btn .ico { margin-right: 4px; }

.note { font-size: 13px; line-height: 1.5; }
.note-sm { font-size: 12.5px; line-height: 1.5; }
.note-xs { font-size: 12px; line-height: 1.5; }
.mt-6 { margin-top: 6px; }  .mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.row-inline { display: inline-flex; align-items: center; gap: 6px; }
.w-120 { flex: 0 0 120px; width: 120px; }
.w-full { width: 100%; }
.push-right { margin-left: auto; white-space: nowrap; }
.push-left { margin-right: auto; }
.chips-block { margin: 14px 0 10px; }
.date-range { display: flex; gap: 8px; align-items: center; }

/* Παραδόσεις: per-driver / per-day <details><summary> grouping */
.deliv-driver { margin-top: 14px; }
.deliv-drv-sum { cursor: pointer; font-weight: 700; font-size: 15px;
  border-bottom: 1px solid var(--line); padding-bottom: 4px; list-style-position: inside; }
.deliv-day-sum { cursor: pointer; font-weight: 600; font-size: 13.5px;
  margin: 6px 0 4px; list-style-position: inside; }
.deliv-days { padding-left: 6px; }
.fw-400 { font-weight: 400; }

.pill { display: inline-block; border-radius: 999px; padding: 3px 10px;
        font-size: 12px; font-weight: 600; }
.pill-ok { background: #e6f6ec; color: #1a7a3a; }
.pill-idle { background: #f1f1f4; color: #666; }
.wait-note { font-size: 12.5px; color: var(--ink-soft); }
.danger-ghost { color: var(--danger); border-color: #ddb8b4; background: transparent; }
.brand-points .ico { color: #7fb0ea; }

/* Sectioned dialogs (Ρυθμίσεις, Λεπτομέρειες): scrolling body, pinned footer */
.dlg-lg { width: min(640px, 94vw); }
.dialog-col { display: flex; flex-direction: column; max-height: min(85vh, 720px); padding: 0; }
.dialog-col .dialog-head { padding: 20px 26px 0; }
.dialog-scroll { overflow-y: auto; padding: 0 26px; flex: 1; min-height: 0; }
.dialog-col .dialog-actions { margin-top: 0; padding: 14px 26px;
  border-top: 1px solid var(--line); background: var(--card); }
.settings-sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.settings-sec:last-of-type { border-bottom: none; }
.settings-sec h3 { margin: 0; }
.settings-sec label { margin-top: 12px; }
.settings-sec .row-inline { margin-top: 0; }
.settings-sec summary { cursor: pointer; }

/* Panel heads: title left, page action pinned right */
.panel-head { display: flex; justify-content: space-between; align-items: flex-start;
              gap: 14px; margin-bottom: 4px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-sub { font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.help-toggle { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-soft); font-size: 12px; font-weight: 700;
  cursor: pointer; line-height: 1; padding: 0; flex: none; }
.help-toggle:hover { border-color: var(--accent); color: var(--accent); }
.help-text { max-width: 68ch; margin-top: 6px; }
.range-chips { gap: 6px; margin-top: 10px; }

.detail-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.detail-tools .btn .ico { margin-right: 6px; }

/* Loading skeletons + empty states */
.skel-row { height: 44px; border-radius: 10px; margin: 8px 0;
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 45%, #eef1f6 65%);
  background-size: 200% 100%; animation: skel 1.1s linear infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty-state { padding: 42px 16px; text-align: center; color: var(--ink-soft); }
.empty-state .ico { width: 30px; height: 30px; color: var(--ink-faint); }
.empty-state p { margin: 10px 0 14px; font-size: 14px; }

/* Mobile shell: fixed top bar + slide-in drawer */
.topbar { display: none; }
@media (min-width: 900px) { .drawer-backdrop { display: none; } }
@media (max-width: 899px) {
  body.drawer-lock { overflow: hidden; }
  .app { display: block; }
  .topbar { display: flex; align-items: center; gap: 10px; position: fixed;
    top: 0; left: 0; right: 0; height: 54px; background: var(--navy);
    padding: 0 10px; z-index: 50; }
  .topbar .logo-word { color: #fff; font-size: 15.5px; }
  .topbar .icon-btn { color: #dbe3f0; border-color: transparent; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; z-index: 70;
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(5, 12, 25, .35); }
  .side.open { transform: none; }
  .drawer-backdrop { position: fixed; inset: 0; background: rgba(12, 20, 36, .45); z-index: 60; }
  .main { padding: 68px 14px 60px; }
}

/* <720px: tables become labeled cards */
@media (max-width: 719px) {
  .card-table table, .card-table thead, .card-table tbody,
  .card-table tr, .card-table td { display: block; }
  .card-table thead { display: none; }
  .card-table table { min-width: 0; }
  .card-table tr { border: 1px solid var(--line); border-radius: 12px;
    padding: 4px 12px; margin-bottom: 10px; background: var(--card); }
  .card-table tbody tr:hover { background: var(--card); }
  .card-table td { display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; padding: 7px 0; border-bottom: 1px solid #f0f2f7; font-size: 14px;
    text-align: right; }
  .card-table td:last-child { border-bottom: none; }
  .card-table td::before { content: attr(data-label); color: var(--ink-faint);
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
    text-align: left; flex: none; }
  .card-table td.actions-cell { justify-content: flex-end; }
  .card-table td.actions-cell::before { content: none; }
  .card-table td:not([data-label]):not(.actions-cell) { justify-content: flex-start; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input[type="search"] { max-width: none; }
  .toolbar .push-right { margin-left: 0; }
  .toolbar .date-range input { flex: 1; width: auto; }
  .range-chips { flex-direction: row; flex-wrap: wrap; }
  .stats { grid-template-columns: 1fr 1fr; }
  .panel-head { flex-direction: column; }
  .panel-head > .btn { align-self: stretch; }
  .chip { padding: 8px 15px; }
  .row-actions .btn { padding: 8px 14px; }
}

/* <560px: dialogs become bottom sheets */
@media (max-width: 559px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto auto 0;
    border-radius: 16px 16px 0 0; max-height: 92dvh; overflow: auto; }
  .dlg-lg { width: 100vw; max-width: 100vw; }
  .dialog-body { padding: 18px; }
  .dialog-col { max-height: 92dvh; }
  .dialog-col .dialog-head { padding: 16px 18px 0; }
  .dialog-scroll { padding: 0 18px; }
  .dialog-col .dialog-actions { padding: 12px 18px; }
  dialog:not(.dlg-lg) .dialog-actions { position: sticky; bottom: 0;
    background: var(--card); padding: 12px 0 0; margin-top: 16px;
    border-top: 1px solid var(--line); }
}
