/* DMPainel — grafite + magenta. */
:root {
  --bg: #08090b;
  --bg-2: #0d0f12;
  --card: #111318;
  --card-2: #151820;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #e9ecf2;
  --text-2: #a3abba;
  --muted: #6c7484;
  --accent: #e0408a;
  --accent-2: #ff7ab8;
  --accent-soft: rgba(224, 64, 138, 0.14);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -12px rgba(0,0,0,.6);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sec { color: var(--text-2); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.s { width: 15px; height: 15px; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); position: fixed; inset: 0 auto 0 0; background: var(--bg-2);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: #d6337f; color: #fff; box-shadow: 0 6px 18px -6px rgba(214, 51, 127,.7);
}
.brand-mark svg { width: 17px; height: 17px; }
.fb-logo { width: 30px; height: 30px; flex-shrink: 0; display: block; filter: drop-shadow(0 6px 14px rgba(214, 51, 127,.45)); }
.auth-card .fb-logo { width: 34px; height: 34px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: #fff; }
.nav a.on svg { color: var(--accent-2); }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--text); }
.user-chip:hover { background: rgba(255,255,255,.04); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--accent-2); text-transform: uppercase; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 22px 32px 0; }
.topbar .sub { color: var(--muted); margin-top: 2px; }
.content { padding: 22px 32px 90px; max-width: 1320px; }
.tabs-mobile, .appbar { display: none; }
.topbar-actions { justify-content: flex-end; }
.bell-desk, .appbar-btn { position: relative; }
.dot { position: absolute; top: -3px; right: -4px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px; background: #f02849; color: #fff; font-size: 10.5px; font-weight: 750; display: grid; place-items: center; line-height: 1; border: 2px solid var(--bg); font-variant-numeric: tabular-nums; }

/* chave liga/desliga */
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255,255,255,.12); transition: background .18s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .18s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }
.pref-row { cursor: pointer; }
.pref-row:hover { background: rgba(255,255,255,.015); }
.pref-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text-2); flex-shrink: 0; }
.pref-ico.k-post_done { color: var(--ok); } .pref-ico.k-post_failed, .pref-ico.k-page_down, .pref-ico.k-worker_down { color: var(--bad); }
.pref-ico.k-page_restricted, .pref-ico.k-reels_limit { color: var(--warn); }
.notif { color: inherit; align-items: flex-start; }
.notif:hover { background: rgba(255,255,255,.02); color: inherit; }
.notif.unread { background: rgba(224, 64, 138,.06); box-shadow: inset 3px 0 0 var(--accent); }

/* menu "Mais" (folha que sobe) */
.sheet-bg { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--card); border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); animation: sheet-up .2s ease-out; }
.sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); margin: 4px auto 10px; }
.sheet a, .sheet button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 10px; border-radius: 12px; color: var(--text); font: 600 15px var(--font); background: none; border: 0; text-align: left; cursor: pointer; }
.sheet a:active, .sheet button:active { background: rgba(255,255,255,.06); }
.sheet svg { color: var(--text-2); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 16px 20px; }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.kpi { padding: 16px 18px; }
.kpi .label { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.kpi .label svg { color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .foot { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- botões / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text);
  font: 600 13px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: rgba(255,255,255,.22); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #ff8cc2; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(255,255,255,.05); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: rgba(248,113,113,.5); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn.icon { width: 32px; padding: 0; }
form.inline { display: inline; margin: 0; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 550; font-size: 13px; color: var(--text-2); }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 9px;
  padding: 9px 12px; font: 14px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input[type=time], input[type=datetime-local] { color-scheme: dark; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; color: var(--text); font-weight: 500; }
.check input { margin-top: 2px; }

/* chips de escolha */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: rgba(255,255,255,.22); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .t { font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 8px; }
.choice .d { color: var(--muted); font-size: 12px; line-height: 1.4; }
.choice.on, .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.on .t svg, .choice:has(input:checked) .t svg { color: var(--accent-2); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 6px 12px; border-radius: 7px; color: var(--text-2); font-weight: 600; font-size: 12.5px; background: none; border: 0; cursor: pointer; font-family: var(--font); }
.seg a.on, .seg button.on { background: var(--card-2); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-picker label { width: 38px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line-2); cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--text-2); background: var(--bg-2); }
.day-picker input { display: none; }
.day-picker label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: #fff; }

/* ---------- badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: rgba(255,255,255,.06); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent-2); }
.badge.count { background: var(--accent); color: #fff; height: 19px; padding: 0 7px; }
.badge.count::before { display: none; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; border: 1px solid; font-size: 13.5px; }
.alert svg { margin-top: 1px; }
.alert.ok { background: var(--ok-soft); border-color: rgba(52,211,153,.3); color: #b6f2d9; }
.alert.bad { background: var(--bad-soft); border-color: rgba(248,113,113,.3); color: #fecaca; }
.alert.warn { background: var(--warn-soft); border-color: rgba(251,191,36,.3); color: #fde68a; }
.alert.info { background: var(--accent-soft); border-color: rgba(224, 64, 138,.3); color: #ffe0ee; }
.flash-wrap { margin-bottom: 18px; }

/* ---------- tabela ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: rgba(255,255,255,.015); }
.err-text { color: var(--bad); font-size: 12px; max-width: 420px; }

/* ---------- páginas ---------- */
.pic { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--card-2); border: 1px solid var(--line-2); flex-shrink: 0; }
.pic.sm { width: 26px; height: 26px; }
.pic.lg { width: 52px; height: 52px; }
.pic-fallback { display: grid; place-items: center; font-weight: 700; color: var(--accent-2); }
.page-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.page-card .meta { display: flex; gap: 18px; color: var(--text-2); font-size: 12.5px; }
.page-card .meta b { color: var(--text); font-weight: 650; display: block; font-size: 15px; }
.page-card .actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.page-card.paused { opacity: .62; }

