/* Painel CheckNum */
body { min-height: 100vh; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }

/* Barra lateral */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.side .cn-logo { padding: 4px 8px 18px; }
.side-sec { margin: 16px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.side a.nav { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.side a.nav:hover { background: var(--neutral-bg); color: var(--text); text-decoration: none; }
.side a.nav.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.side a.nav svg { width: 18px; height: 18px; flex: none; }
.side a.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--brand); color: #fff; }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.side-foot b { color: var(--text-2); }

/* Topo */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; height: 62px; padding: 0 28px; background: color-mix(in oklab, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top h1 { font-size: 17px; font-weight: 700; }
.top .crumbs { font-size: 13px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.credit-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.credit-pill:hover { border-color: var(--border-2); text-decoration: none; }
.credit-pill svg { width: 17px; height: 17px; color: var(--warn); }
.credit-pill.zero { border-color: color-mix(in oklab, var(--no) 40%, var(--border)); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: none; }
.view-switch { font-size: 12px; }
.menu-btn { display: none; }

.main { padding: 28px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; }
.page-head p { color: var(--muted); margin-top: 4px; }

/* KPIs */
.kpi { padding: 18px 20px; }
.kpi .k-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .k-label svg { width: 16px; height: 16px; }
.kpi .k-val { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Gráfico */
.chart { position: relative; height: 210px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--brand); transition: opacity .15s; }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart:hover .bar { opacity: .55; }
.chart .bar.hl { opacity: 1; }
.tip { position: absolute; pointer-events: none; padding: 8px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -100%); z-index: 5; }
.tip b { font-size: 14px; font-variant-numeric: tabular-nums; }

/* Conexões */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.conn { display: flex; flex-direction: column; }
.conn-top { display: flex; gap: 12px; align-items: flex-start; padding: 18px 18px 14px; }
.conn-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--neutral-bg); color: var(--muted); }
.conn-ico svg { width: 21px; height: 21px; }
.conn.st-online .conn-ico { background: var(--ok-bg); color: var(--ok); }
.conn.st-warming .conn-ico { background: var(--info-bg); color: var(--info); }
.conn.st-cooling .conn-ico { background: var(--warn-bg); color: var(--warn); }
.conn.st-banned .conn-ico { background: var(--no-bg); color: var(--no); }
.conn h4 { font-size: 15px; }
.conn .ph { font-size: 13px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-body { padding: 0 18px 16px; display: grid; gap: 11px; font-size: 13px; }
.meter-row { display: grid; gap: 5px; }
.meter-row .row { font-size: 12.5px; color: var(--muted); }
.meter-row .row b { color: var(--text); font-weight: 600; }
.conn-foot { margin-top: auto; display: flex; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); flex-wrap: wrap; }
.conn-add { display: grid; place-items: center; min-height: 250px; border: 2px dashed var(--border-2); border-radius: var(--r); color: var(--muted); cursor: pointer; background: transparent; font: inherit; }
.conn-add:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-softer); }
.conn-add svg { width: 28px; height: 28px; }
.qr-box { display: grid; place-items: center; padding: 18px; background: #fff; border-radius: 14px; border: 1px solid var(--border); width: 252px; margin: 0 auto; }
.qr-box svg, .qr-box img { width: 216px; height: 216px; display: block; }
.pair-code { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .14em; text-align: center; padding: 18px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); }

/* Verificações */
.status-cell { display: grid; gap: 6px; min-width: 190px; }
.job-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.job-name svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.job-name a { color: var(--text); }

