/* ═══════════════════════════════════════════════════════════════
   Kit Ferramentas · Admin  —  design system (TikTok Shop style)
   Tokens espelham public/css/checkout-shell.css e a página de produto.
   Mantém os nomes de variáveis/classes usados pelas páginas internas.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --ink:         #161823;
  --ink-2:       #2a2c3a;
  --bg:          #f4f4f6;
  --surface:     #ffffff;
  --surface-2:   #f8f8fa;
  --border:      #e8e8ec;
  --border-2:    #d9d9df;
  --text:        #161823;
  --text-2:      #4a4b58;
  --muted:       #8a8b91;

  --brand:       #fe2c55;
  --brand-d:     #e0234a;
  --brand-soft:  #ffedf1;
  --cyan:        #25f4ee;
  --green:       #00b8a9;
  --green-d:     #008f83;
  --green-soft:  #def7f4;
  --red:         #e5304a;
  --red-d:       #c41f3a;
  --red-soft:    #ffe9ec;
  --blue:        #2f7bf6;
  --blue-d:      #1f5fd0;
  --blue-soft:   #e4eeff;
  --amber:       #f5a524;
  --amber-d:     #b9770a;
  --amber-soft:  #fff3d9;
  --purple:      #7c5cff;
  --purple-soft: #ece8ff;
  --teal:        #00b8a9;
  --teal-soft:   #def7f4;
  --pink:        #fe2c55;

  --r:     10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --pill:  999px;
  --sh:    0 1px 2px rgba(22,24,35,.04), 0 2px 8px rgba(22,24,35,.04);
  --sh-md: 0 6px 20px rgba(22,24,35,.08), 0 1px 3px rgba(22,24,35,.05);
  --sh-lg: 0 20px 50px rgba(22,24,35,.16), 0 4px 10px rgba(22,24,35,.06);
  --t: 140ms ease;
  --top-h: 60px;
  --tabbar-h: 62px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,*::before,*::after { box-sizing: border-box }
html,body { margin:0; padding:0; overflow-x:hidden }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none }
a:hover { color: var(--brand-d) }
h1,h2,h3,h4 { margin: 0; font-weight: 700; line-height: 1.25; color: var(--ink) }
h1 { font-size: 22px; letter-spacing: -.03em }
h2 { font-size: 15px; letter-spacing: -.015em }
h3 { font-size: 13.5px }
p  { margin: 0 }
hr { border: none; border-top: 1px solid var(--border); margin: 14px 0 }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; color: var(--text-2);
}
img, video { max-width: 100%; height: auto }
::selection { background: var(--brand); color: #fff }

@keyframes spin      { to { transform: rotate(360deg) } }
@keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 0 rgba(0,184,169,.55)} 50%{box-shadow:0 0 0 6px rgba(0,184,169,0)} }
@keyframes fade-up   { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes count-in  { from{opacity:0} to{opacity:1} }
@keyframes sheet-up  { from{transform:translateY(100%)} to{transform:translateY(0)} }

/* ═══ TOP BAR ═══════════════════════════════════════════════════ */
.ad-top {
  position: sticky; top: 0; z-index: 50; height: var(--top-h);
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.ad-top-inner {
  height: 100%; max-width: 1360px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 22px;
}
.ad-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex-shrink: 0 }
.ad-brand:hover { color: var(--ink) }
.ad-brand-mark {
  width: 34px; height: 34px; border-radius: 11px; background: var(--ink);
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.ad-brand-mark::before, .ad-brand-mark::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  border: 2px solid transparent;
}
.ad-brand-mark::before { border-color: var(--cyan); transform: translate(-1.5px,-1.5px); clip-path: inset(0 50% 50% 0) }
.ad-brand-mark::after  { border-color: var(--brand); transform: translate(1.5px,1.5px); clip-path: inset(50% 0 0 50%) }
.ad-brand-mark b { color: #fff; font-weight: 800; font-size: 15px; position: relative; z-index: 1 }
.ad-brand-name { font-weight: 800; font-size: 14.5px; letter-spacing: -.02em; line-height: 1.1 }
.ad-brand-sub  { font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase }

.ad-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0 }
.ad-nav-item { position: relative }
.ad-nav-link, .ad-nav summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 13px; border-radius: var(--pill);
  color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
  border: 0; background: transparent; font-family: inherit; white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.ad-nav summary::-webkit-details-marker { display: none }
