:root {
    /* Core palette — ops-room cool gray / black */
    --bg: #080a0d;
    --bg-elevated: #0e1116;
    --surface: #14181f;
    --surface-2: #1a1f28;
    --surface-hover: #222833;
    --border: rgba(180, 200, 220, 0.09);
    --border-strong: rgba(180, 200, 220, 0.16);
    --text: #e6eaef;
    --muted: #939cab;
    --radius: 6px;
    --radius-sm: 4px;

    /* Accent: CYAN (único acento de wave 1; amber solo secondary/ISK) */
    --cyan: #2ec8e0;
    --amber: #e09a3a;
    --accent: var(--cyan);
    --accent-soft: rgba(46, 200, 224, 0.12);
    --accent-border: rgba(46, 200, 224, 0.32);
    --accent-muted: rgba(46, 200, 224, 0.55);

    /* Tipografía ops-room */
    --font-display: 'Barlow Condensed', 'IBM Plex Sans', 'Segoe UI', sans-serif;
    --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Roboto Mono', ui-monospace, monospace;

    /* Sidebar rail (resizable on desktop; persisted via JS → --sidebar-width) */
    --sidebar-width: 76px;
    --sidebar-width-min: 56px;
    --sidebar-width-max: 280px;
    --sidebar-expand-at: 140px;

    /* Aliases de compatibilidad con páginas existentes */
    --bg-color: var(--bg);
    --panel-color: var(--surface);
    --panel-hover: var(--surface-hover);
    --accent-color: var(--accent);
    --accent-glow: var(--accent-soft);
    --orange-color: var(--amber);
    --purple-color: #8b92a0;
    --text-primary: var(--text);
    --text-secondary: var(--muted);
    --text-dim: #6e7886;
    --danger-color: #FF5252;
    --success-color: #69F0AE;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width, 76px);
    min-width: var(--sidebar-width-min, 56px);
    flex-shrink: 0; /* overflow-y:auto zeroes auto min-width; don't let wide content crush the nav */
    background:
        linear-gradient(180deg, rgba(46, 200, 224, 0.04) 0%, transparent 28%),
        var(--bg-elevated);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border-right: 1px solid var(--border);
    z-index: 100;
    overflow: hidden;
    position: relative;
}

.sidebar-inner {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0 14px 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.sidebar::after {
    display: none;
}

/* Drag handle — right edge (desktop only; hidden on mobile drawer) */
.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 120;
    touch-action: none;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}
.sidebar-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1px;
    transform: translateY(-50%);
    width: 2px;
    height: 48px;
    max-height: 28%;
    border-radius: 2px;
    background: rgba(46, 200, 224, 0.22);
    opacity: 0;
    transition: opacity 0.18s ease, background 0.18s ease, height 0.18s ease;
    pointer-events: none;
}
.sidebar:hover .sidebar-resize-handle::after,
.sidebar-resize-handle:hover::after,
.sidebar.is-resizing .sidebar-resize-handle::after {
    opacity: 1;
}
.sidebar-resize-handle:hover::after,
.sidebar.is-resizing .sidebar-resize-handle::after {
    background: var(--accent);
    height: 64px;
}
.sidebar.is-resizing {
    user-select: none;
    cursor: col-resize;
}
.sidebar.is-resizing ~ .main-content,
body.sidebar-resizing {
    cursor: col-resize;
    user-select: none;
}

/* Hide scrollbar for sidebar */
.sidebar::-webkit-scrollbar,
.sidebar-inner::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* ================================================================
   Desktop wide sidebar (≥ --sidebar-expand-at via .is-wide)
   Horizontal labels — readable names when user drags wider.
   ================================================================ */
@media (min-width: 769px) {
    .sidebar.is-wide {
        align-items: stretch;
        padding: 0;
    }

    .sidebar.is-wide .sidebar-inner {
        align-items: stretch;
        padding: 14px 10px 12px 10px;
    }

    .sidebar.is-wide .nav-brand {
        width: 100%;
        justify-content: flex-start;
        padding: 0 4px;
        margin-bottom: 14px;
    }

    .sidebar.is-wide .nav-item {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 44px;
        margin-bottom: 4px;
        padding: 8px 10px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        border-radius: var(--radius-sm);
    }

    .sidebar.is-wide .nav-item .material-icons {
        font-size: 22px;
        margin-bottom: 0;
        width: 24px;
        text-align: center;
        flex-shrink: 0;
    }

    .sidebar.is-wide .nav-item .label {
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.01em;
        line-height: 1.2;
        display: inline-block;
        text-align: left;
        color: var(--muted);
        max-width: none;
        overflow: visible;
        -webkit-line-clamp: unset;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .sidebar.is-wide .nav-item:hover .label,
    .sidebar.is-wide .nav-item.active .label {
        color: var(--text);
    }

    .sidebar.is-wide .nav-item.active .label {
        color: var(--text);
    }

    .sidebar.is-wide .nav-item::before {
        left: 0;
        width: 3px;
        height: 52%;
        border-radius: 0 2px 2px 0;
    }

    .sidebar.is-wide .submenu-container {
        width: 100%;
        align-items: stretch;
    }

    .sidebar.is-wide .submenu-container > .nav-item::after {
        right: 10px;
    }

    .sidebar.is-wide .sidebar-inner > .submenu-container + .nav-item::after {
        left: 12px;
        right: 12px;
        width: auto;
        transform: none;
    }

    .sidebar.is-wide .submenu {
        width: 100%;
        margin-left: 0;
        padding: 4px 0 4px 8px;
        border-left: 2px solid rgba(46, 200, 224, 0.18);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        background: rgba(8, 10, 13, 0.45);
        align-items: stretch;
    }

    .sidebar.is-wide .submenu .nav-item {
        width: 100%;
        height: auto;
        min-height: 40px;
        margin-bottom: 2px;
        padding: 6px 8px;
    }

    .sidebar.is-wide .submenu .nav-item .material-icons {
        font-size: 20px;
    }

    .sidebar.is-wide .submenu .nav-item .label {
        font-size: 12px;
        display: inline-block;
        -webkit-line-clamp: unset;
        overflow: hidden;
        text-align: left;
        max-width: none;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .sidebar.is-wide .nav-subgroup {
        width: auto;
        margin: 6px 0 4px 4px;
        padding: 4px;
        align-items: stretch;
    }

    .sidebar.is-wide .nav-subgroup__toggle {
        width: 100%;
        min-height: 36px;
        justify-content: flex-start;
        padding: 8px 28px 8px 10px;
        margin: 0;
    }

    .sidebar.is-wide .nav-subgroup__toggle .label {
        font-size: 12px;
        letter-spacing: 0.02em;
        text-align: left;
        -webkit-line-clamp: unset;
        overflow: visible;
        display: inline-block;
    }

    .sidebar.is-wide .nav-subgroup__toggle::after {
        right: 10px;
    }

    .sidebar.is-wide .nav-subgroup__items {
        align-items: stretch;
        padding-left: 4px;
    }

    .sidebar.is-wide .nav-subgroup__items .nav-item {
        width: 100%;
        min-height: 40px;
    }

    .sidebar.is-wide .nav-footer {
        align-items: stretch;
        width: 100%;
        padding: 0;
    }

    .sidebar.is-wide .nav-footer .nav-item,
    .sidebar.is-wide .nav-footer .nav-item--report {
        width: 100%;
        height: auto;
        min-height: 44px;
        margin-bottom: 4px;
        margin-left: 0;
        margin-right: 0;
        padding: 8px 10px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        text-align: left;
    }

    .sidebar.is-wide .nav-footer .nav-item .material-icons,
    .sidebar.is-wide .nav-footer .nav-item--report .material-icons {
        margin-bottom: 0;
    }
}

.nav-brand {
    margin-bottom: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.brand-link {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.brand-link:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.brand-logo {
    width: 36px;
    height: 36px;
    display:block;
}

.nav-item {
    width: 54px;
    height: 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-dim);
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    flex-shrink: 0;
    border: 1px solid transparent;
    position: relative;
    background: transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: -11px;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 2px;
    height: 56%;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.18s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--border);
}

.nav-item:hover::before {
    opacity: 0.45;
    transform: translateY(-50%) scaleY(0.55);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--text);
    border-color: var(--accent-border);
}

.nav-item.active::before {
    opacity: 1;
    transform: translateY(-50%) scaleY(1);
}

.nav-item .material-icons {
    font-size: 24px;
    margin-bottom: 2px;
    transition: color 0.18s ease;
}

.nav-item:hover .material-icons,
.nav-item.active .material-icons {
    transform: none;
    filter: none;
}

.nav-item.active .material-icons {
    color: var(--accent);
}

.nav-item .label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.15;
    text-transform: none;
    color: var(--muted);
    /* Crisp small labels on dark UI (avoid fuzzy antialiased + tiny caps) */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: geometricPrecision;
    transform: none;
}
.nav-item:hover .label,
.nav-item.active .label {
    color: var(--text);
}

/* Submenu Styles */
.submenu-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.submenu {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    background: rgba(8, 10, 13, 0.55);
    margin: 2px 0 8px 0;
    border-radius: var(--radius);
    padding: 6px 0;
    border: 1px solid var(--border);
    position: relative;
}

/* Separadores visuales entre grupos de nav (Trade / Piloto / Corp) */
.sidebar-inner > .nav-item + .submenu-container,
.sidebar-inner > .submenu-container + .submenu-container {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    width: 100%;
}

.sidebar-inner > .submenu-container + .nav-item {
    margin-top: 8px;
    position: relative;
}

.sidebar-inner > .submenu-container + .nav-item::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 1px;
    background: var(--border);
}

.submenu::before {
    display: none;
}

.submenu.open {
    display: flex;
    animation: slideDown 0.22s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.submenu .nav-item {
    width: 52px;
    height: auto;
    min-height: 52px;
    margin-bottom: 4px;
    padding: 5px 2px 6px;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.submenu .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    transform: none;
}

.submenu .nav-item:hover::before {
    opacity: 0.4;
    left: -8px;
    transform: translateY(-50%) scaleY(0.5);
}

.submenu .nav-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    box-shadow: none;
}

.submenu .nav-item.active::before {
    opacity: 1;
    left: -8px;
    transform: translateY(-50%) scaleY(0.85);
}

.submenu .nav-item .material-icons {
    font-size: 18px;
    margin-bottom: 1px;
}

/* Nombre visible bajo el icono (rail desktop icon+texto) */
.submenu .nav-item .label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    color: var(--muted);
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: geometricPrecision;
    transform: none;
}

.submenu .nav-item.is-tip-open {
    background: rgba(46, 200, 224, 0.08);
    border-color: var(--accent-border);
    color: var(--text);
}

/* Subsección acordeón anidada (Corp → Finanzas → tools) — panel/cuadradito ops-room */
.nav-subgroup {
    width: 58px;
    margin: 4px auto 2px;
    padding: 3px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background:
        linear-gradient(180deg, rgba(46, 200, 224, 0.07) 0%, transparent 55%),
        rgba(8, 10, 13, 0.72);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    box-shadow:
        inset 0 1px 0 rgba(46, 200, 224, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.25);
}

.nav-subgroup__toggle {
    position: relative;
    width: 100%;
    min-height: 28px;
    margin: 0;
    padding: 6px 14px 6px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid transparent;
    border-radius: calc(var(--radius-sm) + 1px);
    color: var(--accent-muted);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.nav-subgroup__toggle:hover {
    background: rgba(46, 200, 224, 0.18);
    border-color: rgba(46, 200, 224, 0.22);
    color: var(--cyan);
}

.nav-subgroup__toggle.active,
.nav-subgroup.open > .nav-subgroup__toggle,
.nav-subgroup:has(.nav-subgroup__items.open) > .nav-subgroup__toggle {
    color: var(--cyan);
    background: rgba(46, 200, 224, 0.16);
    border-color: rgba(46, 200, 224, 0.28);
}

.nav-subgroup__toggle .label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    color: inherit;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: geometricPrecision;
    transform: none;
}

.nav-subgroup__toggle::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.7;
    transform-origin: 50% 33%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 220ms ease;
    pointer-events: none;
}

.nav-subgroup.open > .nav-subgroup__toggle::after,
.nav-subgroup:has(.nav-subgroup__items.open) > .nav-subgroup__toggle::after {
    transform: translateY(-50%) rotate(180deg);
    opacity: 1;
}

.nav-subgroup__items {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-3px);
    margin: 0;
    padding: 0 1px;
    border-top: 1px solid transparent;
    transition: max-height 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 220ms ease,
                transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
                margin 200ms ease,
                padding 200ms ease,
                border-color 200ms ease,
                visibility 0s linear 280ms;
}

.nav-subgroup__items.open {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    margin-top: 3px;
    padding-top: 3px;
    border-top-color: rgba(46, 200, 224, 0.16);
    transition-delay: 0s;
}

.nav-subgroup__items .nav-item {
    width: 50px;
    min-height: 48px;
    margin-bottom: 2px;
}

/* Tip flotante sub-nav (mirror section-strip; posicionado en JS fuera del overflow del sidebar) */
.nav-blurb-tip {
    position: fixed;
    z-index: 240;
    left: 0;
    top: 0;
    width: max-content;
    max-width: min(260px, calc(100vw - 24px));
    padding: 9px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.1px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0s linear 0.16s;
}

.nav-blurb-tip.is-visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.nav-spacer {
    flex: 1;
    min-height: 8px;
}

.nav-corp-tenant {
    width: 100%;
    padding: 6px 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.nav-corp-tenant__label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    opacity: 0.9;
}
.nav-corp-tenant__label .material-icons {
    font-size: 18px;
    opacity: 0.75;
}
.nav-corp-tenant__logo {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.brand-link[data-corp-brand="1"] .brand-logo {
    border-radius: 4px;
    object-fit: contain;
}
.nav-corp-tenant__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.nav-corp-tenant__id {
    font-size: 10px;
    font-family: "IBM Plex Mono", monospace;
    opacity: 0.55;
    padding-left: 26px;
}
.nav-corp-switcher {
    width: 100%;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.35);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 11px;
}
.nav-corp-onboard {
    width: 100% !important;
    margin: 0 !important;
    font-size: 11px;
}
.sidebar:not(.is-wide) .nav-corp-tenant__name,
.sidebar:not(.is-wide) .nav-corp-tenant__id,
.sidebar:not(.is-wide) .nav-corp-switcher,
.sidebar:not(.is-wide) .nav-corp-onboard .label {
    display: none;
}
.sidebar:not(.is-wide) .nav-corp-tenant {
    align-items: center;
    padding: 4px 0;
}
.sidebar:not(.is-wide) .nav-corp-tenant__label {
    justify-content: center;
}

.nav-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
    padding: 0;
}

/* Footer items share the same box as the rail stack above */
.nav-footer .nav-item {
    width: 54px;
    margin-bottom: 6px;
    margin-left: 0;
    margin-right: 0;
}

.nav-footer .nav-item:last-child {
    margin-bottom: 0;
}

/* Logout nav-item subtle red accent on hover */
.nav-footer .nav-item--logout:hover {
    background: rgba(255, 82, 82, 0.08);
    color: #ff8a8a;
    border-color: rgba(255, 82, 82, 0.22);
}

.nav-footer .nav-item--logout:hover::before {
    background: var(--danger-color);
    box-shadow: none;
}

/* <button> must reset UA styles so it matches <a.nav-item> (Salir/Entrar) */
.nav-footer .nav-item--report {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-family: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0;
    margin: 0 0 6px 0;
    width: 54px;
    height: 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-align: center;
}

.nav-footer .nav-item--report:hover {
    background: rgba(46, 200, 224, 0.08);
    color: var(--accent);
    border-color: rgba(46, 200, 224, 0.22);
}

.nav-footer .nav-item--report:focus-visible {
    outline: 2px solid var(--accent-border);
    outline-offset: 2px;
}

/* Sidebar report modal */
.nav-report-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.nav-report-modal[hidden] {
    display: none !important;
}

.nav-report-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.nav-report-modal__panel {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    padding: 20px;
    color: var(--text);
}

.nav-report-modal__panel h3 {
    font-family: var(--font-display);
    letter-spacing: 0.45px;
    text-transform: uppercase;
    font-size: 1.05rem;
    margin: 0 0 8px;
}

.nav-report-modal__hint {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.nav-report-modal__textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    margin-bottom: 10px;
}

.nav-report-modal__status {
    margin: 0 0 10px;
    font-size: 0.88rem;
}

.nav-report-modal__status[data-kind="ok"] {
    color: #7ddea0;
}

.nav-report-modal__status[data-kind="err"] {
    color: #ff8a8a;
}

.nav-report-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-report-modal__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(46, 200, 224, 0.03) 0%, transparent 120px),
        radial-gradient(ellipse 70% 40% at 100% 0%, rgba(26, 31, 40, 0.7) 0%, transparent 55%),
        var(--bg);
}

.top-bar {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 2vw, 28px);
    border-bottom: 1px solid var(--border);
    background: rgba(14, 17, 22, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: none;
}

.top-bar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-muted), transparent 42%);
    opacity: 0.45;
    pointer-events: none;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin: 0;
    color: var(--text);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
}

.page-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 0.95em;
    border-radius: 1px;
    background: var(--accent);
    vertical-align: -0.12em;
    margin-right: 12px;
    box-shadow: none;
}

