/* Nexus customer portal — minimalist, modern, Spanish-first.
   Sibling of frontend/css/style.css; kept small on purpose. */

:root {
    color-scheme: dark;
    --bg-void: #05050a;
    --bg-0:   #0a0a12;
    --bg-1:   #0e0e18;
    --bg-card: rgba(18, 18, 30, 0.72);
    --bg-card-hover: rgba(24, 24, 40, 0.85);
    --bg-input: rgba(22, 22, 36, 0.85);
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #ededf4;
    --text-2: #a0a0b4;
    --muted: #6b6b82;

    --accent: #22d3ee;
    --accent-2: #14b8a6;
    --accent-glow: rgba(34, 211, 238, 0.18);
    --gradient: linear-gradient(135deg, #22d3ee, #14b8a6 55%, #0ea5e9);

    --ok: #34d399;
    --ok-glow: rgba(52, 211, 153, 0.2);
    --warn: #fbbf24;
    --err: #f87171;
    --err-glow: rgba(248, 113, 113, 0.18);

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-lg: 0 20px 60px -30px rgba(0,0,0,0.9), 0 8px 24px -16px rgba(34, 211, 238, 0.1);

    --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { display: none !important; }
body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: radial-gradient(ellipse at top, #12122a 0%, var(--bg-void) 55%) fixed;
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.005em;
    overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7ae7f7; }

/* ── Ambient orbs (liquid / lava-lamp) ──────────────────── */
.orb {
    position: fixed; pointer-events: none; z-index: 0;
    filter: blur(60px); opacity: 0.55;
    mix-blend-mode: screen;
    will-change: transform, border-radius;
}
.orb-1 {
    width: 560px; height: 560px;
    background: radial-gradient(circle at 35% 35%, #22d3ee, #06b6d4 55%, #0369a1);
    top: -140px; left: -100px;
    border-radius: 62% 38% 46% 54% / 55% 48% 52% 45%;
    animation: drift-a 28s ease-in-out infinite,
               morph-a 14s ease-in-out infinite;
}
.orb-2 {
    width: 460px; height: 460px;
    background: radial-gradient(circle at 60% 40%, #22d3ee, #0ea5e9 50%, #0c4a6e);
    bottom: -140px; right: -80px;
    border-radius: 48% 52% 64% 36% / 40% 58% 42% 60%;
    animation: drift-b 34s ease-in-out infinite,
               morph-b 18s ease-in-out infinite;
    animation-delay: -9s, -4s;
}
.orb-3 {
    width: 380px; height: 380px;
    background: radial-gradient(circle at 50% 50%, #67e8f9, #06b6d4 55%, transparent 72%);
    top: 42%; left: 44%;
    opacity: 0.35;
    border-radius: 55% 45% 40% 60% / 52% 40% 60% 48%;
    animation: drift-c 42s ease-in-out infinite,
               morph-c 22s ease-in-out infinite;
    animation-delay: -14s, -7s;
}
@keyframes drift-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20%      { transform: translate(160px, 90px)  scale(1.08); }
    45%      { transform: translate(280px, -70px) scale(0.95); }
    70%      { transform: translate(100px, 200px) scale(1.12); }
}
@keyframes drift-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(-190px, -130px) scale(1.1); }
    55%      { transform: translate(-70px, 110px)   scale(0.92); }
    80%      { transform: translate(-230px, 30px)   scale(1.06); }
}
@keyframes drift-c {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    30%      { transform: translate(-28%, -72%) scale(1.18); }
    60%      { transform: translate(-66%, -34%) scale(0.85); }
}
@keyframes morph-a {
    0%, 100% { border-radius: 62% 38% 46% 54% / 55% 48% 52% 45%; }
    33%      { border-radius: 38% 62% 58% 42% / 42% 58% 42% 58%; }
    66%      { border-radius: 50% 50% 34% 66% / 64% 36% 60% 40%; }
}
@keyframes morph-b {
    0%, 100% { border-radius: 48% 52% 64% 36% / 40% 58% 42% 60%; }
    33%      { border-radius: 60% 40% 42% 58% / 55% 45% 55% 45%; }
    66%      { border-radius: 44% 56% 56% 44% / 36% 64% 36% 64%; }
}
@keyframes morph-c {
    0%, 100% { border-radius: 55% 45% 40% 60% / 52% 40% 60% 48%; }
    50%      { border-radius: 40% 60% 58% 42% / 44% 56% 48% 52%; }
}

/* ── Login ──────────────────────────────────────────────── */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-shell {
    position: relative; z-index: 1;
    width: min(440px, 100%);
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 36px 32px 28px; box-shadow: var(--shadow-lg);
}
.brand { text-align: center; margin-bottom: 28px; }
.brand-mark {
    width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center;
    border-radius: 14px; background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.25);
    box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.04);
}
.brand-mark.small { width: 32px; height: 32px; border-radius: 8px; margin: 0; box-shadow: none; }
.brand-mark:has(img) { background: transparent; border-color: transparent; box-shadow: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-logo {
    display: block;
    max-width: 300px; width: 100%;
    height: auto; margin: 0 auto;
    transform: translateX(-12px);
    filter: drop-shadow(0 4px 24px rgba(34, 211, 238, 0.18));
}
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { font-size: 13px; color: var(--text-2); }
.input-wrap { position: relative; }
input[type="password"], input[type="text"], input[type="email"] {
    width: 100%; padding: 14px 44px 14px 14px;
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text); border-radius: var(--radius-sm);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.ghost-toggle {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    background: transparent; color: var(--text-2); border: none; padding: 6px;
    border-radius: 8px; cursor: pointer; transition: color .15s ease, background .15s ease;
}
.ghost-toggle:hover { color: var(--accent); background: var(--accent-glow); }
.ghost-toggle svg { width: 18px; height: 18px; }

.cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--gradient); color: #06212a; border: none;
    padding: 14px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
    cursor: pointer; transition: transform .18s var(--ease), filter .18s ease, box-shadow .18s ease;
    box-shadow: 0 10px 30px -14px var(--accent-glow);
}
.cta:hover { transform: translateY(-1px); filter: brightness(1.05); }
.cta:active { transform: translateY(0); }
.cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cta svg { width: 16px; height: 16px; }
.cta.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
.cta.ghost:hover { background: var(--accent-glow); }
.cta.danger { background: linear-gradient(135deg, #f87171, #ef4444); color: #2a0808; box-shadow: 0 10px 30px -14px var(--err-glow); }

.error-banner {
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248,113,113,.3);
    color: #fecaca; font-size: 13px;
}
.success-banner {
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16,185,129,.3);
    color: #a7f3d0; font-size: 13px;
}
.footnote { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }

.sso-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 18px 0 4px; color: var(--muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.12em;
}
.sso-divider::before, .sso-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}

.sso-fallback { margin-top: 22px; }
.sso-fallback summary {
    cursor: pointer; color: var(--text-2); font-size: 13px;
    text-align: center; list-style: none;
    padding: 8px 0; border-top: 1px dashed var(--border);
}
.sso-fallback summary::-webkit-details-marker { display: none; }
.sso-fallback summary:hover { color: var(--text); }
.sso-fallback[open] summary { color: var(--text); margin-bottom: 12px; }
.sso-fallback .login-form { gap: 10px; }
.hint {
    margin: 4px 0 0; font-size: 12px; color: var(--muted); text-align: center;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 24px;
    padding: 12px 24px; background: rgba(10, 10, 20, 0.72); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-weight: 700; font-size: 15px; }
.topbar-sub { font-size: 12px; color: var(--text-2); max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-logo {
    height: 56px; width: auto; display: block;
    filter: drop-shadow(0 2px 12px rgba(34, 211, 238, 0.18));
}

.topbar-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topbar-nav a {
    color: var(--text-2); font-size: 13px; padding: 8px 14px; border-radius: 10px;
    transition: color .15s ease, background .15s ease;
}
.topbar-nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.topbar-nav a.active { color: var(--accent); background: var(--accent-glow); }

.ghost-btn {
    background: transparent; color: var(--text-2); border: 1px solid var(--border);
    padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 13px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.ghost-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }

/* ── Page ───────────────────────────────────────────────── */
.page { max-width: 1400px; margin: 0 auto; padding: 28px 24px 40px; position: relative; z-index: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.muted { color: var(--text-2); }
.muted.small { font-size: 12px; }

.seg {
    display: inline-flex; padding: 4px; border-radius: 12px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
}
.seg button {
    background: transparent; border: none; color: var(--text-2); font-size: 12px;
    padding: 6px 12px; border-radius: 8px; cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.seg button:hover { color: var(--text); }
.seg button.on { color: #06212a; background: var(--gradient); font-weight: 600; }

/* ── Stat grid ──────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card); backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-label { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value.accent { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.card {
    background: var(--bg-card); backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid-span-2 { grid-column: span 2; }
@media (max-width: 720px) { .grid-span-2 { grid-column: auto; } }

.big { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }

/* ── Budget / progress ──────────────────────────────────── */
.progress-track {
    height: 10px; border-radius: 999px; background: rgba(255,255,255,0.05);
    overflow: hidden; margin-bottom: 10px;
}
.progress-bar {
    height: 100%; width: 0%; background: var(--gradient);
    border-radius: 999px; transition: width .8s var(--ease), background .3s ease;
}
.progress-bar.warn { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.progress-bar.danger { background: linear-gradient(135deg, #f87171, #ef4444); }
.budget-label { display: flex; justify-content: space-between; align-items: baseline; font-variant-numeric: tabular-nums; }

/* ── Pills ──────────────────────────────────────────────── */
.pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li {
    padding: 6px 12px; font-size: 12px; border: 1px solid var(--border);
    border-radius: 999px; background: rgba(255,255,255,0.02);
    transition: border-color .15s ease, color .15s ease;
}
.pills li:hover { border-color: var(--accent); color: var(--accent); }
.pills li strong { margin-right: 6px; color: var(--text); }

/* ── Chart (tiny bar chart) ─────────────────────────────── */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.chart-bar {
    flex: 1 1 0; background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 4px 4px 0 0; min-height: 2px; opacity: 0.85;
    transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
    position: relative;
}
.chart-bar:hover { opacity: 1; transform: translateY(-2px); box-shadow: 0 4px 18px -6px var(--accent-glow); }
.chart-bar::after {
    content: attr(data-tip);
    position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
    background: var(--bg-1); color: var(--text); border: 1px solid var(--border);
    padding: 4px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap;
    pointer-events: none; opacity: 0; transition: opacity .15s ease;
}
.chart-bar:hover::after { opacity: 1; }

/* ── Table ──────────────────────────────────────────────── */
.table-card { padding: 0; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    text-align: left; padding: 12px 18px; color: var(--text-2);
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    border-bottom: 1px solid var(--border); position: sticky; top: 0;
    background: rgba(10,10,20,0.7); backdrop-filter: blur(8px);
}
tbody td { padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.03); }
tbody tr:hover td { background: rgba(255,255,255,0.02); }
.table-foot { padding: 14px 18px; display: flex; justify-content: center; }
.code-chip {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px;
    padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,0.04);
    border: 1px solid var(--border); cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.code-chip:hover { color: var(--accent); border-color: var(--accent); }
.pill-ok { color: var(--ok); }
.pill-err { color: var(--err); }

/* ── Key-value list ─────────────────────────────────────── */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0 0 18px; }
.kv div { border-left: 2px solid var(--border); padding: 4px 12px; }
.kv dt { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.kv dd { margin: 0; font-weight: 600; font-size: 14px; }

/* ── Actions / rotate key box ───────────────────────────── */
.cta-row { display: flex; gap: 12px; margin-top: 10px; }
.cta-row.end { justify-content: flex-end; }
.key-box {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px;
    padding: 14px 16px; border-radius: var(--radius-sm);
    background: var(--bg-input); border: 1px solid var(--border);
    word-break: break-all; margin-bottom: 10px;
    position: relative;
}
.card.success { border-color: rgba(52,211,153,0.35); background: linear-gradient(180deg, rgba(52,211,153,0.04), var(--bg-card) 60%); }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(5, 5, 10, 0.72); backdrop-filter: blur(6px);
    display: grid; place-items: center; z-index: 100;
    animation: fade-in .2s var(--ease);
}
.modal-overlay[hidden] { display: none; }
.modal {
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px 24px 20px; width: min(440px, 92vw); box-shadow: var(--shadow-lg);
}
.modal h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal p { color: var(--text-2); font-size: 14px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Footer ─────────────────────────────────────────────── */
.footer { position: relative; z-index: 1; text-align: center; padding: 12px 24px 24px; color: var(--muted); font-size: 12px; }

/* ── Animations (shared) ────────────────────────────────── */
@keyframes reveal-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.reveal { animation: reveal-up .5s var(--ease) both; }
.reveal-stagger > * { animation: reveal-up .55s var(--ease) both; }
.reveal-stagger > *:nth-child(1) { animation-delay: 40ms; }
.reveal-stagger > *:nth-child(2) { animation-delay: 90ms; }
.reveal-stagger > *:nth-child(3) { animation-delay: 140ms; }
.reveal-stagger > *:nth-child(4) { animation-delay: 190ms; }
.reveal-stagger > *:nth-child(5) { animation-delay: 240ms; }

.lift { transition: transform .25s var(--ease), box-shadow .25s ease, border-color .25s ease; }
.lift:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 28px -12px var(--accent-glow); }

/* tiny skeleton loader */
.skel {
    display: inline-block; height: 1em; min-width: 60px; border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 100%);
    background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; }
    .topbar-nav { order: 3; width: 100%; }
    .page { padding: 20px 16px 64px; }
    .page-head h1 { font-size: 22px; }
}

/* ── Chart bar entry animation ──────────────────────────── */
.chart-bar {
    animation: bar-grow .6s var(--ease) both;
    animation-delay: var(--delay, 0ms);
    height: var(--h, 3%);
}
.chart-bar.has-errors { background: linear-gradient(180deg, var(--err), #ef4444); }
@keyframes bar-grow { from { height: 0; opacity: 0; } to { height: var(--h, 3%); opacity: 0.85; } }

/* ── Chips ──────────────────────────────────────────────── */
.chip {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.chip.ok  { color: var(--ok);  background: var(--ok-glow);  border-color: rgba(52,211,153,0.3); }
.chip.err { color: var(--err); background: var(--err-glow); border-color: rgba(248,113,113,0.3); }

/* ── Pill rows (dashboard models) ───────────────────────── */
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
    background: rgba(255,255,255,0.02); font-size: 12px;
    transition: border-color .15s ease, color .15s ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gradient); }
.pill-count { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ── Table text helpers ─────────────────────────────────── */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.mono.small { font-size: 11px; }
.copyable {
    cursor: pointer; padding: 2px 8px; border-radius: 6px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.copyable:hover { color: var(--accent); border-color: var(--accent); }
.copyable.copied { color: var(--ok); border-color: var(--ok); background: var(--ok-glow); }

/* ── Empty / error states inside cards ──────────────────── */
.empty {
    padding: 24px; text-align: center; color: var(--muted); font-size: 13px;
}
.empty.error { color: var(--err); }
.card.error { border-color: rgba(248,113,113,0.3); color: var(--err); padding: 14px 18px; }

/* ── Button / input states ──────────────────────────────── */
.is-loading { opacity: 0.7; pointer-events: none; position: relative; }
.is-loading::after {
    content: ""; position: absolute; right: 14px; top: 50%;
    width: 14px; height: 14px; margin-top: -7px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.is-success { background: linear-gradient(135deg, var(--ok), #10b981) !important; }
.shake { animation: shake .35s var(--ease); }
@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* ── Row reveal ─────────────────────────────────────────── */
.reveal-row { opacity: 0; transform: translateY(4px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.reveal-row.is-visible { opacity: 1; transform: translateY(0); }

/* ── Modal form rows ────────────────────────────────────── */
.modal .form-row { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.modal .form-row label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal input[type="number"],
.modal input[type="time"],
.modal select {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 13px;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.modal select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select, select option, select optgroup { background: var(--bg-input); color: var(--text); }
.modal input:focus, .modal select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.modal code { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ── Modal open state ───────────────────────────────────── */
.modal-overlay.is-open .modal { animation: pop-in .25s var(--ease) both; }
@keyframes pop-in {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Success card reveal (rotate result) ────────────────── */
.card.success.is-visible { animation: reveal-up .45s var(--ease) both; }

/* The HTML `hidden` attribute must beat any class-level `display:`
   value below — otherwise badges/toasts that start `hidden` show
   anyway because `.badge { display: inline-block }` etc. override
   the user-agent `[hidden] { display: none }` rule. */
[hidden] { display: none !important; }

/* ── Approvals (Epic H.4) ───────────────────────────────── */
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; margin-bottom: 16px;
    border-radius: 12px; text-decoration: none;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.32);
    color: #fde68a;
    transition: background .15s var(--ease), border-color .15s var(--ease);
}
.toast:hover { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.55); }
.toast .toast-cta { margin-left: auto; opacity: 0.85; font-size: 0.9em; }

.badge {
    display: inline-block; min-width: 18px; padding: 0 6px;
    margin-left: 6px; border-radius: 9px; font-size: 11px;
    line-height: 18px; text-align: center;
    background: #f59e0b; color: #1a1300; font-weight: 600;
}

.approval-card { margin-bottom: 14px; transition: opacity .3s var(--ease); }
.approval-card .pill {
    padding: 2px 10px; border-radius: 999px; font-size: 12px;
    background: rgba(34, 211, 238, 0.12); color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, 0.32);
}
.approval-args {
    background: rgba(255, 255, 255, 0.03); border-radius: 8px;
    padding: 10px 12px; margin: 10px 0; font-size: 12px;
    overflow-x: auto; white-space: pre-wrap; word-break: break-word;
    max-height: 240px;
}
.approval-status { margin-top: 8px; }
.approval-card.success { border-color: rgba(16, 185, 129, 0.4); }
.approval-card.error { border-color: rgba(239, 68, 68, 0.45); }
.cta.success {
    background: linear-gradient(135deg, #34d399, #059669);
    color: #04140d; border: none;
}
.cta.success:hover { filter: brightness(1.08); }

/* ── Insights timeline ──────────────────────────────────── */
.timeline { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.tl-cell {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
    justify-content: flex-end; height: 100%;
}
.tl-bar {
    width: 100%; min-height: 2px; border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    opacity: 0.85; transition: opacity .15s ease, transform .15s ease;
}
.tl-cell:hover .tl-bar { opacity: 1; transform: translateY(-2px); }
.tl-cell.sev-warning .tl-bar { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.tl-cell.sev-critical .tl-bar { background: linear-gradient(180deg, #f87171, #ef4444); }
.tl-label {
    margin-top: 6px; font-size: 10px; color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.anom-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.anom-row {
    padding: 8px 12px; border-radius: 8px; font-size: 13px;
    border: 1px solid var(--border); background: rgba(255,255,255,0.02);
}
.anom-row.sev-warning { border-color: rgba(245, 158, 11, 0.5); }
.anom-row.sev-critical { border-color: rgba(239, 68, 68, 0.6); background: rgba(239, 68, 68, 0.06); }

.pill[data-sev="warning"] { border-color: rgba(245, 158, 11, 0.6); color: #fbbf24; }
.pill[data-sev="critical"] { border-color: rgba(239, 68, 68, 0.7); color: #f87171; }

/* ── Customer rules editor (Epic N.2) ───────────────────── */
.rule-card { margin-bottom: 14px; transition: opacity .3s var(--ease); }
.rule-card .rule-instruction {
    margin: 8px 0 6px; font-size: 14px; color: var(--text);
    white-space: pre-wrap; word-break: break-word;
}
.rule-card .rule-pattern {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px; color: var(--text-2);
    padding: 4px 8px; background: rgba(255,255,255,0.03);
    border-radius: 6px; display: inline-block; margin-top: 4px;
}
.rule-card .pill.warn  { border-color: rgba(245, 158, 11, 0.6); color: #fbbf24; }
.rule-card .pill.danger { border-color: rgba(239, 68, 68, 0.7); color: #f87171; }
.rule-card .rule-status { margin-top: 8px; }
.rule-card.error { border-color: rgba(239, 68, 68, 0.45); }

.rule-modal { width: min(560px, 94vw); padding: 22px 22px 18px; }
.rule-modal .card-head { margin-bottom: 12px; }
.rule-modal form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.field span { font-weight: 600; color: var(--text); }
.field small { color: var(--muted); font-size: 11px; }
.field input[type="text"], .field textarea, .field select {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 13px;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field textarea { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; min-height: 80px; }
.field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-inline span { font-weight: 500; color: var(--text-2); }
.error { color: var(--err); font-size: 12px; }

/* Preview panel — Epic N.3 */
.preview-verdict { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 12px 0; border: 1px solid var(--border); }
.preview-verdict.ok { color: var(--ok); border-color: rgba(52,211,153,0.4); background: var(--ok-glow); }
.preview-verdict.warn { color: #fbbf24; border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.06); }
.preview-verdict.danger { color: var(--err); border-color: rgba(239,68,68,0.5); background: var(--err-glow); }
.preview-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.preview-list li { font-size: 13px; padding: 6px 0; }
.preview-details { margin-top: 12px; }
.preview-details pre { background: rgba(255,255,255,0.03); padding: 10px; border-radius: 6px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; }
.chip.warn { color: #fbbf24; background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.3); }
.chip.danger { color: var(--err); background: var(--err-glow); border-color: rgba(248,113,113,0.3); }

/* Memory page — Epic O */
.tabbar { display: flex; gap: 6px; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.tab {
    background: transparent; border: 0; color: var(--text-2);
    padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.memory-card { margin-bottom: 12px; }
.memory-card .card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.memory-content { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; font-size: 14px; }
.memory-meta { margin: 0; }
.memory-delete { font-size: 18px; line-height: 1; padding: 4px 10px; }

/* Sentinel — tenant-admin surface */
.toggle-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 0; cursor: pointer;
    color: var(--text);
}
.toggle-row input[type="checkbox"] { margin-top: 3px; }
.actions-list { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.finding-card .pill[data-severity="critical"] {
    border-color: rgba(239, 68, 68, 0.7); color: #f87171;
}
.finding-card .pill[data-severity="warn"] {
    border-color: rgba(245, 158, 11, 0.6); color: #fbbf24;
}
.finding-card .pill[data-severity="info"] { color: var(--text-2); }
.finding-summary { margin: 8px 0; color: var(--text); }
.finding-payload {
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px; padding: 10px; font-size: 12px; max-height: 180px; overflow: auto;
    white-space: pre-wrap; word-break: break-word;
}

/* ── HelpBot floating dock ──────────────────────────────── */
.helpbot-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 950;
    width: 52px; height: 52px; border-radius: 26px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #042027; border: none; cursor: pointer;
    box-shadow: 0 12px 30px -10px var(--accent-glow), 0 4px 14px rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.helpbot-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 16px 38px -10px var(--accent-glow); }
.helpbot-fab[aria-expanded="true"] { transform: rotate(45deg); }

.helpbot-panel {
    position: fixed; right: 20px; bottom: 84px; z-index: 949;
    width: 360px; max-width: calc(100vw - 32px);
    height: 520px; max-height: calc(100vh - 120px);
    background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: 16px;
    display: none; flex-direction: column; overflow: hidden;
    box-shadow: 0 24px 60px -16px rgba(0,0,0,0.55);
    animation: pop-in .22s var(--ease) both;
}
.helpbot-panel.is-open { display: flex; }

.helpbot-head {
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.helpbot-head .helpbot-mark {
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex; align-items: center; justify-content: center; color: #042027;
    font-weight: 700; font-size: 14px;
}
.helpbot-head .helpbot-title { font-weight: 600; font-size: 14px; }
.helpbot-head .helpbot-sub { font-size: 11px; color: var(--text-2); }
.helpbot-head .helpbot-lang {
    margin-left: auto; background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text); border-radius: 6px; padding: 4px 8px; font-size: 12px;
}

.helpbot-body {
    flex: 1 1 auto; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.helpbot-msg {
    padding: 10px 12px; border-radius: 12px; font-size: 13px;
    line-height: 1.5; max-width: 88%; word-wrap: break-word;
}
.helpbot-msg.user {
    align-self: flex-end; background: var(--accent-glow);
    border: 1px solid rgba(34,211,238,0.32); color: var(--text);
}
.helpbot-msg.bot {
    align-self: flex-start; background: var(--bg-input);
    border: 1px solid var(--border); color: var(--text);
}
.helpbot-msg.bot .sources {
    margin-top: 8px; padding-top: 8px;
    border-top: 1px dashed rgba(255,255,255,0.08);
    font-size: 11px; color: var(--text-2);
}
.helpbot-msg.bot a { color: var(--accent); }
.helpbot-msg.typing { font-style: italic; opacity: 0.7; }

.helpbot-foot {
    padding: 10px; border-top: 1px solid var(--border);
    display: flex; gap: 8px;
}
.helpbot-foot textarea {
    flex: 1; resize: none; min-height: 38px; max-height: 120px;
    padding: 9px 10px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: inherit; font-size: 13px;
}
.helpbot-foot textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.helpbot-foot button {
    background: var(--accent); color: #042027; border: none;
    border-radius: 8px; padding: 0 14px; font-weight: 600; cursor: pointer;
    transition: background .15s var(--ease);
}
.helpbot-foot button:hover { background: var(--accent-2); }
.helpbot-foot button:disabled { opacity: 0.5; cursor: not-allowed; }

.helpbot-powered {
    padding: 6px 14px; text-align: center;
    font-size: 10px; color: var(--muted);
    border-top: 1px solid var(--border);
    letter-spacing: 0.03em;
}
.helpbot-powered strong {
    color: var(--accent); font-weight: 700;
}

@media (max-width: 480px) {
    .helpbot-panel { right: 12px; left: 12px; width: auto; bottom: 78px; }
}

/* ── ayuda.html — manual viewer ─────────────────────────── */
.manual-shell { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.manual-toc {
    position: sticky; top: 84px; align-self: start;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px; max-height: calc(100vh - 110px);
    overflow-y: auto;
}
.manual-toc h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.manual-toc a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--text-2); font-size: 13px; }
.manual-toc a:hover, .manual-toc a.active { color: var(--accent); background: var(--accent-glow); }

.manual-body {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 28px 32px; line-height: 1.65;
}
.manual-body h1 { margin-top: 0; font-size: 26px; }
.manual-body h2 { margin-top: 32px; font-size: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.manual-body h3 { margin-top: 22px; font-size: 16px; color: var(--text-2); }
.manual-body code { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.manual-body pre { background: rgba(0,0,0,0.4); padding: 14px; border-radius: 8px; overflow-x: auto; }
.manual-body ul, .manual-body ol { padding-left: 22px; }
.manual-body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.manual-body th, .manual-body td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; }
.manual-body th { background: rgba(255,255,255,0.04); }

@media (max-width: 880px) {
    .manual-shell { grid-template-columns: 1fr; }
    .manual-toc { position: static; max-height: none; }
}

/* ── Chat surface ────────────────────────────────────────────── */
.chat-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 90px);
    max-width: 980px;
    margin: 0 auto;
    padding: 16px 20px;
    gap: 12px;
}
.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
}
.chat-tool-left { flex: 1; min-width: 0; }
.chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}
.chat-empty {
    margin: auto;
    text-align: center;
    max-width: 520px;
    padding: 32px 16px;
}
.chat-empty p { margin: 6px 0; }
.chat-msg { display: flex; max-width: 100%; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-assistant { justify-content: flex-start; }
.chat-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14.5px;
}
.chat-msg-user .chat-bubble {
    background: var(--gradient);
    color: #06121a;
    border-bottom-right-radius: 4px;
    box-shadow: 0 6px 20px -10px var(--accent-glow);
}
.chat-msg-assistant .chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    border-bottom-left-radius: 4px;
    white-space: normal;
}
.chat-msg-assistant .chat-bubble p { margin: 0 0 8px; }
.chat-msg-assistant .chat-bubble p:last-child { margin-bottom: 0; }
.chat-msg-assistant .chat-bubble strong { color: #fff; font-weight: 600; }
.chat-msg-assistant .chat-bubble em { font-style: italic; opacity: 0.9; }
.chat-code {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 6px 0;
    overflow-x: auto;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre;
}
.chat-inline-code {
    background: rgba(255,255,255,0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
}
.chat-msg-assistant .chat-meta {
    margin-top: 4px;
    padding-left: 6px;
    font-size: 11px;
    opacity: 0.6;
}
.chat-error {
    border-color: var(--err) !important;
    color: var(--err) !important;
    opacity: 0.85;
    font-size: 13px;
}
.chat-typing::after {
    content: "▍";
    color: var(--accent);
    animation: chat-blink 1s steps(2) infinite;
}
@keyframes chat-blink { 50% { opacity: 0; } }

.chat-composer {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    align-items: flex-end;
}
.chat-composer textarea {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    resize: none;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    padding: 8px 6px;
    max-height: 200px;
    min-height: 24px;
}
.chat-composer textarea::placeholder { color: var(--muted); }
.chat-composer .cta {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}
.chat-composer .cta:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 720px) {
    .chat-page { height: calc(100vh - 70px); padding: 10px 12px; }
    .chat-bubble { max-width: 88%; font-size: 14px; }
    .chat-toolbar { flex-direction: column; align-items: stretch; }
}

.chat-memory-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    margin-bottom: 6px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.22);
    color: var(--accent);
    font-size: 12px;
    text-decoration: none;
    align-self: flex-start;
    transition: background .2s var(--ease), transform .2s var(--ease);
}
.chat-memory-chip:hover {
    background: rgba(34, 211, 238, 0.14);
    transform: translateY(-1px);
}

.chat-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 500;
    align-self: flex-start;
    transition: all 0.3s var(--ease);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.08);
}
.chat-tool-chip svg { flex-shrink: 0; }
.chat-tool-chip.tool-ok {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.25);
    color: var(--ok);
    box-shadow: none;
}
.chat-tool-chip.tool-err {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--err);
    box-shadow: none;
}
.tool-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(168, 85, 247, 0.25);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: tool-spin 0.6s linear infinite;
    flex-shrink: 0;
}
@keyframes tool-spin { to { transform: rotate(360deg); } }

/* SLA status badges */
.sla-met { color: #22c55e !important; }
.sla-at_risk { color: #f59e0b !important; }
.sla-breached { color: #ef4444 !important; }

.sla-compact { padding: 10px 16px !important; }
.sla-strip {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    font-size: 13px;
}
.sla-title { font-weight: 700; font-size: 14px; margin-right: 4px; }
.sla-item { display: inline-flex; align-items: center; gap: 4px; }
.sla-lbl { color: rgba(255,255,255,0.45); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sla-item > span:nth-child(2) { font-weight: 600; }
@media (max-width: 600px) {
    .sla-strip { gap: 10px 16px; }
}

/* Admin dashboard table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 8px 12px; color: rgba(255,255,255,.5); font-weight: 500; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-table td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.admin-table tr:hover td { background: rgba(255,255,255,.03); }
.admin-top-users-list { max-height: 400px; overflow-y: auto; }

/* Workflow builder */
.builder-node { transition: box-shadow .15s, border-color .15s; }
.builder-node:hover { filter: brightness(1.1); }
.builder-node.selected { border-color: #fff !important; box-shadow: 0 0 0 2px rgba(255,255,255,.3); }

/* ── Page info icon + tooltip + modal ─────────────────────────────── */
.nx-page-info {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    margin-left: 12px; flex-shrink: 0;
}
.nx-info-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.45); cursor: pointer;
    font-size: 14px; font-weight: 700; font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    transition: all 200ms var(--ease);
    position: relative;
}
.nx-info-btn:hover {
    background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4);
    color: #818cf8;
}

/* Modal overlay */
.nx-info-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 200ms;
}
.nx-info-overlay.is-open { opacity: 1; pointer-events: auto; }
.nx-info-modal {
    background: #0e0e1a; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 32px;
    max-width: 520px; width: 90vw; max-height: 80vh;
    overflow-y: auto; position: relative;
    box-shadow: 0 24px 80px -20px rgba(0,0,0,0.8), 0 0 40px rgba(99,102,241,0.08);
}
.nx-info-modal-title {
    font-size: 20px; font-weight: 700; margin: 0 0 6px;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.nx-info-modal-body {
    font-size: 14px; line-height: 1.7; color: rgba(255,255,255,0.65);
    margin-top: 16px;
}
.nx-info-modal-body p { margin: 0 0 12px; }
.nx-info-modal-body p:last-child { margin-bottom: 0; }
.nx-info-modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; transition: all 150ms;
}
.nx-info-modal-close:hover {
    background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3);
    color: #f87171;
}
@media (max-width: 600px) {
    .nx-info-modal { padding: 20px; }
}

/* ── Mi acceso page ───────────────────────────────────────────────── */
.access-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.access-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px; padding: 20px;
}
.access-card-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4); font-weight: 600; margin-bottom: 8px;
}
.access-card-value {
    font-size: 18px; font-weight: 600; color: rgba(255,255,255,0.85);
    word-break: break-all;
}
.access-card-value.accent { color: var(--accent); }
.access-role-badge {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em;
}
.access-role-badge.admin {
    background: rgba(99,102,241,0.15); color: #818cf8;
}
.access-role-badge.operator {
    background: rgba(34,211,238,0.12); color: #22d3ee;
}
.access-role-badge.viewer {
    background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5);
}
.access-session-bar {
    height: 6px; border-radius: 3px;
    background: rgba(255,255,255,0.06); margin-top: 8px; overflow: hidden;
}
.access-session-fill {
    height: 100%; border-radius: 3px;
    background: var(--gradient);
    transition: width 600ms var(--ease);
}

/* ── Dialog (modal) ─────────────────────────────────────────────── */
.nx-dialog {
    position: fixed; inset: 0; z-index: 1000;
    margin: auto; border: none; border-radius: 16px;
    background: #13131a; color: rgba(255,255,255,.88);
    padding: 0; max-width: 520px; width: calc(100% - 2rem);
    box-shadow: 0 16px 48px rgba(0,0,0,.6);
}
.nx-dialog::backdrop {
    background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
}
.dialog-form {
    padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem;
}
.dialog-form label {
    display: flex; flex-direction: column; gap: .25rem; font-size: 13px;
}
.dialog-form label span {
    color: rgba(255,255,255,.5); font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
}
.dialog-form input,
.dialog-form textarea,
.dialog-form select {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px; padding: 8px 12px; color: #fff; font-size: 13px;
    font-family: inherit; transition: border-color .15s;
}
.dialog-form input:focus,
.dialog-form textarea:focus,
.dialog-form select:focus {
    outline: none; border-color: var(--accent, #6C3DF5);
}
.dialog-form .cta-row {
    display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem;
}
.switch-label {
    display: flex; align-items: center; gap: .5rem; font-size: 13px; cursor: pointer;
}
.switch-label input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--accent, #6C3DF5);
}
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.badge.accent { background: rgba(108,61,245,.2); color: #a78bfa; }
.badge.muted { background: rgba(255,255,255,.08); color: rgba(255,255,255,.45); }
.badge.warn { background: rgba(251,191,36,.15); color: #fbbf24; }
.success { color: #34d399; }
.error { color: #f87171; }
.list-row:hover { background: rgba(255,255,255,.03); }
#config-form label {
    display: flex; flex-direction: column; gap: .25rem; font-size: 13px; margin-bottom: .5rem;
}
#config-form label span {
    color: rgba(255,255,255,.5); font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
}
#config-form input,
#config-form textarea,
#config-form select {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px; padding: 8px 12px; color: #fff; font-size: 13px;
    font-family: inherit; transition: border-color .15s;
}
#config-form input:focus,
#config-form textarea:focus,
#config-form select:focus {
    outline: none; border-color: var(--accent, #6C3DF5);
}
