:root {
  --yellow: #FCE000;
  --black: #21201F;
  --bg: #F5F4F2;
  --card: #FFFFFF;
  --line: #E7E5E1;
  --muted: #8A8784;
  --text: #21201F;
  --green: #3FB846;
  --red: #E5412D;
  --blue: #3478F6;
  --orange: #F59E0B;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── каркас ── */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 236px; flex: none; background: var(--black); color: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 18px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--yellow); color: var(--black);
  display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  text-decoration: none; color: #D8D6D3; margin-bottom: 2px;
}
.nav a:hover { background: #2E2D2B; color: #fff; }
.nav a.on { background: var(--yellow); color: var(--black); font-weight: 700; }
.nav .ico { width: 20px; text-align: center; }
.nav .sep { color: #77746F; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 14px 12px 6px; }
.badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; font-size: 11px;
  min-width: 20px; padding: 1px 6px; text-align: center; font-weight: 700; }
.nav a.on .badge { background: var(--black); color: var(--yellow); }
.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 26px; font-weight: 800; flex: 1; min-width: 160px; }
.btn.burger { display: none; }

@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; z-index: 1000; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { padding: 14px 14px 60px; }
  .btn.burger { display: inline-flex; }
  .top h1 { font-size: 22px; }
}

/* ── элементтер ── */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kpi { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 26px; font-weight: 800; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi.hl { background: var(--yellow); }
.kpi.hl .l { color: #5c5600; }
.btn { border: 0; border-radius: 12px; padding: 9px 14px; background: #ECEAE6; cursor: pointer;
  font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.y { background: var(--yellow); }
.btn.k { background: var(--black); color: #fff; }
.btn.r { background: #FDE8E5; color: var(--red); }
.btn.g { background: #E5F6E6; color: #23862A; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 10px; }
.btn.icon { padding: 8px 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.sp { flex: 1; }
.in, select.in, textarea.in {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 12px; min-width: 0;
}
.in:focus { outline: 2px solid var(--yellow); border-color: transparent; }
textarea.in { width: 100%; min-height: 110px; resize: vertical; }
label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
label.f .in { width: 100%; }
.hint { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.red { color: var(--red); }
.green { color: #23862A; }
.b { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

table.t { width: 100%; border-collapse: collapse; }
.tw { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid #F1EFEC; vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #FBFAF8; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: #EEEcE8; white-space: nowrap; }
.pill.green { background: #E5F6E6; color: #23862A; }
.pill.red { background: #FDE8E5; color: var(--red); }
.pill.yellow { background: #FFF6B3; color: #6B5F00; }
.pill.blue { background: #E6EFFE; color: var(--blue); }
.pill.dark { background: var(--black); color: #fff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border: 0; background: #ECEAE6; padding: 7px 13px; border-radius: 20px; cursor: pointer; font-weight: 600; }
.tabs button.on { background: var(--black); color: #fff; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.empty { text-align: center; color: var(--muted); padding: 26px 0; }

/* ── оң жақтан шығатын панель (карточка) ── */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1500; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(760px, 100%); background: var(--bg);
  z-index: 1600; overflow-y: auto; padding: 18px; box-shadow: -10px 0 40px rgba(0,0,0,.2); }
.drawer .head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.drawer .head h2 { margin: 0; font-size: 21px; flex: 1; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; }
.kv > div:nth-child(odd) { color: var(--muted); }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv > div:nth-child(odd) { margin-top: 6px; } }

/* ── модаль ── */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 2000; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 20px; padding: 20px; width: min(460px, 100%); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 12px; }

/* ── хабарлама ── */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 3000; display: grid; gap: 8px; }
.toast { background: var(--black); color: #fff; padding: 11px 18px; border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }

/* ── кіру ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { background: #fff; border-radius: 24px; padding: 28px; width: min(380px, 100%); }
.login .logo { width: 56px; height: 56px; border-radius: 16px; background: var(--yellow); display: grid;
  place-items: center; font-weight: 900; font-size: 20px; margin-bottom: 14px; }

/* ── фото ── */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo { background: #ECEAE6; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; display: grid; place-items: center;
  position: relative; cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .cap { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px;
  padding: 2px 7px; border-radius: 8px; }
.zoom { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 2500; display: grid; place-items: center; cursor: zoom-out; }
.zoom img { max-width: 95vw; max-height: 95vh; border-radius: 8px; }

/* ── карта ── */
.map { height: 560px; border-radius: var(--radius); overflow: hidden; }
@media (max-width: 860px) { .map { height: 420px; } }
.zone-item { padding: 10px; border-radius: 12px; cursor: pointer; border: 2px solid transparent; margin-bottom: 6px; background: #F7F6F4; }
.zone-item.on { border-color: var(--black); background: #fff; }

/* ── баға кестесі ── */
.price-in { width: 110px; text-align: right; }
.switch { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #D6D3CF; border-radius: 20px; cursor: pointer; transition: .15s; }
.switch span:before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span:before { transform: translateX(18px); }
.set-row { display: flex; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid #F1EFEC; flex-wrap: wrap; }
.set-row .lbl { flex: 1; min-width: 220px; }
.set-row .ctl { width: 260px; max-width: 100%; }
.set-row.changed { background: #FFFBE0; margin: 0 -16px; padding: 11px 16px; }
.chart-box { position: relative; height: 280px; }
.zones-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); }
@media (max-width: 860px) { .zones-grid { grid-template-columns: 1fr; } }
