/* Визуальный язык — как в дашборде наличия LikeAvto: стекло, золотой акцент, две темы. */
:root{
  --gold:#F4B400; --bg1:#f4f5f7; --bg2:#e9ebef; --text:#1a1a1c; --muted:rgba(26,26,28,.6);
  --muted2:rgba(26,26,28,.45); --glassbg:rgba(255,255,255,.65); --glassbrd:rgba(0,0,0,.08);
  --inputbg:rgba(255,255,255,.8); --optbg:#ffffff; --shadow:rgba(0,0,0,.12);
  --radial1:#fff6df; --radial2:#e8eef7; --goldtext:#8a6000; --outbg:rgba(244,180,0,.14); --outbrd:#C99400;
  --st-transit:#0b62c9; --st-arrived:#8a6100; --st-ready:#1a7a3a; --st-marked:#6f42c1;
  --st-bad:#c62828; --st-dealer:#5b6470;
}
[data-theme="dark"]{
  --bg1:#0e0e10; --bg2:#141416; --text:#ffffff; --muted:rgba(255,255,255,.5);
  --muted2:rgba(255,255,255,.4); --glassbg:rgba(255,255,255,.05); --glassbrd:rgba(255,255,255,.10);
  --inputbg:rgba(255,255,255,.06); --optbg:#1a1a1c; --shadow:rgba(0,0,0,.35);
  --radial1:#2a2620; --radial2:#1f2430; --goldtext:#F4B400; --outbg:rgba(244,180,0,.10); --outbrd:#F4B400;
  --st-transit:#58a6ff; --st-arrived:#e0a000; --st-ready:#3fb950; --st-marked:#d2a8ff;
  --st-bad:#ff6b6b; --st-dealer:#9aa3ae;
}
*{ box-sizing:border-box; }
body{ margin:0; font-family:-apple-system,Segoe UI,Roboto,Arial,sans-serif; color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% -10%, var(--radial1) 0%, transparent 60%),
    radial-gradient(1000px 700px at 90% 10%, var(--radial2) 0%, transparent 55%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
  min-height:100vh; min-height:100dvh; transition:background-color .25s, color .25s; }
button,input,select,textarea{ font-family:inherit; }
button{ cursor:pointer; }
[hidden]{ display:none !important; }

.glass{ background:var(--glassbg); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
  border:1px solid var(--glassbrd); box-shadow:0 8px 32px var(--shadow); }

input,select,textarea{ background:var(--inputbg); border:1px solid var(--glassbrd); border-radius:12px;
  padding:11px 14px; color:var(--text); font-size:14px; outline:none; }
input:focus,select:focus,textarea:focus{ border-color:var(--gold); }
input::placeholder,textarea::placeholder{ color:var(--muted2); }
select option{ background:var(--optbg); color:var(--text); }

