/* ============================================================================
   SerenoPro — design system do app (Web/Admin). Shell com sidebar + componentes.
   Mesmo arquivo nos dois hosts (copiar ao alterar).
   ========================================================================== */
:root {
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;

  --bg: #F3F6F4; --surface: #FFFFFF; --surface-2: #F7FAF8; --sidebar: #FBFDFC;
  --ink: #172622; --muted: #5C6E68; --faint: #8CA09A; --line: #DFE8E4; --line-soft: #E9F0EC;
  --brand: #2E7D6E; --brand-deep: #1E5A4E; --brand-soft: #E3EFEB; --brand-ink: #FFFFFF;
  --btn: #2C7A6B; --btn-hover: #1E5A4E;
  --ok: #2E7D6E; --ok-soft: #E3EFEB;
  --warn: #A96F14; --warn-soft: #FBF1DD;
  --danger: #C0453F; --danger-soft: #FBE9E8;
  --info: #2F6FA6; --info-soft: #E6EFF7;
  --shadow: 0 1px 2px rgba(23,38,34,.04), 0 6px 20px rgba(23,38,34,.05);
  --shadow-lg: 0 8px 40px rgba(23,38,34,.13);
  --radius: 14px; --radius-sm: 9px;
}
@media (prefers-color-scheme: dark) { :root {
  --bg:#0C1614; --surface:#132019; --surface-2:#17271F; --sidebar:#0F1B17;
  --ink:#E9F1EE; --muted:#9DB3AC; --faint:#6E837C; --line:#233830; --line-soft:#1C2E27;
  --brand:#58AF9B; --brand-deep:#7CC7B3; --brand-soft:#173029; --brand-ink:#0C1614;
  --btn:#2E8273; --btn-hover:#3B9682;
  --ok:#58AF9B; --ok-soft:#173029; --warn:#D8A445; --warn-soft:#2C2617;
  --danger:#E0776F; --danger-soft:#2E1B1A; --info:#6FA8D6; --info-soft:#152530;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
} }
:root[data-theme="dark"] {
  --bg:#0C1614; --surface:#132019; --surface-2:#17271F; --sidebar:#0F1B17;
  --ink:#E9F1EE; --muted:#9DB3AC; --faint:#6E837C; --line:#233830; --line-soft:#1C2E27;
  --brand:#58AF9B; --brand-deep:#7CC7B3; --brand-soft:#173029; --brand-ink:#0C1614;
  --btn:#2E8273; --btn-hover:#3B9682;
  --ok:#58AF9B; --ok-soft:#173029; --warn:#D8A445; --warn-soft:#2C2617;
  --danger:#E0776F; --danger-soft:#2E1B1A; --info:#6FA8D6; --info-soft:#152530;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
}
:root[data-theme="light"] {
  --bg:#F3F6F4; --surface:#FFFFFF; --surface-2:#F7FAF8; --sidebar:#FBFDFC;
  --ink:#172622; --muted:#5C6E68; --faint:#8CA09A; --line:#DFE8E4; --line-soft:#E9F0EC;
  --brand:#2E7D6E; --brand-deep:#1E5A4E; --brand-soft:#E3EFEB; --brand-ink:#FFFFFF;
  --btn:#2C7A6B; --btn-hover:#1E5A4E;
  --ok:#2E7D6E; --ok-soft:#E3EFEB; --warn:#A96F14; --warn-soft:#FBF1DD;
  --danger:#C0453F; --danger-soft:#FBE9E8; --info:#2F6FA6; --info-soft:#E6EFF7;
  --shadow: 0 1px 2px rgba(23,38,34,.04), 0 6px 20px rgba(23,38,34,.05);
  --shadow-lg: 0 8px 40px rgba(23,38,34,.13);
}

/* ---- Base ------------------------------------------------------------- */
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.18rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .8rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); border: 1px solid var(--line-soft); padding: .08em .35em; border-radius: 6px; word-break: break-all; }
hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
svg { flex: 0 0 auto; }

/* ---- Shell (sidebar + topbar + conteúdo) ------------------------------- */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }

.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px; gap: 6px; }
.side-brand { display: flex; align-items: center; gap: .6rem; font-family: var(--serif); font-weight: 600;
  font-size: 1.18rem; color: var(--ink); padding: 4px 10px 14px; }