/* ---------- biblioteca ---------- */
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--text-2);
  background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255,255,255,.012) 12px 24px); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background-color: var(--accent-soft); color: var(--text); }
.dropzone .big { font-size: 15px; font-weight: 650; color: var(--text); margin-top: 8px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.tile { position: relative; border-radius: 12px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line); cursor: pointer; aspect-ratio: 9 / 12; transition: border-color .15s, transform .15s; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.tile .tag { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; backdrop-filter: blur(4px); display: flex; gap: 4px; align-items: center; }
.tile .tag svg { width: 12px; height: 12px; }
.tile .sel { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: rgba(0,0,0,.35); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.tile.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tile.on .sel { background: var(--accent); border-color: var(--accent); }
.tile.bad { opacity: .45; }
.tile .warn-tag { position: absolute; left: 8px; top: 8px; right: 38px; font-size: 10.5px; padding: 2px 6px; border-radius: 6px; background: rgba(248,113,113,.85); color: #fff; line-height: 1.3; }
.progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .3s; }
.upload-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 70px; gap: 12px; align-items: center; font-size: 12.5px; }

/* ---------- gráfico de barras ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar i { width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); min-height: 3px; opacity: .9; }
.bar i.zero { background: rgba(255,255,255,.07); }
.bar span { font-size: 10.5px; color: var(--muted); }
.bar:hover i { opacity: 1; }
.bar .n { font-size: 11px; color: var(--text-2); font-weight: 600; }

/* ---------- listas ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text-2); }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ---------- wizard ---------- */
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px; }
.step + .step { margin-top: 26px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); font-weight: 700; color: var(--text-2); font-size: 13px; }
.step.done .step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-title { font-weight: 650; font-size: 15px; margin: 4px 0 12px; }
.page-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.page-pick label { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; }
.page-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.page-pick label.off { opacity: .5; }
.summary-bar { position: sticky; bottom: 0; margin-top: 26px; padding: 14px 18px; background: rgba(13,15,18,.92); backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: var(--radius); display: flex; align-items: center; gap: 16px; z-index: 5; }
.caption-list { display: flex; flex-direction: column; gap: 10px; }
.caption-item { position: relative; }
.caption-item .rm { position: absolute; top: 6px; right: 6px; }
.times-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.time-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 8px; background: var(--accent-soft); border: 1px solid rgba(224, 64, 138,.35); font-weight: 650; font-variant-numeric: tabular-nums; }
.time-pill button { background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.time-pill button:hover { color: #fff; background: rgba(255,255,255,.08); }
details.adv > summary { cursor: pointer; color: var(--text-2); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv[open] > summary svg { transform: rotate(90deg); }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { width: min(980px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
.modal .card-body { overflow: auto; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse 60% 50% at 50% -10%, rgba(224, 64, 138,.16), transparent 60%), var(--bg); }
.auth-card { width: min(400px, 100%); padding: 30px; }
.auth-card .brand { justify-content: center; padding: 0 0 6px; font-size: 18px; }

/* ---------- toast ---------- */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 420px; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --tabs-h: 64px; }
  .sidebar, .bell-desk { display: none; }
  .main { margin-left: 0; }
  .appbar {
    display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 25;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px;
    background: rgba(8,9,11,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  }
  .appbar .brand { padding: 0; margin-right: auto; font-size: 17px; }
  .appbar .fb-logo { width: 28px; height: 28px; }
  .appbar-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--text-2); }
  .appbar-btn:active { background: rgba(255,255,255,.06); }
  .appbar-btn .avatar { width: 30px; height: 30px; }
  .topbar { padding: 16px 16px 0; flex-wrap: wrap; gap: 10px; }
  .topbar h1 { font-size: 20px; }
  .topbar .sub { font-size: 13px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .topbar-actions:empty, .topbar-actions:not(:has(> :not(.bell-desk))) { display: none; }
  .content { padding: 16px 14px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); }
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: 12px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 23px; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .list-item { padding-left: 16px; padding-right: 16px; }
  /* iOS não dá zoom em campo com 16px */
  input[type=text], input[type=password], input[type=number], input[type=url], input[type=time], input[type=datetime-local], select, textarea { font-size: 16px; }
  .btn { height: 40px; }
  .btn.sm { height: 34px; }

  .tabs-mobile {
    display: flex; align-items: stretch; position: fixed; inset: auto 0 0 0; z-index: 30;
    height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(13,15,18,.97); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .tabs-mobile a, .tabs-mobile button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font: 600 10.5px var(--font); background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tabs-mobile .on { color: var(--accent-2); }
  .tabs-mobile .fab { flex: 0 0 64px; }
  .tabs-mobile .fab svg { width: 50px; height: 50px; padding: 13px; border-radius: 16px; background: var(--accent); color: #fff; stroke-width: 2.4; box-shadow: 0 8px 22px -8px rgba(224, 64, 138,.8); transform: translateY(-10px); }

  .step { grid-template-columns: minmax(0, 1fr); }
  .step-n { display: none; }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-bar { bottom: calc(var(--tabs-h) + 8px + env(safe-area-inset-bottom)); flex-wrap: wrap; padding: 12px; }
  .summary-bar .btn { width: 100%; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .upload-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .upload-row .pct { display: none; }
  .hide-m { display: none; }
  .toast { left: 12px; right: 12px; bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom)); max-width: none; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 18px 18px 0 0; }
  .page-card .actions .btn { flex: 1; }

  /* tabelas viram cards */
  table.resp thead { display: none; }
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.resp tr:last-child { border-bottom: 0; }
  table.resp td { border: 0; padding: 3px 0; display: flex; gap: 6px; justify-content: flex-end; align-items: center; text-align: right; }
  table.resp td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex-shrink: 0; margin-right: auto; padding-right: 12px; }
  table.resp td.cell-main { padding-bottom: 6px; text-align: left; justify-content: flex-start; }
  table.resp td.cell-main .ellipsis { max-width: none !important; }
  table.resp td.cell-actions { justify-content: flex-end; padding-top: 8px; }
  table.resp td.cell-actions:empty { display: none; }
  table.resp td .err-text { text-align: left; max-width: none; }
  table.resp td.cell-block { display: block; text-align: left; }
  table.resp tr:hover td { background: none; }
}
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}