.btn-gold{ background:var(--gold); color:#1a1a1a; border:none; border-radius:12px; padding:11px 16px; font-weight:800; font-size:14px; }
.btn-outline{ background:var(--outbg); color:var(--goldtext); border:1px solid var(--outbrd); border-radius:12px; padding:11px 16px; font-weight:700; font-size:14px; }
.btn-ghost{ background:var(--inputbg); color:var(--text); border:1px solid var(--glassbrd); border-radius:12px; padding:9px 14px; font-size:13px; }
.btn-gold:disabled,.btn-ghost:disabled{ opacity:.5; cursor:default; }
.icon-btn{ background:var(--inputbg); color:var(--text); border:1px solid var(--glassbrd); border-radius:12px;
  width:40px; height:40px; display:grid; place-items:center; font-size:16px; padding:0; }

/* ─── Шапка ─── */
header{ position:sticky; top:0; z-index:20; padding:12px 22px; display:flex; align-items:center; gap:14px;
  border-radius:0; border-left:none; border-right:none; border-top:none; flex-wrap:wrap; }
.logo{ width:40px; height:40px; object-fit:contain; }
.brand{ display:flex; flex-direction:column; line-height:1.1; margin-right:12px; }
.brand b{ font-size:15px; letter-spacing:.06em; }
.brand span{ font-size:11.5px; color:var(--muted); }
nav{ display:flex; gap:6px; flex-wrap:wrap; }
.tab{ background:transparent; border:1px solid transparent; color:var(--muted); border-radius:12px;
  padding:9px 14px; font-weight:700; font-size:14px; }
.tab[aria-selected="true"]{ background:var(--outbg); color:var(--goldtext); border-color:var(--outbrd); }
.header-right{ margin-left:auto; display:flex; gap:8px; align-items:center; }
.who{ max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

main{ padding:18px 22px 120px; max-width:1400px; margin:0 auto; }
.page-head{ display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.page-head h1{ margin:0; font-size:22px; }
.page-head p{ margin:4px 0 0; color:var(--muted); font-size:13.5px; }
.page-head .grow{ flex:1; }

.banner{ border-radius:14px; padding:12px 16px; margin-bottom:16px; font-size:13.5px; border:1px solid var(--glassbrd); }
.banner.warn{ background:rgba(224,160,0,.12); border-color:rgba(224,160,0,.4); }
.banner.demo{ background:var(--outbg); border-color:var(--outbrd); color:var(--goldtext); }

.chips{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; align-items:center; }
.chip{ background:var(--inputbg); border:1px solid var(--glassbrd); color:var(--text); border-radius:999px;
  padding:7px 13px; font-size:13px; font-weight:600; }
.chip[aria-pressed="true"]{ background:var(--gold); color:#1a1a1a; border-color:var(--gold); }
.chips input{ margin-left:auto; min-width:220px; border-radius:999px; padding:8px 14px; }

/* ─── Карточки машин ─── */
.grid{ display:grid; gap:16px; grid-template-columns:repeat(auto-fill, minmax(300px,1fr)); align-items:start; }
.card{ border-radius:20px; padding:18px; display:flex; flex-direction:column; gap:10px; transition:all .3s; }
.card.marked{ border-color:rgba(63,185,80,.45); }
.card-top{ display:flex; align-items:center; gap:6px 8px; justify-content:space-between; flex-wrap:wrap; }
.card h3{ margin:0; font-size:17px; line-height:1.25; }
.card .sub{ font-size:13px; color:var(--muted); }
.vin{ font-family:Consolas,monospace; font-size:11.5px; color:var(--muted); word-break:break-all; }
.specs{ display:grid; grid-template-columns:1fr 1fr; gap:6px 12px; font-size:12.5px; }
.specs b{ color:var(--muted); font-weight:400; display:block; font-size:11.5px; }

.badge{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; padding:4px 10px;
  border-radius:999px; background:color-mix(in srgb, var(--c) 16%, transparent); color:var(--c); white-space:nowrap; }
.badge::before{ content:""; width:7px; height:7px; border-radius:50%; background:var(--c); }
.days{ font-size:12px; font-weight:700; color:var(--muted); white-space:nowrap; }
.days.soon{ color:var(--goldtext); }
.days.late{ color:var(--st-bad); }

.deal{ font-size:12px; color:var(--st-marked); font-weight:700; }
.card-foot{ margin-top:auto; display:flex; gap:8px; align-items:center; justify-content:space-between; flex-wrap:wrap;
  padding-top:12px; border-top:1px solid var(--glassbrd); }
.marked-note{ font-size:13px; color:var(--st-ready); font-weight:700; }
.marked-note small{ display:block; color:var(--muted); font-weight:400; font-size:12px; }

/* ─── Сводка «скоро придут» ─── */
.tiles{ display:grid; gap:12px; grid-template-columns:repeat(auto-fit, minmax(170px,1fr)); margin-bottom:18px; }
.tile{ border-radius:18px; padding:16px 18px; }
.tile .num{ font-size:30px; font-weight:800; color:var(--gold); line-height:1; }
.tile .lbl{ font-size:13px; color:var(--muted); margin-top:6px; }
.tile.hot .num{ color:var(--st-arrived); }

.group-title{ font-size:13px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.06em;
  margin:20px 0 10px; }
.row{ border-radius:16px; padding:12px 16px; display:grid; grid-template-columns:1fr auto; gap:10px 16px; align-items:center; margin-bottom:8px; }
.row .title{ font-weight:700; }
.row .meta{ font-size:12.5px; color:var(--muted); }

/* ─── Записи на выдачу ─── */
.datebar{ display:flex; gap:8px; align-items:center; }
.datebar input[type="date"]{ padding:9px 12px; }
.appt{ border-radius:18px; padding:14px 18px; display:grid; grid-template-columns:86px 1fr auto; gap:14px; align-items:center; margin-bottom:10px; }
.appt .time{ font-size:22px; font-weight:800; color:var(--gold); }
.appt.done{ opacity:.6; }
.appt.cancelled{ opacity:.45; }
.appt.cancelled .client{ text-decoration:line-through; }
.appt .client{ font-weight:700; font-size:15px; }
.appt .meta{ font-size:13px; color:var(--muted); margin-top:3px; display:flex; gap:12px; flex-wrap:wrap; }
.appt .meta a{ color:var(--text); }
.appt .comment{ font-size:13px; margin-top:6px; }
.status-group{ display:flex; gap:6px; flex-wrap:wrap; }
.status-group button{ background:var(--inputbg); border:1px solid var(--glassbrd); color:var(--muted);
  border-radius:10px; padding:7px 10px; font-size:12.5px; font-weight:700; }
.status-group button[aria-pressed="true"]{ color:#1a1a1a; border-color:transparent; }
.status-group button[data-s="planned"][aria-pressed="true"]{ background:var(--gold); }
.status-group button[data-s="done"][aria-pressed="true"]{ background:var(--st-ready); color:#fff; }
.status-group button[data-s="cancelled"][aria-pressed="true"]{ background:var(--st-bad); color:#fff; }

.empty{ border-radius:20px; padding:40px 20px; text-align:center; color:var(--muted); }
.empty b{ display:block; color:var(--text); font-size:16px; margin-bottom:6px; }

/* ─── Окна ─── */
.overlay{ position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; padding:16px; z-index:50; }
.modal{ border-radius:22px; padding:24px; width:min(460px, 100%); max-height:90dvh; overflow:auto; display:flex; flex-direction:column; gap:12px; }
.modal input,.modal select,.modal textarea{ width:100%; min-width:0; }
.modal h2{ margin:0 0 4px; font-size:19px; }
.modal label{ font-size:12.5px; color:var(--muted); display:flex; flex-direction:column; gap:6px; }
.modal .row2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.modal textarea{ min-height:64px; resize:vertical; }
.car-results{ max-height:160px; overflow:auto; display:flex; flex-direction:column; gap:4px; }
.car-results button{ text-align:left; background:var(--inputbg); border:1px solid var(--glassbrd); color:var(--text);
  border-radius:10px; padding:8px 10px; font-size:13px; }
.car-results button[aria-pressed="true"]{ border-color:var(--gold); background:var(--outbg); }
.modal-actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:4px; }
.err{ color:var(--st-bad); font-size:13px; min-height:1em; }

.toast{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:var(--optbg); color:var(--text);
  border:1px solid var(--glassbrd); box-shadow:0 8px 32px var(--shadow); border-radius:14px; padding:12px 18px; font-size:14px; z-index:60; }
.toast.bad{ border-color:var(--st-bad); }

@media (max-width:640px){
  header{ padding:10px 16px; }
  .tab{ padding:8px 10px; font-size:13px; }
  .brand{ margin-right:0; }
  main{ padding:14px 16px 120px; }
  .who{ display:none; }
  .chips input{ margin-left:0; min-width:0; width:100%; }
  .appt{ grid-template-columns:1fr; }
  .modal .row2{ grid-template-columns:1fr; }
  .grid{ grid-template-columns:1fr; }
}
