/* Squareflow · Διαχείριση — Σύστημα σχεδίου
   © Squareflow Agency Athens */

:root {
  color-scheme: light dark;
  --bg: #F2F2F7;
  --bg-elev: #FFFFFF;
  --bg-elev-2: #F7F7FA;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .08);
  --label: #111316;
  --label-2: rgba(60, 60, 67, .62);
  --label-3: rgba(60, 60, 67, .36);
  --sep: rgba(60, 60, 67, .16);
  --bar: rgba(249, 249, 251, .78);
  --accent: #4F7062;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(86, 120, 106, .13);
  --brand-dot: #56786A;
  --green: #248A3D;
  --green-soft: rgba(52, 199, 89, .14);
  --orange: #C25E00;
  --orange-soft: rgba(255, 149, 0, .15);
  --red: #D70015;
  --red-soft: rgba(255, 59, 48, .12);
  --blue: #0A63D6;
  --blue-soft: rgba(0, 122, 255, .11);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .18);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --sidebar: 264px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elev: #1C1C1E;
    --bg-elev-2: #2C2C2E;
    --fill: rgba(120, 120, 128, .24);
    --fill-2: rgba(120, 120, 128, .16);
    --label: #F4F5F6;
    --label-2: rgba(235, 235, 245, .62);
    --label-3: rgba(235, 235, 245, .32);
    --sep: rgba(84, 84, 88, .55);
    --bar: rgba(22, 22, 24, .78);
    --accent: #A8C1B3;
    --accent-ink: #0E1512;
    --accent-soft: rgba(168, 193, 179, .16);
    --brand-dot: #A8C1B3;
    --green: #30D158;
    --green-soft: rgba(48, 209, 88, .16);
    --orange: #FF9F0A;
    --orange-soft: rgba(255, 159, 10, .16);
    --red: #FF453A;
    --red-soft: rgba(255, 69, 58, .16);
    --blue: #409CFF;
    --blue-soft: rgba(10, 132, 255, .18);
    --shadow: none;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
svg { display: block; }
.logo .dot, .boot-logo .dot { fill: var(--brand-dot); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Εκκίνηση ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; transition: opacity .4s var(--ease); }
.boot-logo { width: 168px; color: var(--label); animation: breathe 1.6s ease-in-out infinite; }
.boot.out { opacity: 0; pointer-events: none; }
@keyframes breathe { 50% { opacity: .45; } }

/* ---------- Δομή ---------- */
#app { min-height: 100dvh; }
.main { overflow-x: clip; }
.sidebar { display: none; }
.main { padding: calc(var(--safe-t) + 8px) 16px calc(96px + var(--safe-b)); max-width: 1180px; margin: 0 auto; outline: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + var(--safe-b));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; border: 0; background: none; color: var(--label-3); font-size: 10.5px; font-weight: 500; letter-spacing: 0; cursor: pointer; }
.tab svg { width: 25px; height: 25px; }
.tab.on { color: var(--accent); }

@media (min-width: 900px) {
  #app { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
    padding: 22px 14px 18px; border-right: .5px solid var(--sep); background: var(--bg-elev-2);
  }
  @media (prefers-color-scheme: dark) { .sidebar { background: #0E0E10; } }
  .sidebar-brand { padding: 6px 12px 26px; }
  .sidebar-brand .logo { width: 140px; color: var(--label); }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--label); font-weight: 500; border: 0; background: none; text-align: left; cursor: pointer; width: 100%; }
  .side-link svg { width: 21px; height: 21px; color: var(--accent); }
  .side-link:hover { background: var(--fill-2); }
  .side-link.on { background: var(--accent); color: var(--accent-ink); }
  .side-link.on svg { color: currentColor; }
  .side-sep { height: 18px; }
  .sidebar-foot { margin-top: auto; padding: 12px; font-size: 13px; color: var(--label-2); display: flex; align-items: center; gap: 10px; }
  .main { padding: 28px 40px 60px; width: 100%; }
}

