/* ═══════════════════════════════════════════════════════════════
   Sprayops — σχεδιασμένο για χρήση στις 05:30 μέσα σε αγροτικό.
   Παλέτα «προ-αυγής»: βαθύ μπλε-μαύρο ουρανού, χρυσό σταριού για δράσεις.
   Το χρώμα κρατιέται για ένα πράγμα: το φανάρι του παραθύρου ψεκασμού.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --bg:        #0B0F14;
  --surface:   #141A22;
  --surface-2: #1C2530;
  --surface-3: #243040;
  --line:      #29343F;
  --ink:       #E6EDF3;
  --ink-2:     #A9B7C6;
  --dim:       #6F7E8E;

  --accent:    #E9B949;   /* στάρι / ανατολή */
  --accent-ink:#1A1206;
  --go:        #3FA46A;
  --caution:   #E09E2E;
  --stop:      #CF4E3C;
  --cool:      #4E9FD1;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --tap: 48px;              /* γάντια εργασίας */
  --nav-h: 68px;
  --safe: env(safe-area-inset-bottom, 0px);

  --display: 'Archivo', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

body { padding-bottom: calc(var(--nav-h) + var(--safe)); }

h1, h2, h3, .display {
  font-family: var(--display);
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: 1.55rem; font-weight: 800; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

.num { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ── Σκελετός ─────────────────────────────────────────────── */

#app { min-height: 100vh; }

.view { padding: 14px 16px 24px; max-width: 780px; margin: 0 auto; animation: rise .22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, var(--bg) 72%, transparent);
  max-width: 780px; margin: 0 auto;
}
.topbar h1 { flex: 1; }
.topbar .sub { color: var(--dim); font-size: .8rem; font-weight: 500; }

.eyebrow {
  font-size: .68rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--dim);
  margin: 26px 0 10px;
}
.eyebrow:first-child { margin-top: 4px; }

/* ── Κάρτες ───────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px;
  margin-bottom: 11px;
}
.card.tap { cursor: pointer; transition: border-color .15s, transform .1s; }
.card.tap:active { transform: scale(.988); border-color: var(--surface-3); }

.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.muted { color: var(--dim); font-size: .82rem; }
.small { font-size: .78rem; }
.mono { font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ── Στατιστικά ───────────────────────────────────────────── */

.stat { background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--r); padding: 13px 14px; }
.stat .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
               color: var(--dim); font-weight: 700; }
.stat .value { font-family: var(--display); font-size: 1.5rem; font-weight: 800;
               margin-top: 5px; font-variant-numeric: tabular-nums; }
.stat .value.sm { font-size: 1.15rem; }
.stat .foot { font-size: .74rem; color: var(--dim); margin-top: 2px; }
.pos { color: var(--go); } .neg { color: var(--stop); }

