/* =========================================================
   Painel de membros: tokens
   O acento (--p) acompanha a cor do app que está sendo editado.
   ========================================================= */
:root {
  --p: #3A5BD9;
  --p-ink: color-mix(in srgb, var(--p) 78%, black);
  --p-tint: color-mix(in srgb, var(--p) 9%, white);
  --p-tint-2: color-mix(in srgb, var(--p) 16%, white);
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --ink: #15171C;
  --ink-2: #5B6270;
  --ink-3: #8A909C;
  --line: #E4E6EB;
  --line-2: #D5D8DF;
  --danger: #C93A2F;
  --danger-tint: #FCEEEC;
  --warn: #A86400;
  --warn-tint: #FFF4E2;
  --ok: #1F7A4D;
  --ok-tint: #E6F4EC;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow-1: 0 1px 2px rgba(20, 23, 28, .05);
  --shadow-2: 0 12px 32px -12px rgba(20, 23, 28, .18);
  --side-w: 256px;
  --top-h: 60px;
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--p-ink); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--p) 45%, white); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--p-tint-2); }

/* ---------- login ---------- */
.a-login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(90% 60% at 50% 0%, var(--p-tint-2), transparent 70%), var(--bg); }
.a-login form { background: var(--surface); border-radius: 20px; padding: 34px 30px; width: 100%; max-width: 400px; display: grid; gap: 16px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-2); }
.a-login .mark { width: 44px; height: 44px; border-radius: 12px; background: var(--p); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.a-login h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.a-login p { margin: 4px 0 0; color: var(--ink-2); }

/* ---------- estrutura ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.side-brand .lg { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.side a.nav { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.side a.nav svg { flex: none; color: var(--ink-3); }
.side a.nav:hover { background: var(--surface-2); color: var(--ink); }
.side a.nav:hover svg { color: var(--ink-2); }
.side a.nav[aria-current="page"] { background: var(--p-tint); color: var(--p-ink); }
.side a.nav[aria-current="page"] svg { color: var(--p); }
.side .label { font-size: 12px; color: var(--ink-3); padding: 16px 10px 6px; font-weight: 700; letter-spacing: .02em; }
.side .grow { flex: 1; min-height: 12px; }
.side .foot { border-top: 1px solid var(--line); padding: 12px 6px 2px; display: grid; gap: 2px; }
.side .foot a, .side .foot button { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; padding: 7px 6px; border-radius: 8px; text-align: left; }
.side .foot a:hover, .side .foot button:hover { color: var(--ink); background: var(--surface-2); }
.count { margin-left: auto; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }

/* troca de app */
.switcher { position: relative; margin: 2px 0 8px; }
.switcher .card { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.switcher .card .lg { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.switcher .card b { display: block; font-size: 14.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher .card small { display: block; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher .card > div { min-width: 0; flex: 1; }
.switcher select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.switcher:focus-within .card { box-shadow: inset 0 0 0 2px var(--p); }

/* barra superior */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .where { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 600; min-width: 0; }
.topbar .where b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; width: 38px; height: 38px; border-radius: 10px; place-items: center; color: var(--ink); }
.menu-btn:hover { background: var(--surface); }

main#main { padding: 8px 28px 64px; max-width: 1200px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; line-height: 1.2; }
.head p { margin: 6px 0 0; color: var(--ink-2); max-width: 640px; }
.crumbs { font-size: 13.5px; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--p-ink); text-decoration: underline; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-2); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(20,23,28,.35); z-index: 25; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 14px; }
  main#main { padding: 6px 16px 56px; }
}

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px;
  background: var(--p); color: #fff; font-weight: 700; font-size: 14.5px; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-1);
  transition: background .15s, box-shadow .15s, transform .08s; }
