/* GTAUTO — темна тема: графітові картки, лаймовий акцент, навігація-«пігулка» */
:root {
  --page:#0d0f13; --shell:#16191f; --card:#1e2229; --card-2:#262b33; --field:#14171c;
  --line:#2d323b; --line-2:#3a404b; --text:#f3f5f7; --muted:#8a92a0;
  --accent:#b8f23c; --accent-ink:#11160a; --accent-soft:rgba(184,242,60,.12);
  --ok:#a3e635; --warn:#fbbf24; --err:#ff6b6b;
  --r-xl:28px; --r-lg:20px; --r-md:14px; --r-pill:999px;
  color-scheme: dark;
}
/* Світла картка (як біла панель у референсі) — для таблиць */
.light {
  --card:#f4f5f1; --card-2:#e9ebe5; --field:#ffffff; --line:#dfe2da; --line-2:#cfd3c9;
  --text:#14171c; --muted:#6b7280; --accent-soft:rgba(17,22,10,.06); --ok:#3f7d0c; --warn:#b45309; --err:#c0392b;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background:var(--page); }
body { margin:0; font:15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif; color:var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #222833 0%, transparent 60%), linear-gradient(180deg, #171a20 0%, #0d0f13 100%) fixed; min-height:100vh; -webkit-font-smoothing:antialiased; }
a { color:var(--accent); }
.light a { color:#2f5d06; }
code { background:var(--card-2); border:1px solid var(--line); padding:1px 6px; border-radius:6px; font-size:.92em; }

/* ---------- шапка ---------- */
header { position:sticky; top:0; z-index:10; background:rgba(13,15,19,.82); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); border-bottom:1px solid rgba(255,255,255,.04); }
.top { max-width:1280px; margin:0 auto; padding:12px 20px; display:flex; align-items:center; gap:16px; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text); font-weight:700; letter-spacing:.08em; font-size:15px; white-space:nowrap; }
.brand img { height:22px; width:auto; display:block; }
.top nav { display:flex; gap:2px; padding:4px; background:#f4f5f1; border-radius:var(--r-pill); flex:0 1 auto; overflow-x:auto; scrollbar-width:none; }
.top nav::-webkit-scrollbar { display:none; }
.top nav a { text-decoration:none; color:#2a2f37; padding:7px 14px; border-radius:var(--r-pill); font-size:14px; white-space:nowrap; transition:background .15s; }
.top nav a:hover { background:#e4e7df; }
.top nav a.on { background:var(--accent); color:var(--accent-ink); font-weight:600; }
.top .me { margin-left:auto; display:flex; gap:8px; align-items:center; color:var(--muted); font-size:14px; white-space:nowrap; }
.top .me a, .top .me .link { color:var(--text); text-decoration:none; border:1px solid var(--line-2); border-radius:var(--r-pill); padding:6px 12px; font-size:13px; }
.top .me a:hover, .top .me .link:hover { border-color:var(--accent); }
.avatar { width:32px; height:32px; border-radius:50%; background:var(--accent); color:var(--accent-ink); display:inline-grid; place-items:center; font-weight:700; font-size:13px; }

main { max-width:1280px; margin:0 auto; padding:28px 20px 64px; }
h1 { font-size:40px; line-height:1.1; font-weight:500; letter-spacing:-.02em; margin:4px 0 20px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
h2 { font-size:17px; font-weight:600; margin:0 0 14px; }

/* ---------- картки ---------- */
.card { background:var(--card); color:var(--text); border:1px solid var(--line); border-radius:var(--r-xl); padding:22px; margin-bottom:18px; box-shadow:0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -24px rgba(0,0,0,.6); }
.card .card { background:var(--card-2); border-radius:var(--r-lg); box-shadow:none; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; } @media (max-width:900px) { .grid2 { grid-template-columns:1fr; } }
.toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:end; margin-bottom:14px; }
.toolbar .grow, .grow { flex:1; min-width:180px; }

/* ---------- поля ---------- */
label { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted); letter-spacing:.01em; }
input, select, textarea { width:100%; min-width:0; font:inherit; font-size:14px; color:var(--text); background:var(--field); border:1px solid var(--line); border-radius:var(--r-md); padding:10px 14px; outline:none; transition:border-color .15s, box-shadow .15s; }
select { appearance:none; -webkit-appearance:none; padding-right:36px; background-image:linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position:calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size:5px 5px; background-repeat:no-repeat; }
input:focus, select:focus, textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
textarea { min-height:80px; resize:vertical; }
input[type=checkbox] { width:18px; height:18px; accent-color:var(--accent); padding:0; }
.form { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:10px; align-items:end; }
.form .wide { grid-column:1 / -1; }
.check-row { flex-direction:row; align-items:center; gap:10px; color:var(--text); font-size:15px; }

/* ---------- кнопки ---------- */
.btn { font:inherit; font-size:14px; font-weight:600; border:0; border-radius:var(--r-pill); padding:10px 18px; background:var(--accent); color:var(--accent-ink); cursor:pointer; white-space:nowrap; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:8px; transition:transform .1s, filter .15s; }
.btn:hover { filter:brightness(1.06); } .btn:active { transform:translateY(1px); } .btn:disabled { opacity:.5; cursor:default; }
.btn.ghost { background:transparent; color:var(--text); border:1px solid var(--line-2); font-weight:500; }
.btn.ghost:hover { border-color:var(--accent); }
.btn.sm { padding:5px 12px; font-size:13px; }
.btn.danger { background:transparent; color:var(--err); border:1px solid color-mix(in srgb, var(--err) 55%, transparent); font-weight:500; }
.light .btn:not(.ghost):not(.danger) { background:#14171c; color:#f4f5f1; }
.light .btn.ghost { color:#14171c; }
.link { background:none; border:0; color:var(--accent); cursor:pointer; font:inherit; padding:0; }

/* ---------- таблиці ---------- */
.table-wrap { overflow-x:auto; margin:0 -6px; }
table { width:100%; border-collapse:separate; border-spacing:0; }
th, td { text-align:left; padding:11px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:11px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
tbody tr:last-child td { border-bottom:0; }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
tr.click { cursor:pointer; }
tr.click td { transition:background .12s; }
tr.click:hover td { background:var(--accent-soft); }
tr.click:hover td:first-child { border-radius:14px 0 0 14px; } tr.click:hover td:last-child { border-radius:0 14px 14px 0; }
tfoot td { font-weight:600; border-bottom:0; border-top:1px solid var(--line-2); }
td a { text-decoration:none; font-weight:600; } td a:hover { text-decoration:underline; }
.light td a { color:#14171c; }

/* ---------- бейджі ---------- */
.badge { display:inline-flex; align-items:center; padding:3px 11px; border-radius:var(--r-pill); font-size:12px; font-weight:500; background:var(--card-2); color:var(--text); border:1px solid var(--line-2); white-space:nowrap; letter-spacing:0; text-transform:none; }
.badge.done { background:var(--accent); color:var(--accent-ink); border-color:transparent; }
.badge.cancel { background:transparent; color:var(--muted); }
.badge.need { background:transparent; color:var(--warn); border-color:color-mix(in srgb, var(--warn) 60%, transparent); }
h1 .badge { font-size:13px; padding:5px 14px; }

/* ---------- великі цифри ---------- */
.totals { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:12px; }
.totals > div { background:var(--card-2); border:1px solid var(--line); border-radius:var(--r-lg); padding:16px 18px; color:var(--muted); font-size:13px; min-height:112px; display:flex; flex-direction:column; }
.totals b { display:block; font-size:30px; font-weight:500; letter-spacing:-.02em; color:var(--text); font-variant-numeric:tabular-nums; margin:6px 0 2px; }
.totals > div:last-child { background:var(--accent); border-color:transparent; color:#3d4a1d; }
.totals > div:last-child b { color:var(--accent-ink); }
.totals > div:last-child .muted { color:#3d4a1d; }
.kv { display:grid; grid-template-columns:max-content 1fr; gap:4px 14px; } .kv dt { color:var(--muted); } .kv dd { margin:0; }
.timeline { list-style:none; padding:0; margin:14px 0 0; } .timeline li { padding:10px 0; border-bottom:1px dashed var(--line); }
.timeline li:last-child { border-bottom:0; }

.muted { color:var(--muted); font-size:13px; }
.err { color:var(--err); } .ok { color:var(--ok); }
.card.err { color:var(--err); }
.row-actions { display:flex; gap:6px; justify-content:flex-end; }
.mt { margin-top:14px; } .narrow { max-width:460px; }

#toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(8px); background:var(--accent); color:var(--accent-ink); font-weight:600; padding:11px 20px; border-radius:var(--r-pill); opacity:0; transition:opacity .2s, transform .2s; pointer-events:none; max-width:90vw; box-shadow:0 10px 30px rgba(0,0,0,.4); }
#toast.show { opacity:1; transform:translateX(-50%); } #toast.bad { background:var(--err); color:#fff; }

/* ---------- вхід ---------- */
.login { max-width:400px; margin:10vh auto; padding:32px; }
.login .logo { display:block; height:34px; margin:0 0 6px; }
.login .brandname { letter-spacing:.2em; font-weight:700; font-size:13px; color:var(--muted); margin:0 0 26px; }
.login h1 { font-size:28px; margin-bottom:18px; }
.login form > br { display:none; } .login form label { margin-bottom:12px; }
.btn.google { display:flex; gap:10px; background:#f4f5f1; color:#14171c; width:100%; padding:12px; margin-bottom:16px; }
.login button[type=submit] { width:100%; margin-top:4px; }

[hidden] { display:none !important; }
@media (max-width:760px) {
  .top { flex-wrap:wrap; gap:10px; padding:10px 14px; }
  .top nav { order:3; flex-basis:100%; }
  main { padding:20px 14px 48px; }
  h1 { font-size:30px; }
  .card { padding:16px; border-radius:22px; }
  .totals b { font-size:24px; }
  .hide-sm { display:none; }
}
.totals.stats { margin-bottom:18px; } .totals.stats > div { background:var(--card); border-radius:var(--r-xl); }
@media (max-width:760px) {
  .totals { grid-template-columns:1fr 1fr; gap:10px; }
  .totals > div { min-height:0; padding:14px; }
  .totals b { font-size:22px; }
}
.totals.stats > div:last-child { background:var(--accent); }