.ad-nav-link:hover, .ad-nav summary:hover { background: var(--bg); color: var(--ink) }
.ad-nav-link.active, .ad-nav details.active > summary, .ad-nav details[open] > summary { background: var(--ink); color: #fff }
.ad-nav summary svg.chev { width: 12px; height: 12px; transition: transform var(--t) }
.ad-nav details[open] > summary svg.chev { transform: rotate(180deg) }
.ad-badge {
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 800;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--pill);
  display: inline-grid; place-items: center; line-height: 1;
}
.ad-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60; min-width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); padding: 8px; animation: fade-up 140ms ease both;
}
.ad-menu-label { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px }
.ad-menu a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  color: var(--ink); font-size: 13px; font-weight: 600;
}
.ad-menu a small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); margin-top: 1px }
.ad-menu a:hover { background: var(--bg); color: var(--ink) }
.ad-menu a.active { background: var(--brand-soft) }
.ad-menu a.active .ad-ico { background: var(--brand); color: #fff }
.ad-ico {
  width: 30px; height: 30px; border-radius: 9px; background: var(--bg); color: var(--ink);
  display: grid; place-items: center; flex-shrink: 0;
}
.ad-ico svg { width: 15px; height: 15px }

.ad-top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0 }
.ad-live {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: var(--pill); background: var(--green-soft); color: var(--green-d);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.ad-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse-dot 2s ease-in-out infinite }
.ad-iconbtn {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); color: var(--ink); border: 0; cursor: pointer; transition: background var(--t);
}
.ad-iconbtn:hover { background: var(--border); color: var(--ink) }
.ad-iconbtn svg { width: 16px; height: 16px }
.ad-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #ff7a59);
  color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; border: 0; cursor: pointer;
}
.ad-user { position: relative }
.ad-user summary { list-style: none; cursor: pointer }
.ad-user summary::-webkit-details-marker { display: none }
.ad-user .ad-menu { left: auto; right: 0; min-width: 220px }
.ad-user-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px }
.ad-user-head b { display: block; font-size: 13px }
.ad-user-head span { font-size: 11.5px; color: var(--muted) }
.ad-menu button.ad-menu-btn {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border-radius: 10px;
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--red-d); cursor: pointer; text-align: left;
}
.ad-menu button.ad-menu-btn:hover { background: var(--red-soft) }

/* ═══ MAIN ══════════════════════════════════════════════════════ */
.ad-main { max-width: 1360px; margin: 0 auto; padding: 26px 24px 80px; min-width: 0 }
.ad-page-head { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap }
.ad-crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px }
.ad-crumbs a { color: var(--muted) }
.ad-crumbs a:hover { color: var(--ink) }
.ad-crumbs svg { width: 11px; height: 11px }
.ad-page-head h1 { font-size: 26px }
.ad-page-head .ad-sub { color: var(--muted); font-size: 13px; margin-top: 3px }
.ad-page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.ad-page-actions form { margin: 0 }
/* compat: páginas internas ainda usam .page-header / .dashboard-main */
.page-header { display:none }

