/* =====================================================================
   Parquinho · Design System
   ===================================================================== */
:root {
  --bg: #fff7ec;
  --surface: #ffffff;
  --surface-2: #fff3e0;
  --surface-3: #ffe8cc;
  --border: #ffd9a8;
  --border-strong: #ffc27a;
  --ink: #2a1a00;
  --ink-2: #4a2e00;
  --muted: #8a5a1a;
  --muted-2: #b38a4a;
  --brand: #FF8C00;
  --brand-dark: #FF6600;
  --brand-soft: #FFF0DB;
  --accent: #FF6600;
  --grad: linear-gradient(135deg, #FF8C00 0%, #CC5500 55%, #FF6600 100%);
  --grad-soft: linear-gradient(135deg, #FFF7EC, #FFF0DB);
  --green: #059669;
  --green-soft: #e7f8f1;
  --amber: #d97706;
  --amber-soft: #fff5e5;
  --red: #dc2626;
  --red-soft: #fdecec;
  --blue: #0284c7;
  --blue-soft: #e8f4fd;
  --shadow-sm: 0 1px 2px rgba(25, 22, 39, .05);
  --shadow: 0 4px 16px rgba(25, 22, 39, .06);
  --shadow-lg: 0 18px 44px rgba(25, 22, 39, .14);
  --r-sm: 9px;
  --r: 14px;
  --r-lg: 20px;
  --sidebar-w: 252px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface-3); padding: 2px 6px; border-radius: 6px; font-size: .86em; font-family: Consolas, monospace; }
small { font-size: .82rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
svg { flex: none; }
::selection { background: #ddd0fb; }

.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "SF Mono", monospace; }
.tabular { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ */
/*  Botões                                                            */
/* ------------------------------------------------------------------ */
.btn {
  --btn-bg: var(--surface);
  --btn-color: var(--ink);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: .92rem;
  color: var(--btn-color);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none !important;
  transition: .15s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { --btn-bg: var(--grad); --btn-color: #fff; --btn-border: transparent; box-shadow: 0 6px 18px rgba(255, 140, 0, .28); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(255, 140, 0, .38); }
.btn-dark { --btn-bg: var(--ink); --btn-color: #fff; --btn-border: transparent; }
.btn-light { --btn-bg: var(--surface-2); --btn-border: var(--border); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-color: var(--muted); }
.btn-ghost:hover { --btn-bg: var(--surface-3); --btn-color: var(--ink); box-shadow: none; }
.btn-success { --btn-bg: var(--green); --btn-color: #fff; --btn-border: transparent; }
.btn-whats { --btn-bg: #ecfdf5; --btn-color: #047857; --btn-border: #b9ecd9; }
.btn-whats:hover { --btn-bg: #d9f9ea; }
.btn-danger { --btn-bg: var(--red-soft); --btn-color: var(--red); --btn-border: #f8c9c9; }
.btn-destructive { --btn-bg: var(--red); --btn-color: #fff; --btn-border: transparent; }
.btn-sm { padding: 7px 11px; font-size: .82rem; border-radius: 8px; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 9px; border-radius: 9px; }

/* ------------------------------------------------------------------ */
/*  Formulários                                                       */
/* ------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: .01em;
}
.field .req { color: var(--accent); }
.input, input[type="text"], input[type="password"], input[type="tel"], input[type="date"],
input[type="number"], input[type="search"], input[type="email"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: .94rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-height: 44px;
}
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, .1);
}
.input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6a86' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.input-lg { font-size: 1.1rem; padding: 14px 16px; }
.help { font-size: .78rem; color: var(--muted); }
.hint-ok { color: var(--green); font-weight: 600; }
.field-error input, .field-error select { border-color: var(--red); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.input-group { display: flex; }
.input-group input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .btn { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 0; }
.cash-box { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font-size: .86rem; color: var(--ink-2); }
.cash-box strong { font-size: 1.02rem; color: var(--green); }
.cash-box.falta { border-color: #f3c4c4; background: var(--red-soft); color: var(--red); }
.cash-box.falta strong { color: var(--red); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; font-weight: 600; }
.switch input { appearance: none; width: 44px; height: 25px; border-radius: 20px; background: #d9d5e6; position: relative; cursor: pointer; transition: .18s; margin: 0; flex: none; }
.switch input:checked { background: var(--brand); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked::after { left: 22px; }

/* Cards de seleção (brinquedo / pacote / pagamento) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0; }
.choice { position: relative; display: block; cursor: pointer; margin: 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .choice-body {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 13px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  transition: .15s;
  height: 100%;
}
.choice:hover .choice-body { border-color: var(--border-strong); background: var(--surface-2); }
.choice input:checked + .choice-body {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, .08);
}
.choice .choice-title { font-weight: 700; font-size: .92rem; display: flex; align-items: center; gap: 7px; }
.choice .choice-sub { font-size: .78rem; color: var(--muted); }
.choice .choice-price { font-weight: 800; color: var(--brand); font-size: .95rem; margin-top: 4px; }
.choice .choice-price small { font-weight: 500; color: var(--muted); }
.choice-toy .choice-title { font-size: .95rem; }
.choice-toy .emoji { font-size: 1.15rem; }
.choice-pay .choice-body { align-items: center; padding: 11px 8px; }
.choice-pay .choice-title { font-size: .88rem; }

/* ------------------------------------------------------------------ */
/*  Layout principal                                                  */
/* ------------------------------------------------------------------ */
body.app { background: var(--bg); }
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: #191430;
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(255, 140, 0, .35), transparent 60%),
                    radial-gradient(90% 50% at 100% 100%, rgba(204, 85, 0, .18), transparent 60%);
  color: #cfc9e3;
  z-index: 50;
  padding: 18px 14px 14px;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; text-decoration: none !important; }
.sidebar-brand .brand-mark { width: 40px; height: 40px; border-radius: 13px; background: var(--grad); display: grid; place-items: center; font-size: 21px; box-shadow: 0 6px 16px rgba(204, 85, 0, .3); }
.sidebar-brand strong { display: block; color: #fff; font-size: 1rem; letter-spacing: -.02em; line-height: 1.15; }
.sidebar-brand span { display: block; color: #9b93b9; font-size: .71rem; margin-top: 2px; }
.nav-label { display: block; padding: 16px 10px 7px; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #7c7498; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; margin-bottom: 2px;
  border-radius: 10px;
  color: #c7c0dd; font-size: .88rem; font-weight: 600;
  text-decoration: none !important;
  transition: .15s;
}
.nav-item svg { width: 19px; height: 19px; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.nav-item.is-active svg { opacity: 1; color: #d8b4fe; }
.nav-item .nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: .68rem; padding: 2px 7px; border-radius: 20px; font-weight: 800; }
.sidebar-foot { margin-top: auto; padding-top: 18px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.sidebar-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.sidebar-user .info { min-width: 0; flex: 1; }
.sidebar-user .info strong { display: block; color: #fff; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .info span { display: block; color: #9b93b9; font-size: .7rem; }
.sidebar-user .logout { color: #9b93b9; padding: 4px; border-radius: 7px; display: grid; place-items: center; }
.sidebar-user .logout:hover { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px;
  background: rgba(245, 244, 251, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 227, 240, .8);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { font-size: .8rem; color: var(--muted); margin: 1px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-clock { font-size: .82rem; font-weight: 700; color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); padding: 7px 12px; border-radius: 9px; font-variant-numeric: tabular-nums; }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); text-decoration: none; }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.content { padding: 24px 26px 48px; max-width: 1520px; width: 100%; }
.sidebar-toggle { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 12, 30, .5); z-index: 45; backdrop-filter: blur(2px); }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-overlay.show { display: block; }
  .app-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .topbar-clock { display: none; }
}

/* ------------------------------------------------------------------ */
/*  Cards / seções                                                    */
/* ------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 9px; }
.card-head .sub { font-size: .8rem; color: var(--muted); margin: 2px 0 0; }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; }
.section-title:first-child { margin-top: 0; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-main-side { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .grid-4 { grid-template-columns: 1fr 1fr; } }

/* KPIs */
.stat { display: flex; align-items: flex-start; gap: 13px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.stat .stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.stat .stat-icon svg { width: 21px; height: 21px; }
.stat .stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat .stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat .stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat .stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat .stat-label { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .stat-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .stat-sub { font-size: .74rem; color: var(--muted-2); margin-top: 2px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Alertas */
.alert { display: flex; gap: 11px; padding: 13px 16px; border-radius: var(--r); font-size: .88rem; margin-bottom: 16px; border: 1px solid transparent; align-items: flex-start; }
.alert strong { font-weight: 700; }
.alert a { font-weight: 700; text-decoration: underline; }
.alert-success { background: var(--green-soft); border-color: #bdebd9; color: #065f46; }
.alert-info { background: var(--blue-soft); border-color: #c4e5f9; color: #075985; }
.alert-warn { background: var(--amber-soft); border-color: #f8dfb0; color: #92400e; }
.alert-error { background: var(--red-soft); border-color: #f6c5c5; color: #991b1b; }

/* ------------------------------------------------------------------ */
/*  Tabelas                                                           */
/* ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .strong { font-weight: 700; }
.table .sub { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table-empty { padding: 38px 20px; text-align: center; color: var(--muted); }
.table-empty .emoji { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .7; }

/* Barra de progresso */
.progress { height: 7px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 6px; background: var(--green); transition: width .5s linear; }
.progress.amber > span { background: var(--amber); }
.progress.red > span { background: var(--red); }
.progress.brand > span { background: var(--grad); }

/* ------------------------------------------------------------------ */
/*  Painel: grade de crianças                                         */
/* ------------------------------------------------------------------ */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.board-head h2 { display: flex; align-items: center; gap: 10px; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 700; color: var(--green); background: var(--green-soft); padding: 4px 10px; border-radius: 20px; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.6s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.kids-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.child-card {
  --estado: var(--green);
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 15px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--estado);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: background .3s, border-color .3s;
}
.child-card[data-estado="alerta"] { --estado: var(--amber); background: linear-gradient(180deg, #fffbf1, #fff 55%); border-color: #fbe6bd; }
.child-card[data-estado="estourado"] { --estado: var(--red); background: linear-gradient(180deg, #fef5f5, #fff 55%); border-color: #f8cccc; box-shadow: 0 0 0 1px rgba(220, 38, 38, .08), 0 8px 22px rgba(220, 38, 38, .1); }
.child-card[data-estado="livre"] { --estado: var(--blue); background: linear-gradient(180deg, #f4fbff, #fff 55%); border-color: #cfe9f8; }
.child-card .kid-top { display: flex; align-items: flex-start; gap: 10px; }
.kid-avatar { width: 42px; height: 42px; border-radius: 13px; background: var(--grad-soft); border: 1px solid var(--border); display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.kid-id { flex: 1; min-width: 0; }
.kid-id h3 { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kid-id .kid-meta { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kid-avatar-state { width: 10px; height: 10px; border-radius: 50%; background: var(--estado); margin-top: 6px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--estado) 15%, transparent); flex: none; }
.kid-toy { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid-timer { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kid-timer .time { font-size: 2.15rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--estado); font-variant-numeric: tabular-nums; }
.kid-timer .time.small { font-size: 1.55rem; }
.kid-timer .timer-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.kid-timer .timer-label .kid-status { text-transform: none; letter-spacing: 0; }
.kid-extra { font-size: .72rem; font-weight: 700; color: var(--red); margin-top: -4px; }
.kid-status { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; color: var(--estado); }
.kid-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.kid-actions-row { display: flex; gap: 7px; }
.kid-actions-row .btn { flex: 1; }
.kid-foot { display: flex; justify-content: space-between; align-items: center; font-size: .7rem; color: var(--muted-2); gap: 8px; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); grid-column: 1 / -1; }
.empty-state .emoji { font-size: 3rem; display: block; margin-bottom: 10px; }
.empty-state h3 { color: var(--ink); margin-bottom: 4px; }

/* ------------------------------------------------------------------ */
/*  Portal do responsável                                             */
/* ------------------------------------------------------------------ */
body.portal-body { background: #0f0b1f; background-image: radial-gradient(120% 60% at 50% 0%, #CC5500 0%, #1e1236 45%, #0f0b1f 100%); min-height: 100vh; color: var(--ink); }
.portal-wrap { max-width: 460px; margin: 0 auto; padding: 22px 16px 40px; }
.portal-head { text-align: center; color: #fff; padding: 10px 0 18px; }
.portal-head .parque-logo { width: 56px; height: 56px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; font-size: 28px; margin: 0 auto 10px; box-shadow: 0 10px 30px rgba(204, 85, 0, .35); }
.portal-head h1 { font-size: 1.05rem; font-weight: 700; }
.portal-head p { color: #b3a9cc; font-size: .8rem; margin: 2px 0 0; }
.portal-card { background: #fff; border-radius: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); overflow: hidden; }
.portal-hero { padding: 0 0 6px 0px; background: var(--grad-soft); border-bottom: 1px solid var(--border); text-align: center; }
.portal-hero .kid-emoji { font-size: 2.2rem; }
.portal-hero h2 { font-size: 1.45rem; margin-top: 4px; }
.portal-hero .toy { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; background: #fff; padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 700; border: 1px solid var(--border); }
.portal-timer { padding: 24px 22px 8px; text-align: center; }
.portal-timer .big { font-size: 3.2rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.portal-timer .label { font-size: .76rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 6px; }
.portal-timer .bar { margin: 18px 6px 0; }
.portal-status { margin: 14px 22px 0; padding: 10px 14px; border-radius: 12px; font-size: .82rem; font-weight: 600; text-align: center; background: var(--green-soft); color: #065f46; }
.portal-status.alerta { background: var(--amber-soft); color: #92400e; }
.portal-status.estourado { background: var(--red-soft); color: #991b1b; }
.portal-status.livre { background: var(--blue-soft); color: #075985; }
.portal-qr { padding: 20px 22px 6px; text-align: center; }
.qr-box { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 16px; line-height: 0; }
.qr-box svg { width: 190px; height: 190px; display: block; }
.qr-caption { font-size: .78rem; color: var(--muted); margin: 12px auto 0; max-width: 290px; }
.portal-code { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; }
.portal-code .codigo { font-family: Consolas, monospace; font-weight: 700; font-size: 1rem; letter-spacing: .12em; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 8px; padding: 6px 12px; }
.portal-info { margin: 18px 22px 0; border-top: 1px solid var(--border); padding-top: 14px; }
.portal-info .row { display: flex; justify-content: space-between; gap: 12px; font-size: .84rem; padding: 5px 0; }
.portal-info .row span { color: var(--muted); }
.portal-info .row strong { text-align: right; }
.portal-foot { text-align: center; color: #8d84a8; font-size: .72rem; padding: 0px 10px 6px; line-height: 1.6; }
.portal-help { margin-top: 18px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: #cfc5e8; border-radius: 14px; padding: 13px 16px; font-size: .78rem; text-align: center; }
.portal-help a { color: #d8b4fe; font-weight: 700; }
.portal-expired { text-align: center; padding: 40px 24px; }
.portal-expired .emoji { font-size: 3rem; }
.portal-expired h2 { margin: 10px 0 6px; }
.portal-refresh { font-size: .7rem; color: var(--muted-2); text-align: center; padding: 6px 0 0; }
.portal-notify { margin: 14px 22px 0; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); text-align: center; }
.portal-gate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; background: rgba(15, 11, 31, .92); backdrop-filter: blur(4px); }
.portal-gate[hidden] { display: none; }
.portal-gate-card { width: 100%; max-width: 360px; background: #fff; border-radius: 24px; padding: 30px 24px; text-align: center; box-shadow: 0 30px 70px rgba(0,0,0,.45); }
.portal-gate-card .emoji { font-size: 2.6rem; }
.portal-gate-card h2 { margin: 10px 0 6px; font-size: 1.25rem; }
.portal-gate-card p { color: var(--muted); font-size: .85rem; line-height: 1.5; margin: 0 0 16px; }
.portal-group { margin: 0 16px 14px; }
.portal-group-title { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.65); margin: 0 4px 8px; }
.portal-group-list { display: grid; gap: 6px; }
.portal-group-row { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: #1e1b2e; text-decoration: none; transition: border-color .15s, background .15s; }
.portal-group-row.active { border-color: var(--brand); background: #fff1e0; box-shadow: 0 0 0 2px var(--brand); }
.portal-group-row .emoji { font-size: 1.35rem; flex: none; }
.portal-group-row .info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.portal-group-row .nome { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-group-row .sub { font-size: .72rem; color: var(--muted); }
.portal-group-row .seta { flex: none; color: var(--muted-2); font-size: 1.3rem; line-height: 1; }
.portal-group-row.aguardando .sub { color: #b45309; font-weight: 700; }
.portal-group-row.encerrado .sub { color: var(--muted-2); }
.portal-group-row.estourado .sub { color: var(--red); font-weight: 700; }
.portal-group-row.alerta .sub { color: var(--amber); font-weight: 700; }
.portal-group-row.livre .sub { color: var(--blue); }
.portal-notify .btn { min-width: 190px; }
.portal-notify .help { margin: 6px 0 0; }

/* ------------------------------------------------------------------ */
/*  Checkout / scanner                                                */
/* ------------------------------------------------------------------ */
.scan-box { background: #17122b; border-radius: var(--r-lg); padding: 18px; color: #fff; position: relative; overflow: hidden; }
.scan-video-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #0c0918; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: none; }
.scan-video-wrap.active video { display: block; }
.scan-video-wrap .scan-idle { text-align: center; color: #a79dbd; padding: 20px; }
.scan-video-wrap .scan-idle .emoji { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.scan-frame { position: absolute; inset: 14%; border: 2px solid rgba(255, 255, 255, .75); border-radius: 16px; pointer-events: none; display: none; }
.scan-video-wrap.active .scan-frame { display: block; }
.scan-frame::before, .scan-frame::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, #c084fc, transparent); animation: scanline 2.2s linear infinite; }
@keyframes scanline { 0% { top: 0; } 50% { top: calc(100% - 2px); } 100% { top: 0; } }
.scan-controls { display: flex; gap: 8px; margin-top: 12px; }
.scan-status { font-size: .78rem; color: #b9afd0; margin-top: 10px; min-height: 18px; }

.checkout-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.checkout-kid { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.checkout-kid .big-avatar { width: 54px; height: 54px; border-radius: 16px; background: var(--grad-soft); display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.checkout-kid h2 { font-size: 1.3rem; }
.checkout-lines { margin: 16px 0; display: grid; gap: 8px; }
.checkout-line { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.checkout-line span { color: var(--muted); }
.checkout-line.total { border-top: 1px dashed var(--border-strong); padding-top: 10px; font-size: 1.05rem; font-weight: 800; }
.checkout-line.total span { color: var(--ink); }
.checkout-line.extra strong { color: var(--red); }
.pay-mini { display: inline-flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ */
/*  Gráficos simples                                                  */
/* ------------------------------------------------------------------ */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 10px; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bar-col .bar { width: 100%; max-width: 32px; background: var(--grad); border-radius: 5px 5px 2px 2px; min-height: 3px; opacity: .85; transition: .2s; }
.chart .bar-col:hover .bar { opacity: 1; }
.chart .bar-col .lbl { font-size: .58rem; color: var(--muted-2); white-space: nowrap; }
.chart .bar-col .val { font-size: .6rem; font-weight: 700; color: var(--muted); }
.hbars { display: grid; gap: 11px; }
.hbar-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; font-size: .82rem; }
.hbar-row .hbar { height: 9px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.hbar-row .hbar > span { display: block; height: 100%; border-radius: 6px; background: var(--grad); }
.hbar-row .hval { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .8rem; }

/* ------------------------------------------------------------------ */
/*  Login / instalação                                                */
/* ------------------------------------------------------------------ */
.auth-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(90% 60% at 15% 0%, #FFF0DB 0%, transparent 55%),
              radial-gradient(80% 60% at 100% 100%, #fce7f3 0%, transparent 55%),
              #f7f5fc;
}
.auth-wrap { width: 100%; max-width: 430px; }
.auth-card { background: var(--surface); border-radius: 26px; box-shadow: 0 30px 70px rgba(49, 32, 95, .16); padding: 32px; border: 1px solid rgba(255,255,255,.6); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 15px; background: var(--grad); display: grid; place-items: center; font-size: 25px; box-shadow: 0 8px 20px rgba(255, 140, 0, .3); }
.auth-brand h1 { font-size: 1.3rem; }
.auth-brand p { font-size: .8rem; color: var(--muted); margin: 1px 0 0; }
.auth-title { font-size: 1.5rem; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: .87rem; margin-bottom: 22px; }
.auth-alt { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 18px; }
.install-steps { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; }
.install-steps li { display: flex; gap: 11px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: .85rem; }
.install-steps li > span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; flex: none; margin-top: 1px; }
.install-steps li.ok > span { background: var(--green-soft); color: var(--green); }
.install-steps li.fail > span { background: var(--red-soft); color: var(--red); }
.install-steps li small { display: block; color: var(--muted); font-size: .75rem; margin-top: 1px; word-break: break-word; }
.install-creds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.install-creds > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.install-creds span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.install-creds strong { font-size: .9rem; }
.install-creds code { justify-self: start; }
@media (max-width: 520px) { .auth-card { padding: 24px 20px; } .auth-body { padding: 14px; } }

/* ------------------------------------------------------------------ */
/*  Toasts / modal                                                    */
/* ------------------------------------------------------------------ */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border-radius: 13px; background: #1d1831; color: #fff; box-shadow: var(--shadow-lg); font-size: .85rem; animation: toastIn .25s ease; }
.toast .t-emoji { font-size: 1.1rem; }
.toast .t-title { font-weight: 800; font-size: .85rem; }
.toast .t-body { color: #c9c1df; font-size: .78rem; margin-top: 1px; line-height: 1.35; }
.toast.warn { background: #4a2c05; }
.toast.danger { background: #4a0f16; }
.toast .t-close { margin-left: auto; background: none; border: 0; color: #a79dbd; cursor: pointer; font-size: 1rem; padding: 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(15, 12, 30, .55); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ------------------------------------------------------------------ */
/*  Detalhes / listas                                                 */
/* ------------------------------------------------------------------ */
.detail-list { display: grid; gap: 9px; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; font-size: .88rem; align-items: baseline; }
.detail-row > span { color: var(--muted); }
.detail-row > strong { text-align: right; word-break: break-word; }
.total-box { background: var(--grad-soft); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.total-box .t-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.total-box .t-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; color: var(--brand); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dot-sep { color: var(--border-strong); margin: 0 6px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.pill-tabs { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.pill-tabs a { padding: 7px 13px; border-radius: 8px; font-size: .81rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.pill-tabs a.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field { margin-bottom: 0; }
.toolbar .grow { min-width: 130px; }

.whatsapp-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.whatsapp-card .wa-icon { width: 40px; height: 40px; border-radius: 12px; background: #e7f9f0; color: #059669; display: grid; place-items: center; flex: none; }
.whatsapp-card .wa-msg { font-size: .8rem; color: var(--muted); white-space: pre-line; margin-top: 4px; max-height: 92px; overflow: hidden; }

/* Impressão */
@media print {
  .sidebar, .topbar, .no-print, .toast-stack { display: none !important; }
  .app-main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  body, body.app { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .print-title { display: block !important; margin-bottom: 16px; }
  a { color: inherit; }
}
.print-title { display: none; }

.nasc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 100%; overflow-y: auto; }
.nasc-grid .btn { padding: 8px 4px; font-size: .85rem; }
dialog.nascDialog { border: 0; border-radius: 16px; padding: 0; width: min(360px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog.nascDialog::backdrop { background: rgba(15, 12, 30, .55); backdrop-filter: blur(3px); }

.auto-form .choice { padding: 3px 1px; }
.crianca-resumo { display: none; align-items: center; justify-content: space-between; gap: 8px; }
.crianca-resumo-acoes { display: flex; gap: 6px; flex: none; }
.crianca-bloco.collapsed .crianca-campos { display: none; }
.crianca-bloco.collapsed .crianca-resumo { display: flex; }

@media (max-width: 420px) {
  .auto-pad { padding: 3px 12px 0px 12px; }
}

@media (max-width: 960px) {
  .content { padding: 0 5px 0px 5px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .topbar-title h1 { font-size: 1.08rem; }
  .topbar-title p { display: none; }
  .kids-grid { grid-template-columns: 1fr; }
  .stat { padding: 13px 14px; }
  .stat .stat-value { font-size: 1.3rem; }
  .card-pad, .card-body, .card-head { padding-left: 16px; padding-right: 16px; }
  .checkout-panel { padding: 16px; }
  .auth-card { border-radius: 20px; }
  .install-creds { grid-template-columns: 1fr; }
}

