/* =========================================================
   PratiClub — design system (leve, sem dependências)
   ========================================================= */
:root {
  --brand: #0e7490;
  --brand-600: #0891b2;
  --brand-50: #ecfeff;
  --brand-100: #cffafe;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e9ee;
  --text: #0f1f2a;
  --text-2: #4b5d6b;
  --muted: #7b8b97;
  --ok: #0f9f6e;   --ok-bg: #e7f8f1;
  --warn: #b7791f; --warn-bg: #fdf4e3;
  --danger: #d23f3f; --danger-bg: #fdecec;
  --info: #2563eb; --info-bg: #eaf1fe;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,40,60,.05), 0 4px 16px rgba(16,40,60,.05);
  --sidebar-w: 248px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #22d3ee;
  --brand-600: #06b6d4;
  --brand-50: #0b2a33;
  --brand-100: #0f3a45;
  --bg: #0b1218;
  --surface: #111b23;
  --surface-2: #15212b;
  --border: #22313d;
  --text: #e6eef3;
  --text-2: #a9b8c3;
  --muted: #7a8a96;
  --ok: #34d399;   --ok-bg: #0e2d24;
  --warn: #fbbf24; --warn-bg: #33270d;
  --danger: #f87171; --danger-bg: #3a1717;
  --info: #60a5fa; --info-bg: #13233f;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 14.5px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; }
h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }
.ic-lg { width: 24px; height: 24px; }
.ic-xl { width: 48px; height: 48px; stroke-width: 1.4; color: var(--muted); }
[data-theme="dark"] .when-light, :root:not([data-theme="dark"]) .when-dark { display: none; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40;
  transition: transform .2s ease;
}
.brand { display: flex; gap: .7rem; align-items: center; padding: 1.1rem 1.1rem 1rem; color: var(--text); }
.brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand strong { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: var(--muted); font-size: .74rem; }
.nav { flex: 1; overflow-y: auto; padding: .25rem .7rem 1rem; }
.nav-group { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; cursor: pointer; font: inherit;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem .6rem .45rem; margin-top: .25rem; border-radius: var(--radius-sm); text-align: left; }
.nav-group:hover { color: var(--text); background: var(--surface-2); }
.nav-group:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nav-sec.has-active > .nav-group { color: var(--brand); }
.nav-chev { width: 14px; height: 14px; transition: transform .2s ease; flex-shrink: 0; }
.nav-sec.open > .nav-group .nav-chev { transform: rotate(180deg); }
.nav-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-items > div { overflow: hidden; min-height: 0; }
.nav-sec.open > .nav-items { grid-template-rows: 1fr; }
.nav-top { margin-top: .4rem; }
@media (prefers-reduced-motion: reduce) { .nav-items, .nav-chev { transition: none; } }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; margin-bottom: 1px; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-50); color: var(--brand); }
.nav-link.active .ic { stroke-width: 2.1; }
.sidebar-foot { padding: .7rem 1.2rem; font-size: .75rem; border-top: 1px solid var(--border); }
.sidebar-backdrop { display: none; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.page-title { font-size: 1.2rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.content { padding: 1.5rem; max-width: 1480px; width: 100%; }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); }
.user-btn { display: flex; align-items: center; gap: .55rem; background: none; border: 0; cursor: pointer; color: var(--text); padding: .2rem; border-radius: 10px; font: inherit; }
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.user-meta small { color: var(--muted); font-size: .74rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #22d3ee, #0e7490); color: #fff; font-weight: 700; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); min-width: 180px; padding: .35rem; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: flex; gap: .55rem; align-items: center; padding: .5rem .6rem; border-radius: 7px; color: var(--text); }
.dropdown-menu a:hover { background: var(--surface-2); }

.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 99px; font-size: .82rem; font-weight: 600; border: 1px solid transparent; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.grid > .card, .gate > .card, .pos > .card, .row > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.p0 { padding: 0; }
.card.p0 .card-head { padding: 1rem 1.25rem 0; }

.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span2 { grid-column: span 2; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }

.kpi { display: flex; gap: .9rem; align-items: flex-start; }
.kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.kpi-ic.ok { background: var(--ok-bg); color: var(--ok); }
.kpi-ic.warn { background: var(--warn-bg); color: var(--warn); }
.kpi-ic.danger { background: var(--danger-bg); color: var(--danger); }
.kpi-ic.info { background: var(--info-bg); color: var(--info); }
.kpi-label { color: var(--text-2); font-size: .82rem; font-weight: 500; }
.kpi-value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .78rem; color: var(--muted); }
a.card { color: inherit; }
a.card.kpi:hover { border-color: var(--brand-600); }