.btn:hover { background: var(--p-ink); }
.btn:active { transform: translateY(1px); }
.btn.sec { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-1); }
.btn.sec:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface); color: var(--ink); }
.btn.danger { background: var(--surface); color: var(--danger); box-shadow: inset 0 0 0 1px #EFC9C4; }
.btn.danger:hover { background: var(--danger-tint); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; height: 44px; }
.btn svg { flex: none; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.icon-act { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--ink-3); position: relative; }
.icon-act:hover { background: var(--surface-2); color: var(--ink); }
.icon-act.del:hover { background: var(--danger-tint); color: var(--danger); }
.linkbtn { color: var(--p-ink); font-weight: 700; font-size: 13.5px; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- caixas ---------- */
.box { background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
.box + .box { margin-top: 16px; }
.box-pad { padding: 20px 22px; }
.box h2 { margin: 0 0 4px; font-size: 16.5px; letter-spacing: -.01em; }
.box .hint, p.hint { color: var(--ink-2); font-size: 14px; margin: 0 0 14px; }
.box-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.box-title .bi { width: 30px; height: 30px; border-radius: 9px; background: var(--p-tint); color: var(--p); display: grid; place-items: center; flex: none; }
.box-title h2 { margin: 0; }
.box-title small { color: var(--ink-3); font-size: 12.5px; display: block; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: 0 0 0 1px var(--line); }
.stat b { display: block; font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: 14px; font-weight: 600; }

/* ---------- tabelas ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--ink-3); font-weight: 700; background: var(--surface-2); letter-spacing: .01em; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #FAFBFC; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--p-tint); display: grid; place-items: center; color: var(--p); font-weight: 800; flex: none; }
.thumb.wide { width: 96px; height: 54px; }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-main b { display: block; }
.cell-main small { color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #EEF0F3; color: var(--ink-2); margin: 2px 4px 2px 0; white-space: nowrap; }
.tag.green { background: var(--ok-tint); color: var(--ok); }
.tag.red { background: var(--danger-tint); color: var(--danger); }
.tag.amber { background: var(--warn-tint); color: var(--warn); }
.tag.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.drag { cursor: grab; color: var(--ink-3); padding: 4px; display: inline-grid; place-items: center; }
.drag:hover { color: var(--ink); }
tr.dragging { opacity: .4; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-2); display: grid; justify-items: center; gap: 4px; }
.empty .ei { width: 48px; height: 48px; border-radius: 14px; background: var(--p-tint); color: var(--p); display: grid; place-items: center; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 16px; }
.empty .btn { margin-top: 12px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); padding: 0 14px 0 38px; background: var(--surface)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A909C' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 13px 50% no-repeat; }
.search:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--p-tint); }

/* ---------- formulários ---------- */
.form { display: grid; gap: 16px; }
.f label.l { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.f .help { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.45; }
.f input[type=text], .f input[type=url], .f input[type=email], .f input[type=number], .f input[type=datetime-local], .f input[type=password], .f textarea, .f select {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.f textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.f input:hover, .f textarea:hover, .f select:hover { border-color: #C3C7D0; }
.f input:focus, .f textarea:focus, .f select:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--p-tint); }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--p); margin: 1px 0 0; flex: none; }
.checks { display: grid; gap: 10px; max-height: 240px; overflow: auto; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; }
.img-field { display: flex; gap: 12px; align-items: center; }
.img-prev { width: 88px; height: 88px; border-radius: 12px; background: var(--surface-2) center/cover; border: 1px dashed var(--line-2); flex: none; display: grid; place-items: center; color: var(--ink-3); font-size: 12px; text-align: center; }
.img-prev.wide { width: 156px; height: 88px; }
.img-field .col { display: grid; gap: 6px; flex: 1; min-width: 0; }
.img-field.drag-over .img-prev { border-color: var(--p); background-color: var(--p-tint); }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 46px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; background: var(--surface); cursor: pointer; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--p); }
.seg { display: inline-grid; grid-auto-flow: column; background: #ECEEF1; border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; }
.seg label { padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink-2); text-align: center; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,23,28,.14); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--p); }
.seg label:has(input:disabled) { opacity: .45; cursor: not-allowed; }

/* interruptor (publicada) */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 11px; background: #CDD1D8; position: relative; transition: background .18s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--p-tint-2); outline-offset: 2px; }

/* área de soltar arquivos */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 16px; text-align: center; color: var(--ink-2); font-size: 14px; background: var(--surface-2);
  display: grid; gap: 6px; justify-items: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag-over { border-color: var(--p); background: var(--p-tint); color: var(--p-ink); }
