/* ==========================================================================
   BRADOX PLAY — Painel operacional, compacto e orientado a leitura.
   Fonte única de estilos: tokens + componentes reutilizáveis. Sem duplicar por página.
   ========================================================================== */
:root {
  /* elevação */
  --bg:            #0C1013;
  --bg-2:          #11171B;
  --surface:       #161D22;
  --surface-2:     #1B242A;
  --surface-hover: #243039;
  /* bordas */
  --border:        #34424B;
  --border-soft:   #27343C;
  /* texto */
  --text:          #F2F5F6;
  --text-2:        #B2BEC4;
  --text-3:        #7E8E97;
  /* ouro */
  --gold:          #E0B84F;
  --gold-hi:       #F1CD70;
  --gold-lo:       #9D7C26;
  --gold-grad:     #E0B84F;
  --gold-soft:     rgba(224,184,79,.13);
  /* semânticos */
  --ok:   #49C997;  --warn: #F2B84B;  --danger: #EF737D;  --info: #55B4C9;
  /* forma */
  --r-sm: 4px; --r: 6px; --r-lg: 8px; --r-xl: 8px;
  --sh-1: 0 1px 2px rgba(0,0,0,.25);
  --sh-2: 0 8px 20px rgba(0,0,0,.3);
  --sh-pop: 0 12px 28px rgba(0,0,0,.42);
  --sh-modal: 0 24px 64px rgba(0,0,0,.58);
  --t: 180ms cubic-bezier(.2,.7,.2,1);
  --h-ctl: 40px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-brand: "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --sidebar-w: 232px;
  accent-color: var(--gold);
}
* { box-sizing: border-box; letter-spacing: 0 !important; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); min-height: 100vh; font-size: 14px; line-height: 1.5;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(215,175,50,.3); color: #fff; }
a { color: inherit; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12.5px; }
.gold-text { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ==================== APP SHELL ==================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }

/* ---- Sidebar ---- */
.sidebar {
  position: sticky; top: 0; height: 100vh; align-self: start; z-index: 60;
  display: flex; flex-direction: column; padding: 16px 12px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--border-soft); }
.brand img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(215,175,50,.25)); }
.brand .wm { font-family: var(--font-brand); line-height: 1; }
.brand .wm b { display: block; font-size: 21px; font-weight: 700; letter-spacing: .05em; }
.brand .wm span { display: block; font-size: 9.5px; letter-spacing: .46em; color: var(--text-2); margin-top: 3px; }
.side-code { padding: 10px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border-soft); }
.side-code small { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.code-chip { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border-radius: var(--r); border: 1px solid var(--gold-lo); background: var(--gold-soft); color: var(--gold-hi); font-size: 15px; font-weight: 700; cursor: pointer; transition: background .15s; }
.code-chip:hover { background: rgba(215,175,50,.2); }
.code-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; flex: none; opacity: .8; }
.code-chip.copied { border-color: var(--gold-hi); }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-3); padding: 14px 12px 6px; font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--r); text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: background var(--t), color var(--t);
}
.side-nav a svg { width: 19px; height: 19px; stroke: currentColor; fill: none; flex: none; }
.side-nav a:hover { background: var(--surface-hover); color: var(--text); }
.side-nav a.active { color: var(--gold-hi); background: var(--gold-soft); font-weight: 600; }
.side-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--gold); border-radius: 0 2px 2px 0; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); display: flex; align-items: center; gap: 10px; }
.side-foot .avatar { width: 36px; height: 36px; border-radius: var(--r); background: var(--gold); color: #1a1305; display: grid; place-content: center; font-weight: 700; flex: none; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who small { display: block; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; font-size: 9.5px; }
.side-foot .who a { display: block; color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who a:hover { color: var(--gold-hi); }
.side-foot form { margin: 0; }

/* drawer (mobile) */
.hamburger { display: none; }
.scrim { display: none; }

/* ---- Topbar ---- */
.topbar {
  height: 68px; display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
  background: rgba(12,16,19,.96);
}
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); font-weight: 600; margin-bottom: 3px; }
.breadcrumb .sep { opacity: .5; }
.topbar h1 { font-size: 22px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ---- Content ---- */
.content { padding: 24px 28px 56px; width: 100%; max-width: 1460px; margin: 0 auto; animation: rise .24s var(--t) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stack-lg > * + * { margin-top: 22px; }
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 20px; align-items: start; }
.brand-layout > aside { position: sticky; top: 92px; }
.account-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 960px; }

/* ==================== CARDS ==================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: .01em; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); display: flex; align-items: center; gap: 9px; }
.section-title::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--gold); }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; display: flex; align-items: center; gap: 12px; transition: border-color var(--t); }
.stat:hover { border-color: var(--border-soft); }
.stat .ico { width: 38px; height: 38px; border-radius: var(--r); display: grid; place-content: center; flex: none; background: var(--surface-hover); border: 1px solid var(--border); }
.stat .ico svg { width: 20px; height: 20px; fill: none; }
.stat.gold .ico { background: var(--gold-soft); border-color: rgba(215,175,50,.3); }
.stat.gold .ico svg { stroke: var(--gold-hi); }
.stat .ico svg { stroke: var(--text-2); }
.stat .n { display: block; margin-top: 7px; font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { display: block; font-size: 12px; color: var(--text-2); line-height: 1.25; }
.stat.warn .n { color: var(--warn); }
.stat.danger .n { color: var(--danger); }

/* ==================== TOOLBAR ==================== */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--border-soft); }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-3); fill: none; pointer-events: none; }
.search input { padding-left: 38px; }
.toolbar .spacer { flex: 1; }