/* Section strip — nombre de sección bajo la barra superior + info al hover/foco/tap */
.section-strip {
    position: relative;
    z-index: 45;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(90deg, rgba(46, 200, 224, 0.06) 0%, transparent 28%),
        rgba(8, 10, 13, 0.72);
    box-shadow: inset 3px 0 0 0 rgba(46, 200, 224, 0.55);
}

.section-strip__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    /* Misma sangría que .content-body para alinear con el contenido */
    padding: 0 clamp(20px, 2.4vw, 36px);
}

.section-strip__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    margin: 0 0 0 -6px;
    padding: 4px 8px;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: left;
    cursor: help;
    transition: color 0.18s ease, background 0.18s ease;
}

.section-strip__group { color: var(--text-dim); font-weight: 500; }
.section-strip__sep { color: var(--accent-muted); opacity: 0.85; margin: 0 2px; }
.section-strip__name { color: var(--text); font-weight: 600; }

.section-strip__hint {
    font-size: 15px;
    color: var(--text-dim);
    opacity: 0.7;
    transition: opacity 0.18s ease, color 0.18s ease;
}

.section-strip__label:hover,
.section-strip__label:focus-visible,
.section-strip.is-open .section-strip__label {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.section-strip__label:hover .section-strip__hint,
.section-strip__label:focus-visible .section-strip__hint,
.section-strip.is-open .section-strip__hint {
    opacity: 1;
    color: var(--text);
}

.section-strip__label:focus-visible {
    outline: 1px solid var(--border-strong);
    outline-offset: 1px;
}

.section-strip__tip {
    position: absolute;
    left: clamp(20px, 2.4vw, 36px);
    top: calc(100% + 4px);
    width: max-content;
    max-width: min(320px, calc(100vw - 32px));
    padding: 9px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.1px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-3px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.section-strip__label:hover ~ .section-strip__tip,
.section-strip__label:focus-visible ~ .section-strip__tip,
.section-strip.is-open .section-strip__tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

@media (max-width: 768px) {
    .section-strip__inner { padding: 0 12px; }
    .section-strip__tip { left: 12px; }
    .section-strip__label { min-height: 36px; font-size: 0.74rem; }
    .section-strip__tip { max-width: calc(100vw - 24px); font-size: 0.85rem; }
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    position: relative;
    padding: 12px 16px 12px 18px;
    margin-left: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 0.9em;
    font-weight: 500;
    letter-spacing: 0.15px;
    box-shadow: none;
    animation: fadeIn 280ms ease;
    overflow: hidden;
}

.flash-message::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 2px;
    border-radius: 0 2px 2px 0;
    background: var(--accent);
    box-shadow: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Corporation Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.alert {
    position: relative;
    padding: 12px 14px 12px 16px;
    border-radius: var(--radius);
    margin: 14px 0;
    margin-left: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    overflow: hidden;
    box-shadow: none;
    letter-spacing: 0.1px;
}

.alert.info {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
}

.alert.info::before {
    content: '';
    position: absolute;
    top: 8px; bottom: 8px; left: 0;
    width: 2px; border-radius: 0 2px 2px 0;
    background: var(--cyan);
    box-shadow: none;
}

.alert.warning {
    background: rgba(255, 145, 0, 0.08);
    border: 1px solid rgba(255, 145, 0, 0.28);
    color: #ffe7c9;
}

.alert.warning::before {
    content: '';
    position: absolute;
    top: 8px; bottom: 8px; left: 0;
    width: 2px; border-radius: 0 2px 2px 0;
    background: var(--amber);
    box-shadow: none;
}

.alert .material-icons,
.alert .fas,
.alert .far {
    flex-shrink: 0;
    margin-top: 1px;
}

.mt-20 { margin-top: 20px; }

.btn-large {
    padding: 14px 28px;
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: var(--radius);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-large:hover { transform: none; }
.btn-large:active { transform: none; }

/* Buttons */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    font-size: 13.5px;
    line-height: 1.15;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

.btn::before {
    display: none;
}

.btn:active {
    transform: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
    border-color: var(--border-strong);
}

.btn[disabled], .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: #e8eaed;
    color: #0b0d10;
    border-color: #e8eaed;
    box-shadow: none;
    text-shadow: none;
}

.btn-primary:hover {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: none;
}

.btn-danger {
    background: transparent;
    color: #ffaeae;
    border-color: rgba(255, 82, 82, 0.35);
    box-shadow: none;
}

.btn-danger:hover {
    background: rgba(255, 82, 82, 0.12);
    border-color: rgba(255, 82, 82, 0.5);
    color: #ffd6d6;
    box-shadow: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    text-transform: uppercase;
}

.badge-bounties { background: rgba(76, 175, 80, 0.12); color: #81c784; border-color: rgba(76, 175, 80, 0.28); box-shadow: none; }
.badge-market { background: rgba(33, 150, 243, 0.12); color: #64b5f6; border-color: rgba(33, 150, 243, 0.28); box-shadow: none; }
.badge-industry { background: rgba(255, 152, 0, 0.12); color: #ffb74d; border-color: rgba(255, 152, 0, 0.28); box-shadow: none; }
.badge-donations { background: rgba(156, 39, 176, 0.12); color: #ce93d8; border-color: rgba(156, 39, 176, 0.28); box-shadow: none; }
.badge-ore_purchase { background: rgba(255, 160, 60, 0.14); color: #ffb74d; border-color: rgba(255, 160, 60, 0.32); box-shadow: none; }
.badge-others { color: var(--muted); }

.positive { color: #81c784; text-shadow: none; font-weight: 600; }
.negative { color: #ef5350; text-shadow: none; font-weight: 600; }

.btn-refresh {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.83em;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-refresh:hover {
    transform: none;
    border-color: var(--border-strong);
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

.btn-refresh:active { transform: none; }

.section-kpis,
.coverage-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.section-kpi,
.coverage-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease;
    position: relative;
    overflow: hidden;
}

.section-kpi::before,
.coverage-kpi::before {
    display: none;
}

.section-kpi:hover,
.coverage-kpi:hover {
    transform: none;
    border-color: var(--border-strong);
    background: var(--surface-2);
    box-shadow: none;
}

.section-kpi-label,
.coverage-kpi-label {
    color: var(--muted);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
}

.section-kpi-value,
.coverage-kpi-value {
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.15px;
    color: var(--text);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    font-variant-numeric: tabular-nums;
}

.form-group label {
    display: block;
    font-size: 11.5px;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 7px;
    text-transform: uppercase;
    padding-left: 2px;
}

.ticket-form .form-group + .form-group {
    margin-top: 14px;
}

.js-reveal {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.js-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Forms */
.form-control {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 0.1px;
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-dim);
    letter-spacing: 0.1px;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-strong);
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

select.form-control {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.45) 50%), linear-gradient(135deg, rgba(255, 255, 255, 0.45) 50%, transparent 50%);
    background-position: calc(100% - 17px) calc(50% + 0px), calc(100% - 12px) calc(50% + 0px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    background-color: var(--bg);
    padding-right: 32px;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 0.1px;
    outline: none;
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.search-input::placeholder {
    color: var(--text-dim);
    letter-spacing: 0.1px;
}

.search-input:focus {
    border-color: var(--border-strong);
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

select.search-input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.45) 50%), linear-gradient(135deg, rgba(255, 255, 255, 0.45) 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% + 0px), calc(100% - 11px) calc(50% + 0px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    background-color: var(--bg);
    padding-right: 32px;
}

.isk-value {
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.15px;
    font-variant-numeric: tabular-nums;
    color: var(--amber);
}

.profit {
    color: var(--success-color);
    text-shadow: none;
    font-weight: 600;
}

.loss {
    color: var(--danger-color);
    text-shadow: none;
    font-weight: 600;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 12px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: none;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.03);
}

.data-table th {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    white-space: nowrap;
}

.data-table th::after {
    display: none;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.92em;
    color: var(--text);
    transition: background 0.15s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: var(--border);
}

.data-table tbody tr:hover td:first-child {
    border-left: 2px solid var(--cyan);
    padding-left: 12px;
    box-shadow: none;
}

.data-table td:first-child {
    border-left: 2px solid transparent;
    padding-left: 14px;
    transition: border-left-color 0.15s ease, padding-left 0.15s ease;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 10px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease;
    cursor: default;
    color: var(--muted);
    font-size: 0.88em;
    font-family: var(--font-mono);
    letter-spacing: 0.2px;
}

.user-profile:hover {
    transform: none;
    border-color: var(--border-strong);
    background: var(--surface-2);
    box-shadow: none;
}

.status-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
    position: relative;
}

.status-indicator::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0;
    animation: statusPulse 2.2s ease-out infinite;
    pointer-events: none;
}

@keyframes statusPulse {
    0% { transform: scale(0.85); opacity: 0.55; }
    80% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1.8); opacity: 0; }
}

.status-indicator.online {
    background-color: var(--success-color);
    color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(105, 240, 174, 0.15);
}

.content-body {
    flex: 1;
    padding: clamp(20px, 2.4vw, 36px);
    overflow-y: auto;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
}

/* Text Utils */
.text-dim { color: var(--text-dim); }
.text-secondary { color: var(--text-secondary); }
.text-right { text-align: right; }

/* Grid & Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.dash-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-top: 16px;
}

.dash-hero-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}

.dash-hero-meta strong {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.dash-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.dash-quick-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 14px 12px;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.18s ease, background 0.18s ease;
    min-height: 88px;
}

.dash-quick-link:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.dash-quick-link .material-icons {
    font-size: 22px;
    color: var(--muted);
}

.dash-quick-link:hover .material-icons {
    color: var(--accent);
}

.dash-quick-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dash-quick-hint {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.35;
}

/* Tutoriales por sección (dashboard) */
.dash-tutorials {
    margin-top: 16px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(18, 18, 20, 0.98), rgba(10, 10, 12, 0.98));
}

.dash-tutorials.dash-tutorials-flash {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.dash-tutorials-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.dash-tutorials-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dash-tutorials-toggle-left,
.dash-tutorials-toggle-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.dash-tutorials-icon {
    font-size: 22px;
    color: rgba(220, 220, 220, 0.75);
}

.dash-tutorials-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dash-tutorials-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.2px;
}

.dash-tutorials-sub {
    font-size: 12px;
    line-height: 1.35;
}

.dash-tutorials-progress {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: rgba(200, 200, 200, 0.7);
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
}

.dash-tutorials-chevron {
    font-size: 22px;
    color: rgba(180, 180, 180, 0.75);
    transition: transform 0.18s ease;
}

.dash-tutorials.is-open .dash-tutorials-chevron {
    transform: rotate(180deg);
}

.dash-tutorials-list {
    display: none;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-tutorials.is-open .dash-tutorials-list,
.dash-tutorials-list:not([hidden]) {
    display: flex;
}

.dash-tutorials-list[hidden] {
    display: none !important;
}

.dash-tutorials-guide-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(46, 200, 224, 0.12);
    background: linear-gradient(90deg, rgba(46, 200, 224, 0.06), transparent 70%);
}

.dash-tutorials-guide-copy {
    margin: 0;
    flex: 1;
    min-width: 180px;
    font-size: 12.5px;
    line-height: 1.45;
}

.ops-tour-strip {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid rgba(46, 200, 224, 0.2);
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(8, 14, 18, 0.4), rgba(46, 200, 224, 0.06));
}

.ops-tour-strip-label {
    margin-right: auto;
    font-size: 12.5px;
}

.ops-tour-start {
    white-space: nowrap;
}

.dash-tutorial-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.dash-tutorial-item:first-child {
    border-top: 0;
}

.dash-tutorial-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dash-tutorial-item.is-done {
    background: rgba(40, 120, 70, 0.08);
}

.dash-tutorial-item.is-done:hover {
    background: rgba(40, 120, 70, 0.14);
}

.dash-tutorial-check {
    font-size: 20px;
    color: #3dce7a;
    flex-shrink: 0;
}

.dash-tutorial-item:not(.is-done) .dash-tutorial-check[hidden] {
    display: none;
}

.dash-tutorial-item:not(.is-done)::before {
    content: "";
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.25);
}

.dash-tutorial-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.dash-tutorial-label {
    font-weight: 650;
    font-size: 0.95rem;
}

.dash-tutorial-hint {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.35;
}

.dash-tutorial-status {
    font-size: 11.5px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(170, 170, 170, 0.75);
    flex-shrink: 0;
}

.dash-tutorial-status.is-done {
    color: #3dce7a;
}

a.dash-stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.dash-stat-link:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.dash-value-muted {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    color: var(--muted) !important;
}

.dash-kpi-sub {
    margin-top: 4px;
    font-size: 11.5px;
}

.dash-main-row {
    align-items: start;
}

.dash-side-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.dash-side-stack .large-card {
    min-height: 0;
}

.dash-yt-card {
    padding-top: 32px;
    padding-bottom: 32px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.dash-yt-card .dash-yt-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 12px;
    margin-bottom: 4px;
}

.dash-yt-mark {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: #ff4d4d;
    font-size: 1.55rem;
}

.dash-yt-copy {
    min-width: 0;
    flex: 1;
}

.dash-yt-channel {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 6px;
}

.dash-yt-copy p {
    margin: 0 0 14px;
    line-height: 1.55;
}

.dash-yt-cta {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dash-yt-handle {
    margin-top: 10px;
    font-size: 12px;
    word-break: break-all;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    display: none;
}

.card:hover {
    transform: none;
    border-color: var(--border-strong);
    background: var(--surface-2);
    box-shadow: none;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.stat-card .card-info,
.stat-card .stat-data {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

/* Números en cajas: centrados + caben (JS .num-fit escala font-size) */
.num-fit,
.card-info .value,
.stat-value,
.section-kpi-value,
.coverage-kpi-value,
.wb-kpi-value,
.wb-ehp-value,
.sim-stat-value,
.sim-kpi-value,
.fits-mini-kpi-value {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.section-kpi-value,
.coverage-kpi-value {
    flex: 1 1 auto;
    max-width: 64%;
}

.section-kpi,
.coverage-kpi {
    min-width: 0;
}

.stat-data {
    min-width: 0;
    overflow: hidden;
}

.stat-label {
    text-align: center;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    box-shadow: none;
    flex: 0 0 auto;
    transition: border-color 0.18s ease;
}

.card:hover .card-icon {
    transform: none;
}

.card-icon.accent {
    color: var(--cyan);
    background: rgba(46, 200, 224, 0.08);
    border-color: rgba(46, 200, 224, 0.22);
    box-shadow: none;
}

.card-icon.orange {
    color: var(--amber);
    background: rgba(255, 145, 0, 0.1);
    border-color: rgba(255, 145, 0, 0.28);
    box-shadow: none;
}

.card-icon.purple {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    box-shadow: none;
}

.card-info h3 {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.card-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.15px;
    color: var(--text);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    line-height: 1.15;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.large-card {
    min-height: 300px;
}

.large-card h2 {
    margin-top: 0;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    position: relative;
    padding-left: 12px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
}

.large-card h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 14px;
    width: 2px;
    border-radius: 2px;
    background: var(--cyan);
    box-shadow: none;
    -webkit-text-fill-color: currentColor;
}

.space-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header-clean {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.card-header-clean::after {
    display: none;
}

.card-header-clean h2,
.card-header-clean h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    color: var(--text);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
}

.card-header-clean h2 { font-size: 1.15rem; }
.card-header-clean h3 { font-size: 1.02rem; }

.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    margin: 2px auto 22px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 2px;
    border-radius: 0 2px 2px 0;
    background: var(--accent);
    box-shadow: none;
}

.page-hero::after {
    display: none;
}

.page-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.page-hero-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    display: block;
    flex: 0 0 auto;
    box-shadow: none;
    transition: border-color 0.18s ease;
}

.page-hero-logo:hover {
    transform: none;
    border-color: var(--border-strong);
    box-shadow: none;
}

.page-hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    line-height: 1.15;
    color: var(--text);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    font-size: 1.35rem;
}

.page-hero-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12.5px;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    opacity: 1;
}

.page-hero-right {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Utils */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 30px 0;
}

.alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 14px;
    color: var(--text-secondary);
}

.alert-item .material-icons { font-size: 20px; }
.alert-item.high { color: var(--cyan); }
.alert-item.info { color: var(--text-secondary); }
.alert-item.success { color: var(--success-color); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--panel-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--panel-hover);
}

/* Tables: canonical .data-table styles are defined earlier */

/* Glass Panels */
.glass-panel {
    background: var(--surface);
    backdrop-filter: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: none;
    margin-bottom: 22px;
}

.glass-panel-secondary {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--border);
}

/* Legacy duplicate button/badge blocks kept as no-ops aliases
   (canonical styles are defined earlier in this file). */

.section-kpis,
.coverage-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.section-kpi,
.coverage-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* KPI / form label duplicates intentionally omitted — see earlier definitions */

.ticket-form .form-group + .form-group {
    margin-top: 12px;
}

.js-reveal {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.js-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Forms: canonical .form-control / .search-input are defined earlier */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.modern-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 600;
    text-transform: none;
    font-size: 12px;
    letter-spacing: 0.2px;
    border-bottom: 1px solid var(--border);
}

.modern-table th,
.modern-table td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.modern-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

.modern-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.isk-text {
    font-variant-numeric: tabular-nums;
    color: var(--amber);
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 340px;
    background: var(--surface-2);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    border: 1px solid var(--border);
    border-bottom: none;
    backdrop-filter: blur(10px);
    transition: transform 280ms ease, border-color 0.18s ease;
    overflow: hidden;
}

