:root {
  --bg: #f4f6fb;
  --ink: #0f172a;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-dark: #1e40af;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  padding: 16px;
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0 0 8px; }

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  margin: 8px auto 16px;
}
.top h1 { font-size: 22px; }
.tagline { margin: 0; color: var(--muted); font-size: 14px; }

.logo { width: 52px; height: 52px; flex-shrink: 0; }
.logo.big { width: 72px; height: 72px; margin: 0 auto 8px; display: block; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 480px;
  margin: 0 auto;
}
.card.narrow { max-width: 380px; text-align: center; }
.card.narrow .form { text-align: left; }

.form { display: flex; flex-direction: column; gap: 16px; }

label span,
legend {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

input:not([type="radio"]):not([type="checkbox"]) {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

fieldset {
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0;
}
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-weight: 500;
  margin: 0;
}
.opt span { margin: 0; font-weight: 500; }

.counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.counter > span { font-size: 14px; font-weight: 600; }
.counter-ctrl { display: flex; align-items: center; gap: 8px; }
.counter-ctrl input {
  width: 70px;
  text-align: center;
  font: inherit;
  padding: 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
}
.counter-ctrl button {
  width: 44px;
  height: 44px;
  font-size: 22px;
  border: none;
  border-radius: 12px;
  background: #e2e8f0;
  cursor: pointer;
}

.total { margin: 0; font-size: 16px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.error { color: var(--danger); margin: 0; font-size: 14px; min-height: 1em; }
.notice {
  background: #fef3c7;
  color: var(--warn);
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
}

button.primary,
button.ghost,
button.danger {
  font: inherit;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
}
button.primary { background: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-dark); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.ghost { background: #e2e8f0; color: var(--ink); }
button.danger { background: #fee2e2; color: var(--danger); }
button.link {
  background: none;
  border: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}

#progress { display: flex; align-items: center; gap: 10px; }
.bar {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
#bar {
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.2s;
}
#pct { font-size: 13px; color: var(--muted); min-width: 40px; text-align: right; }

.success { text-align: center; padding: 10px 0; }
.success h2 { color: var(--ok); font-size: 26px; }
.token {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 2px;
  background: #dcfce7;
  color: var(--ok);
  border-radius: 16px;
  padding: 18px;
  margin: 14px 0;
}

.autoprint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 0 6px;
}
.autoprint input { width: auto; margin: 0; }

/* ---------- Shop panel ---------- */
.admin { padding: 0; background: #eef2f8; }
.login { min-height: 100vh; display: flex; align-items: center; padding: 16px; }
.login .card h1 { font-size: 20px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 36px; height: 36px; }
.pill {
  background: #fef3c7;
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.actions { display: flex; gap: 8px; }
.actions button { padding: 9px 14px; font-size: 14px; }

.dash {
  display: grid;
  gap: 16px;
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.share-row { display: flex; gap: 8px; margin: 10px 0; }
.share-row input { flex: 1; font-size: 13px; }
.share-row button { padding: 10px 14px; font-size: 14px; }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.rate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.queue {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
  max-width: 900px;
  margin: 0 auto;
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.order {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border-left: 6px solid var(--warn);
}
.order.approved { border-left-color: var(--brand); }

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: var(--warn);
}
.badge.approved { background: #dbeafe; color: var(--brand-dark); }

.order-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 0 0 12px;
  font-size: 14px;
}
.order-meta dt { color: var(--muted); }
.order-meta dd { margin: 0; word-break: break-word; }

.order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.order-actions button { flex: 1 1 auto; padding: 10px 12px; font-size: 14px; }

/* Poster: screen par hidden, sirf print mein dikhega */
.poster-area { display: none; }
.poster-text { margin: 4px 0; font-weight: 600; }

/* ---------- Print ---------- */
@media print {
  body { background: #fff; padding: 0; }
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    text-align: center;
    padding: 40px;
  }
}