/* ═══ MOBILE: tab bar + sheet ═══════════════════════════════════ */
.ad-tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.ad-tabbar-inner { display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h) }
.ad-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 700; border: 0; background: transparent; font-family: inherit; cursor: pointer; position: relative;
}
.ad-tab svg { width: 21px; height: 21px }
.ad-tab.active { color: var(--brand) }
.ad-tab .ad-badge { position: absolute; top: 7px; left: calc(50% + 6px) }
.ad-sheet { position: fixed; inset: 0; z-index: 70; display: none }
.ad-sheet.is-open { display: block }
.ad-sheet-bg { position: absolute; inset: 0; background: rgba(22,24,35,.5) }
.ad-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 0 16px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-up 260ms cubic-bezier(.2,.8,.2,1) both;
}
.ad-sheet-grip { position: sticky; top: 0; background: var(--surface); padding: 10px 0 8px; display: flex; justify-content: center; align-items: center; z-index: 2 }
.ad-sheet-grip::before { content: ''; width: 38px; height: 4px; border-radius: 4px; background: var(--border-2) }
.ad-sheet-close { position: absolute; right: 0; top: 4px; width: 32px; height: 32px; border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer }
.ad-sheet h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 14px 4px 6px }
.ad-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.ad-sheet-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  padding: 12px 6px; border-radius: 14px; background: var(--bg); color: var(--ink); font-size: 11.5px; font-weight: 700; line-height: 1.2;
}
.ad-sheet-grid a.active { background: var(--brand-soft); color: var(--brand-d) }
.ad-sheet-grid .ad-ico { background: var(--surface) }
.ad-sheet-out { margin-top: 16px }
.ad-sheet-out button { width: 100%; padding: 12px; border-radius: var(--pill); border: 0; background: var(--red-soft); color: var(--red-d); font: inherit; font-weight: 700; cursor: pointer }

/* ═══ ALERTS ═══════════════════════════════════════════════════ */
.alert {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 15px; border-radius: var(--r-lg);
  margin-bottom: 16px; font-size: 13px; font-weight: 500; animation: fade-up 200ms ease both;
  background: var(--green-soft); color: var(--green-d); border: 1px solid rgba(0,184,169,.25);
}
.alert-error { background: var(--red-soft); color: var(--red-d); border-color: rgba(229,48,74,.25) }

/* ═══ PANEL ════════════════════════════════════════════════════ */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px 22px; box-shadow: var(--sh); min-width: 0; overflow: hidden;
}
.ph { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; min-width: 0 }
.ph-title { font-size: 14.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; letter-spacing: -.01em }
.ph-title svg { color: var(--brand) }
.ph-sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500 }
.ph-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0 }
.panel-header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; min-width:0 }
.panel-header h2 { font-size:14.5px }
.panel-header .muted { font-size:12px; color:var(--muted); margin-top:2px }
.section-head { display:flex; align-items:center; gap:10px; margin:22px 0 12px }
.section-head span { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); white-space:nowrap }
.section-head::after { content:''; flex:1; height:1px; background:var(--border) }