@media (min-width: 900px) { .mobile-only { display: none !important; } }

/* ---------- Μπάρα πλοήγησης ---------- */
.navbar {
  position: sticky; top: 0; z-index: 15; margin: 0 -16px; padding: calc(var(--safe-t) + 8px) 16px 8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px;
  transition: background .2s, border-color .2s;
  border-bottom: .5px solid transparent;
}
.navbar.stuck { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--sep); }
.navbar-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.navbar.stuck .navbar-title { opacity: 1; }
.navbar-l { justify-self: start; display: flex; gap: 4px; }
.navbar-r { justify-self: end; display: flex; gap: 6px; }
@media (min-width: 900px) { .navbar { margin: -28px -40px 0; padding: 14px 40px; } }

.nav-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 6px; border: 0; background: none; color: var(--accent); font-size: 17px; cursor: pointer; border-radius: 10px; }
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn:hover { background: var(--fill-2); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--fill); color: var(--accent); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.solid { background: var(--accent); color: var(--accent-ink); }

.large-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.large-title h1 { margin: 0; font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; }
.large-title .sub { color: var(--label-2); font-size: 15px; margin-top: 4px; }
@media (min-width: 900px) { .large-title { margin-top: 18px; } }

/* ---------- Αναζήτηση & segmented ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--label-2); }
.search input { width: 100%; height: 38px; border: 0; border-radius: 11px; background: var(--fill); padding: 0 12px 0 34px; font-size: 16px; outline: none; }
.search input::placeholder { color: var(--label-2); }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 10px; background: var(--fill); position: relative; isolation: isolate; max-width: 100%; }
.seg button { border: 0; background: none; padding: 6px 14px; font-size: 13.5px; font-weight: 500; border-radius: 8px; cursor: pointer; white-space: nowrap; position: relative; }
.seg button.on { background: var(--bg-elev); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
.seg-wrap { overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.seg-wrap::-webkit-scrollbar { display: none; }

/* ---------- Ενότητες & λίστες ---------- */
.section { margin-bottom: 26px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 7px; }
.section-h h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.section-h .cap { text-transform: uppercase; font-size: 12.5px; font-weight: 500; color: var(--label-2); letter-spacing: .02em; }
.section-h a, .section-h button { font-size: 15px; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }
.foot-note { color: var(--label-2); font-size: 13px; padding: 7px 16px 0; }