.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: .5rem; border: 1px solid var(--border); }
.meter > span { display: block; height: 100%; background: var(--brand-600); border-radius: 99px; }
.meter.warn > span { background: var(--warn); } .meter.danger > span { background: var(--danger); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .58rem 1rem;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand); border-color: var(--brand); }
[data-theme="dark"] .btn-primary { color: #04222a; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: .32rem .6rem; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: .85rem 1.3rem; font-size: 1.05rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: nowrap; }

/* Formulários */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: .9rem 1rem; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; }
.col-9 { grid-column: span 9; } .col-7 { grid-column: span 7; } .col-5 { grid-column: span 5; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label, .label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: .76rem; color: var(--muted); }
.req::after { content: " *"; color: var(--danger); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .55rem .75rem; width: 100%; min-height: 40px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand-600); }
input[type=color] { padding: .2rem; height: 40px; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap; }
.input-group { display: flex; gap: .5rem; }
.input-group > input { flex: 1; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }

/* Tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: .7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table .strong { font-weight: 600; }
.table-empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem !important; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.25rem; font-size: .85rem; border-top: 1px solid var(--border); }
.pager-nav { display: flex; gap: .25rem; }
.pager-nav a { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--text-2); }
.pager-nav a.active { background: var(--brand-600); color: #fff; }

.badge { display: inline-block; padding: .16rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.alert { display: flex; gap: .6rem; align-items: center; padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }

.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state h2 { margin-top: .8rem; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }

dl.info { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; }
dl.info dt { color: var(--muted); font-size: .85rem; }
dl.info dd { margin: 0; font-weight: 500; }

/* Diálogo */
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(8,20,28,.45); backdrop-filter: blur(2px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.dlg-head h3 { margin: 0; }
.dlg-body { padding: 1.25rem; }
.dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: 0 1.25rem 1.25rem; }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: .5rem; z-index: 100; }
.toast { background: var(--text); color: var(--surface); padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; animation: slide .2s ease; font-weight: 500; }
.toast.erro { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

/* ---------- PDV / Bilheteria ---------- */
.pos { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 1rem; align-items: start; }
.pos-cart { position: sticky; top: 76px; }
.cat-bar { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; margin-bottom: 1rem; }
.cat-bar button { flex-shrink: 0; }
.cat-bar .btn.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.prod {
  text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem;
  cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: .35rem; min-height: 104px; transition: border-color .15s, transform .05s;
}
.prod:hover { border-color: var(--brand-600); }
.prod:active { transform: scale(.98); }
.prod .nome { font-weight: 600; line-height: 1.25; flex: 1; }
.prod .preco { font-weight: 700; color: var(--brand); }
.prod .est { font-size: .75rem; color: var(--muted); }
.prod .est.baixo { color: var(--danger); }
.prod-tipo { border-left: 5px solid var(--cor, var(--brand-600)); }
.cart-items { max-height: 42vh; overflow-y: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); }
.cart-item .qty { display: flex; align-items: center; gap: .3rem; }
.cart-item .qty button { width: 28px; height: 28px; padding: 0; border-radius: 7px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.6rem; font-weight: 750; margin: .8rem 0; font-variant-numeric: tabular-nums; }
.pay-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px,1fr)); gap: .4rem; margin-bottom: .8rem; }
.pay-opts label { border: 1px solid var(--border); border-radius: 10px; padding: .55rem .3rem; text-align: center; cursor: pointer; font-weight: 600; font-size: .85rem; }
.pay-opts input { display: none; }
.pay-opts label:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand); }

/* ---------- Portaria ---------- */
.gate { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 1rem; }
.gate-input { font-size: 1.4rem; padding: .9rem 1rem; text-align: center; letter-spacing: .08em; font-weight: 600; min-height: 60px; }
.gate-result { border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; border: 2px dashed var(--border); color: var(--muted); }
.gate-result.ok { background: var(--ok-bg); border: 2px solid var(--ok); color: var(--ok); }
.gate-result.no { background: var(--danger-bg); border: 2px solid var(--danger); color: var(--danger); }
.gate-result .big { font-size: 2.2rem; font-weight: 800; letter-spacing: .02em; }
.gate-result .nome { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.gate-result img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid currentColor; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: var(--surface-2); }
.seg label { padding: .45rem 1rem; border-radius: 8px; cursor: pointer; font-weight: 600; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--surface); box-shadow: var(--shadow); color: var(--brand); }
#leitor { max-width: 100%; border-radius: 12px; overflow: hidden; }

/* ---------- Locações (mapa do dia) ---------- */
.spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: .75rem; }
.space { border: 1px solid var(--border); border-radius: 12px; padding: .9rem; background: var(--surface); display: flex; flex-direction: column; gap: .3rem; }
.space.livre { border-left: 5px solid var(--ok); }
.space.ocupado { border-left: 5px solid var(--warn); }

