/* ==========================================================================
   1. VARIABLES GLOBALES (Paleta Persycom)
   ========================================================================== */
:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --muted: #6b7280;
    --text: #1f2937;
    --line: #e5e7eb;
    --soft: #f3f4f6;
    --soft-2: #f9fafb;
    --persycom-red: #e32b36;
    --persycom-dark: #c1222c;
    --accent: var(--persycom-red);
    --accent-2: var(--persycom-dark);
    --ok: #166534;
    --danger: #dc2626;
    --shadow: 0 2px 4px rgba(0,0,0,.04);
    --radius: 10px;
}

/* ==========================================================================
   2. RESET Y TIPOGRAFÍA BASE
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ==========================================================================
   3. LAYOUT PRINCIPAL
   ========================================================================== */
.layout-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 24px;
}

.layout {
    display: grid;
    grid-template-columns: 1.6fr .9fr;
    gap: 18px;
}

.grid-2 {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, 1fr);
}

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

/* ==========================================================================
   4. TOPBAR (Menú de navegación)
   ========================================================================== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 12px 22px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 10px 30px -18px rgba(15,23,42,.18);
}
/* Filo de marca que sangra desde el borde superior */
.topbar::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #e32b36 30%, #c1222c 70%, transparent 100%);
    pointer-events: none;
}

.brand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .brand-container img {
        height: 38px;
        object-fit: contain;
        margin-bottom: 4px;
    }

.topbar small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   5. PANTALLAS DE AUTENTICACIÓN (Login / Registro)
   ========================================================================== */
.auth-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 85vh;
    background: var(--bg);
    padding: 20px;
}

.auth-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

    .auth-panel label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 8px;
        color: #4b5563;
    }

.auth-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

    .auth-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(227, 43, 54, 0.1);
    }

.auth-btn {
    width: 100%;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #e32b36 0%, #c1222c 100%);
    color: white;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18), 0 4px 12px -4px rgba(227,43,54,.40);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

    .auth-btn:hover {
        transform: translateY(-1px);
        filter: brightness(1.04);
        box-shadow: 0 2px 4px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18), 0 10px 22px -6px rgba(227,43,54,.50);
    }

/* ==========================================================================
   6. BOTONES GLOBALES
   ========================================================================== */
.btn {
    --bg: #fff;
    --fg: var(--text);
    --bd: var(--line);
    --sh: 0 1px 2px rgba(15,23,42,.06);
    --sh-h: 0 4px 10px -4px rgba(15,23,42,.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--bd);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    box-shadow: var(--sh);
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
    text-decoration: none;
    white-space: nowrap;
}

    .btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: var(--sh-h);
    }

    .btn:active:not(:disabled) {
        transform: translateY(0);
    }

    /* Deshabilitado: versión tenue, sin sombra fuerte y sin elevación */
    .btn:disabled, .btn[disabled] {
        cursor: not-allowed;
        box-shadow: none;
    }
    /* primary deshabilitado: rosa tenue pero con texto ROJO legible (no gris) */
    .btn.primary:disabled, .btn.primary[disabled] {
        background: linear-gradient(180deg, #fde9ea 0%, #fbd5d8 100%);
        color: #c1222c;
        border-color: rgba(227,43,54,.22);
    }
    /* resto deshabilitado: gris muy suave con texto legible */
    .btn:not(.primary):disabled, .btn:not(.primary)[disabled] {
        background: var(--soft-2);
        color: var(--muted);
    }

    /* default y ghost comparten el hover gris suave; primary conserva su degradado */
    .btn:not(.primary):hover:not(:disabled) {
        background: var(--soft);
        color: var(--text);
    }

    .btn.primary {
        --bg: linear-gradient(180deg, #e32b36 0%, #c1222c 100%);
        --fg: #fff;
        --bd: transparent;
        --sh: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18), 0 4px 12px -4px rgba(227,43,54,.40);
        --sh-h: 0 2px 4px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18), 0 10px 22px -6px rgba(227,43,54,.50);
    }

    .btn.ghost {
        --bg: transparent;
        --bd: transparent;
        --sh: none;
        color: var(--muted);
    }