/* ---------- grupos / chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: rgba(255,255,255,.22); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.chip.ghost { border-style: dashed; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.tag-group { font-size: 11px; font-weight: 650; padding: 1px 8px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.page-card { position: relative; }
.page-sel { position: absolute; top: 12px; right: 12px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line-2); cursor: pointer; }
.page-sel input { width: 18px; height: 18px; }
.page-card:has(.page-sel input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.select-bar { position: sticky; bottom: 16px; margin-top: 16px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: rgba(13,15,18,.95); backdrop-filter: blur(10px); border: 1px solid var(--accent); box-shadow: 0 16px 40px -16px rgba(0,0,0,.8); }

/* ---------- calendário ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; }
.cal-head { padding: 10px 8px; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); text-align: center; }
.cal-day { min-height: 92px; padding: 8px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; display: flex; flex-direction: column; gap: 6px; cursor: pointer; font-family: var(--font); }
.cal-day:nth-child(7n + 7) { border-right: 0; }
.cal-day:hover { background: rgba(255,255,255,.025); }
.cal-day.out { color: var(--muted); background: rgba(0,0,0,.18); }
.cal-day.sel { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-n { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-n { background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; align-self: flex-start; }
.cal-counts { display: flex; flex-wrap: wrap; gap: 4px; }
.cc { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.cc.done { background: var(--ok-soft); color: var(--ok); }
.cc.planned { background: var(--accent-soft); color: var(--accent-2); }
.cc.failed { background: var(--bad-soft); color: var(--bad); }
.cdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cdot.done { background: var(--ok); } .cdot.planned { background: var(--accent); } .cdot.failed { background: var(--bad); }
.cal-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 2FA ---------- */
.qr-box { background: #fff; padding: 10px; border-radius: 12px; width: 200px; flex-shrink: 0; }
.qr-box svg { width: 100%; height: auto; display: block; }
.recovery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.recovery-grid code { padding: 10px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line-2); text-align: center; font-size: 14px; color: var(--text); }
button:disabled[title] { cursor: help; }

@media (max-width: 760px) {
  .cal-day { min-height: 58px; padding: 5px 4px; gap: 3px; }
  .cal-head { padding: 8px 2px; font-size: 10px; letter-spacing: 0; }
  .cc { font-size: 10px; padding: 0 5px; }
  .recovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .select-bar { bottom: calc(var(--tabs-h) + 10px + env(safe-area-inset-bottom)); }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
}