/* ═══ KPI / METRIC (legado) ════════════════════════════════════ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; position: relative; overflow: hidden; box-shadow: var(--sh); min-width: 0;
}
.kpi::after { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink) }
.kpi-brand::after { background: var(--brand) } .kpi-green::after { background: var(--green) } .kpi-blue::after { background: var(--blue) }
.kpi-purple::after { background: var(--purple) } .kpi-amber::after { background: var(--amber) } .kpi-teal::after { background: var(--cyan) } .kpi-red::after { background: var(--red) }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 8px }
.kpi-val { font-size: 25px; font-weight: 800; letter-spacing: -.035em; line-height: 1; color: var(--ink) }
.kpi-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap }
.kpi-sub { font-size: 11.5px; color: var(--muted) }
.kpi-delta { display: inline-flex; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: var(--pill) }
.kpi-delta-up { background: var(--green-soft); color: var(--green-d) } .kpi-delta-down { background: var(--red-soft); color: var(--red-d) } .kpi-delta-flat { background: var(--bg); color: var(--muted) }
.kpi-prog { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 9px }
.kpi-prog-fill { height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.4,0,.2,1) }
.metric-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:14px }
.metric { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:15px 17px; box-shadow:var(--sh); min-width:0; overflow:hidden }
.metric-label { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.07em; font-weight:700; display:block; margin-bottom:5px }
.metric-value { font-size:23px; font-weight:800; letter-spacing:-.03em; line-height:1 }
.metric-sub { font-size:11.5px; color:var(--muted); margin-top:5px }
.metric-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:6px }
.metric-icon-chip { width:30px; height:30px; border-radius:10px; display:grid; place-items:center; flex-shrink:0 }
.metric-icon-chip svg { width:14px; height:14px }
.metric-bar-wrap { margin-top:7px } .metric-bar-track { height:4px; background:var(--border); border-radius:99px; overflow:hidden }
.metric-bar-fill { height:100%; border-radius:99px; background:var(--brand); transition:width .8s cubic-bezier(.4,0,.2,1) }
.metric-bar-fill--success { background:var(--green) } .metric-bar-fill--danger { background:var(--red) } .metric-bar-fill--warning { background:var(--amber) }
.metric-action { margin-top:8px }

/* ═══ STAT ROW / BARS ══════════════════════════════════════════ */
.sr { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0 }
.sr:last-child { border-bottom: none; padding-bottom: 0 } .sr:first-child { padding-top: 0 }
.sr-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-width: 0; font-weight: 500 }
.sr-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0 }
.sr-val { font-size: 14px; font-weight: 800; color: var(--ink); text-align: right; white-space: nowrap; flex-shrink: 0 }
.sr-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0 } .sr-actions form { margin: 0 }
.attr-bar { margin-bottom: 13px } .attr-bar:last-child { margin-bottom: 0 }
.attr-bar-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px }
.attr-bar-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink) }
.attr-bar-meta { font-size: 12px; color: var(--muted); white-space: nowrap } .attr-bar-meta strong { color: var(--ink); font-weight: 700 }
.prog { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden }
.prog-fill { height: 100%; border-radius: 99px; transition: width .85s cubic-bezier(.4,0,.2,1); width: 0% }
.chart-box { position: relative; width: 100%; min-width: 0; contain: layout style }
.chart-fill { flex: 1; min-height: 0; position: relative } .chart-fill canvas { width: 100% !important; height: 100% !important }
.donut-center { display: flex; justify-content: center; align-items: center; padding: 8px 0 12px } .donut-center canvas { max-width: 170px; max-height: 170px }
.chart-week-totals { display: flex; align-items: center; gap: 12px; flex-shrink: 0 }
.cwt-item { display: flex; flex-direction: column; align-items: flex-end } .cwt-val { font-size: 15px; font-weight: 800; line-height: 1.1 } .cwt-label { font-size: 10.5px; color: var(--muted) }
.cwt-orders { color: var(--ink) } .cwt-revenue { color: var(--brand) } .cwt-sep { width: 1px; height: 28px; background: var(--border) }

/* ═══ GRID ═════════════════════════════════════════════════════ */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: start }
.g52 { display: grid; grid-template-columns: 5fr 3fr; gap: 16px; align-items: start }
.g35 { display: grid; grid-template-columns: 3fr 5fr; gap: 16px; align-items: start }
.g2-stretch { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch }
.g2-stretch .panel { display: flex; flex-direction: column }
.mb { margin-bottom: 16px }

