/* ===== Admin layout ===== */
.adminShell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 290px;
    border-right: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .04);
    backdrop-filter: blur(10px);
    padding: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 18px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .05);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
    position: sticky;
    top: 12px;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.sbBrand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
}



.sbBrand strong {
    display: block;
    font-size: 14px;
}

.sbBrand small {
    display: block;
    opacity: .75;
    margin-top: 2px;
    font-size: 12px;
}

.sbNav {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.sbNav button {
    width: 100%;
    text-align: left;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    padding: 12px 12px;
    color: rgba(255, 255, 255, .90);
    cursor: pointer;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: transform .12s ease, background .12s ease;
}

.sbNav button:hover {
    transform: translateY(-1px);
}

.sbNav button.active {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(139, 92, 246, .35);
    box-shadow: 0 12px 30px rgba(139, 92, 246, .16);
}

.sbNav button span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sbHint {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .03);
    font-size: 12px;
    color: rgba(255, 255, 255, .70);
    line-height: 1.35;
}

.kpis {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 1100px) {
    .kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .sidebar {
        display: none;
    }

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

.kpiCard {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    padding: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .20);
}

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

.kpiCard strong {
    display: block;
    font-size: 16px;
    letter-spacing: -.01em;
}

.kpiCard small {
    display: block;
    opacity: .75;
    margin-top: 4px;
    font-size: 12px;
}

.kpiIcon {
    width: 38px;
    height: 38px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel {
    margin-top: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    padding: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .20);
}

.panelHead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.panelHead h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.01em;
}

.panelHead p {
    margin: 6px 0 0 0;
    opacity: .75;
    font-size: 12px;
    max-width: 70ch;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.input {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .92);
    outline: none;
    font: inherit;
    min-width: 240px;
}

.select {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .92);
    outline: none;
    font: inherit;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .03);
}

th,
td {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    vertical-align: top;
    color: rgba(255, 255, 255, .82);
}

th {
    color: rgba(255, 255, 255, .92);
    font-weight: 900;
}

tr:last-child td {
    border-bottom: none;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    font-size: 12px;
    font-weight: 800;
    opacity: .95;
    white-space: nowrap;
}

.tag.ok {
    border-color: rgba(34, 197, 94, .25);
    background: rgba(34, 197, 94, .12);
}

.tag.warn {
    border-color: rgba(245, 158, 11, .25);
    background: rgba(245, 158, 11, .12);
}

.tag.bad {
    border-color: rgba(239, 68, 68, .25);
    background: rgba(239, 68, 68, .12);
}

.btnSm {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    color: rgba(255, 255, 255, .92);
    cursor: pointer;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.btnSm:hover {
    transform: translateY(-1px);
}

.btnSmDanger {
    border-color: rgba(239, 68, 68, .25);
    background: rgba(239, 68, 68, .14);
}

.btnSmPrimary {
    border-color: rgba(139, 92, 246, .30);
    background: rgba(139, 92, 246, .16);
}

/* ===== Modals ===== */
.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 18px;
}

.modalOverlay.show {
    display: flex;
}

.modal {
    width: min(720px, 100%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(10, 12, 16, .90);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .55);
    overflow: hidden;
}

.modalHead {
    padding: 14px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.modalHead strong {
    font-size: 14px;
}

.modalBody {
    padding: 14px;
}

.modalGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.field label {
    display: block;
    font-size: 12px;
    opacity: .75;
    font-weight: 800;
    margin-bottom: 6px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .92);
    outline: none;
    font: inherit;
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

.modalFoot {
    padding: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, .10);
    flex-wrap: wrap;
}

.miniUserPill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    font-weight: 900;
    cursor: pointer;
    user-select: none;
}

.miniUserPill img {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .18);
    object-fit: cover;
    background: rgba(255, 255, 255, .06);
}

.miniUserDrop {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(340px, calc(100vw - 24px));
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(10, 12, 16, .88);
    backdrop-filter: blur(12px);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .45);
    padding: 12px;
    display: none;
    z-index: 999;
}

.miniUserDrop.show {
    display: block;
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .04);
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
    margin-top: 10px;
}

.kv span {
    opacity: .75;
}

.kv code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11px;
    opacity: .9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.notice {
    border-radius: 18px;
    border: 1px solid rgba(245, 158, 11, .20);
    background: rgba(245, 158, 11, .10);
    padding: 12px 12px;
    color: rgba(255, 255, 255, .90);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 12px;
}