/* Desktop: sit beside AI widget (avoid overlapping) */
.chat-widget.chat-widget--beside-ai {
    right: 380px;
}

.chat-widget::before {
    display: none;
}

.chat-widget.collapsed {
    transform: translateY(calc(100% - 44px));
}

.chat-header-bar {
    padding: 11px 15px 11px 16px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
    transition: background 0.18s ease;
    user-select: none;
}

.chat-header-bar::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success-color);
    box-shadow: none;
    margin-right: 10px;
    vertical-align: middle;
}

.chat-header-bar:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.chat-header-bar i {
    transition: transform 0.2s ease, color 0.18s ease;
    color: var(--muted);
}

.chat-widget.collapsed .chat-header-bar i {
    transform: rotate(180deg);
    color: var(--muted);
}

.chat-body {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-room-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent, #2ec8e0);
    border: 1px solid rgba(46, 200, 224, 0.35);
    border-radius: 3px;
    background: rgba(46, 200, 224, 0.08);
    vertical-align: middle;
}

.chat-room-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 8px 8px 6px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    scrollbar-width: thin;
}

.chat-room-tabs::-webkit-scrollbar { height: 4px; }
.chat-room-tabs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }

.chat-room-tab {
    flex: 0 0 auto;
    height: 26px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 4px);
    color: var(--muted, #9aa3ad);
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.chat-room-tab:hover {
    border-color: rgba(46, 200, 224, 0.4);
    color: var(--text, #e8eaed);
    background: rgba(46, 200, 224, 0.06);
}

.chat-room-tab.is-active {
    border-color: rgba(46, 200, 224, 0.55);
    color: var(--text, #e8eaed);
    background: rgba(46, 200, 224, 0.12);
}

.chat-room-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 200, 224, 0.28);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-size: 13px;
    background: var(--bg);
}

.chat-empty {
    padding: 18px 12px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 0.02em;
    line-height: 1.45;
}

.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

.chat-msg {
    margin-bottom: 10px;
    line-height: 1.45;
    padding: 8px 11px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid var(--border-strong);
    border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.chat-msg:hover {
    background: rgba(228, 236, 240, 0.04);
    border-left-color: rgba(228, 236, 240, 0.55);
}

.chat-msg .time { color: var(--text-dim); font-size: 10.5px; letter-spacing: 0.2px; }
.chat-msg .user { color: var(--text); font-weight: 600; letter-spacing: 0.15px; }
.chat-msg .text { color: var(--muted); }

.chat-input-row {
    padding: 10px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.chat-input-row input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.1px;
    outline: none;
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.chat-input-row input::placeholder {
    color: var(--text-dim);
    letter-spacing: 0.1px;
}

.chat-input-row input:focus {
    border-color: var(--border-strong);
    background: var(--surface-2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.chat-input-row button {
    background: #e8eaed;
    color: #0b0d10;
    border: 1px solid #e8eaed;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 40px;
    font-weight: 600;
    letter-spacing: 0.15px;
    box-shadow: none;
    transition: background 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-input-row button:hover {
    background: #ffffff;
    box-shadow: none;
}

.chat-input-row button:active {
    transform: none;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 28px 0;
    position: relative;
}

.section-divider::before {
    display: none;
}

.alert-list {
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 4px;
    border-bottom: 1px solid rgba(228, 236, 240, 0.07);
    font-size: 13.5px;
    color: #b7cad0;
    letter-spacing: 0.1px;
    transition: background 220ms ease, color 220ms ease, padding-left 220ms ease;
    border-left: 3px solid transparent;
    padding-left: 6px;
    border-radius: 0 10px 10px 0;
}

.alert-item:hover {
    background: rgba(228, 236, 240, 0.04);
    color: #dce4e8;
    padding-left: 8px;
    border-left-color: rgba(228, 236, 240, 0.35);
}

.alert-item .material-icons {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-item.high {
    color: #c8d6dc;
    border-left-color: rgba(228, 236, 240, 0.45);
}

.alert-item.high .material-icons {
    filter: drop-shadow(0 0 6px rgba(228, 236, 240, 0.45));
}

.alert-item.info { color: #aebfbf; }
.alert-item.success {
    color: #9fe8cf;
    border-left-color: rgba(80, 227, 194, 0.40);
}
.alert-item.success .material-icons {
    filter: drop-shadow(0 0 6px rgba(80, 227, 194, 0.35));
}

/* ================================================================
   📱 MENÚ MÓVIL — BOTÓN HAMBURGUESA, OVERLAY, SIDEBAR
   ================================================================ */

.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    border: 1px solid rgba(228, 236, 240, 0.18);
    border-radius: 12px;
    color: #dbe5e9;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
                background 220ms ease,
                border-color 220ms ease,
                box-shadow 220ms ease,
                color 220ms ease;
    position: relative;
    z-index: 60;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

.mobile-menu-btn:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.03));
    border-color: rgba(228, 236, 240, 0.34);
    color: #eef3f5;
    box-shadow: 0 4px 14px rgba(0,0,0,0.30), 0 0 0 1px rgba(228,236,240,0.06);
}

.mobile-menu-btn:active {
    transform: scale(0.96);
}

.mobile-menu-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(228, 236, 240, 0.20),
                0 0 0 1px rgba(228, 236, 240, 0.45),
                0 4px 14px rgba(0,0,0,0.28);
    border-color: rgba(228, 236, 240, 0.55);
}

.mobile-menu-btn .material-icons {
    font-size: 26px;
    transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 220ms ease;
    display: inline-block;
}

body.sidebar-open .mobile-menu-btn .material-icons {
    transform: rotate(90deg);
}

/* Overlay móvil */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 90;
    opacity: 0;
    transition: opacity 260ms ease;
    pointer-events: none;
}

/* ================================================================
   ▶️ SUBMENÚS — Mejoras visuales y flecha expandible
   ================================================================ */

.submenu-container > .nav-item {
    position: relative;
}

.submenu-container > .nav-item::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.55;
    transform-origin: 50% 33%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 220ms ease;
    pointer-events: none;
}

.submenu-container:has(.submenu.open) > .nav-item::after,
.submenu-container.open > .nav-item::after {
    transform: translateY(-50%) rotate(180deg);
    opacity: 0.9;
}

.submenu {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 260ms ease,
                transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
                margin 240ms ease,
                padding 240ms ease;
    display: flex;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
}

.submenu.open {
    /* Cabida para acordeón anidado (Corp → Finanzas → 4 items) */
    max-height: 720px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 2px;
    margin-bottom: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-width: 1px;
    animation: none;
}

.submenu-container > .nav-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ================================================================
   📏 MEDIA QUERY PRINCIPAL — MÓVIL (≤ 768px)
   ================================================================ */

@media (max-width: 768px) {

    html {
        overflow-x: hidden;
        max-width: 100%;
    }

    body {
        overflow: hidden;
        overflow-x: hidden;
        max-width: 100vw;
        /* Safe areas for Android notches / gesture bars */
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    /* Botón menú visible solo en móvil */
    .mobile-menu-btn {
        display: inline-flex;
        min-width: 44px;
        min-height: 44px;
    }

    /* Overlay visible cuando sidebar abierto */
    .mobile-overlay {
        display: block;
    }

    body.sidebar-open .mobile-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    /* Sidebar en móvil: sale por la izquierda */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 86px;
        max-width: 86vw;
        z-index: 95;
        transform: translateX(-110%);
        transition: transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1),
                    box-shadow 300ms ease;
        box-shadow: none;
        will-change: transform;
        -webkit-overflow-scrolling: touch;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.55),
                    inset -1px 0 0 rgba(255,255,255,0.03);
    }

    /* En móvil, el sidebar es más ancho para acomodar labels */
    .sidebar {
        width: 88px;
    }

    .nav-item {
        width: 64px;
        height: 64px;
        margin-bottom: 12px;
        border-radius: 16px;
    }

    .nav-item .material-icons {
        font-size: 26px;
        margin-bottom: 4px;
    }

    .nav-item .label {
        font-size: 11px;
        letter-spacing: 0.1px;
    }

    .submenu-container > .nav-item::after {
        right: 7px;
        border-top-width: 6px;
        border-left-width: 5px;
        border-right-width: 5px;
    }

    .submenu {
        width: 92%;
    }

    .submenu .nav-item {
        width: 54px;
        height: 54px;
        margin-bottom: 6px;
        border-radius: 14px;
    }

    .submenu .nav-item .material-icons {
        font-size: 22px;
    }

    /* Ajustes top-bar en móvil */
    .top-bar {
        height: 64px;
        padding: 0 12px;
        gap: 8px;
    }

    .page-title {
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 55vw;
    }

    .page-title::before {
        width: 4px;
        height: 18px;
        margin-right: 8px;
    }

    .user-profile {
        padding: 5px 10px 5px 8px;
        font-size: 12.5px;
        gap: 6px;
    }

    .user-profile span.status-indicator {
        width: 7px;
        height: 7px;
    }

    .user-profile span:not(.status-indicator) {
        max-width: 24vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    /* Contenido en móvil */
    .main-content {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    .content-body {
        padding: 14px 12px;
        /* Room for stacked collapsed chat + AI bars */
        padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
        max-width: 100%;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    /* Optional UA/touch hints (set on <html>/<body> from base.html) */
    html.is-touch .btn,
    body.is-touch .btn,
    html.is-phone .btn,
    body.is-phone .btn {
        min-height: 44px;
    }

    html.is-android .form-control,
    html.is-android .search-input,
    html.is-ios .form-control,
    html.is-ios .search-input {
        font-size: 16px;
    }

    /* Grid dashboard en móvil */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 20px;
    }

    .dash-kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .dash-quick-links {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .dash-quick-link {
        min-height: 78px;
        padding: 12px;
    }

    .dash-yt-card .dash-yt-body {
        flex-direction: column;
    }

    .dash-hero-meta {
        width: 100%;
        justify-content: flex-start;
    }

    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card {
        padding: 16px 14px;
        border-radius: 14px;
    }

    .stat-card {
        gap: 14px;
    }

    .card-info .value {
        font-size: 20px;
    }

    .card-icon {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    /* KPIs en móvil */
    .section-kpis,
    .coverage-kpis {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .section-kpi,
    .coverage-kpi {
        padding: 9px 10px;
        border-radius: 11px;
    }

    .section-kpi-label,
    .coverage-kpi-label {
        font-size: 9.5px;
        letter-spacing: 0.3px;
    }

    .section-kpi-value,
    .coverage-kpi-value {
        font-size: 14px;
    }

    /* Tablas en móvil: scrolleo horizontal */
    .table-container,
    .data-table {
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 10px 10px;
        font-size: 12.5px;
        white-space: nowrap;
    }

    /* Forms en móvil */
    .form-control,
    .search-input {
        font-size: 16px; /* Evita zoom automático en iOS */
        padding: 12px 13px;
    }

    .btn {
        padding: 11px 16px;
        font-size: 14px;
        min-height: 44px; /* Área táctil decente */
    }

    .btn-large {
        padding: 13px 22px;
    }

    /* Page hero en móvil */
    .page-hero {
        padding: 12px 14px;
        gap: 10px;
    }

    .page-hero-logo {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .page-hero-title {
        font-size: 17px;
    }

    .page-hero-subtitle {
        font-size: 12.5px;
    }

    /* Chat e IA widget en móvil: full-bleed, no bloquear scroll del body */
    .chat-widget,
    .chat-widget.chat-widget--beside-ai {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: calc(100vw - 16px);
        border-radius: 14px 14px 0 0;
        bottom: env(safe-area-inset-bottom, 0px);
        z-index: 997;
        touch-action: manipulation;
    }

    .chat-body {
        height: min(38vh, 280px);
        max-height: 42dvh;
    }

    .chat-input-row input {
        font-size: 16px; /* evita zoom iOS/Android */
    }

    .chat-input-row button {
        min-width: 44px;
        min-height: 44px;
    }

    .chat-header-bar {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Nav items: targets táctiles ≥ 44px */
    .nav-item {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Evitar overflow horizontal en tablas/grids */
    .table-container {
        max-width: 100%;
        overflow-x: auto;
    }

    img,
    canvas,
    video,
    iframe {
        max-width: 100%;
    }
}

/* ================================================================
   🔽 PANTALLAS MUY PEQUEÑAS (≤ 420px)
   ================================================================ */

@media (max-width: 420px) {

    .sidebar {
        width: 82px;
    }

    .nav-item {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
        border-radius: 14px;
    }

    .nav-item .material-icons {
        font-size: 24px;
    }

    .nav-item .label {
        font-size: 10px;
    }

    .page-title {
        font-size: 16px;
    }

    .top-bar {
        height: 60px;
        padding: 0 10px;
    }

    .user-profile span:not(.status-indicator) {
        max-width: 22vw;
        font-size: 12px;
    }

    .section-kpis,
    .coverage-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .card {
        padding: 14px 12px;
    }

    .card-info .value {
        font-size: 18px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn + .btn {
        margin-top: 8px;
    }

    .space-between {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ================================================================
   📱 TABLETA PEQUEÑA (421px – 600px)
   ================================================================ */

@media (min-width: 421px) and (max-width: 600px) {
    .section-kpis,
    .coverage-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================================
   OPS-ROOM WAVE 1 — dashboard + fits workstation (CSS only)
   Rollback: static/css/OPSROOM_ROLLBACK.md + *.bak_pre_opsroom
   Accent: cyan (--accent / --cyan). Amber reserved for ISK/secondary.
   ================================================================ */

.card-info .value,
.stat-value,
.wb-kpi-value,
.wb-ehp-value,
.sim-stat-value,
.sim-kpi-value,
.fits-mini-kpi-value {
    font-family: var(--font-mono);
}

.dash-quick-link {
    border-radius: var(--radius);
    background: var(--surface);
}

.dash-quick-link:hover {
    border-color: var(--accent-border);
    background: var(--surface-2);
}

.dash-hero-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.2px;
}

/* Fits: workstation surfaces without touching simulate structure/IDs */
.fits-layout .fits-sidebar.card,
.fits-layout .ewb-fit-shell,
.fits-layout .fits-ship-card {
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.fits-layout .fits-side-title,
.fits-layout .fits-section-title,
.fits-layout .ewb-fit-title,
.fits-layout .fits-ship-name,
.fits-layout .fits-selected-name {
    font-family: var(--font-display);
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.fits-layout .fits-slot-badge {
    border-radius: var(--radius-sm);
    border-color: var(--border-strong);
    background: rgba(8, 10, 13, 0.55);
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.fits-layout .fits-slot-h { border-color: rgba(46, 200, 224, 0.35); color: var(--accent); }
.fits-layout .fits-slot-m { border-color: rgba(224, 154, 58, 0.35); color: var(--amber); }
.fits-layout .fits-slot-l { border-color: rgba(105, 240, 174, 0.28); color: var(--success-color); }
.fits-layout .fits-slot-r { border-color: var(--border-strong); color: var(--muted); }

.fits-layout .fits-selected {
    border-radius: var(--radius);
    border-color: var(--border);
    background: rgba(8, 10, 13, 0.45);
}

.fits-layout .fits-eve-tab,
.fits-layout .sim-tab {
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.fits-layout .fits-eve-tab.active,
.fits-layout .sim-tab.active {
    border-color: var(--accent-border);
    color: var(--text);
    background: var(--accent-soft);
}

.fits-layout .fits-progress {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.fits-layout .fits-progress-fill {
    border-radius: 0;
}

.fits-layout .fits-progress-cyan { background: var(--accent); }
.fits-layout .fits-progress-amber { background: var(--amber); }

.fits-layout .fits-res-bar-head,
.fits-layout .fits-selected-meta,
.fits-layout .fits-ship-meta {
    font-family: var(--font-mono);
    font-size: 0.78em;
    letter-spacing: 0.2px;
}

.fits-layout .ewb-tabs .sim-tab.active {
    border-bottom-color: var(--accent);
    color: var(--text);
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.2rem;
        letter-spacing: 0.4px;
    }

    .section-strip__label {
        font-size: 0.85rem;
    }

    .sidebar-inner > .submenu-container + .nav-item::after {
        width: 22px;
    }
}

/* ================================================================
   OPS-ROOM WAVE 2 — Trade / Corp / Piloto console tables & panels
   Rollback: OPSROOM_ROLLBACK.md + *.bak_pre_opsroom_w2 (undo w2 only)
   Full undo: *.bak_pre_opsroom
   ================================================================ */

/* --- Dense console tables (shared) --- */
.data-table {
    margin-top: 8px;
    overflow: visible;
}

.data-table th {
    padding: 7px 10px;
    font-size: 10.5px;
    letter-spacing: 0.7px;
    font-family: var(--font-display);
    background: var(--surface-2);
    z-index: 2;
}

.data-table td {
    padding: 6px 10px;
    font-size: 0.86em;
}

.table-container,
.table-responsive {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    max-height: min(70vh, 720px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container > .data-table,
.table-responsive > .data-table,
.table-container > .modern-table,
.table-responsive > .modern-table {
    margin-top: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.data-table thead th,
.modern-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--surface-2);
    box-shadow: 0 1px 0 var(--border);
}

.modern-table th,
.modern-table td {
    padding: 7px 10px;
    font-size: 0.86em;
}

.modern-table thead th {
    font-family: var(--font-display);
    font-size: 10.5px;
    letter-spacing: 0.65px;
    text-transform: uppercase;
    color: var(--muted);
}

/* Mono / tabular numbers */
.num,
.modern-table .num,
.data-table .num,
.price-col,
.vol-col,
.isk-value,
.isk-text,
.stat-value,
.wallet-balance,
.tree-node-total,
.summary-value,
td.text-right,
th.text-right {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.15px;
}

.modern-table .num,
.data-table .num,
.price-col,
.vol-col {
    text-align: right;
}

/* Panel surfaces consistent with ops-room tokens */
.glass-panel {
    padding: 16px 18px;
    background: var(--surface);
    border-color: var(--border);
}

.glass-panel-secondary {
    background: var(--surface-2);
    border-color: var(--border);
}

.panel-header {
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 4px;
}

.panel-header h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 0.55px;
    margin: 0;
    font-weight: 600;
}

.filter-controls,
.filters-container {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 12px 14px !important;
}

/* Corp → Wallets toolbar: wrap, gap, no right-edge glue / overlap */
body[data-active-page="corporation"] .corp-wallet-filters {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}
body[data-active-page="corporation"] .corp-wallet-filters .filter-search {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 100%;
}
body[data-active-page="corporation"] .corp-wallet-filters .search-box {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
body[data-active-page="corporation"] .corp-wallet-filters .filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
}
@media (max-width: 900px) {
    body[data-active-page="corporation"] .corp-wallet-filters {
        flex-direction: column;
        align-items: stretch;
    }
    body[data-active-page="corporation"] .corp-wallet-filters .filter-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 44px;
    }
}

.filter-item,
.chart-controls,
.tree-search,
.search-box {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-sm) !important;
}

.filter-item:hover {
    border-color: var(--border-strong) !important;
}

.filter-controls .form-control,
#arb-filter-controls .form-control {
    background: var(--bg) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.88em;
}

.filter-controls label,
#arb-filter-controls label {
    color: var(--muted) !important;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.72rem !important;
}

/* Stat cards / corp wallets */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.stat-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.highlight-gold {
    border-color: rgba(224, 154, 58, 0.35) !important;
    background: linear-gradient(145deg, var(--surface), rgba(224, 154, 58, 0.08)) !important;
}

.highlight-gold .stat-icon {
    color: var(--amber) !important;
    background: rgba(224, 154, 58, 0.12) !important;
}

.wallet-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.wallet-balance {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--amber);
}

/* Market chrome (reinforces page inline; keeps IDs/classes) */
.market-container.glass-panel {
    padding: 14px;
}

.market-sidebar .results-list {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.market-item.active {
    background: var(--accent-soft);
    border-left: 2px solid var(--cyan);
}

.orders-section {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
}

.orders-section .section-header {
    font-family: var(--font-display);
    letter-spacing: 0.55px;
    text-transform: uppercase;
    font-size: 0.78rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.market-table {
    font-size: 0.84em;
}

.market-table th {
    padding: 6px 8px !important;
    font-family: var(--font-display);
    font-size: 10.5px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: var(--surface-2) !important;
}

.market-table td {
    padding: 5px 8px !important;
}

.market-table .price-col,
.market-table .vol-col {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Market order panes: flex scroll owns height — don't clamp with max-height */
.orders-section .table-container {
    max-height: none;
    border: none;
    border-radius: 0;
    background: transparent;
}

.item-header {
    background: var(--surface-2) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.item-info h2 {
    font-family: var(--font-display);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* Estimation panels */
.estimation-container .input-panel,
.estimation-container .results-panel {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
}

.estimation-container .panel-header {
    background: var(--surface-2) !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--accent) !important;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.estimation-container .input-textarea,
.estimation-container .hub-selector {
    background: var(--bg) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.estimation-container .results-table-container {
    overflow: auto;
    max-height: min(62vh, 640px);
}

.estimation-container th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-2) !important;
    padding: 7px 8px !important;
    font-family: var(--font-display);
    font-size: 10.5px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
    backdrop-filter: none !important;
}

.estimation-container td {
    padding: 5px 8px !important;
    font-size: 0.86em;
}

.estimation-container td:nth-child(n+2),
.estimation-container .summary-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.estimation-container .summary-footer {
    background: var(--bg-elevated) !important;
    border-top: 1px solid var(--border) !important;
}

/* Industry: denser tables, less glow, sticky heads inside .industry-main scroll */
.industry-sidebar {
    border-radius: var(--radius) !important;
    border-color: var(--border) !important;
    box-shadow: none !important;
    background: var(--surface) !important;
    backdrop-filter: none !important;
}

.industry-sidebar::before {
    display: none !important;
}

.industry-main table,
table.industry-table {
    border-radius: var(--radius) !important;
    border-color: var(--border) !important;
    background: var(--surface) !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.industry-main th,
table.industry-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 7px 10px !important;
    font-size: 10.5px !important;
    letter-spacing: 0.65px !important;
    font-family: var(--font-display);
    background: var(--surface-2) !important;
    color: var(--muted) !important;
    border-bottom: 1px solid var(--border) !important;
}

.industry-main td,
table.industry-table td {
    padding: 6px 10px !important;
    font-size: 0.86em !important;
}

.industry-main td.text-right,
table.industry-table td.text-right,
.industry-main th.text-right,
table.industry-table th.text-right {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.corp-inv-table-wrap {
    max-height: min(58vh, 560px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}

.corp-inv-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-2);
    border-bottom-color: var(--border) !important;
    color: var(--muted) !important;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.corp-inv-table td {
    font-size: 0.95em;
}

/* Piloto polish */
.pilot-sub.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pilot-sub-summary {
    font-family: var(--font-display);
    letter-spacing: 0.45px;
    text-transform: uppercase;
    font-size: 0.92rem;
    color: var(--text);
}

.pilot-banner.info {
    background: var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
    color: var(--text) !important;
}

.pilot-cat-chip.active {
    background: var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
    color: var(--text) !important;
}

.pilot-cat-chip:hover {
    border-color: var(--accent-border) !important;
}

.pilot-cat-count,
.pilot-lists-toolbar input,
.pilot-lists-toolbar select {
    font-family: var(--font-mono);
    background: var(--surface) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-sm) !important;
}

.pilot-list,
.pilot-search-hit {
    background: var(--bg-elevated);
    border-color: var(--border);
    border-radius: var(--radius-sm);
}

.chart-metric-card:hover,
.chart-metric-card.active {
    border-color: var(--accent-border) !important;
    box-shadow: none !important;
}

.chart-metric-card.active {
    background: var(--accent-soft);
}

/* Corp assets tree */
.tree-node {
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--radius-sm);
}

.tree-node-total {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--amber);
}

/* Mining uses .card + .modern-table — covered above */

/* --- Mobile pass: nav + tables --- */
@media (max-width: 768px) {
    .table-container,
    .table-responsive,
    .corp-inv-table-wrap,
    .estimation-container .results-table-container {
        max-height: min(55vh, 480px);
        border-radius: var(--radius-sm);
    }

    .data-table th,
    .data-table td,
    .modern-table th,
    .modern-table td,
    .market-table th,
    .market-table td {
        padding: 8px 8px !important;
        font-size: 12px;
        white-space: nowrap;
    }

    .filter-controls,
    .filters-container,
    #arb-filter-controls {
        padding: 10px 12px !important;
        gap: 10px !important;
    }

    .filters-flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    .filter-item,
    .search-box {
        width: 100%;
        min-width: 0 !important;
        min-height: 44px;
    }

    .panel-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .panel-header .btn,
    #arb-panel-header .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px !important;
        min-width: 0;
    }

    .main-grid {
        grid-template-columns: 1fr !important;
    }

    .mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .sidebar {
        -webkit-overflow-scrolling: touch;
    }

    .content-body {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 420px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .glass-panel {
        padding: 12px;
    }
}

/* ================================================================
   OPS-ROOM WAVE 3 — Admin / Plumber / AI / Exploration / leftovers
   Rollback: OPSROOM_ROLLBACK.md + *.bak_pre_opsroom_w3 (undo w3 only)
   Full undo: *.bak_pre_opsroom
   ================================================================ */

/* Shared card header/title (Admin, Plumber, etc.) */
.card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    color: var(--text);
}

/* Light section enter (respect reduced motion) */
.content-body > .card,
.content-body > .glass-panel,
.content-body > .plb-grid,
.content-body > .plb-banner,
.content-body > .error-card,
.content-body > .admin-users-card,
.content-body > .admin-finanzas-card,
.content-body > .admin-analytics-card,
.content-body > .admin-view-tabs,
.content-body > .ai-console {
    animation: opsSectionIn 280ms ease both;
}

@keyframes opsSectionIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .content-body > .card,
    .content-body > .glass-panel,
    .content-body > .plb-grid,
    .content-body > .plb-banner,
    .content-body > .error-card,
    .content-body > .admin-users-card,
    .content-body > .admin-finanzas-card,
    .content-body > .admin-analytics-card,
    .content-body > .admin-view-tabs,
    .content-body > .ai-console,
    .flash-message,
    .js-reveal {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Forms / buttons: cyan focus ring */
.form-control:focus,
.search-input:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--accent-soft);
    border-color: var(--accent-border);
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Modals (shared surface tokens) */
.modal-content,
[id$="-modal"] .modal-content,
#composite-modal .modal-content {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    color: var(--text) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

.modal-content h3,
#composite-modal .modal-content h3 {
    font-family: var(--font-display);
    letter-spacing: 0.45px;
    text-transform: uppercase;
    font-size: 1.05rem;
    margin-top: 0;
}

/* Empty states */
.plb-empty,
.empty-state,
#empty-state {
    text-align: center;
    color: var(--muted);
    padding: 28px 12px;
    font-size: 0.92em;
}

.plb-empty .material-icons,
.empty-state .material-icons,
#empty-state .material-icons {
    font-size: 34px;
    opacity: 0.5;
    color: var(--accent-muted);
    display: block;
    margin: 0 auto 8px;
}

/* --- Guest banner --- */
.guest-refresh-disabled,
button.guest-refresh-disabled,
.btn.guest-refresh-disabled,
.btn-icon.guest-refresh-disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: none;
    filter: grayscale(0.35);
}
.guest-refresh-tip {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.78em;
    color: var(--muted, #9aa3ad);
    max-width: 280px;
    line-height: 1.3;
    vertical-align: middle;
}

.guest-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 18px 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(46, 200, 224, 0.28);
    background: linear-gradient(90deg, rgba(46, 200, 224, 0.10), rgba(18, 24, 32, 0.55));
    color: rgba(220, 232, 240, 0.92);
    font-size: 0.88rem;
    line-height: 1.4;
}
.guest-banner .material-icons { font-size: 18px; color: #2ec8e0; }
.guest-banner__login {
    margin-left: auto;
    color: #9fe8f4;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(159, 232, 244, 0.35);
}
.guest-banner__login:hover { color: #fff; }

/* --- Admin view tabs (Tráfico | Repartos | Permisos) --- */
.admin-view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}
/* Admin Finanzas — same chrome as analytics/users (no Contabilidad clone) */
.admin-finanzas-card .admin-analytics-grid > div > h4 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.admin-finanzas-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
    margin-top: 0.5rem;
}
.admin-finanzas-fields--3 {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.admin-finanzas-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: var(--muted);
}
.admin-finanzas-field input,
.admin-finanzas-field select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text, #e8eef5);
    padding: 0.45rem 0.6rem;
    font-size: 0.95rem;
    outline: none;
}
.admin-finanzas-field input:focus,
.admin-finanzas-field select:focus {
    border-color: var(--accent-border);
}
.admin-finanzas-check {
    margin: 0.35rem 0 0.15rem;
    width: fit-content;
}
.admin-finanzas-sum {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.admin-finanzas-sum.is-ok { color: var(--accent); }
.admin-finanzas-sum.is-bad { color: #e07a7a; }
.admin-view-tabs__tab {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-secondary, rgba(220, 230, 240, 0.72));
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.admin-view-tabs__tab:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text, #e8eef5);
}
.admin-view-tabs__tab.active {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent);
}

/* --- Admin analytics --- */
.admin-analytics-card {
    margin-bottom: 18px;
}
.admin-analytics-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-analytics-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-analytics-days {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--muted);
}
.admin-analytics-days select {
    background: rgba(0, 0, 0, 0.28);
    color: #e8eef4;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 4px 8px;
}
.admin-analytics-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 8px;
}
.admin-analytics-pill {
    min-width: 110px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-analytics-pill strong {
    font-size: 1.15rem;
    color: #eaf4ff;
}
.admin-analytics-pill span {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-analytics-pill--usage {
    border-color: rgba(94, 186, 255, 0.35);
    background: rgba(40, 90, 140, 0.28);
}
.admin-analytics-pill--usage strong {
    color: #b8e4ff;
}
.admin-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.admin-analytics-grid h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #d7e4ef;
}
.admin-security-note {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 180, 80, 0.22);
    background: rgba(255, 160, 60, 0.06);
    color: rgba(230, 220, 200, 0.92);
    font-size: 0.88rem;
    line-height: 1.5;
}
.admin-security-note summary {
    cursor: pointer;
    font-weight: 600;
    color: #ffd59a;
}
.admin-security-note ul {
    margin: 10px 0 0;
    padding-left: 1.2em;
}
@media (max-width: 960px) {
    .admin-analytics-grid { grid-template-columns: 1fr; }
    .guest-banner { margin: 0 10px 10px; }
}

/* --- Admin users --- */
.admin-users-note {
    color: var(--muted);
    font-size: 0.88em;
    margin: 8px 0 0;
    line-height: 1.45;
}

.admin-users-table-wrap {
    max-height: none;
    margin-top: 8px;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.admin-users-table thead tr {
    border-bottom: 1px solid var(--border-strong);
    text-align: left;
}

.admin-users-table th {
    padding: 10px 12px;
    font-family: var(--font-display);
    font-size: 10.5px;
    letter-spacing: 0.65px;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2);
    position: sticky;
    top: 0;
    z-index: 2;
}

.admin-users-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
    font-size: 0.9em;
}

.admin-users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.admin-user-id {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    width: 56px;
}

.admin-user-name {
    font-weight: 600;
}

.admin-actions-col {
    text-align: right;
    white-space: nowrap;
}

.role-cell {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.82em;
    color: var(--muted);
}

.role-check {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.role-check:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.role-check:has(input:checked) {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    color: var(--text);
}

.role-check input {
    accent-color: var(--cyan);
}

.admin-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86em;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.2px;
}

.admin-status--ok { color: var(--success-color); }
.admin-status--pending { color: var(--amber); }
.admin-status--bad { color: var(--danger-color); }

.admin-you {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.85em;
}

.action-btn {
    border: 1px solid transparent;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: 0.15px;
    transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover { opacity: 0.88; }

.action-btn--ok {
    background: rgba(105, 240, 174, 0.14);
    color: var(--success-color);
    border-color: rgba(105, 240, 174, 0.28);
}

.action-btn--bad {
    background: rgba(255, 82, 82, 0.12);
    color: #ffaeae;
    border-color: rgba(255, 82, 82, 0.32);
}

.action-btn--ghost {
    background: var(--bg);
    color: var(--muted);
    border-color: var(--border-strong);
}

.action-btn--ghost:hover {
    color: var(--text);
    border-color: var(--accent-border);
}

/* --- Plumber --- */
.plb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
    align-items: start;
}

.plb-note {
    color: var(--muted);
    font-size: 0.88em;
    margin: 6px 0 0;
    line-height: 1.4;
}

.plb-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.plb-form .form-control {
    flex: 1 1 140px;
    min-width: 120px;
}

.plb-form .plb-wide {
    flex: 2 1 240px;
}

.plb-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.plb-item {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.plb-item:first-child { border-top: none; }

.plb-name {
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-display);
    letter-spacing: 0.35px;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.plb-meta {
    color: var(--muted);
    font-size: 0.78em;
    margin-top: 4px;
    font-family: var(--font-mono);
}

.plb-text {
    color: var(--muted);
    font-size: 0.9em;
    margin-top: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.plb-pill {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    font-size: 0.72em;
    color: var(--accent);
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    font-family: var(--font-mono);
    font-weight: 600;
    vertical-align: middle;
}

.plb-pill--hot {
    border-color: rgba(255, 82, 82, 0.35);
    background: rgba(255, 82, 82, 0.1);
    color: #ffaeae;
}

.plb-pill--warn {
    border-color: rgba(224, 154, 58, 0.35);
    background: rgba(224, 154, 58, 0.1);
    color: var(--amber);
}

.plb-pill--mute {
    border-color: var(--border-strong);
    background: transparent;
    color: var(--muted);
}

.plb-del {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.plb-del:hover {
    color: #ffaeae;
    border-color: rgba(255, 82, 82, 0.35);
}

.plb-banner {
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--muted);
    font-size: 0.88em;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}

.plb-banner strong { color: var(--text); }

.plb-banner-icon {
    font-size: 16px;
    color: var(--accent);
    margin-top: 1px;
}

.plb-card:hover {
    background: var(--surface);
}

/* --- Error page --- */
.error-card {
    max-width: 900px;
}

.error-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.error-card-icon {
    color: var(--danger-color);
    font-size: 28px;
}

.error-card-title {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: 0.45px;
    text-transform: uppercase;
    font-size: 1.25rem;
}

.error-card-msg {
    color: var(--muted);
    line-height: 1.5;
}

.error-card-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- AI console --- */
.ai-console {
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.ai-chat-header h3 {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 1.05rem;
    font-weight: 600;
}

.ai-chat-header .status-badge.online,
.status-badge.online {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(105, 240, 174, 0.3);
    background: rgba(105, 240, 174, 0.1);
    color: var(--success-color);
}

.ai-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-elevated);
    margin-bottom: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.ai-chat-input {
    display: flex;
    gap: 10px;
}

.ai-console .message {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.ai-console .message.user { align-items: flex-end; }
.ai-console .message.assistant { align-items: flex-start; }

.ai-console .message-content {
    max-width: 80%;
    padding: 11px 14px;
    border-radius: var(--radius);
    line-height: 1.5;
    font-size: 0.94em;
}

.ai-console .message.user .message-content {
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-top-right-radius: 2px;
}

.ai-console .message.assistant .message-content {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-top-left-radius: 2px;
}

.ai-console .message.system .message-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 100%;
    text-align: center;
    font-style: italic;
    color: var(--muted);
}

/* --- Exploration --- */
.explore-input,
.explore-textarea {
    flex: 1;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--text);
    padding: 0 12px;
    outline: none;
    font-family: var(--font-body);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.explore-input:focus,
.explore-textarea:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.explore-textarea {
    height: auto;
    min-height: 340px;
    padding: 12px;
    resize: vertical;
    white-space: pre;
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: var(--text);
}

.explore-search {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--muted);
}

.explore-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: auto;
    max-height: 70vh;
}

.explore-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    transition: background 0.15s ease;
}

.explore-item:last-child { border-bottom: none; }

.explore-item:hover {
    background: var(--surface-2);
}

.explore-item.active {
    background: var(--accent-soft);
    border-left: 2px solid var(--cyan);
}

.explore-item-title {
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: 0.35px;
    text-transform: uppercase;
    font-size: 0.92rem;
}

.explore-item-sub {
    font-size: 0.82em;
    color: var(--text-dim);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.explore-run,
.explore-editor {
    padding: 14px;
}

.explore-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.explore-current {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    padding: 12px;
}

.explore-current-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.5em;
    margin-top: 6px;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .plb-grid {
        grid-template-columns: 1fr;
    }

    .admin-users-table th,
    .admin-users-table td {
        padding: 10px 8px;
    }

    .admin-actions-col {
        white-space: normal;
    }

    .action-btn {
        margin: 2px 0 2px 4px;
    }

    .ai-console {
        height: auto;
        min-height: calc(100vh - 120px);
    }

    .ai-chat-input {
        flex-direction: column;
    }

    .ai-chat-input .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
}

/* ================================================================
   OPS-ROOM WAVE 4 — Fits workstation polish + QA + dash pass 2
   Rollback: OPSROOM_ROLLBACK.md + *.bak_pre_opsroom_w4 (undo w4 only)
   Full undo: *.bak_pre_opsroom
   Accent: cyan. No purple glow / cream / terracotta.
   Visual only — keep JS IDs/classes; do not break sim/ammo/DPS.
   ================================================================ */

/* --- Global leftovers (pre-opsroom purple / flat white) --- */
.badge-donations {
    background: rgba(46, 200, 224, 0.1);
    color: var(--accent);
    border-color: var(--accent-border);
    box-shadow: none;
}

.card-icon.purple {
    color: var(--accent-muted);
    background: var(--accent-soft);
    border-color: var(--accent-border);
}

body[data-skin="opsroom"] .btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

body[data-skin="opsroom"] .btn-primary:hover {
    background: #ffffff;
    border-color: #ffffff;
}

/* --- Dashboard second pass: brand + hierarchy --- */
body[data-active-page="dashboard"] .page-hero {
    padding: 20px 22px;
    background:
        linear-gradient(135deg, rgba(46, 200, 224, 0.07) 0%, transparent 42%),
        linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    border-color: var(--border-strong);
}

body[data-active-page="dashboard"] .page-hero-title {
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    letter-spacing: 1px;
}

body[data-active-page="dashboard"] .page-hero-subtitle {
    color: var(--accent-muted);
    letter-spacing: 0.55px;
}

body[data-active-page="dashboard"] .page-hero-logo {
    width: 52px;
    height: 52px;
    border-color: var(--accent-border);
}

body[data-active-page="dashboard"] .dash-hero-meta {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(8, 10, 13, 0.45);
    gap: 8px;
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
}

body[data-active-page="dashboard"] .dash-hero-meta strong {
    font-family: var(--font-mono);
    color: var(--amber);
    font-variant-numeric: tabular-nums;
}

.eve-personal-card {
    border-color: var(--border-strong);
    background:
        linear-gradient(90deg, rgba(46, 200, 224, 0.05) 0%, transparent 28%),
        var(--surface);
}

.eve-personal-card .btn {
    border-radius: var(--radius-sm);
}

.dash-quick-links {
    margin-top: 18px;
}

.dash-quick-link {
    position: relative;
    overflow: hidden;
}

.dash-quick-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 2px;
    border-radius: 0 2px 2px 0;
    background: transparent;
    transition: background 0.18s ease;
}