/* ═══ BADGES / PILLS ═══════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--pill); font-size: 11px; font-weight: 700; white-space: nowrap }
.badge-info { background: var(--blue-soft); color: var(--blue-d) } .badge-success { background: var(--green-soft); color: var(--green-d) }
.badge-warning { background: var(--amber-soft); color: var(--amber-d) } .badge-danger { background: var(--red-soft); color: var(--red-d) }
.badge-muted { background: var(--bg); color: var(--text-2) } .badge-brand { background: var(--brand-soft); color: var(--brand-d) } .badge-purple { background: var(--purple-soft); color: var(--purple) }
.badge-store { background: var(--blue-soft); color: var(--blue-d) } .badge-checkout { background: var(--purple-soft); color: var(--purple) }
.step-pill, .step-pill-old { display: inline-block; padding: 3px 9px; border-radius: var(--pill); font-size: 11px; font-weight: 600; background: var(--bg); color: var(--text-2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.pulse-dot { display: inline-block; width: 7px; height: 7px; background: var(--green); border-radius: 50%; animation: pulse-dot 2s ease-in-out infinite; flex-shrink: 0 }
.live-pill, .live-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green-d); padding: 3px 10px; border-radius: var(--pill); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; flex-shrink: 0 }

/* ═══ BUTTONS ══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px;
  border-radius: var(--pill); border: 1px solid transparent; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t), box-shadow var(--t), transform var(--t);
  font-family: inherit; white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn:active { transform: scale(.98) }
.btn svg { width: 14px; height: 14px; flex-shrink: 0 }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 4px 12px rgba(254,44,85,.28) }
.btn-primary:hover { background: var(--brand-d); border-color: var(--brand-d); color: #fff }
.btn-dark { background: var(--ink); color: #fff } .btn-dark:hover { background: var(--ink-2); color: #fff }
.btn-outline { background: var(--surface); color: var(--ink); border: 1px solid var(--border-2) }
.btn-outline:hover { background: var(--bg); color: var(--ink) }
.btn-ghost { background: transparent; color: var(--text-2) } .btn-ghost:hover { background: var(--bg); color: var(--ink) }
.btn-danger { background: var(--red-soft); color: var(--red-d); border-color: rgba(229,48,74,.2) } .btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red) }
.btn-sm { padding: 6px 12px; font-size: 12px } .btn-sm svg { width: 12px; height: 12px }
.btn:disabled { opacity: .5; cursor: not-allowed }

/* ═══ FORMS ════════════════════════════════════════════════════ */
.form-field { display: flex; flex-direction: column; gap: 6px }
.form-field label { font-size: 12.5px; font-weight: 700; color: var(--ink) }
.form-field input[type=text], .form-field input[type=email], .form-field input[type=password], .form-field input[type=number],
.form-field input[type=tel], .form-field input[type=url], .form-field input[type=file], .form-field input[type=color],
.form-field input[type=date], .form-field input[type=datetime-local], .form-field textarea, .form-field select,
.ad-input {
  width: 100%; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--ink); font-size: 13.5px; font-family: inherit; transition: border-color var(--t), box-shadow var(--t);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus, .ad-input:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,24,35,.08);
}
.form-field input[type=color] { height: 42px; padding: 4px 8px; cursor: pointer }
.form-field input[readonly] { background: var(--surface-2); color: var(--text-2) }
.form-field textarea { min-height: 84px; resize: vertical; line-height: 1.5 }
.form-field .field-hint { font-size: 11.5px; color: var(--muted); line-height: 1.5 }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border) }
.toggle-row:last-child { border-bottom: none } .toggle-row .toggle-info strong { font-size: 13.5px } .toggle-row .toggle-info .ph-sub { font-size: 12px; margin-top: 1px }
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0 }
.toggle input { opacity: 0; width: 0; height: 0 }
.toggle .slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-2); border-radius: 99px; transition: background var(--t) }
.toggle .slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--t) }
.toggle input:checked + .slider { background: var(--brand) } .toggle input:checked + .slider::before { transform: translateX(18px) }

/* ═══ TABLE ════════════════════════════════════════════════════ */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: auto; box-shadow: var(--sh) }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px }
.table thead th { text-align: left; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 700; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap }
.table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--ink); vertical-align: middle }
.table tbody tr:last-child td { border-bottom: none } .table tbody tr { transition: background var(--t) } .table tbody tr:hover { background: var(--surface-2) }
.table .empty { text-align: center; color: var(--muted); padding: 32px 14px }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end }

/* ═══ SUB-NAV / TABS ═══════════════════════════════════════════ */
.subnav { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--pill); padding: 4px; margin-bottom: 18px; overflow-x: auto; box-shadow: var(--sh); width: max-content; max-width: 100% }
.subnav a { padding: 7px 15px; border-radius: var(--pill); color: var(--text-2); font-weight: 700; font-size: 12.5px; white-space: nowrap }
.subnav a:hover { background: var(--bg); color: var(--ink) } .subnav a.active { background: var(--ink); color: #fff }
.settings-subnav-hide-desktop { display: none }
.vtabs { display: inline-flex; background: var(--bg); border-radius: var(--pill); padding: 3px; gap: 2px }
.vtab { border: 0; background: transparent; padding: 6px 13px; border-radius: var(--pill); font: inherit; font-size: 12px; font-weight: 700; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background var(--t), color var(--t) }
.vtab.active { background: var(--ink); color: #fff }
.vtab-cnt { font-size: 10.5px; background: rgba(22,24,35,.08); padding: 0 6px; border-radius: var(--pill); line-height: 17px }
.vtab.active .vtab-cnt { background: rgba(255,255,255,.2) }

/* ═══ MOBILE CARDS ═════════════════════════════════════════════ */
.row-list { display: flex; flex-direction: column; gap: 10px }
.row-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 13px 15px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 8px }
.row-card .row-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap }
.row-card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12.5px }
.row-card dt { color: var(--muted) } .row-card dd { margin: 0; color: var(--ink); word-break: break-word; overflow-wrap: anywhere }
.row-card .actions-cell { justify-content: flex-start }

