:root {
  --bg: #121212; --panel: #1c1c1c; --panel2: #262626; --line: #333; --text: #eee; --muted: #9a9a9a;
  --gold: #d4a64a; --gold2: #f0c76a; --ok: #3fae6b; --warn: #e0a030; --bad: #d9534f; --blue: #4a90d4;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--gold); border-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.btn.gold { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 600; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
.btn.bad { background: transparent; border-color: var(--bad); color: var(--bad); }
a.btn { color: var(--text); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn.big { padding: 16px; font-size: 18px; width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; }

/* Giriş */
.login { max-width: 420px; margin: 0 auto; padding: 32px 16px; text-align: center; }
.brand { font-family: Georgia, serif; font-size: 28px; color: var(--gold); letter-spacing: 1px; }
.brand small { display: block; font-size: 13px; letter-spacing: 4px; color: var(--muted); }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.dots { display: flex; justify-content: center; gap: 14px; margin: 24px 0; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gold); }
.dots i.on { background: var(--gold); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pad button { padding: 18px 0; font-size: 22px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }

/* Üst panel */
header { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.top { border-bottom: 1px solid var(--line); padding: 8px 12px; }
.top .brand { font-size: 18px; }
.datebar { display: flex; align-items: center; gap: 6px; }
.datebar input { width: auto; padding: 6px 8px; }
@media (max-width: 699px) { .datebar { order: 5; width: 100%; justify-content: center; } }
@media (min-width: 700px) { .datebar { order: 0; margin: 0 auto; } .top .grow { display: none; } }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px 12px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: none; padding: 10px 12px; border-bottom: 3px solid transparent; white-space: nowrap; color: var(--muted); }
.tabs button.on { color: var(--gold); border-color: var(--gold); }
main { padding: 12px; max-width: 1400px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 16px; color: var(--gold); }

/* Cədvəl */
.gridwrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: calc(100vh - 190px); }
table.grid { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.grid th, .grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; vertical-align: top; }
.grid thead th { position: sticky; top: 0; background: var(--panel2); z-index: 3; padding: 8px 6px; color: var(--gold); min-width: 112px; font-weight: 600; }
.grid th.time, .grid td.time { position: sticky; left: 0; background: #2a2410; color: var(--gold2); z-index: 2; min-width: 58px; width: 58px; text-align: center; padding: 6px 2px; font-weight: 600; }
.grid thead th.time { z-index: 4; }
.grid td.cell { height: 46px; min-width: 112px; cursor: pointer; background: var(--panel); }
.grid td.cell:hover { background: #222; }
.grid td.now { box-shadow: inset 0 2px 0 var(--bad); }
.v { margin: 2px; border-radius: 6px; padding: 3px 6px; font-size: 13px; line-height: 1.25; display: flex; justify-content: space-between; gap: 4px; }
.v.booked { background: #24364d; border-left: 3px solid var(--blue); }
.v.done { background: #1f3a2a; border-left: 3px solid var(--ok); }
.v.noshow { background: #3a2222; border-left: 3px solid var(--bad); text-decoration: line-through; }
.v.cont { opacity: .45; font-style: italic; }
.v.hid { background: #2b2b2b; color: var(--muted); }
.v .amt { font-weight: 700; white-space: nowrap; }
.v .m { font-size: 11px; color: var(--muted); }

/* Sıra */
.next { text-align: center; padding: 18px; }
.next .who { font-size: 30px; font-weight: 700; color: var(--gold); margin: 6px 0; }
.qitem { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); }
.qitem:last-child { border-bottom: none; }
.qn { width: 28px; height: 28px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-weight: 700; }
.qitem.first .qn { background: var(--gold); color: #111; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 20px; background: var(--panel2); }
.tag.free { background: #1f3a2a; color: #7ddc9f; }
.tag.busy { background: #3a3020; color: var(--warn); }

/* Seçim çipləri */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 8px 12px; border-radius: 20px; background: var(--panel2); border: 1px solid var(--line); font-size: 14px; }
.chip.on { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 600; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px; }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 16px; } }
.sheet h2 { margin: 0 0 12px; font-size: 18px; color: var(--gold); }
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* Cədvəllər (hesabat) */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th, .t td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.t th:first-child, .t td:first-child { text-align: left; }
.t th { color: var(--muted); font-weight: 500; font-size: 12px; }
.t tr.sum td { font-weight: 700; border-top: 2px solid var(--gold); }
.scroll { overflow-x: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.kpi b { display: block; font-size: 20px; color: var(--gold); }
.kpi span { font-size: 12px; color: var(--muted); }
.neg { color: var(--bad); }
.pos { color: #7ddc9f; }

/* Loqo: orijinal ağ fonda qara — tünd fonda ağ görünsün deyə tərsinə çevrilir, fon "screen" ilə yox olur */
.logo { display: block; margin: 0 auto; filter: invert(1); mix-blend-mode: screen; height: auto; }
.logo-sub { display: block; text-align: center; font-size: 12px; letter-spacing: 5px; color: var(--muted); margin-top: 2px; }

/* Şəkil (avatar) */
.ava { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; background: #2e2614; color: var(--gold); font-weight: 700; vertical-align: middle; flex: 0 0 auto; border: 2px solid var(--gold); }
.barbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.bcard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); text-align: center; font-size: 14px; }
.bcard.on { border-color: var(--gold); background: #2e2614; box-shadow: inset 0 0 0 1px var(--gold); }
.bcard:disabled { opacity: .35; }

/* Müştəri rezerv səhifəsi */
.bwrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.bhead { text-align: center; padding: 12px 0 4px; }
.btitle { text-align: center; font-size: 20px; margin: 14px 0; }
.svcs { display: grid; gap: 8px; }
.svc { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.svc small { display: block; color: var(--muted); font-size: 12px; }
.svc b { color: var(--gold); white-space: nowrap; }
.svc.on { border-color: var(--gold); background: #2e2614; box-shadow: inset 0 0 0 1px var(--gold); }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.dayb { flex: 0 0 auto; min-width: 64px; padding: 8px 6px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); text-align: center; }
.dayb small { display: block; font-size: 11px; color: var(--muted); }
.dayb.on { background: var(--gold); color: #111; border-color: var(--gold); }
.dayb.on small { color: #3a2e10; }
.dayb:disabled, .chip:disabled { opacity: .35; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.times .chip { text-align: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #333; padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: 0 4px 20px rgba(0,0,0,.5); }
.toast.bad { background: var(--bad); }