.side-brand svg { width: 30px; height: 30px; }
.side-brand .tag { font-family: var(--sans); font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: .15rem .5rem; }
.side-group { margin-top: 14px; padding: 0 10px 6px; font-size: .68rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint); }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: .92rem; }
.side-nav a svg { width: 18px; height: 18px; }
.side-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side-nav a.active { background: var(--brand-soft); color: var(--brand-deep); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem; }
.side-user .who { min-width: 0; }
.side-user .who b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { display: block; font-size: .74rem; color: var(--muted); }
.side-actions { display: flex; gap: 6px; padding: 0 .3rem .2rem; }
.side-actions a, .side-actions button { flex: 1; justify-content: center; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 26px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .crumb { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.topbar .crumb b { color: var(--ink); }
.topbar .spacer { flex: 1; }
.burger { display: none; }

.content { width: 100%; max-width: 1140px; margin: 0 auto; padding: 26px 28px 48px; }

/* Shell público / autenticação (sem sidebar) */
.pub-shell { min-height: 100vh; display: flex; flex-direction: column; }
.pub-top { display: flex; align-items: center; gap: 12px; padding: 14px 26px; }
.pub-top .brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--ink); }
.pub-top .brand svg { width: 28px; height: 28px; }
.pub-top .spacer { flex: 1; }
.pub-main { width: 100%; max-width: 920px; margin: 0 auto; padding: 12px 24px 56px; flex: 1; }
.auth-center { display: grid; place-items: center; min-height: calc(100vh - 190px); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px 34px 28px; }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { font-size: 1.45rem; margin-bottom: .25rem; }
.auth-card .lead { color: var(--muted); font-size: .92rem; margin-bottom: 1.2rem; }
.auth-links { margin-top: 14px; text-align: center; font-size: .9rem; }

/* ---- Botões ------------------------------------------------------------ */
button, .btn, input[type="submit"] {
  font-family: var(--sans); font-weight: 600; font-size: .9rem; padding: .55rem 1rem; border-radius: 10px;
  border: 1px solid transparent; background: var(--btn); color: #fff; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: .45rem; line-height: 1.2;
  transition: background .15s ease, border-color .15s, color .15s, transform .06s ease; }
button:hover, .btn:hover, input[type="submit"]:hover { background: var(--btn-hover); color: #fff; text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 82%, #000); }
.btn-sm { padding: .34rem .65rem; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], button[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--surface); }
.icon-btn svg { display: block; }

/* ---- Formulários -------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"],
input[type="date"], input[type="datetime-local"], input[type="number"], input:not([type]),
select, textarea {
  font-family: inherit; font-size: .93rem; padding: .58rem .7rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; max-width: 100%;
  transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
label { color: var(--ink); font-size: .85rem; font-weight: 600; }
.field { display: grid; gap: 6px; margin: 0 0 15px; }
.field .hint { color: var(--muted); font-weight: 400; font-size: .8rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.form-sec { margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
  font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.checkbox { display: flex; align-items: center; gap: .55rem; font-weight: 500; font-size: .92rem; color: var(--ink); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand); }
form p { margin: 0 0 12px; }
.validation-summary-errors { color: var(--danger); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.field-validation-error, .text-danger { color: var(--danger); font-size: .83rem; }

/* ---- Cards / grid / stats ---------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 16px; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .empty { border: none; border-radius: 0; }
.card.flush > .card-head { padding: 16px 18px 0; }   /* header alinhado em card sem padding */
.empty.sm { padding: 22px 16px; }                     /* estado vazio compacto (dentro de card) */

.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-auto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-deep);
  display: grid; place-items: center; }