/* ==========================================================================
   7. PANELES Y TARJETAS (Presupuestador)
   ========================================================================== */
.panel {
    position: relative;
    /* Lavado de marca muy tenue arriba-izquierda (capa de fondo: queda bajo todo
       el contenido y se recorta solo con el radio del panel) */
    background: radial-gradient(120% 100% at 0% 0%, rgba(254,242,242,.6) 0%, transparent 60%) left top / 100% 88px no-repeat, #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 16px 32px -20px rgba(15,23,42,.22);
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

    .panel-header h2, .panel-header h3 {
        margin: 0;
        font-size: 18px;
        color: var(--text);
    }

.panel-body {
    padding: 20px;
}

.muted {
    color: var(--muted);
}

/* Importador de ficheros (dropzone moderna) */
.choice {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border: none;
    border-radius: 14px;
    background: radial-gradient(120% 80% at 0% 0%, rgba(254,242,242,.65) 0%, transparent 55%), #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 14px 28px -20px rgba(15,23,42,.25);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
/* Borde discontinuo dibujado con máscara para respetar el radio */
.choice::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1.5px;
    background: repeating-linear-gradient(135deg, #d1d5db 0, #d1d5db 8px, transparent 8px, transparent 14px);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background .2s ease;
}

    .choice:hover {
        transform: translateY(-1px);
        background: radial-gradient(120% 80% at 0% 0%, rgba(254,226,226,.85) 0%, transparent 55%), #fff;
        box-shadow: 0 1px 2px rgba(227,43,54,.06), 0 18px 32px -20px rgba(227,43,54,.32);
    }

    .choice:hover::before {
        background: repeating-linear-gradient(135deg, #e32b36 0, #e32b36 8px, transparent 8px, transparent 14px);
        animation: marching 12s linear infinite;
    }

@keyframes marching {
    to { background-position: 200px 0; }
}

.choice-text h3 {
    margin: 0 0 6px 0;
}

/* Lenguaje Natural (IA) */
.nl-box {
    border: 1px solid var(--line);
    background: #fbfbfb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
}

    .nl-box textarea {
        width: 100%;
        min-height: 92px;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 12px;
        margin-top: 10px;
        resize: vertical;
        font: inherit;
        background: white;
    }

        .nl-box textarea:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(227, 43, 54, 0.1);
        }

.nl-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Secciones del formulario */
.section {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 18px;
    overflow: hidden;
    background: var(--panel);
}

.section-title {
    padding: 14px 18px;
    background: var(--soft-2);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

    .section-title h3 {
        margin: 0;
        font-size: 15px;
    }

.section-body {
    padding: 18px;
}

/* ==========================================================================
   8. FORMULARIOS GLOBALES (Inputs, Selects, Checkboxes)
   ========================================================================== */
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4b5563;
}

input[type="text"], input[type="date"], input[type="number"], select, input:not([type]) {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font: inherit;
    color: var(--text);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

    input:focus, select:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(227, 43, 54, 0.1);
    }

/* Chips (Toggles) */
.toggle-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    transition: all 0.15s ease;
}

    .chip:hover {
        border-color: #d1d5db;
        transform: translateY(-1px);
    }

    .chip.active {
        background: linear-gradient(180deg, #e32b36 0%, #c1222c 100%);
        border-color: transparent;
        color: white;
        box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18), 0 4px 10px -4px rgba(227,43,54,.40);
    }

        .chip.active:hover {
            filter: brightness(1.05);
            transform: translateY(-1px);
        }

/* Resumen final */
.summary {
    background: #fef2f2;
    border: 1px solid rgba(227, 43, 54, 0.2);
    border-radius: 12px;
    padding: 16px;
    line-height: 1.6;
    color: #7f1d1d;
}

    .summary strong {
        display: block;
        margin-bottom: 8px;
        color: var(--accent-2);
    }

/* ==========================================================================
   9. CARRITO Y ASIDE
   ========================================================================== */
.aside-stack {
    display: grid;
    gap: 18px;
    align-content: start;
    position: sticky;
    top: 90px;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 14px 12px;
    background: #fff;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 22px -18px rgba(15,23,42,.20);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    .stat:hover {
        transform: translateY(-1px);
        border-color: #d1d5db;
        box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 16px 28px -18px rgba(15,23,42,.28);
    }

    /* Brillo de esquina tintado al color de marca */
    .stat::after {
        content: "";
        position: absolute;
        right: -40px; top: -40px;
        width: 90px; height: 90px;
        border-radius: 50%;
        background: radial-gradient(closest-side, var(--glow, #e32b36) 0%, transparent 70%);
        opacity: .10;
        pointer-events: none;
        z-index: 0;
    }

    .stat .n {
        position: relative;
        z-index: 1;
        font-size: 24px;
        font-weight: 700;
        color: var(--accent);
        line-height: 1;
        letter-spacing: -.02em;
    }

    .stat .l {
        position: relative;
        z-index: 1;
        font-size: 12px;
        color: var(--muted);
        margin-top: 4px;
        font-weight: 500;
    }

/* ---- Cuerpo de tarjeta de línea (carrito y pedido admin) ---- */
.cart-item-body { font-size: 12px; line-height: 1.8; }
.cart-item-body .det { display: block; }
.cart-item-body .det strong { font-weight: 700; }

.cart-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

    .cart-item:hover {
        border-color: #d1d5db;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }

.cart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.cart-title {
    font-weight: 700;
    font-size: 14px;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    padding: 4px 10px;
    background: #e5e7eb;
    color: #374151;
}

.cart-desc {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 12px;
}

.mini-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .mini-actions button {
        border: 1px solid var(--line);
        background: var(--soft-2);
        border-radius: 6px;
        padding: 6px 12px;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        color: var(--text);
    }

        .mini-actions button:hover {
            background: #e5e7eb;
        }

/* Bloque Posponer Pedido */
.postpone-box {
    border: 1px solid var(--line);
    background: var(--soft-2);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

    .postpone-box label {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 0;
        cursor: pointer;
    }

    .postpone-box input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--accent);
        cursor: pointer;
    }

.totals {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 4px;
    display: grid;
    gap: 10px;
    font-size: 14px;
}

    .totals .row {
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }

.helper {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.footer-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ==========================================================================
   10. VISUALIZADOR GRÁFICO (Paños y uniones)
   ========================================================================== */
.graphical-visualizer {
    margin-top: 24px;
    padding: 20px;
    background: var(--soft-2);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.visualizer-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shutter-box-visual {
    position: relative;
    height: 110px;
    border: 1px solid #d1d5db;
    background: white;
    border-top: 6px solid #e5e7eb;
    border-radius: 4px;
    display: flex;
    overflow: hidden;
}

.driven-group {
    height: 100%;
    position: relative;
    display: flex;
    flex: 1;
    background: repeating-linear-gradient(#f3f4f6, #f3f4f6 4px, #e5e7eb 4px, #e5e7eb 5px);
}

.cota-v {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(255,255,255,0.8);
    padding: 2px 4px;
    border-radius: 4px;
    border-left: 2px solid var(--accent);
    z-index: 10;
}

.pano-visual {
    flex: 1;
    border-right: 1px solid rgba(0,0,0,0.05);
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
}

    .pano-visual:last-child {
        border-right: none;
    }

.pano-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}

.op-icon-visual {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 14px;
    padding: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #d1d5db;
    color: var(--accent);
    z-index: 10;
}

.union-visual {
    position: absolute;
    right: -9px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: var(--accent);
    background: white;
    border-radius: 50%;
    padding: 2px;
    font-size: 12px;
    border: 1px solid var(--accent);
}

.detailed-cotas-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.pano-cota-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: white;
    position: relative;
    transition: all 0.2s ease;
}

    .pano-cota-box h5 {
        margin: 0 0 8px 0;
        font-size: 13px;
        color: var(--muted);
    }

.union-check-container {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

    .union-check-container input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: var(--accent);
    }

/* ==========================================================================
   11. RESPONSIVE (Móviles y Tablets)
   ========================================================================== */
@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .aside-stack {
        position: static;
    }

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

    .detailed-cotas-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .grid-2, .grid-4, .stat-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .layout-container {
        padding: 16px;
    }

    .detailed-cotas-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   12. ALERTAS / BANNERS (sistema de diseño "moderno")
   Banner reutilizable: raíl de color, icono en relieve, fondo en degradado
   y sombra ambiental tintada. Variantes vía custom props en el wrapper.
   ========================================================================== */
.alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    margin-bottom: 14px;
    border-radius: 14px;
    border: 1px solid var(--bd);
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bot) 100%);
    box-shadow: 0 1px 2px rgba(15,23,42,.03), 0 12px 24px -20px var(--shadow-tint, rgba(15,23,42,.20));
    overflow: hidden;
}
/* Raíl de color que ancla la identidad de la variante */
.alert::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--rail);
}
.alert-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--rail);
    background: var(--icon-bg);
    border: 1px solid var(--icon-bd);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 4px -2px var(--shadow-tint, rgba(15,23,42,.10));
}
.alert-body { flex: 1; min-width: 0; }
.alert-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--title);
    letter-spacing: -.005em;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 2px;
}
.alert-meta {
    font-size: 11px;
    font-weight: 600;
    color: var(--meta, var(--muted));
    background: rgba(255,255,255,.7);
    border: 1px solid var(--bd);
    border-radius: 999px;
    padding: 1px 8px;
}
.alert-msg {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--msg);
}
.alert-msg ul { margin: 4px 0 0; padding-left: 18px; color: var(--msg); }
.alert-msg li { margin: 2px 0; }
.alert-msg strong { color: var(--title); }
.alert-actions { display: flex; gap: 6px; margin-top: 10px; }
.alert-btn {
    display: inline-flex; align-items: center; gap: 5px;
    height: 28px; padding: 0 11px;
    border-radius: 8px;
    font: 600 12px/1 Inter, Arial, Helvetica, sans-serif;
    color: var(--btn-fg, var(--title));
    background: rgba(255,255,255,.8);
    border: 1px solid var(--bd);
    cursor: pointer;
    transition: background .15s ease, transform .12s ease;
}
.alert-btn:hover { background: #fff; transform: translateY(-1px); }
.alert-btn.primary {
    background: var(--rail);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.18);
}
.alert-btn.primary:hover { filter: brightness(1.08); }
.alert-close {
    flex-shrink: 0;
    width: 26px; height: 26px;
    margin: -2px -2px -2px 0;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--meta, var(--muted));
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.alert-close:hover { background: rgba(255,255,255,.8); color: var(--title); }