.lockScreen {
    display: none;
    margin-top: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(239, 68, 68, .18);
    background: rgba(239, 68, 68, .10);
}

.lockScreen h2 {
    margin: 0;
    font-size: 18px;
}

.lockScreen p {
    margin: 8px 0 0;
    opacity: .85;
    font-size: 13px;
}

/* =========================================================
   ✅ Sidebar: scroll OK pero SIN barras visibles (X/Y)
   ========================================================= */
.sidebar {
    overflow-y: auto;
    /* scroll vertical permitido */
    overflow-x: hidden;
    /* no scroll horizontal */
    scrollbar-width: none;
    /* Firefox: oculta scrollbar */
    -ms-overflow-style: none;
    /* IE/Edge legacy */
    overscroll-behavior: contain;
}

.sidebar::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

/* Evitar que algo “reviente” el ancho y fuerce scrollbar */
.sidebar * {
    max-width: 100%;
}

.sbNav button {
    overflow: hidden;
}

.sbNav button span {
    min-width: 0;
}

.sbHint {
    overflow-wrap: anywhere;
    /* evita que textos largos generen scroll-x */
}

/* (opcional) por si el layout general mete scroll-x al body */
html,
body {
    overflow-x: hidden;
}

/* =========================================================
   ✅ Modal: más ancho + alto controlado + body scrolleable
   ========================================================= */
.modal {
    width: min(980px, calc(100% - 24px));
    /* más ancho */
    max-height: calc(100vh - 48px);
    /* no se sale de la pantalla */
    display: flex;
    flex-direction: column;
}

.modalHead,
.modalFoot {
    flex: 0 0 auto;
}

.modalBody {
    flex: 1 1 auto;
    overflow: auto;
    /* scroll interno */
    max-height: none;
    scrollbar-width: none;
    /* ocultar barra */
    -ms-overflow-style: none;
}

.modalBody::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

/* =========================================================
   ✅ Tabs del modal (paginación tipo wizard)
   ========================================================= */
.mTabs {
    display: grid;
    grid-template-columns: 220px 1fr;
    /* sidebar tabs + contenido */
    gap: 14px;
}

@media (max-width: 860px) {
    .mTabs {
        grid-template-columns: 1fr;
        /* en móvil: tabs arriba */
    }
}

.mTabRail {
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .03);
    border-radius: 16px;
    padding: 10px;
    display: grid;
    gap: 10px;
    align-content: start;

    /* scroll si hay muchos tabs, pero sin barras visibles */
    max-height: calc(100vh - 220px);
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mTabRail::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.mTabBtn {
    width: 100%;
    text-align: left;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    padding: 10px 10px;
    color: rgba(255, 255, 255, .90);
    cursor: pointer;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mTabBtn:hover {
    transform: translateY(-1px);
}

.mTabBtn.active {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(139, 92, 246, .35);
    box-shadow: 0 12px 30px rgba(139, 92, 246, .14);
}

.mTabPanel {
    display: none;
}

.mTabPanel.active {
    display: block;
}

.mPanelTitle {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -.01em;
}

.mPanelHint {
    margin: -6px 0 12px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, .70);
}

/* ===== Select PRO (dark, con chevron) ===== */
.select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    padding: 10px 42px 10px 12px;
    /* espacio para el icono */
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    background-color: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .92);
    outline: none;
    font: inherit;

    cursor: pointer;
    line-height: 1.2;

    /* Flecha integrada en el background (no depende de FontAwesome) */
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, .70) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, .70) 50%, transparent 50%),
        linear-gradient(to right, rgba(255, 255, 255, .08), rgba(255, 255, 255, .08));
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px),
        calc(100% - 40px) 50%;
    background-size:
        6px 6px,
        6px 6px,
        1px 18px;
    background-repeat: no-repeat;

    transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.select:hover {
    background-color: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .18);
    transform: translateY(-1px);
}

.select:focus {
    border-color: rgba(139, 92, 246, .45);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .14);
    transform: translateY(-1px);
}

.select:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* Opciones legibles en el dropdown nativo */
.select option {
    background: #0b0f14;
    color: rgba(255, 255, 255, .92);
}


/* =========================================================
   ✅ admin.css PRO (drop-in)
   - Responsive real (sidebar colapsable)
   - Tables legibles + scroll x sin romper layout
   - Inputs/selects consistentes
   - Cards/panels con spacing fluido
   - Light mode friendly
   ========================================================= */