.dash-quick-link:hover::before {
    background: var(--accent);
}

.dash-tutorials {
    border-color: var(--border);
    background: var(--surface);
    border-radius: var(--radius);
}

.dash-tutorials-title {
    font-family: var(--font-display);
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.dash-tutorials-icon,
.dash-tutorials.is-open .dash-tutorials-icon {
    color: var(--accent-muted);
}

.dash-tutorials-progress {
    font-family: var(--font-mono);
    border-radius: var(--radius-sm);
    border-color: var(--border-strong);
    background: var(--bg-elevated);
    color: var(--muted);
}

/* --- Fits workstation (specificity beats inline <style> in fits.html) --- */
.fits-layout.ops-ws,
.fits-layout {
    gap: 14px;
}

.fits-layout .fits-sidebar.card,
.fits-layout.ewb-mode .fits-sidebar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.fits-layout .fits-side-title {
    color: var(--accent-muted);
    font-size: 0.78rem;
    letter-spacing: 0.7px;
}

.fits-layout .fits-search {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

.fits-layout .fits-search input {
    font-family: var(--font-body);
    color: var(--text);
}

.fits-layout .fits-search-clear {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    background: var(--surface-2);
}

.fits-layout .fits-eve-tab {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font-display);
    letter-spacing: 0.55px;
    text-transform: uppercase;
    font-weight: 600;
}

.fits-layout .fits-eve-tab.active {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    color: var(--text);
}

.fits-layout .fits-section-title {
    color: var(--muted);
    font-family: var(--font-display);
    letter-spacing: 0.6px;
}

.fits-layout .fits-item,
.fits-layout .fits-eve-list .fits-item {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    background: rgba(8, 10, 13, 0.35);
}

.fits-layout .fits-item:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.fits-layout .fits-item.active {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.fits-layout .fits-badge {
    font-family: var(--font-mono);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border-color: var(--border);
}

.fits-layout .fits-selected {
    background: rgba(8, 10, 13, 0.55);
    border-color: var(--border-strong);
    border-radius: var(--radius);
}

.fits-layout .fits-selected-name,
.fits-layout .fits-eve-title,
.fits-layout .ewb-fit-title,
.fits-layout .ewb-hull-name,
.fits-layout .ewb-author-name {
    font-family: var(--font-display);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.fits-layout .fits-slot-badge {
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

/* Slot color coding (ops-room; no purple rig) */
.fits-layout .fits-slot-h {
    color: var(--accent);
    border-color: rgba(46, 200, 224, 0.35);
    background: rgba(46, 200, 224, 0.08);
}
.fits-layout .fits-slot-m {
    color: var(--amber);
    border-color: rgba(224, 154, 58, 0.35);
    background: rgba(224, 154, 58, 0.08);
}
.fits-layout .fits-slot-l {
    color: var(--success-color);
    border-color: rgba(105, 240, 174, 0.28);
    background: rgba(105, 240, 174, 0.08);
}
.fits-layout .fits-slot-r {
    color: var(--muted);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.fits-layout .fits-cat-exploration {
    color: var(--accent);
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

/* Resource bars: flat ops meters (keep IDs / fill classes) */
.fits-layout .fits-progress,
.fits-layout .wb-progress {
    height: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 2px;
    box-shadow: none;
    overflow: hidden;
}

.fits-layout .wb-progress-lg {
    height: 11px;
}

.fits-layout .fits-progress-fill,
.fits-layout .wb-progress-fill {
    border-radius: 0;
    box-shadow: none;
}

.fits-layout .fits-progress-fill::after,
.fits-layout .wb-progress-fill::after {
    opacity: 0.35;
    animation: none;
}

.fits-layout .fits-progress-cyan,
.fits-layout .wb-progress-cyan {
    background: var(--accent);
    box-shadow: none;
}

.fits-layout .fits-progress-amber,
.fits-layout .wb-progress-amber {
    background: var(--amber);
    box-shadow: none;
}

.fits-layout .fits-progress-green {
    background: var(--success-color);
    box-shadow: none;
}

/* Kill purple calibrations / capacitor fills */
.fits-layout .fits-progress-violet,
.fits-layout .wb-progress-violet,
.fits-layout .wb-progress-purple {
    background: linear-gradient(90deg, #3aa8bc, var(--accent));
    box-shadow: none;
}

.fits-layout .fits-progress-danger,
.fits-layout .wb-progress-fill.danger {
    background: linear-gradient(90deg, #c62828, #ef5350) !important;
    box-shadow: none;
}

.fits-layout .fits-res-bar-head,
.fits-layout .wb-progress-head,
.fits-layout .wb-progress-num {
    font-family: var(--font-mono);
    letter-spacing: 0.25px;
}

.fits-layout .wb-res-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    letter-spacing: 0.45px;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--muted);
}

/* Shell / chrome */
.fits-layout .ewb-fit-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px 20px;
}

.fits-layout .ewb-fit-title {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    color: var(--text);
    letter-spacing: 0.35px;
}

.fits-layout .ewb-btn {
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 600;
}

.fits-layout .ewb-btn-copy {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--text);
}

.fits-layout .ewb-btn-copy:hover {
    background: rgba(46, 200, 224, 0.2);
}

.fits-layout .ewb-btn-push {
    background: var(--bg-elevated);
    color: var(--muted);
    border-color: var(--border);
}

.fits-layout .ewb-tabs {
    border-bottom-color: var(--border);
}

.fits-layout .ewb-tabs .sim-tab {
    color: var(--muted);
    font-family: var(--font-display);
    letter-spacing: 0.55px;
}

.fits-layout .ewb-tabs .sim-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    background: transparent;
}

.fits-layout .ewb-lib-toggle {
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-border);
    background: var(--accent-soft);
    color: var(--text);
    font-family: var(--font-display);
    letter-spacing: 0.45px;
    text-transform: uppercase;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.fits-layout .ewb-chip {
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-border);
    background: var(--accent-soft);
    color: var(--text);
    font-family: var(--font-display);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.fits-layout .ewb-chip.active-charges {
    border-color: rgba(224, 154, 58, 0.45);
    background: rgba(224, 154, 58, 0.12);
    color: var(--amber);
}

.fits-layout .wb-tag-omega {
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent);
}

.fits-layout .wb-tag-alpha {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--muted);
}

/* Cards / panels */
.fits-layout .ewb-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.fits-layout .ewb-card-h {
    font-family: var(--font-display);
    letter-spacing: 0.55px;
    color: var(--muted);
}

.fits-layout .ewb-tag-pill {
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--text);
    border-radius: var(--radius-sm);
}