.dropzone svg { color: var(--p); }
.dropzone b { color: var(--ink); font-size: 14px; }
.dropzone small { color: var(--ink-3); font-size: 12.5px; }
.progress-line { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; width: 100%; }
.progress-line > i { display: block; height: 100%; background: var(--p); width: 0; transition: width .2s; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 23, 28, .45); z-index: 50; display: grid; place-items: center; padding: 20px; overflow: auto; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 620px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-2); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.x { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); }
.x:hover { background: var(--surface-2); color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.copy { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; }
.copy code { flex: 1; overflow-x: auto; white-space: nowrap; font-size: 13.5px; }
pre.json { background: #14171C; color: #D9DEE6; padding: 14px; border-radius: 12px; overflow: auto; font-size: 12.5px; max-height: 340px; margin: 0; }
.warn { background: var(--warn-tint); color: #6E4300; border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 1px #F4DDB2; }
.steps { margin: 0; padding-left: 20px; line-height: 1.7; color: #2B3038; }

/* toast */
#toast { position: fixed; top: 16px; right: 16px; transform: translateY(-140%); background: var(--ink); color: #fff; padding: 12px 16px 12px 14px; border-radius: 12px;
  font-weight: 600; font-size: 14.5px; z-index: 99; transition: transform .25s cubic-bezier(.2,.8,.2,1); max-width: min(420px, calc(100% - 32px)); visibility: hidden;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-2); }
#toast.show { visibility: visible; transform: none; }
#toast.err { background: var(--danger); }
#toast svg { flex: none; }

/* ---------- apps ---------- */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.app-card { background: var(--surface); border-radius: 18px; box-shadow: 0 0 0 1px var(--line), var(--shadow-1); padding: 18px; display: grid; gap: 14px; transition: box-shadow .15s, transform .15s; }
.app-card:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow-2); }
.app-card .top { display: flex; gap: 12px; align-items: center; }
.app-card .lg { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; flex: none; }
.app-card h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.app-card .url { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }
.app-card .nums { display: flex; gap: 18px; font-size: 13.5px; color: var(--ink-2); flex-wrap: wrap; }
.app-card .nums b { color: var(--ink); font-size: 16px; }
.app-new { border: 1.5px dashed var(--line-2); background: transparent; box-shadow: none; place-items: center; min-height: 176px; color: var(--ink-2); font-weight: 700; cursor: pointer; align-content: center; gap: 8px; }
.app-new:hover { border-color: var(--p); color: var(--p-ink); background: var(--p-tint); box-shadow: none; }