.list { background: var(--bg-elev); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 16px;
  border: 0; background: none; text-align: left; cursor: default; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.row.has-lead + .row::before, .row.has-lead + .row.has-lead::before { left: 62px; }
button.row, a.row { cursor: pointer; color: inherit; transition: background .15s; }
button.row:active, a.row:active { background: var(--fill-2); }
@media (hover: hover) { button.row:hover, a.row:hover { background: var(--fill-2); } }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13.5px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row-end { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.row-val { font-size: 15.5px; font-variant-numeric: tabular-nums; font-weight: 500; }
.row-val.muted { color: var(--label-2); font-weight: 400; }
.chev { width: 14px; height: 14px; color: var(--label-3); flex-shrink: 0; }
.row.kv .row-title { font-weight: 400; color: var(--label); }
.row.kv .row-val { font-weight: 400; color: var(--label-2); white-space: pre-wrap; text-align: right; max-width: 62%; overflow-wrap: anywhere; }
.row.danger .row-title { color: var(--red); }
.row.action .row-title { color: var(--accent); font-weight: 400; }

.lead-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.lead-ico svg { width: 19px; height: 19px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 600; font-size: 14px; color: #fff; letter-spacing: 0; }
.avatar.lg { width: 76px; height: 76px; font-size: 28px; }

.empty { text-align: center; padding: 40px 20px; color: var(--label-2); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--label-3); }
.empty b { display: block; color: var(--label); font-size: 17px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------- Ετικέτες κατάστασης ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap; background: var(--fill); color: var(--label-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.plain::before { display: none; }

/* ---------- Κάρτες KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 26px; }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--bg-elev); border-radius: var(--r-lg); padding: 15px 16px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; border: 0; text-align: left; cursor: pointer; color: inherit; transition: transform .2s var(--ease); }
.kpi:active { transform: scale(.98); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--label-2); font-size: 13.5px; font-weight: 500; }
.kpi-top .lead-ico { width: 28px; height: 28px; border-radius: 8px; }
.kpi-top .lead-ico svg { width: 16px; height: 16px; }
.kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1.1; }
.kpi-foot { font-size: 12.5px; color: var(--label-2); line-height: 1.35; }
.kpi-foot span { white-space: nowrap; }
.kpi-foot .up { color: var(--green); font-weight: 600; }
.kpi-foot .down { color: var(--red); font-weight: 600; }
@media (max-width: 380px) { .kpi-val { font-size: 22px; } }

.grid-2 { display: grid; gap: 0 22px; }
.grid-2 > * { min-width: 0; }
@media (min-width: 1100px) { .grid-2 { grid-template-columns: 1.35fr 1fr; } }

/* ---------- Γράφημα ---------- */
.chart-card { background: var(--bg-elev); border-radius: var(--r-lg); padding: 18px 18px 14px; box-shadow: var(--shadow); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.chart-head .big { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart-head .small { font-size: 13px; color: var(--label-2); }
.legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--label-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 180px; align-items: end; }
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; position: relative; cursor: default; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar { width: min(14px, 42%); border-radius: 5px 5px 2px 2px; background: var(--accent); min-height: 2px; transform-origin: bottom; animation: grow .7s var(--ease) both; }
.bar.alt { background: rgba(120, 120, 128, .2); }
@media (prefers-color-scheme: dark) { .bar.alt { background: rgba(120, 120, 128, .38); } }
.bar-lbl { font-size: 11px; color: var(--label-2); letter-spacing: 0; white-space: nowrap; }
@media (max-width: 520px) { .bars { gap: 3px; height: 150px; } .bar-lbl { font-size: 9.5px; letter-spacing: -.02em; } .legend { flex-direction: column; gap: 2px; } }
.bar-col.now .bar-lbl { color: var(--label); font-weight: 600; }
.bar-tip { position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translate(-50%, 4px); background: var(--label); color: var(--bg-elev); font-size: 12px; padding: 5px 8px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .15s; z-index: 2; line-height: 1.35; }
.bar-col:hover .bar-tip, .bar-col:focus .bar-tip { opacity: 1; transform: translate(-50%, 0); }
.bar-col:nth-child(-n+3) .bar-tip { left: 0; transform: translate(0, 4px); }
.bar-col:nth-last-child(-n+3) .bar-tip { left: auto; right: 0; transform: translate(0, 4px); }
.bar-col:nth-child(-n+3):hover .bar-tip, .bar-col:nth-child(-n+3):focus .bar-tip,
.bar-col:nth-last-child(-n+3):hover .bar-tip, .bar-col:nth-last-child(-n+3):focus .bar-tip { transform: none; }
@keyframes grow { from { transform: scaleY(0); } }

/* ---------- Κεφαλίδα λεπτομερειών ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin: 4px 0 20px; }
.hero h1 { margin: 6px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.hero .sub { color: var(--label-2); font-size: 15px; }
.hero-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.hero-act { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 74px; padding: 9px 10px 8px; border-radius: 13px; background: var(--bg-elev); color: var(--accent); font-size: 12px; font-weight: 500; border: 0; cursor: pointer; box-shadow: var(--shadow); }
.hero-act svg { width: 21px; height: 21px; }
.hero-act[aria-disabled="true"] { opacity: .4; pointer-events: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); background: var(--bg-elev); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.stat { padding: 13px 16px; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; border-left: .5px solid var(--sep); }
.stat .k { font-size: 12.5px; color: var(--label-2); }
.stat .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 2px; }
.v.red { color: var(--red); }
.v.green { color: var(--green); }

/* ---------- Κουμπιά ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--fill); color: var(--accent); font-size: 16px; font-weight: 600; cursor: pointer; transition: transform .15s var(--ease), opacity .15s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 14.5px; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Φόρμες (ομάδες τύπου iOS) ---------- */
.group { background: var(--bg-elev); border-radius: var(--r); overflow: hidden; margin: 0 0 22px; }
.sheet .group { background: var(--bg-elev); }
.group-label { text-transform: uppercase; font-size: 12.5px; color: var(--label-2); padding: 0 16px 7px; letter-spacing: .02em; }
.group-note { font-size: 13px; color: var(--label-2); padding: 0 16px; margin: -15px 0 22px; }
.field { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.field > label { flex: 0 0 auto; max-width: 58%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.field input, .field select, .field textarea { flex: 1; min-width: 0; border: 0; background: none; font-size: 16px; padding: 12px 0; outline: none; text-align: right; color: var(--label); }
.field input::placeholder, .field textarea::placeholder { color: var(--label-3); }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; color: var(--label-2); direction: rtl; padding-right: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right center / 12px no-repeat; }
.field select option { direction: ltr; color: initial; }
.field.stack { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
.field.stack > label { width: auto; max-width: none; font-size: 13px; color: var(--label-2); }
.field.stack textarea, .field.stack input { text-align: left; padding: 6px 0 12px; resize: vertical; min-height: 44px; }
.field textarea { min-height: 96px; line-height: 1.45; }
.field .suffix { color: var(--label-2); }
.field.calc input { color: var(--label-2); }
.field.total > label, .field.total input { font-weight: 600; color: var(--label); }
input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 1.4em; }
input[type="date"]::-webkit-date-and-time-value { text-align: right; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }

.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; margin-left: auto; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--fill); transition: background .25s; }
@media (prefers-color-scheme: dark) { .switch span { background: rgba(120, 120, 128, .32); } }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .3s var(--ease); }
.switch input:checked + span { background: #34C759; }
.switch input:checked + span::after { transform: translateX(20px); }

.seg-field { padding: 8px 12px; }
.seg-field .seg { display: grid; width: 100%; }

.file-drop { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; position: relative; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop .lead-ico { background: var(--accent); color: var(--accent-ink); }
.file-drop.drag { background: var(--accent-soft); }

/* ---------- Φύλλα (sheets) & διάλογοι ---------- */
.layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .35s var(--ease); pointer-events: auto; }
.scrim.on { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--safe-t) + 18px);
  display: flex; flex-direction: column; background: var(--bg); border-radius: 14px 14px 0 0;
  transform: translateY(105%); transition: transform .45s var(--ease); pointer-events: auto; box-shadow: var(--shadow-lg);
}
@media (prefers-color-scheme: dark) { .sheet { background: #1C1C1E; } .sheet .group, .sheet .list { background: #2C2C2E; } }
.sheet.on { transform: none; }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 6px auto 0; flex-shrink: 0; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 8px 8px; flex-shrink: 0; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .nav-btn:last-child { justify-self: end; font-weight: 600; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 16px calc(28px + var(--safe-b)); overscroll-behavior: contain; }
@media (min-width: 700px) {
  .sheet { left: 50%; top: 50%; bottom: auto; width: 600px; max-height: min(86dvh, 860px); border-radius: 18px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .35s var(--ease), opacity .25s; }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; }
  .sheet.wide { width: 860px; }
  .sheet-grab { display: none; }
  .sheet-head { padding: 12px 10px 6px; }
}

.alert-box { position: absolute; left: 50%; top: 50%; width: min(300px, calc(100% - 60px)); transform: translate(-50%, -50%) scale(1.1); opacity: 0; transition: .25s var(--ease); background: var(--bar); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border-radius: 15px; text-align: center; pointer-events: auto; overflow: hidden; }
@media (prefers-color-scheme: light) { .alert-box { background: rgba(242, 242, 246, .92); } }
.alert-box.on { transform: translate(-50%, -50%); opacity: 1; }
.alert-box h3 { margin: 20px 16px 4px; font-size: 17px; font-weight: 600; }
.alert-box p { margin: 0 16px 18px; font-size: 13.5px; color: var(--label-2); }
.alert-btns { display: grid; grid-auto-flow: column; border-top: .5px solid var(--sep); }
.alert-btns button { border: 0; background: none; padding: 12px; font-size: 17px; color: var(--accent); cursor: pointer; }
.alert-btns button + button { border-left: .5px solid var(--sep); }
.alert-btns .destructive { color: var(--red); font-weight: 600; }
.alert-btns button:active { background: var(--fill-2); }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; z-index: 60; background: var(--label); color: var(--bg-elev); padding: 11px 18px; border-radius: 99px; font-size: 14.5px; font-weight: 500; transition: .35s var(--ease); pointer-events: none; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-lg); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 32px; left: calc(50% + var(--sidebar) / 2); } }