.fits-layout .ewb-zkill {
    color: var(--accent);
}

.fits-layout .ewb-desc-box {
    background: rgba(46, 200, 224, 0.06);
    border: 1px solid var(--accent-border);
    color: var(--muted);
    border-radius: var(--radius-sm);
}

.fits-layout .ewb-skills-row select {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
}

.fits-layout .ewb-sim-badge {
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    color: var(--text);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
}

.fits-layout .ewb-sim-badge.warn {
    color: #ffe0b2;
    background: rgba(224, 154, 58, 0.12);
    border-color: rgba(224, 154, 58, 0.4);
}

.fits-layout .ewb-sim-badge.bad {
    color: #ffcdd2;
    background: rgba(255, 82, 82, 0.12);
    border-color: rgba(255, 82, 82, 0.4);
}

.fits-layout .ewb-client-gap-hint {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
}

/* Tank / DPS / resists panels */
.fits-layout .wb-acc {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.fits-layout .wb-acc[open] {
    border-color: var(--border-strong);
}

.fits-layout .wb-acc-head {
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-display);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.fits-layout .wb-acc-head:hover {
    background: var(--surface-2);
}

.fits-layout .wb-acc-ico {
    color: var(--accent-muted) !important;
}

.fits-layout .wb-acc-summary {
    font-family: var(--font-mono);
    color: var(--text);
}

.fits-layout .wb-acc-body {
    background: rgba(8, 10, 13, 0.45);
    border-top-color: var(--border);
}

.fits-layout .wb-kpi {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.fits-layout .wb-kpi-dps {
    background: linear-gradient(135deg, rgba(255, 112, 67, 0.14), var(--bg) 58%);
    border-color: rgba(255, 112, 67, 0.28);
}

.fits-layout .wb-kpi-label {
    font-family: var(--font-display);
    letter-spacing: 0.55px;
    color: var(--muted);
}

.fits-layout .wb-kpi-value,
.fits-layout .wb-ehp-value,
.fits-layout .wb-stat-value,
.fits-layout .wb-dmg-val,
.fits-layout .wb-resist-ehp,
.fits-layout .wb-resist-hp {
    font-family: var(--font-mono);
}

.fits-layout .wb-ehp-banner {
    background: linear-gradient(90deg, rgba(46, 200, 224, 0.12), var(--bg) 72%);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
}

.fits-layout .wb-ehp-value {
    color: var(--accent);
}

.fits-layout .wb-stat-grid {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    background: var(--border);
}

.fits-layout .wb-stat {
    background: rgba(8, 10, 13, 0.65);
}

.fits-layout .wb-stat-label {
    color: var(--muted);
}

.fits-layout .wb-dmg-profile {
    background: rgba(8, 10, 13, 0.35);
    border-color: var(--border);
    border-radius: var(--radius-sm);
}

.fits-layout .wb-resist-cell {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
}

.fits-layout .wb-resist-txt {
    font-family: var(--font-mono);
}

/* Module / list rows */
.fits-layout .wb-mod-item {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.fits-layout .wb-mod-item:hover {
    background: var(--accent-soft);
    border-color: var(--accent-border);
}

.fits-layout .wb-mod-qty {
    font-family: var(--font-mono);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
}

.fits-layout .wb-mod-group-label,
.fits-layout .market-mod-head-title,
.fits-layout .skill-group-title {
    font-family: var(--font-display);
    letter-spacing: 0.55px;
}

.fits-layout .market-mod-group,
.fits-layout .skill-group,
.fits-layout .export-card,
.fits-layout .comment-meta {
    border-radius: var(--radius);
    border-color: var(--border);
    background: var(--bg-elevated);
}

.fits-layout .export-card:hover {
    transform: none;
    border-color: var(--accent-border);
    box-shadow: none;
}

.fits-layout .market-mod-price,
.fits-layout .market-mod-qty,
.fits-layout .skill-level-badge,
.fits-layout .skill-sp {
    font-family: var(--font-mono);
}

.fits-layout .sim-slot-hint {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(8, 10, 13, 0.7);
    color: var(--muted);
}

/* Slot racks: marker classes only (geometry stays in fits.html radial CSS) */
.fits-layout .fit-radial .slot-inner {
    filter: none;
}

.fits-layout .fit-radial .ops-slot-rack-h .slot-inner:not(.empty):not([data-state="Empty"]) {
    box-shadow: 0 0 0 1px rgba(46, 200, 224, 0.22);
}
.fits-layout .fit-radial .ops-slot-rack-m .slot-inner:not(.empty):not([data-state="Empty"]) {
    box-shadow: 0 0 0 1px rgba(224, 154, 58, 0.22);
}
.fits-layout .fit-radial .ops-slot-rack-l .slot-inner:not(.empty):not([data-state="Empty"]) {
    box-shadow: 0 0 0 1px rgba(105, 240, 174, 0.2);
}
.fits-layout .fit-radial .ops-slot-rack-r .slot-inner:not(.empty):not([data-state="Empty"]) {
    box-shadow: 0 0 0 1px rgba(180, 200, 220, 0.18);
}

.fits-layout .ewb-cargo-item:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.fits-layout .ewb-meta b,
.fits-layout .ewb-hull-class,
.fits-layout .ewb-hull-cat {
    font-family: var(--font-mono);
}

.fits-layout .isk-value {
    font-family: var(--font-mono);
    color: var(--amber);
    text-shadow: none;
}

/* --- Mobile: Fits + nav --- */
@media (max-width: 768px) {
    body[data-active-page="dashboard"] .page-hero {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    body[data-active-page="dashboard"] .page-hero-title {
        font-size: 1.35rem;
    }

    .dash-quick-links {
        grid-template-columns: 1fr 1fr;
    }

    .sidebar {
        width: 64px;
        padding-top: 12px;
    }

    .nav-item {
        width: 48px;
        height: 48px;
    }

    .brand-link {
        width: 46px;
        height: 46px;
    }

    .fits-layout {
        gap: 10px;
    }

    .fits-layout .fits-sidebar.card,
    .fits-layout.ewb-mode .fits-sidebar {
        max-height: min(42vh, 360px);
        position: relative;
        top: 0;
        -webkit-overflow-scrolling: touch;
    }

    .fits-layout .ewb-lib-toggle {
        position: sticky;
        bottom: 12px;
        left: auto;
        min-height: 44px;
        z-index: 30;
    }

    .fits-layout .fits-eve-tab,
    .fits-layout .ewb-btn,
    .fits-layout .ewb-chip,
    .fits-layout .fits-copy-btn {
        min-height: 44px;
    }

    .fits-layout .ewb-titlebar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .fits-layout .ewb-title-actions {
        width: 100%;
    }

    .fits-layout .ewb-title-actions .ewb-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .fits-layout .ewb-fit-title {
        font-size: 1.25rem;
    }

    .fits-layout .wb-fp-hero {
        grid-template-columns: 1fr;
    }

    .fits-layout .wb-resist-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .fits-layout .wb-resist-ehp {
        text-align: left;
    }

    .fits-layout .sim-tabs.ewb-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .fits-layout .ewb-tabs .sim-tab {
        flex: 0 0 auto;
        min-height: 44px;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fits-layout .fits-progress-fill,
    .fits-layout .wb-progress-fill,
    .fits-layout .wb-dmg-bar-fill,
    .fits-layout .wb-resist-fill {
        transition: none !important;
    }

    .fits-layout .fits-progress-fill::after,
    .fits-layout .wb-progress-fill::after {
        animation: none !important;
        display: none;
    }
}

/* ================================================================
   OPS-ROOM WAVE 5 — finishing pass (shared UI + weak pages + a11y)
   Rollback: OPSROOM_ROLLBACK.md + *.bak_pre_opsroom_w5 (undo w5 only)
   Full undo: *.bak_pre_opsroom
   Visual only — keep JS IDs/classes; no dogma/auth/API/simulate.
   ================================================================ */

/* --- Shared: loading / spinners --- */
.spinner,
.loading-spinner .fa-spinner,
.fa-spinner.fa-spin {
    color: var(--accent);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: opsSpin 0.75s linear infinite;
}

.loading-spinner,
.loading-overlay {
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.92em;
    letter-spacing: 0.2px;
}

.loading-overlay {
    background: rgba(8, 10, 13, 0.72) !important;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 12px;
    color: var(--muted);
}

.loading-spinner .fa-spinner {
    font-size: 1.15em;
}

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

/* --- Shared: toasts / alerts / flash --- */
.flash-message.success::before,
.flash-message.ok::before { background: var(--success-color); }
.flash-message.error::before,
.flash-message.danger::before { background: var(--danger-color); }
.flash-message.warning::before,
.flash-message.warn::before { background: var(--amber); }
.flash-message.info::before { background: var(--accent); }

.alert.warn,
.alert.warning {
    background: rgba(224, 154, 58, 0.08);
    border: 1px solid rgba(224, 154, 58, 0.28);
    color: #ffe7c9;
}

.alert.warn::before,
.alert.warning::before {
    content: '';
    position: absolute;
    top: 8px; bottom: 8px; left: 0;
    width: 2px; border-radius: 0 2px 2px 0;
    background: var(--amber);
}

.alert.success,
.alert.ok {
    background: rgba(105, 240, 174, 0.08);
    border: 1px solid rgba(105, 240, 174, 0.28);
    color: #c8f7dc;
}

.alert.success::before,
.alert.ok::before {
    content: '';
    position: absolute;
    top: 8px; bottom: 8px; left: 0;
    width: 2px; border-radius: 0 2px 2px 0;
    background: var(--success-color);
}

.alert.error,
.alert.danger {
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #ffc9c9;
}

.alert.error::before,
.alert.danger::before {
    content: '';
    position: absolute;
    top: 8px; bottom: 8px; left: 0;
    width: 2px; border-radius: 0 2px 2px 0;
    background: var(--danger-color);
}

/* SSO / auth: tone leftover flash panels to tokens */
.auth-container .alert.info {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--text);
}

.auth-container .large-card,
.auth-container .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.auth-container h2 {
    font-family: var(--font-display);
    letter-spacing: 0.55px;
    text-transform: uppercase;
    font-size: 1.25rem;
}

.auth-container .scopes-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.auth-container .scopes-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: var(--muted);
    font-size: 0.92em;
    border-bottom: 1px solid var(--border);
}

.auth-container .scopes-list li:last-child { border-bottom: none; }
.auth-container .scopes-list .material-icons { color: var(--accent); font-size: 16px; }

#sso-diagnostics > div,
#url-sso-box {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius) !important;
    color: var(--text) !important;
}

#url-sso-box {
    border-color: rgba(255, 82, 82, 0.45) !important;
    background: rgba(255, 82, 82, 0.08) !important;
}

#url-sso-textarea {
    background: var(--bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-family: var(--font-mono) !important;
}

#sso-launch-status {
    font-family: var(--font-mono);
    font-size: 12.5px;
}

