/* ═══════════════════════════════════════════════════════════════════════════
   WAYCARD ADMIN · rediseño "sala de control"
   Identidad: sidebar tinta-violeta (como las tarjetas físicas) + firma de
   marca: el degradado magenta→violeta de la Waycard como rail/filo vivo.
   Compatibilidad: se conservan TODOS los selectores del CSS anterior.
   ═══════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* tokens heredados (usados por estilos inline de las páginas) */
    --bg:          #F3F2F9;   /* lienzo frío con tinte violeta */
    --surface:     #FFFFFF;
    --border:      #E7E4F2;
    --text:        #1B1726;
    --text-light:  #6E6787;
    --primary:     #7C3AED;
    --primary-dark:#6D28D9;
    --success:     #10B981;
    --warning:     #F59E0B;
    --danger:      #EF4444;
    /* tokens nuevos */
    --ink:         #16121F;   /* tinta violeta-negra (sidebar) */
    --ink-2:       #221B33;
    --magenta:     #E14CEB;
    --grad:        linear-gradient(135deg, #E14CEB 0%, #7C3AED 100%);
    --font-ui:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-disp:   'Sora', 'Inter', sans-serif;
    --shadow-1:    0 1px 2px rgba(22,18,31,.05), 0 4px 16px rgba(22,18,31,.05);
    --shadow-2:    0 2px 6px rgba(22,18,31,.07), 0 12px 32px rgba(22,18,31,.08);
    --radius:      14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(124,58,237,.18); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ════════════ LOGIN ════════════ */
.login-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(680px 420px at 15% 0%,  rgba(225,76,235,.16), transparent 60%),
        radial-gradient(720px 480px at 85% 100%, rgba(124,58,237,.20), transparent 60%),
        var(--ink);
    padding: 24px;
}
.login-card {
    background: var(--surface);
    border-radius: 22px;
    padding: 42px 38px;
    width: 100%; max-width: 400px;
    box-shadow: 0 24px 80px rgba(0,0,0,.45);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: var(--grad);
}
.login-logo { font-size: 40px; margin-bottom: 10px; }
.login-card h1 {
    font-family: var(--font-disp); font-size: 23px; font-weight: 800;
    letter-spacing: -.02em; margin-bottom: 4px;
}
.login-card .subtitle { color: var(--text-light); font-size: 13.5px; margin-bottom: 26px; }

