/* ================================================================
   ReviewShield · Panel (dashboard del negocio + superadmin + login)
   Sistema compartido con el portal público: mismos tokens --rs-*.
   Claro por defecto; oscuro "azul de plano" según el sistema o el
   botón de tema (data-theme en <html>).
   ================================================================ */
:root {
    --rs-bg:#ECEEEA; --rs-sheet:#FBFBF8; --rs-sheet-2:#F3F4F0; --rs-ink:#15171C; --rs-ink-soft:#565B66; --rs-ink-mute:#8A8F98;
    --rs-line:#DCDFD8; --rs-border:#D5D8CE; --rs-accent:#4636D1; --rs-accent-soft:#ECEAFB; --rs-google:#1F63D6; --rs-google-soft:#E4EDFB;
    --rs-success:#1E7F48; --rs-success-soft:#E4F1EA; --rs-star:#D99A00; --rs-correction:#CF4A12; --rs-warn-soft:#FBF0E8;
    --rs-font-sans:'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --rs-font-mono:'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
    --rs-font-hand:'Caveat', 'Segoe Print', cursive;
    --rs-r-sm:8px; --rs-r-md:12px; --rs-r-lg:16px; --rs-r-pill:999px;
    --rs-shadow:0 1px 2px rgba(21,23,28,.05), 0 8px 24px rgba(21,23,28,.05);
    --rs-shadow-sm:0 1px 2px rgba(21,23,28,.06);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --rs-bg:#0E1320; --rs-sheet:#141A28; --rs-sheet-2:#101726; --rs-ink:#E7ECF5; --rs-ink-soft:#9FB0CE; --rs-ink-mute:#6E7F9E;
        --rs-line:#24304B; --rs-border:#263149; --rs-accent:#7B6EF0; --rs-accent-soft:#1E2440; --rs-google:#5B8DEF; --rs-google-soft:#16233E;
        --rs-success:#3FB27A; --rs-success-soft:#12271E; --rs-star:#E4B33A; --rs-correction:#E86A3A; --rs-warn-soft:#2A2016;
        --rs-shadow:0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); --rs-shadow-sm:0 1px 2px rgba(0,0,0,.3);
    }
}
:root[data-theme="dark"] {
    --rs-bg:#0E1320; --rs-sheet:#141A28; --rs-sheet-2:#101726; --rs-ink:#E7ECF5; --rs-ink-soft:#9FB0CE; --rs-ink-mute:#6E7F9E;
    --rs-line:#24304B; --rs-border:#263149; --rs-accent:#7B6EF0; --rs-accent-soft:#1E2440; --rs-google:#5B8DEF; --rs-google-soft:#16233E;
    --rs-success:#3FB27A; --rs-success-soft:#12271E; --rs-star:#E4B33A; --rs-correction:#E86A3A; --rs-warn-soft:#2A2016;
    --rs-shadow:0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); --rs-shadow-sm:0 1px 2px rgba(0,0,0,.3);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--rs-bg); color: var(--rs-ink); font-family: var(--rs-font-sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--rs-accent); outline-offset: 2px; }
