/* ============================================================
   CUATLVIVE SYSTEM - estilos base (responsive)
   Ambientado a la paleta del sitio web: negro + rojo #EA1119.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   TEMAS: OSCURO (default) + CLARO (data-theme="light")
   El claro usa la paleta oficial del Manual de Identidad CUATLVIVE.
   La barra lateral se mantiene oscura en ambos temas (marca).
   ============================================================ */
:root, :root[data-theme="dark"] {
    /* --- Paleta CUATLVIVE - OSCURO (del sitio web) --- */
    --red: #EA1119;
    --red-bright: #ff2a30;
    --red-deep: #9e0b12;
    --bg: #070708;
    --bg-2: #0d0d10;
    --panel: #14141a;
    --panel-2: #1b1b22;
    --line: #26262e;
    --text: #f6f6f7;
    --muted: #9a9aa2;

    /* superficies que cambian con el tema */
    --field-bg: rgba(255, 255, 255, .04);
    --field-border: rgba(255, 255, 255, .12);
    --field-focus-bg: rgba(255, 255, 255, .06);
    --placeholder: #71717a;
    --chip-bg: rgba(255, 255, 255, .08);
    --chip-tx: #b5b5bd;

    /* barra lateral (oscuro) */
    --side-bg: #0c0c11;
    --side-text: #c9c9d1;
    --side-strong: #ffffff;
    --side-muted: #6b6b74;
    --side-hover: #1b1b22;
    --side-line: rgba(255, 255, 255, .07);
    --side-sublink: #9a9aa6;

    /* --- Alias --- */
    --sc-blue: #EA1119;
    --sc-green: #22c55e;
    --sc-amber: #f59e0b;
    --sc-purple: #a855f7;
    --sc-bg: #070708;
    --sc-text: #f6f6f7;
    --sc-muted: #9a9aa2;
    --sc-border: #26262e;
}

/* La barra lateral es oscura en AMBOS temas (identidad de marca) */
:root {
    --sc-navy: #0c0c11;
    --sc-navy-2: #14141a;
    --sc-navy-hover: #1b1b22;
    --sc-sidebar-w: 256px;
    --rail-w: 76px;
    --sc-font: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Sombra sutil para distinguir el menu claro del contenido */
:root[data-theme="light"] .sc-sidebar { box-shadow: 2px 0 14px rgba(0, 0, 0, .06); }

/* ---------- TEMA CLARO (paleta del Manual) ---------- */
:root[data-theme="light"] {
    --red: #E30613;          /* Rojo Ascent oficial */
    --red-bright: #ff1e2b;
    --red-deep: #b00510;
    --bg: #ECECEE;           /* Concreto / fondo */
    --bg-2: #F6F6F7;         /* topbar / encabezado de tabla */
    --panel: #FFFFFF;        /* tarjetas / paneles */
    --panel-2: #F1F1F3;      /* hover */
    --line: #E1E1E4;         /* bordes (Gris Claro) */
    --text: #1B1B1D;         /* Grafito / texto */
    --muted: #6B6B72;

    --field-bg: #FFFFFF;
    --field-border: #D9D9D9; /* Concreto */
    --field-focus-bg: #FFFFFF;
    --placeholder: #9a9aa2;
    --chip-bg: #ECECEF;
    --chip-tx: #55555C;

    /* barra lateral (claro) - clara pero distinta del contenido */
    --side-bg: #FFFFFF;
    --side-text: #3d3d45;
    --side-strong: #1B1B1D;
    --side-muted: #9a9aa2;
    --side-hover: #F0F0F3;
    --side-line: #E4E4E7;
    --side-sublink: #6B6B72;

    --sc-blue: #E30613;
    --sc-bg: #ECECEE;
    --sc-text: #1B1B1D;
    --sc-muted: #6B6B72;
    --sc-border: #E1E1E4;
}

* { box-sizing: border-box; }

/* ===================== LOGIN (negro + glow rojo) ===================== */
.sc-auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sc-font);
    color: var(--text);
    background:
        radial-gradient(60% 50% at 18% 108%, rgba(234,17,25,.22) 0%, rgba(234,17,25,0) 60%),
        radial-gradient(55% 45% at 88% 0%, rgba(234,17,25,.14) 0%, rgba(234,17,25,0) 60%),
        linear-gradient(180deg, #0a0a0c 0%, #070708 60%, #050506 100%);
    position: relative;
    overflow: hidden;
}
/* Halos rojos difusos de fondo */
.sc-auth-body::before,
.sc-auth-body::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(234,17,25,.18) 0%, rgba(234,17,25,0) 70%);
    filter: blur(20px);
    pointer-events: none;
}
.sc-auth-body::before { width: 520px; height: 520px; bottom: -180px; left: -120px; }
.sc-auth-body::after  { width: 620px; height: 620px; bottom: -240px; right: -160px; }