/* ═══ UTILS ════════════════════════════════════════════════════ */
.stack { display: flex; flex-direction: column; gap: 14px } .inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.inline.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap } .inline.actions form, .actions form { margin: 0 }
.muted { color: var(--muted) } .spacer { flex: 1 } .fw7 { font-weight: 700 }
.text-green { color: var(--green-d) !important } .text-red { color: var(--red-d) !important } .text-blue { color: var(--blue-d) !important }
.text-brand { color: var(--brand-d) !important } .text-amber { color: var(--amber-d) !important } .text-teal { color: var(--green-d) !important }
.text-purple { color: var(--purple) !important } .text-muted { color: var(--muted) !important }
.spin { width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 650ms linear infinite }
.table-wrap-only-desktop { display: block } .row-list-only-mobile { display: none }
.pane[hidden] { display: none }

/* ═══ OVERVIEW (ad-*) ══════════════════════════════════════════ */
.ov-top { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 16px; margin-bottom: 16px }
.ov-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 24px; color: #fff;
  background: radial-gradient(420px 260px at 105% -10%, rgba(254,44,85,.55), transparent 65%),
              radial-gradient(360px 240px at -10% 115%, rgba(37,244,238,.28), transparent 65%), var(--ink);
  display: flex; flex-direction: column; gap: 18px; min-width: 0;
}
.ov-hero-label { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 8px }
.ov-hero-val { font-size: 42px; font-weight: 800; letter-spacing: -.045em; line-height: 1 }
.ov-hero-delta { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: rgba(255,255,255,.7); font-weight: 500 }
.ov-hero-delta b { padding: 2px 9px; border-radius: var(--pill); font-size: 11.5px; font-weight: 800 }
.ov-hero-delta .up { background: rgba(0,184,169,.25); color: #6ff3e6 } .ov-hero-delta .down { background: rgba(254,44,85,.3); color: #ff9db0 }
.ov-hero-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.ov-hero-mini div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 11px 12px; backdrop-filter: blur(6px) }
.ov-hero-mini b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1 }
.ov-hero-mini span { font-size: 10.5px; color: rgba(255,255,255,.6); font-weight: 600 }
.ov-chart { display: flex; flex-direction: column }
.ov-split { display: grid; grid-template-columns: minmax(300px, 3fr) 5fr; gap: 16px; align-items: stretch }
.ov-split > .panel { display: flex; flex-direction: column }
.ov-spark { display: flex; align-items: flex-end; gap: 8px; height: 92px; margin-top: auto }
.ov-spark-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px }
.ov-spark-col i { display: block; width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--cyan), rgba(37,244,238,.25)); min-height: 4px }
.ov-spark-col:last-child i { background: linear-gradient(180deg, #ff5f7d, var(--brand)) }
.ov-spark-col span { font-size: 9.5px; font-weight: 700; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .04em }
.ov-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px }
.ov-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh); display: flex; align-items: center; gap: 14px; min-width: 0 }
.ov-kpi-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0 }
.ov-kpi-ico svg { width: 19px; height: 19px }
.ov-kpi-body { min-width: 0; flex: 1 }
.ov-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ov-kpi-val { font-size: 22px; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; color: var(--ink) }
.ov-kpi-sub { font-size: 11.5px; color: var(--muted) }
.ov-ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: conic-gradient(var(--ringc, var(--brand)) calc(var(--p, 0) * 1%), var(--bg) 0) }
.ov-ring::before { content: ''; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); grid-area: 1/1 }
.ov-ring span { grid-area: 1/1; font-size: 10.5px; font-weight: 800; z-index: 1 }