/* ---------- Tokens (si ya existen en app.css, no pasa nada) ---------- */
:root {
    --bg: #0b0f14;
    --panel: rgba(255, 255, 255, .04);
    --panel2: rgba(255, 255, 255, .06);
    --text: rgba(255, 255, 255, .92);
    --muted: rgba(255, 255, 255, .70);
    --faint: rgba(255, 255, 255, .55);
    --border: rgba(255, 255, 255, .12);
    --brand: #8b5cf6;
    --brand2: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 18px 50px rgba(0, 0, 0, .22);
    --radius: 18px;
    --radiusSm: 14px;
    --focus: 0 0 0 4px rgba(139, 92, 246, .16);

    /* Admin layout */
    --sbW: 290px;
    --gap: 14px;
    --pad: 18px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f7f7fb;
        --panel: rgba(0, 0, 0, .04);
        --panel2: rgba(0, 0, 0, .06);
        --text: rgba(0, 0, 0, .86);
        --muted: rgba(0, 0, 0, .60);
        --faint: rgba(0, 0, 0, .50);
        --border: rgba(0, 0, 0, .12);
        --shadow: 0 18px 50px rgba(0, 0, 0, .12);
    }
}

/* ---------- Base safety ---------- */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

html,
body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

code {
    word-break: break-word;
}

/* =========================================================
   ✅ Layout
   ========================================================= */
.adminShell {
    display: flex;
    min-height: 100vh;
    gap: 0;
}

/* Sidebar (desktop) */
.sidebar {
    width: var(--sbW);
    border-right: 1px solid var(--border);
    background: var(--panel);
    backdrop-filter: blur(12px);
    padding: var(--pad);
    position: sticky;
    top: 0;
    height: 100vh;

    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
}

.sidebar::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

.sidebar * {
    max-width: 100%;
}

/* Main */
.main {
    flex: 1;
    min-width: 0;
    padding: var(--pad);
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    box-shadow: var(--shadow);

    position: sticky;
    top: 12px;
    z-index: 10;
    backdrop-filter: blur(14px);
}

/* Make topbar wrap nicely on narrow screens */
.topbar>* {
    min-width: 0;
}

@media (max-width: 920px) {
    .topbar {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .topbar .pill {
        white-space: nowrap;
    }
}

/* =========================================================
   ✅ Sidebar brand + nav
   ========================================================= */
.sbBrand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .03);
}

.sbBrand strong {
    display: block;
    font-size: 14px;
}

.sbBrand small {
    display: block;
    opacity: .75;
    margin-top: 2px;
    font-size: 12px;
}

.sbNav {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.sbNav button {
    width: 100%;
    text-align: left;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .03);
    padding: 12px 12px;

    color: var(--text);
    cursor: pointer;
    font-weight: 900;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
    overflow: hidden;
}

.sbNav button span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sbNav button span i {
    opacity: .92;
}

.sbNav button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .18);
}

.sbNav button:active {
    transform: translateY(0) scale(.99);
}

.sbNav button.active {
    background: rgba(139, 92, 246, .14);
    border-color: rgba(139, 92, 246, .35);
    box-shadow: 0 12px 30px rgba(139, 92, 246, .14);
}

/* Helper box */
.sbHint {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .03);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* =========================================================
   ✅ KPIs
   ========================================================= */
.kpis {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

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

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

.kpiCard {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    padding: 14px;
    box-shadow: var(--shadow);
    min-width: 0;
}

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

.kpiCard strong {
    display: block;
    font-size: 16px;
    letter-spacing: -.01em;
}

.kpiCard small {
    display: block;
    opacity: .75;
    margin-top: 4px;
    font-size: 12px;
}

.kpiIcon {
    width: 38px;
    height: 38px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* =========================================================
   ✅ Panels
   ========================================================= */
.panel {
    margin-top: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    padding: 14px;
    box-shadow: var(--shadow);
}

.panelHead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

@media (prefers-color-scheme: light) {
    .panelHead {
        border-bottom: 1px solid rgba(0, 0, 0, .08);
    }
}

.panelHead h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.01em;
}

.panelHead p {
    margin: 6px 0 0 0;
    opacity: .78;
    font-size: 12px;
    max-width: 70ch;
    color: var(--muted);
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

/* =========================================================
   ✅ Inputs / Selects / Focus states
   ========================================================= */
.input,
.field input,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    outline: none;
    font: inherit;
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease, transform .12s ease;
}

.input {
    min-width: 240px;
}

.input:focus,
.field input:focus,
.field textarea:focus {
    border-color: rgba(139, 92, 246, .45);
    box-shadow: var(--focus);
    background: rgba(255, 255, 255, .06);
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

/* Select PRO (no depende de icon fonts) */
.select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    padding: 10px 42px 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background-color: rgba(255, 255, 255, .04);
    color: var(--text);
    outline: none;
    font: inherit;

    cursor: pointer;
    line-height: 1.2;

    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, .70) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, .70) 50%, transparent 50%),
        linear-gradient(to right, rgba(255, 255, 255, .10), rgba(255, 255, 255, .10));
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px),
        calc(100% - 40px) 50%;
    background-size: 6px 6px, 6px 6px, 1px 18px;
    background-repeat: no-repeat;

    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease, transform .12s ease;
}