/* Variantes */
.alert.success {
    --rail:#059669; --bd:#a7f3d0; --bg-top:#ecfdf5; --bg-bot:#d1fae5;
    --icon-bg:linear-gradient(180deg,#ecfdf5,#bbf7d0); --icon-bd:#6ee7b7;
    --title:#065f46; --msg:#047857; --meta:#047857; --shadow-tint:rgba(5,150,105,.22);
}
.alert.danger {
    --rail:#dc2626; --bd:#fecaca; --bg-top:#fff5f5; --bg-bot:#fee2e2;
    --icon-bg:linear-gradient(180deg,#fff5f5,#fecaca); --icon-bd:#fca5a5;
    --title:#991b1b; --msg:#b91c1c; --meta:#b91c1c; --shadow-tint:rgba(220,38,38,.22);
}
.alert.warn {
    --rail:#d97706; --bd:#fcd34d; --bg-top:#fffbeb; --bg-bot:#fef3c7;
    --icon-bg:linear-gradient(180deg,#fffbeb,#fde68a); --icon-bd:#fcd34d;
    --title:#78350f; --msg:#92400e; --meta:#92400e; --shadow-tint:rgba(217,119,6,.22);
}
.alert.info {
    --rail:#2563eb; --bd:#bfdbfe; --bg-top:#eff6ff; --bg-bot:#dbeafe;
    --icon-bg:linear-gradient(180deg,#eff6ff,#bfdbfe); --icon-bd:#93c5fd;
    --title:#1e3a8a; --msg:#1d4ed8; --meta:#1d4ed8; --shadow-tint:rgba(37,99,235,.22);
}
.alert.brand {
    --rail:#e32b36; --bd:rgba(227,43,54,.22); --bg-top:#fff5f5; --bg-bot:#fee2e2;
    --icon-bg:linear-gradient(180deg,#fff5f5,#fecaca); --icon-bd:rgba(227,43,54,.32);
    --title:#7f1d1d; --msg:#991b1b; --meta:#991b1b; --shadow-tint:rgba(227,43,54,.26);
}

/* Ajustes para el Dropdown de Administración */
.dropdown-item {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .dropdown-item:hover {
        background-color: var(--soft);
        color: var(--persycom-red);
    }

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.5px;
}
/* Eyebrow: línea que se desvanece a la derecha del encabezado */
.dropdown-header::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line) 0%, transparent 100%);
}

/* ==========================================================================
   13. PRIMITIVOS DE CONTROL (sistema de diseño "moderno")
   Disponibles para usar en filtros, toggles y etiquetas de estado.
   ========================================================================== */
/* Control segmentado (p. ej. modo accionamiento) */
.segmented {
    display: inline-flex;
    padding: 4px;
    background: var(--soft-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: inset 0 1px 2px rgba(15,23,42,.04);
}
.segmented .seg {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 14px;
    border-radius: 8px;
    font: 600 12.5px/1 Inter, Arial, Helvetica, sans-serif;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s, border-color .15s;
    white-space: nowrap;
}
.segmented .seg:hover { color: var(--text); }
.segmented .seg.active {
    background: #fff;
    color: var(--persycom-red);
    border-color: rgba(227,43,54,.18);
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 10px -4px rgba(227,43,54,.20);
}

/* Pastilla de conmutación simple */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    height: 28px; padding: 0 12px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: var(--muted);
    font: 600 12px/1 Inter, Arial, Helvetica, sans-serif;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
}
.pill:hover { border-color: #d1d5db; color: var(--text); }
.pill.active {
    background: linear-gradient(180deg, #e32b36 0%, #c1222c 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18), 0 4px 10px -4px rgba(227,43,54,.40);
}

/* Chip de filtro con contador y cierre */
.filter-chip {
    display: inline-flex; align-items: stretch;
    height: 30px;
    border-radius: 999px;
    background: var(--soft-2);
    border: 1px solid var(--line);
    font: 600 12px/1 Inter, Arial, Helvetica, sans-serif;
    color: var(--text);
    overflow: hidden;
}
.filter-chip .fc-label { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; }
.filter-chip .fc-label .muted { color: var(--muted); font-weight: 500; }
.filter-chip .fc-count {
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: 2px 7px; font-size: 10.5px; color: var(--text); align-self: center;
}
.filter-chip .fc-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.filter-chip .fc-close:hover { background: #fee2e2; color: var(--persycom-red); }

/* Etiqueta de estado con punto */
.tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px 3px 7px;
    border-radius: 999px;
    font: 700 11px/1.3 Inter, Arial, Helvetica, sans-serif;
    border: 1px solid;
    letter-spacing: .01em;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.tag.brand   { color:#b1232c; background:#fee2e2; border-color:#fecaca; }
.tag.success { color:#047857; background:#d1fae5; border-color:#a7f3d0; }
.tag.warn    { color:#92400e; background:#fef3c7; border-color:#fcd34d; }
.tag.info    { color:#1d4ed8; background:#dbeafe; border-color:#bfdbfe; }
.tag.neutral { color:#374151; background:#f3f4f6; border-color:#e5e7eb; }