.mono { font-family: var(--rs-font-mono); }
.muted { color: var(--rs-ink-mute); }
.soft { color: var(--rs-ink-soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar { width: 264px; flex: none; background: var(--rs-sheet); border-right: 1px solid var(--rs-border); display: flex; flex-direction: column; gap: 6px; padding: 20px 16px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--rs-accent); display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--rs-font-mono); font-weight: 600; font-size: 15px; }
.brand b { font-size: 17px; font-weight: 600; display: block; line-height: 1.2; }
.brand span { display: block; font-family: var(--rs-font-mono); font-size: 11px; color: var(--rs-ink-mute); letter-spacing: .04em; }
.roleswitch { display: flex; background: var(--rs-sheet-2); border: 1px solid var(--rs-border); border-radius: var(--rs-r-md); padding: 3px; gap: 3px; margin: 0 4px 12px; }
.roleswitch a { flex: 1; text-align: center; white-space: nowrap; color: var(--rs-ink-soft); font-size: 12.5px; font-weight: 500; padding: 8px 6px; border-radius: 9px; line-height: 1.2; }
.roleswitch a.on { background: var(--rs-sheet); color: var(--rs-ink); box-shadow: var(--rs-shadow-sm); }
.bizchip { display: flex; align-items: center; gap: 10px; margin: 0 4px 10px; padding: 10px; border: 1px solid var(--rs-border); border-radius: var(--rs-r-md); background: var(--rs-sheet); }
.bizchip .lg { width: 32px; height: 32px; border-radius: 8px; background: var(--rs-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--rs-font-mono); font-weight: 600; font-size: 12px; overflow: hidden; flex: none; }
.bizchip .lg img { width: 100%; height: 100%; object-fit: cover; }
.bizchip b { display: block; font-size: 13.5px; line-height: 1.2; }
.bizchip span { font-family: var(--rs-font-mono); font-size: 11px; color: var(--rs-ink-mute); }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav .grp { font-family: var(--rs-font-mono); font-size: 10.5px; letter-spacing: .1em; color: var(--rs-ink-mute); padding: 12px 12px 6px; }
.navlink { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--rs-ink-soft); font-size: 14.5px; font-weight: 500; }
.navlink svg { width: 19px; height: 19px; flex: none; }
.navlink:hover { background: var(--rs-sheet-2); color: var(--rs-ink); }
.navlink.on { background: var(--rs-accent-soft); color: var(--rs-accent); }
.navlink .ext { margin-left: auto; width: 15px; height: 15px; opacity: .6; }
.navspace { flex: 1; }
.navfoot { border-top: 1px solid var(--rs-line); padding-top: 8px; margin-top: 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--rs-bg); border-bottom: 1px solid var(--rs-border); padding: 16px 32px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar .tt { flex: 1; min-width: 180px; }
.topbar .tt h1 { font-size: 20px; font-weight: 600; }
.topbar .tt p { font-size: 13px; color: var(--rs-ink-soft); }
.topctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--rs-border); background: var(--rs-sheet); color: var(--rs-ink-soft); display: flex; align-items: center; justify-content: center; }
.iconbtn:hover { color: var(--rs-ink); border-color: var(--rs-ink-mute); }
.iconbtn svg { width: 18px; height: 18px; }
.content { padding: 28px 32px 64px; max-width: 1240px; width: 100%; }

/* ---------- genéricos ---------- */
.card { background: var(--rs-sheet); border: 1px solid var(--rs-border); border-radius: var(--rs-r-lg); box-shadow: var(--rs-shadow-sm); min-width: 0; }
.pad { padding: 20px; }
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-wide { grid-template-columns: 1.15fr .85fr; }
.g-form { grid-template-columns: 1.3fr .7fr; align-items: start; }
.start { align-items: start; }
.mt { margin-top: 18px; }
.sechead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; flex-wrap: wrap; }
.card .sechead { margin: 0 0 16px; }
.sechead h2 { font-size: 17px; font-weight: 600; }
.sechead p { font-size: 13px; color: var(--rs-ink-soft); }
.sechead p.mono { color: var(--rs-ink-mute); }
.eyebrow { font-family: var(--rs-font-mono); font-size: 11px; letter-spacing: .1em; color: var(--rs-ink-mute); text-transform: uppercase; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--rs-r-pill); font-family: var(--rs-font-mono); }
.tag svg { width: 12px; height: 12px; }
.tag.google { background: var(--rs-google-soft); color: var(--rs-google); }
.tag.priv { background: var(--rs-accent-soft); color: var(--rs-accent); }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars svg { width: 15px; height: 15px; }
.stars .on { color: var(--rs-star); }
.stars .off { color: var(--rs-ink-mute); }
.delta { font-size: 12px; font-weight: 600; font-family: var(--rs-font-mono); }
.delta.up { color: var(--rs-success); }
.delta.down { color: var(--rs-correction); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; border: 1px solid var(--rs-border); background: var(--rs-sheet); color: var(--rs-ink); font-size: 14px; font-weight: 600; padding: 11px 16px; line-height: 1.2; }
.btn:hover { border-color: var(--rs-ink-mute); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--rs-accent); border-color: var(--rs-accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.input { width: 100%; border: 1px solid var(--rs-border); background: var(--rs-sheet); color: var(--rs-ink); border-radius: 10px; padding: 11px 13px; font-size: 15px; }
.input::placeholder { color: var(--rs-ink-mute); }
.input:focus { outline: none; border-color: var(--rs-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rs-accent) 18%, transparent); }
textarea.input { resize: vertical; min-height: 88px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--rs-ink-soft); }
.divider { height: 1px; background: var(--rs-line); border: 0; margin: 22px 0; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--rs-r-md); font-size: 14px; margin-bottom: 18px; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.ok { background: var(--rs-success-soft); color: var(--rs-success); }
.alert.err { background: var(--rs-warn-soft); color: var(--rs-correction); }

