:root {
  --bg: #eef4ff;
  --card: rgba(255,255,255,0.95);
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe3ef;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --success-bg: #dcfce7;
  --shadow: 0 20px 50px rgba(15,23,42,0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29,78,216,0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(234,88,12,0.12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}
.container { width: min(1220px, 94%); margin: 0 auto; }
.page-shell { padding-bottom: 32px; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(12px);
  background: rgba(15,23,42,0.88);
  color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; padding: 14px 0;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.brand-name { font-size: 18px; display: block; }
.brand-subtitle { font-size: 12px; opacity: 0.8; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a {
  color: #fff; text-decoration: none; padding: 10px 12px; border-radius: 10px;
}
.nav-links a:hover { background: rgba(255,255,255,0.08); }
.hero {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px;
  align-items: center; padding: 28px 0 18px;
}
.hero h1 { font-size: clamp(28px, 4vw, 48px); margin: 0 0 12px; line-height: 1.05; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 0 18px; }
.hero-panel {
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.88));
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 28px; padding: 28px; box-shadow: var(--shadow);
}
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.hero-stat {
  border: 1px solid var(--border); border-radius: 20px; padding: 18px;
  background: rgba(255,255,255,0.9);
}
.hero-stat strong { display: block; color: var(--muted); font-size: 13px; }
.hero-stat span { display: block; font-size: 30px; font-weight: 800; margin-top: 8px; }
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 24px; padding: 24px; box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.section-title, .title { margin: 0 0 14px; }
.section-muted { color: var(--muted); margin-top: -6px; margin-bottom: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 16px; padding: 14px 18px; font-size: 15px;
  cursor: pointer; text-decoration: none; font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 22px rgba(29,78,216,.18); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 10px 22px rgba(234,88,12,.16); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 10px 22px rgba(21,128,61,.18); }
.btn-light { background: #edf2f7; color: #0f172a; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-block { width: 100%; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.kiosk-btn {
  min-height: 170px; width: 100%; font-size: clamp(22px, 3vw, 34px);
  border-radius: 28px; padding: 28px; line-height: 1.1;
}
.kiosk-btn small { display: block; opacity: .85; font-size: 15px; font-weight: 600; margin-top: 10px; }
.alert {
  padding: 14px 16px; border-radius: 16px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: #166534; border-color: #bbf7d0; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.form-group { margin-bottom: 14px; }
label { display:block; font-weight: 700; margin-bottom: 7px; }
input[type=text], input[type=password], input[type=date], input[type=color], input[type=number], textarea, select {
  width: 100%; padding: 13px 14px; border: 1px solid #cbd5e1; border-radius: 14px;
  font-size: 15px; background: #fff;
}
textarea { resize: vertical; min-height: 100px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px 10px; border-bottom: 1px solid #e5e7eb;
  text-align: left; vertical-align: top;
}
.table th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.center { text-align:center; }
.ticket-display { text-align: center; padding: 18px 16px; }
.ticket-number { font-size: clamp(72px, 12vw, 112px); font-weight: 900; margin: 10px 0; letter-spacing: 1px; }
.ticket-number-small { font-size: 30px; font-weight: 800; margin-top: 8px; }
.ticket-type { font-size: clamp(20px, 2.2vw, 30px); color: var(--muted); }
.status-chip, .badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 10px 14px;
  font-weight: 700; font-size: 14px;
}
.badge { background: rgba(29,78,216,0.10); color: var(--primary); }
.badge.badge-accent { background: rgba(234,88,12,0.12); color: var(--accent); }
.status-AGUARDANDO { background: #dbeafe; color: #1d4ed8; }
.status-CHAMADA { background: #ffedd5; color: #c2410c; }
.status-FINALIZADA { background: #dcfce7; color: #166534; }
.status-CANCELADA { background: #fee2e2; color: #991b1b; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.92));
  padding: 18px; border-radius: 22px; border: 1px solid var(--border);
}
.stat-label { color: var(--muted); font-weight: 700; font-size: 14px; }
.stat-number { font-size: 34px; font-weight: 900; margin-top: 10px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.painel-wrap { min-height: calc(100vh - 92px); display: grid; place-items: center; padding: 18px 0 28px; }
.painel-card { width: min(1440px, 97%); text-align: center; border-radius: 30px; }
.painel-top {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; text-align: left;
}
.painel-clock { font-size: 24px; font-weight: 800; color: var(--muted); }
.painel-number {
  font-size: clamp(92px, 20vw, 220px); line-height: 1; font-weight: 1000;
  color: var(--primary); margin: 16px 0 8px;
}
.painel-msg { color: var(--muted); font-size: 18px; margin-top: 8px; }
.recent-calls { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.quick-links { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:14px; margin-top:18px; }
.print-ticket { width: 58mm; text-align: center; font-family: Arial, Helvetica, sans-serif; color: #000; }
.print-ticket .big { font-size: 30px; font-weight: 900; margin: 10px 0; }
.small { font-size: 12px; color: var(--muted); }
.no-print { }
.footer-note { color: var(--muted); font-size: 13px; margin-top: 6px; }
.inline-check label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .topbar-inner { align-items: flex-start; flex-direction: column; }
  .painel-top { grid-template-columns: 1fr; text-align: center; }
}
@media print {
  .no-print { display:none !important; }
  body { background:#fff; }
  .print-ticket { width: 58mm; margin: 0 auto; }
}


.painel-wrap-v4 { min-height: calc(100vh - 92px); }
.painel-card-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, .75fr);
  gap: 22px;
  align-items: stretch;
}
.painel-main { text-align: center; }
.painel-side { display: flex; }
.ad-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.92));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 520px;
}
.ad-header {
  display:flex; justify-content:space-between; align-items:center;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.ad-stage {
  position: relative;
  flex: 1;
  min-height: 420px;
  background: #0f172a;
  display:grid; place-items:center;
}
.ad-media {
  width: 100%; height: 100%; object-fit: cover; display:block;
}
.ad-placeholder {
  width: 100%; height: 100%; display:grid; place-items:center; text-align:center;
  color: #fff; padding: 24px;
}
.ticker-wrap {
  grid-column: 1 / -1;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  color: #fff;
  padding: 12px 0;
}
.ticker-track {
  display: inline-flex;
  gap: 48px;
  white-space: nowrap;
  min-width: 200%;
  animation: tickerMove 22s linear infinite;
  font-weight: 800;
}
.ticker-track span { padding-left: 24px; }
@keyframes tickerMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (max-width: 1100px) {
  .painel-card-split { grid-template-columns: 1fr; }
  .ad-card { min-height: 340px; }
}
