* { box-sizing: border-box; }

:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
  background: #f4f4f4;
}

body { margin: 0; min-height: 100vh; background: #f4f4f4; }
button { font: inherit; }

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.container { width: 100%; max-width: 1100px; margin: auto; }

.card {
  background: #fff;
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 14px 40px rgba(0,0,0,.08), 0 3px 10px rgba(0,0,0,.04);
}

.top-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.title {
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -1.8px;
  margin: 0 0 12px;
}

.title.compact { font-size: clamp(28px, 4vw, 44px); }
.subtitle { color: #666; margin: 0; }
.eyebrow { font-size: 12px; font-weight: 900; letter-spacing: 2px; color: #777; margin-bottom: 10px; }

.btn {
  border: 0;
  border-radius: 15px;
  padding: 17px 22px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-black { background: #111; color: #fff; box-shadow: 0 9px 22px rgba(0,0,0,.18); }
.btn-light { background: #eee; color: #111; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.customer-card { width: min(680px, 100%); text-align: center; }
.customer-button { width: 100%; font-size: 19px; margin-top: 20px; padding: 21px; }
.big-ticket { font-size: clamp(72px, 16vw, 180px); font-weight: 950; line-height: .95; letter-spacing: -6px; margin: 30px 0; }
.hidden { display: none !important; }

.connection { margin-top: 14px; font-size: 12px; color: #888; font-weight: 800; }
.connection.connected { color: #111; }

.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.stat { background: #fff; border-radius: 16px; padding: 14px 18px; box-shadow: 0 6px 20px rgba(0,0,0,.05); min-width: 150px; }
.stat span { color: #777; font-size: 13px; }
.stat strong { display: block; margin-top: 3px; font-size: 27px; }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; margin-top: 22px; }
.counter-card { background: #fff; border-radius: 22px; padding: 26px; box-shadow: 0 12px 32px rgba(0,0,0,.07); }
.counter-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.counter-name { font-size: 23px; font-weight: 950; }
.status { font-size: 11px; font-weight: 900; padding: 7px 10px; border-radius: 999px; }
.status.available { background: #111; color: #fff; }
.status.break { background: #e6e6e6; color: #555; }
.counter-ticket { font-size: clamp(55px, 8vw, 90px); font-weight: 950; letter-spacing: -4px; margin: 30px 0; }
.counter-actions { display: grid; gap: 10px; }
.reset-card { margin-top: 22px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #111;
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.preview { min-height: 100vh; background: #fff; display: flex; flex-direction: column; }
.preview-top { padding: 24px 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.preview-title { font-size: 22px; font-weight: 950; }
.clock { font-variant-numeric: tabular-nums; font-weight: 800; }
.preview-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 35px; }
.preview-called { text-align: center; }
.preview-called.animate { animation: called .55s ease; }
.preview-label { color: #666; font-size: clamp(22px,3vw,38px); font-weight: 900; }
.preview-ticket { font-size: clamp(100px,22vw,280px); font-weight: 950; line-height: .9; letter-spacing: -10px; margin: 25px 0; }
.preview-counter { font-size: clamp(26px,4vw,54px); font-weight: 950; }
.preview-counters { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; margin-top: 32px; }
.preview-counter-card { background: #f3f3f3; border-radius: 20px; padding: 23px; text-align: center; }
.preview-counter-card h3 { margin: 0 0 8px; font-size: 19px; }
.preview-small-ticket { font-size: clamp(38px,6vw,80px); font-weight: 950; }
.preview-break { color: #666; font-weight: 900; }
.sound-button { position: fixed; right: 20px; bottom: 20px; z-index: 20; }
.preview-connection { position: fixed; left: 20px; bottom: 20px; font-size: 11px; font-weight: 900; color: #999; }
.preview-connection.connected { color: #111; }

@keyframes called {
  0% { opacity: 0; transform: scale(.82); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 700px) {
  .page { padding: 14px; }
  .card, .counter-card { padding: 21px; }
  .top-card { align-items: flex-start; flex-direction: column; }
  .admin-grid, .preview-counters { grid-template-columns: 1fr; }
  .preview-main { padding: 22px 14px; }
  .preview-top { padding: 17px; }
  .preview-ticket { letter-spacing: -5px; }
}