/* ════════════ TOPBAR (legado) ════════════ */
.topbar { background: var(--ink); border-bottom: 1px solid rgba(255,255,255,.06); }
.topbar-inner {
    max-width: none; margin: 0; padding: 12px 24px;
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { font-family: var(--font-disp); font-weight: 800; color: #fff; font-size: 17px; }
.brand-sub { font-size: 12px; color: rgba(255,255,255,.55); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a {
    padding: 8px 14px; border-radius: 9px; text-decoration: none;
    color: rgba(255,255,255,.75); font-size: 14px; font-weight: 500;
    transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: var(--grad); color: #fff; }
.nav a.logout { color: #FCA5A5; }

/* ════════════ LIENZO ════════════ */
.container { max-width: none; margin: 0; padding: 30px 34px 56px; }
.page-title {
    font-family: var(--font-disp);
    font-size: 25px; font-weight: 800; letter-spacing: -.02em;
    margin-bottom: 22px;
    position: relative;
    padding-bottom: 12px;
}
.page-title::after {           /* firma: subrayado degradado de marca */
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 56px; height: 4px; border-radius: 4px;
    background: var(--grad);
}

/* ════════════ STATS ════════════ */
.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
/* En monitores anchos las secciones de stats no se estiran hasta lo absurdo */
@media (min-width: 1700px) {
    .stats, .stat-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); }
}
.stats .stat-card, .stat-grid .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-1);
    position: relative;
    overflow: hidden;
}
.stats .stat-card::before, .stat-grid .stat-card::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--grad); opacity: .9;
}
.stat-card.green::before,  .stat-total::before      { background: var(--text) !important; }
.stat-disponible::before  { background: var(--success) !important; }
.stat-grabada::before     { background: var(--grad) !important; }
.stat-bloqueada::before   { background: var(--danger) !important; }
.stat-card.green::before  { background: var(--success) !important; }
.stat-card.blue::before   { background: #0EA5E9 !important; }
.stat-card.amber::before  { background: var(--warning) !important; }
.stat-card.violet::before { background: var(--grad) !important; }
.stat-label {
    font-size: 11.5px; font-weight: 700; color: var(--text-light);
    text-transform: uppercase; letter-spacing: .06em;
    display: flex; align-items: center; gap: 7px;
}
.stat-value {
    font-family: var(--font-disp);
    font-size: 27px; font-weight: 800; letter-spacing: -.02em;
    margin-top: 8px; line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 12.5px; color: var(--text-light); margin-top: 7px; }

/* ════════════ FILTROS ════════════ */
.filters { margin-bottom: 16px; }
.filter-form {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-1);
}
.filter-form select,
.filter-form input[type="text"] {
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px; font-family: inherit;
    background: #FBFAFE;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.filter-form select:focus,
.filter-form input[type="text"]:focus {
    outline: none; background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,.14);
}
.filter-form input[type="text"] { flex: 1; min-width: 200px; }
.link-clear {
    color: var(--text-light); font-size: 13.5px; text-decoration: none;
    font-weight: 500; padding: 6px 4px;
}
.link-clear:hover { color: var(--primary); }

/* ════════════ TABLA ════════════ */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
    box-shadow: var(--shadow-1);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    position: sticky; top: 0; z-index: 1;
    background: #FBFAFE;
    text-align: left;
    font-size: 11.5px; font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase; letter-spacing: .06em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #F1EFF8;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;          /* simetría: cada fila, una línea */
}
/* Fila de acciones: controles alineados en una sola línea, misma altura */
.row-actions {
    display: inline-flex; align-items: center; gap: 8px;
    white-space: nowrap;
}
/* Botones dentro de tablas: compactos y de ANCHO FIJO — cada botón forma
   una columna vertical perfecta aunque el texto cambie por fila
   (Suspender/Activar miden lo mismo, y Borrar nunca se desplaza). */
.table .btn-inline {
    padding: 8px 10px; font-size: 13px; border-radius: 9px;
    min-width: 100px;
    justify-content: center;
}
.table select {
    vertical-align: middle;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #F8F6FD; }
.table tbody tr:last-child td { border-bottom: none; }
.table .uid {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 13px; letter-spacing: .02em;
}
/* Chip violeta SOLO en elementos inline (code/span), nunca en la celda entera */
.table code.uid, .table span.uid {
    background: #F4F1FB; border-radius: 6px; padding: 3px 8px;
}
/* Celdas uid largas (emails, wallets): una línea con elipsis, hover = title */
.table td.uid {
    max-width: 260px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-light);
}
.table .empty { text-align: center; color: var(--text-light); padding: 34px 14px; }
.actions-col { white-space: nowrap; }

/* ════════════ BADGES ════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 700; letter-spacing: .01em;
    white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-disponible { background: rgba(16,185,129,.12); color: #047857; }
.badge-grabada    { background: rgba(124,58,237,.12); color: var(--primary-dark); }
.badge-bloqueada  { background: rgba(239,68,68,.12);  color: #B91C1C; }

/* ════════════ BOTONES ════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px;
    border: none; border-radius: 11px;
    font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; text-decoration: none;
    transition: transform .12s, box-shadow .15s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
    background: var(--grad); color: #fff;
    box-shadow: 0 6px 18px rgba(124,58,237,.30);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(124,58,237,.40); }
.btn-secondary {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}
.btn-secondary:hover { border-color: #CFC7E8; background: #FBFAFE; }
/* Peligro (Borrar/Eliminar): misma anatomía que secondary — MISMA altura,
   mismo borde de 1px — para que la fila de botones quede perfectamente
   alineada; el color avisa, la geometría no baila. */