/* ==================== BUTTONS ==================== */
.btn {
  height: var(--h-ctl); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: background var(--t), border-color var(--t), filter var(--t), transform .06s, opacity var(--t);
}
.btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; }
.btn:hover { background: var(--surface-hover); border-color: var(--border-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--gold); color: #1E1708; border-color: var(--gold); box-shadow: none; }
.btn-primary:hover { filter: brightness(1.05); background: var(--gold-hi); border-color: var(--gold-hi); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger { background: transparent; border-color: rgba(243,107,117,.35); color: #f7969d; }
.btn-danger:hover { background: rgba(243,107,117,.12); border-color: rgba(243,107,117,.5); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r); }
.btn-block { width: 100%; }
/* icon button */
.iconbtn { width: 36px; height: 36px; padding: 0; border-radius: var(--r); display: inline-grid; place-content: center; background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t); }
.iconbtn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border); }
.iconbtn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; }
.iconbtn.danger:hover { color: #f7969d; background: rgba(243,107,117,.1); }
/* spinner */
.spin { width: 15px; height: 15px; border: 2px solid rgba(0,0,0,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== BADGES ==================== */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; border: 1px solid transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: rgba(53,208,154,.12); color: #6ee4b8; border-color: rgba(53,208,154,.25); }
.badge.blocked { background: rgba(243,107,117,.12); color: #f79aa1; border-color: rgba(243,107,117,.25); }
.badge.expired { background: rgba(245,185,66,.12); color: #f6cd7e; border-color: rgba(245,185,66,.25); }
.badge.warn { background: rgba(245,185,66,.12); color: #f6cd7e; border-color: rgba(245,185,66,.25); }
.badge.none { background: var(--surface-hover); color: var(--text-3); border-color: var(--border); }
.badge.tag { background: var(--surface-hover); color: var(--text-2); border-color: var(--border); text-transform: uppercase; letter-spacing: .05em; font-size: 10px; }
.badge.gold { background: var(--gold-soft); color: var(--gold-hi); border-color: rgba(215,175,50,.3); text-transform: uppercase; letter-spacing: .05em; font-size: 10px; }
.pill-count { display: inline-grid; place-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; background: var(--surface-hover); border: 1px solid var(--border); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ==================== TABLE ==================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; padding: 11px 16px; color: var(--text-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; background: var(--bg-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr { transition: background var(--t); }
tbody tr:hover { background: rgba(255,255,255,.018); }
tbody tr:last-child td { border-bottom: 0; }
.cell-name { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
td.right, th.right { text-align: right; }
td.actions-cell { text-align: right; white-space: nowrap; }
.actions-inline { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* ==================== DROPDOWN ==================== */
.menu { position: relative; display: inline-block; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 176px; z-index: 50;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-pop);
  padding: 6px; display: none;
}
.menu.open .menu-pop { display: block; animation: pop .15s var(--t) both; }
.menu-pop.is-floating { display: block; position: fixed; z-index: 3000; animation: pop .15s var(--t) both; }
.menu-pop button, .menu-pop a { width: 100%; justify-content: flex-start; height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--text-2); font-size: 13.5px; border-radius: 8px; display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-hover); color: var(--text); }
.menu-pop svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.menu-pop .danger { color: #f7969d; }
.menu-pop .danger:hover { background: rgba(243,107,117,.1); }
.menu-pop hr { border: 0; border-top: 1px solid var(--border-soft); margin: 6px 4px; }

/* ==================== FORMS ==================== */
label { display: block; margin: 0 0 6px; font-size: 12px; color: var(--text-2); font-weight: 500; letter-spacing: .01em; }
.field { margin-bottom: 15px; }
.field-help { display: block; margin-top: 6px; color: var(--text-3); font-size: 12px; line-height: 1.35; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
input:not([type=checkbox]):not([type=color]), select, textarea {
  width: 100%; height: var(--h-ctl); padding: 0 12px; border-radius: var(--r); color: var(--text); font-size: 14px; font-family: var(--font);
  border: 1px solid var(--border); background: var(--bg-2); transition: border-color var(--t), box-shadow var(--t);
}
textarea { height: auto; padding: 11px 13px; min-height: 80px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #5b5e66; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-lo); box-shadow: 0 0 0 3px rgba(215,175,50,.16); }
input[readonly] { opacity: .55; cursor: not-allowed; }
input[type=color] { height: var(--h-ctl); padding: 3px; cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.7) sepia(1) saturate(4) hue-rotate(2deg); cursor: pointer; }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2.2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center; }
select option { background: #14141c; }
input[type=checkbox] { width: 19px; height: 19px; height: 19px; margin: 0; appearance: none; -webkit-appearance: none; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-2); display: inline-grid; place-content: center; cursor: pointer; transition: background var(--t), border-color var(--t); }
input[type=checkbox]:checked { background: var(--gold); border-color: var(--gold-lo); }
input[type=checkbox]:checked::after { content: ""; width: 5px; height: 9px; border: solid #1a1206; border-width: 0 2px 2px 0; transform: rotate(43deg) translateY(-1px); }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.file-picker { min-height: var(--h-ctl); margin: 0; display: flex; align-items: center; gap: 12px; padding: 5px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-2); cursor: pointer; }
.file-picker:hover { border-color: var(--gold-lo); }
.file-picker-button { flex: none; padding: 5px 9px; border-radius: 4px; background: var(--surface-hover); color: var(--text); font-size: 12px; font-weight: 600; }
.file-picker-name { min-width: 0; overflow: hidden; color: var(--text-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
fieldset { border: 1px solid var(--border); border-radius: var(--r); margin: 0; padding: 8px 16px 16px; }
legend { padding: 0 8px; color: var(--text-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.chk { display: flex; align-items: center; gap: 10px; margin: 11px 0; color: var(--text); font-size: 14px; cursor: pointer; font-weight: 400; }

/* ==================== MODAL / DIALOG ==================== */
dialog { border: 0; background: transparent; padding: 0; color: var(--text); max-height: 100dvh; max-width: 100vw; overflow: visible; }
dialog::backdrop { background: rgba(4,7,9,.76); }
.modal { width: 820px; max-width: 94vw; max-height: min(90vh, calc(100dvh - 24px)); display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-modal); animation: modalin .16s var(--t) both; }
.modal.sm { width: 460px; }
@keyframes modalin { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--border); flex: none; }
.modal-head .ico { width: 40px; height: 40px; border-radius: var(--r); background: var(--gold-soft); border: 1px solid rgba(224,184,79,.3); display: grid; place-content: center; flex: none; }
.modal-head .ico svg { width: 21px; height: 21px; stroke: var(--gold-hi); fill: none; }
.modal-head .ttl { flex: 1; min-width: 0; }
.modal-head h3 { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-head .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.modal-body { padding: 22px 24px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-2); flex: none; }
.modal-foot .spacer { flex: 1; }

/* confirmation dialog */
.confirm { width: 420px; max-width: 92vw; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-modal); overflow: hidden; animation: modalin .18s var(--t) both; }
.confirm-body { padding: 22px 24px; display: flex; gap: 14px; }
.confirm-body .ico { width: 40px; height: 40px; border-radius: 11px; background: rgba(243,107,117,.12); display: grid; place-content: center; flex: none; }
.confirm-body .ico svg { width: 20px; height: 20px; stroke: var(--danger); fill: none; }
.confirm-body h3 { font-size: 16px; margin-bottom: 6px; }
.confirm-body p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.confirm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg-2); }

/* ==================== LIST CARDS (playlists) ==================== */
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; }
.list-card + .list-card { margin-top: 10px; }
.list-card .main { flex: 1; min-width: 0; }
.list-card .rowtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-card .name { font-weight: 600; font-size: 14px; }
.list-card .url { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); margin-top: 6px; word-break: break-all; display: flex; align-items: center; gap: 8px; }
.list-card .url span { min-width: 0; word-break: break-all; }
.copybtn { flex: none; }
.copybtn.copied { color: var(--ok); }

/* ==================== EMPTY / SKELETON ==================== */
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-hover); border: 1px solid var(--border); display: grid; place-content: center; margin: 0 auto 14px; }
.empty .ico svg { width: 24px; height: 24px; stroke: var(--text-3); fill: none; }
.empty h3 { font-size: 15px; margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 13.5px; }
.skeleton { background: linear-gradient(90deg, var(--surface-hover) 25%, #23283300 37%, var(--surface-hover) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.hidden { display: none !important; }
.no-results { text-align: center; padding: 34px; color: var(--text-3); font-size: 13.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.pager-btns { display: flex; gap: 8px; }

/* ==================== TOAST ==================== */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 11px; min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--sh-pop); font-size: 13.5px; animation: toastin .22s var(--t) both; }
.toast.out { animation: toastout .2s var(--t) both; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(20px); } }
.toast .bar { width: 3px; align-self: stretch; border-radius: 3px; }
.toast.ok .bar { background: var(--ok); } .toast.error .bar { background: var(--danger); } .toast.info .bar { background: var(--info); }

/* ==================== PRÉVIA DA MARCA ==================== */
.phone { position: relative; width: 100%; aspect-ratio: 9/16; max-height: 440px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); background: var(--pri, #151A1E); }
.phone .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.phone .prev-center { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.phone .prev-logo { max-width: 46%; max-height: 38%; object-fit: contain; }
.phone .prev-logo.placeholder { color: var(--text-3); font-size: 13px; }
.phone-inner { position: relative; height: 100%; display: grid; place-content: center; gap: 12px; text-align: center; }
.phone .logo { max-width: 60%; margin: 0 auto; }
.phone .logo.placeholder { padding: 22px; border: 1px dashed rgba(255,255,255,.3); border-radius: 10px; color: #fff; }
.phone .app-name { color: #fff; font-family: var(--font-brand); font-weight: 700; font-size: 22px; letter-spacing: .05em; text-shadow: 0 2px 12px rgba(0,0,0,.7); }

/* ==================== LOGIN ==================== */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth { width: 380px; max-width: 94vw; position: relative; padding: 30px; }
.auth::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 2px; background: var(--gold); }

/* ==================== RESPONSIVO ==================== */
@media (max-width: 1080px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1120px) { .brand-layout { grid-template-columns: 1fr; } .brand-layout > aside { position: static; } }
@media (max-width: 980px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform var(--t); }
  body.drawer-open .sidebar { transform: none; box-shadow: var(--sh-modal); }
  body.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; }
  .hamburger { display: inline-grid; }
  .topbar { padding: 0 18px; }
}
@media (max-width: 720px) {
  .content { padding: 20px 16px 56px; }
  .account-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .topbar { height: 64px; }
  .topbar h1 { font-size: 19px; }
  .breadcrumb { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { padding: 14px 16px; }
  .modal { width: 100%; max-width: 100vw; max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  dialog { margin: auto auto 0; }
  /* tabela -> cards */
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 12px; padding: 6px 4px; background: var(--surface); }
  tbody td { border: 0; padding: 9px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  tbody td::before { content: attr(data-label); color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
  td.actions-cell { justify-content: flex-end; }
  td.actions-cell::before { display: none; }
  .actions-inline { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---- APPS: link público ---- */
.public-link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.public-link input { flex: 1; min-width: 200px; height: var(--h-ctl); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13px; }

/* ---- APPS: grade de cards ---- */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.app-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; transition: background .18s, border-color .18s; display: flex; flex-direction: column; }
.app-card:hover, .app-card:focus-visible { background: var(--surface-2); border-color: var(--gold-lo); outline: none; }
/* Mídia: mostra a imagem INTEIRA (contain) com um fundo desfocado da própria imagem atrás — estilo "capa", sem corte. */
.app-card-media { position: relative; aspect-ratio: 16/10; background: #0a0b0e; overflow: hidden; }
.app-card-media .media-bg { display: none; }
.app-card-media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; }
.app-card-noimg { width: 100%; height: 100%; display: grid; place-content: center; color: var(--text-3); }
.app-card-noimg svg { width: 48px; height: 48px; fill: none; stroke: currentColor; }
.app-card-count { position: absolute; z-index: 2; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,.68); color: #fff; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.app-card-body { padding: 16px 18px 18px; }
.app-card-body h3 { font-size: 17.5px; font-weight: 700; margin: 0 0 6px; letter-spacing: .01em; }
.app-card-preview { font-size: 13.5px; color: var(--text-2); line-height: 1.55; max-height: 8.2em; overflow: hidden; }
.app-card-preview p { margin: 0 0 7px; }
.app-card-preview p:last-child, .app-card-preview ul:last-child, .app-card-preview ol:last-child { margin-bottom: 0; }
.app-card-preview h2, .app-card-preview h3, .app-card-preview h4 { color: var(--text); margin-top: 7px; }
.app-card-preview ul, .app-card-preview ol { margin-bottom: 7px; }

/* ---- APPS: galeria e thumbs no modal ---- */
.app-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.app-gallery a { position: relative; display: block; border-radius: var(--r-sm); overflow: hidden; background: #0a0b0e; aspect-ratio: 16/10; }
.app-gallery a .g-bg { display: none; }
.app-gallery img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .2s ease; }
.app-gallery a { cursor: zoom-in; }
.app-gallery a:hover img { transform: scale(1.04); }
.app-gallery a::after { content: ""; position: absolute; inset: 0; z-index: 2; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); border-radius: inherit; transition: box-shadow .18s; }
.app-gallery a:hover::after { box-shadow: inset 0 0 0 2px var(--gold-lo); }
.app-preview-modal { width: 980px; }
.app-preview-modal .app-gallery a:only-child { aspect-ratio: 16/9; }

/* ---- Lightbox (galeria em tela cheia) ---- */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: transparent; overflow: hidden; }
.lightbox:not([open]) { display: none; }
.lightbox[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.lightbox::backdrop { background: rgba(5,6,9,.94); backdrop-filter: blur(6px); }
.lb-stage { grid-column: 2; display: grid; place-items: center; padding: 24px; min-width: 0; }
.lb-img { max-width: 100%; max-height: 88vh; object-fit: contain; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.7); animation: lbin .18s ease; }
@keyframes lbin { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lb-nav { z-index: 2; width: 54px; height: 54px; margin: 0 14px; border-radius: 50%; background: rgba(24,25,30,.72); border: 1px solid rgba(255,255,255,.14); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.lb-nav:hover { background: rgba(40,42,50,.9); border-color: var(--gold-lo); }
.lb-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; }
.lb-close { position: fixed; top: 18px; right: 20px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; background: rgba(24,25,30,.72); border: 1px solid rgba(255,255,255,.14); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-close:hover { background: rgba(40,42,50,.9); border-color: var(--gold-lo); }
.lb-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; }
.lb-counter { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 3; color: #e8e8ea; font-size: 13px; font-weight: 600; background: rgba(0,0,0,.55); padding: 6px 14px; border-radius: 999px; letter-spacing: .05em; }
@media (max-width: 640px) { .lb-nav { width: 44px; height: 44px; margin: 0 6px; } .lb-stage { padding: 12px; } }
.app-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.app-thumb { position: relative; width: 84px; height: 84px; }
.app-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); }
.app-thumb form { position: absolute; top: -6px; right: -6px; }
.app-thumb .iconbtn { background: var(--surface); border: 1px solid var(--border); width: 24px; height: 24px; }
/* Seletor de imagens (Novo app) */
.imgpick { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px dashed var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 600; transition: border-color .15s, color .15s; }
.imgpick:hover { border-color: var(--gold-lo); color: var(--gold-hi); }
.imgpick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; }
.img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.img-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border-soft); }

/* ---- Bradox Times: catálogo global de fundos ---- */
.team-global-note { display: flex; gap: 8px 18px; align-items: baseline; flex-wrap: wrap; margin-bottom: 18px; }
.team-global-note strong { color: var(--gold-hi); }
.team-global-note span { color: var(--text-2); font-size: 13px; }
.team-theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.team-theme-card { overflow: hidden; }
.team-theme-background { position: relative; aspect-ratio: 16/9; background: #050607; overflow: hidden; }
.team-theme-background > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-theme-badge { position: absolute; width: 88px; height: 88px; left: 14px; bottom: 14px; padding: 4px; border-radius: 14px; background: rgba(5,6,8,.82); border: 1px solid rgba(255,255,255,.18); box-shadow: 0 10px 28px rgba(0,0,0,.45); }
.team-theme-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.team-theme-form { display: grid; grid-template-columns: 1fr 120px; gap: 12px; padding: 16px 18px 10px; }
.team-theme-form .field:nth-child(n+3) { grid-column: span 1; }
.team-theme-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 18px 18px; }
@media (max-width: 560px) {
  .team-theme-form { grid-template-columns: 1fr; }
  .team-theme-form .field:nth-child(n+3) { grid-column: auto; }
  .team-theme-actions { align-items: stretch; flex-direction: column; }
  .team-theme-actions .btn { width: 100%; }
}

/* ---- Texto rico: editor e leitura ---- */
.richeditor { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.rt-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.rt-toolbar button { min-width: 30px; height: 28px; padding: 0 7px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; }
.rt-toolbar button:hover { background: var(--surface-hover); border-color: var(--border); }
.rt-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rt-area { min-height: 150px; max-height: 340px; overflow-y: auto; padding: 12px 14px; font-size: 14px; line-height: 1.55; color: var(--text); }
.rt-area:focus { outline: none; }
.richtext { font-size: 14.5px; line-height: 1.6; color: var(--text); word-break: break-word; }
.richtext h2 { font-size: 18px; margin: 12px 0 6px; }
.richtext h3 { font-size: 15.5px; margin: 10px 0 5px; }
.richtext p { margin: 0 0 9px; }
.richtext > div { margin: 0 0 9px; }
.richtext > div:last-child { margin-bottom: 0; }
.richtext ul, .richtext ol { margin: 0 0 9px; padding-left: 22px; }
.richtext a { color: var(--gold-hi); }

/* ---- Página pública dos apps: vitrine comercial ---- */
.public-page { min-height: 100vh; background: #07080b; }
.public-page::before { content: ""; position: fixed; inset: 0; background: var(--bg, none) center/cover no-repeat; opacity: .42; z-index: 0; pointer-events: none; }
.public-page::after { content: ""; position: fixed; inset: 0; background: rgba(7,8,11,.76); z-index: 0; pointer-events: none; }
.pub-wrap { position: relative; z-index: 1; width: min(1220px, 100%); margin: 0 auto; padding: 52px 24px 72px; }
.pub-head { width: min(720px, 100%); text-align: center; margin: 0 auto 42px; }
.pub-logo { width: 112px; height: 112px; object-fit: contain; margin-bottom: 14px; filter: drop-shadow(0 10px 28px rgba(215,175,50,.32)); }
.pub-head h1 { font-family: var(--font-brand); font-size: clamp(36px, 5vw, 56px); line-height: 1.05; color: #f4d46d; }
.pub-head p { max-width: 610px; color: #c9cdd3; margin: 14px auto 0; font-size: 18px; line-height: 1.55; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 24px; }
.public-app-card { min-width: 0; overflow: hidden; background: #14191d; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; cursor: pointer; box-shadow: 0 20px 54px rgba(0,0,0,.32); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.public-app-card:hover, .public-app-card:focus-visible { transform: translateY(-3px); border-color: rgba(242,214,128,.66); box-shadow: 0 26px 68px rgba(0,0,0,.46); outline: none; }
.public-app-card-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #050607; border-bottom: 1px solid rgba(255,255,255,.09); }
.public-app-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.public-app-card:hover .public-app-card-media img { transform: scale(1.025); }
.public-app-card-body { padding: 24px 26px 26px; }
.public-app-kicker { display: block; margin-bottom: 8px; color: #e5bd43; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.public-app-card-body > h2 { margin: 0 0 10px; color: #fff; font-size: 25px; line-height: 1.2; }
.public-app-preview { color: #b9c0c7; max-height: 4.9em; overflow: hidden; font-size: 14px; line-height: 1.6; }
.public-app-preview h2, .public-app-preview h3 { font-size: 14px; color: #d7dbe0; margin: 0 0 5px; }
.public-app-preview p, .public-app-preview ul, .public-app-preview ol { margin-bottom: 5px; }
.public-app-cta { display: inline-flex; align-items: center; gap: 9px; margin-top: 19px; color: #f4d46d; font-size: 14px; font-weight: 800; }
.public-app-cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .18s ease; }
.public-app-card:hover .public-app-cta svg { transform: translateX(4px); }
.pub-empty { text-align: center; color: var(--text-3); padding: 80px 0; font-size: 15px; }
.pub-foot { text-align: center; color: #858c94; font-size: 12px; margin-top: 52px; }

.legal-wrap { position: relative; z-index: 1; width: min(860px, 100%); margin: 0 auto; padding: 48px 22px 64px; }
.legal-head { margin-bottom: 28px; text-align: center; }
.legal-logo { width: 92px; height: 92px; margin-bottom: 10px; object-fit: contain; }
.legal-brand { margin: 0 0 8px; color: var(--gold-hi); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.legal-head h1 { color: #fff; font-size: 34px; line-height: 1.2; }
.legal-head > p:not(.legal-brand) { margin: 12px auto 6px; color: #c9cdd3; font-size: 16px; line-height: 1.6; }
.legal-head small { color: #858c94; }
.legal-content { display: grid; gap: 14px; }
.legal-content section { padding: 22px 24px; border: 1px solid rgba(215,175,50,.22); border-radius: var(--r); background: rgba(20,25,29,.92); }
.legal-content h2 { margin-bottom: 10px; color: var(--gold-hi); font-size: 16px; }
.legal-content p { margin: 7px 0 0; color: #d5d9de; font-size: 14px; line-height: 1.7; }
.legal-foot { display: flex; justify-content: center; gap: 22px; margin-top: 30px; font-size: 13px; }
.legal-foot a { color: var(--gold-hi); }

.public-app-dialog { width: 100%; max-width: 100vw; max-height: 100vh; margin: auto; }
.public-app-dialog::backdrop { background: rgba(2,4,6,.88); backdrop-filter: blur(5px); }
.public-app-modal { position: relative; width: min(1080px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); margin: auto; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; background: #11161a; color: #f5f6f7; box-shadow: 0 30px 90px rgba(0,0,0,.68); }
.public-app-modal-scroll { max-height: calc(100dvh - 42px); overflow-y: auto; overscroll-behavior: contain; }
.public-modal-close { position: absolute; z-index: 6; top: 14px; right: 14px; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(4,6,8,.78); color: #fff; cursor: pointer; backdrop-filter: blur(8px); }
.public-modal-close:hover { background: #242a2f; border-color: rgba(244,212,109,.72); }
.public-modal-close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; }
.public-app-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 0; background: #050607; }
.public-app-gallery a { aspect-ratio: 16/9; border-radius: 0; }
.public-app-gallery .public-app-gallery-main { grid-column: 1 / -1; aspect-ratio: 16/9; max-height: 600px; }
.public-app-gallery img { object-fit: cover; }
.public-app-gallery .public-app-gallery-main img { object-fit: contain; }
.public-app-gallery a::after { border-radius: 0; }
.public-app-modal-content { padding: 32px 38px 38px; }
.public-app-modal-content h2 { margin: 0 0 18px; color: #fff; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; }
.public-app-copy { color: #d5d9de; font-size: 17px; line-height: 1.7; }
.public-app-copy h2 { margin: 24px 0 9px; color: #fff; font-size: 22px; }
.public-app-copy h3 { margin: 20px 0 8px; color: #fff; font-size: 18px; }
.public-app-copy a { color: #f4d46d; font-weight: 700; text-underline-offset: 3px; }
.public-install-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); }
.public-install-actions .btn { min-height: 46px; padding: 0 18px; }

@media (max-width: 720px) {
  .pub-wrap { padding: 34px 15px 52px; }
  .pub-head { margin-bottom: 28px; }
  .pub-logo { width: 82px; height: 82px; margin-bottom: 10px; }
  .pub-head h1 { font-size: 36px; }
  .pub-head p { margin-top: 10px; font-size: 15px; }
  .pub-grid { grid-template-columns: 1fr; gap: 18px; }
  .public-app-card-body { padding: 20px; }
  .public-app-card-body > h2 { font-size: 23px; }
  .public-app-dialog { margin: auto auto 0; }
  .public-app-modal { width: 100vw; max-height: 96dvh; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 8px 8px 0 0; }
  .public-app-modal-scroll { max-height: 96dvh; }
  .public-modal-close { top: 10px; right: 10px; width: 40px; height: 40px; }
  .public-app-gallery { grid-template-columns: repeat(3, 1fr); }
  .public-app-gallery .public-app-gallery-main { max-height: none; }
  .public-app-modal-content { padding: 25px 20px 30px; }
  .public-app-modal-content h2 { font-size: 30px; }
  .public-app-copy { font-size: 15.5px; }
  .public-install-actions { align-items: stretch; flex-direction: column; }
  .public-install-actions .btn { width: 100%; justify-content: center; }
  .legal-wrap { padding: 30px 14px 44px; }
  .legal-head h1 { font-size: 28px; }
  .legal-content section { padding: 18px; }
  .legal-foot { align-items: center; flex-direction: column; gap: 10px; }
}

/* ---- Planos, financeiro e cadastro de teste ---- */
.side-alert { margin: 10px 12px 2px; padding: 10px 11px; border: 1px solid rgba(245,185,66,.28); border-radius: var(--r-sm); background: rgba(245,185,66,.08); color: #f6cd7e; }
.side-alert.danger { border-color: rgba(243,107,117,.28); background: rgba(243,107,117,.08); color: #f79aa1; }
.side-alert strong, .side-alert span { display: block; font-size: 11px; }
.side-alert span { margin-top: 2px; color: var(--text-3); }
.side-alert { text-decoration: none; }
.side-alert:hover { border-color: var(--gold-hi); }
.side-subscription { display: block; margin: 10px 12px 2px; padding: 12px; color: inherit; text-decoration: none; border: 1px solid rgba(245,185,66,.25); border-radius: var(--r-sm); background: linear-gradient(135deg, rgba(245,185,66,.09), rgba(255,255,255,.018) 72%); box-shadow: inset 3px 0 0 rgba(245,185,66,.58), 0 8px 22px rgba(0,0,0,.14); }
.side-subscription:hover { border-color: var(--gold-hi); background: linear-gradient(135deg, rgba(245,185,66,.13), rgba(255,255,255,.025) 72%); }
.side-subscription small, .side-subscription strong, .side-subscription span { display: block; }
.side-subscription small { color: var(--text-2); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.side-subscription strong { margin-top: 5px; color: var(--gold-hi); font-size: 13px; line-height: 1.25; }
.side-subscription .side-subscription-due { margin-top: 5px; color: var(--text-2); font-size: 11px; }
.side-subscription .side-subscription-credits { display: flex; align-items: center; gap: 5px; margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(245,185,66,.18); color: var(--text-2); font-size: 11px; white-space: nowrap; }
.side-subscription .side-subscription-credits::before { content: ''; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(245,185,66,.5); }
.side-subscription .side-subscription-credits b { color: var(--gold-hi); font-size: 15px; line-height: 1; }
.billing-layout { display: grid; gap: 18px; }
.billing-layout .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.billing-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.card-head.no-pad { padding: 0 0 18px; }
.stat-money { font-size: 21px !important; white-space: nowrap; }
.btn-wide { width: 100%; justify-content: center; margin-top: 14px; }
.dashboard-content, .report-content { display: grid; gap: 18px; }
.dashboard-stats, .report-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.finance-filters { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)) auto; align-items: end; gap: 12px; }
.finance-filters .field { margin: 0; }
.finance-filters .btn { height: var(--h-ctl); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr); gap: 18px; }
.section-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-row h2 { font-size: 16px; font-weight: 650; }
.section-row .muted { margin-top: 5px; }
.text-link { color: var(--gold-hi); font-size: 13px; font-weight: 650; white-space: nowrap; }
.dashboard-bars { min-height: 220px; display: flex; align-items: flex-end; gap: 8px; padding: 12px 4px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.dashboard-bar-wrap { min-width: 24px; flex: 1; min-height: 200px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.dashboard-bar { width: 100%; height: var(--bar-height); min-height: 8px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.dashboard-bar-wrap span { color: var(--text-3); font: 11px var(--font-mono); white-space: nowrap; }
.metric-list, .dashboard-list { display: grid; }
.metric-line { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border-soft); }
.metric-line:first-child { border-top: 0; padding-top: 0; }
.metric-line span, .rank { display: grid; gap: 4px; min-width: 0; }
.metric-line small { color: var(--text-3); font-size: 11px; }
.metric-line strong, .list-line > strong { color: var(--gold-hi); white-space: nowrap; }
.rank { grid-template-columns: 26px minmax(0, 1fr); align-items: center; }
.rank b { color: var(--gold); font: 13px var(--font-mono); }
.dashboard-list .list-line > div > span, .dashboard-list .list-line > div > strong { display: block; color: var(--text-2); font-size: 12px; margin-top: 4px; }
.expense-form-card { display: grid; gap: 2px; }
.expense-form { display: grid; grid-template-columns: 150px 190px minmax(180px, 1fr) 130px auto; align-items: end; gap: 12px; }
.expense-form .field { margin: 0; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--border-soft); }
.right form { display: inline; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.plan-picker { border: 0; padding: 0; margin: 0 0 18px; }
.plan-picker[disabled] { opacity: .78; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 14px; }
.plan-choice {
  position: relative; display: flex; flex-direction: column; min-height: 100%; margin: 0; padding: 18px;
  color: var(--text); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  cursor: pointer; transition: border-color var(--t), background var(--t), box-shadow var(--t), transform var(--t);
}
.plan-choice:hover { border-color: var(--gold-lo); background: var(--surface-hover); transform: translateY(-1px); }
.plan-choice:has(.plan-choice-input:checked) {
  border-color: var(--gold); background: linear-gradient(180deg, rgba(215,175,50,.11), var(--bg-2) 42%);
  box-shadow: 0 0 0 2px rgba(215,175,50,.13);
}
.plan-choice-input { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.plan-choice:has(.plan-choice-input:focus-visible) { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.plan-choice-top { min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-choice-name { margin-top: 16px; font-size: 18px; }
.plan-choice-price { margin-top: 7px; color: var(--gold-hi); font-size: 25px; font-weight: 750; font-variant-numeric: tabular-nums; }
.plan-choice-price small { margin-left: 3px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.plan-benefits { display: grid; gap: 9px; margin: 17px 0 20px; padding: 16px 0 0; border-top: 1px solid var(--border-soft); list-style: none; }
.plan-benefits li { position: relative; padding-left: 22px; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.plan-benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan-benefits li.highlight { color: var(--text); font-weight: 600; }
.plan-choice-action { margin-top: auto; padding: 10px 12px; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--r); text-align: center; font-size: 12.5px; font-weight: 650; }
.plan-choice:has(.plan-choice-input:checked) .plan-choice-action { color: #1e1708; background: var(--gold); border-color: var(--gold); }
.plan-billing-hint { margin: -2px 0 16px; }
.plan-payment-unavailable { margin-top: 4px; border-top: 1px solid var(--border-soft); }
.form-grid .full { grid-column: 1 / -1; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.copy-row input { min-width: 0; }
.invoice-shell { padding-block: 40px; }
.invoice-card { max-width: 560px; }
.invoice-brand { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.invoice-brand img { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; background: rgba(255,255,255,.04); }
.invoice-brand h1 { margin: 3px 0 0; }
.invoice-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0; }
.invoice-summary { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); }
.invoice-summary > div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 15px; background: var(--surface-2); }
.invoice-summary span { color: var(--muted); }
.invoice-summary strong { text-align: right; }
.invoice-value { color: var(--gold); font-size: 1.25rem; }
.invoice-pix { text-align: center; padding-top: 24px; }
.invoice-qr { display: block; width: min(240px, 76vw); aspect-ratio: 1; margin: 18px auto; padding: 10px; background: #fff; border-radius: 16px; }
.invoice-pix .field { text-align: left; }
.invoice-wait { margin-top: 14px; }
.referral-card { max-width: 720px; }
.list-lines { display: grid; }
.list-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.list-line:first-child { border-top: 0; }
.list-line strong, .list-line span { display: block; }
.list-line span { margin-top: 3px; color: var(--text-3); font-size: 12px; }
.empty.compact { padding: 24px 0; }
.public-form-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #07090c; }
.public-form-card { width: min(480px, 100%); padding: 28px; }
.public-form-card h1 { margin: 8px 0; font-size: 26px; }
.public-form-card form { margin-top: 22px; }
.access-notice { display: grid; gap: 5px; margin-top: 20px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.access-notice span { color: var(--text-2); font-size: 13px; }
.access-ok { border-color: rgba(53,208,154,.32); background: rgba(53,208,154,.08); }
.access-danger { border-color: rgba(255,91,105,.35); background: rgba(255,91,105,.09); }
.access-blocked { border-color: rgba(243,107,117,.32); background: rgba(243,107,117,.08); }

@media (max-width: 1180px) {
  .billing-layout .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .billing-columns { grid-template-columns: 1fr; }
  .billing-layout .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .billing-layout .stats { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr; }
  .public-form-shell { padding: 12px; }
  .public-form-card { padding: 20px; }
}
@media (max-width: 1180px) {
  .dashboard-stats, .report-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .expense-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expense-description { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .finance-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-filters .btn { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .dashboard-stats, .report-stats, .finance-filters, .expense-form { grid-template-columns: 1fr; }
  .expense-description { grid-column: auto; }
}

/* Editor de galeria dos apps (reordenar / capa / alt) */
.gallery-editor { margin: 10px 0 14px; }
.gallery-item { position: relative; cursor: grab; }
.gallery-item.is-dragging { opacity: .5; cursor: grabbing; }
.gallery-item.is-cover { outline: 2px solid var(--gold, #f7d878); outline-offset: 2px; }
.gallery-item-tools { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.gallery-cover { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; cursor: pointer; }
.gallery-alt { width: 100%; margin-top: 6px; font-size: 12px; padding: 6px 8px; }
.gallery-remove { display: inline-flex; align-items: center; gap: 6px; }

.reseller-toolbar { align-items: end; }
.reseller-toolbar .search { flex: 1 1 260px; }
.reseller-toolbar .search input:not([type=checkbox]):not([type=color]) { padding-left: 38px; }
.reseller-toolbar select { width: auto; flex: 0 1 170px; min-width: 170px; }
.reseller-toolbar [data-filter-owner] { max-width: 100%; flex: 1 1 240px; min-width: 0; }
.reseller-children-link { border: 0; padding: 0; background: none; color: var(--gold); font: inherit; cursor: pointer; text-align: left; text-decoration: underline; white-space: nowrap; }
.reseller-table .pill-count { white-space: nowrap; }
.reseller-children-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.reseller-results { flex: 0 0 auto; padding: 0 2px 9px; white-space: nowrap; }
.reseller-hierarchy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 5px; }
.reseller-hierarchy .cell-sub { margin: 0; }
.reseller-hierarchy .cell-sub strong { color: var(--text-2); font-weight: 600; }
.badge.main-reseller { color: #f6cd7e; background: rgba(245,185,66,.1); border-color: rgba(245,185,66,.25); }
.badge.subreseller { color: #9bd9ef; background: rgba(69,185,218,.1); border-color: rgba(69,185,218,.25); }
.table-wrap.hidden { display: none; }
.reseller-table [data-row][data-depth="0"] > td { border-top: 2px solid var(--border); }
.reseller-table [data-row]:not([data-depth="0"]) td[data-label="Revenda"] > .cell-name { padding-left: calc(var(--reseller-depth, 1) * 12px); border-left: 2px solid rgba(69,185,218,.48); }

@media (max-width: 720px) {
  .reseller-table tbody td:not(.actions-cell) { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: start; gap: 5px 10px; }
  .reseller-table tbody td:not(.actions-cell)::before { grid-column: 1; grid-row: 1; letter-spacing: 0; }
  .reseller-table tbody td:not(.actions-cell) > * { grid-column: 2; min-width: 0; overflow-wrap: anywhere; justify-self: start; }
  .reseller-table td.actions-cell { display: block; white-space: normal; }
  .reseller-table .actions-inline { flex-wrap: wrap; justify-content: flex-start; }
}

@media (max-width: 820px) {
  .reseller-toolbar .search { flex-basis: 100%; }
  .reseller-toolbar select { flex: 1 1 180px; min-width: 0; }
  .reseller-results { margin-left: auto; }
}
@media (max-width: 520px) {
  .reseller-toolbar select { flex-basis: 100%; }
  .reseller-toolbar [data-filter-clear] { flex: 1; justify-content: center; }
  .reseller-results { width: 100%; padding-bottom: 0; }
}