/* métricas */
.metric { padding: 18px 20px; }
.metric .lab { display: flex; align-items: center; gap: 9px; color: var(--rs-ink-soft); font-size: 13px; font-weight: 500; }
.metric .lab svg { width: 17px; height: 17px; color: var(--rs-ink-mute); }
.metric .val { font-size: 32px; font-weight: 600; letter-spacing: -.01em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.metric .val small { font-size: 16px; color: var(--rs-ink-soft); font-weight: 500; }
.metric .sub { font-size: 12.5px; color: var(--rs-ink-soft); margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.metric .sub b { color: var(--rs-ink); }
.spark { margin-top: 12px; width: 100%; height: 34px; display: block; color: var(--rs-accent); }

/* canal */
.split { display: flex; height: 44px; border-radius: 10px; overflow: hidden; border: 1px solid var(--rs-border); background: var(--rs-sheet-2); }
.split .seg { display: flex; align-items: center; padding: 0 14px; color: #fff; font-weight: 600; font-size: 14px; gap: 8px; min-width: 0; white-space: nowrap; }
.split .seg svg { width: 16px; height: 16px; flex: none; }
.split .seg.g { background: var(--rs-google); }
.split .seg.p { background: var(--rs-accent); }
.legend { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.legend .it { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rs-ink-soft); }
.legend .it b { color: var(--rs-ink); }
.legend .dot { width: 11px; height: 11px; border-radius: 3px; }

/* distribución */
.rrow { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.rrow .rl { display: flex; align-items: center; gap: 5px; width: 44px; font-size: 13px; color: var(--rs-ink-soft); font-family: var(--rs-font-mono); }
.rrow .rl svg { width: 13px; height: 13px; color: var(--rs-star); }
.rtrack { flex: 1; height: 10px; background: var(--rs-sheet-2); border-radius: var(--rs-r-pill); overflow: hidden; }
.rfill { height: 100%; background: var(--rs-star); border-radius: var(--rs-r-pill); }
.rrow .rc { width: 38px; text-align: right; font-size: 13px; color: var(--rs-ink-soft); font-family: var(--rs-font-mono); }

/* comentarios */
.quote { padding: 16px 18px; border: 1px solid var(--rs-border); border-radius: var(--rs-r-md); background: var(--rs-sheet); display: flex; gap: 14px; align-items: flex-start; }
.quote + .quote { margin-top: 12px; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--rs-accent-soft); color: var(--rs-accent); display: flex; align-items: center; justify-content: center; font-family: var(--rs-font-mono); font-weight: 600; font-size: 14px; }
.avatar svg { width: 18px; height: 18px; }
.avatar.g { background: var(--rs-google-soft); color: var(--rs-google); }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.quote .qb { flex: 1; min-width: 0; }
.quote .qh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quote .qh b { font-size: 14.5px; }
.quote .qh .when { font-size: 12px; color: var(--rs-ink-mute); font-family: var(--rs-font-mono); }
.quote .qt { margin-top: 6px; font-size: 14px; color: var(--rs-ink-soft); line-height: 1.55; overflow-wrap: anywhere; }
.quote.event .qt { color: var(--rs-ink-mute); display: flex; align-items: center; gap: 7px; }
.quote.event .qt svg { width: 15px; height: 15px; }

/* mapa de calor */
.heat { display: grid; grid-template-columns: auto repeat(7, 1fr); gap: 6px; align-items: center; }
.heat .hd { font-family: var(--rs-font-mono); font-size: 11px; color: var(--rs-ink-mute); text-align: center; }
.heat .wl { font-family: var(--rs-font-mono); font-size: 11px; color: var(--rs-ink-mute); padding-right: 6px; white-space: nowrap; }
.hcell { aspect-ratio: 1 / 1; border-radius: 6px; min-height: 22px; background: var(--rs-sheet-2); }
.hcell.future { background: transparent; border: 1px dashed var(--rs-line); }
.heatnote { margin-top: 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--rs-ink); background: var(--rs-accent-soft); border-radius: var(--rs-r-md); padding: 12px 14px; }
.heatnote svg { width: 18px; height: 18px; color: var(--rs-accent); flex: none; }
.heatscale { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 11.5px; color: var(--rs-ink-mute); font-family: var(--rs-font-mono); }
.heatscale .sc { width: 16px; height: 16px; border-radius: 4px; }

/* tarjeta NFC */
.nfc { border-radius: var(--rs-r-lg); padding: 22px; background: linear-gradient(150deg, #1b1f3a, #12162b); color: #fff; position: relative; overflow: hidden; min-height: 200px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid #2a2f52; }
.nfc .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(#ffffff10 1px, transparent 1px), linear-gradient(90deg, #ffffff10 1px, transparent 1px); background-size: 26px 26px; opacity: .5; }
.nfc .top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
.nfc .lg { width: 44px; height: 44px; border-radius: 10px; background: #fff; color: #1b1f3a; display: flex; align-items: center; justify-content: center; font-family: var(--rs-font-mono); font-weight: 600; overflow: hidden; }
.nfc .lg img { width: 100%; height: 100%; object-fit: cover; }
.nfc .nm { position: relative; font-size: 18px; font-weight: 600; }
.nfc .nm span { display: block; font-family: var(--rs-font-mono); font-size: 11px; color: #aab0d4; margin-top: 2px; font-weight: 400; }
.nfc .wave { width: 26px; height: 26px; color: #aab0d4; }
.nfc .wave svg { width: 100%; height: 100%; }
.urlbox { display: flex; align-items: center; gap: 8px; background: var(--rs-sheet-2); border: 1px solid var(--rs-border); border-radius: 10px; padding: 9px 12px; margin-top: 14px; }
.urlbox .u { flex: 1; min-width: 0; font-family: var(--rs-font-mono); font-size: 12.5px; color: var(--rs-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copybtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rs-border); background: var(--rs-sheet); color: var(--rs-ink); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.copybtn svg { width: 14px; height: 14px; }
.copybtn:hover { border-color: var(--rs-ink-mute); }
.tip { display: flex; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--rs-ink-soft); background: var(--rs-sheet-2); border-radius: var(--rs-r-md); padding: 12px 14px; line-height: 1.5; }
.tip svg { width: 17px; height: 17px; color: var(--rs-accent); flex: none; margin-top: 1px; }

/* filtros */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.segtabs { display: inline-flex; background: var(--rs-sheet-2); border: 1px solid var(--rs-border); border-radius: 10px; padding: 3px; gap: 3px; }
.segtabs a { color: var(--rs-ink-soft); font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 8px; }
.segtabs a.on { background: var(--rs-sheet); color: var(--rs-ink); box-shadow: var(--rs-shadow-sm); }
.segtabs a .n { font-family: var(--rs-font-mono); font-size: 11px; color: var(--rs-ink-mute); margin-left: 4px; }
.searchbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rs-border); background: var(--rs-sheet); border-radius: 10px; padding: 0 12px; flex: 1; min-width: 180px; }
.searchbox:focus-within { border-color: var(--rs-accent); }
.searchbox svg { width: 16px; height: 16px; color: var(--rs-ink-mute); flex: none; }
.searchbox input { border: 0; background: transparent; color: var(--rs-ink); padding: 11px 0; font-size: 14px; width: 100%; outline: none; }

/* tablas */
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--rs-font-mono); font-size: 11px; letter-spacing: .06em; color: var(--rs-ink-mute); text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--rs-border); font-weight: 500; white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--rs-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--rs-sheet-2); }
.table .num { font-family: var(--rs-font-mono); font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.table a.rowlink:hover { color: var(--rs-accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--rs-r-pill); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.ok { background: var(--rs-success-soft); color: var(--rs-success); }
.pill.ok .dot { background: var(--rs-success); }
.pill.off { background: var(--rs-sheet-2); color: var(--rs-ink-mute); }
.pill.off .dot { background: var(--rs-ink-mute); }
.rowact { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.rowact form { margin: 0; }

/* estados */
.state { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.state .ic { width: 56px; height: 56px; border-radius: 14px; background: var(--rs-sheet-2); display: flex; align-items: center; justify-content: center; color: var(--rs-ink-mute); }
.state .ic svg { width: 26px; height: 26px; }
.state .ic.err { color: var(--rs-correction); background: var(--rs-warn-soft); }
.state h3 { font-size: 17px; font-weight: 600; }
.state p { font-size: 14px; color: var(--rs-ink-soft); max-width: 420px; }

/* login */
.loginwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--rs-bg); }
.logincard { width: 100%; max-width: 400px; background: var(--rs-sheet); border: 1px solid var(--rs-border); border-radius: var(--rs-r-lg); box-shadow: var(--rs-shadow); padding: 32px; }
.logincard .lb { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.logincard .lb .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--rs-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--rs-font-mono); font-weight: 600; }
.logincard .lb b { font-size: 17px; display: block; line-height: 1.2; }
.loginfoot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--rs-ink-mute); font-family: var(--rs-font-mono); }

/* configuración */
.notebox { display: flex; gap: 11px; background: var(--rs-warn-soft); border: 1px solid color-mix(in srgb, var(--rs-correction) 30%, transparent); border-radius: var(--rs-r-md); padding: 14px 16px; font-size: 13.5px; color: var(--rs-ink); line-height: 1.5; margin-top: 4px; }
.notebox svg { width: 18px; height: 18px; color: var(--rs-correction); flex: none; margin-top: 1px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sw { position: relative; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw span { display: block; width: 38px; height: 38px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; }
.sw input:checked + span { border-color: var(--rs-ink); box-shadow: 0 0 0 2px var(--rs-sheet) inset; }
.sw input:focus-visible + span { outline: 2px solid var(--rs-accent); outline-offset: 2px; }
.sw.custom span { display: flex; align-items: center; justify-content: center; background: conic-gradient(#CF4A12, #D99A00, #1E7F48, #1F63D6, #4636D1, #CF4A12); }
.sw.custom input[type=color] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.logo-up { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-prev { width: 72px; height: 72px; border-radius: 14px; background: var(--rs-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--rs-font-mono); font-weight: 600; font-size: 24px; overflow: hidden; flex: none; }
.logo-prev.round { border-radius: 50%; }
.logo-prev img { width: 100%; height: 100%; object-fit: cover; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--rs-ink-soft); }
.savebar { position: sticky; bottom: 0; margin-top: 18px; padding: 12px 0; background: linear-gradient(transparent, var(--rs-bg) 30%); display: flex; justify-content: flex-end; }

/* ---------- responsive: sidebar → barra superior ---------- */
@media (max-width: 1100px) {
    .g-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .app { flex-direction: column; }
    .sidebar { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--rs-border); padding: 12px 16px; gap: 10px; }
    .brand { padding: 0; }
    .roleswitch, .bizchip { margin: 0; }
    .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; flex: none; scrollbar-width: none; }
    .nav .grp, .navspace { display: none; }
    .navfoot { border: 0; margin: 0; padding: 0; display: contents; }
    .navlink { white-space: nowrap; padding: 9px 12px; flex: none; }
    .topbar { padding: 14px 16px; }
    .content { padding: 20px 16px 56px; }
    .g-3, .g-2, .g-wide, .g-form { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .g-4 { grid-template-columns: 1fr; }
    .metric .val { font-size: 28px; }
    .logincard { padding: 26px 20px; }
    .split .seg { padding: 0 10px; font-size: 13px; }
}