.btn-danger {
    background: var(--surface); color: #B91C1C;
    border: 1px solid #FCA5A5;
    box-shadow: var(--shadow-1);
}
.btn-danger:hover { background: #FEF2F2; border-color: #F87171; }
/* Fantasma (acciones discretas): también con borde para conservar la altura */
.btn-ghost {
    background: transparent; color: var(--text-light);
    border: 1px solid transparent;
}
.btn-ghost:hover { background: rgba(27,23,38,.05); color: var(--text); }
/* Variantes de confirmación usadas en algunos modales */
.btn-confirm {
    background: var(--success); color: #fff;
    border: 1px solid var(--success);
    box-shadow: 0 4px 14px rgba(16,185,129,.30);
}
.btn-confirm:hover { filter: brightness(1.05); }
.btn-cancel, .btn-nota {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}
.btn-cancel:hover, .btn-nota:hover { background: #FBFAFE; }
.btn-icon {
    background: none; border: 1px solid transparent; cursor: pointer;
    font-size: 18px; padding: 7px 10px; border-radius: 9px;
    transition: background .12s;
}
.btn-icon:hover { background: rgba(124,58,237,.08); }
.btn-inline { width: auto; margin: 0; }

/* ════════════ FORMULARIOS ════════════ */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    max-width: 620px;
    box-shadow: var(--shadow-1);
}
.field { margin-bottom: 18px; }
.field label {
    display: block; font-size: 13px; font-weight: 600;
    margin-bottom: 7px; color: var(--text);
}
/* Aspecto de los controles: aplica a TODOS los inputs dentro de un campo */
.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea, .field select {
    padding: 11px 13px;
    border: 1px solid var(--border); border-radius: 10px;
    font-size: 14px; font-family: inherit;
    background: #FBFAFE;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
/* Ancho completo: SOLO los hijos directos del campo. Las maquetaciones
   propias anidadas (filas de componentes, cascadas de comisión, etc.)
   conservan sus anchos locales sin que esta regla los machaque. */
.field > input:not([type="checkbox"]):not([type="radio"]),
.field > textarea, .field > select {
    width: 100%;
}
/* Checkboxes: grandes, violeta, PEGADOS a su etiqueta (nunca a ancho completo) */
.field input[type="checkbox"], .field input[type="radio"] {
    width: 22px; height: 22px;
    accent-color: var(--primary);
    cursor: pointer; flex-shrink: 0;
}
.field label:has(input[type="checkbox"]),
.field label:has(input[type="radio"]) {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 14.5px; font-weight: 600; cursor: pointer;
    padding: 6px 0; margin-bottom: 0;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,.14);
}
.field textarea { resize: vertical; min-height: 130px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.field small { display: block; margin-top: 6px; color: var(--text-light); font-size: 12.5px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ════════════ ALERTAS ════════════ */
.alert { border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.alert ul { margin-top: 8px; padding-left: 20px; }
.alert li { margin-bottom: 4px; }
.alert-success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.alert-error   { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.alert code    { background: rgba(0,0,0,.06); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; }

.info-box {
    background: linear-gradient(135deg, rgba(225,76,235,.05), rgba(124,58,237,.07));
    border: 1px solid rgba(124,58,237,.18);
    border-radius: var(--radius);
    padding: 16px 18px; margin-bottom: 20px; font-size: 14px;
}
.info-box strong { display: block; margin-bottom: 8px; }
.info-box ol { padding-left: 22px; }
.info-box ol li { margin-bottom: 6px; }
.info-box code { background: rgba(124,58,237,.10); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; }

/* ════════════ PAGINACIÓN ════════════ */
.pagination {
    margin-top: 20px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 14px; flex-wrap: wrap; font-size: 14px;
}
.page-info { color: var(--text-light); white-space: nowrap; }
.page-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-btn {
    min-width: 40px; height: 40px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface); color: var(--text);
    text-decoration: none; font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-1);
    transition: background .15s, border-color .15s, transform .12s;
}
.page-btn:hover { background: #FBFAFE; border-color: #CFC7E8; }
.page-btn:active { transform: scale(.96); }
.page-btn.current { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,.35); }
.page-btn.disabled { opacity: .35; pointer-events: none; }
.page-dots { color: var(--text-light); padding: 0 2px; }
.page-size { display: inline-flex; align-items: center; gap: 8px; color: var(--text-light); font-size: 13px; white-space: nowrap; }
.page-size select {
    padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ════════════ ESQUELETO (sidebar + contenido) ════════════ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 254px; flex-shrink: 0;
    background: var(--ink);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.14) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo {                 /* firma: mini-tarjeta con el degradado Waycard */
    width: 40px; height: 28px; flex-shrink: 0;
    background: var(--grad);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-disp); font-weight: 800; font-size: 15px; color: #fff;
    box-shadow: 0 4px 14px rgba(225,76,235,.35);
}
.sidebar-title { font-family: var(--font-disp); font-weight: 800; color: #fff; font-size: 16px; letter-spacing: -.01em; }
.sidebar-sub { font-size: 11.5px; color: rgba(255,255,255,.45); }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 10px 12px; }
.main-content { flex: 1; min-width: 0; }

/* ════════════ TOPBAR MÓVIL + DRAWER ════════════ */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 900px) {
    .mobile-topbar {
        display: flex; align-items: center; gap: 12px;
        position: fixed; top: 0; left: 0; right: 0; height: 56px;
        background: var(--ink);
        padding: 0 12px; z-index: 900;
        box-shadow: 0 2px 12px rgba(0,0,0,.25);
    }
    .menu-toggle {
        width: 44px; height: 44px; border: none; background: none;
        font-size: 22px; cursor: pointer; border-radius: 10px; color: #fff;
    }
    .menu-toggle:active { background: rgba(255,255,255,.1); }
    .mobile-topbar-title {
        font-family: var(--font-disp); font-weight: 800; font-size: 16px; flex: 1;
        background: var(--grad);
        -webkit-background-clip: text; background-clip: text;
        color: transparent;
    }
    .mobile-topbar-logout {
        width: 44px; height: 44px;
        display: flex; align-items: center; justify-content: center;
        font-size: 20px; text-decoration: none; border-radius: 10px;
    }

    .app-shell { display: block; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; height: 100%;
        width: 280px; max-width: 85vw; z-index: 1100;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 8px 0 40px rgba(0,0,0,.45);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay {
        display: block; position: fixed; inset: 0;
        background: rgba(10,8,16,.55);
        z-index: 1050; opacity: 0; pointer-events: none;
        transition: opacity .25s;
        backdrop-filter: blur(2px);
    }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    body.sidebar-open { overflow: hidden; }
    .main-content { padding-top: 56px; }
    .container { padding: 16px 14px 40px; }
}

/* ════════════ RESPONSIVE GENERAL (móvil) ════════════ */
@media (max-width: 900px) {
    input[type="text"], input[type="password"], input[type="number"],
    input[type="email"], select, textarea { font-size: 16px !important; }

    .stats, .stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .stats .stat-card, .stat-grid .stat-card { padding: 14px; }
    .stat-value { font-size: 21px; }

    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-form select, .filter-form input[type="text"], .filter-form .btn { width: 100%; min-width: 0; }
    .link-clear { text-align: center; }

    .table-wrap { -webkit-overflow-scrolling: touch; }
    .table th, .table td { padding: 10px 10px; font-size: 13px; white-space: nowrap; }
    .btn-icon { font-size: 20px; padding: 8px 10px; min-width: 42px; min-height: 42px; }

    .form-card { padding: 18px 14px; max-width: 100%; }
    .panel-card { padding: 16px 14px; }
    .device-grid { grid-template-columns: 1fr !important; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
    .add-wallet-row input[type="text"] { min-width: 0; }

    .pagination { justify-content: center; }
    .page-info { width: 100%; text-align: center; order: 3; }
    .btn { padding: 12px 18px; }
    .seg { padding: 11px 0; }
}
@media (max-width: 400px) {
    .stats, .stat-grid { grid-template-columns: 1fr 1fr !important; }
    .page-btn { min-width: 36px; height: 38px; padding: 0 9px; }
}

/* ════════════ PANELES ════════════ */
.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-1);
    margin-bottom: 18px;
}
.panel-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.panel-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.panel-title { font-family: var(--font-disp); font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.panel-desc { font-size: 13px; color: var(--text-light); margin: 0; max-width: 560px; }
.panel-desc code { background: #F4F1FB; border-radius: 5px; padding: 1px 6px; font-size: 12px; }

/* ════════════ DEVICE GRID / SEGMENTED ════════════ */
.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.device-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-1);
}
.device-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.device-name { font-family: var(--font-disp); font-weight: 700; font-size: 15px; }
.segmented {
    display: flex; background: #F1EEF9; border-radius: 11px; padding: 4px; gap: 4px;
}
.seg {
    flex: 1; text-align: center; padding: 9px 0;
    border: none; background: none; cursor: pointer;
    border-radius: 8px; font-size: 13.5px; font-weight: 600; font-family: inherit;
    color: var(--text-light);
    transition: background .15s, color .15s, box-shadow .15s;
}
.seg:hover { color: var(--text); }
.seg.active.seg-ok   { background: var(--success); color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,.35); }
.seg.active.seg-warn { background: var(--warning); color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,.35); }
.seg.active.seg-off  { background: var(--danger);  color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,.35); }