/* ---------- Carteirinha / Ingresso ---------- */
.member-card {
  width: 340px; max-width: 100%; aspect-ratio: 1.586; border-radius: 16px; padding: 1rem 1.1rem; color: #fff;
  background: linear-gradient(135deg, #0891b2, #0e7490 55%, #155e75); display: grid; grid-template-columns: 1fr auto; gap: .5rem; position: relative; overflow: hidden;
}
.member-card::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.member-card .mc-club { font-weight: 700; font-size: .95rem; grid-column: span 2; display: flex; gap: .5rem; align-items: center; }
.member-card .mc-nome { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.member-card .mc-qr { background: #fff; padding: 5px; border-radius: 8px; align-self: end; z-index: 1; }
.member-card small { opacity: .85; display: block; }
.member-card .mc-foto { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; border: 2px solid rgba(255,255,255,.6); }
.ticket { border: 2px dashed var(--border); border-radius: 14px; padding: 1rem; display: flex; gap: 1rem; align-items: center; background: var(--surface); break-inside: avoid; margin-bottom: .8rem; }
.ticket .qr { background: #fff; padding: 6px; border-radius: 8px; }
.ticket h3 { margin: 0 0 .2rem; }
.ticket-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .1em; font-size: 1.05rem; }

.perm-table select { min-width: 140px; }
.perm-table td:first-child { min-width: 220px; }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: linear-gradient(150deg, #0891b2, #0e7490 55%, #134e5e); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero h1 { font-size: 2.2rem; max-width: 460px; }
.auth-hero p { opacity: .85; max-width: 420px; font-size: 1.05rem; }
.auth-hero .waves { position: absolute; left: 0; right: 0; bottom: 0; opacity: .25; }
.auth-form { display: grid; place-items: center; padding: 2rem; background: var(--surface); }
.auth-form form { width: min(380px, 100%); }
.auth-form h2 { font-size: 1.5rem; }

/* ---------- Responsivo ---------- */
.only-mobile { display: none; }
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pos { grid-template-columns: minmax(0,1fr) 330px; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(8,20,28,.4); z-index: 35; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-grid; }
  .g3, .g2 { grid-template-columns: minmax(0,1fr); }
  .span2 { grid-column: auto; }
  .pos, .gate { grid-template-columns: minmax(0,1fr); }
  .pos-cart { position: static; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 2rem 1.5rem; min-height: 200px; }
  .auth-hero h1 { font-size: 1.6rem; }
}
@media (max-width: 640px) {
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; }
  .g4 > .kpi { flex-direction: column; gap: .5rem; padding: .9rem; }
  .g4 > .kpi .kpi-ic { width: 34px; height: 34px; border-radius: 10px; }
  .g4 > .kpi .meter { width: 100%; }
  .hide-sm { display: none !important; }
  .form-grid > [class^="col-"] { grid-column: span 12; }
  .card { padding: 1rem; }
  .kpi-value { font-size: 1.35rem; }
  .table th, .table td { padding: .6rem .7rem; }
  .card-head .btn { padding: .45rem .75rem; }
}

/* ---------- Impressão ---------- */
@media print {
  .sidebar, .topbar, .no-print, .toasts, .form-actions, .alert { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .member-card, .ticket { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Catracas ---- */
.catraca .cat-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0 .6rem; }
.catraca .cat-nums div { background: var(--surface-2); border-radius: 10px; padding: .55rem .4rem; text-align: center; }
.catraca .cat-nums strong { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.catraca .cat-nums span { font-size: .75rem; color: var(--muted); }
.catraca.inativa { opacity: .6; }
.badge .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: .35rem; vertical-align: middle; }
.badge-ok .dot { animation: pc-pulse 2s infinite; }
@keyframes pc-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.cfg-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .75rem .9rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.cfg-steps { padding-left: 1.2rem; margin: .5rem 0 0; }
.cfg-steps li + li { margin-top: .55rem; }
.gate-cat { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.gate-cat select { width: auto; min-width: 180px; }
.gate-cat .grow { flex: 1; min-width: 180px; }
.gate-cat .strong { font-weight: 600; }
.gate-cat > .ic { color: var(--brand); }
@media (max-width: 1280px) and (min-width: 961px) { .grid.g3:has(.catraca) { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---- Maquininha ---- */
.point-anim { color: var(--brand); margin: .25rem 0 .5rem; animation: pc-pulse 1.4s infinite; }
.point-anim.parado { animation: none; }
.form-secao { border-top: 1px solid var(--border); padding-top: .9rem; margin-top: .3rem; }
.form-secao h3 { margin: 0 0 .15rem; font-size: 1rem; }
.form-secao p { margin: 0; }

/* ---- Aulas e armários ---- */
.turma.inativa { opacity: .6; }
.meter > span.cheio { background: var(--danger); }
.seg.dias { flex-wrap: wrap; }
.seg.dias label { padding: .4rem .75rem; }
.chamada-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.chamada-lista label { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.chamada-lista label:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.chamada-lista input { width: 20px; height: 20px; accent-color: var(--ok); }
.armarios-mapa { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .55rem; }
.armario { border: 1.5px solid var(--border); border-radius: 12px; padding: .6rem .4rem; text-align: center; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.armario strong { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.armario small { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.armario.livre { border-color: var(--ok); background: var(--ok-bg); }
.armario.ocupado { border-color: var(--info); background: var(--info-bg); }
.armario.atrasado { border-color: var(--danger); background: var(--danger-bg); }
.armario.manutencao { border-style: dashed; opacity: .6; }
.armario:hover { box-shadow: var(--shadow); }
.legenda { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); }
.legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: .3rem; vertical-align: -1px; border: 1.5px solid; }

/* ---- Festas e eventos ---- */
.agenda { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.ag-dow { padding: .5rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: center; border-bottom: 1px solid var(--border); }
.ag-dia { min-height: 96px; padding: .35rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.ag-dia:nth-child(7n) { border-right: 0; }
.ag-dia.vazio { background: var(--surface-2); }
.ag-dia.passado .ag-num { color: var(--muted); }
.ag-dia.hoje { background: var(--brand-50); }
.ag-dia.hoje .ag-num { color: var(--brand-600); font-weight: 800; }
.ag-num { font-size: .8rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.ag-add { opacity: 0; font-weight: 700; padding: 0 .35rem; border-radius: 6px; color: var(--brand-600); }
.ag-dia:hover .ag-add, .ag-add:focus { opacity: 1; background: var(--brand-100); }
.ag-ev { display: block; font-size: .72rem; line-height: 1.25; padding: .2rem .35rem; border-radius: 6px; border-left: 3px solid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ag-ev.st-orcamento { background: var(--surface-2); border-color: var(--muted); }
.ag-ev.st-confirmado { background: var(--info-bg); border-color: var(--info); }
.ag-ev.st-realizado { background: var(--ok-bg); border-color: var(--ok); }
.legenda i.ag-ev { display: inline-block; width: 12px; height: 12px; padding: 0; border: 0; }
.legenda i.ag-ev.st-orcamento { background: var(--muted); } .legenda i.ag-ev.st-confirmado { background: var(--info); } .legenda i.ag-ev.st-realizado { background: var(--ok); }
.ev-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ev-lista li a { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--border); color: inherit; }
.ev-lista li:last-child a { border-bottom: 0; }
.ev-data { width: 46px; flex: none; text-align: center; background: var(--brand-50); color: var(--brand-600); border-radius: 10px; padding: .3rem 0; line-height: 1.1; }
.ev-data strong { display: block; font-size: 1.15rem; } .ev-data span { font-size: .7rem; text-transform: uppercase; font-weight: 700; }
.ev-lista .grow { flex: 1; min-width: 0; }
.parcelas { display: grid; gap: .5rem; }
.parcela { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.parcela.paga { background: var(--ok-bg); border-color: transparent; }
.parcela.vencida { border-color: var(--danger); }
.conv-lista { max-height: 520px; overflow: auto; }
.conv-lista tr.entrou td { color: var(--muted); }
.contrato-txt { white-space: pre-wrap; font-family: var(--font); line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; max-height: 420px; overflow: auto; font-size: .9rem; }
.itens-ev input { min-width: 0; }
.itens-ev td { vertical-align: middle; }
@media (max-width: 720px) {
  .agenda { font-size: .9em; }
  .ag-dia { min-height: 64px; padding: .2rem; }
  .ag-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .ag-ev.st-orcamento { background: var(--muted); } .ag-ev.st-confirmado { background: var(--info); } .ag-ev.st-realizado { background: var(--ok); }
  .ag-dow { padding: .35rem 0; font-size: .65rem; }
}

/* ---- Financeiro ---- */
.table.dre td { padding-top: .45rem; padding-bottom: .45rem; }
.dre-g td { font-weight: 700; background: var(--surface-2); }
.dre-item td:first-child { padding-left: 2rem; color: var(--text-2); }
.dre-t td { font-weight: 800; border-top: 2px solid var(--border); }
.dre-T td { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--text); background: var(--brand-50); }
.fin-kpis .kpi-value { font-size: clamp(1.1rem, 1.55vw, 1.55rem); white-space: nowrap; }