.stat .ico svg { width: 20px; height: 20px; }
.stat .label { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat .value { font-family: var(--serif); font-size: 1.65rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .value.sm { font-size: 1.25rem; }
a.stat { color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
a.stat.is-active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

/* ---- Cabeçalho de página / toolbar ------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 2px 0 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 3px 0 0; font-size: .92rem; display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); }
.toolbar .search input { padding-left: 34px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px 14px; align-items: end; }
.filter-grid .field { margin: 0; }
.filter-grid input:disabled, .filter-grid select:disabled { opacity: .55; cursor: not-allowed; }

/* ---- Badges / avatar / alerts ------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .01em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 28%, transparent); }
.badge.brand { background: var(--brand-soft); color: var(--brand-deep); border-color: color-mix(in srgb, var(--brand) 28%, transparent); }
.dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; display: inline-block; }

.avi { width: 34px; height: 34px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep);
  display: inline-grid; place-items: center; font-size: .78rem; font-weight: 800; letter-spacing: .02em; flex: 0 0 auto; }
.avi.lg { width: 46px; height: 46px; font-size: .95rem; }
.person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.person .p-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .p-sub { font-size: .78rem; color: var(--muted); }

.alert, .flash { border: 1px solid var(--line); border-left: 3px solid var(--muted); padding: 11px 14px;
  border-radius: 0 10px 10px 0; margin: 0 0 16px; background: var(--surface-2); font-size: .92rem; }
.alert-ok, .flash { background: var(--ok-soft); border-left-color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.alert-erro { background: var(--danger-soft); border-left-color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); color: color-mix(in srgb, var(--danger) 80%, var(--ink)); }
.alert-info { background: var(--info-soft); border-left-color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); color: color-mix(in srgb, var(--info) 80%, var(--ink)); }

/* ---- Empty state / tabs / listas ---------------------------------------- */
.empty { text-align: center; color: var(--muted); padding: 42px 20px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); }
.empty svg { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }
.empty h3 { color: var(--ink); margin-bottom: .3rem; }
.empty p { margin: 0 0 12px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 18px; flex-wrap: wrap; }
.tabs a { color: var(--muted); padding: .5rem .8rem; border-radius: 8px 8px 0 0; font-size: .9rem; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

.linklist { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.linklist a { display: flex; align-items: center; gap: .65rem; padding: .68rem .85rem; border: 1px solid var(--line);
  border-radius: 11px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: .92rem; }
.linklist a svg { width: 17px; height: 17px; color: var(--brand); }
.linklist a:hover { border-color: var(--brand); text-decoration: none; background: var(--surface-2); }
.linklist a .go { margin-left: auto; color: var(--faint); }

/* ---- Feed / timeline (histórico consistente entre telas) --------------- */
.feed { display: grid; }
.feed-item { display: flex; gap: .75rem; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.feed-item:last-child { border-bottom: none; padding-bottom: 0; }
.feed-item > .dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 999px; background: var(--brand); margin-top: 8px; }
.feed-item .body { flex: 1; min-width: 0; }
.feed-item .head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.feed-item .head .title { font-weight: 600; }
.feed-item .when { font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-item .text { margin: .25rem 0 0; overflow-wrap: anywhere; }
.feed-item .meta { margin: .2rem 0 0; font-size: .82rem; color: var(--muted); }

/* ---- Tabelas ------------------------------------------------------------ */
html, body { overflow-x: clip; }   /* a página nunca rola na horizontal */
.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; margin: 4px 0 10px; font-size: .92rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
.card table, .card.flush table { margin: 0; }
td .row, td form { display: inline-flex; margin: 0 2px 0 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Blocos ------------------------------------------------------------- */
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; white-space: pre-wrap; overflow-x: auto; font-size: .88rem; }
.doc-body { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; white-space: pre-wrap; line-height: 1.7; font-size: .95rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 22px; margin: 0; }
dl dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
dl dd { margin: 0; font-size: .93rem; }
ul { line-height: 1.7; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin: 8px 0; background: var(--surface); }
summary { cursor: pointer; font-weight: 600; }

.video-frame { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--radius); background: #0b1512; overflow: hidden; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.bar-track { flex: 1; background: var(--surface-2); border-radius: 6px; overflow: hidden; height: 14px; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 6px; }

/* Planos (billing) */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 6px 0 18px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); display: grid; gap: 4px; }
.plan b { font-family: var(--serif); font-size: 1.05rem; }
.plan .price { font-family: var(--serif); font-size: 1.5rem; color: var(--brand-deep); }
.plan .price small { font-family: var(--sans); font-size: .78rem; color: var(--muted); }

/* ---- Responsivo --------------------------------------------------------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 262px; z-index: 40; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10,20,17,.45); z-index: 30; }
  .burger { display: inline-grid; }
  .content { padding: 20px 18px 44px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 22px; }
}

/* Tabelas marcadas com data-stack viram cartões no celular — sem rolagem lateral.
   Cada <td> usa data-label="Coluna" para rotular o valor. */
@media (max-width: 720px) {
  table[data-stack] { font-size: .95rem; }
  table[data-stack] thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  table[data-stack] tr { display: block; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); margin: 0 0 10px; padding: 6px 4px; }
  table[data-stack] tbody tr:last-child { margin-bottom: 0; }
  table[data-stack] tbody tr:hover td { background: transparent; }
  table[data-stack] td { display: block; border: 0; padding: 5px 14px; text-align: left; }
  table[data-stack] td.num { text-align: left; }
  table[data-stack] td:first-child { padding-top: 12px; }
  table[data-stack] td:last-child { padding-bottom: 12px; }
  table[data-stack] td::before { content: attr(data-label); display: block; font-size: .66rem;
    text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; margin-bottom: 1px; }
  table[data-stack] td[data-label=""]::before, table[data-stack] td:not([data-label])::before { content: none; }
  table[data-stack] td .row, table[data-stack] td form { display: inline-flex; }
}