/* ════════════ PILLS ════════════ */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
    white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok    { background: rgba(16,185,129,.12); color: #047857; }
.pill-warn  { background: rgba(245,158,11,.14); color: #92400E; }
.pill-off   { background: rgba(239,68,68,.12);  color: #B91C1C; }
.pill-muted { background: rgba(27,23,38,.06);   color: var(--text-light); }

/* ════════════ SWITCH ════════════ */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; inset: 0; background: #D8D3E8;
    border-radius: 26px; cursor: pointer; transition: background .2s;
}
.slider::before {
    content: ''; position: absolute; width: 20px; height: 20px;
    left: 3px; top: 3px; background: #fff; border-radius: 50%;
    transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.sel-estado {
    padding: 8px 11px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 13.5px; font-family: inherit; background: #FBFAFE; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.sel-estado:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.14); }
.sel-estado:disabled { opacity: .45; cursor: not-allowed; }

/* ════════════ TOAST ════════════ */
.toast {
    position: fixed; left: 50%; bottom: 28px;
    transform: translateX(-50%) translateY(16px);
    color: #fff; font-size: 14px; font-weight: 600;
    padding: 13px 22px; border-radius: 12px;
    opacity: 0; pointer-events: none; z-index: 2000;
    transition: opacity .25s, transform .25s;
    box-shadow: 0 12px 40px rgba(0,0,0,.30);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok  { background: #059669; }
.toast-err { background: #DC2626; }

/* Tablas con estilos propios (marcas, versiones, whitelist) → scroll en móvil */
@media (max-width: 900px) {
    .mk-table, .vc-table, .wl-table {
        display: block; overflow-x: auto;
        -webkit-overflow-scrolling: touch; white-space: nowrap;
    }
    .mk-wrap { max-width: 100%; }
}

/* Accesibilidad: sin animaciones si el sistema lo pide */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