/* Assistente */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.wstep { display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 7px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border); }
.wstep span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--neutral-bg); font-size: 12px; }
.wstep.on { color: var(--brand-ink); border-color: color-mix(in oklab, var(--brand) 40%, var(--border)); }
.wstep.on span { background: var(--brand); color: #fff; }
.wstep.done span { background: var(--ok); color: #fff; }
.drop { display: grid; place-items: center; gap: 12px; text-align: center; padding: 56px 24px; border: 2px dashed var(--border-2); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-softer); }
.drop .big { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.drop .big svg { width: 28px; height: 28px; }
.drop h3 { font-size: 18px; }
.preview-table { max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.preview-table table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.preview-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); padding: 0; border-bottom: 1px solid var(--border); text-align: left; }
.preview-table th button { all: unset; display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.preview-table th button:hover { background: var(--brand-softer); }
.preview-table th.sel button { background: var(--brand); color: #fff; }
.preview-table th .sug { font-size: 10.5px; padding: 1px 6px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); }
.preview-table th.sel .sug { background: rgba(255,255,255,.22); color: #fff; }
.preview-table td { padding: 8px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.preview-table td.sel { background: var(--brand-softer); font-family: var(--mono); font-size: 12.5px; box-shadow: inset 2px 0 0 var(--brand), inset -2px 0 0 var(--brand); }
.preview-table td.rn, .preview-table th.rn { color: var(--muted); font-size: 11.5px; width: 1%; text-align: right; padding: 8px 10px; }
.sum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.sum-grid > div { background: var(--surface); padding: 15px 18px; }
.sum-grid .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sum-grid .l { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.sum-grid .l .badge { height: 19px; font-size: 10.5px; padding: 0 7px; }
.conn-pick { display: grid; gap: 8px; }
.conn-pick label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.conn-pick label:hover { background: var(--surface-2); }
.conn-pick label.dis { opacity: .5; cursor: not-allowed; }
.est { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--r); background: linear-gradient(135deg, var(--brand-soft), var(--brand-softer)); border: 1px solid color-mix(in oklab, var(--brand) 25%, var(--border)); }
.est .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--brand-ink); }
.est svg { width: 30px; height: 30px; color: var(--brand-ink); flex: none; }

/* Detalhe */
.det-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.det-kpis .kpi .k-val { font-size: 23px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.log { font-family: var(--mono); font-size: 12px; line-height: 1.75; max-height: 300px; overflow: auto; padding: 14px 16px; background: var(--surface-2); }
.log div { white-space: nowrap; }
.log .t { color: var(--muted); }
.log .w { color: var(--warn); }
.log .e { color: var(--no); }
.log .o { color: var(--ok); }
.dl-menu { position: relative; }
.dl-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 20; display: grid; gap: 2px; }
.dl-pop button { all: unset; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.dl-pop button:hover { background: var(--neutral-bg); }
.dl-pop button svg { width: 17px; height: 17px; color: var(--muted); }
.dl-pop .sep { height: 1px; background: var(--border); margin: 4px 0; }
.dl-pop .hd { font-size: 11.5px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* Créditos */
.credit-hero { display: flex; align-items: center; gap: 22px; padding: 26px; color: #fff; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex-wrap: wrap; }
.credit-hero .v { font-size: 42px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.credit-hero .l { opacity: .85; font-size: 14px; margin-bottom: 6px; }
.credit-hero .btn { background: #fff; color: #11152A; border: 0; margin-left: auto; }
.credit-hero .mini { display: flex; gap: 28px; }
.credit-hero .mini b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.credit-hero .mini span { font-size: 12.5px; opacity: .8; }
.qty-plus { color: var(--ok); font-weight: 700; }
.qty-minus { color: var(--text-2); font-weight: 600; }

/* API */
.method { display: inline-block; min-width: 56px; text-align: center; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 6px; border-radius: 6px; }
.m-get { background: var(--info-bg); color: var(--info); }
.m-post { background: var(--ok-bg); color: var(--ok); }
.m-put, .m-patch { background: var(--warn-bg); color: var(--warn); }
.m-del { background: var(--no-bg); color: var(--no); }
.endpoint { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.endpoint:last-child { border-bottom: 0; }
.endpoint code { font-size: 13px; }
.endpoint .muted { margin-left: auto; font-size: 12.5px; text-align: right; }
.key-reveal { font-family: var(--mono); font-size: 13.5px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-2); word-break: break-all; }

/* Branding */
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 22px; align-items: start; }
.brand-preview { position: sticky; top: 84px; }
.pv-frame { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); }
.pv-bar { display: flex; gap: 6px; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); align-items: center; }
.pv-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); display: block; }
.pv-bar span { margin-left: 8px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.pv-hero { padding: 26px 24px; font-family: var(--pv-font, var(--font)); background: radial-gradient(closest-side at 20% 0%, color-mix(in oklab, var(--pv-brand) 16%, transparent), transparent), var(--surface); }
.pv-hero .t { font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 16px 0 10px; }
.pv-hero .s { font-size: 13px; color: var(--text-2); }
.pv-btn { display: inline-flex; height: 34px; align-items: center; padding: 0 14px; border-radius: 9px; color: #fff; font-weight: 600; font-size: 13px; background: linear-gradient(135deg, var(--pv-brand), var(--pv-brand-2)); margin-top: 16px; }
.pv-btn.solid { background: var(--pv-brand); }
.pv-panel { display: grid; grid-template-columns: 110px 1fr; border-top: 1px solid var(--border); font-family: var(--pv-font, var(--font)); }
.pv-side { padding: 14px 10px; border-right: 1px solid var(--border); display: grid; gap: 6px; align-content: start; }
.pv-side div { height: 22px; border-radius: 6px; background: var(--neutral-bg); }
.pv-side div.on { background: color-mix(in oklab, var(--pv-brand) 16%, var(--surface)); }
.pv-content { padding: 14px; display: grid; gap: 10px; }
.pv-kpi { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.pv-kpi b { display: block; font-size: 18px; color: var(--text); }
.pv-prog { height: 7px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.pv-prog span { display: block; height: 100%; width: 64%; background: var(--pv-brand); border-radius: 99px; }
.pv-wm { font-weight: 800; font-size: 17px; letter-spacing: -.03em; }
.pv-wm em { font-style: normal; color: var(--pv-brand); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); cursor: pointer; padding: 0; }
.swatch:hover { transform: scale(1.06); }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field .input:not([type="color"]) { font-family: var(--mono); text-transform: uppercase; }
.upload-row { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.upload-row .stack-sm { display: flex; gap: 6px; flex-wrap: wrap; }
.upload-thumb { width: 100%; height: 52px; border-radius: 10px; border: 1px dashed var(--border-2); display: grid; place-items: center; background: var(--surface-2); overflow: hidden; flex: none; }
.upload-thumb.dark { background: #0D1120; }
.upload-thumb img { max-height: 36px; max-width: 108px; }
.contrast { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.contrast .chip { width: 44px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; }
.locked { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--neutral-bg); font-size: 13px; color: var(--text-2); }
.locked svg { width: 17px; height: 17px; flex: none; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; color: #fff; background: linear-gradient(150deg, var(--brand), var(--brand-2)); }
.auth-art .cn-logo, .auth-art .cn-wm, .auth-art .cn-wm em { color: #fff; }
.auth-art h2 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; max-width: 440px; }
.auth-art p { opacity: .85; margin-top: 12px; max-width: 420px; font-size: 16px; }
.auth-art .stats { display: flex; gap: 30px; }
.auth-art .stats b { display: block; font-size: 24px; }
.auth-art .stats span { opacity: .8; font-size: 13px; }
.auth-art::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -160px; border-radius: 50%; border: 70px solid rgba(255,255,255,.07); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-form form { width: min(400px, 100%); display: grid; gap: 16px; }
.auth-form h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); }


@media (max-width: 1180px) {
  .brand-layout { grid-template-columns: 1fr; }
  .brand-preview { position: static; }
  .det-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 20px 16px; }
  .top { padding: 0 16px; }
  .top .crumbs, .view-switch-label, .top .avatar { display: none; }
  .top-right { gap: 4px; }
  .view-switch .seg button { padding: 6px 8px; font-size: 12px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .sum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .det-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .page-head .row { flex-wrap: wrap; }
  .page-head .input-group { width: 100% !important; }
  .brand-layout, .det-kpis { min-width: 0; }
  .credit-hero .btn { margin-left: 0; }
}
@media (max-width: 560px) {
  .row.between { flex-wrap: wrap; }
  .job-name { min-width: 0; overflow-wrap: anywhere; }
  .btn { white-space: normal; height: auto; min-height: 38px; text-align: center; }
  .endpoint { flex-wrap: wrap; }
  .endpoint .muted { margin-left: 0; text-align: left; width: 100%; }
  .top .view-switch { display: none; }
  .side-switch { display: block !important; }
  .credit-pill .lbl, .top [data-act="logout"] { display: none; }
  .top h1 { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top h1 { font-size: 15px; }
}

.side-switch { display: none; margin-top: 10px; }

/* ── Painel real (Fase 3) ── */
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--muted); }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.qr-wait { width: 216px; height: 216px; display: grid; place-items: center; gap: 10px; color: #555; font-size: 13px; text-align: center; }
.acting { display: flex; gap: 10px; align-items: center; padding: 9px 16px; background: var(--warn-bg); color: var(--warn); font-size: 13px; border-bottom: 1px solid var(--border); }
.acting button { margin-left: auto; }
.form-error { color: var(--no); font-size: 13px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty svg { width: 30px; height: 30px; }
.check-table td.num-col { font-family: var(--mono); }
.nav.soon { opacity: .55; }
.nav .soon-tag { margin-left: auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
textarea.input { min-height: 140px; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.tabs { overflow-y: hidden; }
.table code { white-space: nowrap; }
.table td.num, .table td .row { white-space: nowrap; }
@media (max-width: 1280px) { .api-grid { grid-template-columns: 1fr !important; } }
.side-logout { display: none !important; }
@media (max-width: 560px) { .side-logout { display: flex !important; } }
.big-num { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.preset-card { cursor: pointer; }
.preset-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