/* checklist de primeiros passos */
.checklist { padding: 20px 22px; margin-bottom: 16px; }
.checklist-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.checklist-head h2 { margin: 0; }
.checklist-head .bar { flex: 1; max-width: 260px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.cl-items { display: grid; gap: 6px; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink); }
.cl-item:hover { background: var(--surface-2); }
.cl-item .ck { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: #fff; }
.cl-item.done .ck { background: var(--ok); border-color: var(--ok); }
.cl-item.done .tx b { color: var(--ink-3); text-decoration: line-through; }
.cl-item .tx { flex: 1; min-width: 0; }
.cl-item .tx b { display: block; font-size: 14.5px; }
.cl-item .tx small { color: var(--ink-2); font-size: 13px; }
.cl-item .go { color: var(--ink-3); }

/* ---------- construtor da tela inicial ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
@media (max-width: 1150px) { .builder { grid-template-columns: 1fr; } .phone-wrap { display: none; } }
.sections { display: grid; gap: 10px; }
.sec { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 14px; padding: 12px 12px 12px 8px; box-shadow: 0 0 0 1px var(--line), var(--shadow-1); transition: box-shadow .15s; }
.sec:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow-1); }
.sec.off { opacity: .55; }
.sec.dragging { opacity: .35; }
.sec .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--p-tint); color: var(--p); display: grid; place-items: center; flex: none; }
.sec .t { flex: 1; min-width: 0; }
.sec .t b { display: block; font-size: 15px; }
.sec .t small { color: var(--ink-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.add-menu button { text-align: left; background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: inset 0 0 0 1px var(--line); display: flex; gap: 12px; align-items: flex-start; }
.add-menu button:hover { box-shadow: inset 0 0 0 2px var(--p); background: var(--p-tint); }
.add-menu .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--p-tint); color: var(--p); display: grid; place-items: center; flex: none; }
.add-menu b { display: block; margin-bottom: 2px; }
.add-menu small { color: var(--ink-2); }
.phone-wrap { position: sticky; top: calc(var(--top-h) + 8px); }
.phone { width: 380px; height: 760px; border-radius: 44px; background: #111318; padding: 11px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); margin: 0 auto; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 34px; background: #fff; display: block; }
.phone-cap { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 10px; }
.phone-cap a { font-weight: 700; }

/* ---------- módulos e aulas ---------- */
.module-box { background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line), var(--shadow-1); margin-bottom: 14px; transition: box-shadow .15s; }
.module-box.drop-target { box-shadow: 0 0 0 2px var(--p); }
.module-box.dragging { opacity: .5; }
.module-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 10px; border-bottom: 1px solid var(--line); }
.module-top .mt { flex: 1; min-width: 0; }
.module-top b { font-size: 16px; display: block; }
.module-top small { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.module-top .tag { margin: 0; }
.lesson-list { min-height: 52px; padding: 6px; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 4px; border-radius: 12px; background: var(--surface); }
.lesson-row:hover { background: var(--surface-2); }
.lesson-row.dragging { opacity: .35; }
.lesson-row .thumb { width: 44px; height: 44px; border-radius: 10px; }
.lesson-row .ttl { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.lesson-row .ttl:hover { color: var(--p-ink); text-decoration: underline; }
.lesson-row .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .lesson-row .tags { display: none; } }
.lesson-list .empty-drop { color: var(--ink-3); font-size: 14px; padding: 16px; text-align: center; border: 1.5px dashed var(--line); border-radius: 12px; margin: 4px; }
.add-lesson { display: flex; align-items: center; gap: 8px; width: calc(100% - 12px); margin: 0 6px 6px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.add-lesson:hover { background: var(--p-tint); color: var(--p-ink); }

/* ---------- editor de aula ---------- */
.editor-bar { position: sticky; top: var(--top-h); z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--r-lg); padding: 10px 12px 10px 16px; margin-bottom: 18px; box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
.editor-bar .crumbs { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
@media (max-width: 1050px) { .editor-layout { grid-template-columns: 1fr; } }
.title-input { width: 100%; font-size: 30px; font-weight: 800; letter-spacing: -.02em; border: 0; background: transparent; padding: 2px 0; margin-bottom: 12px; border-radius: 8px; }
.title-input:hover { background: rgba(255,255,255,.6); }
.title-input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 1px var(--line); padding: 2px 10px; }
.editor-box { background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
.editor-box .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); position: sticky; top: calc(var(--top-h) + 66px); background: var(--surface); z-index: 3; border-radius: 16px 16px 0 0; padding: 10px 12px; font-family: inherit; }
.modal .editor-box .ql-toolbar.ql-snow { top: 0; }
.editor-box .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 16px; }
.editor-box .ql-editor { min-height: 460px; padding: 24px 28px; line-height: 1.7; }
.editor-box .ql-editor.ql-blank::before { left: 28px; right: 28px; font-style: normal; color: #A1A6B0; }
.editor-box.small .ql-editor { min-height: 200px; }
.ql-editor h1, .ql-editor h2, .ql-editor h3 { letter-spacing: -.01em; }
.ql-editor a.rt-btn { display: block; text-align: center; background: var(--p); color: #fff; border-radius: 12px; padding: 12px; font-weight: 700; text-decoration: none; margin: 10px 0; }
.ql-editor .rt-callout { background: var(--p-tint); border-radius: 12px; padding: 12px 14px; }
.ql-editor hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.ql-editor iframe.ql-video { width: 100%; aspect-ratio: 16/9; height: auto; border-radius: 12px; }
.ql-editor img { border-radius: 12px; }
.ql-toolbar.ql-snow button.ql-cta, .ql-toolbar.ql-snow button.ql-divider, .ql-toolbar.ql-snow button.ql-callout { width: auto; padding: 3px 8px; font-weight: 700; font-size: 12.5px; color: #444; border-radius: 6px; }
.ql-toolbar.ql-snow button:hover, .ql-toolbar.ql-snow .ql-picker-label:hover { border-radius: 6px; }
.ql-toolbar.ql-snow button.ql-cta:hover, .ql-toolbar.ql-snow button.ql-divider:hover, .ql-toolbar.ql-snow button.ql-callout:hover { background: var(--p-tint); color: var(--p-ink); }
.ql-toolbar.ql-snow .ql-formats { margin-right: 10px; }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--p) !important; }
.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--p) !important; }
.ql-snow.ql-toolbar button.ql-active, .ql-snow .ql-picker-label.ql-active { color: var(--p) !important; }
/* rótulos do editor em português */
.editor-box .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label::before, .editor-box .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-item::before { content: 'Texto'; }
.editor-box .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, .editor-box .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { content: 'Título 1'; }
.editor-box .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .editor-box .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: 'Título 2'; }
.editor-box .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .editor-box .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: 'Título 3'; }
.editor-box .ql-container.ql-snow .ql-tooltip[data-mode=link]::before { content: 'Link:'; }
.editor-box .ql-container.ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: 'Salvar'; }
.editor-box .ql-container.ql-snow .ql-tooltip a.ql-action::after { content: 'Editar'; }
.editor-box .ql-container.ql-snow .ql-tooltip a.ql-remove::before { content: 'Remover'; }
.editor-box .ql-container.ql-snow .ql-tooltip::before { content: 'Abrir:'; }
.side-panel { display: grid; gap: 14px; position: sticky; top: calc(var(--top-h) + 78px); max-height: calc(100vh - var(--top-h) - 96px); overflow-y: auto; padding: 1px; }
@media (max-width: 1050px) { .side-panel { position: static; max-height: none; } }
.side-panel .box-pad { display: grid; gap: 14px; }
.video-prev { aspect-ratio: 16/9; background: #111; border-radius: 12px; overflow: hidden; }
.video-prev iframe, .video-prev video { width: 100%; height: 100%; border: 0; display: block; }
.save-state { font-size: 13px; color: var(--ok); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.save-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.save-state.dirty { color: var(--warn); }
.att-row { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.att-row:last-child { border-bottom: 0; }
.att-row .fi { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.att-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-row small { color: var(--ink-3); }
.danger-zone { box-shadow: 0 0 0 1px #EFC9C4; }
.dns { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.6; box-shadow: inset 0 0 0 1px var(--line); }
.dns code { background: var(--surface); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- estatísticas ---------- */
:root { --s-principal: #2a78d6; --s-extra: #eb6834; }
.period { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: 14px; padding: 16px 18px; box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
.kpi span { display: block; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.kpi b { display: block; font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi small { color: var(--ink-2); font-size: 12.5px; }
.kpi.hero { grid-column: span 2; }
.kpi.hero b { font-size: 34px; }
@media (max-width: 600px) { .kpi.hero { grid-column: span 1; } }
.kpi .split { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-box { padding: 18px 20px 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; flex-wrap: wrap; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.5; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px; z-index: 2; }
.chart .tip b { font-variant-numeric: tabular-nums; }
.subhead { font-size: 15px; font-weight: 800; margin: 26px 0 10px; color: var(--ink); }
.bar-cell { display: flex; align-items: center; gap: 8px; }
.bar-cell i { display: block; height: 8px; border-radius: 4px; background: var(--s-principal); min-width: 2px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* card do app: link resumido em uma linha, com botão de copiar */
.app-card { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.app-card .top > div { flex: 1; min-width: 0; }
.url-line { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 3px; }
.url-line .tag { margin: 0; flex: none; }
.url-line .url { flex: 1; min-width: 0; }
.icon-act.sm { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.icon-act.sm svg { width: 15px; height: 15px; }
.tag.blue { background: var(--p-tint); color: var(--p-ink); }
.tag svg { width: 13px; height: 13px; }

/* oferta dentro da aula */
#offer-box .box-title { flex-wrap: nowrap; }
.offer-prev { background: var(--surface-2); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.op-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 12px; padding: 12px; box-shadow: 0 0 0 1px var(--line); }
.op-img { width: 64px; height: 64px; border-radius: 10px; background: center/cover no-repeat var(--surface-2); flex: none; }
.op-body { min-width: 0; display: grid; gap: 3px; }
.op-body small { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--p); }
.op-body b { font-size: 14.5px; line-height: 1.25; }
.op-body p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; overflow-wrap: anywhere; }
.op-btn { margin-top: 6px; justify-self: start; background: var(--p); color: #fff; font-weight: 700; font-size: 12.5px; padding: 6px 12px; border-radius: 8px; }
.offer-stats { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.offer-stats svg { width: 15px; height: 15px; color: var(--ink-3); }