.select:hover {
    background-color: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .18);
    transform: translateY(-1px);
}

.select:focus {
    border-color: rgba(139, 92, 246, .45);
    box-shadow: var(--focus);
    transform: translateY(-1px);
}

.select:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* dropdown options legibles */
.select option {
    background: var(--bg);
    color: var(--text);
}

/* =========================================================
   ✅ Tables (responsive + sticky header)
   ========================================================= */
.tableWrap {
    width: 100%;
    overflow: auto;
    margin-top: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .03);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    min-width: 820px;
    /* evita tablas “aplastadas” */
}

th,
td {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    vertical-align: top;
    color: rgba(255, 255, 255, .82);
}

@media (prefers-color-scheme: light) {

    th,
    td {
        border-bottom: 1px solid rgba(0, 0, 0, .08);
        color: rgba(0, 0, 0, .78);
    }
}

th {
    color: rgba(255, 255, 255, .92);
    font-weight: 900;
    position: sticky;
    top: 0;
    background: rgba(10, 12, 16, .70);
    backdrop-filter: blur(10px);
    z-index: 2;
}

@media (prefers-color-scheme: light) {
    th {
        background: rgba(255, 255, 255, .85);
        color: rgba(0, 0, 0, .86);
    }
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: rgba(255, 255, 255, .03);
}

@media (prefers-color-scheme: light) {
    tbody tr:hover td {
        background: rgba(0, 0, 0, .03);
    }
}

/* If you can't wrap table in .tableWrap, keep your existing overflow container,
   but this is the best-practice wrapper:
   <div class="tableWrap"><table>...</table></div>
*/

/* =========================================================
   ✅ Tags / Buttons
   ========================================================= */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .05);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    opacity: .96;
}

.tag.ok {
    border-color: rgba(34, 197, 94, .25);
    background: rgba(34, 197, 94, .12);
}

.tag.warn {
    border-color: rgba(245, 158, 11, .25);
    background: rgba(245, 158, 11, .12);
}

.tag.bad {
    border-color: rgba(239, 68, 68, .25);
    background: rgba(239, 68, 68, .12);
}

.btnSm {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.btnSm:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
}

.btnSm:active {
    transform: translateY(0) scale(.99);
}

.btnSm:focus {
    outline: none;
    box-shadow: var(--focus);
    border-color: rgba(139, 92, 246, .45);
}

.btnSmDanger {
    border-color: rgba(239, 68, 68, .25);
    background: rgba(239, 68, 68, .14);
}

.btnSmPrimary {
    border-color: rgba(139, 92, 246, .30);
    background: rgba(139, 92, 246, .16);
}

/* =========================================================
   ✅ Modals (high quality)
   ========================================================= */
.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 18px;
}

.modalOverlay.show {
    display: flex;
}

.modal {
    width: min(980px, calc(100% - 24px));
    max-height: calc(100vh - 48px);

    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(10, 12, 16, .90);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .55);
    overflow: hidden;

    display: flex;
    flex-direction: column;
}

@media (prefers-color-scheme: light) {
    .modal {
        background: rgba(255, 255, 255, .92);
        border-color: rgba(0, 0, 0, .12);
    }
}

.modalHead {
    padding: 14px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    flex: 0 0 auto;
}

@media (prefers-color-scheme: light) {
    .modalHead {
        border-bottom: 1px solid rgba(0, 0, 0, .08);
    }
}

.modalHead strong {
    font-size: 14px;
}

.modalBody {
    padding: 14px;
    flex: 1 1 auto;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modalBody::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

.modalFoot {
    padding: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, .10);
    flex-wrap: wrap;
    flex: 0 0 auto;
}

