:root {
    --bg: #071021;
    --bg-deep: #050b17;
    --sapphire: #0b132b;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-solid: #101a31;
    --panel-soft: rgba(30, 41, 59, 0.56);
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(129, 140, 248, 0.28);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --indigo: #6366f1;
    --indigo-bright: #818cf8;
    --cyan: #22d3ee;
    --green: #34d399;
    --red: #fb7185;
    --amber: #fbbf24;
    --shadow-xl: 0 30px 90px rgba(0, 0, 0, 0.38);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg-deep); }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.app-body {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(79, 70, 229, 0.12), transparent 28%),
        radial-gradient(circle at 85% 90%, rgba(8, 145, 178, 0.08), transparent 26%),
        var(--bg-deep);
    font-size: 14px;
    font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1, "cv04" 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.auth-page { overflow-x: hidden; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(420px, 0.75fr); }
.auth-showcase { position: relative; isolation: isolate; overflow: hidden; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; padding: 42px 52px 38px; background: linear-gradient(145deg, #071127 0%, #0b1632 48%, #081326 100%); border-right: 1px solid var(--border); }
.showcase-grid { position: absolute; inset: 0; z-index: -3; opacity: .32; background-image: linear-gradient(rgba(148,163,184,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(148,163,184,.055) 1px,transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to bottom, black 0%, rgba(0,0,0,.8) 65%, transparent 100%); }
.showcase-glow { position: absolute; z-index: -2; border-radius: 999px; filter: blur(2px); pointer-events: none; }
.glow-one { width: 520px; height: 520px; left: -190px; top: 16%; background: radial-gradient(circle, rgba(99,102,241,.2), transparent 68%); }
.glow-two { width: 430px; height: 430px; right: -120px; bottom: 4%; background: radial-gradient(circle, rgba(34,211,238,.11), transparent 68%); }
.showcase-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-mark { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; color: #c7d2fe; border: 1px solid rgba(129,140,248,.35); background: linear-gradient(145deg, rgba(99,102,241,.28), rgba(15,23,42,.85)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 30px rgba(49,46,129,.22); }
.brand-mark svg { width: 27px; height: 27px; }
.brand-mark-small { width: 42px; height: 42px; border-radius: 13px; }
.brand-mark-small svg { width: 23px; height: 23px; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 16px; letter-spacing: -.01em; }
.brand-copy span { color: var(--muted); font-size: 12px; }
.secure-chip, .status-pill, .extension-badge { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; white-space: nowrap; }
.secure-chip { gap: 8px; padding: 8px 12px; color: #cbd5e1; font-size: 11px; font-weight: 650; border: 1px solid var(--border); background: rgba(15,23,42,.5); backdrop-filter: blur(12px); }
.secure-chip i, .live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52,211,153,.11); }
.showcase-copy { max-width: 760px; margin: 7vh 0; }
.eyebrow { margin: 0 0 14px; color: #a5b4fc; font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.showcase-copy h1 { max-width: 720px; margin: 0; font-size: clamp(42px, 5.2vw, 76px); line-height: .99; letter-spacing: -.055em; font-weight: 650; background: linear-gradient(110deg, #fff 0%, #dbeafe 48%, #a5b4fc 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.showcase-description { max-width: 650px; margin: 26px 0 0; color: #a9b5c8; font-size: 16px; line-height: 1.75; }
.showcase-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
.showcase-metrics article { min-height: 128px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(30,41,59,.48), rgba(15,23,42,.25)); box-shadow: inset 0 1px 0 rgba(255,255,255,.025); backdrop-filter: blur(12px); }
.showcase-metrics span, .showcase-metrics small { display: block; color: var(--muted); font-size: 11px; }
.showcase-metrics strong { display: block; margin: 14px 0 8px; font-size: 21px; letter-spacing: -.025em; }
.showcase-footer { position: relative; z-index: 1; }
.system-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.system-strip-label { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.system-strip-items { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.extension-badge { gap: 7px; padding: 6px 9px; border: 1px solid var(--border); background: rgba(15,23,42,.48); color: #aebbd0; font-size: 10px; }
.extension-badge i { width: 5px; height: 5px; border-radius: 50%; }
.extension-badge.is-ready i { background: var(--green); }
.extension-badge.is-missing { color: #fda4af; border-color: rgba(251,113,133,.22); }
.extension-badge.is-missing i { background: var(--red); }

.auth-panel { display: grid; place-items: center; min-height: 100vh; padding: 48px clamp(30px,4vw,68px); background: rgba(6,12,25,.82); }
.auth-panel-inner { width: min(100%, 430px); }
.mobile-brand { display: none; align-items: center; gap: 13px; margin-bottom: 46px; }
.auth-heading { margin-bottom: 30px; }
.auth-kicker { display: inline-flex; margin-bottom: 13px; color: #a5b4fc; font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.auth-heading h2 { margin: 0; font-size: 33px; line-height: 1.15; letter-spacing: -.035em; font-weight: 650; }
.auth-heading p { margin: 13px 0 0; color: var(--muted); line-height: 1.65; }
.auth-form { display: grid; gap: 22px; margin-top: 26px; }
.field-group { display: grid; gap: 9px; }
.field-group > span { color: #d7dfeb; font-size: 12px; font-weight: 650; }
.field-group small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.field-input, .input-shell { width: 100%; border: 1px solid rgba(148,163,184,.16); border-radius: var(--radius-md); background: rgba(15,23,42,.62); color: var(--text); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease; }
.field-input { height: 48px; padding: 0 14px; outline: 0; }
.input-shell { display: flex; align-items: center; min-height: 54px; overflow: hidden; }
.input-shell:focus-within, .field-input:focus { border-color: rgba(129,140,248,.65); background: rgba(17,27,49,.92); box-shadow: 0 0 0 4px rgba(99,102,241,.11), 0 12px 32px rgba(0,0,0,.14); }
.input-shell > svg { flex: 0 0 auto; width: 19px; height: 19px; margin-left: 16px; color: #71809a; }
.input-shell input { min-width: 0; flex: 1; height: 52px; border: 0; outline: 0; padding: 0 14px; background: transparent; color: var(--text); }
.input-shell input::placeholder, .field-input::placeholder { color: #58667d; }
.input-shell.has-error { border-color: rgba(251,113,133,.56); box-shadow: 0 0 0 3px rgba(251,113,133,.08); }
.field-error { color: #fda4af !important; }
.password-toggle { flex: 0 0 auto; width: 52px; height: 52px; display: grid; place-items: center; border: 0; background: transparent; color: #71809a; cursor: pointer; transition: color .2s ease; }
.password-toggle:hover { color: #c7d2fe; }
.password-toggle svg { width: 19px; height: 19px; }
.password-toggle .eye-closed { display: none; }
.password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: block; }
.security-note { display: flex; align-items: flex-start; gap: 10px; margin-top: -3px; color: #8290a6; font-size: 10.5px; line-height: 1.5; }
.security-note svg { flex: 0 0 auto; width: 17px; height: 17px; color: #818cf8; }
.primary-button { min-height: 49px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid rgba(165,180,252,.22); border-radius: var(--radius-md); padding: 0 20px; background: linear-gradient(135deg, #5b5ee8, #4f46e5); color: white; font-size: 12px; font-weight: 750; letter-spacing: .015em; cursor: pointer; box-shadow: 0 14px 34px rgba(79,70,229,.25), inset 0 1px 0 rgba(255,255,255,.18); transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 18px 38px rgba(79,70,229,.34), inset 0 1px 0 rgba(255,255,255,.2); filter: brightness(1.04); }
.primary-button:focus-visible { outline: 3px solid rgba(129,140,248,.28); outline-offset: 3px; }
.primary-button:disabled { cursor: wait; opacity: .8; transform: none; }
.auth-submit { width: 100%; min-height: 54px; margin-top: 2px; }
.auth-submit > svg { width: 18px; height: 18px; margin-left: auto; }
.button-loading { display: none; align-items: center; gap: 9px; }
.button-loading i { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.auth-submit.is-loading .button-label, .auth-submit.is-loading > svg { display: none; }
.auth-submit.is-loading .button-loading { display: inline-flex; }
.auth-meta { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 34px; color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.auth-meta i { width: 3px; height: 3px; border-radius: 50%; background: #475569; }

.alert { display: flex; align-items: flex-start; gap: 11px; border-radius: var(--radius-md); padding: 13px 14px; font-size: 11px; line-height: 1.55; transition: opacity .28s ease, transform .28s ease, max-height .28s ease, margin .28s ease, padding .28s ease; }
.alert svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
.alert-error { color: #fecdd3; border: 1px solid rgba(251,113,133,.25); background: rgba(136,19,55,.14); }
.alert-success { color: #a7f3d0; border: 1px solid rgba(52,211,153,.23); background: rgba(6,95,70,.14); }
.alert.is-leaving { opacity: 0; transform: translateY(-6px); }

.glass-card { border: 1px solid var(--border); border-radius: var(--radius-xl); background: linear-gradient(145deg, rgba(20,31,56,.88), rgba(10,18,35,.9)); box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,.035); backdrop-filter: blur(20px); }
.section-heading { display: flex; align-items: flex-start; gap: 14px; }
.section-heading > span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(129,140,248,.28); border-radius: 12px; background: rgba(99,102,241,.1); color: #a5b4fc; font-size: 11px; font-weight: 750; }
.section-heading h2 { margin: 1px 0 4px; font-size: 17px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.success-icon { width: 66px; height: 66px; display: grid; place-items: center; border: 1px solid rgba(52,211,153,.3); border-radius: 20px; color: #6ee7b7; background: rgba(16,185,129,.1); }
.success-icon svg { width: 34px; height: 34px; }
.status-pill { padding: 6px 10px; border: 1px solid; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.status-pill-info { color: #c7d2fe; border-color: rgba(129,140,248,.25); background: rgba(79,70,229,.13); }
.status-pill-neutral { color: #aebbd0; border-color: var(--border); background: rgba(51,65,85,.22); }

.dashboard-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 23px 17px 18px; border-right: 1px solid var(--border); background: rgba(7,15,31,.93); backdrop-filter: blur(22px); z-index: 50; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.sidebar-brand > div:last-child { display: flex; flex-direction: column; gap: 3px; }
.sidebar-brand strong { font-size: 14px; }
.sidebar-brand span { color: var(--muted); font-size: 10px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-caption { margin: 23px 11px 8px; color: #526078; font-size: 9px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.nav-item { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 1px solid transparent; border-radius: 12px; color: #8290a6; font-size: 11px; font-weight: 600; transition: .2s ease; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item.active { color: #e0e7ff; border-color: rgba(129,140,248,.18); background: linear-gradient(90deg,rgba(79,70,229,.19),rgba(79,70,229,.05)); box-shadow: inset 3px 0 0 #6366f1; }
.nav-item:not(.disabled):hover { color: white; background: rgba(30,41,59,.38); }
.nav-item.disabled { cursor: default; opacity: .62; }
.nav-code { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(51,65,85,.42); color: #94a3b8; font-size: 8px; font-weight: 800; }
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border); }
.user-card { display: grid; grid-template-columns: 36px minmax(0,1fr) 34px; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(129,140,248,.2); border-radius: 11px; background: rgba(79,70,229,.15); color: #c7d2fe; font-size: 11px; font-weight: 800; }
.user-card strong, .user-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card strong { font-size: 10px; }
.user-card span { margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: capitalize; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: rgba(30,41,59,.32); color: #8795aa; cursor: pointer; transition: .2s ease; }
.icon-button:hover { color: white; border-color: rgba(129,140,248,.25); background: rgba(79,70,229,.13); }
.icon-button svg { width: 17px; height: 17px; }
.dashboard-main { min-width: 0; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; border-bottom: 1px solid var(--border); background: rgba(5,11,23,.78); backdrop-filter: blur(20px); }
.topbar-context { display: flex; flex-direction: column; gap: 2px; }
.topbar-context span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.topbar-context strong { font-size: 11px; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.live-indicator { display: flex; align-items: center; gap: 8px; color: #a7f3d0; font-size: 10px; font-weight: 650; }
.mobile-menu-button { display: none; }
.dashboard-content { padding: 34px; }
.dashboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding: 30px 32px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: linear-gradient(115deg,rgba(79,70,229,.16),rgba(15,23,42,.5) 46%,rgba(8,145,178,.08)); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.dashboard-hero h1 { margin: 0; font-size: clamp(27px,3vw,42px); letter-spacing: -.04em; }
.dashboard-hero p:not(.eyebrow) { max-width: 720px; margin: 12px 0 0; color: var(--muted); line-height: 1.65; }
.hero-date { min-width: 190px; padding-left: 24px; border-left: 1px solid var(--border); }
.hero-date span,.hero-date small { display: block; color: var(--muted); font-size: 9px; }
.hero-date strong { display: block; margin: 7px 0; font-size: 15px; text-transform: capitalize; }
.summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.summary-card { display: flex; align-items: center; gap: 15px; min-height: 112px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(15,23,42,.58); }
.summary-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(129,140,248,.2); border-radius: 13px; color: #a5b4fc; background: rgba(79,70,229,.1); }
.summary-icon svg { width: 22px; height: 22px; }
.summary-card span,.summary-card small { display: block; color: var(--muted); font-size: 9px; }
.summary-card strong { display: block; margin: 6px 0; font-size: 22px; letter-spacing: -.03em; }
.content-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 34px 0 15px; }
.content-heading > div > span { color: #818cf8; font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.content-heading h2 { margin: 5px 0 0; font-size: 20px; }
.module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.module-card { min-height: 220px; display: flex; flex-direction: column; padding: 21px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(145deg,rgba(20,31,56,.72),rgba(10,18,35,.7)); transition: transform .22s ease,border-color .22s ease,box-shadow .22s ease; }
.module-card:hover { transform: translateY(-3px); border-color: rgba(129,140,248,.28); box-shadow: 0 18px 45px rgba(0,0,0,.18); }
.module-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.module-code { width: 44px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(79,70,229,.13); color: #a5b4fc; font-size: 9px; font-weight: 850; letter-spacing: .05em; }
.module-card h3 { margin: 27px 0 9px; font-size: 15px; }
.module-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.module-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; color: #65748b; font-size: 9px; border-top: 1px solid var(--border); }
.module-card-footer svg { width: 16px; height: 16px; }
.readiness-panel { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; margin-top: 18px; padding: 30px 32px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: rgba(15,23,42,.5); }
.readiness-panel h2 { margin: 0; font-size: 20px; }
.readiness-panel p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.readiness-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; align-content: center; }
.readiness-list span { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 11px; color: #aebbd0; font-size: 9px; }
.readiness-list i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52,211,153,.08); }
.sidebar-backdrop { display: none; }
.error-page { display: grid; place-items: center; padding: 24px; }
.error-shell { width: min(100%,540px); text-align: center; padding: 48px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: rgba(15,23,42,.7); box-shadow: var(--shadow-xl); }
.error-code { color: #818cf8; font-size: 72px; font-weight: 800; letter-spacing: -.08em; }
.error-shell h1 { margin: 8px 0 12px; font-size: 25px; }
.error-shell p { margin: 0 0 25px; color: var(--muted); line-height: 1.65; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
    .auth-shell { grid-template-columns: minmax(0,1.15fr) minmax(400px,.85fr); }
    .auth-showcase { padding: 34px; }
    .showcase-copy h1 { font-size: clamp(40px,5vw,60px); }
    .showcase-metrics { grid-template-columns: 1fr; max-width: 450px; }
    .showcase-metrics article { min-height: 0; }
    .showcase-metrics small { display: none; }
    .system-strip { align-items: flex-start; flex-direction: column; }
    .system-strip-items { justify-content: flex-start; }
    .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
    .auth-shell { display: block; }
    .auth-showcase { display: none; }
    .auth-panel { min-height: 100vh; padding: 36px 22px; }
    .mobile-brand { display: flex; }
    .dashboard-shell { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 24px 0 70px rgba(0,0,0,.42); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; display: block; background: rgba(2,6,23,.7); opacity: 0; visibility: hidden; transition: .25s ease; backdrop-filter: blur(3px); }
    .sidebar-backdrop.is-visible { opacity: 1; visibility: visible; }
    body.sidebar-open { overflow: hidden; }
    .mobile-menu-button { display: inline-grid; }
    .topbar { padding: 0 20px; }
    .dashboard-content { padding: 22px; }
    .readiness-panel { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
    .auth-heading h2 { font-size: 28px; }
    .dashboard-content { padding: 16px; }
    .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 24px; }
    .hero-date { width: 100%; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--border); }
    .summary-grid,.module-grid,.readiness-list { grid-template-columns: 1fr; }
    .content-heading { align-items: flex-start; flex-direction: column; }
    .topbar-context { display: none; }
    .readiness-panel { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================================================================
   Selector global de apariencia
   ================================================================ */
.theme-ready *,
.theme-ready *::before,
.theme-ready *::after {
    transition-property: background-color, border-color, color, box-shadow, opacity;
    transition-duration: .18s;
    transition-timing-function: ease;
}

.theme-toggle {
    position: relative;
    z-index: 60;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 13px;
    background: rgba(15, 23, 42, .72);
    color: var(--muted-strong);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 28px rgba(0,0,0,.12);
    backdrop-filter: blur(16px);
    cursor: pointer;
}
.theme-toggle:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(30, 41, 59, .9);
}
.theme-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(99,102,241,.16), inset 0 1px 0 rgba(255,255,255,.05);
}
.theme-toggle-floating {
    position: fixed;
    top: 20px;
    right: 20px;
}
.theme-toggle-compact {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 11px;
    box-shadow: none;
}
.theme-toggle-compact .theme-toggle-label { display: none; }
.theme-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.theme-icon-moon { display: none; }
.theme-toggle-label { font-size: 10px; font-weight: 700; white-space: nowrap; }

/* ================================================================
   Tema claro premium
   ================================================================ */
html[data-theme="light"] {
    --bg: #eef3fb;
    --bg-deep: #f7f9fd;
    --sapphire: #0b132b;
    --panel: rgba(255, 255, 255, .9);
    --panel-solid: #ffffff;
    --panel-soft: rgba(241, 245, 249, .9);
    --border: rgba(15, 23, 42, .11);
    --border-strong: rgba(79, 70, 229, .3);
    --text: #13213a;
    --muted: #64748b;
    --muted-strong: #334155;
    --shadow-xl: 0 30px 80px rgba(15, 23, 42, .13);
    background: var(--bg-deep);
}
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: block; }
html[data-theme="light"] .app-body {
    background:
        radial-gradient(circle at 12% 8%, rgba(99,102,241,.11), transparent 28%),
        radial-gradient(circle at 88% 92%, rgba(14,165,233,.09), transparent 28%),
        var(--bg-deep);
}
html[data-theme="light"] .theme-toggle {
    background: rgba(255,255,255,.88);
    color: #475569;
    box-shadow: 0 10px 30px rgba(15,23,42,.1), inset 0 1px 0 rgba(255,255,255,.8);
}
html[data-theme="light"] .theme-toggle:hover {
    color: #312e81;
    background: #fff;
}

/* El panel de marca conserva profundidad institucional en modo claro. */
html[data-theme="light"] .auth-showcase {
    background: linear-gradient(145deg, #0b1632 0%, #11224a 48%, #0a1830 100%);
    border-right-color: rgba(15,23,42,.12);
    color: #f8fafc;
}
html[data-theme="light"] .auth-showcase .brand-copy span,
html[data-theme="light"] .auth-showcase .system-strip-label,
html[data-theme="light"] .auth-showcase .showcase-metrics span,
html[data-theme="light"] .auth-showcase .showcase-metrics small { color: #aab8cc; }
html[data-theme="light"] .auth-showcase .showcase-description { color: #b7c4d6; }
html[data-theme="light"] .auth-showcase .showcase-metrics article {
    background: linear-gradient(145deg, rgba(30,41,59,.58), rgba(15,23,42,.34));
    border-color: rgba(203,213,225,.14);
}
html[data-theme="light"] .auth-showcase .secure-chip,
html[data-theme="light"] .auth-showcase .extension-badge {
    background: rgba(15,23,42,.55);
    border-color: rgba(203,213,225,.14);
    color: #d7e0ed;
}
html[data-theme="light"] .auth-panel { background: rgba(248,250,252,.9); }
html[data-theme="light"] .auth-heading h2,
html[data-theme="light"] .field-group > span { color: #1e293b; }
html[data-theme="light"] .auth-kicker,
html[data-theme="light"] .eyebrow { color: #4f46e5; }
html[data-theme="light"] .field-input,
html[data-theme="light"] .input-shell {
    background: rgba(255,255,255,.94);
    border-color: rgba(15,23,42,.13);
    color: #13213a;
    box-shadow: 0 8px 24px rgba(15,23,42,.025);
}
html[data-theme="light"] .field-input:focus,
html[data-theme="light"] .input-shell:focus-within {
    background: #fff;
    border-color: rgba(79,70,229,.56);
    box-shadow: 0 0 0 4px rgba(79,70,229,.1), 0 14px 30px rgba(15,23,42,.07);
}
html[data-theme="light"] .input-shell input { color: #13213a; }
html[data-theme="light"] .input-shell input::placeholder,
html[data-theme="light"] .field-input::placeholder { color: #94a3b8; }
html[data-theme="light"] .input-shell > svg,
html[data-theme="light"] .password-toggle { color: #64748b; }
html[data-theme="light"] .password-toggle:hover { color: #4338ca; }
html[data-theme="light"] .security-note { color: #64748b; }
html[data-theme="light"] .auth-meta { color: #64748b; }

html[data-theme="light"] .glass-card,
html[data-theme="light"] .summary-card,
html[data-theme="light"] .module-card,
html[data-theme="light"] .readiness-panel,
html[data-theme="light"] .error-shell {
    background: rgba(255,255,255,.86);
    border-color: rgba(15,23,42,.1);
    box-shadow: 0 14px 40px rgba(15,23,42,.055), inset 0 1px 0 rgba(255,255,255,.88);
}
html[data-theme="light"] .dashboard-hero {
    background: linear-gradient(115deg,rgba(99,102,241,.1),rgba(255,255,255,.82) 48%,rgba(14,165,233,.08));
    border-color: rgba(15,23,42,.1);
    box-shadow: 0 16px 44px rgba(15,23,42,.05), inset 0 1px 0 #fff;
}
html[data-theme="light"] .module-card {
    background: linear-gradient(145deg,rgba(255,255,255,.96),rgba(241,245,249,.86));
}
html[data-theme="light"] .module-card:hover {
    border-color: rgba(79,70,229,.28);
    box-shadow: 0 20px 48px rgba(15,23,42,.09);
}
html[data-theme="light"] .module-code,
html[data-theme="light"] .summary-icon,
html[data-theme="light"] .user-avatar {
    background: rgba(79,70,229,.09);
    color: #4f46e5;
    border-color: rgba(79,70,229,.16);
}
html[data-theme="light"] .readiness-list span { color: #475569; background: rgba(248,250,252,.75); }
html[data-theme="light"] .module-card-footer { color: #64748b; }
html[data-theme="light"] .content-heading > div > span,
html[data-theme="light"] .error-code { color: #4f46e5; }
html[data-theme="light"] .status-pill-neutral { color: #475569; background: rgba(100,116,139,.08); }

html[data-theme="light"] .topbar {
    background: rgba(248,250,252,.84);
    border-bottom-color: rgba(15,23,42,.1);
    box-shadow: 0 6px 24px rgba(15,23,42,.035);
}
html[data-theme="light"] .icon-button {
    background: rgba(255,255,255,.84);
    color: #64748b;
    border-color: rgba(15,23,42,.1);
}
html[data-theme="light"] .icon-button:hover {
    background: rgba(79,70,229,.08);
    color: #4338ca;
    border-color: rgba(79,70,229,.2);
}
html[data-theme="light"] .live-indicator { color: #047857; }

/* La barra lateral permanece zafiro para conservar jerarquía y contraste. */
html[data-theme="light"] .sidebar {
    background: linear-gradient(180deg,#0b132b 0%,#0a1428 100%);
    color: #f8fafc;
    border-right-color: rgba(15,23,42,.16);
}
html[data-theme="light"] .sidebar .sidebar-brand span,
html[data-theme="light"] .sidebar .nav-caption,
html[data-theme="light"] .sidebar .user-card span { color: #94a3b8; }
html[data-theme="light"] .sidebar .nav-item { color: #8fa0b8; }
html[data-theme="light"] .sidebar .nav-item.active { color: #e0e7ff; }
html[data-theme="light"] .sidebar .nav-item:not(.disabled):hover { color: #fff; }
html[data-theme="light"] .sidebar .icon-button {
    background: rgba(30,41,59,.42);
    color: #94a3b8;
    border-color: rgba(148,163,184,.14);
}

html[data-theme="light"] .alert-success {
    background: rgba(5,150,105,.08);
    border-color: rgba(5,150,105,.2);
    color: #047857;
}
html[data-theme="light"] .alert-error {
    background: rgba(225,29,72,.07);
    border-color: rgba(225,29,72,.18);
    color: #be123c;
}

@media (max-width: 640px) {
    .theme-toggle-floating {
        top: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
    }
    .theme-toggle-floating .theme-toggle-label { display: none; }
    .topbar-actions { gap: 8px; }
    .live-indicator { display: none; }
}

/* ==================================================================
   SRI Control v0.3.0 — interfaz operativa, superficies y movimiento
   ================================================================== */
:root {
    --surface: rgba(13, 24, 44, .78);
    --surface-raised: rgba(18, 31, 55, .92);
    --surface-subtle: rgba(30, 41, 59, .42);
    --table-line: rgba(148, 163, 184, .11);
    --violet: #a78bfa;
    --blue: #60a5fa;
    --emerald: #34d399;
    --rose: #fb7185;
}

.dashboard-page { overflow-x: hidden; }
.dashboard-content { max-width: 1640px; width: 100%; margin: 0 auto; }
.premium-surface,
.data-panel,
.import-panel,
.filter-panel,
.query-panel,
.validation-result,
.form-panel,
.info-panel,
.process-panel,
.document-detail {
    border: 1px solid var(--border);
    background: linear-gradient(145deg, rgba(17, 29, 52, .84), rgba(8, 17, 33, .82));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 24px 60px rgba(0,0,0,.12);
    backdrop-filter: blur(22px);
}

/* Barra lateral adaptable al tema */
.sidebar { isolation: isolate; overflow: hidden; }
.sidebar-aurora {
    position: absolute; inset: -130px -180px auto -170px; z-index: -1;
    height: 390px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(99,102,241,.22), transparent 67%);
    animation: sidebarAurora 12s ease-in-out infinite alternate;
}
.sidebar-security { display: flex; align-items: center; gap: 8px; margin: 0 4px 15px; color: var(--muted); font-size: 9px; }
.sidebar-security i { width: 6px; height: 6px; border-radius: 99px; background: var(--green); box-shadow: 0 0 0 4px rgba(52,211,153,.08), 0 0 16px rgba(52,211,153,.55); }
.nav-item { position: relative; overflow: hidden; }
.nav-item::after { content: ""; position: absolute; inset: 0; opacity: 0; transform: translateX(-65%); background: linear-gradient(105deg, transparent, rgba(255,255,255,.055), transparent); transition: transform .5s ease, opacity .25s ease; pointer-events: none; }
.nav-item:not(.disabled):hover::after { opacity: 1; transform: translateX(65%); }
.nav-item small { margin-left: auto; color: var(--muted); font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

/* Revelado progresivo */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.75,.2,1), transform .7s cubic-bezier(.2,.75,.2,1); transition-delay: var(--reveal-delay, 0ms); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* Hero */
.dashboard-hero { position: relative; isolation: isolate; overflow: hidden; align-items: center; min-height: 250px; padding: 38px 40px; }
.hero-copy { position: relative; z-index: 2; max-width: 850px; }
.hero-copy h1 { background: linear-gradient(110deg, #fff, #dbeafe 54%, #a5b4fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 25px; }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }
.secondary-button {
    min-height: 49px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 0 19px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: rgba(30,41,59,.44); color: var(--muted-strong); font-size: 12px; font-weight: 700;
    cursor: pointer; transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.secondary-button:hover { transform: translateY(-1px); color: var(--text); border-color: var(--border-strong); background: rgba(51,65,85,.52); box-shadow: 0 14px 30px rgba(0,0,0,.12); }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.hero-orb-one { width: 410px; height: 410px; right: 4%; top: -245px; background: radial-gradient(circle, rgba(99,102,241,.32), transparent 68%); animation: heroFloat 10s ease-in-out infinite; }
.hero-orb-two { width: 300px; height: 300px; right: 24%; bottom: -225px; background: radial-gradient(circle, rgba(34,211,238,.19), transparent 69%); animation: heroFloat 13s ease-in-out infinite reverse; }
.hero-period-card { position: relative; z-index: 2; flex: 0 0 245px; padding: 24px; border: 1px solid rgba(129,140,248,.18); border-radius: 20px; background: rgba(8,16,32,.42); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); backdrop-filter: blur(15px); }
.hero-period-card > span, .hero-period-card > small { display: block; color: var(--muted); font-size: 9px; }
.hero-period-card > strong { display: block; margin: 9px 0 7px; font-size: 17px; text-transform: capitalize; }
.hero-period-line { display: flex; align-items: center; gap: 8px; margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--border); color: #a7f3d0; font-size: 9px; }
.hero-period-line i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52,211,153,.09); }

/* Métricas con color */
.summary-card { position: relative; isolation: isolate; overflow: hidden; min-height: 125px; transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s ease, border-color .28s ease; }
.summary-card:hover { transform: translateY(-5px); box-shadow: 0 24px 50px rgba(0,0,0,.18); border-color: color-mix(in srgb, var(--card-accent, #818cf8) 36%, transparent); }
.summary-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at var(--mx, 85%) var(--my, 10%), color-mix(in srgb, var(--card-accent, #818cf8) 14%, transparent), transparent 45%); opacity: .85; }
.summary-card-indigo { --card-accent: #818cf8; }
.summary-card-emerald { --card-accent: #34d399; }
.summary-card-cyan { --card-accent: #22d3ee; }
.summary-card-amber { --card-accent: #fbbf24; }
.summary-glow { position: absolute; width: 150px; height: 150px; right: -70px; top: -75px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--card-accent) 28%, transparent), transparent 68%); animation: pulseGlow 5.5s ease-in-out infinite; }
.summary-card .summary-icon { color: var(--card-accent); border-color: color-mix(in srgb, var(--card-accent) 28%, transparent); background: color-mix(in srgb, var(--card-accent) 11%, transparent); box-shadow: 0 10px 28px color-mix(in srgb, var(--card-accent) 10%, transparent); }
.summary-card strong { font-size: 24px; }

/* Tarjetas de módulos */
.module-card { position: relative; isolation: isolate; overflow: hidden; min-height: 242px; transform-style: preserve-3d; --module-accent: #818cf8; }
.module-card[data-tone="violet"], .module-card-violet { --module-accent: #a78bfa; }
.module-card[data-tone="cyan"], .module-card-cyan { --module-accent: #22d3ee; }
.module-card[data-tone="emerald"], .module-card-emerald { --module-accent: #34d399; }
.module-card[data-tone="amber"], .module-card-amber { --module-accent: #fbbf24; }
.module-card[data-tone="rose"], .module-card-rose { --module-accent: #fb7185; }
.module-card:hover { transform: translateY(-6px) perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); border-color: color-mix(in srgb, var(--module-accent) 34%, transparent); box-shadow: 0 25px 58px rgba(0,0,0,.22), 0 0 0 1px color-mix(in srgb, var(--module-accent) 8%, transparent); }
.module-card-aurora { position: absolute; z-index: -1; width: 220px; height: 220px; right: -100px; top: -110px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--module-accent) 25%, transparent), transparent 67%); transition: transform .55s ease, opacity .35s ease; animation: moduleBreathe 7s ease-in-out infinite; }
.module-card:hover .module-card-aurora { transform: scale(1.18) translate(-10px, 12px); }
.module-card .module-code { color: var(--module-accent); border: 1px solid color-mix(in srgb, var(--module-accent) 20%, transparent); background: color-mix(in srgb, var(--module-accent) 11%, transparent); }
.module-card.is-disabled { opacity: .6; pointer-events: none; filter: saturate(.6); }
.module-card-footer { transition: color .2s ease; }
.module-card:hover .module-card-footer { color: var(--module-accent); }

/* Encabezados internos */
.page-hero { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 22px; position: relative; overflow: hidden; min-height: 150px; margin-bottom: 18px; padding: 28px 30px; border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 48px rgba(0,0,0,.1); }
.page-hero::before { content: ""; position: absolute; width: 360px; height: 360px; right: -150px; top: -230px; border-radius: 50%; background: radial-gradient(circle, var(--hero-glow, rgba(99,102,241,.22)), transparent 68%); animation: heroFloat 11s ease-in-out infinite; pointer-events: none; }
.page-hero-indigo { --hero-glow: rgba(99,102,241,.3); background: linear-gradient(120deg, rgba(79,70,229,.16), rgba(15,23,42,.52) 48%, rgba(99,102,241,.07)); }
.page-hero-violet { --hero-glow: rgba(167,139,250,.28); background: linear-gradient(120deg, rgba(124,58,237,.16), rgba(15,23,42,.52) 48%, rgba(167,139,250,.07)); }
.page-hero-cyan { --hero-glow: rgba(34,211,238,.28); background: linear-gradient(120deg, rgba(8,145,178,.16), rgba(15,23,42,.52) 48%, rgba(34,211,238,.07)); }
.page-hero-emerald { --hero-glow: rgba(52,211,153,.28); background: linear-gradient(120deg, rgba(5,150,105,.15), rgba(15,23,42,.52) 48%, rgba(52,211,153,.07)); }
.page-hero-icon { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 18px; color: #c7d2fe; background: rgba(99,102,241,.11); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 30px rgba(0,0,0,.13); }
.page-hero-cyan .page-hero-icon { color: #67e8f9; background: rgba(6,182,212,.1); border-color: rgba(34,211,238,.22); }
.page-hero-violet .page-hero-icon { color: #c4b5fd; background: rgba(139,92,246,.1); border-color: rgba(167,139,250,.22); }
.page-hero-emerald .page-hero-icon { color: #6ee7b7; background: rgba(16,185,129,.1); border-color: rgba(52,211,153,.22); }
.page-hero-icon svg { width: 28px; height: 28px; }
.page-hero h1 { margin: 0; font-size: clamp(24px,2.5vw,36px); letter-spacing: -.04em; }
.page-hero p:not(.eyebrow) { max-width: 880px; margin: 9px 0 0; color: var(--muted); line-height: 1.6; }
.page-hero-status { position: relative; z-index: 1; }

/* Paneles y formularios */
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-heading > div > span { color: #818cf8; font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.panel-heading h2 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.025em; }
.data-panel, .form-panel, .info-panel, .process-panel, .query-panel, .validation-result { border-radius: var(--radius-xl); padding: 25px; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.stack-form { display: grid; gap: 17px; }
.full-button { width: 100%; }
.primary-button:disabled { opacity: .48; cursor: not-allowed; filter: grayscale(.35); }
.compact-input { height: 42px; min-width: 0; }
.compact-button { min-height: 42px; padding-inline: 16px; }
.text-link { color: #a5b4fc; font-size: 10px; font-weight: 700; }
.text-link:hover { color: #c7d2fe; }
.secure-chip { flex: 0 0 auto; }

/* Carga de archivos */
.dropzone { position: relative; overflow: hidden; display: flex; align-items: center; gap: 13px; min-height: 92px; padding: 17px; border: 1px dashed rgba(129,140,248,.3); border-radius: 16px; background: rgba(79,70,229,.055); color: var(--muted-strong); cursor: pointer; transition: border-color .22s ease, background .22s ease, transform .22s ease, box-shadow .22s ease; }
.dropzone::after { content: ""; position: absolute; inset: -1px; opacity: 0; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.07) 48%, transparent 76%); transform: translateX(-100%); transition: opacity .2s ease; pointer-events: none; }
.dropzone:hover, .dropzone.is-dragging { transform: translateY(-2px); border-color: rgba(129,140,248,.62); background: rgba(79,70,229,.1); box-shadow: 0 15px 32px rgba(49,46,129,.13); }
.dropzone:hover::after { opacity: 1; animation: shine 1.1s ease; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone-icon { width: 43px; height: 43px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; color: #a5b4fc; background: rgba(99,102,241,.13); }
.dropzone-icon svg { width: 22px; height: 22px; }
.dropzone strong, .dropzone small { display: block; }
.dropzone strong { color: var(--text); font-size: 11px; }
.dropzone small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.dropzone-large { min-height: 155px; justify-content: center; flex-direction: column; text-align: center; }
.dropzone-large .dropzone-icon { width: 52px; height: 52px; border-radius: 16px; }
.dropzone.has-files { border-style: solid; border-color: rgba(52,211,153,.34); background: rgba(16,185,129,.07); }

/* Certificados */
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(310px,.8fr); gap: 18px; align-items: start; }
.workspace-grid-aside { display: grid; gap: 18px; }
.certificate-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.certificate-card { position: relative; overflow: hidden; padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: rgba(15,23,42,.45); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.certificate-card::before { content: ""; position: absolute; width: 170px; height: 170px; right: -85px; top: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,.18), transparent 68%); }
.certificate-card:hover { transform: translateY(-3px); border-color: rgba(129,140,248,.28); box-shadow: 0 18px 42px rgba(0,0,0,.14); }
.certificate-card.is-expired, .certificate-card.is-inactive { opacity: .65; }
.certificate-card-head { display: flex; align-items: flex-start; gap: 12px; position: relative; }
.certificate-emblem { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; color: #a5b4fc; background: rgba(99,102,241,.1); border: 1px solid rgba(129,140,248,.18); }
.certificate-emblem svg { width: 22px; height: 22px; }
.certificate-title { min-width: 0; flex: 1; }
.certificate-title strong, .certificate-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.certificate-title strong { font-size: 12px; }
.certificate-title span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.certificate-status-line { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.certificate-meta-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 11px; margin-top: 17px; }
.certificate-meta-grid div { padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: rgba(15,23,42,.28); }
.certificate-meta-grid span, .certificate-meta-grid strong { display: block; }
.certificate-meta-grid span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.certificate-meta-grid strong { margin-top: 6px; font-size: 10px; }
.certificate-fingerprint { display: block; margin-top: 14px; padding: 10px 11px; overflow: hidden; text-overflow: ellipsis; border-radius: 10px; background: rgba(2,6,23,.28); color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.certificate-progress { margin-top: 14px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(148,163,184,.11); }
.progress-track i { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: linear-gradient(90deg,#6366f1,#22d3ee); }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.mini-button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; padding: 0 11px; background: rgba(30,41,59,.34); color: var(--muted-strong); font-size: 9px; font-weight: 700; cursor: pointer; }
.mini-button:hover { color: var(--text); border-color: var(--border-strong); background: rgba(79,70,229,.1); }
.mini-button-danger { color: #fda4af; }
.mini-button-danger:hover { color: #fecdd3; border-color: rgba(251,113,133,.3); background: rgba(225,29,72,.1); }
.info-panel-icon { width: 49px; height: 49px; display: grid; place-items: center; border-radius: 15px; color: #67e8f9; background: rgba(6,182,212,.1); border: 1px solid rgba(34,211,238,.2); }
.info-panel-icon svg { width: 25px; height: 25px; }
.info-panel h3 { margin: 17px 0 9px; font-size: 16px; }
.info-panel > p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 11px; }
.info-checks { display: grid; gap: 10px; margin-top: 18px; }
.info-checks span { display: flex; align-items: center; gap: 9px; color: var(--muted-strong); font-size: 10px; }
.info-checks i { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: rgba(16,185,129,.1); color: #6ee7b7; }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 13px; background: rgba(15,23,42,.32); cursor: pointer; }
.switch-row input { width: 17px; height: 17px; accent-color: #6366f1; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 10px; }
.switch-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }

/* Firmador */
.signer-workspace { display: grid; gap: 18px; }
.process-panel { position: relative; overflow: hidden; }
.process-timeline { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 20px; }
.process-timeline div { position: relative; padding: 15px 12px; border: 1px solid var(--border); border-radius: 13px; background: rgba(15,23,42,.3); }
.process-timeline div::after { content: ""; position: absolute; right: -11px; top: 50%; width: 11px; height: 1px; background: var(--border); }
.process-timeline div:last-child::after { display: none; }
.process-timeline span, .process-timeline strong { display: block; }
.process-timeline span { color: #818cf8; font-size: 8px; font-weight: 800; }
.process-timeline strong { margin-top: 6px; font-size: 9px; }
.algorithm-selector { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.algorithm-option { position: relative; display: block; cursor: pointer; }
.algorithm-option input { position: absolute; opacity: 0; }
.algorithm-option > span { min-height: 72px; display: flex; flex-direction: column; justify-content: center; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: rgba(15,23,42,.3); }
.algorithm-option strong, .algorithm-option small { display: block; }
.algorithm-option strong { font-size: 10px; }
.algorithm-option small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.algorithm-option input:checked + span { border-color: rgba(129,140,248,.48); background: rgba(79,70,229,.11); box-shadow: 0 0 0 3px rgba(99,102,241,.07); }
.security-banner { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid rgba(52,211,153,.17); border-radius: 14px; background: rgba(16,185,129,.06); color: #a7f3d0; }
.security-banner svg { width: 20px; height: 20px; flex: 0 0 auto; }
.security-banner strong, .security-banner p { display: block; }
.security-banner strong { font-size: 10px; }
.security-banner p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

/* Importación y documentos */
.import-panel { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 15px; padding: 20px 22px; border-radius: 18px; }
.import-panel-copy { display: flex; align-items: center; gap: 14px; min-width: 260px; }
.panel-step { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #67e8f9; background: rgba(6,182,212,.1); border: 1px solid rgba(34,211,238,.18); font-size: 9px; font-weight: 800; }
.import-panel-copy strong, .import-panel-copy p { display: block; }
.import-panel-copy strong { font-size: 12px; }
.import-panel-copy p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.import-inline-form { display: flex; align-items: center; gap: 10px; }
.inline-dropzone { min-width: 245px; min-height: 62px; padding: 10px 13px; }
.inline-dropzone .dropzone-icon { width: 36px; height: 36px; }
.filter-panel { margin-bottom: 15px; padding: 14px; border-radius: 16px; }
.filter-grid { display: grid; grid-template-columns: minmax(210px,1.6fr) repeat(4,minmax(125px,.75fr)) auto auto; gap: 9px; align-items: center; }
.search-field { height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border); border-radius: 13px; background: rgba(15,23,42,.42); }
.search-field:focus-within { border-color: rgba(129,140,248,.5); box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.search-field svg { width: 17px; height: 17px; color: var(--muted); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; }
.documents-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 15px; align-items: start; }
.documents-layout.has-detail { grid-template-columns: minmax(0,1.35fr) minmax(340px,.65fr); }
.documents-panel { min-width: 0; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--table-line); border-radius: 14px; }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.data-table th { padding: 12px 14px; background: rgba(15,23,42,.42); color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-top: 1px solid var(--table-line); color: var(--muted-strong); font-size: 10px; vertical-align: middle; }
.data-table tbody tr { transition: background .18s ease; }
.data-table tbody tr:hover, .data-table tbody tr.is-selected { background: rgba(99,102,241,.055); }
.data-table td > span, .table-primary, .table-secondary { display: block; }
.data-table td > span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.table-primary, .table-secondary { color: var(--text); font-weight: 680; }
.table-primary:hover { color: #a5b4fc; }
.numeric-cell { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text) !important; white-space: nowrap; }
.row-action { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); }
.row-action:hover { color: #c7d2fe; border-color: var(--border-strong); background: rgba(99,102,241,.08); }
.row-action svg { width: 15px; height: 15px; }
.table-density { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.category-chip { display: inline-flex !important; width: max-content; margin: 0 !important; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted-strong) !important; font-size: 8px !important; font-weight: 700; text-transform: uppercase; }
.category-vivienda { color: #93c5fd !important; background: rgba(59,130,246,.08); border-color: rgba(96,165,250,.2); }
.category-salud { color: #6ee7b7 !important; background: rgba(16,185,129,.08); border-color: rgba(52,211,153,.2); }
.category-educacion { color: #c4b5fd !important; background: rgba(139,92,246,.08); border-color: rgba(167,139,250,.2); }
.category-alimentacion { color: #fde68a !important; background: rgba(245,158,11,.08); border-color: rgba(251,191,36,.2); }
.category-vestimenta { color: #f9a8d4 !important; background: rgba(236,72,153,.08); border-color: rgba(244,114,182,.2); }
.document-detail { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; border-radius: var(--radius-xl); padding: 22px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.detail-head h2 { margin: 12px 0 4px; font-size: 19px; }
.detail-head p { margin: 0; color: var(--muted); font-size: 10px; }
.detail-key { margin-top: 18px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: rgba(2,6,23,.24); }
.detail-key span, .detail-key code { display: block; }
.detail-key span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.detail-key code { margin-top: 7px; overflow: hidden; text-overflow: ellipsis; color: #c7d2fe; font-size: 9px; white-space: nowrap; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.detail-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.detail-section-title { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.detail-section-title span { color: #818cf8; font-size: 8px; text-transform: uppercase; letter-spacing: .09em; }
.detail-section-title strong { font-size: 10px; }
.category-form { display: flex; gap: 8px; }
.detail-stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-top: 17px; }
.detail-stat-grid div { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(15,23,42,.26); }
.detail-stat-grid span, .detail-stat-grid strong { display: block; }
.detail-stat-grid span { color: var(--muted); font-size: 8px; }
.detail-stat-grid strong { margin-top: 6px; font-size: 13px; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list div { display: grid; grid-template-columns: minmax(110px,.75fr) minmax(0,1.25fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--table-line); }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 8px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; color: var(--muted-strong); font-size: 9px; text-align: right; }
.detail-table-wrap { overflow: auto; border: 1px solid var(--table-line); border-radius: 12px; }
.detail-table { width: 100%; border-collapse: collapse; min-width: 360px; }
.detail-table th, .detail-table td { padding: 9px 10px; border-bottom: 1px solid var(--table-line); font-size: 8px; text-align: left; }
.detail-table th { color: var(--muted); background: rgba(15,23,42,.35); text-transform: uppercase; }
.detail-table td strong, .detail-table td span { display: block; }
.detail-table td span { margin-top: 3px; color: var(--muted); }

/* Vacíos y estados */
.empty-state { min-height: 270px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 30px; text-align: center; }
.empty-state.compact-empty { min-height: 190px; }
.empty-icon { width: 55px; height: 55px; display: grid; place-items: center; margin-bottom: 15px; border: 1px solid var(--border-strong); border-radius: 17px; color: #a5b4fc; background: rgba(99,102,241,.08); }
.empty-icon svg { width: 27px; height: 27px; }
.empty-state strong { font-size: 13px; }
.empty-state p { max-width: 430px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.status-pill-success { color: #6ee7b7; border-color: rgba(52,211,153,.25); background: rgba(16,185,129,.1); }
.status-pill-danger { color: #fda4af; border-color: rgba(251,113,133,.25); background: rgba(225,29,72,.1); }
.status-pill-info { color: #93c5fd; border-color: rgba(96,165,250,.25); background: rgba(59,130,246,.1); }

/* Validador */
.validator-grid { display: grid; grid-template-columns: minmax(330px,.82fr) minmax(0,1.18fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.query-panel, .validation-result { min-height: 470px; }
.access-key-shell { position: relative; }
.access-key-shell input { padding-right: 65px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .035em; }
.character-counter { position: absolute; right: 13px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.query-notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(15,23,42,.28); }
.query-notice svg { width: 18px; height: 18px; flex: 0 0 auto; color: #818cf8; }
.query-notice p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.validation-overview { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(210px,.6fr); gap: 14px; }
.validation-score { display: flex; align-items: center; gap: 14px; min-height: 102px; padding: 16px; border: 1px solid var(--border); border-radius: 15px; background: rgba(15,23,42,.28); }
.score-ring { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; border: 4px solid rgba(52,211,153,.18); border-top-color: #34d399; border-radius: 50%; color: #6ee7b7; }
.validation-score.is-invalid .score-ring { border-color: rgba(251,113,133,.18); border-top-color: #fb7185; color: #fda4af; }
.score-ring span { font-size: 11px; font-weight: 850; }
.validation-score small, .validation-score strong { display: block; }
.validation-score small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.validation-score strong { margin-top: 6px; font-size: 10px; line-height: 1.5; }
.validation-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.validation-meta div { padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: rgba(15,23,42,.25); }
.validation-meta span, .validation-meta strong { display: block; }
.validation-meta span { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.validation-meta strong { margin-top: 6px; font-size: 8px; overflow-wrap: anywhere; }
.result-section { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--border); }
.key-components { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 0; }
.key-components div { padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: rgba(15,23,42,.25); }
.key-components dt { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.key-components dd { margin: 6px 0 0; color: var(--muted-strong); font-size: 9px; overflow-wrap: anywhere; }
.connection-error { display: flex; gap: 12px; margin-top: 18px; padding: 14px; border: 1px solid rgba(251,113,133,.22); border-radius: 13px; background: rgba(225,29,72,.08); }
.connection-error svg { width: 20px; height: 20px; flex: 0 0 auto; color: #fb7185; }
.connection-error strong { font-size: 10px; color: #fecdd3; }
.connection-error p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.response-details { border: 1px solid var(--border); border-radius: 12px; background: rgba(2,6,23,.26); }
.response-details summary { padding: 12px; color: var(--muted-strong); font-size: 9px; font-weight: 700; cursor: pointer; }
.response-details pre { max-height: 350px; margin: 0; overflow: auto; padding: 14px; border-top: 1px solid var(--border); color: #a5b4fc; font: 9px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Tema claro integral, incluida la barra lateral */
html[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(242,246,253,.96));
    color: #17213a;
    border-right-color: rgba(15,23,42,.09);
    box-shadow: 12px 0 40px rgba(15,23,42,.035);
}
html[data-theme="light"] .sidebar-aurora { background: radial-gradient(circle, rgba(99,102,241,.13), transparent 67%); }
html[data-theme="light"] .sidebar .sidebar-brand strong,
html[data-theme="light"] .sidebar .user-card strong { color: #17213a; }
html[data-theme="light"] .sidebar .sidebar-brand span,
html[data-theme="light"] .sidebar .nav-caption,
html[data-theme="light"] .sidebar .user-card span,
html[data-theme="light"] .sidebar .sidebar-security { color: #64748b; }
html[data-theme="light"] .sidebar .nav-item { color: #52627a; }
html[data-theme="light"] .sidebar .nav-item.active {
    color: #4338ca; border-color: rgba(79,70,229,.14);
    background: linear-gradient(90deg,rgba(79,70,229,.12),rgba(99,102,241,.035));
    box-shadow: inset 3px 0 0 #6366f1, 0 8px 22px rgba(79,70,229,.045);
}
html[data-theme="light"] .sidebar .nav-item:not(.disabled):hover { color: #312e81; background: rgba(79,70,229,.065); }
html[data-theme="light"] .sidebar .nav-code { color: #64748b; background: rgba(100,116,139,.09); }
html[data-theme="light"] .sidebar .user-avatar { color: #4338ca; background: rgba(79,70,229,.09); border-color: rgba(79,70,229,.15); }
html[data-theme="light"] .sidebar .icon-button { background: rgba(255,255,255,.8); color: #64748b; border-color: rgba(15,23,42,.1); }
html[data-theme="light"] .sidebar .icon-button:hover { color: #4338ca; background: rgba(79,70,229,.08); }
html[data-theme="light"] .sidebar-footer { border-top-color: rgba(15,23,42,.08); }
html[data-theme="light"] .brand-mark-small { color: #4f46e5; background: linear-gradient(145deg,rgba(99,102,241,.14),rgba(255,255,255,.9)); border-color: rgba(79,70,229,.19); }
html[data-theme="light"] .premium-surface,
html[data-theme="light"] .data-panel,
html[data-theme="light"] .import-panel,
html[data-theme="light"] .filter-panel,
html[data-theme="light"] .query-panel,
html[data-theme="light"] .validation-result,
html[data-theme="light"] .form-panel,
html[data-theme="light"] .info-panel,
html[data-theme="light"] .process-panel,
html[data-theme="light"] .document-detail {
    background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(246,249,253,.91));
    border-color: rgba(15,23,42,.09);
    box-shadow: inset 0 1px 0 #fff, 0 18px 48px rgba(15,23,42,.055);
}
html[data-theme="light"] .hero-copy h1 { background: linear-gradient(110deg,#15213a,#334155 55%,#4f46e5); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-theme="light"] .hero-period-card,
html[data-theme="light"] .certificate-card,
html[data-theme="light"] .certificate-meta-grid div,
html[data-theme="light"] .switch-row,
html[data-theme="light"] .process-timeline div,
html[data-theme="light"] .algorithm-option > span,
html[data-theme="light"] .search-field,
html[data-theme="light"] .detail-stat-grid div,
html[data-theme="light"] .validation-score,
html[data-theme="light"] .validation-meta div,
html[data-theme="light"] .key-components div,
html[data-theme="light"] .query-notice {
    background: rgba(248,250,252,.82);
    border-color: rgba(15,23,42,.09);
}
html[data-theme="light"] .summary-card { background: linear-gradient(145deg,rgba(255,255,255,.98),rgba(245,248,253,.94)); }
html[data-theme="light"] .module-card { background: linear-gradient(145deg,rgba(255,255,255,.98),rgba(243,247,253,.94)); }
html[data-theme="light"] .secondary-button,
html[data-theme="light"] .mini-button { background: rgba(255,255,255,.85); color: #475569; border-color: rgba(15,23,42,.1); }
html[data-theme="light"] .secondary-button:hover,
html[data-theme="light"] .mini-button:hover { color: #4338ca; background: rgba(79,70,229,.07); }
html[data-theme="light"] .dropzone { background: rgba(79,70,229,.045); }
html[data-theme="light"] .dropzone:hover { background: rgba(79,70,229,.075); }
html[data-theme="light"] .data-table th { background: rgba(241,245,249,.94); color: #64748b; }
html[data-theme="light"] .data-table td { color: #475569; }
html[data-theme="light"] .data-table tbody tr:hover,
html[data-theme="light"] .data-table tbody tr.is-selected { background: rgba(79,70,229,.04); }
html[data-theme="light"] .table-primary,
html[data-theme="light"] .table-secondary,
html[data-theme="light"] .numeric-cell { color: #17213a !important; }
html[data-theme="light"] .search-field input { color: #17213a; }
html[data-theme="light"] .detail-key,
html[data-theme="light"] .certificate-fingerprint,
html[data-theme="light"] .response-details { background: rgba(241,245,249,.78); }
html[data-theme="light"] .response-details pre { color: #4338ca; }
html[data-theme="light"] .page-hero-indigo { background: linear-gradient(120deg,rgba(79,70,229,.1),rgba(255,255,255,.9) 48%,rgba(99,102,241,.04)); }
html[data-theme="light"] .page-hero-violet { background: linear-gradient(120deg,rgba(124,58,237,.09),rgba(255,255,255,.9) 48%,rgba(167,139,250,.04)); }
html[data-theme="light"] .page-hero-cyan { background: linear-gradient(120deg,rgba(8,145,178,.09),rgba(255,255,255,.9) 48%,rgba(34,211,238,.04)); }
html[data-theme="light"] .page-hero-emerald { background: linear-gradient(120deg,rgba(5,150,105,.085),rgba(255,255,255,.9) 48%,rgba(52,211,153,.04)); }
html[data-theme="light"] .connection-error strong { color: #be123c; }

/* Adaptación */
@media (max-width: 1320px) {
    .filter-grid { grid-template-columns: minmax(200px,1.5fr) repeat(3,minmax(120px,.8fr)) auto auto; }
    .filter-grid input[type="month"] { display: none; }
    .documents-layout.has-detail { grid-template-columns: minmax(0,1fr) 355px; }
    .validation-overview { grid-template-columns: 1fr; }
}
@media (max-width: 1120px) {
    .workspace-grid, .validator-grid { grid-template-columns: 1fr; }
    .certificate-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .documents-layout.has-detail { grid-template-columns: 1fr; }
    .document-detail { position: static; max-height: none; }
    .import-panel { align-items: flex-start; flex-direction: column; }
    .import-inline-form { width: 100%; }
    .inline-dropzone { flex: 1; }
    .filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .search-field { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    html[data-theme="light"] .sidebar { box-shadow: 24px 0 70px rgba(15,23,42,.16); }
    .dashboard-hero { align-items: flex-start; flex-direction: column; }
    .hero-period-card { width: 100%; flex-basis: auto; }
    .page-hero { grid-template-columns: auto minmax(0,1fr); }
    .page-hero-status { grid-column: 2; }
    .process-timeline { grid-template-columns: repeat(2,1fr); }
    .process-timeline div:nth-child(2)::after { display: none; }
}
@media (max-width: 680px) {
    .dashboard-content { padding: 15px; }
    .dashboard-hero { padding: 25px 21px; }
    .hero-actions, .hero-actions > * { width: 100%; }
    .page-hero { grid-template-columns: 1fr; padding: 22px; }
    .page-hero-status { grid-column: auto; }
    .page-hero-icon { width: 50px; height: 50px; }
    .certificate-grid { grid-template-columns: 1fr; }
    .field-row, .algorithm-selector, .validation-meta, .key-components { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: 1fr; }
    .search-field { grid-column: auto; }
    .filter-grid .clear-filter { text-align: center; }
    .import-inline-form { align-items: stretch; flex-direction: column; }
    .inline-dropzone { width: 100%; }
    .process-timeline { grid-template-columns: 1fr; }
    .process-timeline div::after { display: none; }
    .detail-stat-grid, .certificate-meta-grid { grid-template-columns: 1fr; }
    .panel-heading { align-items: flex-start; flex-direction: column; }
}

@keyframes sidebarAurora { from { transform: translate3d(-15px,-8px,0) scale(.96); } to { transform: translate3d(25px,18px,0) scale(1.07); } }
@keyframes heroFloat { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-18px,18px,0) scale(1.06); } }
@keyframes pulseGlow { 0%,100% { opacity: .6; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes moduleBreathe { 0%,100% { opacity: .7; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1 !important; transform: none !important; }
    .sidebar-aurora, .hero-orb, .page-hero::before, .summary-glow, .module-card-aurora { animation: none !important; }
    .module-card:hover { transform: translateY(-2px); }
}

/* Ajustes de componentes v0.3 */
.dashboard-two-column { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(320px,.65fr); gap: 18px; margin-top: 18px; align-items: stretch; }
.compact-readiness { margin-top: 0; grid-template-columns: 1fr; gap: 22px; }
.status-pill-warning { color: #fde68a; border-color: rgba(251,191,36,.25); background: rgba(245,158,11,.1); }
.process-timeline { grid-template-columns: repeat(5,minmax(0,1fr)); list-style: none; margin: 20px 0 0; padding: 0; }
.process-timeline > li { position: relative; min-width: 0; }
.process-timeline > li::after { content: ""; position: absolute; right: -10px; top: 28px; width: 10px; height: 1px; background: var(--border); }
.process-timeline > li:last-child::after { display: none; }
.process-timeline > li > span { display: grid; place-items: center; width: 27px; height: 27px; margin: 0 0 -8px 10px; position: relative; z-index: 2; border: 1px solid rgba(129,140,248,.22); border-radius: 9px; background: #111c34; color: #a5b4fc; }
.process-timeline > li > div { min-height: 126px; padding-top: 22px; }
.process-timeline > li > div::after { display: none; }
.process-timeline small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.algorithm-selector { margin: 0; padding: 0; border: 0; }
.algorithm-selector legend { grid-column: 1/-1; margin-bottom: 2px; color: var(--muted-strong); font-size: 10px; font-weight: 650; }
.algorithm-option > i { position: absolute; right: 9px; top: 9px; color: #818cf8; font-size: 7px; font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.security-banner > span { color: var(--muted); font-size: 9px; line-height: 1.55; }
.security-banner > span strong { color: #a7f3d0; }
.certificate-fingerprint > span, .certificate-fingerprint > code { display: block; }
.certificate-fingerprint > span { color: var(--muted); font: 7px Inter, sans-serif; text-transform: uppercase; letter-spacing: .07em; }
.certificate-fingerprint > code { margin-top: 5px; }
.character-counter.is-complete { color: #34d399; }
html[data-theme="light"] .process-timeline > li > span { background: #fff; color: #4f46e5; }
html[data-theme="light"] .security-banner > span strong { color: #047857; }
@media (max-width: 1250px) { .process-timeline { grid-template-columns: repeat(3,1fr); } .process-timeline > li:nth-child(3)::after { display:none; } }
@media (max-width: 1120px) { .dashboard-two-column { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .process-timeline { grid-template-columns: 1fr; } .process-timeline > li::after { display:none; } }

/* Recepción y autorización */
.page-hero-amber { --hero-glow: rgba(251,191,36,.28); background: linear-gradient(120deg,rgba(217,119,6,.14),rgba(15,23,42,.52) 48%,rgba(251,191,36,.06)); }
.page-hero-amber .page-hero-icon { color: #fde68a; background: rgba(245,158,11,.1); border-color: rgba(251,191,36,.22); }
.reception-grid { display: grid; grid-template-columns: minmax(340px,.82fr) minmax(0,1.18fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.reception-form-panel, .reception-result { min-height: 520px; }
.reception-result { border-radius: var(--radius-xl); padding: 25px; }
.transmission-flow { display: grid; grid-template-columns: minmax(0,1fr) 34px minmax(0,1fr) 34px minmax(0,1fr); align-items: center; gap: 0; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(15,23,42,.27); }
.flow-step { display: flex; align-items: center; gap: 10px; min-width: 0; }
.flow-step > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); background: rgba(30,41,59,.45); font-size: 8px; font-weight: 800; }
.flow-step small, .flow-step strong { display: block; }
.flow-step small { color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: .07em; }
.flow-step strong { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; color: var(--muted-strong); font-size: 9px; white-space: nowrap; }
.flow-step.is-complete > span { color: #6ee7b7; border-color: rgba(52,211,153,.25); background: rgba(16,185,129,.1); }
.flow-step.is-error > span { color: #fda4af; border-color: rgba(251,113,133,.25); background: rgba(225,29,72,.1); }
.flow-step.is-pending > span { color: #fde68a; border-color: rgba(251,191,36,.25); background: rgba(245,158,11,.1); }
.flow-step.is-idle { opacity: .55; }
.flow-line { height: 1px; background: linear-gradient(90deg,var(--border),rgba(129,140,248,.32),var(--border)); }
.transmission-meta { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin: 16px 0 0; }
.transmission-meta div { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(15,23,42,.24); }
.transmission-meta .wide { grid-column: 1/-1; }
.transmission-meta dt { color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: .07em; }
.transmission-meta dd { margin: 6px 0 0; color: var(--muted-strong); font-size: 9px; overflow-wrap: anywhere; }
.transmission-meta code { color: #c7d2fe; font-size: 9px; }
.sri-message-list { display: grid; gap: 8px; }
.sri-message-list article { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 11px; padding: 12px; border: 1px solid rgba(251,191,36,.18); border-radius: 12px; background: rgba(245,158,11,.055); }
.sri-message-list article > span { width: 42px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #fde68a; background: rgba(245,158,11,.11); font-size: 7px; font-weight: 800; }
.sri-message-list strong { font-size: 9px; }
.sri-message-list p { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.response-tabs { display: grid; gap: 8px; }
html[data-theme="light"] .page-hero-amber { background: linear-gradient(120deg,rgba(217,119,6,.085),rgba(255,255,255,.9) 48%,rgba(251,191,36,.035)); }
html[data-theme="light"] .reception-result { background: linear-gradient(145deg,rgba(255,255,255,.94),rgba(246,249,253,.91)); border-color: rgba(15,23,42,.09); box-shadow: inset 0 1px 0 #fff,0 18px 48px rgba(15,23,42,.055); }
html[data-theme="light"] .transmission-flow,
html[data-theme="light"] .transmission-meta div { background: rgba(248,250,252,.84); border-color: rgba(15,23,42,.09); }
html[data-theme="light"] .transmission-meta code { color: #4338ca; }
html[data-theme="light"] .flow-step > span { background: #fff; }
@media (max-width: 1120px) { .reception-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
    .transmission-flow { grid-template-columns: 1fr; gap: 10px; }
    .flow-line { width: 1px; height: 18px; margin-left: 17px; }
    .transmission-meta { grid-template-columns: 1fr; }
    .transmission-meta .wide { grid-column: auto; }
}

/* =========================================================
   SRI Control v0.4.0 · RUC, cédula y descargas por lote
   ========================================================= */

/* Descarga individual y por lotes */
.batch-panel-heading { align-items: center; }
.batch-download-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.batch-selection-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.batch-selection-label b { min-width: 20px; color: #c7d2fe; font-size: 11px; text-align: right; }
.batch-download-note { display: flex; align-items: center; gap: 9px; margin: -2px 18px 13px; padding: 10px 12px; border: 1px solid rgba(34,211,238,.13); border-radius: 11px; background: rgba(8,145,178,.055); color: var(--muted); font-size: 9px; line-height: 1.5; }
.batch-download-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: #67e8f9; }
.mini-button:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.select-column { width: 42px; padding-right: 2px !important; text-align: center !important; }
.table-checkbox { position: relative; display: inline-grid; width: 19px; height: 19px; place-items: center; cursor: pointer; }
.table-checkbox input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.table-checkbox span { width: 16px; height: 16px; display: block; border: 1px solid rgba(148,163,184,.3); border-radius: 5px; background: rgba(15,23,42,.6); transition: .18s ease; }
.table-checkbox input:focus-visible + span { outline: 3px solid rgba(99,102,241,.22); outline-offset: 2px; }
.table-checkbox input:checked + span { border-color: rgba(129,140,248,.85); background: linear-gradient(135deg,#6366f1,#4f46e5); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.table-checkbox input:checked + span::after { content: ""; width: 7px; height: 4px; position: absolute; left: 6px; top: 6px; border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: rotate(-45deg); }
.table-checkbox input:indeterminate + span { border-color: rgba(129,140,248,.75); background: rgba(79,70,229,.75); }
.table-checkbox input:indeterminate + span::after { content: ""; width: 7px; height: 1.5px; position: absolute; left: 6px; top: 9px; border-radius: 2px; background: #fff; }
.data-table tbody tr.is-batch-selected { background: linear-gradient(90deg,rgba(79,70,229,.085),rgba(79,70,229,.025)); }
.row-action-group { display: inline-flex; align-items: center; gap: 5px; }

/* Resumen de contribuyentes */
.taxpayer-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin: 16px 0; }
.mini-summary-card { position: relative; isolation: isolate; overflow: hidden; min-height: 98px; padding: 18px; border: 1px solid var(--border); border-radius: 17px; background: linear-gradient(145deg,rgba(20,31,56,.73),rgba(10,18,35,.72)); box-shadow: inset 0 1px 0 rgba(255,255,255,.028); }
.mini-summary-card::after { content: ""; position: absolute; z-index: -1; width: 110px; height: 110px; right: -45px; top: -55px; border-radius: 50%; background: radial-gradient(circle,rgba(251,191,36,.15),transparent 68%); }
.mini-summary-card span,.mini-summary-card small { display: block; color: var(--muted); font-size: 9px; }
.mini-summary-card strong { display: block; margin: 8px 0 6px; color: var(--text); font-size: 20px; letter-spacing: -.035em; }

/* Consola de verificación */
.taxpayer-verification-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); gap: 15px; align-items: start; }
.verification-console { padding: 21px; }
.identity-form { display: grid; gap: 17px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(15,23,42,.35); }
.identity-input-shell { position: relative; display: flex; align-items: center; width: 100%; }
.identity-input-shell > svg { position: absolute; left: 14px; z-index: 2; width: 19px; height: 19px; color: #71809a; pointer-events: none; }
.identity-input { height: 56px; padding-left: 45px; padding-right: 92px; font-size: 17px; font-weight: 680; letter-spacing: .075em; font-variant-numeric: tabular-nums; }
.identity-input.is-valid { border-color: rgba(52,211,153,.5); box-shadow: 0 0 0 4px rgba(52,211,153,.075); }
.identity-input.is-invalid { border-color: rgba(251,113,133,.5); box-shadow: 0 0 0 4px rgba(251,113,133,.075); }
.identity-counter { position: absolute; right: 14px; color: var(--muted); font-size: 9px; font-weight: 700; pointer-events: none; }
.field-group small.is-valid { color: #6ee7b7; }
.field-group small.is-invalid { color: #fda4af; }
.identity-form-actions { display: flex; align-items: center; gap: 14px; }
.identity-form-actions .primary-button svg { width: 18px; height: 18px; }
.identity-form-actions > span { max-width: 460px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.identity-result { margin-top: 17px; overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: linear-gradient(145deg,rgba(15,23,42,.58),rgba(7,15,31,.5)); }
.identity-result.is-valid { border-color: rgba(52,211,153,.2); }
.identity-result.is-invalid { border-color: rgba(251,113,133,.2); }
.identity-result-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 18px; border-bottom: 1px solid var(--border); }
.identity-result-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; }
.identity-result-mark svg { width: 24px; height: 24px; }
.identity-result.is-valid .identity-result-mark { color: #6ee7b7; border: 1px solid rgba(52,211,153,.25); background: rgba(16,185,129,.1); }
.identity-result.is-invalid .identity-result-mark { color: #fda4af; border: 1px solid rgba(251,113,133,.25); background: rgba(225,29,72,.09); }
.identity-result-head span:not(.status-pill) { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.identity-result-head h3 { margin: 4px 0 3px; font-size: 20px; letter-spacing: .045em; }
.identity-result-head p { margin: 0; color: var(--muted); font-size: 10px; }
.identity-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 16px 18px; }
.identity-check { display: flex; align-items: flex-start; gap: 9px; min-height: 57px; padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: rgba(15,23,42,.35); }
.identity-check i { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; }
.identity-check.passed i { background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.08); }
.identity-check.failed i { background: #fb7185; box-shadow: 0 0 0 4px rgba(251,113,133,.08); }
.identity-check strong,.identity-check span { display: block; }
.identity-check strong { color: var(--muted-strong); font-size: 9px; }
.identity-check span { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.repository-match-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 18px 15px; padding: 14px; border: 1px solid rgba(129,140,248,.2); border-radius: 13px; background: linear-gradient(110deg,rgba(79,70,229,.12),rgba(15,23,42,.3)); transition: .2s ease; }
.repository-match-card:hover { transform: translateY(-1px); border-color: rgba(129,140,248,.36); background: linear-gradient(110deg,rgba(79,70,229,.18),rgba(15,23,42,.34)); }
.repository-match-card span,.repository-match-card small,.repository-match-card strong { display: block; }
.repository-match-card span { color: #a5b4fc; font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.repository-match-card strong { margin: 5px 0; font-size: 11px; }
.repository-match-card small { color: var(--muted); font-size: 8.5px; }
.repository-match-card svg { width: 18px; height: 18px; flex: 0 0 auto; color: #a5b4fc; }
.repository-no-match { margin: 0 18px 15px; padding: 13px; border: 1px solid rgba(251,191,36,.16); border-radius: 12px; background: rgba(217,119,6,.06); }
.repository-no-match strong,.repository-no-match span { display: block; }
.repository-no-match strong { color: #fde68a; font-size: 9px; }
.repository-no-match span { margin-top: 5px; color: var(--muted); font-size: 8.5px; line-height: 1.5; }
.identity-disclaimer { display: flex; align-items: flex-start; gap: 10px; padding: 13px 18px 16px; border-top: 1px solid var(--border); color: var(--muted); }
.identity-disclaimer svg { width: 17px; height: 17px; flex: 0 0 auto; color: #fbbf24; }
.identity-disclaimer p { margin: 0; font-size: 8.5px; line-height: 1.55; }
.identity-disclaimer strong { color: var(--muted-strong); }

/* Historial y directorio */
.validation-history { padding: 19px; }
.validation-history-list { display: grid; gap: 7px; }
.validation-history-list > div { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.validation-history-list > div:last-child { border-bottom: 0; }
.history-dot { width: 7px; height: 7px; border-radius: 50%; }
.history-dot.valid { background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.07); }
.history-dot.invalid { background: #fb7185; box-shadow: 0 0 0 4px rgba(251,113,133,.07); }
.validation-history-list strong,.validation-history-list small { display: block; }
.validation-history-list strong { font-size: 9px; letter-spacing: .03em; }
.validation-history-list small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.taxpayer-directory-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 15px; margin-top: 15px; align-items: start; }
.taxpayer-directory-layout.has-detail { grid-template-columns: minmax(0,1fr) 370px; }
.directory-heading { gap: 18px; }
.directory-search { display: flex; align-items: center; gap: 8px; width: min(100%,470px); }
.directory-search .search-field { flex: 1; min-width: 0; }
.taxpayer-table .category-chip { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.taxpayer-detail { top: 87px; }
.taxpayer-document-list { display: grid; gap: 7px; }
.taxpayer-document-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: rgba(15,23,42,.3); transition: .18s ease; }
.taxpayer-document-list a:hover { border-color: rgba(129,140,248,.25); background: rgba(79,70,229,.07); }
.taxpayer-document-list strong,.taxpayer-document-list span { display: block; }
.taxpayer-document-list strong { font-size: 9px; }
.taxpayer-document-list span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.taxpayer-document-list b { color: var(--muted-strong); font-size: 9px; white-space: nowrap; }

/* Tema claro */
html[data-theme="light"] .batch-download-note { background: rgba(8,145,178,.045); border-color: rgba(8,145,178,.13); }
html[data-theme="light"] .batch-selection-label b { color: #4338ca; }
html[data-theme="light"] .table-checkbox span { background: #fff; border-color: rgba(15,23,42,.2); }
html[data-theme="light"] .data-table tbody tr.is-batch-selected { background: linear-gradient(90deg,rgba(79,70,229,.065),rgba(79,70,229,.015)); }
html[data-theme="light"] .mini-summary-card,
html[data-theme="light"] .identity-form,
html[data-theme="light"] .identity-result,
html[data-theme="light"] .identity-check,
html[data-theme="light"] .taxpayer-document-list a { background: linear-gradient(145deg,rgba(255,255,255,.96),rgba(246,249,253,.92)); border-color: rgba(15,23,42,.09); }
html[data-theme="light"] .mini-summary-card strong,
html[data-theme="light"] .identity-result-head h3 { color: #17213a; }
html[data-theme="light"] .identity-input { color: #17213a; background: rgba(255,255,255,.85); }
html[data-theme="light"] .repository-match-card { background: linear-gradient(110deg,rgba(79,70,229,.08),rgba(255,255,255,.88)); }
html[data-theme="light"] .repository-no-match { background: rgba(217,119,6,.045); }
html[data-theme="light"] .repository-no-match strong { color: #92400e; }
html[data-theme="light"] .identity-disclaimer strong { color: #334155; }

@media (max-width: 1260px) {
    .taxpayer-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .taxpayer-directory-layout.has-detail { grid-template-columns: minmax(0,1fr) 340px; }
}
@media (max-width: 1120px) {
    .taxpayer-verification-grid { grid-template-columns: 1fr; }
    .taxpayer-directory-layout.has-detail { grid-template-columns: 1fr; }
    .taxpayer-detail { position: static; max-height: none; }
    .directory-heading { align-items: stretch; flex-direction: column; }
    .directory-search { width: 100%; }
}
@media (max-width: 760px) {
    .batch-panel-heading { align-items: stretch; }
    .batch-download-actions { justify-content: flex-start; }
    .batch-download-actions .mini-button { flex: 1; }
    .batch-selection-label { width: 100%; }
    .batch-download-note { margin-left: 12px; margin-right: 12px; }
    .taxpayer-summary-grid { grid-template-columns: 1fr; }
    .identity-form-actions { align-items: stretch; flex-direction: column; }
    .identity-form-actions .primary-button { width: 100%; }
    .identity-check-grid { grid-template-columns: 1fr; }
    .identity-result-head { grid-template-columns: auto minmax(0,1fr); }
    .identity-result-head > .status-pill { grid-column: 2; }
    .directory-search { align-items: stretch; flex-direction: column; }
    .directory-search .secondary-button { width: 100%; }
}

/* v0.4.0 · acceso complementario a la consulta pública oficial */
.official-sri-link {
    flex: 0 0 auto;
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .official-sri-link {
        width: 100%;
        justify-content: center;
    }
}

/* v0.4.1 · Consulta pública integrada SRI */
.internal-query-badge {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.35rem;
    padding: .55rem .85rem;
    border: 1px solid color-mix(in srgb, var(--success) 28%, var(--border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--success) 8%, transparent);
    color: var(--text-secondary);
    font-size: .76rem;
    font-weight: 700;
}
.internal-query-badge i,
.official-result-footer i {
    width: .48rem;
    height: .48rem;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 .28rem rgba(52, 211, 153, .12), 0 0 1rem rgba(52, 211, 153, .5);
}
.official-sri-result {
    position: relative;
    overflow: hidden;
    margin: 1.15rem 0 1.35rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 92% 0%, rgba(79, 70, 229, .17), transparent 24rem),
        linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-alt) 91%, transparent));
    box-shadow: var(--shadow-lg);
}
.official-sri-result::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #22c55e, #38bdf8);
}
.official-result-warning::before {
    background: linear-gradient(90deg, #f59e0b, #fb7185, #8b5cf6);
}
.official-result-header,
.official-company-banner,
.official-section-title,
.official-result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.official-result-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.official-result-brand {
    display: flex;
    align-items: center;
    gap: .9rem;
}
.official-result-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(99, 102, 241, .28);
    border-radius: 1rem;
    color: #818cf8;
    background: rgba(99, 102, 241, .1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.official-result-icon svg { width: 1.45rem; height: 1.45rem; }
.official-result-brand span,
.official-section-title span,
.official-company-banner > div > span,
.official-person-card > span {
    display: block;
    margin-bottom: .25rem;
    color: var(--text-muted);
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.official-result-brand h2,
.official-section-title h3,
.official-company-banner h3 {
    margin: 0;
    color: var(--text-primary);
}
.official-result-brand h2 { font-size: 1.08rem; }
.official-result-brand p,
.official-company-banner p,
.official-empty p,
.official-error-panel p {
    margin: .28rem 0 0;
    color: var(--text-secondary);
    font-size: .79rem;
    line-height: 1.55;
}
.official-result-state {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .4rem;
}
.official-result-state small { color: var(--text-muted); font-size: .72rem; }
.official-company-banner {
    margin-top: 1rem;
    padding: 1rem 1.05rem;
    border: 1px solid color-mix(in srgb, #6366f1 24%, var(--border));
    border-radius: 1.15rem;
    background: linear-gradient(120deg, rgba(99, 102, 241, .11), rgba(56, 189, 248, .05));
}
.official-company-banner h3 { font-size: clamp(1.05rem, 2vw, 1.45rem); }
.official-status-large {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .62rem .85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .06em;
    white-space: nowrap;
}
.official-status-large i {
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
    background: #f59e0b;
}
.official-status-large.is-active {
    color: #10b981;
    border-color: rgba(16, 185, 129, .28);
    background: rgba(16, 185, 129, .08);
}
.official-status-large.is-active i {
    background: #34d399;
    box-shadow: 0 0 0 .28rem rgba(52, 211, 153, .12);
}
.official-profile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .7rem;
    margin-top: .8rem;
}
.official-profile-grid > div {
    min-height: 5rem;
    padding: .8rem .85rem;
    border: 1px solid var(--border);
    border-radius: .95rem;
    background: color-mix(in srgb, var(--surface-alt) 74%, transparent);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.official-profile-grid > div:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, .3);
    box-shadow: 0 .75rem 1.6rem rgba(15, 23, 42, .08);
}
.official-profile-grid .profile-wide { grid-column: span 2; }
.official-profile-grid span {
    display: block;
    margin-bottom: .42rem;
    color: var(--text-muted);
    font-size: .68rem;
    font-weight: 700;
}
.official-profile-grid strong {
    color: var(--text-primary);
    font-size: .82rem;
    line-height: 1.45;
}
.official-table-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.official-section-title { margin-bottom: .7rem; }
.official-section-title h3 { font-size: .98rem; }
.official-section-title > span {
    margin: 0;
    padding: .38rem .62rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-alt) 86%, transparent);
    letter-spacing: 0;
    text-transform: none;
}
.official-table th { white-space: nowrap; }
.official-table td { vertical-align: top; }
.official-address { min-width: 20rem; line-height: 1.45; }
.official-result-footer {
    margin-top: 1rem;
    padding-top: .9rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .7rem;
}
.official-result-footer span:first-child {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}
.official-error-panel,
.official-person-card,
.official-empty {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(244, 63, 94, .25);
    border-radius: 1rem;
    background: rgba(244, 63, 94, .07);
}
.official-error-panel {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
}
.official-error-panel svg { flex: 0 0 auto; width: 1.5rem; color: #fb7185; }
.official-error-panel strong,
.official-empty strong { color: var(--text-primary); }
.official-error-panel.is-neutral,
.official-empty {
    border-color: var(--border);
    background: color-mix(in srgb, var(--surface-alt) 78%, transparent);
}
.official-person-card strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.25rem;
}
.official-person-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin: 1rem 0 0;
}
.official-person-card dl > div {
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: .8rem;
}
.official-person-card dt { color: var(--text-muted); font-size: .7rem; }
.official-person-card dd { margin: .25rem 0 0; color: var(--text-primary); font-weight: 800; }

@media (max-width: 1100px) {
    .official-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .official-sri-result { padding: .9rem; border-radius: 1.1rem; }
    .official-result-header,
    .official-company-banner,
    .official-section-title,
    .official-result-footer { align-items: flex-start; flex-direction: column; }
    .official-result-state { align-items: flex-start; }
    .official-profile-grid { grid-template-columns: 1fr; }
    .official-profile-grid .profile-wide { grid-column: auto; }
    .official-person-card dl { grid-template-columns: 1fr; }
}

/* ==================================================================
   SRI Control v0.4.2 — legibilidad, color y productividad
   ================================================================== */
:root {
    --text-primary: var(--text);
    --text-secondary: var(--muted-strong);
    --text-muted: var(--muted);
    --surface-alt: var(--panel-soft);
    --success: var(--green);
}

/* Tipografía y tablas con lectura cómoda a zoom 100% */
.data-table th {
    padding: 14px 16px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
}
.data-table td {
    padding: 15px 16px;
    font-size: 11.5px;
    line-height: 1.5;
}
.data-table td > span { margin-top: 4px; font-size: 10px; }
.table-primary, .table-secondary { font-size: 11.5px; }
.panel-heading > div > span,
.content-heading > div > span { font-size: 9px; }
.panel-heading h2 { font-size: 17px; }

/* Resúmenes de color */
.taxpayer-summary-grid,
.document-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 15px 0;
}
.mini-summary-card {
    --tone: #818cf8;
    --tone-rgb: 129, 140, 248;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 122px;
    padding: 18px;
    border: 1px solid rgba(var(--tone-rgb), .24);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(var(--tone-rgb), .20), transparent 60%),
        linear-gradient(145deg, rgba(17, 29, 52, .94), rgba(8, 17, 33, .88));
    box-shadow: 0 18px 42px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255,255,255,.05);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.mini-summary-card::after {
    content: "";
    position: absolute;
    inset: auto -24px -55px auto;
    z-index: -1;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(var(--tone-rgb), .13);
    filter: blur(3px);
}
.mini-summary-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--tone-rgb), .46);
    box-shadow: 0 24px 54px rgba(0, 0, 0, .18), 0 0 32px rgba(var(--tone-rgb), .08);
}
.mini-summary-card > div { min-width: 0; }
.mini-summary-card > div > span,
.mini-summary-card small { display: block; }
.mini-summary-card > div > span { color: var(--muted-strong); font-size: 10px; font-weight: 750; }
.mini-summary-card strong { display: block; margin: 7px 0 5px; color: var(--text); font-size: 23px; line-height: 1.05; letter-spacing: -.035em; }
.mini-summary-card small { color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.mini-summary-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(var(--tone-rgb), .32);
    border-radius: 15px;
    color: var(--tone);
    background: rgba(var(--tone-rgb), .11);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 28px rgba(var(--tone-rgb), .10);
}
.mini-summary-icon svg { width: 23px; height: 23px; }
.summary-tone-indigo { --tone: #818cf8; --tone-rgb: 129, 140, 248; }
.summary-tone-emerald { --tone: #34d399; --tone-rgb: 52, 211, 153; }
.summary-tone-cyan { --tone: #22d3ee; --tone-rgb: 34, 211, 238; }
.summary-tone-amber { --tone: #fbbf24; --tone-rgb: 251, 191, 36; }
.summary-tone-rose { --tone: #fb7185; --tone-rgb: 251, 113, 133; }

/* Consulta y actividad */
.taxpayer-verification-grid { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .72fr); gap: 15px; }
.verification-console { padding: 20px; }
.identity-form { padding: 17px; border-radius: 16px; }
.identity-form-actions { flex-wrap: wrap; }
.identity-form-actions > span:not(.internal-query-badge) { display: none; }
.internal-query-badge { font-size: 10px; }
.activity-rail { padding: 19px; }
.official-history-list { display: grid; gap: 8px; }
.official-history-list > a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(15, 23, 42, .30);
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.official-history-list > a:hover { transform: translateX(3px); border-color: rgba(129,140,248,.30); background: rgba(79,70,229,.08); }
.history-avatar {
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    border: 1px solid rgba(129,140,248,.25);
    border-radius: 10px;
    color: #c7d2fe;
    background: rgba(99,102,241,.12);
    font-size: 11px;
    font-weight: 850;
}
.official-history-list strong,
.official-history-list small { display: block; }
.official-history-list strong { font-size: 10px; letter-spacing: .035em; }
.official-history-list small { margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.rail-divider { position: relative; margin: 17px 0 9px; text-align: center; }
.rail-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.rail-divider span { position: relative; padding: 0 8px; color: var(--muted); background: var(--panel-solid); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.compact-history > div { grid-template-columns: auto minmax(0, 1fr); }

/* Ficha oficial más limpia */
.official-sri-result { padding: 1.35rem; }
.official-result-header { align-items: flex-start; }
.official-result-brand h2 { font-size: 1.22rem; }
.official-result-brand p { font-size: .82rem; }
.official-header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 37px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--muted-strong);
    background: rgba(30,41,59,.48);
    font-size: 9.5px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.action-button:hover { transform: translateY(-1px); color: var(--text); border-color: rgba(129,140,248,.38); background: rgba(79,70,229,.12); }
.action-button svg { width: 15px; height: 15px; }
.company-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.company-avatar,
.taxpayer-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(129,140,248,.30);
    color: #c7d2fe;
    background: linear-gradient(145deg, rgba(99,102,241,.26), rgba(56,189,248,.10));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
    font-weight: 850;
}
.company-avatar { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }
.taxpayer-avatar { width: 37px; height: 37px; border-radius: 12px; font-size: 12px; }
.official-company-banner { padding: 1.15rem; }
.colorful-profile-grid > div {
    --profile-tone: 129, 140, 248;
    position: relative;
    overflow: hidden;
    border-color: rgba(var(--profile-tone), .22);
    background: linear-gradient(145deg, rgba(var(--profile-tone), .10), rgba(15,23,42,.30));
}
.colorful-profile-grid > div::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(var(--profile-tone), .82);
}
.profile-tone-indigo { --profile-tone: 129, 140, 248 !important; }
.profile-tone-violet { --profile-tone: 167, 139, 250 !important; }
.profile-tone-cyan { --profile-tone: 34, 211, 238 !important; }
.profile-tone-blue { --profile-tone: 96, 165, 250 !important; }
.profile-tone-emerald { --profile-tone: 52, 211, 153 !important; }
.profile-tone-amber { --profile-tone: 251, 191, 36 !important; }
.profile-tone-rose { --profile-tone: 251, 113, 133 !important; }
.profile-tone-slate { --profile-tone: 148, 163, 184 !important; }
.colorful-profile-grid span { font-size: .72rem; }
.colorful-profile-grid strong { font-size: .88rem; }

/* Tablas premium y ordenables */
.premium-table-wrap {
    --table-accent: 129, 140, 248;
    overflow: auto;
    border-color: rgba(var(--table-accent), .18);
    border-radius: 15px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.table-accent-indigo { --table-accent: 129, 140, 248; }
.table-accent-violet { --table-accent: 167, 139, 250; }
.table-accent-cyan { --table-accent: 34, 211, 238; }
.premium-data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #dbeafe;
    background:
        linear-gradient(180deg, rgba(var(--table-accent), .18), rgba(var(--table-accent), .07)),
        rgba(10, 20, 38, .97);
    border-bottom: 1px solid rgba(var(--table-accent), .20);
}
.premium-data-table th[data-sort] { padding-right: 30px; cursor: pointer; user-select: none; }
.premium-data-table th[data-sort]::after {
    content: "↕";
    position: absolute;
    right: 12px;
    color: rgba(203,213,225,.50);
    font-size: 10px;
}
.premium-data-table th.is-sort-asc::after { content: "↑"; color: rgb(var(--table-accent)); }
.premium-data-table th.is-sort-desc::after { content: "↓"; color: rgb(var(--table-accent)); }
.premium-data-table tbody tr:nth-child(even) { background: rgba(148,163,184,.022); }
.premium-data-table tbody tr:hover { background: linear-gradient(90deg, rgba(var(--table-accent), .09), rgba(var(--table-accent), .025)); }
.premium-data-table tbody tr.is-selected { background: linear-gradient(90deg, rgba(var(--table-accent), .15), rgba(var(--table-accent), .035)); box-shadow: inset 3px 0 0 rgb(var(--table-accent)); }
.establishment-number {
    display: inline-grid;
    place-items: center;
    min-width: 36px;
    min-height: 27px;
    padding: 0 7px;
    border: 1px solid rgba(34,211,238,.28);
    border-radius: 9px;
    color: #67e8f9;
    background: rgba(34,211,238,.08);
    font-size: 10px;
    font-weight: 850;
}
.role-chip,
.category-regime {
    display: inline-flex;
    padding: 6px 9px;
    border: 1px solid rgba(167,139,250,.23);
    border-radius: 999px;
    color: #c4b5fd;
    background: rgba(139,92,246,.08);
    font-size: 9px;
    font-weight: 750;
}
.address-cell { display: flex; align-items: flex-start; gap: 9px; }
.address-cell > span { flex: 1; }
.address-cell button,
.copy-cell,
.copy-inline,
.detail-key button {
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}
.address-cell button { flex: 0 0 auto; padding: 2px; }
.address-cell svg,
.copy-cell svg,
.copy-inline svg,
.detail-key button svg { width: 14px; height: 14px; }
.copy-cell { display: inline-flex; align-items: center; gap: 7px; padding: 0; font-size: inherit; font-weight: 700; }
.copy-inline { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 0; font-size: 10px; }
.copy-cell:hover,
.copy-inline:hover,
.address-cell button:hover,
.detail-key button:hover { color: #a5b4fc; }
.taxpayer-cell,
.document-type-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.taxpayer-cell > div,
.document-type-cell > div { min-width: 0; }
.document-type-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(34,211,238,.24);
    border-radius: 11px;
    color: #67e8f9;
    background: rgba(34,211,238,.08);
}
.document-type-icon svg { width: 18px; height: 18px; }
.directory-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 9px; width: min(100%, 680px); }
.directory-toolbar .directory-search { flex: 1; width: auto; }
.export-button { gap: 7px; white-space: nowrap; }
.export-button svg { width: 15px; height: 15px; }

/* Comprobantes: clasificación y filtros */
.enhanced-import-panel { border-color: rgba(34,211,238,.18); }
.category-overview {
    margin: 15px 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: linear-gradient(145deg, rgba(17,29,52,.78), rgba(8,17,33,.72));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 44px rgba(0,0,0,.10);
}
.category-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.category-overview-head span { color: var(--muted); font-size: 9px; }
.category-overview-head > div > span { color: #a5b4fc; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.category-overview-head h2 { margin: 4px 0 0; font-size: 17px; }
.category-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.category-overview-card {
    --cat-tone: 148, 163, 184;
    position: relative;
    overflow: hidden;
    min-height: 92px;
    padding: 13px;
    border: 1px solid rgba(var(--cat-tone), .20);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(var(--cat-tone), .11), rgba(15,23,42,.25));
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.category-overview-card:hover { transform: translateY(-3px); border-color: rgba(var(--cat-tone), .42); box-shadow: 0 16px 30px rgba(0,0,0,.12); }
.category-overview-card span,
.category-overview-card strong,
.category-overview-card small { display: block; }
.category-overview-card span { color: var(--muted-strong); font-size: 9px; font-weight: 750; }
.category-overview-card strong { margin: 8px 0 5px; color: var(--text); font-size: 16px; }
.category-overview-card small { color: var(--muted); font-size: 8.5px; }
.category-tone-indigo { --cat-tone: 129, 140, 248; }
.category-tone-emerald { --cat-tone: 52, 211, 153; }
.category-tone-violet { --cat-tone: 167, 139, 250; }
.category-tone-amber { --cat-tone: 251, 191, 36; }
.category-tone-rose { --cat-tone: 251, 113, 133; }
.category-tone-cyan { --cat-tone: 34, 211, 238; }
.category-tone-slate { --cat-tone: 148, 163, 184; }
.advanced-filter-panel { padding: 18px; }
.filter-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.filter-panel-title span { color: #a5b4fc; font-size: 8.5px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.filter-panel-title h2 { margin: 4px 0 0; font-size: 16px; }
.filter-count { padding: 6px 9px; border: 1px solid rgba(129,140,248,.20); border-radius: 999px; background: rgba(99,102,241,.08); letter-spacing: 0 !important; text-transform: none !important; }
.document-filter-grid { grid-template-columns: minmax(230px, 1.4fr) repeat(3, minmax(135px, .75fr)); repeat(3, minmax(125px, .65fr)) auto; align-items: end; }
.filter-search-wide { min-height: 48px; }
.compact-date-field { display: grid; gap: 6px; }
.compact-date-field > span { color: var(--muted); font-size: 8.5px; font-weight: 700; }
.filter-actions { display: flex; align-items: center; gap: 9px; min-height: 48px; }
.detail-key { align-items: center; }
.detail-key code { flex: 1; }
.colorful-detail-stats > div:nth-child(1) { border-color: rgba(129,140,248,.20); background: rgba(99,102,241,.07); }
.colorful-detail-stats > div:nth-child(2) { border-color: rgba(251,191,36,.20); background: rgba(245,158,11,.06); }
.colorful-detail-stats > div:nth-child(3) { border-color: rgba(34,211,238,.20); background: rgba(6,182,212,.06); }
.colorful-detail-stats > div:nth-child(4) { border-color: rgba(52,211,153,.20); background: rgba(16,185,129,.06); }

/* Notificación de copiado */
.ui-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 220px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 13px 15px;
    border: 1px solid rgba(52,211,153,.28);
    border-radius: 13px;
    color: #d1fae5;
    background: rgba(6, 38, 36, .94);
    box-shadow: 0 20px 55px rgba(0,0,0,.30);
    backdrop-filter: blur(18px);
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
}
.ui-toast.is-visible { opacity: 1; transform: translateY(0); }
.ui-toast i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); }

/* Tema claro */
html[data-theme="light"] .mini-summary-card,
html[data-theme="light"] .category-overview,
html[data-theme="light"] .category-overview-card,
html[data-theme="light"] .official-history-list > a {
    background:
        radial-gradient(circle at 100% 0%, rgba(var(--tone-rgb, 129,140,248), .11), transparent 58%),
        linear-gradient(145deg, rgba(255,255,255,.98), rgba(245,248,253,.96));
}
html[data-theme="light"] .mini-summary-card strong,
html[data-theme="light"] .category-overview-card strong { color: #17213a; }
html[data-theme="light"] .premium-data-table th {
    color: #334155;
    background:
        linear-gradient(180deg, rgba(var(--table-accent), .11), rgba(var(--table-accent), .045)),
        rgba(248,250,252,.98);
}
html[data-theme="light"] .premium-data-table tbody tr:nth-child(even) { background: rgba(148,163,184,.035); }
html[data-theme="light"] .premium-data-table tbody tr:hover { background: linear-gradient(90deg, rgba(var(--table-accent), .075), rgba(var(--table-accent), .02)); }
html[data-theme="light"] .colorful-profile-grid > div { background: linear-gradient(145deg, rgba(var(--profile-tone), .075), rgba(255,255,255,.94)); }
html[data-theme="light"] .official-history-list > a { background: rgba(255,255,255,.78); }
html[data-theme="light"] .rail-divider span { background: #fff; }
html[data-theme="light"] .role-chip,
html[data-theme="light"] .category-regime { color: #6d28d9; }
html[data-theme="light"] .establishment-number { color: #0e7490; }
html[data-theme="light"] .ui-toast { color: #064e3b; background: rgba(236,253,245,.97); }

@media (max-width: 1380px) {
    .document-filter-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
    .filter-search-wide { grid-column: span 2; }
}
@media (max-width: 1120px) {
    .taxpayer-summary-grid,
    .document-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .directory-toolbar { align-items: stretch; flex-direction: column; width: 100%; }
    .directory-toolbar .directory-search { width: 100%; }
    .official-result-header { flex-direction: column; }
    .official-header-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
    .taxpayer-summary-grid,
    .document-summary-grid { grid-template-columns: 1fr; }
    .mini-summary-card { min-height: 105px; }
    .document-filter-grid { grid-template-columns: 1fr; }
    .filter-search-wide { grid-column: auto; }
    .filter-actions { align-items: stretch; flex-direction: column; }
    .filter-actions .secondary-button { width: 100%; }
    .category-overview-head,
    .filter-panel-title { align-items: flex-start; flex-direction: column; }
    .official-header-actions { width: 100%; }
    .action-button { flex: 1; }
    .company-identity { align-items: flex-start; }
    .official-company-banner { align-items: flex-start; }
    .directory-toolbar .export-button { justify-content: center; width: 100%; }
    .ui-toast { right: 16px; bottom: 16px; left: 16px; }
}

@media print {
    body * { visibility: hidden !important; }
    [data-print-section], [data-print-section] * { visibility: visible !important; }
    [data-print-section] {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        border: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
        color: #111827 !important;
    }
    [data-print-section] .action-button { display: none !important; }
    [data-print-section] * { color: #111827 !important; text-shadow: none !important; }
    [data-print-section] .status-pill,
    [data-print-section] .official-status-large,
    [data-print-section] .role-chip,
    [data-print-section] .category-chip { border: 1px solid #cbd5e1 !important; background: #f8fafc !important; }
    [data-print-section] .premium-data-table th { position: static !important; background: #eef2ff !important; }
}

.alert-warning { color: #fde68a; border: 1px solid rgba(251,191,36,.25); background: rgba(146,64,14,.16); }
html[data-theme="light"] .alert-warning { color: #92400e; border-color: rgba(217,119,6,.22); background: rgba(254,243,199,.72); }

/* Navegación con acentos cromáticos sin sacrificar legibilidad */
.sidebar-nav .nav-item:nth-of-type(2) { --nav-tone: 129,140,248; }
.sidebar-nav .nav-item:nth-of-type(3) { --nav-tone: 167,139,250; }
.sidebar-nav .nav-item:nth-of-type(4) { --nav-tone: 34,211,238; }
.sidebar-nav .nav-item:nth-of-type(5) { --nav-tone: 251,191,36; }
.sidebar-nav .nav-item:nth-of-type(6) { --nav-tone: 52,211,153; }
.sidebar-nav .nav-item:nth-of-type(7) { --nav-tone: 251,113,133; }
.sidebar-nav .nav-item:not(.disabled) { --nav-tone: 129,140,248; }
.sidebar-nav .nav-item:not(.disabled):hover,
.sidebar-nav .nav-item.active {
    border-color: rgba(var(--nav-tone), .28);
    background: linear-gradient(90deg, rgba(var(--nav-tone), .13), rgba(var(--nav-tone), .035));
}
.sidebar-nav .nav-item:not(.disabled):hover > svg,
.sidebar-nav .nav-item.active > svg { color: rgb(var(--nav-tone)); }
.sidebar-nav .nav-item.active::before {
    background: linear-gradient(180deg, rgb(var(--nav-tone)), rgba(var(--nav-tone), .45));
    box-shadow: 0 0 18px rgba(var(--nav-tone), .38);
}
.sidebar-nav a.nav-item:nth-of-type(1) { --nav-tone: 129,140,248; }
.sidebar-nav a.nav-item:nth-of-type(2) { --nav-tone: 167,139,250; }
.sidebar-nav a.nav-item:nth-of-type(3) { --nav-tone: 34,211,238; }
.sidebar-nav a.nav-item:nth-of-type(4) { --nav-tone: 251,191,36; }
.sidebar-nav a.nav-item:nth-of-type(5) { --nav-tone: 52,211,153; }
.sidebar-nav a.nav-item:nth-of-type(6) { --nav-tone: 251,113,133; }
.sidebar-nav a.nav-item:nth-of-type(7) { --nav-tone: 96,165,250; }

/* =====================================================================
   SRI Control v0.5.0 — Registro tributario y facturación electrónica
   ===================================================================== */
.registry-hero,
.invoice-command-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(circle at 90% 10%, rgba(56,189,248,.16), transparent 32%),
        radial-gradient(circle at 10% 100%, rgba(99,102,241,.16), transparent 36%),
        linear-gradient(135deg, color-mix(in srgb, var(--panel) 96%, #111827), color-mix(in srgb, var(--panel-soft) 90%, transparent));
    box-shadow: 0 24px 70px rgba(2,6,23,.12);
}
.registry-kicker,
.invoice-kicker { display:block; margin-bottom:8px; color:#818cf8; font-size:10px; font-weight:850; letter-spacing:.18em; text-transform:uppercase; }
.registry-hero h1,
.invoice-command-hero h1 { margin:0; color:var(--text); font-size:clamp(28px,3vw,44px); letter-spacing:-.045em; line-height:1.05; }
.registry-hero p,
.invoice-command-hero p { max-width:720px; margin:12px 0 0; color:var(--muted-strong); font-size:14px; line-height:1.65; }
.registry-hero-stats { display:grid; grid-template-columns:repeat(3,minmax(120px,1fr)); gap:10px; min-width:min(520px,46%); }
.registry-hero-stats div { padding:17px 18px; border:1px solid rgba(129,140,248,.16); border-radius:16px; background:rgba(15,23,42,.22); backdrop-filter:blur(14px); }
.registry-hero-stats span { display:block; color:var(--muted); font-size:10px; font-weight:750; text-transform:uppercase; letter-spacing:.08em; }
.registry-hero-stats strong { display:block; margin-top:8px; color:var(--text); font-size:20px; }

.registry-search-panel { display:grid; grid-template-columns:minmax(240px,.75fr) minmax(420px,1.25fr); align-items:center; gap:30px; margin-top:18px; padding:24px 26px; border:1px solid var(--border); border-radius:20px; background:var(--panel); box-shadow:0 16px 45px rgba(2,6,23,.08); }
.registry-search-copy span,
.invoice-section-heading > div > span,
.registry-block-title > div > span,
.registry-directory-head > div > span { color:#6366f1; font-size:9px; font-weight:850; letter-spacing:.16em; text-transform:uppercase; }
.registry-search-copy h2,
.invoice-section-heading h2,
.registry-block-title h3,
.registry-directory-head h2 { margin:5px 0 0; color:var(--text); font-size:20px; letter-spacing:-.025em; }
.registry-search-copy p,
.invoice-section-heading p,
.registry-directory-head p { margin:7px 0 0; color:var(--muted); font-size:12px; line-height:1.55; }
.registry-search-form { display:flex; align-items:center; gap:12px; }
.registry-search-input { min-width:0; flex:1; height:54px; display:flex; align-items:center; gap:12px; padding:0 15px; border:1px solid var(--border); border-radius:14px; background:var(--input-bg); box-shadow:inset 0 1px 0 rgba(255,255,255,.03); }
.registry-search-input:focus-within { border-color:rgba(99,102,241,.55); box-shadow:0 0 0 4px rgba(99,102,241,.1); }
.registry-search-input svg { width:20px; color:#818cf8; }
.registry-search-input input { min-width:0; flex:1; border:0; outline:0; color:var(--text); background:transparent; font-size:16px; font-weight:750; letter-spacing:.06em; }
.registry-search-input > span { color:var(--muted); font-size:10px; white-space:nowrap; }

.registry-result,
.registry-directory,
.invoice-section { margin-top:18px; padding:26px; border:1px solid var(--border); border-radius:22px; background:var(--panel); box-shadow:0 18px 55px rgba(2,6,23,.08); }
.registry-result-header { display:flex; align-items:center; justify-content:space-between; gap:22px; padding-bottom:22px; border-bottom:1px solid var(--border); }
.registry-company-id,
.registry-person-card { display:flex; align-items:center; gap:16px; }
.registry-avatar { width:56px; height:56px; flex:0 0 auto; display:grid; place-items:center; border-radius:17px; color:white; font-size:20px; font-weight:900; background:linear-gradient(135deg,#4f46e5,#0891b2); box-shadow:0 14px 30px rgba(79,70,229,.26); }
.registry-company-id span,
.registry-person-card span { color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.registry-company-id h2,
.registry-person-card h2 { margin:4px 0 0; color:var(--text); font-size:24px; letter-spacing:-.03em; }
.registry-company-id p,
.registry-person-card p { margin:5px 0 0; color:var(--muted-strong); font-size:12px; }
.registry-company-id .registry-trade-name { color:#06b6d4; font-size:13px; font-weight:850; letter-spacing:.02em; }
.registry-header-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.registry-summary-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:20px; }
.registry-summary-strip div { min-height:84px; padding:16px; border:1px solid var(--border); border-radius:15px; background:linear-gradient(145deg,rgba(99,102,241,.08),rgba(14,165,233,.025)); }
.registry-summary-strip div:nth-child(2){background:linear-gradient(145deg,rgba(168,85,247,.09),transparent)}
.registry-summary-strip div:nth-child(3){background:linear-gradient(145deg,rgba(16,185,129,.09),transparent)}
.registry-summary-strip div:nth-child(4){background:linear-gradient(145deg,rgba(245,158,11,.1),transparent)}
.registry-summary-strip span,
.registry-facts span,
.registry-main-activity span { display:block; color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.registry-summary-strip strong { display:block; margin-top:10px; color:var(--text); font-size:13px; line-height:1.45; }
.registry-info-layout { display:grid; grid-template-columns:minmax(300px,1.2fr) minmax(460px,1.8fr); gap:12px; margin-top:12px; }
.registry-main-activity { padding:20px; border:1px solid rgba(56,189,248,.22); border-radius:17px; background:linear-gradient(145deg,rgba(14,165,233,.1),rgba(59,130,246,.025)); }
.registry-main-activity strong { display:block; margin-top:12px; color:var(--text); font-size:15px; line-height:1.55; }
.registry-main-activity p { margin:14px 0 0; color:var(--muted-strong); font-size:11px; line-height:1.55; }
.registry-facts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.registry-facts div { min-height:92px; padding:15px; border:1px solid var(--border); border-radius:15px; background:var(--panel-soft); }
.registry-facts strong { display:block; margin-top:10px; color:var(--text); font-size:12px; line-height:1.4; }
.registry-table-block { margin-top:24px; }
.registry-block-title { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:11px; }
.registry-block-title b,
.invoice-section-heading > b,
.invoice-section-heading.compact > b { min-width:34px; height:34px; display:grid; place-items:center; border-radius:10px; color:#4f46e5; background:rgba(99,102,241,.1); font-size:12px; }
.registry-table-wrap,
.registry-directory-table-wrap,
.invoice-history-wrap { border:1px solid var(--border); border-radius:16px; overflow:auto; background:var(--panel-soft); }
.registry-table { min-width:850px; }
.registry-table thead th,
.invoice-history-table thead th { position:sticky; top:0; z-index:1; padding:13px 15px; color:#eef2ff; background:linear-gradient(135deg,#173b7a,#3157c8); border-bottom:0; font-size:9px; letter-spacing:.1em; text-transform:uppercase; }
.registry-table tbody tr,
.invoice-history-table tbody tr { transition:background .18s ease,transform .18s ease; }
.registry-table tbody tr:nth-child(even),
.invoice-history-table tbody tr:nth-child(even) { background:rgba(99,102,241,.025); }
.registry-table tbody tr:hover,
.invoice-history-table tbody tr:hover { background:rgba(99,102,241,.08); }
.registry-table td,
.invoice-history-table td { padding:14px 15px; color:var(--muted-strong); font-size:11px; border-bottom:1px solid var(--border); vertical-align:middle; }
.registry-table td strong,
.invoice-history-table td strong { color:var(--text); font-size:11.5px; }
.registry-table td small,
.invoice-history-table td small { display:block; margin-top:4px; color:var(--muted); }
.registry-number { display:inline-grid; min-width:38px; height:28px; place-items:center; border-radius:8px; color:#0891b2; font-weight:850; background:rgba(6,182,212,.1); }
.registry-address { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:260px; }
.registry-address button { width:30px; height:30px; flex:0 0 auto; display:grid; place-items:center; border:1px solid var(--border); border-radius:8px; color:#6366f1; background:transparent; cursor:pointer; }
.registry-address button svg { width:15px; }
.registry-result-footer { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:18px; padding-top:16px; border-top:1px solid var(--border); color:var(--muted); font-size:10px; }
.registry-result-footer strong { color:var(--muted-strong); }
.registry-error,
.registry-empty,
.invoice-empty-warning { padding:22px; border:1px solid rgba(245,158,11,.22); border-radius:16px; background:rgba(245,158,11,.07); }
.registry-error { border-color:rgba(244,63,94,.22); background:rgba(244,63,94,.07); }
.registry-error strong,
.registry-empty strong,
.invoice-empty-warning strong { color:var(--text); }
.registry-error p,
.registry-empty p,
.invoice-empty-warning p { margin:7px 0 0; color:var(--muted-strong); font-size:12px; }
.invoice-empty-warning a { display:inline-flex; margin-top:12px; color:#6366f1; font-weight:800; font-size:12px; }
.registry-directory-head { display:flex; align-items:end; justify-content:space-between; gap:22px; }
.registry-directory-actions { display:flex; align-items:center; gap:10px; }
.registry-directory-actions form { display:flex; align-items:center; gap:8px; }
.registry-directory-actions input { min-width:280px; height:42px; padding:0 13px; border:1px solid var(--border); border-radius:11px; outline:0; color:var(--text); background:var(--input-bg); }
.registry-directory-actions button { height:42px; padding:0 15px; border:0; border-radius:11px; color:white; background:#4f46e5; font-weight:800; cursor:pointer; }
.registry-directory-table-wrap { margin-top:18px; }
.registry-taxpayer-cell { display:flex; align-items:center; gap:11px; min-width:260px; }
.registry-taxpayer-cell > span { width:36px; height:36px; display:grid; place-items:center; border-radius:10px; color:#fff; background:linear-gradient(135deg,#6366f1,#06b6d4); font-weight:850; }
.registry-taxpayer-cell div strong { display:block; }
.registry-selected { display:flex; align-items:center; gap:24px; margin-top:16px; padding:20px; border:1px solid rgba(99,102,241,.22); border-radius:16px; background:linear-gradient(135deg,rgba(99,102,241,.09),rgba(14,165,233,.04)); }
.registry-selected > div:first-child { min-width:230px; }
.registry-selected h3 { margin:8px 0 0; color:var(--text); }
.registry-selected p { margin:5px 0 0; color:var(--muted); font-size:11px; }
.registry-selected dl { display:grid; flex:1; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:0; }
.registry-selected dl div { padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--panel-soft); }
.registry-selected dt { color:var(--muted); font-size:9px; text-transform:uppercase; }
.registry-selected dd { margin:6px 0 0; color:var(--text); font-size:12px; font-weight:800; }
.registry-person-card { justify-content:flex-start; padding:5px; }
.registry-person-card > .status-pill { margin-left:auto; }

/* Facturación */
.invoice-command-actions { display:flex; gap:10px; margin-top:22px; }
.invoice-environment-card { position:relative; min-width:230px; padding:22px 24px; overflow:hidden; border:1px solid rgba(129,140,248,.22); border-radius:20px; background:rgba(15,23,42,.25); }
.invoice-environment-card span { color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; }
.invoice-environment-card strong { display:block; margin-top:10px; color:var(--text); font-size:25px; }
.invoice-environment-card small { display:block; margin-top:8px; color:var(--muted-strong); }
.invoice-environment-card i { position:absolute; right:-15px; bottom:-20px; width:95px; height:95px; border-radius:50%; filter:blur(2px); opacity:.22; background:#22d3ee; }
.invoice-environment-card.is-production { border-color:rgba(244,63,94,.26); }
.invoice-environment-card.is-production i { background:#f43f5e; }
.invoice-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:18px; }
.invoice-stat { position:relative; overflow:hidden; min-height:118px; padding:20px; border:1px solid var(--border); border-radius:18px; background:var(--panel); box-shadow:0 14px 38px rgba(2,6,23,.07); }
.invoice-stat::after { content:""; position:absolute; width:85px; height:85px; right:-28px; top:-28px; border-radius:50%; background:var(--stat-tone); opacity:.14; }
.invoice-stat span { color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.invoice-stat strong { display:block; margin-top:12px; color:var(--text); font-size:25px; letter-spacing:-.035em; }
.invoice-stat small { display:block; margin-top:7px; color:var(--muted); font-size:10px; }
.invoice-stat-indigo{--stat-tone:#6366f1}.invoice-stat-emerald{--stat-tone:#10b981}.invoice-stat-amber{--stat-tone:#f59e0b}.invoice-stat-cyan{--stat-tone:#06b6d4}
.invoice-section-nav { position:sticky; top:80px; z-index:10; display:flex; align-items:center; gap:6px; margin-top:18px; padding:7px; overflow:auto; border:1px solid var(--border); border-radius:14px; background:color-mix(in srgb,var(--panel) 88%,transparent); backdrop-filter:blur(18px); }
.invoice-section-nav a { padding:9px 13px; border-radius:9px; color:var(--muted-strong); font-size:10px; font-weight:800; white-space:nowrap; text-decoration:none; }
.invoice-section-nav a:hover { color:#fff; background:#4f46e5; }
.invoice-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:22px; }
.invoice-section-heading.compact { margin-bottom:18px; }
.invoice-form-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.invoice-span-2 { grid-column:span 2; }
.invoice-span-3 { grid-column:span 3; }
.invoice-form-actions { display:flex; justify-content:flex-end; padding-top:4px; }
.invoice-catalog-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.invoice-compact-form { display:grid; gap:13px; }
.invoice-two-cols { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.invoice-full-button { width:100%; }
.invoice-mini-list { display:grid; gap:7px; margin-top:16px; padding-top:15px; border-top:1px solid var(--border); }
.invoice-mini-list > div { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:9px 11px; border-radius:10px; background:var(--panel-soft); }
.invoice-mini-list span { color:var(--text); font-size:11px; font-weight:750; }
.invoice-mini-list small,
.invoice-mini-list p { color:var(--muted); font-size:9px; }
.invoice-header-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.invoice-lines-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:24px 0 11px; }
.invoice-lines-toolbar strong { display:block; color:var(--text); font-size:14px; }
.invoice-lines-toolbar span { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
.invoice-lines { display:grid; gap:10px; }
.invoice-line { position:relative; display:grid; grid-template-columns:34px 1.25fr .65fr 1.5fr .55fr .7fr .65fr .65fr .7fr 30px; gap:9px; align-items:end; padding:14px; border:1px solid var(--border); border-radius:16px; background:var(--panel-soft); }
.invoice-line label { min-width:0; }
.invoice-line label > span,
.invoice-line-total > span { display:block; margin-bottom:7px; color:var(--muted); font-size:8px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.invoice-line .field-input { width:100%; min-width:0; height:42px; padding:0 10px; font-size:10.5px; }
.invoice-line-number { align-self:center; width:30px; height:30px; display:grid; place-items:center; border-radius:9px; color:#6366f1; background:rgba(99,102,241,.1); font-size:11px; font-weight:900; }
.invoice-line-wide { min-width:170px; }
.invoice-line-total { align-self:center; min-width:72px; text-align:right; }
.invoice-line-total strong { color:var(--text); font-size:12px; }
.invoice-line-remove { align-self:center; width:30px; height:30px; border:1px solid rgba(244,63,94,.18); border-radius:9px; color:#fb7185; background:rgba(244,63,94,.06); font-size:19px; cursor:pointer; }
.invoice-totals { display:flex; justify-content:flex-end; gap:10px; margin-top:13px; }
.invoice-totals > div { min-width:150px; padding:14px 16px; border:1px solid var(--border); border-radius:13px; background:var(--panel-soft); }
.invoice-totals span { color:var(--muted); font-size:9px; font-weight:800; text-transform:uppercase; }
.invoice-totals strong { display:block; margin-top:7px; color:var(--text); font-size:16px; }
.invoice-totals .invoice-grand-total { border-color:rgba(99,102,241,.3); background:linear-gradient(135deg,rgba(99,102,241,.14),rgba(14,165,233,.06)); }
.invoice-totals .invoice-grand-total strong { color:#818cf8; font-size:21px; }
.invoice-submit-bar { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:18px; padding:16px 18px; border:1px solid rgba(99,102,241,.2); border-radius:14px; background:linear-gradient(90deg,rgba(99,102,241,.09),transparent); }
.invoice-submit-bar strong { display:block; color:var(--text); }
.invoice-submit-bar span { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
.environment-chip { display:inline-flex; padding:6px 9px; border-radius:999px; font-size:9px; font-weight:850; }
.environment-chip.test { color:#0369a1; background:rgba(14,165,233,.12); }
.environment-chip.production { color:#be123c; background:rgba(244,63,94,.11); }
.invoice-history-table { min-width:900px; }
.invoice-history-table tr.is-selected { outline:2px solid rgba(99,102,241,.35); outline-offset:-2px; background:rgba(99,102,241,.08); }
.invoice-selected-card { margin-top:18px; padding:22px; border:1px solid rgba(99,102,241,.22); border-radius:18px; background:linear-gradient(135deg,rgba(99,102,241,.08),rgba(14,165,233,.035)); }
.invoice-selected-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.invoice-selected-head h3 { margin:9px 0 0; color:var(--text); font-size:20px; }
.invoice-selected-head p { margin:6px 0 0; color:var(--muted); }
.invoice-selected-head > strong { color:var(--text); font-size:28px; }
.invoice-selected-meta { display:grid; grid-template-columns:2fr 1fr 1fr; gap:10px; margin-top:17px; }
.invoice-selected-meta > div { padding:13px; border:1px solid var(--border); border-radius:12px; background:var(--panel-soft); }
.invoice-selected-meta span { display:block; color:var(--muted); font-size:8px; font-weight:800; text-transform:uppercase; }
.invoice-selected-meta strong,
.invoice-selected-meta code { display:block; margin-top:7px; color:var(--text); font-size:10.5px; word-break:break-all; }
.invoice-selected-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:13px; }
.invoice-detail-lines { margin-top:16px; overflow:auto; border:1px solid var(--border); border-radius:13px; }
.invoice-detail-lines table { width:100%; min-width:650px; border-collapse:collapse; }
.invoice-detail-lines th { padding:11px; color:#e0e7ff; background:#263f91; text-align:left; font-size:9px; text-transform:uppercase; }
.invoice-detail-lines td { padding:11px; color:var(--muted-strong); border-bottom:1px solid var(--border); font-size:10px; }
.invoice-detail-lines td strong { color:var(--text); }
.invoice-detail-lines td small { display:block; margin-top:4px; color:var(--muted); }
.invoice-send-panel { display:grid; grid-template-columns:1.2fr 1fr 1fr auto; align-items:end; gap:12px; margin-top:18px; padding:17px; border:1px solid rgba(16,185,129,.2); border-radius:15px; background:rgba(16,185,129,.055); }
.invoice-send-panel > div > span { color:#10b981; font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.1em; }
.invoice-send-panel > div > strong { display:block; margin-top:5px; color:var(--text); }
.invoice-send-panel > div > p { margin:5px 0 0; color:var(--muted); font-size:9px; }
.production-confirm { grid-column:1/-1; display:flex; align-items:center; gap:9px; color:#fb7185; font-size:10px; font-weight:750; }
.invoice-sri-message { margin-top:13px; padding:14px; border:1px solid rgba(244,63,94,.2); border-radius:12px; background:rgba(244,63,94,.06); }
.invoice-sri-message strong { color:#fb7185; }
.invoice-sri-message p { margin:6px 0 0; color:var(--muted-strong); font-size:10px; }

html[data-theme="light"] .registry-hero,
html[data-theme="light"] .invoice-command-hero { background:radial-gradient(circle at 90% 10%,rgba(14,165,233,.12),transparent 34%),radial-gradient(circle at 10% 100%,rgba(99,102,241,.12),transparent 36%),linear-gradient(135deg,#fff,#f1f6ff); }
html[data-theme="light"] .registry-hero-stats div,
html[data-theme="light"] .invoice-environment-card { background:rgba(255,255,255,.78); }
html[data-theme="light"] .registry-table thead th,
html[data-theme="light"] .invoice-history-table thead th,
html[data-theme="light"] .invoice-detail-lines th { color:#fff; }
html[data-theme="light"] .invoice-section-nav a:hover { color:#fff; }
html[data-theme="light"] .registry-summary-strip div,
html[data-theme="light"] .registry-facts div,
html[data-theme="light"] .invoice-line,
html[data-theme="light"] .invoice-totals > div { box-shadow:inset 0 1px 0 rgba(255,255,255,.85); }

@media(max-width:1280px){
    .registry-info-layout{grid-template-columns:1fr}.registry-facts{grid-template-columns:repeat(4,1fr)}
    .invoice-line{grid-template-columns:34px 1fr .7fr 1.35fr .55fr .7fr .65fr .65fr}.invoice-line-total{grid-column:8}.invoice-line-remove{grid-column:9}
    .invoice-send-panel{grid-template-columns:1fr 1fr}.invoice-send-panel>div{grid-column:1/-1}
}
@media(max-width:980px){
    .registry-hero,.invoice-command-hero{align-items:flex-start;flex-direction:column}.registry-hero-stats{width:100%;min-width:0}.invoice-environment-card{width:100%}
    .registry-search-panel{grid-template-columns:1fr}.registry-summary-strip{grid-template-columns:repeat(2,1fr)}.registry-facts{grid-template-columns:repeat(2,1fr)}
    .registry-directory-head,.registry-result-header{align-items:flex-start;flex-direction:column}.registry-directory-actions{width:100%;align-items:stretch;flex-direction:column}.registry-directory-actions form{width:100%}.registry-directory-actions input{min-width:0;flex:1}
    .registry-selected{align-items:flex-start;flex-direction:column}.registry-selected dl{width:100%;grid-template-columns:repeat(2,1fr)}
    .invoice-stat-grid{grid-template-columns:repeat(2,1fr)}.invoice-catalog-grid{grid-template-columns:1fr}.invoice-form-grid{grid-template-columns:repeat(2,1fr)}.invoice-span-3{grid-column:span 2}.invoice-header-grid{grid-template-columns:repeat(2,1fr)}
    .invoice-line{grid-template-columns:34px repeat(2,1fr)}.invoice-line label,.invoice-line-total{grid-column:auto}.invoice-line-wide{grid-column:span 2}.invoice-line-remove{position:absolute;right:10px;top:10px}
    .invoice-selected-meta{grid-template-columns:1fr}.invoice-send-panel{grid-template-columns:1fr}
}
@media(max-width:650px){
    .registry-hero,.invoice-command-hero,.registry-result,.registry-directory,.invoice-section{padding:19px;border-radius:17px}
    .registry-hero-stats,.invoice-stat-grid,.registry-summary-strip,.registry-facts{grid-template-columns:1fr}.registry-search-form{align-items:stretch;flex-direction:column}.registry-search-input{width:100%}
    .registry-company-id{align-items:flex-start}.registry-header-actions{justify-content:flex-start}.registry-selected dl{grid-template-columns:1fr}
    .invoice-command-actions,.invoice-submit-bar,.invoice-selected-head{align-items:stretch;flex-direction:column}.invoice-form-grid,.invoice-header-grid,.invoice-two-cols{grid-template-columns:1fr}.invoice-span-2,.invoice-span-3{grid-column:auto}.invoice-line{grid-template-columns:34px 1fr}.invoice-line-wide{grid-column:auto}.invoice-totals{flex-direction:column}.invoice-totals>div{width:100%}.invoice-section-nav{top:66px}
}

@media print {
    .sidebar,.topbar,.registry-search-panel,.registry-directory,.registry-header-actions,.invoice-section-nav{display:none!important}
    .dashboard-main{margin:0!important}.dashboard-content{padding:0!important;max-width:none!important}.registry-result{border:0!important;box-shadow:none!important;margin:0!important}
}
.sidebar-nav a.nav-item:nth-of-type(1){--nav-tone:129,140,248}
.sidebar-nav a.nav-item:nth-of-type(2){--nav-tone:167,139,250}
.sidebar-nav a.nav-item:nth-of-type(3){--nav-tone:34,211,238}
.sidebar-nav a.nav-item:nth-of-type(4){--nav-tone:59,130,246}
.sidebar-nav a.nav-item:nth-of-type(5){--nav-tone:251,191,36}
.sidebar-nav a.nav-item:nth-of-type(6){--nav-tone:52,211,153}
.sidebar-nav a.nav-item:nth-of-type(7){--nav-tone:251,113,133}
.sidebar-nav a.nav-item:nth-of-type(8){--nav-tone:96,165,250}
.invoice-inline-action { display: inline-flex; margin: 0; }
.invoice-inline-action .mini-button { height: 100%; }

/* ========================================================================== 
   v0.5.1 · Tablas sólidas, contraste alto y centro documental
   ========================================================================== */

/* Integración segura con Bootstrap: el diseño propio conserva prioridad. */
.app-body .table { --bs-table-bg: transparent; --bs-table-color: inherit; --bs-table-border-color: var(--border); }
.app-body .nav { --bs-nav-link-padding-x: 0; --bs-nav-link-padding-y: 0; }

.solid-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #0f1a2f;
}
.solid-data-table thead th,
.registry-table.solid-data-table thead th,
.document-table.solid-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 16px;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.14);
    background: #1d4ed8 !important;
    color: #ffffff !important;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .075em;
    line-height: 1.35;
    text-transform: uppercase;
    white-space: nowrap;
}
.solid-data-table thead th:first-child { border-top-left-radius: 13px; }
.solid-data-table thead th:last-child { border-top-right-radius: 13px; border-right: 0; }
.solid-data-table tbody tr { background: #111d32; }
.solid-data-table tbody tr:nth-child(even) { background: #152238; }
.solid-data-table tbody tr:hover { background: #1a2a45; }
.solid-data-table tbody td,
.registry-table.solid-data-table tbody td,
.document-table.solid-data-table tbody td {
    padding: 15px 16px;
    border-top: 0;
    border-bottom: 1px solid #263650;
    color: #dbe7f5;
    font-size: 12px;
    line-height: 1.45;
    vertical-align: middle;
}
.solid-data-table tbody td strong { color: #ffffff; font-weight: 780; }
.solid-data-table tbody td small { color: #9fb1c8; font-size: 10px; }
.solid-table-wrap,
.registry-table-wrap,
.registry-directory-table-wrap {
    border: 1px solid #263650;
    border-radius: 15px;
    overflow: auto;
    background: #0f1a2f;
    box-shadow: 0 12px 28px rgba(2,6,23,.16);
}

.registry-count-badge {
    min-width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 850 !important;
}
.registry-count-badge.badge-violet { background: #6d28d9 !important; }
.registry-count-badge.badge-blue { background: #1d4ed8 !important; }

.registry-number,
.number-badge-cyan,
.document-number,
.date-chip,
.document-type-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-width: 44px;
    min-height: 30px;
    padding: 5px 10px;
    border: 0;
    border-radius: 9px;
    color: #ffffff !important;
    background: #0e7490 !important;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .025em;
    white-space: nowrap;
}
.document-number { background: #1d4ed8 !important; }
.date-chip { background: #334155 !important; }
.document-type-chip { background: #6d28d9 !important; text-transform: uppercase; }

.copy-id-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 9px 6px 11px;
    border: 1px solid #365071;
    border-radius: 9px;
    color: #dbeafe;
    background: #182941;
    font-size: 11px;
    font-weight: 780;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.copy-id-button:hover { border-color: #60a5fa; background: #203653; transform: translateY(-1px); }
.copy-id-button svg { width: 15px; height: 15px; color: #60a5fa; }
.copy-id-button.compact { min-height: 32px; padding: 5px 8px 5px 10px; }

.registry-taxpayer-cell > span {
    background: #1d4ed8 !important;
    color: #fff;
    box-shadow: none;
}
.registry-taxpayer-cell > span.avatar-blue { background: #1d4ed8 !important; }
.registry-taxpayer-cell > span.avatar-teal { background: #0f766e !important; }
.registry-taxpayer-cell > span.avatar-violet { background: #6d28d9 !important; }
.registry-taxpayer-cell > span.avatar-amber { background: #b45309 !important; }
.registry-taxpayer-cell > span.avatar-rose { background: #be123c !important; }

.registry-not-found {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border: 1px solid #475569;
    border-left: 5px solid #f59e0b;
    border-radius: 16px;
    background: #111d32;
}
.registry-not-found-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fbbf24;
    background: #3b2a0c;
}
.registry-not-found-icon svg { width: 28px; height: 28px; }
.registry-not-found-copy > span {
    color: #fbbf24;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.registry-not-found-copy h2 { margin: 5px 0 7px; color: #fff; font-size: 21px; letter-spacing: -.02em; }
.registry-not-found-copy p { max-width: 760px; margin: 0; color: #bac8db; font-size: 12px; line-height: 1.6; }
.registry-not-found-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.registry-not-found-meta strong { padding: 6px 10px; border-radius: 8px; color: #fff; background: #1d4ed8; letter-spacing: .06em; }
.registry-not-found-meta span { color: #a7f3d0; font-size: 10px; font-weight: 750; }
.solid-button { border-color: #4f46e5 !important; color: #fff !important; background: #4f46e5 !important; }

/* Centro documental */
.document-center-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 25px 27px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 18px 44px rgba(2,6,23,.11);
}
.document-center-hero h1 { margin: 5px 0 0; color: var(--text); font-size: clamp(27px,3vw,38px); letter-spacing: -.045em; }
.document-center-hero p { max-width: 760px; margin: 10px 0 0; color: var(--muted-strong); line-height: 1.65; }
.document-center-hero .primary-button svg { width: 18px; height: 18px; }
.section-eyebrow { color: #818cf8; font-size: 10px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.document-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:16px; }
.document-metric {
    min-height: 134px;
    padding: 20px;
    border: 1px solid var(--border);
    border-top: 5px solid #1d4ed8;
    border-radius: 16px;
    background: var(--panel);
    box-shadow: 0 13px 34px rgba(2,6,23,.09);
}
.document-metric.metric-blue { border-top-color: #2563eb; }
.document-metric.metric-teal { border-top-color: #0d9488; }
.document-metric.metric-green { border-top-color: #16a34a; }
.document-metric.metric-amber { border-top-color: #d97706; }
.document-metric span { display: block; color: var(--muted-strong); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.document-metric strong { display: block; margin-top: 13px; color: var(--text); font-size: 25px; letter-spacing: -.035em; }
.document-metric small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.5; }
.document-center-panel { margin-top: 16px; padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); box-shadow: 0 18px 44px rgba(2,6,23,.1); }
.document-center-toolbar { display: grid; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.document-scope-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted-strong);
    background: var(--panel-soft);
    font-size: 11px;
    font-weight: 800;
}
.document-scope-tabs .nav-link span { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: #cbd5e1; background: #334155; font-size: 10px; }
.document-scope-tabs .nav-link.active { border-color: #2563eb; color: #fff; background: #1d4ed8; }
.document-scope-tabs .nav-link.active span { color: #1d4ed8; background: #fff; }
.document-filter-form { display: grid; grid-template-columns:minmax(250px,1.6fr) repeat(4,minmax(135px,.7fr)) auto auto; gap: 9px; align-items:center; }
.document-filter-form input,
.document-filter-form select,
.document-filter-search {
    min-width: 0;
    height: 43px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--input-bg);
    outline: 0;
}
.document-filter-form input,
.document-filter-form select { padding: 0 11px; }
.document-filter-search { display:flex; align-items:center; gap:9px; padding:0 11px; }
.document-filter-search svg { width:17px; color:#60a5fa; }
.document-filter-search input { flex:1; height:auto; padding:0; border:0; background:transparent; }
.document-filter-form input:focus,
.document-filter-form select:focus,
.document-filter-search:focus-within { border-color:#60a5fa; box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.solid-filter-button,
.clear-filter-button { min-height:43px; display:inline-flex; align-items:center; justify-content:center; padding:0 14px; border-radius:10px; font-size:11px; font-weight:820; white-space:nowrap; }
.solid-filter-button { border:1px solid #1d4ed8; color:#fff; background:#1d4ed8; cursor:pointer; }
.clear-filter-button { border:1px solid var(--border); color:var(--muted-strong); background:var(--panel-soft); }
.document-list-section { margin-top: 24px; }
.document-list-section + .document-list-section { padding-top: 24px; border-top: 1px solid var(--border); }
.document-list-heading { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:12px; }
.document-list-heading span { color:#60a5fa; font-size:9px; font-weight:850; letter-spacing:.13em; text-transform:uppercase; }
.document-list-heading h2 { margin:4px 0 0; color:var(--text); font-size:20px; letter-spacing:-.025em; }
.document-list-heading > a { color:#60a5fa; font-size:11px; font-weight:780; }
.document-table { min-width: 920px; }
.document-table td:nth-child(3) { min-width: 220px; }
.document-row-actions { display:flex; align-items:center; gap:7px; }
.document-row-actions a { min-width:38px; height:32px; display:grid; place-items:center; border:1px solid #365071; border-radius:8px; color:#dbeafe; background:#182941; font-size:10px; font-weight:800; }
.document-row-actions a:hover { border-color:#60a5fa; background:#203653; }
.document-empty-state { padding:28px; border:1px dashed var(--border); border-radius:14px; text-align:center; background:var(--panel-soft); }
.document-empty-state strong { color:var(--text); }
.document-empty-state p { margin:7px 0 0; color:var(--muted); }

/* Modo claro con contraste alto y sin encabezados lavados. */
html[data-theme="light"] .solid-data-table,
html[data-theme="light"] .solid-table-wrap,
html[data-theme="light"] .registry-table-wrap,
html[data-theme="light"] .registry-directory-table-wrap { background: #ffffff; border-color:#cbd5e1; }
html[data-theme="light"] .solid-data-table thead th,
html[data-theme="light"] .registry-table.solid-data-table thead th,
html[data-theme="light"] .document-table.solid-data-table thead th { background:#1d4ed8 !important; color:#ffffff !important; border-right-color:rgba(255,255,255,.22); }
html[data-theme="light"] .solid-data-table tbody tr { background:#ffffff; }
html[data-theme="light"] .solid-data-table tbody tr:nth-child(even) { background:#f1f5f9; }
html[data-theme="light"] .solid-data-table tbody tr:hover { background:#dbeafe; }
html[data-theme="light"] .solid-data-table tbody td,
html[data-theme="light"] .registry-table.solid-data-table tbody td,
html[data-theme="light"] .document-table.solid-data-table tbody td { border-bottom-color:#d8e0eb; color:#334155; }
html[data-theme="light"] .solid-data-table tbody td strong { color:#0f172a; }
html[data-theme="light"] .solid-data-table tbody td small { color:#64748b; }
html[data-theme="light"] .copy-id-button { border-color:#bfcee1; color:#1e3a5f; background:#eff6ff; }
html[data-theme="light"] .copy-id-button:hover { border-color:#2563eb; background:#dbeafe; }
html[data-theme="light"] .copy-id-button svg { color:#2563eb; }
html[data-theme="light"] .registry-not-found { border-color:#cbd5e1; border-left-color:#d97706; background:#fff; box-shadow:0 13px 34px rgba(15,23,42,.07); }
html[data-theme="light"] .registry-not-found-icon { color:#b45309; background:#fef3c7; }
html[data-theme="light"] .registry-not-found-copy h2 { color:#0f172a; }
html[data-theme="light"] .registry-not-found-copy p { color:#475569; }
html[data-theme="light"] .document-row-actions a { border-color:#cbd5e1; color:#1d4ed8; background:#eff6ff; }
html[data-theme="light"] .document-row-actions a:hover { border-color:#2563eb; background:#dbeafe; }
html[data-theme="light"] .document-scope-tabs .nav-link span { color:#334155; background:#e2e8f0; }
html[data-theme="light"] .document-scope-tabs .nav-link.active span { color:#1d4ed8; background:#fff; }

@media (max-width: 1280px) {
    .document-filter-form { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .document-filter-search { grid-column:span 2; }
}
@media (max-width: 820px) {
    .registry-not-found { grid-template-columns:1fr; align-items:start; }
    .registry-not-found-icon { width:48px; height:48px; }
    .document-center-hero { align-items:flex-start; flex-direction:column; }
    .document-filter-form { grid-template-columns:1fr 1fr; }
    .document-filter-search { grid-column:1 / -1; }
}
@media (max-width: 560px) {
    .document-filter-form { grid-template-columns:1fr; }
    .document-filter-search { grid-column:auto; }
    .document-center-panel { padding:15px; }
    .document-list-heading { align-items:flex-start; flex-direction:column; }
}

@media (max-width:1100px){.document-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:560px){.document-metrics{grid-template-columns:1fr;}}

/* =========================================================
   Estado tributario v0.6.0
   ========================================================= */
.tax-module { display:grid; gap:20px; }
.solid-panel { border:1px solid var(--border); border-radius:22px; background:var(--panel-solid); box-shadow:0 18px 45px rgba(0,0,0,.15); }
.tax-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(330px,.62fr); gap:28px; padding:28px; border-top:4px solid #2563eb; overflow:hidden; }
.tax-hero-copy h1 { margin:6px 0 8px; color:var(--text); font-size:clamp(29px,3vw,43px); line-height:1.05; letter-spacing:-.045em; }
.tax-hero-copy > p { max-width:760px; margin:0; color:var(--muted); font-size:13px; line-height:1.7; }
.section-kicker { display:inline-flex; color:#60a5fa; font-size:9px; font-weight:900; letter-spacing:.16em; text-transform:uppercase; }
.tax-context-line { display:flex; flex-wrap:wrap; gap:8px; margin-top:19px; }
.tax-context-chip { min-height:30px; display:inline-flex; align-items:center; padding:0 11px; border:1px solid #29415f; border-radius:8px; color:#cbd5e1; background:#142238; font-size:10px; font-weight:700; }
.tax-context-chip.mono { font-variant-numeric:tabular-nums; letter-spacing:.04em; }
.tax-period-tools { display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:14px; padding-left:26px; border-left:1px solid var(--border); }
.period-selector { display:grid; gap:7px; }
.period-selector label { color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.period-selector-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.period-selector input { height:44px; padding:0 12px; border:1px solid #30445f; border-radius:10px; color:var(--text); background:#0f1b2f; outline:0; }
.period-selector input:focus { border-color:#60a5fa; box-shadow:0 0 0 3px rgba(37,99,235,.15); }
.tax-hero-actions { display:flex; flex-wrap:wrap; gap:8px; }
.tax-hero-actions form { margin:0; }
.btn-solid-primary,.btn-solid-secondary,.btn-solid-success,.btn-solid-warning { min-height:40px; display:inline-flex; align-items:center; justify-content:center; border-radius:9px; padding:0 13px; font-size:10px; font-weight:850; cursor:pointer; transition:transform .18s ease,filter .18s ease,border-color .18s ease; }
.btn-solid-primary { border:1px solid #2563eb; color:#fff; background:#2563eb; }
.btn-solid-secondary { border:1px solid #334966; color:#dbeafe; background:#16263e; }
.btn-solid-success { border:1px solid #059669; color:#fff; background:#059669; }
.btn-solid-warning { border:1px solid #d97706; color:#fff; background:#d97706; }
.btn-solid-primary:hover,.btn-solid-secondary:hover,.btn-solid-success:hover,.btn-solid-warning:hover { transform:translateY(-1px); filter:brightness(1.08); }
.tax-period-heading { display:flex; align-items:end; justify-content:space-between; gap:18px; padding:2px 4px 0; }
.tax-period-heading h2 { margin:5px 0 0; color:var(--text); font-size:23px; letter-spacing:-.03em; }
.period-state { min-height:32px; display:inline-flex; align-items:center; border-radius:8px; padding:0 11px; font-size:9px; font-weight:900; letter-spacing:.09em; }
.period-state.is-open { border:1px solid #10b981; color:#6ee7b7; background:#063f35; }
.period-state.is-closed { border:1px solid #64748b; color:#cbd5e1; background:#243044; }
.tax-callout { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 18px; border-radius:14px; }
.tax-callout.warning { border:1px solid #b45309; background:#3a2609; }
.tax-callout div { display:grid; gap:3px; }
.tax-callout strong { color:#fde68a; }
.tax-callout span { color:#d6b978; font-size:11px; }
.tax-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; }
.tax-stat-card { min-height:128px; display:flex; align-items:center; gap:15px; padding:19px; border:1px solid var(--border); border-top-width:4px; border-radius:17px; background:var(--panel-solid); box-shadow:0 14px 34px rgba(0,0,0,.12); }
.tax-stat-card.blue{border-top-color:#2563eb}.tax-stat-card.cyan{border-top-color:#0891b2}.tax-stat-card.violet{border-top-color:#7c3aed}.tax-stat-card.success{border-top-color:#059669}.tax-stat-card.danger{border-top-color:#e11d48}.tax-stat-card.info{border-top-color:#475569}
.tax-stat-icon { width:44px; height:44px; flex:0 0 auto; display:grid; place-items:center; border-radius:12px; }
.tax-stat-card.blue .tax-stat-icon{color:#93c5fd;background:#183567}.tax-stat-card.cyan .tax-stat-icon{color:#67e8f9;background:#164e63}.tax-stat-card.violet .tax-stat-icon{color:#c4b5fd;background:#3b1f69}.tax-stat-card.success .tax-stat-icon{color:#6ee7b7;background:#064e3b}.tax-stat-card.danger .tax-stat-icon{color:#fda4af;background:#66152e}.tax-stat-card.info .tax-stat-icon{color:#cbd5e1;background:#334155}
.tax-stat-icon svg { width:23px; height:23px; }
.tax-stat-card span,.tax-stat-card small { display:block; color:var(--muted); }
.tax-stat-card span { font-size:10px; font-weight:750; }
.tax-stat-card strong { display:block; margin:6px 0; color:var(--text); font-size:22px; letter-spacing:-.035em; }
.tax-stat-card small { font-size:9px; line-height:1.45; }
.tax-two-column { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
.tax-gap-lg { gap:16px; }
.tax-liquidation-panel,.tax-chart-panel,.tax-obligations-panel,.tax-two-column > .solid-panel { padding:22px; }
.panel-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:17px; }
.panel-title-row h3 { margin:5px 0 0; color:var(--text); font-size:18px; letter-spacing:-.025em; }
.panel-title-row p { margin:6px 0 0; color:var(--muted); font-size:10px; line-height:1.55; }
.panel-link { color:#60a5fa; font-size:10px; font-weight:850; }
.tax-mini-badge,.count-box { min-height:30px; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; padding:0 10px; font-size:9px; font-weight:900; text-transform:uppercase; }
.tax-mini-badge.success{color:#6ee7b7;background:#064e3b;border:1px solid #059669}.tax-mini-badge.danger{color:#fda4af;background:#66152e;border:1px solid #e11d48}.tax-mini-badge.info{color:#cbd5e1;background:#334155;border:1px solid #64748b}.count-box{min-width:34px;color:#bfdbfe;background:#1e3a5f;border:1px solid #2563eb}
.tax-ledger { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.tax-ledger-column { border:1px solid #2b405c; border-radius:13px; overflow:hidden; background:#101d31; }
.tax-ledger-column.debit{border-top:3px solid #e11d48}.tax-ledger-column.credit{border-top:3px solid #059669}
.tax-ledger-title { display:flex; justify-content:space-between; gap:12px; padding:13px 14px; border-bottom:1px solid #2b405c; }
.tax-ledger-title span { color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; }
.tax-ledger-title strong { color:var(--text); font-size:14px; }
.tax-ledger-row { display:flex; justify-content:space-between; gap:14px; padding:11px 14px; border-bottom:1px solid #21334b; font-size:10px; }
.tax-ledger-row:last-child{border-bottom:0}.tax-ledger-row span{color:var(--muted)}.tax-ledger-row strong{color:var(--muted-strong)}
.tax-balance-bar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:13px; padding:15px; border-radius:11px; }
.tax-balance-bar.success{border:1px solid #059669;background:#064e3b}.tax-balance-bar.danger{border:1px solid #e11d48;background:#66152e}.tax-balance-bar.info{border:1px solid #64748b;background:#334155}
.tax-balance-bar span{font-size:11px;font-weight:780}.tax-balance-bar strong{font-size:20px}
.chart-legend { display:flex; gap:12px; color:var(--muted); font-size:9px; }
.chart-legend span { display:flex; align-items:center; gap:5px; }
.chart-legend i { width:8px; height:8px; border-radius:2px; }.legend-sales{background:#2563eb}.legend-purchases{background:#0891b2}
.tax-column-chart { height:238px; display:flex; align-items:end; gap:7px; padding:18px 6px 0; border-bottom:1px solid #334155; }
.tax-chart-group { flex:1; min-width:0; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:7px; }
.tax-chart-bars { width:100%; flex:1; display:flex; justify-content:center; align-items:end; gap:3px; }
.tax-chart-bars i { width:min(12px,38%); min-height:3px; border-radius:3px 3px 0 0; transition:height .35s ease,filter .18s ease; }.tax-chart-bars i.sales{background:#2563eb}.tax-chart-bars i.purchases{background:#0891b2}.tax-chart-group:hover i{filter:brightness(1.25)}
.tax-chart-group > span { color:var(--muted); font-size:8px; white-space:nowrap; transform:rotate(-42deg); transform-origin:center; margin-bottom:-4px; }
.obligations-header { align-items:center; }
.obligation-progress { min-width:210px; }
.obligation-progress > div:first-child { display:flex; justify-content:space-between; color:var(--muted); font-size:9px; }.obligation-progress strong{color:var(--text);font-size:14px}
.progress-track { height:8px; margin-top:7px; overflow:hidden; border-radius:99px; background:#25344b; }.progress-track i{display:block;height:100%;border-radius:inherit;background:#2563eb}
.tax-obligation-list { display:grid; gap:9px; }
.tax-obligation-card { border:1px solid #2a405b; border-left:4px solid #64748b; border-radius:13px; background:#111e32; overflow:hidden; }
.tax-obligation-card.presentada,.tax-obligation-card.pagada,.tax-obligation-card.no_aplica{border-left-color:#059669}.tax-obligation-card.vencida{border-left-color:#e11d48}.tax-obligation-card.pendiente{border-left-color:#d97706}
.tax-obligation-card summary { min-height:74px; display:grid; grid-template-columns:90px minmax(0,1fr) 120px 110px 22px; align-items:center; gap:14px; padding:12px 15px; cursor:pointer; list-style:none; }.tax-obligation-card summary::-webkit-details-marker{display:none}
.obligation-code-box { min-height:32px; display:grid; place-items:center; border:1px solid #315a93; border-radius:8px; color:#bfdbfe; background:#15345f; font-size:9px; font-weight:900; letter-spacing:.05em; }
.obligation-main{min-width:0}.obligation-main strong,.obligation-main span{display:block}.obligation-main strong{color:var(--text);font-size:12px}.obligation-main span{margin-top:5px;color:var(--muted);font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.obligation-amount span,.obligation-amount strong{display:block;text-align:right}.obligation-amount span{color:var(--muted);font-size:8px;text-transform:uppercase}.obligation-amount strong{margin-top:5px;color:var(--text);font-size:12px}
.obligation-status { min-height:28px; display:grid; place-items:center; border-radius:8px; padding:0 8px; font-size:8px; font-weight:900; text-transform:uppercase; }.status-pendiente{color:#fde68a;background:#4a3209;border:1px solid #d97706}.status-vencida{color:#fecdd3;background:#621128;border:1px solid #e11d48}.status-presentada,.status-pagada{color:#a7f3d0;background:#064e3b;border:1px solid #059669}.status-no_aplica{color:#cbd5e1;background:#334155;border:1px solid #64748b}
.details-chevron { width:18px; color:#7b8ca4; transition:transform .2s ease; }.tax-obligation-card[open] .details-chevron{transform:rotate(180deg)}
.obligation-editor { padding:16px; border-top:1px solid #2a405b; background:#0d1829; }
.obligation-form,.tax-add-form,.adjustment-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.obligation-form label,.tax-add-form label,.adjustment-form label { display:grid; gap:6px; color:var(--muted-strong); font-size:9px; font-weight:750; }.obligation-form .wide,.tax-add-form .wide,.adjustment-form .wide{grid-column:span 2}
.obligation-form input,.obligation-form select,.obligation-form textarea,.tax-add-form input,.tax-add-form select,.adjustment-form input,.adjustment-form select { width:100%; min-height:40px; border:1px solid #30445f; border-radius:9px; padding:8px 10px; color:var(--text); background:#111f34; outline:0; }.obligation-form textarea{resize:vertical}.obligation-form input:focus,.obligation-form select:focus,.obligation-form textarea:focus,.tax-add-form input:focus,.tax-add-form select:focus,.adjustment-form input:focus,.adjustment-form select:focus{border-color:#60a5fa;box-shadow:0 0 0 3px rgba(37,99,235,.13)}
.obligation-form-actions { display:flex; align-items:end; }.inline-danger-form{margin-top:12px}.inline-danger-form button{border:0;color:#fda4af;background:transparent;font-size:9px;font-weight:800;cursor:pointer}
.tax-readonly-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }.tax-readonly-grid > div{padding:11px;border:1px solid #263a53;border-radius:9px;background:#111f34}.tax-readonly-grid .wide{grid-column:span 3}.tax-readonly-grid span,.tax-readonly-grid strong{display:block}.tax-readonly-grid span{color:var(--muted);font-size:8px;text-transform:uppercase}.tax-readonly-grid strong{margin-top:5px;color:var(--text);font-size:10px}
.tax-add-box { margin-top:14px; border:1px dashed #3c5677; border-radius:12px; background:#0e1a2d; }.tax-add-box summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;color:#bfdbfe;font-size:10px;font-weight:850;cursor:pointer}.tax-add-box summary svg{width:18px}.tax-add-form{padding:0 16px 16px}
.compact-empty { padding:22px; border:1px dashed #334b69; border-radius:12px; text-align:center; background:#0e1a2c; }.compact-empty strong,.compact-empty span{display:block}.compact-empty strong{color:var(--text)}.compact-empty span{margin-top:5px;color:var(--muted);font-size:10px}
.adjustment-list { display:grid; gap:8px; margin-bottom:14px; }.adjustment-row{display:grid;grid-template-columns:150px minmax(0,1fr) 34px;align-items:center;gap:11px;padding:10px;border:1px solid #293e59;border-radius:10px;background:#111f34}.adjustment-type{min-height:29px;display:grid;place-items:center;border-radius:7px;padding:0 8px;color:#bfdbfe;background:#1e3a5f;font-size:8px;font-weight:850;text-align:center}.adjustment-row > div:nth-child(2) strong,.adjustment-row > div:nth-child(2) span{display:block}.adjustment-row > div:nth-child(2) strong{color:var(--text);font-size:12px}.adjustment-row > div:nth-child(2) span{margin-top:4px;color:var(--muted);font-size:9px}.mini-delete-button{width:31px;height:31px;display:grid;place-items:center;border:1px solid #633247;border-radius:8px;color:#fda4af;background:#351524;cursor:pointer}.mini-delete-button svg{width:15px}
.category-bars { display:grid; gap:13px; }.category-bar-row{display:grid;gap:6px;padding:4px;border-radius:8px}.category-bar-row:hover{background:#15243a}.category-bar-row > div:first-child{display:flex;justify-content:space-between;gap:12px}.category-bar-row span{color:var(--muted-strong);font-size:10px}.category-bar-row strong{color:var(--text);font-size:10px}.category-bar-row small{color:var(--muted);font-size:8px}.category-track{height:8px;overflow:hidden;border-radius:99px;background:#25344b}.category-track i{display:block;height:100%;border-radius:99px;background:#2563eb}.category-track .category-salud{background:#e11d48}.category-track .category-educacion{background:#7c3aed}.category-track .category-alimentacion{background:#d97706}.category-track .category-vivienda{background:#0891b2}.category-track .category-vestimenta{background:#db2777}.category-track .category-otros{background:#475569}.category-track .category-sin_clasificar{background:#64748b}
.tax-table-wrap { overflow:auto; border:1px solid #2b405b; border-radius:12px; }.tax-solid-table{width:100%;min-width:640px;border-collapse:collapse}.tax-solid-table thead th{padding:11px 12px;color:#fff;background:#1d4ed8;font-size:8px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.tax-solid-table tbody td{padding:12px;border-bottom:1px solid #293d56;color:var(--muted-strong);background:#111f34;font-size:9px}.tax-solid-table tbody tr:nth-child(even) td{background:#14243a}.tax-solid-table tbody tr:hover td{background:#18304d}.tax-solid-table tbody tr:last-child td{border-bottom:0}.tax-solid-table td strong,.tax-solid-table td small{display:block}.tax-solid-table td strong{color:var(--text);font-size:10px}.tax-solid-table td small{margin-top:3px;color:var(--muted);font-size:8px}.id-chip,.number-box{display:inline-flex;align-items:center;min-height:27px;border-radius:7px;padding:0 8px;font-size:8px;font-weight:850}.id-chip{color:#bfdbfe;background:#15345f;border:1px solid #315a93}.number-box{min-width:31px;justify-content:center;color:#cffafe;background:#164e63;border:1px solid #0891b2}.empty-cell{text-align:center;color:var(--muted)!important;padding:24px!important}.text-end{text-align:right!important}
.period-history-list { display:grid; gap:8px; }.period-history-row{display:grid;grid-template-columns:42px minmax(0,1fr) 75px;align-items:center;gap:10px;padding:10px;border:1px solid #293e59;border-radius:10px;background:#111f34}.period-history-row:hover,.period-history-row.active{border-color:#2563eb;background:#142a47}.period-month-box{width:38px;height:38px;display:grid;place-items:center;border-radius:9px;color:#bfdbfe;background:#1e3a5f;font-size:12px;font-weight:900}.period-history-row strong,.period-history-row span{display:block}.period-history-row strong{color:var(--text);font-size:10px}.period-history-row div:nth-child(2) span{margin-top:4px;color:var(--muted);font-size:8px}.period-history-status{justify-self:end;min-height:27px;display:grid;place-items:center;border-radius:7px;padding:0 8px;font-size:8px;font-weight:900}.period-history-status.abierto{color:#a7f3d0;background:#064e3b;border:1px solid #059669}.period-history-status.cerrado{color:#cbd5e1;background:#334155;border:1px solid #64748b}
.tax-footnote { display:flex;align-items:flex-start;gap:10px;padding:13px 15px;border:1px solid #30445f;border-radius:12px;color:var(--muted);background:#101d31;font-size:9px;line-height:1.55}.tax-footnote svg{width:17px;flex:0 0 auto;color:#60a5fa}

html[data-theme="light"] .solid-panel,html[data-theme="light"] .tax-stat-card { background:#fff; border-color:#cbd5e1; box-shadow:0 14px 36px rgba(15,23,42,.08); }
html[data-theme="light"] .tax-context-chip { color:#334155;background:#eff6ff;border-color:#bfdbfe; }
html[data-theme="light"] .tax-period-tools { border-left-color:#d7e0ec; }
html[data-theme="light"] .period-selector input { color:#0f172a;background:#fff;border-color:#cbd5e1; }
html[data-theme="light"] .btn-solid-secondary { color:#1e3a5f;background:#eff6ff;border-color:#bfcee1; }
html[data-theme="light"] .period-state.is-open { color:#047857;background:#ecfdf5;border-color:#6ee7b7; }
html[data-theme="light"] .period-state.is-closed { color:#475569;background:#f1f5f9;border-color:#94a3b8; }
html[data-theme="light"] .tax-callout.warning { background:#fffbeb;border-color:#f59e0b; }
html[data-theme="light"] .tax-callout strong{color:#92400e}html[data-theme="light"] .tax-callout span{color:#a16207}
html[data-theme="light"] .tax-stat-card.blue .tax-stat-icon{color:#1d4ed8;background:#dbeafe}
html[data-theme="light"] .tax-stat-card.cyan .tax-stat-icon{color:#0e7490;background:#cffafe}html[data-theme="light"] .tax-stat-card.violet .tax-stat-icon{color:#6d28d9;background:#ede9fe}html[data-theme="light"] .tax-stat-card.success .tax-stat-icon{color:#047857;background:#d1fae5}html[data-theme="light"] .tax-stat-card.danger .tax-stat-icon{color:#be123c;background:#ffe4e6}html[data-theme="light"] .tax-stat-card.info .tax-stat-icon{color:#475569;background:#e2e8f0}
html[data-theme="light"] .tax-ledger-column,html[data-theme="light"] .tax-obligation-card,html[data-theme="light"] .tax-obligation-card summary,html[data-theme="light"] .obligation-editor,html[data-theme="light"] .tax-add-box,html[data-theme="light"] .adjustment-row,html[data-theme="light"] .compact-empty,html[data-theme="light"] .period-history-row,html[data-theme="light"] .tax-footnote { background:#fff; border-color:#cbd5e1; }
html[data-theme="light"] .tax-ledger-title,html[data-theme="light"] .tax-ledger-row,html[data-theme="light"] .obligation-editor{border-color:#dbe3ed}
html[data-theme="light"] .tax-ledger-row strong,html[data-theme="light"] .obligation-main strong,html[data-theme="light"] .obligation-amount strong,html[data-theme="light"] .adjustment-row > div:nth-child(2) strong,html[data-theme="light"] .tax-readonly-grid strong { color:#0f172a; }
html[data-theme="light"] .tax-balance-bar.success{color:#047857;background:#ecfdf5;border-color:#6ee7b7}html[data-theme="light"] .tax-balance-bar.danger{color:#be123c;background:#fff1f2;border-color:#fda4af}html[data-theme="light"] .tax-balance-bar.info{color:#334155;background:#f1f5f9;border-color:#cbd5e1}
html[data-theme="light"] .progress-track,html[data-theme="light"] .category-track{background:#e2e8f0}
html[data-theme="light"] .obligation-code-box,html[data-theme="light"] .id-chip{color:#1d4ed8;background:#dbeafe;border-color:#93c5fd}html[data-theme="light"] .number-box{color:#0e7490;background:#cffafe;border-color:#67e8f9}
html[data-theme="light"] .obligation-form input,html[data-theme="light"] .obligation-form select,html[data-theme="light"] .obligation-form textarea,html[data-theme="light"] .tax-add-form input,html[data-theme="light"] .tax-add-form select,html[data-theme="light"] .adjustment-form input,html[data-theme="light"] .adjustment-form select,html[data-theme="light"] .tax-readonly-grid > div { color:#0f172a;background:#fff;border-color:#cbd5e1; }
html[data-theme="light"] .tax-add-box summary{color:#1d4ed8}html[data-theme="light"] .adjustment-type{color:#1d4ed8;background:#dbeafe}html[data-theme="light"] .category-bar-row:hover{background:#eff6ff}
html[data-theme="light"] .tax-table-wrap{border-color:#cbd5e1}html[data-theme="light"] .tax-solid-table thead th{background:#1d4ed8;color:#fff}html[data-theme="light"] .tax-solid-table tbody td{color:#334155;background:#fff;border-bottom-color:#d8e0eb}html[data-theme="light"] .tax-solid-table tbody tr:nth-child(even) td{background:#f1f5f9}html[data-theme="light"] .tax-solid-table tbody tr:hover td{background:#dbeafe}html[data-theme="light"] .tax-solid-table td strong{color:#0f172a}
html[data-theme="light"] .period-history-row:hover,html[data-theme="light"] .period-history-row.active{background:#eff6ff;border-color:#2563eb}html[data-theme="light"] .period-month-box{color:#1d4ed8;background:#dbeafe}
html[data-theme="light"] .tax-footnote{color:#475569;background:#f8fafc}
html[data-theme="light"] .status-pendiente{color:#92400e;background:#fef3c7;border-color:#f59e0b}html[data-theme="light"] .status-vencida{color:#be123c;background:#ffe4e6;border-color:#fb7185}html[data-theme="light"] .status-presentada,html[data-theme="light"] .status-pagada{color:#047857;background:#d1fae5;border-color:#34d399}html[data-theme="light"] .status-no_aplica{color:#475569;background:#e2e8f0;border-color:#94a3b8}

@media (max-width:1280px){.tax-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tax-hero{grid-template-columns:1fr}.tax-period-tools{padding-left:0;padding-top:18px;border-left:0;border-top:1px solid var(--border)}}
@media (max-width:1050px){.tax-two-column{grid-template-columns:1fr}.tax-obligation-card summary{grid-template-columns:78px minmax(0,1fr) 100px 100px 20px}}
@media (max-width:780px){.tax-stat-grid{grid-template-columns:1fr}.tax-ledger{grid-template-columns:1fr}.tax-obligation-card summary{grid-template-columns:70px minmax(0,1fr) 92px 20px}.tax-obligation-card summary .obligation-status{grid-column:2/4;justify-self:start}.obligation-form,.tax-add-form,.adjustment-form{grid-template-columns:1fr 1fr}.obligation-form .wide,.tax-add-form .wide,.adjustment-form .wide{grid-column:1/-1}.tax-readonly-grid{grid-template-columns:1fr 1fr}.tax-readonly-grid .wide{grid-column:1/-1}.tax-column-chart{overflow-x:auto}.tax-chart-group{min-width:35px}}
@media (max-width:560px){.tax-hero,.tax-liquidation-panel,.tax-chart-panel,.tax-obligations-panel,.tax-two-column>.solid-panel{padding:16px}.period-selector-row{grid-template-columns:1fr}.tax-hero-actions>*{width:100%}.tax-hero-actions form button{width:100%}.tax-obligation-card summary{grid-template-columns:62px minmax(0,1fr) 20px}.obligation-amount,.obligation-status{grid-column:2/3!important;justify-self:start!important}.obligation-form,.tax-add-form,.adjustment-form,.tax-readonly-grid{grid-template-columns:1fr}.obligation-form .wide,.tax-add-form .wide,.adjustment-form .wide,.tax-readonly-grid .wide{grid-column:auto}.adjustment-row{grid-template-columns:1fr 34px}.adjustment-type{grid-column:1/3;justify-self:start}.period-history-row{grid-template-columns:40px minmax(0,1fr)}.period-history-status{grid-column:2;justify-self:start}.panel-title-row{align-items:flex-start;flex-direction:column}.obligation-progress{width:100%;min-width:0}}

/* v0.7.0 · Centro documental, descargas por rango y representaciones imprimibles */
.signature-scope-notice {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 14px 0 16px;
    padding: 15px 17px;
    border: 1px solid #1d4ed8;
    border-left-width: 5px;
    border-radius: 15px;
    background: #101f36;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .17);
}
.signature-scope-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #2563eb;
    border-radius: 11px;
    color: #bfdbfe;
    background: #15345f;
}
.signature-scope-icon svg { width: 22px; height: 22px; }
.signature-scope-notice strong { display: block; color: #f8fafc; font-size: 13px; }
.signature-scope-notice p { margin: 4px 0 0; color: #b8c4d6; font-size: 11px; line-height: 1.55; }
.solid-badge { display: inline-flex; min-height: 28px; align-items: center; justify-content: center; padding: 0 10px; border-radius: 7px; font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.solid-badge.success { color: #a7f3d0; border: 1px solid #059669; background: #064e3b; }
.compact-date-field { display: grid; gap: 4px; min-width: 145px; }
.compact-date-field > span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.compact-date-field input { width: 100%; }
.document-bulk-bar {
    display: grid;
    grid-template-columns: auto minmax(270px, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    padding: 13px 14px;
    border: 1px solid #29415e;
    border-radius: 13px;
    background: #101d31;
}
.document-selection-summary { display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.document-selection-summary strong { color: #cbd5e1; font-size: 10px; }
.document-selection-summary strong b { color: #93c5fd; font-size: 12px; }
.selection-master, .document-download-options > label { display: inline-flex; align-items: center; gap: 8px; color: #dbe5f2; font-size: 10px; font-weight: 750; cursor: pointer; }
.selection-master input, .document-download-options input, .row-selector input { position: absolute; opacity: 0; pointer-events: none; }
.selection-master > span, .row-selector > span, .document-download-options > label:not(.version-selector) > span::before {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #55708f;
    border-radius: 5px;
    background: #0c1829;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.selection-master input:checked + span, .row-selector input:checked + span { border-color: #2563eb; background: #2563eb; box-shadow: inset 0 0 0 4px #2563eb; }
.selection-master input:checked + span::after, .row-selector input:checked + span::after {
    content: '';
    width: 8px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateY(-1px) rotate(-45deg);
}
.document-download-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.document-download-options > label:not(.version-selector) > span { display: inline-flex; align-items: center; gap: 8px; }
.document-download-options > label:not(.version-selector) > span::before { content: ''; }
.document-download-options > label:not(.version-selector) input:checked + span::before { border-color: #0891b2; background: #0891b2; box-shadow: inset 0 0 0 4px #0891b2; }
.document-download-options > label:not(.version-selector) input:checked + span::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 4px;
    margin-left: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateY(-1px) rotate(-45deg);
}
.version-selector { gap: 7px !important; }
.version-selector > span { color: #8fa2ba; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.version-selector select { min-height: 34px; border: 1px solid #3a526f; border-radius: 8px; padding: 0 31px 0 9px; color: #dbe5f2; background: #0c1829; font-size: 9px; outline: 0; }
.document-bulk-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.outline-action-button, .solid-action-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 9px;
    padding: 0 11px;
    font-size: 9px;
    font-weight: 850;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.outline-action-button { border: 1px solid #3b5878; color: #dbeafe; background: #13243a; }
.outline-action-button:hover { border-color: #3b82f6; color: #fff; background: #18365b; transform: translateY(-1px); }
.solid-action-button { border: 1px solid #2563eb; color: #fff; background: #1d4ed8; }
.solid-action-button:hover { background: #1e40af; transform: translateY(-1px); }
.outline-action-button svg, .solid-action-button svg { width: 15px; height: 15px; }
.outline-action-button:disabled, .solid-action-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.selection-column { width: 42px; min-width: 42px; text-align: center !important; }
.row-selector { width: 25px; height: 25px; display: inline-grid; place-items: center; cursor: pointer; }
.row-selector > span { width: 17px; height: 17px; }
.solid-data-table tbody tr.is-document-selected td { background: #173454 !important; border-bottom-color: #315b86 !important; }
.download-history-panel {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-solid);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .14);
}
.download-history-panel .document-list-heading { margin-bottom: 13px; }
.download-history-panel .document-list-heading > small { color: var(--muted); font-size: 9px; }
.download-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.download-history-grid article {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 10px 12px;
    border: 1px solid #293f5a;
    border-radius: 11px;
    background: #101d31;
}
.download-history-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #2563eb; border-radius: 9px; color: #bfdbfe; background: #15345f; }
.download-history-icon svg { width: 17px; height: 17px; }
.download-history-grid article > div:nth-child(2) strong, .download-history-grid article > div:nth-child(2) span { display: block; }
.download-history-grid article > div:nth-child(2) strong { color: var(--text); font-size: 10px; }
.download-history-grid article > div:nth-child(2) span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.download-history-meta { text-align: right; }
.download-history-meta span, .download-history-meta strong { display: block; }
.download-history-meta span { color: #93c5fd; font-size: 8px; font-weight: 850; }
.download-history-meta strong { margin-top: 4px; color: #cbd5e1; font-size: 9px; }

html[data-theme="light"] .signature-scope-notice { border-color: #2563eb; background: #eff6ff; box-shadow: 0 13px 30px rgba(15, 23, 42, .08); }
html[data-theme="light"] .signature-scope-icon { color: #1d4ed8; border-color: #60a5fa; background: #dbeafe; }
html[data-theme="light"] .signature-scope-notice strong { color: #0f172a; }
html[data-theme="light"] .signature-scope-notice p { color: #475569; }
html[data-theme="light"] .solid-badge.success { color: #047857; border-color: #34d399; background: #d1fae5; }
html[data-theme="light"] .document-bulk-bar { border-color: #cbd5e1; background: #f8fafc; }
html[data-theme="light"] .document-selection-summary strong, html[data-theme="light"] .selection-master, html[data-theme="light"] .document-download-options > label { color: #334155; }
html[data-theme="light"] .document-selection-summary strong b { color: #1d4ed8; }
html[data-theme="light"] .selection-master > span, html[data-theme="light"] .row-selector > span, html[data-theme="light"] .document-download-options > label:not(.version-selector) > span::before { border-color: #94a3b8; background: #fff; }
html[data-theme="light"] .version-selector > span { color: #64748b; }
html[data-theme="light"] .version-selector select { color: #0f172a; border-color: #cbd5e1; background: #fff; }
html[data-theme="light"] .outline-action-button { color: #1e3a5f; border-color: #aabbd1; background: #fff; }
html[data-theme="light"] .outline-action-button:hover { color: #1d4ed8; border-color: #2563eb; background: #eff6ff; }
html[data-theme="light"] .solid-data-table tbody tr.is-document-selected td { background: #dbeafe !important; border-bottom-color: #93c5fd !important; }
html[data-theme="light"] .download-history-panel { background: #fff; border-color: #cbd5e1; box-shadow: 0 16px 38px rgba(15, 23, 42, .08); }
html[data-theme="light"] .download-history-grid article { border-color: #d6dee9; background: #f8fafc; }
html[data-theme="light"] .download-history-icon { color: #1d4ed8; border-color: #60a5fa; background: #dbeafe; }
html[data-theme="light"] .download-history-meta strong { color: #334155; }

@media (max-width: 1280px) {
    .document-bulk-bar { grid-template-columns: 1fr; }
    .document-selection-summary, .document-download-options, .document-bulk-actions { justify-content: flex-start; }
}
@media (max-width: 780px) {
    .signature-scope-notice { grid-template-columns: 42px minmax(0, 1fr); }
    .signature-scope-notice .solid-badge { grid-column: 2; justify-self: start; }
    .document-download-options { align-items: flex-start; flex-direction: column; }
    .document-bulk-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .document-bulk-actions > * { width: 100%; }
    .download-history-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .signature-scope-notice { grid-template-columns: 1fr; }
    .signature-scope-icon, .signature-scope-notice .solid-badge { grid-column: 1; }
    .document-selection-summary { align-items: flex-start; flex-direction: column; }
    .document-bulk-actions { grid-template-columns: 1fr; }
    .download-history-grid article { grid-template-columns: 36px minmax(0, 1fr); }
    .download-history-meta { grid-column: 2; text-align: left; }
}
.document-download-options > label:not(.version-selector) > span { position: relative; }
.document-download-options > label:not(.version-selector) input:checked + span::after { left: 0; top: 50%; transform: translateY(-65%) rotate(-45deg); }

/* ============================================================
   SRI Control 0.8.0 - Conexión autenticada y sincronización
   ============================================================ */
.nav-item-badge{margin-left:auto;padding:.18rem .42rem;border-radius:.45rem;background:#1d4ed8;color:#fff;font-size:.58rem;font-weight:800;letter-spacing:.08em}.portal-hero{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:1.8rem 2rem;margin-bottom:1.35rem;border:1px solid var(--border-color,#dbe4f0);border-radius:24px;background:var(--card-bg,#fff);box-shadow:0 18px 45px rgba(15,23,42,.07)}.portal-hero-copy{max-width:780px}.portal-hero h1{margin:.2rem 0 .55rem;font-size:clamp(1.65rem,2.4vw,2.55rem);line-height:1.08;letter-spacing:-.035em;color:var(--text-primary,#0f172a)}.portal-hero p{margin:0;color:var(--text-secondary,#64748b);font-size:.98rem;line-height:1.65}.portal-status-card{display:flex;align-items:center;gap:.8rem;min-width:270px;padding:1rem 1.15rem;border-radius:17px;border:1px solid #dbe4f0;background:#f8fafc}.portal-status-card.is-connected{background:#ecfdf5;border-color:#a7f3d0}.portal-status-card.is-disconnected{background:#f8fafc}.portal-status-dot{width:.72rem;height:.72rem;border-radius:50%;background:#94a3b8;box-shadow:0 0 0 5px rgba(148,163,184,.13)}.portal-status-card.is-connected .portal-status-dot{background:#10b981;box-shadow:0 0 0 5px rgba(16,185,129,.13)}.portal-status-card div{display:flex;flex-direction:column}.portal-status-card small{font-size:.68rem;text-transform:uppercase;letter-spacing:.08em;color:#64748b;font-weight:800}.portal-status-card strong{font-size:.9rem;color:#0f172a;margin:.15rem 0}.portal-status-card span:last-child{font-size:.75rem;color:#64748b}.portal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.35rem}.portal-grid-top{align-items:stretch}.portal-grid-bottom{margin-top:1.35rem}.portal-panel{border:1px solid var(--border-color,#dbe4f0);border-radius:24px;background:var(--card-bg,#fff);padding:1.5rem;box-shadow:0 16px 42px rgba(15,23,42,.06)}.portal-panel-head{display:flex;gap:1rem;align-items:flex-start;padding-bottom:1.15rem;border-bottom:1px solid var(--border-color,#e2e8f0);margin-bottom:1.15rem}.portal-icon-box{width:3rem;height:3rem;border-radius:14px;display:grid;place-items:center;flex:0 0 auto}.portal-icon-box svg{width:1.45rem;height:1.45rem}.portal-icon-blue{background:#dbeafe;color:#1d4ed8}.portal-icon-cyan{background:#cffafe;color:#0e7490}.portal-eyebrow,.section-kicker{display:block;text-transform:uppercase;letter-spacing:.13em;font-size:.66rem;font-weight:900;color:#4f46e5;margin-bottom:.32rem}.portal-panel h2,.portal-section-head h2{margin:0;color:var(--text-primary,#0f172a);font-size:1.25rem;letter-spacing:-.02em}.portal-panel-head p,.portal-section-head p{margin:.35rem 0 0;color:var(--text-secondary,#64748b);font-size:.83rem;line-height:1.5}.portal-form,.portal-sync-form{display:grid;gap:1rem}.portal-sync-form{grid-template-columns:repeat(4,minmax(0,1fr))}.portal-field{display:flex;flex-direction:column;gap:.42rem}.portal-field>span{font-size:.75rem;font-weight:800;color:var(--text-primary,#334155)}.portal-field input,.portal-field select,.portal-filter-bar input,.portal-filter-bar select{width:100%;height:46px;border:1px solid var(--border-color,#d5deea);border-radius:12px;background:var(--input-bg,#fff);color:var(--text-primary,#0f172a);padding:0 .85rem;outline:none;transition:.18s ease;font-size:.86rem}.portal-field input:focus,.portal-field select:focus,.portal-filter-bar input:focus,.portal-filter-bar select:focus{border-color:#4f46e5;box-shadow:0 0 0 4px rgba(79,70,229,.11)}.portal-input-wrap{display:flex;align-items:center;border:1px solid var(--border-color,#d5deea);border-radius:12px;background:var(--input-bg,#fff);height:48px;padding:0 .75rem;transition:.18s ease}.portal-input-wrap:focus-within{border-color:#4f46e5;box-shadow:0 0 0 4px rgba(79,70,229,.11)}.portal-input-wrap>svg{width:1.05rem;height:1.05rem;color:#64748b;flex:0 0 auto}.portal-input-wrap input{border:0!important;box-shadow:none!important;height:44px;padding:0 .7rem;background:transparent}.portal-input-action{border:0;background:transparent;color:#64748b;width:2rem;height:2rem;display:grid;place-items:center;border-radius:8px}.portal-input-action:hover{background:#eef2ff;color:#4338ca}.portal-input-action svg{width:1.05rem}.portal-consent{display:flex;gap:.7rem;align-items:flex-start;padding:.85rem 1rem;border-radius:13px;background:#f8fafc;border:1px solid #e2e8f0}.portal-consent svg{width:1.15rem;flex:0 0 auto;color:#2563eb;margin-top:.08rem}.portal-consent p{margin:0;font-size:.76rem;line-height:1.45;color:#64748b}.portal-button{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:43px;padding:.68rem 1rem;border-radius:11px;border:1px solid transparent;text-decoration:none;font-size:.79rem;font-weight:800;cursor:pointer;transition:.18s ease;white-space:nowrap}.portal-button svg{width:1rem;height:1rem}.portal-button:hover{transform:translateY(-1px)}.portal-button-primary{background:#2563eb;color:#fff;border-color:#2563eb;box-shadow:0 8px 18px rgba(37,99,235,.18)}.portal-button-primary:hover{background:#1d4ed8;color:#fff}.portal-button-danger{background:#fff1f2;color:#be123c;border-color:#fecdd3}.portal-button-muted{background:#f1f5f9;color:#334155;border-color:#e2e8f0}.portal-button-outline{background:transparent;color:#2563eb;border-color:#bfdbfe}.portal-button-full{width:100%}.portal-inline-form{margin-top:1rem}.portal-connected-summary{display:flex;align-items:center;gap:.85rem;padding:1rem;border:1px solid #bbf7d0;border-radius:16px;background:#f0fdf4}.portal-account-avatar{width:2.8rem;height:2.8rem;border-radius:13px;display:grid;place-items:center;background:#16a34a;color:#fff;font-weight:900;font-size:1.1rem}.portal-connected-summary>div:nth-child(2){display:flex;flex-direction:column;flex:1}.portal-connected-summary span{font-size:.7rem;color:#64748b}.portal-connected-summary strong{color:#0f172a;font-size:1rem;margin:.15rem 0}.portal-connected-summary small{color:#64748b}.portal-security-notes{display:grid;grid-template-columns:repeat(3,1fr);gap:.65rem;margin-top:.9rem}.portal-security-notes>div{display:flex;align-items:center;gap:.45rem;padding:.65rem;border-radius:11px;background:#f8fafc;border:1px solid #e2e8f0;color:#475569;font-size:.68rem;font-weight:700}.portal-security-notes svg{width:1rem;color:#2563eb;flex:0 0 auto}.portal-field-wide{grid-column:span 2}.portal-field-full{grid-column:1/-1}.portal-sync-actions{display:flex;justify-content:flex-end;gap:.65rem;padding-top:.15rem}.portal-empty-state{min-height:190px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem;border:1px dashed #cbd5e1;border-radius:16px;background:#f8fafc}.portal-empty-compact{min-height:250px}.portal-empty-icon{width:3.1rem;height:3.1rem;display:grid;place-items:center;border-radius:15px;background:#e0e7ff;color:#4338ca;margin-bottom:.8rem}.portal-empty-icon svg{width:1.45rem}.portal-empty-state strong{color:#0f172a;font-size:.95rem}.portal-empty-state span{color:#64748b;margin-top:.35rem;font-size:.8rem}.portal-captcha-card{display:grid;grid-template-columns:1.25fr 1fr .8fr;gap:1rem;align-items:center;padding:1rem;border-radius:16px;background:#fffbeb;border:1px solid #fde68a}.portal-captcha-copy strong{display:block;color:#78350f}.portal-captcha-copy p{margin:.25rem 0 0;font-size:.75rem;color:#92400e}.portal-captcha-image{height:76px;border:1px solid #fcd34d;border-radius:12px;background:#fff;display:grid;place-items:center;overflow:hidden}.portal-captcha-image img{max-width:100%;max-height:100%;object-fit:contain}.portal-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin:1.35rem 0}.portal-stat{position:relative;overflow:hidden;border:1px solid var(--border-color,#dbe4f0);border-radius:18px;background:var(--card-bg,#fff);padding:1.15rem 1.2rem;box-shadow:0 12px 30px rgba(15,23,42,.05)}.portal-stat:before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:#2563eb}.portal-stat-cyan:before{background:#0891b2}.portal-stat-violet:before{background:#7c3aed}.portal-stat-green:before{background:#16a34a}.portal-stat span{display:block;text-transform:uppercase;letter-spacing:.08em;font-size:.65rem;font-weight:900;color:#64748b}.portal-stat strong{display:block;margin:.42rem 0 .25rem;color:var(--text-primary,#0f172a);font-size:1.55rem}.portal-stat small{font-size:.72rem;color:#64748b}.portal-documents-panel{margin-top:0}.portal-section-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.15rem}.portal-section-head-compact{margin-bottom:.9rem}.portal-filter-bar{display:grid;grid-template-columns:minmax(220px,1.8fr) repeat(2,minmax(150px,.8fr)) repeat(2,minmax(140px,.7fr)) auto auto;gap:.65rem;padding:1rem;border-radius:15px;background:#f8fafc;border:1px solid #e2e8f0;margin-bottom:1rem}.portal-search-field{height:46px;display:flex;align-items:center;border:1px solid #d5deea;border-radius:12px;background:#fff;padding:0 .75rem}.portal-search-field:focus-within{border-color:#4f46e5;box-shadow:0 0 0 4px rgba(79,70,229,.1)}.portal-search-field svg{width:1rem;color:#64748b}.portal-search-field input{border:0!important;box-shadow:none!important;background:transparent;padding-left:.55rem}.portal-table-wrap{overflow:auto;border:1px solid #cbd5e1;border-radius:16px}.portal-table{width:100%;border-collapse:separate;border-spacing:0;min-width:980px}.portal-table thead th{background:#1d4ed8;color:#fff;padding:.85rem .9rem;font-size:.66rem;text-transform:uppercase;letter-spacing:.08em;text-align:left}.portal-table tbody td{padding:.85rem .9rem;border-bottom:1px solid #e2e8f0;color:var(--text-primary,#334155);font-size:.78rem;background:var(--card-bg,#fff)}.portal-table tbody tr:nth-child(even) td{background:#f8fafc}.portal-table tbody tr:last-child td{border-bottom:0}.portal-table tbody tr:hover td{background:#eff6ff}.portal-align-right{text-align:right!important}.portal-doc-cell{display:flex;align-items:center;gap:.65rem}.portal-doc-cell>div{display:flex;flex-direction:column}.portal-doc-cell strong{color:var(--text-primary,#0f172a);font-size:.78rem}.portal-doc-cell small{color:#64748b;margin-top:.15rem}.portal-doc-badge{width:2rem;height:2rem;border-radius:9px;background:#dbeafe;color:#1d4ed8;display:grid;place-items:center;font-size:.65rem;font-weight:900}.portal-copy-value,.portal-access-key{display:flex;align-items:center;gap:.35rem}.portal-copy-value code{padding:.28rem .45rem;border-radius:7px;background:#e0f2fe;color:#075985;font-family:inherit;font-weight:800;font-size:.72rem}.portal-copy-value button,.portal-access-key button{border:0;background:#eef2ff;color:#4338ca;width:1.8rem;height:1.8rem;border-radius:8px;display:grid;place-items:center}.portal-copy-value button svg,.portal-access-key button svg{width:.9rem}.portal-date-chip{display:inline-flex;padding:.3rem .5rem;border-radius:8px;background:#f1f5f9;color:#334155;font-weight:700}.portal-access-key span{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.7rem;color:#475569}.status-pill{display:inline-flex;align-items:center;justify-content:center;min-height:27px;padding:.28rem .65rem;border-radius:999px;font-size:.62rem;font-weight:900;letter-spacing:.04em;text-transform:uppercase;border:1px solid transparent}.status-pill-success{background:#dcfce7;color:#166534;border-color:#86efac}.status-pill-danger{background:#ffe4e6;color:#be123c;border-color:#fda4af}.status-pill-warning{background:#fef3c7;color:#92400e;border-color:#fcd34d}.status-pill-neutral{background:#e2e8f0;color:#475569;border-color:#cbd5e1}.portal-timeline,.portal-coverage-list{display:flex;flex-direction:column;gap:.55rem}.portal-timeline article,.portal-coverage-list article{display:flex;align-items:center;gap:.7rem;padding:.78rem;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}.portal-timeline article>div,.portal-coverage-list article>div{display:flex;flex-direction:column;flex:1;min-width:0}.portal-timeline strong,.portal-coverage-list strong{font-size:.78rem;color:#0f172a}.portal-timeline span:not(.status-pill):not(.portal-timeline-dot),.portal-coverage-list span:not(.status-pill){font-size:.69rem;color:#64748b;margin-top:.18rem}.portal-timeline small{font-size:.63rem;color:#64748b}.portal-timeline-dot{width:.65rem;height:.65rem;border-radius:50%;background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.13);flex:0 0 auto}.portal-timeline-dot.is-success{background:#10b981;box-shadow:0 0 0 4px rgba(16,185,129,.13)}.portal-timeline-dot.is-error{background:#e11d48;box-shadow:0 0 0 4px rgba(225,29,72,.13)}.portal-empty-list{padding:1.4rem;text-align:center;border:1px dashed #cbd5e1;border-radius:12px;color:#64748b;background:#f8fafc;font-size:.78rem}

[data-theme="dark"] .portal-hero,[data-theme="dark"] .portal-panel,[data-theme="dark"] .portal-stat{background:#0f1a2d;border-color:#263653;box-shadow:0 18px 45px rgba(0,0,0,.22)}[data-theme="dark"] .portal-hero h1,[data-theme="dark"] .portal-panel h2,[data-theme="dark"] .portal-section-head h2,[data-theme="dark"] .portal-stat strong,[data-theme="dark"] .portal-field>span{color:#f8fafc}[data-theme="dark"] .portal-hero p,[data-theme="dark"] .portal-panel-head p,[data-theme="dark"] .portal-section-head p,[data-theme="dark"] .portal-stat small{color:#9fb0c8}[data-theme="dark"] .portal-status-card{background:#111f34;border-color:#2d405f}[data-theme="dark"] .portal-status-card.is-connected{background:#0b2b24;border-color:#166534}[data-theme="dark"] .portal-status-card strong{color:#f8fafc}[data-theme="dark"] .portal-input-wrap,[data-theme="dark"] .portal-field input,[data-theme="dark"] .portal-field select,[data-theme="dark"] .portal-filter-bar input,[data-theme="dark"] .portal-filter-bar select,[data-theme="dark"] .portal-search-field{background:#0b1526;border-color:#2a3b59;color:#e5edf8}[data-theme="dark"] .portal-consent,[data-theme="dark"] .portal-security-notes>div,[data-theme="dark"] .portal-filter-bar,[data-theme="dark"] .portal-empty-state,[data-theme="dark"] .portal-empty-list,[data-theme="dark"] .portal-timeline article,[data-theme="dark"] .portal-coverage-list article{background:#101c30;border-color:#2a3b59}[data-theme="dark"] .portal-connected-summary{background:#092820;border-color:#166534}[data-theme="dark"] .portal-connected-summary strong,[data-theme="dark"] .portal-empty-state strong,[data-theme="dark"] .portal-timeline strong,[data-theme="dark"] .portal-coverage-list strong{color:#f8fafc}[data-theme="dark"] .portal-table-wrap{border-color:#334765}[data-theme="dark"] .portal-table thead th{background:#2554b9}[data-theme="dark"] .portal-table tbody td{background:#142035;border-color:#2a3b59;color:#dce7f5}[data-theme="dark"] .portal-table tbody tr:nth-child(even) td{background:#101b2e}[data-theme="dark"] .portal-table tbody tr:hover td{background:#192b47}[data-theme="dark"] .portal-doc-cell strong{color:#f8fafc}[data-theme="dark"] .portal-date-chip{background:#22314a;color:#dce7f5}[data-theme="dark"] .portal-copy-value code{background:#12314a;color:#7dd3fc}[data-theme="dark"] .portal-access-key span{color:#b9c7da}[data-theme="dark"] .status-pill-neutral{background:#26364e;color:#d8e2ef;border-color:#3b4f6e}

@media (max-width:1200px){.portal-filter-bar{grid-template-columns:repeat(3,minmax(0,1fr))}.portal-search-field{grid-column:span 3}.portal-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-sync-form{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-field-wide{grid-column:span 1}.portal-captcha-card{grid-template-columns:1fr 1fr}.portal-captcha-copy{grid-column:1/-1}}
@media (max-width:900px){.portal-grid{grid-template-columns:1fr}.portal-hero{align-items:flex-start;flex-direction:column}.portal-status-card{width:100%;min-width:0}.portal-security-notes{grid-template-columns:1fr}.portal-filter-bar{grid-template-columns:1fr 1fr}.portal-search-field{grid-column:1/-1}.portal-grid-bottom{grid-template-columns:1fr}}
@media (max-width:640px){.portal-hero,.portal-panel{padding:1rem;border-radius:17px}.portal-stat-grid{grid-template-columns:1fr}.portal-sync-form,.portal-filter-bar{grid-template-columns:1fr}.portal-search-field{grid-column:auto}.portal-captcha-card{grid-template-columns:1fr}.portal-sync-actions{flex-direction:column}.portal-button{width:100%}.portal-section-head{align-items:flex-start;flex-direction:column}.portal-status-card{padding:.85rem}.portal-table-wrap{margin-left:-.2rem;margin-right:-.2rem}}
.sri-sync-strip{display:flex;align-items:center;gap:1rem;padding:1rem 1.15rem;margin-bottom:1rem;border:1px solid #bfdbfe;border-radius:16px;background:#eff6ff}.sri-sync-strip-icon{width:2.65rem;height:2.65rem;border-radius:12px;background:#2563eb;color:#fff;display:grid;place-items:center;flex:0 0 auto}.sri-sync-strip-icon svg{width:1.25rem}.sri-sync-strip-copy{flex:1}.sri-sync-strip-copy strong{display:block;color:#0f172a;font-size:.84rem}.sri-sync-strip-copy p{margin:.2rem 0 0;color:#64748b;font-size:.74rem}.sri-sync-strip-metrics{display:flex;gap:.45rem}.sri-sync-strip-metrics span{display:flex;align-items:center;gap:.25rem;padding:.42rem .65rem;border-radius:999px;background:#fff;border:1px solid #dbeafe;color:#475569;font-size:.68rem}.sri-sync-strip-metrics b{color:#1d4ed8}.primary-button.compact{min-height:39px;padding:.58rem .85rem;font-size:.72rem}[data-theme="dark"] .sri-sync-strip{background:#10223c;border-color:#274d85}[data-theme="dark"] .sri-sync-strip-copy strong{color:#f8fafc}[data-theme="dark"] .sri-sync-strip-metrics span{background:#13233a;border-color:#2e4770;color:#c7d5e8}[data-theme="dark"] .sri-sync-strip-metrics b{color:#7db4ff}@media(max-width:900px){.sri-sync-strip{align-items:flex-start;flex-wrap:wrap}.sri-sync-strip-copy{min-width:calc(100% - 4rem)}.sri-sync-strip-metrics{margin-left:3.65rem}}@media(max-width:640px){.sri-sync-strip{flex-direction:column}.sri-sync-strip-copy{min-width:0}.sri-sync-strip-metrics{margin-left:0;flex-wrap:wrap}.sri-sync-strip .primary-button{width:100%}}

.portal-file-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
}
.portal-file-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.8rem;
    min-height: 2rem;
    padding: .35rem .65rem;
    border: 1px solid #bfdbfe;
    border-radius: .65rem;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-decoration: none;
}
.portal-file-actions a:hover { background: #dbeafe; border-color: #93c5fd; }
.portal-file-actions span { color: var(--text-muted); font-size: .72rem; }
[data-theme="dark"] .portal-file-actions a {
    background: #172554;
    border-color: #1e40af;
    color: #bfdbfe;
}
[data-theme="dark"] .portal-file-actions a:hover { background: #1e3a8a; }

.portal-center-panel {
    margin-top: 1.25rem;
    padding: 1.35rem;
    border: 1px solid var(--border-color);
    border-radius: 1.35rem;
    background: var(--surface-primary);
    box-shadow: var(--shadow-soft);
}

/* SRI Control 0.8.2 — conexión operativa, reportes oficiales y recuperación XML */
.portal-report-panel {
    border-top: 4px solid #2563eb;
    overflow: hidden;
}
.portal-report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
    gap: 28px;
    align-items: center;
}
.portal-report-copy h2 {
    margin: 8px 0 10px;
    color: var(--text-primary, #0f172a);
    font-size: clamp(1.35rem, 2vw, 1.85rem);
}
.portal-report-copy > p {
    max-width: 820px;
    margin: 0;
    color: var(--text-secondary, #475569);
    line-height: 1.7;
}
.portal-report-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.portal-report-steps span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-size: .83rem;
    font-weight: 700;
}
.portal-report-steps strong {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 7px;
    background: #2563eb;
    color: #fff;
    font-size: .75rem;
}
.portal-report-form {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #eff6ff;
}
.portal-upload-field {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 14px;
    border: 1px dashed #60a5fa;
    border-radius: 12px;
    background: #fff;
    color: #1e3a8a;
    cursor: pointer;
}
.portal-upload-field:hover { border-color: #2563eb; }
.portal-upload-field input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.portal-upload-field svg {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
}
.portal-upload-field span { display: grid; gap: 2px; }
.portal-upload-field small { color: #64748b; font-weight: 500; }
.portal-recovery-form { display: grid; gap: 14px; }
.portal-batch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}
.portal-batch-toolbar > div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}
.portal-check-all {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #0f172a;
    font-size: .84rem;
    font-weight: 800;
}
.portal-check-all input,
.portal-select-col input {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}
.portal-batch-note {
    color: #64748b;
    font-size: .78rem;
}
.portal-select-col { width: 52px; text-align: center !important; }
.portal-table tr.is-document-selected td { background: #eff6ff; }
.portal-table tr.is-document-selected td:first-child { box-shadow: inset 3px 0 0 #2563eb; }

[data-theme="dark"] .portal-report-copy h2 { color: #f8fafc; }
[data-theme="dark"] .portal-report-copy > p { color: #cbd5e1; }
[data-theme="dark"] .portal-report-steps span {
    border-color: #334155;
    background: #111c31;
    color: #dbeafe;
}
[data-theme="dark"] .portal-report-form {
    border-color: #1d4ed8;
    background: #0f1c36;
}
[data-theme="dark"] .portal-upload-field {
    border-color: #3b82f6;
    background: #0b1326;
    color: #bfdbfe;
}
[data-theme="dark"] .portal-upload-field small,
[data-theme="dark"] .portal-batch-note { color: #94a3b8; }
[data-theme="dark"] .portal-batch-toolbar {
    border-color: #263754;
    background: #0b1427;
}
[data-theme="dark"] .portal-check-all { color: #e2e8f0; }
[data-theme="dark"] .portal-table tr.is-document-selected td { background: #102349; }

@media (max-width: 980px) {
    .portal-report-layout { grid-template-columns: 1fr; }
    .portal-batch-toolbar,
    .portal-batch-toolbar > div { align-items: stretch; flex-direction: column; }
    .portal-batch-toolbar > div { width: 100%; }
    .portal-batch-toolbar .portal-button { width: 100%; justify-content: center; }
}
.portal-inline-recover {
    border: 1px solid #2563eb;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    padding: 7px 9px;
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.portal-inline-recover:hover { background: #1d4ed8; border-color: #1d4ed8; }
[data-theme="dark"] .portal-inline-recover { background: #3b82f6; border-color: #3b82f6; color: #071225; }

/* v0.8.2 - conexión SRI resiliente */
.portal-session-fallback {
    margin-top: 1rem;
    border: 1px solid var(--border-color, #dbe3f0);
    border-radius: 16px;
    background: var(--surface-muted, #f8fafc);
    overflow: hidden;
}
.portal-session-fallback > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.95rem 1rem;
    font-weight: 800;
    color: var(--text-primary, #13213a);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.portal-session-fallback > summary::-webkit-details-marker { display: none; }
.portal-session-fallback > summary::after {
    content: '+';
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    background: #e8edff;
    color: #3d4df2;
    font-size: 1.05rem;
}
.portal-session-fallback[open] > summary::after { content: '−'; }
.portal-session-fallback-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border-color, #dbe3f0);
}
.portal-session-fallback-copy { padding: 1rem 0 0.8rem; }
.portal-session-fallback-copy strong {
    display: block;
    color: var(--text-primary, #13213a);
    margin-bottom: 0.35rem;
}
.portal-session-fallback-copy p {
    margin: 0;
    color: var(--text-secondary, #61708a);
    line-height: 1.6;
    font-size: 0.88rem;
}
.portal-session-fallback-copy code {
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    background: #e9eef8;
    color: #273b65;
}
.portal-browser-session-form textarea,
.portal-file-input {
    width: 100%;
    border: 1px solid var(--border-color, #d7dfeb);
    border-radius: 12px;
    background: var(--surface-card, #fff);
    color: var(--text-primary, #13213a);
    padding: 0.8rem 0.9rem;
    outline: none;
}
.portal-browser-session-form textarea:focus,
.portal-file-input:focus {
    border-color: #4f5df5;
    box-shadow: 0 0 0 3px rgba(79, 93, 245, 0.12);
}
.portal-consent-compact { margin-top: 0.15rem; }
[data-theme="dark"] .portal-session-fallback {
    background: #0f1a2e;
    border-color: #263651;
}
[data-theme="dark"] .portal-session-fallback > summary,
[data-theme="dark"] .portal-session-fallback-copy strong { color: #f5f7ff; }
[data-theme="dark"] .portal-session-fallback-copy p { color: #aebbd1; }
[data-theme="dark"] .portal-session-fallback-copy code {
    background: #172640;
    color: #cbd5ff;
}
[data-theme="dark"] .portal-browser-session-form textarea,
[data-theme="dark"] .portal-file-input {
    background: #0b1527;
    border-color: #2a3a56;
    color: #f5f7ff;
}

/* v0.8.2 · Conexión SRI resiliente y diagnóstico local */
.portal-diagnostic-action {
    margin-top: .75rem;
}
.portal-diagnostic-panel {
    margin-top: 1.25rem;
}
.portal-diagnostic-panel .portal-panel-head {
    align-items: center;
}
.portal-diagnostic-panel .status-pill {
    margin-left: auto;
}
.portal-diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin-top: 1.1rem;
}
.portal-diagnostic-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: var(--surface-soft);
}
.portal-diagnostic-item.is-ok {
    border-color: rgba(16, 185, 129, .28);
}
.portal-diagnostic-item.is-error {
    border-color: rgba(239, 68, 68, .3);
}
.portal-diagnostic-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 3.25rem;
    min-height: 1.85rem;
    padding: .25rem .5rem;
    border-radius: .65rem;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #047857;
    background: #d1fae5;
}
.portal-diagnostic-item.is-error .portal-diagnostic-state {
    color: #b91c1c;
    background: #fee2e2;
}
.portal-diagnostic-item strong {
    display: block;
    color: var(--text-primary);
    font-size: .92rem;
}
.portal-diagnostic-item p {
    margin: .28rem 0 0;
    color: var(--text-secondary);
    font-size: .82rem;
    line-height: 1.45;
}
.portal-diagnostic-item small {
    display: block;
    max-width: 100%;
    margin-top: .45rem;
    color: var(--text-muted);
    font-size: .7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.portal-diagnostic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.portal-diagnostic-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: .3rem .7rem;
    border-radius: .65rem;
    color: var(--text-secondary);
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    font-size: .74rem;
    font-weight: 700;
}
.portal-session-fallback-copy strong {
    color: var(--text-primary);
}
.portal-session-fallback-copy p strong {
    display: inline;
}
[data-theme="dark"] .portal-diagnostic-state {
    color: #6ee7b7;
    background: rgba(16, 185, 129, .17);
}
[data-theme="dark"] .portal-diagnostic-item.is-error .portal-diagnostic-state {
    color: #fca5a5;
    background: rgba(239, 68, 68, .18);
}
@media (max-width: 850px) {
    .portal-diagnostic-grid {
        grid-template-columns: 1fr;
    }
    .portal-diagnostic-panel .status-pill {
        margin-left: 0;
    }
}

/* SRI Control v0.8.3 — Conector local de sesión y favicon renovado */
.portal-hero-browser{border-top:4px solid #2563eb}
.bridge-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem;margin-bottom:1rem}
.bridge-steps article{display:flex;align-items:center;gap:.65rem;padding:.8rem;border:1px solid #dbe4f0;border-radius:13px;background:#f8fafc;min-width:0}
.bridge-steps article>span{width:1.85rem;height:1.85rem;display:grid;place-items:center;flex:0 0 auto;border-radius:8px;background:#1d4ed8;color:#fff;font-size:.72rem;font-weight:900}
.bridge-steps article div{display:flex;flex-direction:column;min-width:0}.bridge-steps strong{font-size:.72rem;color:#0f172a}.bridge-steps small{font-size:.65rem;color:#64748b;line-height:1.35;margin-top:.12rem}
.bridge-start-form{padding:1rem;border:1px solid #bfdbfe;border-radius:15px;background:#eff6ff}
.bridge-code-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:1rem;padding:1.05rem;border:2px solid #2563eb;border-radius:16px;background:#eff6ff;margin-bottom:1rem}
.bridge-code-copy{display:flex;flex-direction:column}.bridge-code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:clamp(1.65rem,4vw,2.25rem);letter-spacing:.13em;color:#1e3a8a;line-height:1.05}.bridge-code-copy p{margin:.45rem 0 0;color:#475569;font-size:.72rem;line-height:1.45}
.bridge-live-state{grid-column:1/-1;display:flex;align-items:center;gap:.55rem;padding:.65rem .75rem;border-radius:10px;background:#dbeafe;color:#1e40af;font-size:.72rem;font-weight:800}
.bridge-live-state i{width:.62rem;height:.62rem;border-radius:50%;background:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.14);animation:bridgePulse 1.5s ease-in-out infinite}.bridge-live-state.is-success{background:#dcfce7;color:#166534}.bridge-live-state.is-success i{background:#10b981;animation:none}.bridge-live-state.is-error{background:#fee2e2;color:#991b1b}.bridge-live-state.is-error i{background:#ef4444;animation:none}
@keyframes bridgePulse{0%,100%{transform:scale(.9);opacity:.65}50%{transform:scale(1.15);opacity:1}}
.bridge-actions{display:grid;grid-template-columns:1.15fr 1fr;gap:.7rem;margin-top:1rem}.bridge-install-note{display:flex;gap:.4rem;align-items:flex-start;padding:.75rem .85rem;margin-top:.75rem;border-radius:11px;background:#f8fafc;border:1px solid #e2e8f0;color:#475569;font-size:.69rem;line-height:1.45}.bridge-install-note strong{color:#0f172a;white-space:nowrap}.bridge-install-note code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;color:#1d4ed8;font-weight:800}
.portal-compatibility-access{margin-top:1rem}.portal-compatibility-access .portal-session-fallback-body{display:grid;gap:.85rem}.portal-compatibility-access .portal-form{padding:.85rem;border-radius:13px;background:#f8fafc;border:1px solid #e2e8f0}.portal-compatibility-access textarea{width:100%;border:1px solid #d5deea;border-radius:12px;background:#fff;color:#0f172a;padding:.8rem;resize:vertical;outline:none}.portal-compatibility-access textarea:focus{border-color:#4f46e5;box-shadow:0 0 0 4px rgba(79,70,229,.11)}
[data-theme="dark"] .bridge-steps article,[data-theme="dark"] .bridge-install-note,[data-theme="dark"] .portal-compatibility-access .portal-form{background:#101c30;border-color:#2a3b59}
[data-theme="dark"] .bridge-steps strong,[data-theme="dark"] .bridge-install-note strong{color:#f8fafc}[data-theme="dark"] .bridge-steps small,[data-theme="dark"] .bridge-install-note{color:#aebbd1}
[data-theme="dark"] .bridge-start-form,[data-theme="dark"] .bridge-code-card{background:#10213b;border-color:#3b82f6}.dark .bridge-code,[data-theme="dark"] .bridge-code{color:#bfdbfe}[data-theme="dark"] .bridge-code-copy p{color:#aebbd1}
[data-theme="dark"] .portal-compatibility-access textarea{background:#0b1526;border-color:#2a3b59;color:#e5edf8}
@media (max-width:720px){.bridge-steps{grid-template-columns:1fr}.bridge-code-card{grid-template-columns:1fr}.bridge-actions{grid-template-columns:1fr}.bridge-install-note{flex-direction:column}.bridge-install-note strong{white-space:normal}}
@media (prefers-reduced-motion:reduce){.bridge-live-state i{animation:none}}

/* SRI Control 0.9.0 — conexión directa local */
.direct-bridge-panel {
    border-top: 4px solid #2563eb;
}

.direct-start-form {
    display: grid;
    gap: 1rem;
}

.direct-connect-button {
    min-height: 3.25rem;
    font-size: .96rem;
    box-shadow: 0 14px 30px rgba(37, 99, 235, .22);
}

.direct-bridge-live,
.direct-capture-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color, #dbe4f0);
    border-radius: 16px;
    background: var(--surface-muted, #f8fafc);
    color: var(--text-primary, #0f172a);
}

.direct-bridge-live strong,
.direct-capture-card strong {
    display: block;
    margin-bottom: .2rem;
    color: var(--text-primary, #0f172a);
    font-size: .9rem;
}

.direct-bridge-live p,
.direct-capture-card p {
    margin: 0;
    color: var(--text-secondary, #64748b);
    font-size: .79rem;
    line-height: 1.55;
}

.direct-bridge-indicator,
.direct-capture-spinner {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 0 6px rgba(148, 163, 184, .14);
}

.direct-bridge-live.is-running .direct-bridge-indicator,
.direct-capture-card.is-waiting .direct-capture-spinner {
    background: #2563eb;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, .14);
    animation: sri-direct-pulse 1.4s ease-in-out infinite;
}

.direct-bridge-live.is-connected .direct-bridge-indicator,
.direct-capture-card.is-success .direct-capture-spinner {
    background: #10b981;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, .14);
}

.direct-bridge-live.is-error .direct-bridge-indicator,
.direct-capture-card.is-error .direct-capture-spinner {
    background: #ef4444;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, .14);
}

.direct-bridge-note {
    margin-top: 1rem;
    border-left: 4px solid #06b6d4;
}

.direct-connected-summary {
    border: 1px solid rgba(16, 185, 129, .35);
    background: rgba(16, 185, 129, .08);
}

.direct-query-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.direct-capture-card {
    position: relative;
    border-color: rgba(37, 99, 235, .35);
    background: rgba(37, 99, 235, .07);
}

.direct-capture-card > div {
    flex: 1 1 auto;
    min-width: 0;
}

.direct-capture-card .portal-button {
    flex: 0 0 auto;
}

@keyframes sri-direct-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(.78); opacity: .65; }
}

html[data-theme="dark"] .direct-bridge-live,
html[data-theme="dark"] .direct-capture-card {
    border-color: #263752;
    background: #0e1a2e;
}

html[data-theme="dark"] .direct-connected-summary {
    border-color: rgba(16, 185, 129, .36);
    background: rgba(16, 185, 129, .10);
}

html[data-theme="dark"] .direct-capture-card {
    border-color: rgba(59, 130, 246, .4);
    background: rgba(37, 99, 235, .10);
}

@media (max-width: 760px) {
    .direct-query-form {
        grid-template-columns: 1fr;
    }
    .direct-capture-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .direct-capture-card .portal-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .direct-bridge-live.is-running .direct-bridge-indicator,
    .direct-capture-card.is-waiting .direct-capture-spinner {
        animation: none;
    }
}

/* SRI Control v0.9.2 — acceso OIDC directo */
.direct-login-form{grid-template-columns:repeat(2,minmax(0,1fr))}.direct-login-form .portal-field-full,.direct-login-form .portal-button-full,.direct-login-form+.direct-bridge-note{grid-column:1/-1}.direct-login-form .portal-input-wrap .password-toggle{width:40px;height:40px;color:#64748b}.direct-login-form .portal-input-wrap .password-toggle:hover{color:#2563eb}.direct-login-form .portal-input-wrap .password-toggle svg{width:17px;height:17px}@media (max-width:720px){.direct-login-form{grid-template-columns:1fr}.direct-login-form .portal-field-full,.direct-login-form .portal-button-full{grid-column:auto}}

/* SRI Control v0.9.3 — bloqueo de autocompletado cruzado */
.portal-autofill-trap {
    position: fixed !important;
    inset-inline-start: -10000px !important;
    top: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.portal-bridge-diagnostic {
    margin: 0 0 22px;
    padding: 22px;
    border: 1px solid color-mix(in srgb, var(--warning, #d97706) 34%, var(--border));
    border-radius: 22px;
    background: var(--surface, #fff);
    box-shadow: var(--shadow-sm);
}
.portal-bridge-diagnostic-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}
.portal-bridge-diagnostic-head h2 { margin: 4px 0 5px; font-size: 1.15rem; }
.portal-bridge-diagnostic-head p { margin: 0; color: var(--text-muted); font-size: .86rem; }
.portal-bridge-attempts { display: grid; gap: 10px; }
.portal-bridge-attempt {
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--warning, #d97706);
    border-radius: 14px;
    background: var(--surface-soft);
}
.portal-bridge-attempt.is-ok { border-inline-start-color: var(--success, #059669); }
.portal-bridge-attempt-main { display: flex; justify-content: space-between; gap: 12px; }
.portal-bridge-attempt-main strong { text-transform: uppercase; letter-spacing: .045em; font-size: .76rem; }
.portal-bridge-attempt-main span, .portal-bridge-attempt small { color: var(--text-muted); font-size: .76rem; }
.portal-bridge-attempt small { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.portal-bridge-cookie-flags { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.portal-cookie-names { color: var(--text-muted); font-size: .72rem; overflow-wrap: anywhere; }
@media (max-width: 720px) {
    .portal-bridge-diagnostic-head { flex-direction: column; }
}

/* Diagnóstico técnico del puente local — v0.9.4-D1 */
.portal-runtime-diagnostic{margin-top:20px;border-top:3px solid #7c3aed}
.portal-runtime-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:18px}
.portal-runtime-actions form{margin:0}
.portal-runtime-grid{margin-top:18px}
.portal-runtime-trace{margin-top:20px;padding:18px;border:1px solid var(--border-color,#dbe4f0);border-radius:16px;background:var(--surface-soft,#f8fafc)}
.portal-runtime-trace h3{margin:0 0 12px;font-size:15px;color:var(--text-strong,#0f172a)}
.portal-runtime-trace-row{display:grid;grid-template-columns:auto minmax(140px,220px) auto 1fr;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--border-color,#e2e8f0)}
.portal-runtime-trace-row:last-child{border-bottom:0}
.portal-runtime-trace-row strong{font-size:12px;letter-spacing:.04em}
.portal-runtime-trace-row small{font-variant-numeric:tabular-nums;color:var(--text-muted,#64748b)}
.portal-runtime-trace-row p{margin:0;color:var(--text-muted,#64748b);font-size:12px}
.portal-runtime-exception{margin-top:16px;padding:14px 16px;border:1px solid rgba(239,68,68,.28);border-radius:14px;background:rgba(239,68,68,.07)}
.portal-runtime-exception strong{display:block;margin-bottom:5px;color:#dc2626}
.portal-runtime-exception p{margin:0;font-size:13px;line-height:1.55;color:var(--text-strong,#334155)}
@media (max-width:860px){.portal-runtime-trace-row{grid-template-columns:auto 1fr auto}.portal-runtime-trace-row p{grid-column:1/-1;padding-left:0}}
[data-theme="dark"] .portal-runtime-trace{background:#0f1b31;border-color:#273753}
[data-theme="dark"] .portal-runtime-exception{background:rgba(239,68,68,.1)}
[data-theme="dark"] .portal-runtime-exception p{color:#fecaca}

/* SRI Control v1.0.4 — conector para hosting Linux */
.portal-grid-single{grid-template-columns:minmax(0,1fr)}
#conector-navegador{margin:1.35rem 0;border-top:4px solid #2563eb}
#conector-navegador .portal-panel-head>.status-pill{margin-left:auto}
.bridge-code-copy>small{margin-bottom:.35rem;color:var(--text-secondary,#64748b);font-weight:800;text-transform:uppercase;letter-spacing:.07em}
@media (max-width:720px){#conector-navegador .portal-panel-head>.status-pill{margin-left:0}}
/* SRI Control 1.0: trabajos persistentes de consulta privada. */
.portal-query-job {
    grid-column: 1 / -1;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    padding: 18px;
    margin-bottom: 18px;
}

.portal-query-job-head,
.portal-query-metrics,
.portal-query-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.portal-query-job-head strong {
    display: block;
    color: #0f172a;
    font-size: 1.05rem;
    margin-top: 3px;
}

.portal-query-job-head p {
    color: #475569;
    margin: 4px 0 0;
}

.portal-query-progress {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe5f0;
    margin: 16px 0 12px;
}

.portal-query-progress > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #087ea4;
    transition: width .35s ease;
}

.portal-query-metrics {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: #475569;
    font-size: .86rem;
}

.portal-query-metrics span {
    border-right: 1px solid #cbd5e1;
    padding-right: 14px;
}

.portal-query-metrics span:last-child {
    border-right: 0;
}

.portal-query-captcha {
    margin-top: 16px;
}

.portal-query-actions {
    justify-content: flex-end;
    margin-top: 14px;
}

.portal-query-actions form {
    margin: 0;
}

.portal-query-downloads {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .portal-query-job-head,
    .portal-query-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-query-metrics span {
        border-right: 0;
        padding-right: 0;
        width: 100%;
    }
}