.sc-auth-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.sc-login-card {
    width: 100%;
    max-width: 380px;
    padding: 2.25rem 2rem 1.75rem;
    text-align: center;
    border-radius: 22px;
    background: rgba(20, 20, 26, .72);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 25px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(234,17,25,.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.sc-login-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
    box-shadow: 0 8px 22px rgba(234, 17, 25, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

.sc-login-title { font-size: 1.6rem; font-weight: 800; color: #fff; margin: 0 0 .4rem; letter-spacing: .01em; }
.sc-login-subtitle { font-size: .88rem; color: var(--muted); line-height: 1.5; margin: 0 0 1.5rem; }

.sc-login-form { text-align: left; }

.sc-login-alert {
    background: rgba(234, 17, 25, .12);
    color: #ff6b6f;
    border: 1px solid rgba(234, 17, 25, .4);
    border-radius: 12px;
    padding: .6rem .8rem;
    font-size: .85rem;
    margin-bottom: .9rem;
}

.sc-field {
    position: relative;
    margin-bottom: .85rem;
}
.sc-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1rem;
}
.sc-input {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    border-radius: 12px;
    padding: 0 44px 0 42px;
    font-size: .92rem;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.sc-input::placeholder { color: #71717a; }
.sc-input:focus {
    outline: none;
    background: rgba(255, 255, 255, .06);
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(234, 17, 25, .25);
}

.sc-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    line-height: 0;
}
.sc-eye:hover { color: var(--text); }

.sc-field-error { display: block; color: var(--red-bright); font-size: .78rem; margin: -.5rem 0 .5rem; }

.sc-forgot { text-align: right; margin: .15rem 0 1.1rem; }
.sc-forgot a { color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none; }
.sc-forgot a:hover { color: var(--red-bright); text-decoration: underline; }

.sc-login-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    background: linear-gradient(180deg, var(--red) 0%, var(--red-deep) 100%);
    box-shadow: 0 12px 26px rgba(234, 17, 25, .4);
    transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
}
.sc-login-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(234, 17, 25, .55); background: linear-gradient(180deg, var(--red-bright) 0%, var(--red) 100%); }
.sc-login-btn:active { transform: translateY(0); }

.sc-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0 1rem;
    color: var(--muted);
    font-size: .78rem;
}
.sc-divider::before,
.sc-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, .1);
}

.sc-social { display: flex; gap: .65rem; }
.sc-social-btn {
    flex: 1;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    border-radius: 12px;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .12s ease, border-color .15s ease;
}
.sc-social-btn:not(:disabled):hover { background: rgba(255, 255, 255, .08); border-color: var(--red); transform: translateY(-1px); }
.sc-social-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===================== APP / SIDEBAR ===================== */
.sc-app-body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sc-font);
}

/* ===== Controles de formulario Bootstrap (tema oscuro) ===== */
.sc-app-body .form-control,
.sc-app-body .form-select {
    background: var(--field-bg);
    border: 1px solid var(--field-border);
    color: var(--text);
}
.sc-app-body .form-control::placeholder { color: var(--placeholder); }
.sc-app-body .form-control:focus,
.sc-app-body .form-select:focus {
    background: var(--field-focus-bg);
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, .22);
    color: var(--text);
}
.sc-app-body .form-select option { background: var(--panel); color: var(--text); }
.sc-app-body .form-label { color: var(--text); font-weight: 600; }
.sc-app-body .form-text, .sc-app-body .text-muted { color: var(--muted) !important; }
.sc-app-body .form-check-input { background-color: var(--field-bg); border-color: var(--field-border); }
.sc-app-body .form-check-input:checked { background-color: var(--red); border-color: var(--red); }
.sc-app-body .input-group-text { background: var(--panel-2); border-color: var(--field-border); color: var(--muted); }
.sc-app-body .dropdown-menu { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.sc-app-body .dropdown-item { color: var(--text); }
.sc-app-body .dropdown-item:hover, .sc-app-body .dropdown-item:focus { background: var(--panel-2); color: var(--text); }
.sc-app-body hr { border-color: var(--line); opacity: 1; }
/* enlaces de texto dentro del contenido (no afecta menu ni tarjetas) */
.sc-content p a, .sc-content .sc-textlink { color: var(--red-bright); }

.sc-layout { display: flex; min-height: 100vh; }

.sc-sidebar {
    width: var(--sc-sidebar-w);
    background: var(--side-bg);
    color: var(--side-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    border-right: 1px solid var(--side-line);
    transition: transform .25s ease, width .2s ease;
}

.sc-sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--side-line);
    white-space: nowrap;
    overflow: hidden;
}
.sc-sidebar-logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--red), var(--red-deep));
    box-shadow: 0 6px 16px rgba(234, 17, 25, .4);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.1rem;
}
.sc-sidebar-title { color: var(--side-strong); font-weight: 800; font-size: 1.1rem; letter-spacing: .02em; white-space: nowrap; }