@media (prefers-color-scheme: light) {
    .modalFoot {
        border-top: 1px solid rgba(0, 0, 0, .08);
    }
}

/* Form grid inside modal */
.modalGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.field label {
    display: block;
    font-size: 12px;
    opacity: .78;
    font-weight: 900;
    margin-bottom: 6px;
    color: var(--muted);
}

/* =========================================================
   ✅ Mini user dropdown (topbar)
   ========================================================= */
.miniUserPill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    font-weight: 900;
    cursor: pointer;
    user-select: none;
    transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.miniUserPill:hover {
    transform: translateY(-1px);
}

.miniUserPill:active {
    transform: translateY(0) scale(.99);
}

.miniUserPill:focus {
    outline: none;
    box-shadow: var(--focus);
    border-color: rgba(139, 92, 246, .45);
}

.miniUserPill img {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .18);
    object-fit: cover;
    background: rgba(255, 255, 255, .06);
}

.miniUserDrop {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(340px, calc(100vw - 24px));
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(10, 12, 16, .88);
    backdrop-filter: blur(12px);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .45);
    padding: 12px;
    display: none;
    z-index: 999;
}

.miniUserDrop.show {
    display: block;
}

@media (prefers-color-scheme: light) {
    .miniUserDrop {
        background: rgba(255, 255, 255, .92);
        border-color: rgba(0, 0, 0, .12);
    }
}

/* KV blocks */
.kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .04);
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
    margin-top: 10px;
}

.kv span {
    opacity: .78;
}

.kv code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11px;
    opacity: .92;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

@media (prefers-color-scheme: light) {
    .kv {
        border-color: rgba(0, 0, 0, .10);
        background: rgba(0, 0, 0, .03);
        color: rgba(0, 0, 0, .78);
    }
}

/* Notices / lock */
.notice {
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, .20);
    background: rgba(245, 158, 11, .10);
    padding: 12px 12px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 12px;
}

.lockScreen {
    display: none;
    margin-top: 14px;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, .18);
    background: rgba(239, 68, 68, .10);
}

.lockScreen h2 {
    margin: 0;
    font-size: 18px;
}

.lockScreen p {
    margin: 8px 0 0;
    opacity: .85;
    font-size: 13px;
}

/* =========================================================
   ✅ Responsive: sidebar becomes bottom-sheet style menu
   (No JS required to look good; with JS you can toggle display)
   ========================================================= */
@media (max-width: 900px) {
    :root {
        --pad: 14px;
    }

    .main {
        padding: 14px;
    }
}

@media (max-width: 680px) {
    .sidebar {
        display: none;
        /* if you later want a toggle: replace with position:fixed + transform */
    }

    .topbar {
        top: 10px;
        border-radius: 16px;
    }
}

/* Optional: prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   ✅ Sidebar Drawer (Mobile)
   - Desktop: sidebar normal
   - Mobile: sidebar off-canvas con overlay + botón
   ========================================================= */

.sbToggle {
    display: none;
    /* visible solo en mobile */
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border, rgba(255, 255, 255, .12));
    background: rgba(255, 255, 255, .06);
    color: var(--text, rgba(255, 255, 255, .92));
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.sbToggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .18);
}

.sbToggle:active {
    transform: translateY(0) scale(.99);
}

.sbToggle:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .16);
    border-color: rgba(139, 92, 246, .45);
}

/* Overlay */
.sbOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(8px);
    z-index: 900;
    /* debajo del sidebar */
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.sbOverlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Body lock cuando drawer abierto */
body.sbOpen {
    overflow: hidden;
}

/* Desktop baseline */
.sidebar {
    z-index: 950;
}

/* Mobile drawer behavior */
@media (max-width: 680px) {
    .sbToggle {
        display: inline-flex;
    }

    /* Sidebar como drawer */
    .sidebar {
        display: block;
        /* NO ocultarlo */
        position: fixed;
        left: 12px;
        top: 12px;
        bottom: 12px;
        height: auto;

        width: min(320px, calc(100vw - 24px));
        border-radius: 18px;
        box-shadow: 0 22px 70px rgba(0, 0, 0, .55);

        transform: translateX(calc(-100% - 16px));
        transition: transform .18s ease;
        will-change: transform;
    }

    body.sbOpen .sidebar {
        transform: translateX(0);
    }

    /* Topbar spacing: evita que se rompa */
    .topbar {
        gap: 10px;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {

    .sidebar,
    .sbOverlay,
    .sbToggle {
        transition: none !important;
    }
}