@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');
/* ==========================================================================
   BRADOX PLAY — Painel. Sistema de design (dark premium, preto grafite + ouro).
   Fonte única de estilos: tokens + componentes reutilizáveis. Sem duplicar por página.
   ========================================================================== */
:root {
  /* elevação */
  --bg:            #07080B;
  --bg-2:          #0B0D12;
  --surface:       #10131A;
  --surface-2:     #161A23;
  --surface-hover: #1B202B;
  /* bordas */
  --border:        #262B36;
  --border-soft:   rgba(255,255,255,.07);
  /* texto */
  --text:          #F4F4F5;
  --text-2:        #A1A1AA;
  --text-3:        #71717A;
  /* ouro */
  --gold:          #D7AF32;
  --gold-hi:       #F0CE63;
  --gold-lo:       #A77B12;
  --gold-grad:     linear-gradient(135deg, #F0CE63 0%, #D7AF32 52%, #A77B12 100%);
  --gold-soft:     rgba(215,175,50,.12);
  /* semânticos */
  --ok:   #35D09A;  --warn: #F5B942;  --danger: #F36B75;  --info: #60A5FA;
  /* forma */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
  --sh-1: 0 1px 2px rgba(0,0,0,.5);
  --sh-2: 0 12px 34px rgba(0,0,0,.4);
  --sh-pop: 0 16px 40px rgba(0,0,0,.5);
  --sh-modal: 0 40px 110px rgba(0,0,0,.66);
  --t: 180ms cubic-bezier(.2,.7,.2,1);
  --h-ctl: 42px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-brand: "Chakra Petch", var(--font);
  --font-mono: "JetBrains Mono", "Chakra Petch", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sidebar-w: 252px;
  accent-color: var(--gold);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); min-height: 100vh; font-size: 14px; line-height: 1.5;
  background:
    radial-gradient(1100px 520px at 10% -6%, rgba(215,175,50,.06), transparent 55%),
    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; letter-spacing: -.01em; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12.5px; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
: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: 18px 14px;
  background: linear-gradient(180deg, #0C0E14, #08090D);
  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: 10px; border: 1px solid var(--gold-lo); background: var(--gold-soft); color: var(--gold-hi); font-size: 15px; font-weight: 700; letter-spacing: .08em; 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: 10px; 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: -14px; top: 9px; bottom: 9px; width: 3px; background: var(--gold-grad); border-radius: 0 3px 3px 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: 10px; background: var(--gold-grad); 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: 72px; display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 0 32px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, rgba(9,10,14,.9), rgba(9,10,14,.7)); backdrop-filter: blur(12px);
}
.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: 28px 32px 64px; width: 100%; max-width: 1520px; margin: 0 auto; animation: rise .4s var(--t) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stack-lg > * + * { margin-top: 22px; }

/* ==================== CARDS ==================== */
.card { background: linear-gradient(180deg, var(--surface-2), 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-grad); }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; display: flex; align-items: center; gap: 14px; transition: border-color var(--t), transform var(--t); }
.stat:hover { border-color: var(--border-soft); }
.stat .ico { width: 40px; height: 40px; border-radius: 11px; 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 { font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.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 16px; border-radius: 10px; 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-grad); color: #1e1604; border: 0; box-shadow: 0 6px 16px rgba(215,175,50,.2); }
.btn-primary:hover { filter: brightness(1.06); background: var(--gold-grad); }
.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: 9px; }
.btn-block { width: 100%; }
/* icon button */
.iconbtn { width: 36px; height: 36px; padding: 0; border-radius: 9px; 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; }
.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 13px; border-radius: 10px; 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-grad); 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; }
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,5,8,.68); backdrop-filter: blur(4px); }
.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 .2s 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: 42px; height: 42px; border-radius: 12px; background: var(--gold-soft); border: 1px solid rgba(215,175,50,.28); 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: 18px; overflow: hidden; border: 1px solid var(--border); background: linear-gradient(160deg, var(--pri, #1a1a22), #0a0b0f); }
.phone .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.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-grad); }

/* ==================== RESPONSIVO ==================== */
@media (max-width: 1080px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@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; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .topbar { height: 64px; }
  .topbar h1 { font-size: 19px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { padding: 14px 16px; }
  .modal { width: 100%; max-width: 100vw; max-height: 92vh; border-radius: 18px 18px 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: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border-soft); border-radius: var(--r-xl); overflow: hidden; cursor: pointer; transition: transform .18s ease, border-color .18s, box-shadow .18s; display: flex; flex-direction: column; }
.app-card:hover, .app-card:focus-visible { transform: translateY(-4px); border-color: var(--gold-lo); box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px var(--gold-soft); 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 { position: absolute; inset: -10%; background-size: cover; background-position: center; filter: blur(28px) brightness(.4) saturate(1.35); transform: scale(1.05); }
.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-body p { font-size: 13.5px; color: var(--text-2); margin: 0; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- APPS: galeria e thumbs no modal ---- */
.app-gallery { display: grid; grid-template-columns: repeat(auto-fill, 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 { position: absolute; inset: -10%; background-size: cover; background-position: center; filter: blur(24px) brightness(.4); }
.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); }

/* ---- 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); }

/* ---- 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 ul, .richtext ol { margin: 0 0 9px; padding-left: 22px; }
.richtext a { color: var(--gold-hi); }

/* ---- Página pública dos apps ---- */
.public-page { min-height: 100vh; background: #07080b; }
.public-page::before { content: ""; position: fixed; inset: 0; background: var(--bg, none) center/cover no-repeat; opacity: .28; z-index: 0; pointer-events: none; }
.public-page::after { content: ""; position: fixed; inset: 0; background: radial-gradient(120% 80% at 50% 0%, rgba(0,0,0,.2), rgba(7,8,11,.92) 78%); z-index: 0; pointer-events: none; }
.pub-wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 60px 24px 90px; }
.pub-head { text-align: center; margin-bottom: 48px; }
.pub-logo { width: 96px; height: 96px; object-fit: contain; margin-bottom: 16px; filter: drop-shadow(0 6px 22px rgba(215,175,50,.4)); }
.pub-head h1 { font-family: var(--font-brand); font-size: clamp(30px, 5vw, 42px); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .01em; }
.pub-head p { color: var(--text-2); margin-top: 8px; font-size: 16px; letter-spacing: .04em; }
.pub-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; }
.pub-grid .app-card { flex: 0 1 380px; max-width: 100%; }
.pub-empty { text-align: center; color: var(--text-3); padding: 80px 0; font-size: 15px; }
.pub-foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 56px; letter-spacing: .05em; }