.auth-container a.btn-primary[href="/sso-help"],
.auth-container a.btn-primary[style*="6366f1"] {
    background: var(--accent-soft) !important;
    border: 1px solid var(--accent-border) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

.auth-container #btnCopyBig,
.auth-container #btnNewTab,
.auth-container #btnHideUrl {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
}

.auth-container #btnCopyBig:hover,
.auth-container #btnNewTab:hover {
    border-color: var(--accent-border) !important;
    background: var(--accent-soft) !important;
}

/* --- Shared: tabs --- */
.tab-buttons {
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
    padding: 3px !important;
    gap: 2px !important;
}

.tab-btn {
    border-radius: var(--radius-sm) !important;
    font-family: var(--font-display) !important;
    letter-spacing: 0.45px !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    color: var(--muted) !important;
    box-shadow: none !important;
    transform: none !important;
}

.tab-btn:hover {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    transform: none !important;
}

.tab-btn.active {
    background: var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

.tab-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
}

/* --- Shared: dropdowns / selects / file inputs --- */
select,
select.form-control,
select.search-input,
select.hub-select,
.hub-select {
    background: var(--bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-family: var(--font-body);
    box-shadow: none !important;
}

select:focus,
select.form-control:focus,
select.hub-select:focus,
.hub-select:focus {
    border-color: var(--accent-border) !important;
    box-shadow: 0 0 0 2px var(--accent-soft) !important;
    outline: none;
}

input[type="file"] {
    font-family: var(--font-body);
    color: var(--muted);
    font-size: 0.88em;
}

input[type="file"]::file-selector-button {
    font-family: var(--font-display);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    margin-right: 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

/* --- Shared: tooltips (section tip) --- */
.section-strip__tip {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* --- Shared: pagination (generic) --- */
.pagination,
.pager,
.page-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
}

.pagination a,
.pagination button,
.pager a,
.pager button,
.page-controls a,
.page-controls button,
.page-btn {
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.pagination a:hover,
.pagination button:hover,
.pager a:hover,
.page-btn:hover {
    border-color: var(--accent-border);
    color: var(--text);
    background: var(--accent-soft);
}

.pagination .active,
.pagination [aria-current="page"],
.page-btn.active {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    color: var(--text);
}

/* --- Industry: shopping list + chrome leftovers --- */
.industry-container {
    color: var(--text) !important;
}

.industry-main {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.industry-main::before {
    display: none !important;
}

.industry-sidebar .sidebar-header {
    background: var(--surface-2) !important;
    border-bottom: 1px solid var(--border) !important;
}

.shopping-item {
    background: transparent !important;
    border-bottom: 1px solid var(--border) !important;
    border-left: 2px solid transparent !important;
    transition: background 0.15s ease, border-left-color 0.15s ease !important;
    padding-left: 12px !important;
}

.shopping-item:hover {
    background: var(--surface-2) !important;
    border-left-color: var(--accent) !important;
    padding-left: 12px !important;
}

.shopping-qty {
    color: var(--amber) !important;
    font-family: var(--font-mono) !important;
    text-shadow: none !important;
}

.search-input {
    background: var(--bg) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

.search-input:focus {
    border-color: var(--accent-border) !important;
    box-shadow: 0 0 0 2px var(--accent-soft) !important;
    background: var(--bg) !important;
}

.action-btn {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    transform: none !important;
    font-family: var(--font-body) !important;
}

.action-btn:hover,
.action-btn:active {
    transform: none !important;
    border-color: var(--accent-border) !important;
    background: var(--accent-soft) !important;
}

.node-category,
.node-group,
.node-item {
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    transform: none !important;
}

.node-category {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.node-group {
    border-left-color: var(--border-strong) !important;
    background: rgba(8, 10, 13, 0.25) !important;
}

.node-item {
    border-left-color: var(--border) !important;
}

.node-item:hover,
.node-group:hover {
    background: var(--surface-2) !important;
    border-left-color: var(--accent-muted) !important;
}

.node-item.active {
    background: var(--accent-soft) !important;
    border-left-color: var(--accent) !important;
    border-color: var(--accent-border) !important;
    box-shadow: none !important;
    color: var(--text) !important;
}

/* --- Fits create / browse: kill leftover Material blue --- */
.fc-hero h1,
.fits-browse-hero h1 {
    font-family: var(--font-display);
    letter-spacing: 0.55px;
    text-transform: uppercase;
    font-weight: 600;
}

.fc-ai {
    border-color: var(--accent-border) !important;
    background:
        linear-gradient(135deg, rgba(46, 200, 224, 0.08) 0%, transparent 55%),
        var(--surface) !important;
    border-radius: var(--radius) !important;
}

.fc-ai h2,
.fc-panel h3 {
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.fc-panel,
.fits-browse-stat,
.fits-browse-card {
    border-radius: var(--radius) !important;
    border-color: var(--border) !important;
    background: var(--surface) !important;
    box-shadow: none !important;
}

.fc-item.active,
.fc-acc-fam.open .fc-acc-head,
.fc-slot.filled {
    background: var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
}

.fc-acc-fam.open .fc-acc-head .chev {
    color: var(--accent) !important;
}

.fc-slot.active-target {
    border-color: rgba(224, 154, 58, 0.7) !important;
    background: rgba(224, 154, 58, 0.1) !important;
}

.fc-search,
.fits-browse-search {
    background: var(--bg) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
}

.fits-browse-filter {
    border-radius: var(--radius-sm) !important;
    border-color: var(--border) !important;
    background: var(--surface) !important;
    font-family: var(--font-display);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-size: 0.78rem !important;
}

.fits-browse-filter.active {
    border-color: var(--accent-border) !important;
    background: var(--accent-soft) !important;
    color: var(--text) !important;
}

.fits-browse-filter.skills-toggle.active {
    border-color: rgba(105, 240, 174, 0.4) !important;
    background: rgba(105, 240, 174, 0.12) !important;
    color: #c8f7dc !important;
}

.fits-browse-card {
    background:
        linear-gradient(135deg, rgba(46, 200, 224, 0.06) 0%, transparent 55%),
        var(--surface) !important;
    transition: border-color 0.15s ease, background 0.15s ease !important;
}

.fits-browse-card:hover {
    border-color: var(--accent-border) !important;
    transform: none !important;
    background:
        linear-gradient(135deg, rgba(46, 200, 224, 0.12) 0%, transparent 55%),
        var(--surface-2) !important;
}

.fits-browse-pill.corp {
    border-color: var(--accent-border) !important;
    color: var(--accent) !important;
}

.fits-browse-empty,
.fc-empty {
    border-color: var(--border) !important;
    color: var(--muted) !important;
    border-radius: var(--radius) !important;
}

/* --- Plumber edge states --- */
.plb-empty {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: rgba(8, 10, 13, 0.35);
    padding: 22px 14px !important;
}

.plb-form .form-control:disabled,
.plb-form select:disabled,
.plb-form button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.plb-list:empty::after {
    content: 'Sin entradas.';
    display: block;
    text-align: center;
    color: var(--muted);
    padding: 18px 8px;
    font-size: 0.9em;
}

.plb-item {
    border-color: var(--border);
    background: rgba(8, 10, 13, 0.25);
}

.plb-item:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

/* --- Page enter: broaden + stagger lightly --- */
.content-body > .card,
.content-body > .glass-panel,
.content-body > .plb-grid,
.content-body > .plb-banner,
.content-body > .error-card,
.content-body > .admin-users-card,
.content-body > .ai-console,
.content-body > .fc,
.content-body > .fits-browse,
.content-body > .industry-container,
.content-body > .auth-container,
.content-body > .page-hero,
.content-body > .eve-personal-card {
    animation: opsSectionIn 300ms ease both;
}

.content-body > .fc,
.content-body > .fits-browse,
.content-body > .industry-container {
    animation-delay: 40ms;
}

/* --- A11y: focus rings + cyan contrast --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-muted);
}

.btn:focus-visible,
.tab-btn:focus-visible,
.fits-browse-filter:focus-visible,
.action-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-muted) !important;
    border-color: var(--accent-border) !important;
}

/* Cyan-on-dark: bump accent text for contrast (ISK stays amber) */
.accent-text,
.text-accent {
    color: #6ad8ea;
}

body[data-skin="opsroom"] a.accent-text,
body[data-skin="opsroom"] .accent-text {
    color: #7adbdc;
}

/* Dashboard chart font leftover */
body[data-active-page="dashboard"] canvas {
    font-family: var(--font-body);
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
        border-top-color: var(--accent);
        opacity: 0.85;
    }

    .content-body > .fc,
    .content-body > .fits-browse,
    .content-body > .industry-container,
    .content-body > .auth-container,
    .content-body > .page-hero,
    .content-body > .eve-personal-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .fa-spinner.fa-spin {
        animation: none !important;
    }
}

/* ================================================================
   OPS-ROOM WAVE 6 — JS-injected UI / charts / leftovers / density
   Rollback: OPSROOM_ROLLBACK.md + *.bak_pre_opsroom_w6 (undo w6 only)
   Full undo: *.bak_pre_opsroom
   Visual only — colors/classes of injected UI; no dogma/auth/simulate.
   ================================================================ */

:root {
    --chart-line: #2ec8e0;
    --chart-fill: rgba(46, 200, 224, 0.06);
    --chart-grid: rgba(180, 200, 220, 0.06);
    --chart-tick: #939cab;
    --ops-gutter: clamp(20px, 2.4vw, 36px);
    --ops-gutter-tight: clamp(16px, 2vw, 28px);
}

/* --- Density: nav + content gutters aligned --- */
.sidebar {
    width: var(--sidebar-width, 76px);
    flex-shrink: 0;
    padding: 0;
}

.sidebar-inner {
    padding: 16px 0 12px 0;
}

.nav-brand {
    margin-bottom: 18px;
}

.nav-item {
    width: 52px;
    height: 52px;
    margin-bottom: 5px;
}

.nav-item::before {
    left: -10px;
}

.top-bar {
    padding: 0 var(--ops-gutter);
}

.section-strip__inner {
    padding: 0 var(--ops-gutter);
}

.content-body {
    padding: var(--ops-gutter);
}

/* --- Shared: Material blue/purple leftovers --- */
.stat-icon.blue {
    color: var(--accent) !important;
    background: var(--accent-soft) !important;
}

.stat-icon.green {
    color: var(--success-color);
    background: rgba(105, 240, 174, 0.1);
}

.stat-icon.orange {
    color: var(--amber);
    background: rgba(224, 154, 58, 0.1);
}

.stat-icon.red {
    color: var(--danger-color);
    background: rgba(255, 82, 82, 0.1);
}

/* Chart canvas chrome */
.chart-wrapper,
.chart-card,
[id*="Chart"],
canvas[id*="chart" i],
canvas[id*="Chart"] {
    font-family: var(--font-body);
}

body[data-active-page="corporation"] .chart-wrapper,
body[data-active-page="pilot"] .chart-wrapper,
body[data-active-page="corporation_assets"] .chart-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
}

/* Industry: keep scan metrics readable on ops surfaces */
body[data-active-page="industry"] .node-item {
    border-radius: var(--radius-sm);
}

body[data-active-page="industry"] #filter-basic {
    font-family: var(--font-body);
}

/* Assistant widget: align fallback cyan to ops token */
.ai-status-dot.online {
    background: var(--cyan) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

.ai-icon {
    color: var(--cyan) !important;
}

.ai-msg.ai .ai-bubble {
    background: var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
}

/* Fits: kill residual Material blue if inline wins rarely */
.fits-layout .ewb-lib-toggle,
.fits-layout .ewb-implant-advice button:not(.secondary),
.fits-layout .ewb-btn-copy {
    background: var(--accent-soft) !important;
    border: 1px solid var(--accent-border) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
}

.fits-layout .ewb-drone-add-btn:hover {
    border-color: var(--accent) !important;
    background: var(--accent-soft) !important;
    color: var(--text) !important;
}

.fits-layout .ewb-tabs .sim-tab.active {
    border-bottom-color: var(--accent) !important;
}

.fits-layout .ewb-tag-pill {
    background: var(--accent-soft) !important;
    border: 1px solid var(--accent-border) !important;
    color: var(--text) !important;
}

/* Dashboard card-icon.purple already remapped; keep compact spacing */
body[data-active-page="dashboard"] .dashboard-grid {
    gap: 16px;
    margin-bottom: 22px;
}

body[data-active-page="dashboard"] .dash-kpi-grid {
    gap: 14px;
}

@media (max-width: 900px) {
    .sidebar:not(.is-wide) .sidebar-inner {
        /* Keep user-resized width; only tighten padding on narrow viewports */
        padding: 12px 0 10px 0;
    }

    .sidebar:not(.is-wide) .nav-item {
        width: 48px;
        height: 48px;
    }

    .content-body,
    .top-bar,
    .section-strip__inner {
        padding-left: var(--ops-gutter-tight);
        padding-right: var(--ops-gutter-tight);
    }
}

/* ================================================================
   OPS-ROOM WAVE 7 — leftovers / chrome / fits micro / 8px rhythm
   Rollback: OPSROOM_ROLLBACK.md + *.bak_pre_opsroom_w7 (undo w7 only)
   Full undo: *.bak_pre_opsroom
   Visual only — colors/classes; no dogma/auth/simulate/API.
   ================================================================ */

:root {
    /* 8px rhythm tokens (top-bar / strip / content) */
    --ops-space-1: 8px;
    --ops-space-2: 16px;
    --ops-space-3: 24px;
    --ops-space-4: 32px;
    --ops-gutter: clamp(16px, 2.4vw, 32px);
    --ops-gutter-tight: 16px;
}

/* --- Scrollbars (dark ops) --- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 200, 224, 0.28) rgba(8, 10, 13, 0.85);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(8, 10, 13, 0.9);
}

::-webkit-scrollbar-thumb {
    background: rgba(46, 200, 224, 0.22);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 200, 224, 0.38);
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: rgba(8, 10, 13, 0.9);
}

.sidebar::-webkit-scrollbar,
.sidebar-inner::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.chat-messages::-webkit-scrollbar-thumb,
.ai-messages::-webkit-scrollbar-thumb,
.tree-content::-webkit-scrollbar-thumb {
    background: rgba(46, 200, 224, 0.22);
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.ai-messages::-webkit-scrollbar-thumb:hover,
.tree-content::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 200, 224, 0.36);
}

/* --- Selection + autofill --- */
::selection {
    background: rgba(46, 200, 224, 0.28);
    color: var(--text);
}

::-moz-selection {
    background: rgba(46, 200, 224, 0.28);
    color: var(--text);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text);
    box-shadow: 0 0 0 1000px var(--surface) inset !important;
    border-color: var(--accent-border) !important;
    transition: background-color 99999s ease-out 0s;
}

/* --- Empty states / skeleton loaders --- */
.empty-state,
#empty-state,
.ops-empty,
.plb-empty {
    text-align: center;
    color: var(--muted);
    padding: var(--ops-space-4) var(--ops-space-2);
    font-size: 0.92em;
    line-height: 1.45;
}

.ops-empty-icon,
.empty-state .material-icons,
#empty-state .material-icons,
.empty-state .fas,
#empty-state .fas,
.plb-empty .material-icons {
    display: block;
    margin: 0 auto var(--ops-space-2);
    font-size: 40px;
    color: var(--accent-muted);
    opacity: 0.55;
}

.ops-empty h3,
.empty-state h3,
#empty-state h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
}

.ops-empty p,
.empty-state p,
#empty-state p {
    margin: 0;
    color: var(--muted);
}

.ops-skeleton,
.skeleton,
[data-skeleton],
.wb-progress-fill::after,
.fits-progress-fill::after {
    background-image: linear-gradient(
        90deg,
        transparent,
        rgba(46, 200, 224, 0.10),
        transparent
    );
}

.ops-skeleton,
.skeleton,
[data-skeleton] {
    display: block;
    min-height: 12px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.04);
    background-size: 200% 100%;
    animation: ops-skel 1.6s ease-in-out infinite;
}

@keyframes ops-skel {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ops-skeleton,
    .skeleton,
    [data-skeleton],
    .wb-progress-fill::after,
    .fits-progress-fill::after {
        animation: none !important;
    }
}

/* --- 8px rhythm: top-bar + section-strip + main --- */
.top-bar {
    height: 56px;
    padding: 0 var(--ops-gutter);
}

.section-strip__inner {
    padding: 0 var(--ops-gutter);
}

.section-strip__label {
    min-height: 32px;
    gap: 8px;
    padding: 4px 8px;
}

.content-body {
    padding: var(--ops-gutter);
}

/* --- Fits micro: hover / selected / offline vs active --- */
.fits-layout .fits-item {
    transition: background 0.15s ease, border-color 0.15s ease;
}

.fits-layout .fits-item:hover {
    background: rgba(46, 200, 224, 0.05);
    border-color: rgba(46, 200, 224, 0.22);
}

.fits-layout .fits-item.active {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    box-shadow: inset 2px 0 0 var(--accent);
}

.fits-layout .fits-selected {
    border: 1px solid var(--accent-border);
    background:
        linear-gradient(135deg, rgba(46, 200, 224, 0.06) 0%, transparent 48%),
        rgba(8, 10, 13, 0.55);
    box-shadow: 0 0 0 1px rgba(46, 200, 224, 0.06);
}

.fits-layout .fits-selected-name {
    color: var(--text);
}

.fits-layout .ewb-picker-item:hover {
    background: var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
}

.fits-layout .ewb-cargo-item:hover,
.fits-layout .wb-mod-item:hover {
    background: rgba(46, 200, 224, 0.06);
    border-color: var(--accent-border);
}

.fits-layout .wb-mod-qty {
    background: var(--accent-soft);
    color: var(--accent);
}

.fits-layout .wb-stat-ehp .wb-stat-value,
.fits-layout .sim-fit-category,
.fits-layout .wb-tag-omega {
    color: var(--accent) !important;
}

.fits-layout .wb-btn:hover {
    background: rgba(46, 200, 224, 0.10);
    border-color: var(--accent-border);
    color: var(--accent);
}

.fits-layout .fits-progress-cyan,
.fits-layout .wb-progress-cyan {
    background: linear-gradient(90deg, #2498ac, var(--accent));
    box-shadow: none;
}

.fits-layout .wb-dmg-em .wb-dmg-bar-fill,
.fits-layout .sim-res-em .sim-res-bar-fill {
    background: linear-gradient(180deg, var(--accent), #1a7a8a);
}

/* Offline vs active chip / slot clarity */
.fits-layout .fit-radial .slot-inner[data-state="Active"],
.fits-layout .fit-radial .slot-inner[data-state="Online"] {
    outline: 1px solid rgba(105, 240, 174, 0.35);
    outline-offset: -1px;
}

.fits-layout .fit-radial .slot-inner[data-state="Offline"],
.fits-layout .fit-radial .slot-inner.off {
    opacity: 0.38;
    filter: grayscale(0.55) brightness(0.72);
    outline: 1px dashed rgba(147, 156, 171, 0.45);
    outline-offset: -1px;
}

.fits-layout .wb-mod-item.on .wb-mod-state {
    color: var(--success-color);
}

.fits-layout .wb-mod-item.off .wb-mod-state {
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.fits-layout .ewb-sim-badge {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent);
}

.fits-layout .ewb-sim-badge.warn {
    color: #ffe0b2;
    background: rgba(224, 154, 58, 0.14);
    border-color: rgba(224, 154, 58, 0.45);
}

.fits-layout .ewb-sim-badge.bad {
    color: #ffcdd2;
    background: rgba(255, 82, 82, 0.14);
    border-color: rgba(255, 82, 82, 0.48);
}

.fits-layout .ewb-chip.active-charges {
    border-color: rgba(224, 154, 58, 0.5);
    background: rgba(224, 154, 58, 0.14);
    color: var(--amber);
    box-shadow: inset 0 -2px 0 rgba(224, 154, 58, 0.55);
}

.fits-layout .ewb-chip:not(.active-charges):hover {
    border-color: var(--accent-border);
    background: rgba(46, 200, 224, 0.16);
}

/* Shared leftover class names kept for compatibility */
.card-icon.accent {
    background: var(--accent-soft);
    border-color: var(--accent-border);
}

@media (max-width: 900px) {
    .top-bar {
        height: 56px;
    }

    .content-body,
    .top-bar,
    .section-strip__inner {
        padding-left: var(--ops-gutter-tight);
        padding-right: var(--ops-gutter-tight);
    }
}

/* ================================================================
   OPS-ROOM WAVE 8 — live visual QA leftovers
   Rollback: OPSROOM_ROLLBACK.md + *.bak_pre_opsroom_w8 (undo w8 only)
   Visual only — mobile drawer + Fits browse mobile + btn tokens.
   No dogma/auth/simulate/API.
   ================================================================ */

/* Untokenized Bootstrap-ish leftovers seen in Corp Contabilidad */
.btn-success {
    background: rgba(105, 240, 174, 0.14);
    color: #c8f7dc;
    border-color: rgba(105, 240, 174, 0.42);
    box-shadow: none;
}
.btn-success:hover {
    background: rgba(105, 240, 174, 0.22);
    border-color: rgba(105, 240, 174, 0.55);
    color: #e6fff0;
}
.btn-warning {
    background: transparent;
    color: var(--amber);
    border-color: rgba(224, 154, 58, 0.45);
    box-shadow: none;
}
.btn-warning:hover {
    background: rgba(224, 154, 58, 0.12);
    border-color: rgba(224, 154, 58, 0.6);
    color: #ffe0b2;
}

/* --- Mobile nav drawer: real drawer, not a 64px icon strip --- */
@media (max-width: 768px) {
    .mobile-overlay {
        background: rgba(0, 0, 0, 0.62);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .sidebar-resize-handle {
        display: none !important;
    }

    .sidebar {
        width: min(272px, 86vw) !important;
        max-width: min(272px, 86vw);
        min-width: 0;
        align-items: stretch;
        padding: 0 !important;
        border-right: 1px solid var(--border-strong);
        background:
            linear-gradient(180deg, rgba(46, 200, 224, 0.07) 0%, transparent 22%),
            var(--bg-elevated);
    }

    .sidebar .sidebar-inner {
        align-items: stretch;
        padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px)) 12px;
    }

    body.sidebar-open .sidebar {
        box-shadow: 12px 0 48px rgba(0, 0, 0, 0.62),
                    inset -1px 0 0 rgba(46, 200, 224, 0.08);
    }

    .sidebar .nav-brand {
        width: 100%;
        margin-bottom: 14px;
        justify-content: flex-start;
        padding: 0 4px;
    }

    .sidebar .brand-link {
        width: 48px;
        height: 48px;
    }

    .sidebar .nav-item {
        width: 100% !important;
        min-width: 0;
        height: auto !important;
        min-height: 48px;
        margin-bottom: 4px;
        padding: 8px 12px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        border-radius: var(--radius-sm);
    }

    .sidebar .nav-item .material-icons {
        font-size: 22px;
        margin-bottom: 0;
        width: 24px;
        text-align: center;
        flex-shrink: 0;
    }

    .sidebar .nav-item .label {
        font-family: var(--font-body);
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.01em;
        display: inline-block;
        line-height: 1.2;
        text-transform: none;
        color: var(--muted);
        -webkit-font-smoothing: auto;
        -moz-osx-font-smoothing: auto;
        text-rendering: geometricPrecision;
    }

    .sidebar .nav-item::before {
        left: 0;
        width: 3px;
        height: 52%;
        border-radius: 0 2px 2px 0;
    }

    .sidebar .submenu-container {
        width: 100%;
        align-items: stretch;
    }

    .sidebar .submenu-container > .nav-item::after {
        right: 12px;
    }

    .sidebar .submenu {
        width: 100%;
        margin-left: 0;
        padding: 4px 0 4px 10px;
        border-left: 2px solid rgba(46, 200, 224, 0.18);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        background: rgba(8, 10, 13, 0.45);
    }

    .sidebar .submenu .nav-item {
        width: 100% !important;
        height: auto !important;
        min-height: 44px;
        margin-bottom: 2px;
        padding: 6px 10px;
        border-radius: var(--radius-sm);
    }

    .sidebar .submenu .nav-item .material-icons {
        font-size: 20px;
    }

    .sidebar .submenu .nav-item .label {
        font-size: 12px;
        display: inline-block;
        -webkit-line-clamp: unset;
        overflow: visible;
        text-align: left;
        max-width: none;
        letter-spacing: 0.01em;
        text-transform: none;
    }

    .sidebar .nav-subgroup {
        width: auto;
        margin: 6px 0 4px 8px;
        padding: 4px;
        align-items: stretch;
        background:
            linear-gradient(180deg, rgba(46, 200, 224, 0.08) 0%, transparent 50%),
            rgba(8, 10, 13, 0.55);
        border: 1px solid var(--accent-border);
        border-radius: var(--radius);
        box-shadow:
            inset 0 1px 0 rgba(46, 200, 224, 0.07),
            0 0 0 1px rgba(0, 0, 0, 0.2);
    }

    .sidebar .nav-subgroup__toggle {
        width: 100%;
        min-height: 38px;
        justify-content: flex-start;
        padding: 8px 30px 8px 12px;
        margin: 0;
        background: var(--accent-soft);
        border-radius: var(--radius-sm);
    }

    .sidebar .nav-subgroup__toggle .label {
        font-family: var(--font-body);
        font-size: 12px;
        letter-spacing: 0.02em;
        text-align: left;
        text-transform: none;
        -webkit-line-clamp: unset;
        overflow: visible;
        display: inline-block;
    }

    .sidebar .nav-subgroup__toggle::after {
        right: 12px;
        border-left-width: 4px;
        border-right-width: 4px;
        border-top-width: 5px;
        opacity: 0.85;
    }

    .sidebar .nav-subgroup__items {
        align-items: stretch;
        padding-left: 4px;
        padding-right: 2px;
        margin-left: 0;
        border-left: none;
    }

    .sidebar .nav-subgroup__items.open {
        margin-top: 4px;
        padding-top: 4px;
        padding-bottom: 2px;
        border-top-color: rgba(46, 200, 224, 0.18);
    }

    .sidebar .nav-subgroup__items .nav-item {
        width: 100% !important;
        min-height: 44px;
    }

    .nav-blurb-tip {
        max-width: min(280px, calc(100vw - 20px));
        font-size: 0.85rem;
    }

    .sidebar .nav-footer {
        margin-top: auto;
        margin-bottom: 0;
        align-items: stretch;
        width: 100%;
        padding: 0;
    }

    .sidebar .nav-footer .nav-item,
    .sidebar .nav-footer .nav-item--report {
        width: 100% !important;
        height: auto !important;
        min-height: 48px;
        margin-bottom: 4px;
        margin-left: 0;
        margin-right: 0;
        padding: 8px 12px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .sidebar .nav-footer .nav-item:last-child,
    .sidebar .nav-footer .nav-item--report:last-child {
        margin-bottom: 0;
    }

    .sidebar .nav-footer .nav-item .material-icons,
    .sidebar .nav-footer .nav-item--report .material-icons {
        margin-bottom: 0;
    }

    .sidebar a.nav-item[href="/logout"],
    .sidebar a.nav-item[href="/login"] {
        margin-bottom: 0;
    }

    .mobile-menu-btn {
        border-color: rgba(46, 200, 224, 0.28);
        background: linear-gradient(180deg, rgba(46, 200, 224, 0.10), rgba(255, 255, 255, 0.02));
    }

    body.sidebar-open .mobile-menu-btn {
        border-color: var(--accent-border);
        background: var(--accent-soft);
        color: var(--text);
    }

    /* Fits library (browse) — mobile density / gaps / safe bottom */
    .fits-browse {
        gap: 14px;
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        max-width: 100%;
    }

    .fits-browse-hero {
        align-items: stretch;
        gap: 12px;
        padding: 0 0 4px;
    }

    .fits-browse-hero h1 {
        font-size: 1.35rem;
        line-height: 1.15;
    }

    .fits-browse-hero .btn,
    .fits-browse-hero a.btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .fits-browse-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .fits-browse-stat {
        min-width: 0;
        padding: 10px 8px;
    }

    .fits-browse-stat strong {
        font-size: 1.1rem;
    }

    .fits-browse-stat span {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
    }

    .fits-browse-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .fits-browse-search {
        flex: 1 1 auto;
        width: 100%;
        min-height: 44px;
    }

    .fits-browse-search input {
        font-size: 16px; /* avoid iOS zoom */
    }

    .fits-browse-filters {
        width: 100%;
        gap: 8px;
    }

    .fits-browse-filter {
        min-height: 40px;
        flex: 1 1 auto;
        justify-content: center;
        display: inline-flex;
        align-items: center;
        padding: 8px 12px;
    }

    .fits-browse-filter.skills-toggle {
        flex: 1 1 100%;
    }

    .fits-browse-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .fits-browse-card {
        min-height: 0;
        padding: 12px;
        gap: 8px;
    }

    .fits-browse-card img {
        width: 56px;
        height: 56px;
    }

    .fits-browse-card-name {
        font-size: 0.98rem;
        overflow-wrap: anywhere;
    }

    .fits-browse-section-title {
        margin: 12px 0 8px;
    }

    /* Workshop panel gaps on phone */
    .fits-layout {
        gap: 12px;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .fits-layout .fits-sidebar.card,
    .fits-layout.ewb-mode .fits-sidebar {
        max-height: min(38vh, 320px);
        margin-bottom: 4px;
    }
}

@media (max-width: 420px) {
    .sidebar {
        width: min(260px, 90vw) !important;
        max-width: min(260px, 90vw);
    }

    .fits-browse-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .fits-browse-stat {
        padding: 8px 6px;
    }
}



/* === INDUSTRY ALIGN 20261012ind6 === */
/* Rollback: *.bak_pre_industry_ind6 + OPSROOM_ROLLBACK.md */
body[data-active-page="industry"] .industry-container {
    gap: 12px;
    color: var(--text);
    min-height: 0;
    overflow: hidden;
}

body[data-active-page="industry"] .industry-sidebar {
    width: var(--industry-sidebar-width, 400px);
    flex: 0 0 auto;
    overflow: hidden !important;
    z-index: 4;
    min-height: 0;
}

body[data-active-page="industry"] .industry-sidebar .tree-content {
    min-height: 0;
    overflow-y: auto;
}

body[data-active-page="industry"] .industry-sidebar,
body[data-active-page="industry"] .industry-main {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
}

body[data-active-page="industry"] .tab-btn {
    font-family: var(--font-display);
    letter-spacing: 0.4px;
}

body[data-active-page="industry"] .tab-btn.active {
    background: var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
    color: var(--text) !important;
}

body[data-active-page="industry"] .filter-panel {
    background: var(--bg-elevated) !important;
    border-bottom: 1px solid var(--border) !important;
    overflow: hidden !important;
    z-index: 2;
}

body[data-active-page="industry"] #filter-basic {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Gear popover is portaled to body with position:fixed */
body[data-active-page="industry"] #filter-advanced,
body[data-active-page="industry"] .filter-advanced-dropdown {
    background: var(--surface) !important;
    border: 1px solid rgba(224, 154, 58, 0.45) !important;
    border-left: 3px solid var(--amber) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
    z-index: 9000 !important;
}

body[data-active-page="industry"] .filter-gear-btn {
    width: 34px !important;
    min-width: 34px !important;
    min-height: 32px !important;
    border-color: var(--border-strong) !important;
    color: var(--text-dim) !important;
    background: transparent !important;
    opacity: 0.85;
}

body[data-active-page="industry"] .filter-gear-btn i {
    font-size: 1.05em !important;
}

body[data-active-page="industry"] .filter-gear-btn:hover {
    background: rgba(148, 163, 184, 0.12) !important;
    border-color: rgba(148, 163, 184, 0.4) !important;
    color: var(--muted) !important;
    opacity: 1;
}

body[data-active-page="industry"] .filter-gear-btn.is-open {
    color: var(--muted) !important;
    background: rgba(148, 163, 184, 0.1) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
    opacity: 1;
}

body[data-active-page="industry"] .node-item {
    min-height: 48px;
    font-size: 0.98em;
    padding: 10px 12px;
}

body[data-active-page="industry"] .node-item img {
    width: 32px !important;
    height: 32px !important;
}

/* One shared Propiedad row — no Corp/Personal size forks */
body[data-active-page="industry"] .ind-bp-row {
    display: flex !important;
    align-items: center;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 8px 10px !important;
    font-size: 0.92em !important;
    box-sizing: border-box;
}

body[data-active-page="industry"] .ind-bp-row img.ind-bp-icon {
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
}

body[data-active-page="industry"] .ind-bp-badges {
    width: 72px;
}

body[data-active-page="industry"] table.industry-table {
    table-layout: fixed !important;
}

body[data-active-page="industry"] table.industry-table th.col-unit,
body[data-active-page="industry"] table.industry-table td.col-unit {
    padding-left: 28px !important;
    text-align: left !important;
}

body[data-active-page="industry"] table.industry-table th.col-total,
body[data-active-page="industry"] table.industry-table td.col-total {
    padding-left: 14px !important;
    text-align: left !important;
}

body[data-active-page="industry"] table.industry-table th.col-qty,
body[data-active-page="industry"] table.industry-table td.col-qty,
body[data-active-page="industry"] .industry-main th.text-center,
body[data-active-page="industry"] table.industry-table th.text-center,
body[data-active-page="industry"] .industry-main td.text-center,
body[data-active-page="industry"] table.industry-table td.text-center {
    text-align: center !important;
}

body[data-active-page="industry"] .industry-main th.text-left,
body[data-active-page="industry"] table.industry-table th.text-left,
body[data-active-page="industry"] .industry-main td.text-left,
body[data-active-page="industry"] table.industry-table td.text-left {
    text-align: left !important;
}

body[data-active-page="industry"] .ind-kpi {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

body[data-active-page="industry"] .ind-kpi-val {
    font-family: var(--font-mono);
}

body[data-active-page="industry"] .bp-title h2 {
    font-family: var(--font-display);
    background: none !important;
    -webkit-text-fill-color: unset !important;
    color: var(--text) !important;
}

body[data-active-page="industry"] .action-btn.btn-accent {
    background: var(--accent-soft) !important;
    border-color: var(--accent-border) !important;
}

body[data-active-page="industry"] .action-btn.btn-amber {
    color: var(--amber) !important;
    border-color: rgba(224, 154, 58, 0.45) !important;
    background: transparent !important;
}

body[data-active-page="industry"] .action-btn.btn-amber.is-open {
    color: var(--text) !important;
    background: rgba(224, 154, 58, 0.18) !important;
}

body[data-active-page="industry"] .action-btn.btn-danger {
    color: var(--danger-color) !important;
    border-color: rgba(255, 82, 82, 0.35) !important;
}

body[data-active-page="industry"] .shopping-footer {
    background: var(--surface-2) !important;
    border-top: 1px solid var(--border) !important;
}

body[data-active-page="industry"] .balance-card {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
}

body[data-active-page="industry"] .ind-empty {
    color: var(--muted);
}

body[data-active-page="industry"] .ops-empty {
    padding: 48px 20px;
}

@media (max-width: 768px) {
    body[data-active-page="industry"] .industry-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    body[data-active-page="industry"] .industry-sidebar {
        width: 100% !important;
        max-height: 58vh;
        overflow: hidden !important;
    }
    body[data-active-page="industry"] .industry-sidebar-resize-handle {
        display: none !important;
    }
}

/* ================================================================
   LANGUAGE PICKER — ops-room chrome (site-wide via top-bar)
   ================================================================ */
.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.lang-picker {
    position: relative;
    z-index: 40;
}

.lang-picker__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px 0 8px;
    background: var(--surface, #161a20);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: var(--radius, 6px);
    color: var(--text, #e8eaed);
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.lang-picker__btn:hover,
.lang-picker.is-open .lang-picker__btn {
    border-color: rgba(46, 200, 224, 0.45);
    background: rgba(46, 200, 224, 0.08);
    color: var(--text, #e8eaed);
}

.lang-picker__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 200, 224, 0.28);
}

.lang-picker__btn .material-icons {
    font-size: 16px;
    color: var(--accent, #2ec8e0);
}

.lang-picker__code {
    min-width: 1.6em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.lang-picker__chev {
    font-size: 16px !important;
    color: var(--muted, #9aa3ad) !important;
    transition: transform 0.18s ease;
}

.lang-picker.is-open .lang-picker__chev {
    transform: rotate(180deg);
}

.lang-picker__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 168px;
    padding: 6px;
    background: var(--surface-2, #1c2128);
    border: 1px solid var(--border-strong, rgba(255,255,255,0.14));
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 50;
}

.lang-picker__menu[hidden] {
    display: none !important;
}

.lang-picker__opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted, #9aa3ad);
    font-family: var(--font-body, 'IBM Plex Sans', sans-serif);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.lang-picker__opt:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text, #e8eaed);
}

.lang-picker__opt.is-active {
    background: rgba(46, 200, 224, 0.10);
    border-color: rgba(46, 200, 224, 0.28);
    color: var(--text, #e8eaed);
}

.lang-picker__opt-code {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent, #2ec8e0);
    min-width: 1.8em;
}

@media (max-width: 768px) {
    .top-bar-actions {
        gap: 6px;
    }

    .lang-picker__btn {
        height: 36px;
        padding: 0 8px;
        gap: 4px;
    }

    .lang-picker__chev {
        display: none;
    }

    .lang-picker__menu {
        right: -4px;
        min-width: 156px;
    }
}

/* ================================================================
   Dashboard ticket / bug-suggestion card — ops-room visibility
   Rollback: *.bak_pre_bug_btn · cache ?v=…bugbtn1
   Accent: cyan only (no purple / neon spam)
   ================================================================ */
.dash-ticket-card {
    position: relative;
    border-color: var(--accent-border);
    background:
        linear-gradient(180deg, rgba(46, 200, 224, 0.07), transparent 46%),
        var(--surface);
    overflow: visible;
}

.dash-ticket-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid rgba(46, 200, 224, 0.34);
    box-shadow: 0 0 0 0 rgba(46, 200, 224, 0.18);
    animation: dashTicketPulse 3.4s ease-out infinite;
    pointer-events: none;
}

@keyframes dashTicketPulse {
    0% {
        opacity: 0.55;
        box-shadow: 0 0 0 0 rgba(46, 200, 224, 0.18);
    }
    70% {
        opacity: 0;
        box-shadow: 0 0 0 8px rgba(46, 200, 224, 0);
    }
    100% {
        opacity: 0;
        box-shadow: 0 0 0 8px rgba(46, 200, 224, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dash-ticket-card::after {
        animation: none;
        opacity: 0.35;
        box-shadow: none;
    }
}

.dash-ticket-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.dash-ticket-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: var(--cyan);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
}

.dash-ticket-titles {
    min-width: 0;
    flex: 1;
}

.dash-ticket-card .large-card h2,
.dash-ticket-card h2 {
    margin: 0;
    padding: 0 0 0 10px;
    border-bottom: none;
    font-family: var(--font-display);
    font-size: 1.12rem;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.dash-ticket-card h2::before {
    top: 3px;
    bottom: 3px;
}

.dash-ticket-intro {
    margin: 8px 0 0;
    line-height: 1.5;
    font-size: 0.92rem;
}

.dash-ticket-submit {
    min-height: 48px;
    padding: 12px 18px;
    margin-top: 4px;
    font-size: 14.5px;
    letter-spacing: 0.2px;
    border-color: var(--accent-border);
    box-shadow: 0 0 0 1px rgba(46, 200, 224, 0.12);
}

.dash-ticket-submit .material-icons {
    font-size: 20px;
}

.dash-ticket-submit:hover {
    border-color: rgba(46, 200, 224, 0.55);
    box-shadow: 0 0 0 1px rgba(46, 200, 224, 0.22);
}

.dash-ticket-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 1px var(--accent-border);
}

/* --- Guest home elevation (cinematic ops-room, not KillSync clone) --- */
.guest-home-hero {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 22px;
    padding: clamp(22px, 3.2vw, 36px) clamp(20px, 3vw, 32px);
    overflow: hidden;
    position: relative;
    border-color: var(--border-strong);
    background:
        radial-gradient(900px 280px at 8% 0%, rgba(46, 200, 224, 0.12), transparent 55%),
        linear-gradient(165deg, rgba(20, 28, 36, 0.98) 0%, var(--surface) 48%, rgba(10, 14, 18, 0.96) 100%);
    animation: guest-home-enter 520ms ease-out both;
}

.guest-home-hero::before {
    top: 14px;
    bottom: 14px;
    width: 3px;
    background: linear-gradient(180deg, var(--accent) 0%, rgba(46, 200, 224, 0.15) 100%);
}

.guest-home-compose {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(18px, 2.4vw, 26px);
    width: 100%;
    max-width: 52rem;
    position: relative;
    z-index: 1;
}

.guest-home-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    width: 100%;
}

.guest-home-logo {
    width: clamp(56px, 7vw, 72px) !important;
    height: clamp(56px, 7vw, 72px) !important;
    border-color: var(--accent-border) !important;
    box-shadow: 0 0 0 1px rgba(46, 200, 224, 0.08);
}

body[data-active-page="dashboard"] .guest-home-hero .page-hero-title {
    font-size: clamp(1.7rem, 3.2vw, 2.35rem);
    letter-spacing: 1.2px;
    line-height: 1.05;
}

.guest-home-sub {
    text-transform: none !important;
    letter-spacing: 0.2px !important;
    font-size: 0.98rem !important;
    line-height: 1.45 !important;
    max-width: 36rem;
    color: var(--muted) !important;
    margin-top: 8px !important;
}

.guest-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
}

.guest-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 46px;
    padding: 11px 18px;
    font-weight: 700;
    letter-spacing: 0.35px;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.guest-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(46, 200, 224, 0.16);
}

.guest-cta-btn:active {
    transform: translateY(0);
}

.guest-cta-btn .material-icons {
    font-size: 20px;
}

.guest-home-proof-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 36rem;
}

.guest-social-proof {
    font-size: 0.82rem;
    letter-spacing: 0.15px;
    font-family: var(--font-mono);
    color: var(--accent-muted);
}

.guest-home-micro {
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 36rem;
}

.guest-value-hook {
    margin-top: 0;
    margin-bottom: 20px;
    border-color: var(--border);
    background:
        linear-gradient(105deg, rgba(46, 200, 224, 0.06) 0%, transparent 42%),
        var(--surface);
    animation: guest-home-enter 640ms 80ms ease-out both;
}

.guest-value-hook-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.guest-value-hook-copy {
    min-width: 0;
    flex: 1;
}

.guest-value-hook-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 200, 224, 0.08);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    flex-shrink: 0;
}

.guest-value-hook-label {
    font-size: 0.74rem;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.guest-value-hook-title {
    font-weight: 700;
    font-size: 1.02rem;
    margin-top: 4px;
    color: #eaf4ff;
}

.guest-value-hook-detail {
    margin-top: 6px;
    line-height: 1.45;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.guest-hook-cta {
    border-color: var(--accent-border);
    text-decoration: none;
    white-space: nowrap;
    align-self: center;
    transition: transform 160ms ease, border-color 160ms ease;
}

.guest-hook-cta:hover {
    transform: translateY(-1px);
}

.guest-secondary-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.guest-trust {
    margin: 0;
    padding: 16px 18px 18px;
    border-radius: 12px;
    border: 1px solid rgba(120, 140, 160, 0.16);
    background:
        linear-gradient(165deg, rgba(14, 18, 24, 0.92) 0%, rgba(8, 10, 13, 0.72) 100%);
    max-width: 46rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.guest-trust-kicker {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim, #9aa8b5);
    margin: 0 0 6px;
}

.guest-trust-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 650;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e8f0f6;
    line-height: 1.2;
}

.guest-trust-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.guest-trust-chip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(120, 140, 160, 0.14);
    background: rgba(6, 8, 11, 0.4);
    color: var(--text-dim, #9aa8b5);
    font-family: var(--font-body);
    font-size: 0.82rem;
    line-height: 1.45;
}

.guest-trust-dot {
    width: 6px;
    height: 6px;
    margin-top: 0.48em;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent, #2ec8e0);
    box-shadow: 0 0 0 1px rgba(46, 200, 224, 0.22), 0 0 7px rgba(46, 200, 224, 0.32);
}

.guest-sso-secondary,
.guest-login-secondary {
    margin: 0;
    border-color: var(--border);
    background: rgba(8, 10, 13, 0.28);
    opacity: 0.92;
    padding: 14px 16px;
}

.guest-secondary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.guest-secondary-char {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.guest-secondary-portrait {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0a1016;
    object-fit: cover;
    flex-shrink: 0;
}

.guest-secondary-name {
    font-weight: 700;
    font-size: 0.98rem;
    color: #eaf4ff;
}

.guest-secondary-meta {
    margin-top: 3px;
    line-height: 1.4;
    font-size: 0.86em;
}

.guest-secondary-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}

.guest-secondary-body,
.guest-login-copy {
    margin-top: 4px;
    line-height: 1.45;
    font-size: 0.86rem;
}

.guest-secondary-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.guest-secondary-btn {
    opacity: 0.95;
}

.guest-quick-links {
    margin-top: 4px;
    opacity: 0.92;
}

/* Compact guest banner (chrome) */
.guest-banner {
    padding: 7px 12px;
    font-size: 0.8rem;
    gap: 8px;
    margin: 0 18px 8px;
    line-height: 1.35;
}

.guest-banner .material-icons {
    font-size: 16px;
}

.guest-banner > span[data-i18n="guest.banner"] {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 12rem;
    min-width: 0;
}

/* AI dock safe-zone: keep content clear of collapsed strip (desktop) */
@media (min-width: 769px) {
    .content-body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    body[data-guest="1"] .content-body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

/* Shared page-hero identity (market / industry / fits) */
.ops-page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 18px;
    margin: 0 0 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background:
        linear-gradient(135deg, rgba(46, 200, 224, 0.07) 0%, transparent 42%),
        linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    position: relative;
    overflow: hidden;
}

.ops-page-hero::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 2px;
    background: var(--accent);
}

.ops-page-hero-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.ops-page-hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    color: var(--text);
    line-height: 1.15;
}

.ops-page-hero-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.fits-browse-hero {
    padding: 12px 4px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.fits-browse-hero h1 {
    color: var(--text);
}

@keyframes guest-home-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .guest-home-hero,
    .guest-value-hook {
        animation: none;
    }
    .guest-cta-btn:hover,
    .guest-hook-cta:hover {
        transform: none;
    }
}

@media (max-width: 720px) {
    .guest-home-hero {
        padding: 18px 16px;
        margin-bottom: 16px;
    }
    .guest-cta-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .guest-cta-btn {
        width: 100%;
        justify-content: center;
    }
    .guest-value-hook-inner {
        align-items: stretch;
    }
    .guest-hook-cta {
        width: 100%;
        justify-content: center;
        text-align: center;
        /* Room for KOKO parked bottom-left on short phones */
        margin-bottom: 4px;
    }
    .guest-value-hook {
        margin-bottom: 28px;
    }
    .guest-banner {
        margin: 0 10px 8px;
        padding: 6px 10px;
    }
    .guest-banner > span[data-i18n="guest.banner"] {
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 768px) {
    body[data-active-page="dashboard"] .guest-home-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 16px;
    }
    body[data-guest="1"] .content-body {
        padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    }
}
