:root {
  --ink: #1a1a1a;
  --muted: #5c6560;
  --line: #e2e6e3;
  --paper: #ffffff;
  --bg: #f4f5f4;
  --green: #39b54a;
  --green-dark: #1f7a32;
  --green-soft: #e8f6eb;
  --red: #e10600;
  --danger: #9e1830;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
}

body { padding-bottom: 40px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: #111;
  color: #fff;
  border-bottom: 3px solid var(--red);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-lockup img {
  height: 54px;
  width: 196px;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #111;
}

.brand {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
}

.topbar h1 {
  margin: 1px 0 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-meta { text-align: right; }
.staff-line { margin: 0; font-weight: 650; font-size: 14px; }
.shop-line { margin: 2px 0 0; font-size: 12px; color: rgba(255, 255, 255, 0.7); }

.header-btn, .btn, .issue-grid button, .rate-row button, .text-btn {
  font: inherit;
  cursor: pointer;
}

.header-btn {
  border: 0;
  background: var(--green);
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.header-btn-quiet {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

main {
  width: min(1040px, calc(100% - 28px));
  margin: 22px auto 0;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}

.panel.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

.kicker {
  margin: 0;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead {
  color: var(--muted);
  margin: 6px 0 16px;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  border: 1px solid #cfd6d1;
  background: #fff;
  border-radius: 8px;
  padding: 13px 12px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
}

input:focus {
  outline: 2px solid #b7e3bf;
  border-color: var(--green);
}

input.masked,
input[readonly] {
  background: #f6f7f6;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.phone-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.text-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
}

.btn-primary {
  width: 100%;
  margin-top: 16px;
  background: var(--green);
  color: #fff;
}

.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-ghost {
  background: #f3f4f3;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-row {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px;
}

.btn-row .btn { margin-top: 16px; }

.admin-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.admin-link:hover { color: var(--ink); }

.error {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.desk-main { display: grid; gap: 14px; }

.count-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.count-row .lead { margin-bottom: 0; }

.count-pill {
  min-width: 72px;
  text-align: center;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 8px;
  padding: 8px 10px;
}

.count-pill span {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.count-pill small { font-size: 12px; font-weight: 650; }

.phone-lg {
  margin: 10px 0 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.clock {
  margin: 12px 0 8px;
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.clock-sm { font-size: 40px; margin: 8px 0 4px; }

.issue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.issue-grid button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 13px 10px;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

.issue-grid button.selected {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.rate-lead { margin-bottom: 8px; }

.rate-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.rate-row button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 4px;
}

.rate-row strong { display: block; font-size: 20px; line-height: 1; }
.rate-row span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.rate-row button.selected {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.rate-row button.selected span { color: #fff; }

.visit-list { list-style: none; margin: 8px 0 0; padding: 0; }

.visit-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.visit-list strong { display: block; }
.visit-list span { color: var(--muted); font-size: 13px; }
.visit-list em {
  font-style: normal;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.empty { color: var(--muted); margin: 12px 0 0; }

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 20;
  background: #111;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(244, 245, 244, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.loader p {
  margin: 0;
  font-weight: 650;
  color: var(--ink);
}

.spin {
  width: 36px;
  height: 36px;
  border: 3px solid #d9e0db;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .top-actions { width: 100%; justify-content: space-between; }
  .brand-lockup img { width: 150px; height: 42px; }
  .clock { font-size: 56px; }
  .rate-row span { font-size: 10px; }
}

@media (min-width: 860px) {
  .desk-main {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}
