/* Agiza Mezani — mfumo wa muonekano */
:root {
  --brand: #0F766E;
  --brand-ink: #ffffff;
  --brand-soft: #E6F3F1;
  --accent: #F59E0B;
  --accent-ink: #111827;
  --bg: #F5F6F3;
  --card: #ffffff;
  --ink: #1C2321;
  --muted: #66706C;
  --line: #E3E6E1;
  --ok: #15803D;
  --ok-soft: #E7F6EC;
  --warn: #B45309;
  --warn-soft: #FEF3E2;
  --bad: #B91C1C;
  --bad-soft: #FDECEC;
  --info: #1D4ED8;
  --info-soft: #E8EEFD;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 14px rgba(16, 24, 20, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Header / nav ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1180px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--ink); text-decoration: none !important;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.logo small { display: block; font-weight: 500; font-size: 12px; }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.top-user .who { text-align: right; line-height: 1.2; }
.top-user .who small { display: block; }
.nav {
  max-width: 1180px; margin: 0 auto; padding: 0 12px;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 10px 12px; white-space: nowrap; font-size: 14px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none;
}
.nav a.on { color: var(--brand); border-bottom-color: var(--brand); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; }
.wrap.narrow { max-width: 560px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.foot {
  max-width: 1180px; margin: 0 auto; padding: 18px 16px 28px;
  color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap;
}
.foot .sp { margin-left: auto; }

/* ---------- Cards / grids ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .sp { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .sp { margin-left: auto; }
.stack > * + * { margin-top: 12px; }

.stat { padding: 16px; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.stat .s { font-size: 13px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid transparent; background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none !important;
  transition: transform .06s ease, filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #fafbf9; }
.btn.soft { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--bad); border-color: #f1c9c9; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.lg { min-height: 54px; font-size: 1.05rem; padding: 12px 22px; }
.btn.block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=tel], input[type=email],
input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid #cfd5cf; border-radius: 10px; background: #fff;
  font: inherit; color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
input[type=color] { width: 56px; height: 44px; border: 1px solid #cfd5cf; border-radius: 10px; padding: 4px; background: #fff; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.f2 { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: 13px; color: var(--muted); font-weight: 650; background: #fafbf9; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }

/* ---------- Badges / flash ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
  background: #eef0ed; color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 550; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.bad { background: var(--bad-soft); color: var(--bad); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big { font-size: 2.2rem; margin-bottom: 6px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a, .tabs button {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: none;
}
.tabs .on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; margin-left: 4px;
}

/* ---------- Auth pages ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%),
    radial-gradient(900px 400px at 110% 110%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--bg);
}
.auth .card { width: 100%; max-width: 420px; padding: 26px; }
.auth .logo { justify-content: center; margin-bottom: 18px; font-size: 1.15rem; }

/* ---------- Landing ---------- */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); max-width: 720px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; }
.feature .ic {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 22px; margin-bottom: 10px;
}