/* ---------- Σύνδεση ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 18px calc(32px + var(--safe-b)); }
.auth-card { width: 100%; max-width: 380px; }
.auth-logo .logo { width: 176px; color: var(--label); margin: 0 auto 34px; }
.auth h1 { text-align: center; font-size: 28px; margin: 0; letter-spacing: -.02em; }
.auth-sub { text-align: center; color: var(--label-2); margin: 6px 0 26px; }
.auth .field > label { min-width: 84px; }
.auth-err { color: var(--red); text-align: center; min-height: 20px; font-size: 14px; margin: -10px 0 12px; }
.auth-foot { color: var(--label-3); font-size: 12.5px; margin-top: 40px; }

/* ---------- Προεπισκόπηση αρχείου ---------- */
.preview { border-radius: var(--r); overflow: hidden; background: var(--bg-elev); margin-bottom: 22px; box-shadow: var(--shadow); }
.preview iframe { width: 100%; height: 420px; border: 0; display: block; background: #fff; }
.preview img { width: 100%; display: block; }

/* ---------- Εναλλαγή οθονών ---------- */
.view { animation: viewIn .35s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.skeleton { height: 64px; border-radius: var(--r); background: linear-gradient(90deg, var(--fill-2), var(--fill), var(--fill-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.muted { color: var(--label-2); }
.num { font-variant-numeric: tabular-nums; }
.mt0 { margin-top: 0; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Υπενθυμίσεις & εγκατάσταση ---------- */
.bell { position: relative; }
.bell .dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; letter-spacing: 0; box-shadow: 0 0 0 2px var(--bg); }
.navbar-r .icon-btn { text-decoration: none; }
.side-count { margin-left: auto; min-width: 22px; text-align: center; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 11px; padding: 1px 7px; letter-spacing: 0; }
.side-link.on .side-count { background: var(--accent-ink); color: var(--accent); }

.notice { display: flex; align-items: center; gap: 12px; background: var(--bg-elev); border-radius: var(--r-lg); padding: 14px 14px 14px 16px; box-shadow: var(--shadow); margin-bottom: 22px; position: relative; }
.notice .row-main { display: flex; flex-direction: column; gap: 2px; }
.notice b { font-size: 15.5px; font-weight: 600; }
.notice span { font-size: 13.5px; color: var(--label-2); }
.notice .lead-ico { width: 40px; height: 40px; border-radius: 11px; }
.notice .btn { flex-shrink: 0; }
.notice .x { border: 0; background: var(--fill); color: var(--label-2); width: 26px; height: 26px; border-radius: 50%; font-size: 17px; line-height: 1; cursor: pointer; flex-shrink: 0; }
@media (max-width: 520px) { .notice { flex-wrap: wrap; } .notice .row-main { flex: 1 1 calc(100% - 100px); } .notice .btn { margin-left: 52px; } }

.linkish { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.code-row { align-items: center; }
.code-row code { display: block; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--label); word-break: break-all; margin-top: 3px; user-select: all; }
.app-icon { width: 78px; height: 78px; border-radius: 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; margin: 0 2px; }
.step-ico { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.row-title.wrap, .row-sub.wrap { white-space: normal; }