.sc-nav { flex: 1; padding: .75rem .6rem; overflow-y: auto; overflow-x: hidden; }
.sc-nav-group {
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .1em;
    color: var(--side-muted);
    padding: 1rem .75rem .35rem;
    font-weight: 700;
    white-space: nowrap;
}
.sc-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .75rem;
    border-radius: 9px;
    color: var(--side-text);
    text-decoration: none;
    font-size: .92rem;
    margin-bottom: 2px;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.sc-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.sc-nav-link:hover { background: var(--side-hover); color: var(--side-strong); }
.sc-nav-link.active { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(234,17,25,.35); }
.sc-nav-link.disabled { opacity: .45; pointer-events: none; }

/* ===== Grupos colapsables del menu ===== */
.sc-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .75rem;
    border: none;
    background: none;
    color: var(--side-text);
    font-size: .92rem;
    border-radius: 9px;
    cursor: pointer;
    margin-bottom: 2px;
    text-align: left;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.sc-group-toggle i:first-child { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.sc-group-toggle span { flex: 1; }
.sc-group-toggle:hover { background: var(--side-hover); color: var(--side-strong); }
.sc-group-toggle.open { color: var(--side-strong); }

.sc-chevron {
    font-size: .8rem !important;
    width: auto !important;
    transition: transform .2s ease;
}
.sc-group-toggle.open .sc-chevron { transform: rotate(180deg); }

.sc-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    margin: 0 0 2px .55rem;
    border-left: 1px solid var(--side-line);
    padding-left: .35rem;
}
.sc-submenu.open { max-height: 420px; }

.sc-sublink {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .7rem;
    margin-bottom: 1px;
    border-radius: 8px;
    color: var(--side-sublink);
    text-decoration: none;
    font-size: .86rem;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.sc-sublink i { font-size: .95rem; width: 18px; text-align: center; flex-shrink: 0; }
.sc-sublink:hover { background: var(--side-hover); color: var(--side-strong); }
.sc-sublink.active { color: var(--red); background: rgba(227, 6, 19, .12); font-weight: 600; }

.sc-sidebar-note {
    font-size: .72rem;
    color: var(--side-muted);
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--side-line);
    line-height: 1.4;
}

/* Pie del menu lateral: boton Vaciar sistema (fijo abajo) */
.sc-sidebar-foot {
    margin-top: auto;
    padding: .7rem .8rem;
    border-top: 1px solid var(--side-line);
}
.fz-wipe-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    padding: .62rem .75rem;
    border: 1px solid rgba(234, 17, 25, .55);
    border-radius: 9px;
    background: transparent;
    color: #ff8a8d;
    font-size: .9rem; font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.fz-wipe-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.fz-wipe-btn i { font-size: 1.05rem; }

/* ===== Contenido ===== */
.sc-main {
    flex: 1;
    margin-left: var(--sc-sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left .2s ease;
}

/* ===================== MENU CONTRAIDO (solo iconos) ===================== */
.sc-rail .sc-sidebar { width: var(--rail-w); }
.sc-rail .sc-main { margin-left: var(--rail-w); }
.sc-rail .sc-sidebar .sc-sidebar-title,
.sc-rail .sc-sidebar .sc-nav-group,
.sc-rail .sc-sidebar .sc-nav-link > span,
.sc-rail .sc-sidebar .sc-group-toggle > span,
.sc-rail .sc-sidebar .sc-chevron,
.sc-rail .sc-sidebar .sc-submenu,
.sc-rail .sc-sidebar .sc-sidebar-note,
.sc-rail .sc-sidebar .sc-sidebar-foot { display: none; }
.sc-rail .sc-sidebar .sc-nav-link,
.sc-rail .sc-sidebar .sc-group-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
.sc-rail .sc-sidebar .sc-sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }

/* En escritorio: al pasar el cursor, el riel se expande temporalmente (overlay) */
@media (min-width: 992px) {
    .sc-rail .sc-sidebar:hover { width: var(--sc-sidebar-w); box-shadow: 8px 0 34px rgba(0, 0, 0, .38); }
    .sc-rail .sc-sidebar:hover .sc-sidebar-title,
    .sc-rail .sc-sidebar:hover .sc-nav-group,
    .sc-rail .sc-sidebar:hover .sc-nav-link > span,
    .sc-rail .sc-sidebar:hover .sc-group-toggle > span,
    .sc-rail .sc-sidebar:hover .sc-chevron,
    .sc-rail .sc-sidebar:hover .sc-sidebar-note,
    .sc-rail .sc-sidebar:hover .sc-sidebar-foot { display: block; }
    .sc-rail .sc-sidebar:hover .sc-submenu.open { display: block; }
    .sc-rail .sc-sidebar:hover .sc-nav-link,
    .sc-rail .sc-sidebar:hover .sc-group-toggle { justify-content: flex-start; padding-left: .75rem; padding-right: .75rem; }
    .sc-rail .sc-sidebar:hover .sc-sidebar-brand { justify-content: flex-start; padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* Boton contraer (solo escritorio) */
.sc-collapse {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 9px;
    background: none; border: 1px solid var(--line); color: var(--text);
    cursor: pointer; font-size: 1.05rem;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.sc-collapse:hover { border-color: var(--red); color: var(--red); }
.sc-rail .sc-collapse i { transform: rotate(180deg); }

.sc-topbar {
    height: 62px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.sc-burger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}
.sc-topbar-title { font-weight: 700; font-size: 1.05rem; flex: 1; }

/* Switch de tema claro/oscuro */
.sc-theme-toggle {
    background: var(--field-bg);
    border: 1px solid var(--line);
    color: var(--text);
    width: 40px; height: 40px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; margin-right: .25rem;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .2s ease;
}
.sc-theme-toggle:hover { border-color: var(--red); color: var(--red); }
.sc-theme-toggle:active { transform: rotate(-20deg); }

.sc-user-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
}
.sc-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--red-deep));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
}
.sc-user-info { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.sc-user-name { font-weight: 600; font-size: .85rem; }
.sc-user-role { font-size: .72rem; color: var(--muted); }

.sc-content { padding: 1.5rem; }

/* ===== Tarjetas dashboard ===== */
.sc-welcome h2 { font-weight: 800; font-size: 1.4rem; margin: 0; }
.sc-welcome p { color: var(--muted); margin: .15rem 0 1.25rem; }

/* ===== Dashboard de cards (accesos por pantalla) ===== */
.sc-dash-mod { margin-bottom: 1.5rem; }
.sc-dash-modtitle {
    font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); margin-bottom: .6rem;
}
.sc-dash-card {
    display: flex; align-items: center; gap: .75rem;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: .9rem 1rem; height: 100%; text-decoration: none; color: var(--text);
    transition: box-shadow .15s ease, transform .1s ease, border-color .15s ease, background .15s ease;
}
.sc-dash-card:hover { box-shadow: 0 10px 24px rgba(0,0,0,.4); transform: translateY(-2px); border-color: rgba(234,17,25,.5); background: var(--panel-2); color: var(--text); }
.sc-dash-ic {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: var(--red); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.sc-dash-info { flex: 1; min-width: 0; }
.sc-dash-nom { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.sc-dash-desc { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-dash-arrow { color: #55555f; font-size: .9rem; }

/* contador de registros */
.sc-dash-count { font-weight: 800; font-size: 1.35rem; color: var(--text); min-width: 28px; text-align: right; }

/* globo de notificacion tipo Facebook */
.sc-dash-ic { position: relative; }
.sc-dash-notif {
    position: absolute; top: -7px; right: -7px;
    background: var(--red-bright); color: #fff;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px; border: 2px solid var(--panel);
    font-size: .68rem; font-weight: 700; line-height: 16px; text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,.5);
}

/* colores por modulo (fondo del icono + barra lateral del card) */
.sc-dash-card.mod-op   .sc-dash-ic { background: var(--red); }
.sc-dash-card.mod-alm  .sc-dash-ic { background: #0f766e; }
.sc-dash-card.mod-cat  .sc-dash-ic { background: #7c3aed; }
.sc-dash-card.mod-area .sc-dash-ic { background: #ea580c; }
.sc-dash-card.mod-cfg  .sc-dash-ic { background: #52525b; }
.sc-dash-card.mod-def  .sc-dash-ic { background: var(--red); }
.sc-dash-card.mod-op   { border-left: 4px solid var(--red); }
.sc-dash-card.mod-alm  { border-left: 4px solid #0f766e; }
.sc-dash-card.mod-cat  { border-left: 4px solid #7c3aed; }
.sc-dash-card.mod-area { border-left: 4px solid #ea580c; }
.sc-dash-card.mod-cfg  { border-left: 4px solid #52525b; }

.sc-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}
.sc-card-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.35rem;
    flex-shrink: 0;
}
.sc-bg-blue { background: var(--red); }
.sc-bg-green { background: var(--sc-green); }
.sc-bg-amber { background: var(--sc-amber); }
.sc-bg-purple { background: var(--sc-purple); }
.sc-bg-red { background: var(--red); }
.sc-card-value { font-size: 1.4rem; font-weight: 800; }
.sc-card-label { font-size: .82rem; color: var(--muted); }

.sc-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
}
.sc-panel h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; }

/* ===== Encabezado de pagina ===== */
.sc-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.sc-page-head h2 { font-weight: 800; font-size: 1.4rem; margin: 0; }
.sc-page-head p { color: var(--muted); margin: .15rem 0 0; font-size: .9rem; }

.sc-btn-add {
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .6rem 1.1rem;
    font-weight: 700;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    box-shadow: 0 8px 20px rgba(234,17,25,.3);
    transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
}
.sc-btn-add:hover { background: var(--red-bright); color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px rgba(234,17,25,.45); }

.sc-head-actions { display: flex; align-items: center; gap: .5rem; }
.sc-btn-refresh {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .3s ease;
}
.sc-btn-refresh:hover { background: var(--panel-2); border-color: rgba(234,17,25,.5); }
.sc-btn-refresh:active i { transform: rotate(360deg); }

/* ===== Tabla ===== */
.sc-table { font-size: .88rem; color: var(--text); }
.sc-table thead th {
    background: var(--bg-2);
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--line);
    padding: .75rem .9rem;
    white-space: nowrap;
}
.sc-table tbody td {
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    vertical-align: middle;
}
.sc-table tbody tr:hover { background: var(--panel-2); }

/* ===== Tarjetas de inventario (vista movil) ===== */
.sc-inv-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .7rem .8rem;
    margin-bottom: .6rem;
}
.sc-inv-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.sc-inv-card-id { min-width: 0; }
.sc-inv-card-nom { font-weight: 700; font-size: .92rem; color: var(--text); line-height: 1.2; }
.sc-inv-card-meta { font-size: .72rem; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: .25rem; }
.sc-inv-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .4rem;
    margin-top: .65rem;
}
.sc-inv-cell {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .3rem .25rem;
    text-align: center;
}
.sc-inv-cell .l {
    display: block; font-size: .58rem; text-transform: uppercase; letter-spacing: .02em;
    color: var(--muted); line-height: 1.1;
}
.sc-inv-cell .v { display: block; font-weight: 700; font-size: .82rem; color: var(--text); margin-top: 1px; }
.sc-inv-cell.is-total { background: rgba(234,17,25,.12); border-color: rgba(234,17,25,.35); }
.sc-inv-cell.is-total .v { color: #ff6b6f; }
.sc-inv-cell.is-bajo { background: rgba(234,17,25,.12); border-color: rgba(234,17,25,.35); }
.sc-inv-cell.is-bajo .v { color: #ff6b6f; }

/* Solo 3 columnas en telefonos muy angostos */
@media (max-width: 359.98px) {
    .sc-inv-card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Badges de status ===== */
.sc-badge {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.sc-badge-green { background: rgba(34,197,94,.15); color: #4ade80; border-color: rgba(34,197,94,.3); }
.sc-badge-gray { background: var(--chip-bg); color: var(--chip-tx); border-color: var(--field-border); }
.sc-badge-blue { background: rgba(234,17,25,.15); color: #ff6b6f; border-color: rgba(234,17,25,.3); }
.sc-badge-amber { background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.3); }
.sc-badge-red { background: rgba(234,17,25,.15); color: #ff6b6f; border-color: rgba(234,17,25,.3); }

/* ===================== Boton flotante: Sugerir cambio ===================== */
.fz-fab {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--red);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 8px 22px rgba(234,17,25,.45);
    cursor: pointer;
    z-index: 1045;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, background .15s ease;
}
.fz-fab:hover { background: var(--red-bright); transform: scale(1.08); }
.fz-fab.fz-loading { pointer-events: none; opacity: .7; }
.fz-fab.fz-loading i { animation: fz-spin 1s linear infinite; }
@keyframes fz-spin { to { transform: rotate(360deg); } }

/* ===================== MOVIL: cards colapsables + filtros flotantes ===================== */
.fz-cards-toggle { display: none; }
@media (max-width: 768px) {
    .fz-fab { bottom: 18px; right: 16px; }

    /* Cards colapsables */
    .fz-cards-toggle {
        display: flex; justify-content: space-between; align-items: center;
        background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
        padding: 11px 15px; margin: 4px 0 12px; font-weight: 600; color: var(--text);
        cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3);
    }
    .sc-cards.fz-collapsed { display: none !important; }

    /* FAB de filtros (abajo-izquierda, para no chocar con el de sugerencias) */
    .fz-filter-fab {
        position: fixed; bottom: 18px; left: 16px;
        width: 46px; height: 46px; border-radius: 50%;
        background: var(--panel); color: var(--text); border: 1px solid var(--line);
        box-shadow: 0 4px 14px rgba(0,0,0,.4); font-size: 1.1rem; z-index: 1045;
        display: flex; align-items: center; justify-content: center;
    }

    /* Hoja flotante (bottom sheet) con los filtros */
    .fz-sheet { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1060; display: none; }
    .fz-sheet.open { display: block; }
    .fz-sheet-inner {
        position: absolute; left: 0; right: 0; bottom: 0;
        background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px 16px 0 0;
        padding: 14px; max-height: 82vh; overflow: auto;
        box-shadow: 0 -6px 20px rgba(0,0,0,.5);
    }
    .fz-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
    .fz-sheet-head b { color: var(--text); font-size: 1.05rem; }
    .fz-in-sheet { margin: 0 0 10px 0 !important; }
}

/* ===== Botones de accion en la tabla ===== */
.sc-btn-icon {
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: .95rem;
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease;
    margin-left: .25rem;
}
.sc-btn-icon:hover { filter: brightness(1.15); transform: translateY(-1px); }
.sc-edit { background: rgba(234,17,25,.15); color: #ff6b6f; }
.sc-delete { background: rgba(234,17,25,.18); color: #ff6b6f; }
.sc-ini { background: rgba(34,197,94,.15); color: #4ade80; }
.sc-link { background: rgba(168,85,247,.15); color: #c084fc; }
.sc-lock { background: rgba(255,255,255,.06); color: #6b6b74; cursor: not-allowed; }
.sc-buy { background: rgba(34,197,94,.15); color: #4ade80; }

.sc-buy-info { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; font-size: .9rem; }
.sc-buy-info div { margin-bottom: .15rem; }
.sc-buy-info span { color: var(--muted); }
.sc-buy-total { background: var(--red); color: #fff; border-radius: 10px; padding: .6rem 1rem; text-align: right; font-size: 1.05rem; box-shadow: 0 8px 20px rgba(234,17,25,.3); }

/* Vista previa de foto (evidencia de merma) */
.sc-foto-prev { position: relative; display: inline-block; margin-top: .5rem; }
.sc-foto-prev img { max-height: 150px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.sc-foto-quitar { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); background: var(--red); color: #fff; cursor: pointer; font-size: .75rem; line-height: 1; box-shadow: 0 2px 5px rgba(0,0,0,.5); }

/* ===== Pedidos ===== */
.sc-pedido { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sc-pedido-prov { font-size: 1rem; }
.sc-pedido-meta { font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.sc-pedido-acciones { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sc-pedido-form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.sc-pedido-form input { width: 200px; }
@media (max-width: 575.98px) {
    .sc-pedido-acciones, .sc-pedido-form { width: 100%; }
    .sc-pedido-form input { flex: 1; width: auto; }
}
.sc-key {
    background: rgba(245,158,11,.15); color: #fbbf24;
    width: auto; padding: 0 .75rem; gap: .35rem;
    display: inline-flex; align-items: center;
    font-size: .82rem; font-weight: 600;
}

/* ===== Modal ===== */
.sc-modal { border: none; border-radius: 16px; overflow: hidden; background: var(--panel); color: var(--text); }
.sc-modal .modal-content { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.sc-modal .modal-header { background: var(--sc-navy); color: #fff; border: none; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.sc-modal .modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.sc-modal .modal-title { font-size: 1.05rem; font-weight: 700; }
.sc-modal .modal-body { padding: 1.25rem; }
.sc-modal .modal-footer { border-top: 1px solid var(--line); }
.sc-modal .form-label { font-weight: 600; font-size: .82rem; color: var(--text); margin-bottom: .25rem; }
.sc-modal .form-control, .sc-modal .form-select {
    background: var(--field-bg); border: 1px solid var(--field-border); color: var(--text);
}
.sc-modal .form-control:focus, .sc-modal .form-select:focus {
    background: var(--field-focus-bg); border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,6,19,.22); color: var(--text);
}
.sc-modal .form-control::placeholder { color: var(--placeholder); }

.sc-btn-primary {
    background: var(--red);
    color: #fff;
    font-weight: 700;
    border: none;
}
.sc-btn-primary:hover { background: var(--red-bright); color: #fff; }

/* ===================== PAGINA PUBLICA DE REQUISICION ===================== */
.sc-pub-body {
    margin: 0; min-height: 100vh; background: var(--bg);
    font-family: var(--sc-font); color: var(--text);
}
.sc-pub-wrap { max-width: 760px; margin: 0 auto; padding: 1.25rem; }
.sc-pub-header {
    display: flex; align-items: center; gap: .9rem;
    background: var(--panel); border: 1px solid var(--line); color: #fff;
    border-radius: 16px; padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.sc-pub-logo {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--red), var(--red-deep));
    box-shadow: 0 6px 16px rgba(234,17,25,.4);
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.sc-pub-header h1 { font-size: 1.25rem; font-weight: 800; margin: 0; }
.sc-pub-header p { margin: .1rem 0 0; opacity: .75; font-size: .85rem; }

.sc-pub-error {
    max-width: 420px; margin: 12vh auto 0; text-align: center;
    background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 2.5rem 1.5rem;
}
.sc-pub-error i { font-size: 3rem; color: var(--red); }
.sc-pub-error h3 { font-weight: 800; margin: .75rem 0 .35rem; }
.sc-pub-error p { color: var(--muted); margin: 0; }

/* ===================== AUTOCOMPLETE (proveedor) ===================== */
.sc-autocomplete { position: relative; }
.sc-ac-icon {
    position: absolute; left: 12px; top: 13px;
    color: var(--muted); font-size: .95rem; pointer-events: none; z-index: 2;
}
.sc-ac-input { padding-left: 34px !important; }
.sc-ac-list {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    z-index: 1080;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-top: 4px;
    max-height: 240px; overflow-y: auto;
    box-shadow: 0 10px 24px rgba(0,0,0,.5);
}
.sc-ac-item {
    display: flex; align-items: center; gap: .55rem;
    padding: .55rem .8rem; cursor: pointer; font-size: .88rem;
}
.sc-ac-item:hover { background: var(--panel-2); }
.sc-ac-item i { color: var(--red); }
.sc-ac-item small { color: var(--muted); }
.sc-ac-empty { padding: .6rem .8rem; color: var(--muted); font-size: .85rem; }

.sc-ac-selected {
    display: none; align-items: center; gap: .5rem;
    background: rgba(34,197,94,.14); border: 1px solid rgba(34,197,94,.3); color: #4ade80;
    border-radius: 10px; padding: .55rem .8rem; font-weight: 600; font-size: .9rem;
}
.sc-ac-selected .sc-ac-clear {
    margin-left: auto; background: none; border: none; color: #4ade80;
    cursor: pointer; font-size: .85rem; padding: 2px 6px; border-radius: 6px;
}
.sc-ac-selected .sc-ac-clear:hover { background: rgba(34,197,94,.2); }

/* ===================== ACCESOS ===================== */
.acc-users h3 { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.acc-search {
    position: relative;
    margin-bottom: .75rem;
}
.acc-search i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: .9rem;
}
.acc-search input {
    width: 100%; height: 40px;
    border: 1px solid var(--field-border);
    background: var(--field-bg);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px 0 34px;
    font-size: .88rem;
}
.acc-search input::placeholder { color: var(--placeholder); }
.acc-search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,6,19,.22); background: var(--field-focus-bg); }

.acc-user-list { max-height: 540px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.acc-user {
    display: flex; align-items: center; gap: .6rem;
    width: 100%; text-align: left;
    border: 1px solid transparent; background: none;
    color: var(--text);
    padding: .5rem .6rem; border-radius: 10px; cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.acc-user:hover { background: var(--panel-2); }
.acc-user.active { background: rgba(234,17,25,.14); border-color: rgba(234,17,25,.4); }
.acc-user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .75rem; flex-shrink: 0;
}
.acc-user-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.acc-user-name { font-weight: 600; font-size: .85rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-user-tipo { font-size: .72rem; color: var(--muted); }

.acc-empty {
    text-align: center; color: var(--muted);
    padding: 3rem 1.5rem;
}
.acc-empty i { font-size: 2.5rem; opacity: .4; display: block; margin-bottom: .75rem; }
.acc-empty p { margin: 0; }

.acc-selected-bar {
    width: 100%;
    background: rgba(234,17,25,.12);
    border: 1px solid rgba(234,17,25,.35);
    color: #ff6b6f;
    border-radius: 10px;
    padding: .6rem 1rem;
    font-size: .9rem;
    margin: 0 .5rem 0 .5rem;
}

.acc-box { display: flex; flex-direction: column; height: 100%; }
.acc-box-head {
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: .9rem; margin-bottom: .75rem;
    color: var(--text);
}
.acc-count {
    background: var(--chip-bg); color: var(--chip-tx);
    border-radius: 999px; padding: .1rem .6rem;
    font-size: .75rem; font-weight: 700;
}
.acc-count-green { background: rgba(34,197,94,.15); color: #4ade80; }

.acc-drop {
    min-height: 360px;
    border: 2px dashed var(--line);
    border-radius: 12px;
    padding: .6rem;
    display: flex; flex-direction: column; gap: 6px;
    background: var(--bg-2);
    transition: border-color .15s ease, background .15s ease;
}
.acc-drop-green { border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.06); }
.acc-drop.drag-over { border-color: var(--red); background: rgba(234,17,25,.08); }

.acc-item {
    display: flex; align-items: center; gap: .6rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .55rem .7rem;
    cursor: grab;
    transition: box-shadow .15s ease, transform .1s ease, border-color .15s ease;
}
.acc-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,.4); border-color: rgba(234,17,25,.4); }
.acc-item:active { cursor: grabbing; }
.acc-item-ic { font-size: 1.05rem; color: var(--red); width: 22px; text-align: center; }
.acc-item-text { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.acc-item-name { font-weight: 600; font-size: .85rem; color: var(--text); }
.acc-item-mod { font-size: .72rem; color: var(--muted); }
.acc-act {
    border: none; width: 30px; height: 30px; border-radius: 8px;
    font-size: .85rem; cursor: pointer; flex-shrink: 0;
    transition: filter .15s ease;
}
.acc-act:hover { filter: brightness(1.15); }
.acc-add { background: rgba(34,197,94,.15); color: #4ade80; }
.acc-rem { background: rgba(234,17,25,.18); color: #ff6b6f; }

/* ===== Overlay movil ===== */
.sc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 1035;
}
.sc-overlay.show { display: block; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 991.98px) {
    .sc-sidebar { transform: translateX(-100%); }
    .sc-sidebar.open { transform: translateX(0); }
    .sc-main { margin-left: 0; }
    .sc-burger { display: inline-flex; }
    /* En movil el menu es off-canvas: el modo riel no aplica */
    .sc-rail .sc-sidebar { width: var(--sc-sidebar-w); }
    .sc-rail .sc-main { margin-left: 0; }
    .sc-rail .sc-sidebar .sc-nav-link > span,
    .sc-rail .sc-sidebar .sc-group-toggle > span,
    .sc-rail .sc-sidebar .sc-sidebar-title,
    .sc-rail .sc-sidebar .sc-nav-group,
    .sc-rail .sc-sidebar .sc-chevron { display: inline; }
    .sc-rail .sc-sidebar .sc-nav-link,
    .sc-rail .sc-sidebar .sc-group-toggle { justify-content: flex-start; padding-left: .75rem; padding-right: .75rem; }
    .sc-collapse { display: none; }
}

/* Tablet: tablas y paneles mas compactos */
@media (max-width: 767.98px) {
    .sc-table { font-size: .82rem; }
    .sc-table thead th { padding: .55rem .6rem; }
    .sc-table tbody td { padding: .55rem .6rem; }
    .sc-panel { padding: 1rem; }
    .sc-card { padding: .9rem 1rem; gap: .75rem; }
    .sc-card-icon { width: 42px; height: 42px; font-size: 1.15rem; }
    .sc-card-value { font-size: 1.2rem; }
}

/* Telefono */
@media (max-width: 575.98px) {
    .sc-user-info { display: none; }
    .sc-content { padding: 1rem; }
    .sc-topbar { padding: 0 .9rem; }

    /* Encabezado de pagina: apila titulo y boton */
    .sc-page-head { align-items: flex-start; }
    .sc-page-head .sc-btn-add,
    .sc-page-head .sc-head-actions { width: 100%; justify-content: center; }
    .sc-head-actions { display: flex; }

    /* Tablas aun mas compactas para aprovechar el scroll horizontal */
    .sc-table { font-size: .78rem; }
    .sc-table thead th { padding: .5rem .5rem; font-size: .66rem; }
    .sc-table tbody td { padding: .5rem .5rem; }
    .sc-btn-icon { width: 30px; height: 30px; font-size: .85rem; }

    /* Modales a pantalla completa de ancho */
    .modal-dialog { margin: .5rem; }

    /* Titulos un poco menores */
    .sc-page-head h2, .sc-welcome h2 { font-size: 1.2rem; }
}

/* ===== Tabla -> tarjetas en movil (generico, clase .sc-stack) =====
   Cada <tr> se vuelve una tarjeta y cada <td> una linea "Etiqueta: valor"
   tomando la etiqueta de su atributo data-label. No requiere JS. */
@media (max-width: 767.98px) {
    table.sc-stack thead { display: none; }
    table.sc-stack, table.sc-stack tbody { display: block; width: 100%; }
    table.sc-stack tr {
        display: block;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: .35rem .8rem;
        margin-bottom: .6rem;
    }
    table.sc-stack tbody tr:hover { background: var(--panel); }
    table.sc-stack td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .4rem 0;
        border: none;
        border-bottom: 1px solid var(--line);
        text-align: right;
        white-space: normal;
        min-height: 0;
    }
    table.sc-stack td:last-child { border-bottom: none; }
    table.sc-stack td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: .7rem;
        text-transform: uppercase;
        letter-spacing: .02em;
        color: var(--muted);
        text-align: left;
        flex-shrink: 0;
    }
    /* Celdas sin etiqueta (acciones): pega el contenido a la derecha */
    table.sc-stack td:not([data-label]) { justify-content: flex-end; }
    table.sc-stack td:not([data-label])::before { content: none; }
    /* Botones de accion comodos en la tarjeta */
    table.sc-stack td .sc-btn-icon:first-child { margin-left: 0; }
}