/* ---------- Department screen (KDS) ---------- */
body.kds { background: #0f1513; color: #eef3f1; }
body.kds .top { background: #141c19; border-color: #22302b; }
body.kds .logo { color: #eef3f1; }
body.kds .muted, body.kds small { color: #9fb0aa; }
.kds-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.kds-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.ticket {
  background: #18221f; border: 1px solid #263631; border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ticket.new { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); animation: pulse 1.2s ease-in-out infinite; }
.ticket.late { border-color: #ef4444; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 15%, transparent); } }
.ticket-head { display: flex; align-items: baseline; gap: 8px; }
.ticket-head .place { font-size: 1.25rem; font-weight: 800; }
.ticket-head .t { margin-left: auto; font-variant-numeric: tabular-nums; color: #9fb0aa; font-weight: 650; }
.ticket-head .t.late { color: #f87171; }
.ticket ul { list-style: none; margin: 0; padding: 0; }
.ticket li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px dashed #2a3a35; }
.ticket li:first-child { border-top: 0; }
.ticket .qty { font-weight: 800; color: var(--accent); min-width: 30px; }
.ticket .nm { font-weight: 650; }
.ticket .note { display: block; color: #fcd34d; font-size: 14px; }
.ticket li small { display: block; font-size: 12.5px; }
.ticket .btns { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.kds .btn.ghost { color: #eef3f1; border-color: #2c3d37; }
.kds .btn.ghost:hover { background: #1d2a26; }
.kds .tabs a, .kds .tabs button { background: #18221f; border-color: #263631; color: #b9c8c2; }
.kds .tabs .on { background: var(--accent); border-color: var(--accent); color: #111; }
.kds .empty { color: #9fb0aa; }

.unlock {
  position: fixed; inset: 0; z-index: 90; background: rgba(8, 12, 10, .88);
  display: grid; place-items: center; padding: 24px; text-align: center; color: #fff;
}
.unlock .box { max-width: 380px; }
.unlock h2 { font-size: 1.4rem; }

/* ---------- Customer (menu) ---------- */
body.cust { background: #f7f7f5; padding-bottom: 96px; }
.c-hero {
  background: var(--brand); color: var(--brand-ink);
  padding: 22px 16px 26px; position: relative; overflow: hidden;
}
.c-hero.has-cover { background-size: cover; background-position: center; }
.c-hero.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.65)); }
.c-hero.has-cover { color: #fff; }
.c-hero-in { position: relative; max-width: 720px; margin: 0 auto; display: flex; gap: 14px; align-items: center; }
.c-logo { width: 64px; height: 64px; border-radius: 16px; background: #fff; object-fit: contain; padding: 4px; flex: none; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.c-logo.txt { display: grid; place-items: center; font-weight: 800; font-size: 26px; color: var(--brand); }
.c-hero h1 { font-size: 1.35rem; margin: 0; }
.c-hero .slogan { opacity: .9; font-size: .95rem; margin: 2px 0 0; }
.c-table {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 650;
}
.c-main { max-width: 720px; margin: 0 auto; padding: 0 12px; }
.c-cats {
  position: sticky; top: 0; z-index: 20; background: #f7f7f5;
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 12px 10px; margin: 0 -12px; scrollbar-width: none;
}
.c-cats::-webkit-scrollbar { display: none; }
.c-cats button {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 650; color: var(--ink); cursor: pointer;
}
.c-cats button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.c-sec h2 { font-size: 1.05rem; margin: 18px 4px 10px; }
.c-item {
  display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; margin-bottom: 10px; align-items: center;
}
.c-item.off { opacity: .55; }
.c-item img { width: 78px; height: 78px; border-radius: 12px; object-fit: cover; flex: none; }
.c-item .info { flex: 1; min-width: 0; }
.c-item .nm { font-weight: 700; }
.c-item .ds { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-item .meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: 14px; }
.c-item .price { font-weight: 750; }
.c-item .time { color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.stepper button {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-size: 20px; font-weight: 700; cursor: pointer; color: var(--ink);
}
.stepper button.add { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.stepper .n { min-width: 22px; text-align: center; font-weight: 750; }

.c-cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(247,247,245,0), #f7f7f5 30%);
}
.c-cartbar .btn { width: 100%; max-width: 696px; margin: 0 auto; display: flex; justify-content: space-between; min-height: 56px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 24px rgba(0,0,0,.18); }

.sheet-bg { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; background: #fff;
  border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: #ddd; margin: -6px auto 12px; }
.line-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line-item .nm { flex: 1; font-weight: 650; }
.line-item input { min-height: 36px; font-size: 14px; margin-top: 6px; }
.eta-box {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 10%, #fff); margin: 14px 0;
}
.eta-box .min { white-space: nowrap; font-size: 1.6rem; font-weight: 800; color: var(--brand); line-height: 1; }
.pay-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.pay-opt {
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 12px; background: #fff; cursor: pointer;
  font: inherit; text-align: left; color: var(--ink);
}
.pay-opt .ic { font-size: 22px; }
.pay-opt b { display: block; margin-top: 4px; }
.pay-opt small { display: block; }
.pay-opt.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); }
.pay-opt:disabled { opacity: .45; cursor: not-allowed; }
.total-row { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 750; margin: 12px 0; }

/* Order tracking */
.track { max-width: 720px; margin: 0 auto; padding: 16px 12px 40px; }
.track-hero { text-align: center; padding: 22px 16px; }
.track-hero .big { font-size: 3rem; font-weight: 850; color: var(--brand); line-height: 1; letter-spacing: -.03em; }
.track-hero .big small { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.steps { display: flex; gap: 6px; margin: 16px 0 4px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--brand); }
.steps-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.it-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.it-row:last-child { border-bottom: 0; }
.it-row .nm { flex: 1; }
.powered { text-align: center; font-size: 12px; color: var(--muted); margin: 24px 0 8px; }

/* Waiter */
.w-card { display: flex; gap: 12px; align-items: center; }
.w-card .place { font-weight: 800; font-size: 1.1rem; }
.w-list > .card { margin-top: 12px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.picker-item .nm { flex: 1; }

/* QR print */
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.qr-card {
  border: 2px solid var(--brand); border-radius: 18px; padding: 18px 16px; text-align: center; background: #fff;
  break-inside: avoid; page-break-inside: avoid;
}
.qr-card .qr-logo { width: 54px; height: 54px; object-fit: contain; margin: 0 auto 6px; }
.qr-card .bn { font-weight: 800; font-size: 1.05rem; }
.qr-card .call { margin: 10px 0; font-weight: 700; color: var(--brand); }
.qr-card .qr { width: 180px; height: 180px; margin: 0 auto; }
.qr-card .qr svg { width: 100%; height: 100%; }
.qr-card .tn { margin-top: 10px; display: inline-block; padding: 4px 14px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 800; }
@media print {
  .top, .foot, .no-print { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
}

@media (max-width: 640px) {
  .top-user .who { display: none; }
  .wrap { padding: 16px 12px 32px; }
  .card { padding: 14px; }
  h1 { font-size: 1.3rem; }
}

/* ---------- Wabia: mkataba na vyeti ---------- */
.contract { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; line-height: 1.65; }
.contract h2 { text-align: center; font-size: 1.25rem; margin-bottom: 18px; }
.contract h3 { font-size: 1.02rem; margin: 18px 0 6px; }
.contract p, .contract li { font-size: 15.5px; }
.contract ul { margin: 0 0 10px; padding-left: 22px; }
.sign-box { border: 2px dashed var(--line); border-radius: 14px; padding: 16px; margin-top: 18px; }
.cert { max-width: 760px; margin: 0 auto; background: #fff; border: 6px double var(--brand); border-radius: 10px; padding: 40px 44px; text-align: center; }
.cert h1 { font-size: 1.8rem; letter-spacing: .04em; margin: 6px 0 4px; }
.cert .big { font-size: 2.4rem; font-weight: 800; color: var(--brand); margin: 10px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.h-card .top-row { display: flex; gap: 10px; align-items: flex-start; }
.h-card .top-row .sp { margin-left: auto; }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 10px 0 4px; }
.progress span { display: block; height: 100%; background: var(--brand); }
@media print {
  .contract { border: 0; padding: 0; }
  .cert { border-width: 6px; }
}

@media (max-width: 640px) {
  .stat .v { font-size: 1.25rem; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dd { margin-bottom: 8px; }
}