/* ── Κουμπιά ──────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  font-weight: 600; cursor: pointer;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--stop); border-color: #48302C; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .85rem; }

.fab {
  position: fixed; right: 18px; z-index: 45;
  bottom: calc(var(--nav-h) + var(--safe) + 18px);
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  border: none; font-size: 30px; font-weight: 300;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 26px rgba(233, 185, 73, .3);
}
.fab:active { transform: scale(.92); }

/* ── Πλοήγηση ─────────────────────────────────────────────── */

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--nav-h) + var(--safe));
  padding-bottom: var(--safe);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(20, 26, 34, .96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav button {
  background: none; border: none; color: var(--dim);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: .66rem; font-weight: 600; cursor: pointer;
}
.nav button svg { width: 22px; height: 22px; stroke-width: 1.9; }
.nav button.on { color: var(--accent); }

/* ── ΥΠΟΓΡΑΦΗ: η λωρίδα παραθύρου ψεκασμού ────────────────── */
/* 24 κάθετες σχισμές = ένα 24ωρο. Ο ορίζοντας της ημέρας με μια ματιά. */

.window-band { margin: 12px 0 4px; }
.band {
  display: grid; grid-template-columns: repeat(24, 1fr);
  gap: 2px; height: 46px; border-radius: var(--r-sm); overflow: hidden;
}
.slat {
  background: var(--surface-3); position: relative;
  transition: opacity .15s; cursor: pointer;
}
.slat.go      { background: var(--go); }
.slat.caution { background: var(--caution); }
.slat.no      { background: var(--stop); opacity: .58; }
.slat.unknown { background: var(--surface-3); }
.slat.now::after {
  content: ''; position: absolute; inset: 0;
  border: 2px solid var(--ink); border-radius: 2px;
}
.slat.marked::before {
  content: ''; position: absolute; left: 50%; top: -7px;
  transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--accent);
}
.band-axis {
  display: grid; grid-template-columns: repeat(24, 1fr);
  font-size: .58rem; color: var(--dim); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.band-axis span { text-align: center; }
.band-axis span:not(:nth-child(4n+1)) { visibility: hidden; }

.verdict {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
}
.verdict.go      { background: rgba(63,164,106,.16); color: var(--go); }
.verdict.caution { background: rgba(224,158,46,.16); color: var(--caution); }
.verdict.no      { background: rgba(207,78,60,.16); color: var(--stop); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.metric { text-align: center; padding: 9px 4px; background: var(--surface-2);
          border-radius: var(--r-sm); }
.metric .k { font-size: .62rem; color: var(--dim); text-transform: uppercase;
             letter-spacing: .06em; font-weight: 700; }
.metric .v { font-family: var(--display); font-size: 1.02rem; font-weight: 700; margin-top: 2px; }

.reasons { list-style: none; padding: 0; margin: 12px 0 0; }
.reasons li { font-size: .82rem; color: var(--ink-2); padding: 5px 0 5px 16px;
              position: relative; }
.reasons li::before { content: '—'; position: absolute; left: 0; color: var(--dim); }

/* ── ΥΠΟΓΡΑΦΗ 2: η ζυγαριά εκκαθάρισης ────────────────────── */

.scale { padding: 20px 16px 16px; text-align: center; }
.scale-beam {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: end; gap: 10px; margin: 18px 0 12px;
}
.pan { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pan .who { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.pan .bar {
  width: 100%; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--line); border-bottom: none;
  display: grid; place-items: end center; padding-bottom: 8px;
  transition: height .4s cubic-bezier(.4,0,.2,1);
}
.pan .amt { font-family: var(--display); font-weight: 800; font-size: 1rem;
            font-variant-numeric: tabular-nums; }
.pan.heavy .bar { background: linear-gradient(180deg, var(--accent), #B98F32); }
.pan.heavy .amt { color: var(--accent-ink); }
.fulcrum { width: 2px; height: 100%; background: var(--line); }
.scale-verdict { font-family: var(--display); font-size: 1.05rem; font-weight: 700;
                 margin-top: 8px; }

/* ── Φόρμες ───────────────────────────────────────────────── */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .76rem; font-weight: 700;
               color: var(--ink-2); margin-bottom: 6px;
               text-transform: uppercase; letter-spacing: .05em; }
.field .req { color: var(--accent); }
input, select, textarea {
  width: 100%; min-height: var(--tap);
  padding: 11px 14px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  outline: none;
}
textarea { min-height: 86px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--dim); }
select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236F7E8E' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

.seg { display: flex; gap: 6px; background: var(--surface-2);
       padding: 4px; border-radius: 999px; }
.seg button { flex: 1; min-height: 38px; border: none; border-radius: 999px;
              background: none; color: var(--dim); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--ink); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { padding: 7px 13px; border-radius: 999px; background: var(--surface-2);
        border: 1px solid var(--line); font-size: .8rem; cursor: pointer;
        font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ── Modal ────────────────────────────────────────────────── */

.backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 7, 10, .74); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .16s ease-out;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  width: 100%; max-width: 780px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-top: 1px solid var(--line);
  padding: 8px 16px calc(24px + var(--safe));
  animation: slide .24s cubic-bezier(.32,.72,0,1);
}
@keyframes slide { from { transform: translateY(100%) } to { transform: none } }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line);
              margin: 8px auto 14px; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { flex: 1; }
.x { width: 38px; height: 38px; border-radius: 50%; border: none;
     background: var(--surface-2); color: var(--ink-2); font-size: 20px; cursor: pointer; }

/* ── Λοιπά ────────────────────────────────────────────────── */

.empty { text-align: center; padding: 46px 20px; color: var(--dim); }
.empty .icon { font-size: 34px; opacity: .35; margin-bottom: 10px; }
.empty p { margin: 0 0 16px; font-size: .88rem; }

.badge { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
         background: var(--surface-3); color: var(--ink-2); text-transform: uppercase;
         letter-spacing: .05em; }
.badge.go { background: rgba(63,164,106,.18); color: var(--go); }
.badge.warn { background: rgba(224,158,46,.18); color: var(--caution); }
.badge.stop { background: rgba(207,78,60,.18); color: var(--stop); }
.badge.cool { background: rgba(78,159,209,.18); color: var(--cool); }

.bar-track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 3px;
            transition: width .4s ease; }
.bar-fill.go { background: var(--go); }
.bar-fill.warn { background: var(--caution); }
.bar-fill.stop { background: var(--stop); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe) + 22px); z-index: 200;
  background: var(--surface-3); color: var(--ink);
  padding: 13px 20px; border-radius: 999px; font-size: .87rem; font-weight: 600;
  border: 1px solid var(--line); box-shadow: 0 10px 32px rgba(0,0,0,.5);
  animation: rise .2s ease-out;
  max-width: 90vw; text-align: center;
}
.toast.err { border-color: #4A312C; color: #F0A79A; }
.toast.ok { border-color: #2A4A38; color: #8DD9AE; }

.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  background: var(--caution); color: #221803;
  text-align: center; font-size: .76rem; font-weight: 700; padding: 5px;
}

.spinner { width: 22px; height: 22px; border: 2px solid var(--line);
           border-top-color: var(--accent); border-radius: 50%;
           animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg) } }

.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 0;
             border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.avatar { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
          background: var(--surface-3); display: grid; place-items: center;
          font-family: var(--display); font-weight: 800; color: var(--accent); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

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

@media (min-width: 720px) {
  .nav { grid-template-columns: repeat(5, minmax(0, 156px)); justify-content: center; }
}