.ov-funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative }
.ov-step { position: relative; padding: 4px 18px 4px 0 }
.ov-step + .ov-step { padding-left: 22px; border-left: 1px dashed var(--border-2) }
.ov-step-rate { position: absolute; left: -17px; top: 6px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--pill); font-size: 10px; font-weight: 800; padding: 1px 7px; color: var(--text-2); z-index: 1 }
.ov-step-val { font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1 }
.ov-step-label { font-size: 12.5px; font-weight: 700; margin-top: 2px }
.ov-step-sub { font-size: 11px; color: var(--muted) }
.ov-step .prog { margin-top: 10px; height: 5px }
.ov-funnel-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px }
.ov-funnel-foot div { background: var(--bg); border-radius: 14px; padding: 11px 14px }
.ov-funnel-foot span { font-size: 11px; color: var(--muted); font-weight: 600; display: block }
.ov-funnel-foot b { font-size: 19px; font-weight: 800; letter-spacing: -.03em }

.ov-legend { display: flex; flex-direction: column; margin-top: 6px }
.ov-rank { display: flex; flex-direction: column }
.ov-rank-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border) }
.ov-rank-row:last-child { border-bottom: 0; padding-bottom: 0 }
.ov-rank-n { width: 28px; height: 28px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: 12px }
.ov-rank-row:nth-child(1) .ov-rank-n { background: var(--brand); color: #fff }
.ov-rank-row:nth-child(2) .ov-rank-n { background: var(--ink); color: #fff }
.ov-rank-row:nth-child(3) .ov-rank-n { background: var(--cyan); color: var(--ink) }
.ov-rank-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ov-rank-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 6px }
.ov-rank-rev { text-align: right; font-weight: 800; font-size: 14px; color: var(--ink) }
.ov-rank-rev small { display: block; font-weight: 600; font-size: 11px; color: var(--muted) }
.ov-maint { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px }
.ov-maint summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px }
.ov-maint summary::-webkit-details-marker { display: none }
.ov-maint[open] summary { color: var(--ink); margin-bottom: 10px }
.ov-top-pages { display: flex; flex-direction: column; gap: 8px; margin-top: 10px }
.top-page-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px }
.top-page-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600 }
.top-page-cnt { font-size: 11px; font-weight: 800; color: var(--brand-d); background: var(--brand-soft); padding: 1px 8px; border-radius: var(--pill) }
.top-page-bar { width: 70px; height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden }
.top-page-bar-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width .4s }

/* ═══ LOGIN ════════════════════════════════════════════════════ */
.lg { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface) }
.lg-art {
  position: relative; overflow: hidden; color: #fff; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(620px 420px at 100% 0%, rgba(254,44,85,.6), transparent 62%),
              radial-gradient(560px 420px at 0% 100%, rgba(37,244,238,.34), transparent 62%), var(--ink);
}
.lg-art .ad-brand { color: #fff } .lg-art .ad-brand-mark { background: rgba(255,255,255,.1) } .lg-art .ad-brand-sub { color: rgba(255,255,255,.55) }
.lg-hero h2 { color: #fff; font-size: 40px; line-height: 1.08; letter-spacing: -.04em; font-weight: 800; max-width: 460px }
.lg-hero h2 em { font-style: normal; background: linear-gradient(90deg, var(--cyan), #fff 55%, var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent }
.lg-hero p { color: rgba(255,255,255,.7); font-size: 15px; margin-top: 14px; max-width: 420px; line-height: 1.6 }
.lg-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px }
.lg-feat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px; backdrop-filter: blur(8px) }
.lg-feat svg { width: 20px; height: 20px; color: var(--cyan); margin-bottom: 10px }
.lg-feat b { display: block; font-size: 13px } .lg-feat span { font-size: 11.5px; color: rgba(255,255,255,.6) }
.lg-orb { position: absolute; right: -80px; top: 38%; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); pointer-events: none }
.lg-orb::after { content: ''; position: absolute; inset: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1) }
.lg-form-wrap { display: grid; place-items: center; padding: 32px 24px; background: var(--bg) }
.lg-card { width: min(410px, 100%); background: var(--surface); border-radius: 24px; padding: 34px; box-shadow: var(--sh-lg); border: 1px solid var(--border); animation: fade-up 300ms ease both }
.lg-card .lg-mobile-brand { display: none; margin-bottom: 22px }
.lg-card h1 { font-size: 26px; letter-spacing: -.035em }
.lg-card .lg-lead { color: var(--muted); margin: 6px 0 24px; font-size: 13.5px }
.lg-field { position: relative }
.lg-field > svg.lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none }
.lg-field input { width: 100%; padding: 13px 44px 13px 42px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface-2); font: inherit; font-size: 14px; color: var(--ink); transition: border-color var(--t), background var(--t), box-shadow var(--t) }
.lg-field input:focus { outline: none; border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(22,24,35,.07) }
.lg-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; border-radius: 50%; color: var(--muted); cursor: pointer; display: grid; place-items: center }
.lg-eye:hover { background: var(--bg); color: var(--ink) } .lg-eye svg { width: 17px; height: 17px }
.lg-label { font-size: 12.5px; font-weight: 700; margin-bottom: 7px; display: block }
.lg-remember { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; font-weight: 500 }
.lg-submit { width: 100%; padding: 14px; border-radius: var(--pill); border: 0; background: var(--brand); color: #fff; font: inherit; font-weight: 800; font-size: 14.5px; cursor: pointer; box-shadow: 0 8px 22px rgba(254,44,85,.32); transition: background var(--t), transform var(--t) }
.lg-submit:hover { background: var(--brand-d) } .lg-submit:active { transform: scale(.985) }
.lg-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; color: var(--muted); font-size: 11.5px; font-weight: 600 }
.lg-secure svg { width: 13px; height: 13px }

/* ═══ RESPONSIVE ═══════════════════════════════════════════════ */
@media (max-width: 1180px) {
  .ad-brand-sub { display: none } .ad-nav-link, .ad-nav summary { padding: 0 10px }
  .ad-live .ad-live-extra { display: none }
}
@media (max-width: 1080px) {
  .ov-top, .ov-split { grid-template-columns: 1fr } .ov-kpis { grid-template-columns: repeat(2, 1fr) }
}
@media (max-width: 900px) {
  .ad-nav, .ad-top-right .ad-desktop-only { display: none }
  .ad-top-inner { padding: 0 16px; gap: 12px } .ad-tabbar { display: block }
  .ad-main { padding: 18px 14px calc(var(--tabbar-h) + 34px) }
  .ad-page-head h1 { font-size: 22px }
  .g2, .g3, .g52, .g35, .g2-stretch { grid-template-columns: 1fr }
  .table-wrap-only-desktop { display: none } .row-list-only-mobile { display: flex }
  .table-mobile-hide { display: none !important }
  .lg { grid-template-columns: 1fr } .lg-art { display: none } .lg-form-wrap { min-height: 100vh; background: var(--ink); background-image: radial-gradient(500px 340px at 100% 0%, rgba(254,44,85,.5), transparent 62%), radial-gradient(420px 320px at 0% 100%, rgba(37,244,238,.28), transparent 62%) }
  .lg-card .lg-mobile-brand { display: flex }
}
@media (max-width: 600px) {
  .panel { padding: 16px 16px } .ov-hero { padding: 20px } .ov-hero-val { font-size: 36px }
  .ov-kpis { grid-template-columns: 1fr 1fr; gap: 8px } .ov-kpi { padding: 13px 14px; gap: 10px; flex-direction: column; align-items: flex-start }
  .ov-kpi-ico { width: 36px; height: 36px } .ov-kpi-val { font-size: 19px }
  .ov-funnel { grid-template-columns: 1fr 1fr; row-gap: 20px } .ov-step:nth-child(3) { border-left: 0; padding-left: 0 } .ov-step:nth-child(3) .ov-step-rate { display: none }
  .ov-funnel-foot { grid-template-columns: 1fr }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px } .kpi-val { font-size: 20px }
  .lg-card { padding: 26px 22px }
}

/* painéis empilhados (formulários das páginas internas) */
.ad-main > .panel + .panel, .ad-main form > .panel + .panel, .ad-main form > .panel + form, .ad-main > form + .panel { margin-top: 16px }
.ad-main .subnav + .panel { margin-top: 0 }
