/* ============================================================================
 * Email Checker Pro v1.3 — SaaS Dashboard Theme
 * Sidebar lateral · Tabla de hijos con búsqueda · Filtros agrupados
 * ============================================================================ */

.ecp,
.ecp * {
    box-sizing: border-box;
}

.ecp {
    /* === Paleta === */
    --ecp-bg:        #14171f;
    --ecp-surface:   #1a1d27;
    --ecp-surface-2: #232732;
    --ecp-surface-3: #2d3240;
    --ecp-border:    #2e3340;
    --ecp-border-2:  #3a4150;
    --ecp-text:      #e7eaf3;
    --ecp-text-dim:  #b4bccc;
    --ecp-muted:     #8b95a8;

    --ecp-primary:   #ff8a00;
    --ecp-primary-2: #ffa940;
    --ecp-gold:      #ffc857;
    --ecp-electric:  #00d4ff;
    --ecp-danger:    #ff3d71;
    --ecp-success:   #2ec27e;
    --ecp-warning:   #ffc857;

    --ecp-netflix:   #e50914;
    --ecp-disney:    #0072d2;

    --ecp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --ecp-radius-sm: 6px;
    --ecp-radius:    10px;
    --ecp-radius-lg: 14px;

    --ecp-shadow:        0 4px 12px rgba(0,0,0,0.4);
    --ecp-shadow-lg:     0 12px 32px rgba(0,0,0,0.5);
    --ecp-glow-primary:  0 0 0 1px rgba(255,138,0,0.4), 0 0 20px rgba(255,138,0,0.25);

    --ecp-sidebar-w:     240px;

    font-family: var(--ecp-font);
    color: var(--ecp-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Versión normal (no panel): padded card */
.ecp:not(.ecp-panel) {
    background: var(--ecp-bg);
    padding: 1rem;
    border-radius: var(--ecp-radius-lg);
}
@media (min-width: 768px) {
    .ecp:not(.ecp-panel) { padding: 1.5rem; }
}

/* ------- Tipografía ------- */
.ecp-h2 { margin: 0 0 0.25rem; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.ecp-card-subtitle { margin: 0 0 1rem; color: var(--ecp-muted); font-size: 0.9rem; }
.ecp-section-title { margin: 0 0 1rem; font-size: 1.15rem; font-weight: 600; }
.ecp-help-text { color: var(--ecp-muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
.ecp-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--ecp-text-dim); margin-bottom: 0.4rem; }

/* ------- Card básica ------- */
.ecp-card {
    background: var(--ecp-surface);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--ecp-shadow);
    max-width: 480px;
    margin: 0 auto;
}
.ecp-card-glow {
    box-shadow: var(--ecp-shadow), var(--ecp-glow-primary);
    border-color: rgba(255,138,0,0.25);
}
.ecp-card-header { margin-bottom: 1.25rem; text-align: center; }
.ecp-card-footer-link { margin-top: 1.25rem; text-align: center; font-size: 0.85rem; }
.ecp-card-footer-link a { color: var(--ecp-electric); text-decoration: none; }
.ecp-card-footer-link a:hover { text-decoration: underline; }

/* ------- Logos ------- */
.ecp-logo-netflix {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    background: var(--ecp-netflix);
    color: white; font-weight: 900; font-size: 1.5rem;
    border-radius: var(--ecp-radius-sm);
    margin-bottom: 0.75rem;
    box-shadow: 0 0 24px rgba(229,9,20,0.4);
}
.ecp-brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--ecp-primary), var(--ecp-gold));
    color: #14171f; font-weight: 900; font-size: 0.85rem;
    border-radius: var(--ecp-radius-sm);
    flex-shrink: 0;
}

/* ============================================================================
 * TEMP CODE — Página pública [ecp_temp_code]
 * Fondo "aurora" 100% CSS (sin canvas/JS) para no depender de hacks externos.
 * ============================================================================ */
.ecp.ecp-temp-code {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: 100vh;
    min-height: 100dvh;
    background: radial-gradient(120% 140% at 50% 0%, #1c1420 0%, #0c0d12 55%, #08090c 100%);
    padding: 0;
    border-radius: 0;
}

.ecp-temp-aurora {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.ecp-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(46px);
    opacity: 0.55;
    will-change: transform;
    animation: ecpOrbFloat 16s ease-in-out infinite;
}
.ecp-orb-1 {
    width: 340px; height: 340px;
    top: -90px; left: -60px;
    background: radial-gradient(circle, rgba(229,9,20,0.55), transparent 70%);
    animation-duration: 18s;
}
.ecp-orb-2 {
    width: 300px; height: 300px;
    bottom: -110px; right: -50px;
    background: radial-gradient(circle, rgba(0,212,255,0.4), transparent 70%);
    animation-duration: 22s;
    animation-delay: -6s;
}
.ecp-orb-3 {
    width: 220px; height: 220px;
    top: 40%; left: 55%;
    background: radial-gradient(circle, rgba(255,200,87,0.30), transparent 70%);
    animation-duration: 20s;
    animation-delay: -3s;
}
@keyframes ecpOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(24px, -18px) scale(1.08); }
}

/* ------- Fondo "cine": imagen con inclinación 3D + zoom lento + niebla + grano -------
 * Se activa solo si el admin configuró una imagen en Ajustes → Diseño.
 * Es la misma técnica (pura CSS, sin JS) de un banner que le gustó al cliente:
 * perspectiva 3D + zoom/orbita lentos + viñeta + grano de película animado.
 */
.ecp-temp-cine {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #08090c;
}
.ecp-cine-scene {
    position: absolute;
    inset: 0;
    perspective: 1000px;
    perspective-origin: 50% 40%;
}
.ecp-cine-tilt {
    position: absolute;
    top: -25%; left: -20%; right: -20%; bottom: -25%;
    transform-style: preserve-3d;
    will-change: transform;
    animation: ecpCineOrbit 22s ease-in-out infinite alternate;
}
@keyframes ecpCineOrbit {
    from { transform: rotateX(9deg)  rotateY(-14deg) rotateZ(2deg) scale(1.12); }
    to   { transform: rotateX(13deg) rotateY(-4deg)  rotateZ(0deg) scale(1.18); }
}
.ecp-cine-img {
    position: absolute;
    top: -18%; left: -15%;
    width: 130%; height: 138%;
    object-fit: cover;
    will-change: transform;
    animation: ecpCineZoom 18s ease-in-out infinite alternate;
}
@keyframes ecpCineZoom {
    from { transform: translateY(4%) scale(1.05); }
    to   { transform: translateY(-10%) scale(1.16); }
}
.ecp-cine-tint {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(229,9,20,0.16), rgba(8,9,12,0.55));
    mix-blend-mode: multiply;
}
.ecp-cine-fog {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 50% 32%, transparent 28%, rgba(8,9,12,0.55) 70%, rgba(8,9,12,0.95) 100%),
        linear-gradient(180deg, rgba(8,9,12,0.5) 0%, transparent 24%, transparent 60%, #08090c 98%);
}
.ecp-cine-grain {
    position: absolute;
    inset: -50%;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='ecpn'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23ecpn)'/%3E%3C/svg%3E");
    animation: ecpCineGrain 0.5s steps(4) infinite;
}
@keyframes ecpCineGrain {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-6%, 3%); }
    50%  { transform: translate(4%, -5%); }
    75%  { transform: translate(-3%, 4%); }
    100% { transform: translate(0, 0); }
}

.ecp-temp-stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2.5rem 1rem;
}
@media (min-width: 768px) {
    .ecp-temp-stage { padding: 4rem 1.5rem; }
}

.ecp-temp-card {
    width: 100%;
    max-width: 440px;
    background: rgba(26, 29, 39, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 2rem 1.75rem;
    animation: ecpFadeInUp 0.5s ease both;
}

.ecp-temp-header { position: relative; }
.ecp-logo-netflix-lg {
    width: 60px; height: 60px;
    font-size: 1.9rem;
    box-shadow: 0 0 0 1px rgba(229,9,20,0.45), 0 0 32px rgba(229,9,20,0.55);
    animation: ecpLogoGlow 3.2s ease-in-out infinite;
}
@keyframes ecpLogoGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(229,9,20,0.45), 0 0 26px rgba(229,9,20,0.45); }
    50%      { box-shadow: 0 0 0 1px rgba(229,9,20,0.6),  0 0 40px rgba(229,9,20,0.7); }
}
@keyframes ecpFadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ecp-temp-trust {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--ecp-border);
}
.ecp-temp-trust-item {
    font-size: 0.78rem;
    color: var(--ecp-muted);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .ecp-temp-card { padding: 1.5rem 1.25rem; }
    .ecp-orb { filter: blur(34px); }
    .ecp-orb-1, .ecp-orb-2 { width: 220px; height: 220px; }
    .ecp-orb-3 { width: 160px; height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
    .ecp-orb, .ecp-temp-card, .ecp-logo-netflix-lg,
    .ecp-cine-tilt, .ecp-cine-img, .ecp-cine-grain {
        animation: none !important;
    }
}

/* ============================================================================
 * FORMS / INPUTS / BUTTONS
 * ============================================================================ */
.ecp-form { display: flex; flex-direction: column; gap: 1rem; }
.ecp-field { display: flex; flex-direction: column; }
.ecp-field-inline { flex-direction: row; align-items: center; gap: 0.5rem; }
.ecp-field-captcha .ecp-input-captcha { max-width: 120px; }

.ecp-input {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    background: var(--ecp-surface-2);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius);
    color: var(--ecp-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.ecp-input:focus {
    outline: none;
    border-color: var(--ecp-primary);
    box-shadow: 0 0 0 3px rgba(255,138,0,0.15);
}
.ecp-input::placeholder { color: var(--ecp-muted); }

.ecp-checkbox {
    display: inline-flex; align-items: center; gap: 0.5rem;
    cursor: pointer; font-size: 0.9rem;
}
.ecp-checkbox input { accent-color: var(--ecp-primary); width: 18px; height: 18px; }

.ecp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.7rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--ecp-radius);
    font-family: inherit; font-size: 0.92rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: transform .15s, box-shadow .15s, background .15s, color .15s;
    min-height: 42px;
    white-space: nowrap;
}
.ecp-btn:hover { transform: translateY(-1px); }
.ecp-btn:active { transform: translateY(0); }
.ecp-btn-block { width: 100%; }
.ecp-btn-small { padding: 0.4rem 0.85rem; font-size: 0.85rem; min-height: 34px; }
.ecp-btn-tiny  { padding: 0.3rem 0.7rem;  font-size: 0.75rem; min-height: 28px; gap: 0.25rem; }
.ecp-btn-large { padding: 0.95rem 1.5rem; font-size: 1.05rem; min-height: 52px; }

.ecp-btn-primary {
    background: linear-gradient(135deg, var(--ecp-primary), var(--ecp-primary-2));
    color: #14171f;
    box-shadow: 0 4px 12px rgba(255,138,0,0.3);
}
.ecp-btn-primary:hover { box-shadow: 0 6px 20px rgba(255,138,0,0.45); }

.ecp-btn-ghost {
    background: transparent; color: var(--ecp-text);
    border-color: var(--ecp-border);
}
.ecp-btn-ghost:hover {
    background: var(--ecp-surface-2);
    border-color: var(--ecp-electric);
    color: var(--ecp-electric);
}

.ecp-btn-danger {
    background: transparent; border-color: var(--ecp-danger); color: var(--ecp-danger);
}
.ecp-btn-danger:hover { background: var(--ecp-danger); color: white; }

/* Botón rojo Netflix */
.ecp-btn-netflix-red {
    background: linear-gradient(135deg, #e50914, #ff1d2b);
    color: white;
    box-shadow: 0 4px 16px rgba(229,9,20,0.45);
}
.ecp-btn-netflix-red:hover { box-shadow: 0 6px 24px rgba(229,9,20,0.6); }

.ecp-mini-link {
    background: transparent; border: none; padding: 0;
    color: var(--ecp-electric); font-size: 0.75rem; cursor: pointer;
    text-decoration: underline; font-family: inherit;
}
.ecp-mini-link:hover { color: var(--ecp-primary); }

/* ------- Toggle Netflix/Disney ------- */
.ecp-toggle-service {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    background: var(--ecp-surface-2);
    padding: 4px;
    border-radius: var(--ecp-radius);
    border: 1px solid var(--ecp-border);
}
.ecp-toggle-service input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.ecp-toggle-option {
    display: flex; align-items: center; justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: var(--ecp-radius-sm);
    cursor: pointer; font-weight: 600;
    color: var(--ecp-muted);
    transition: all .15s; user-select: none;
}
.ecp-toggle-service input:checked + .ecp-toggle-netflix {
    background: var(--ecp-netflix); color: white;
    box-shadow: 0 0 16px rgba(229,9,20,0.4);
}
.ecp-toggle-service input:checked + .ecp-toggle-disney {
    background: var(--ecp-disney); color: white;
    box-shadow: 0 0 16px rgba(0,114,210,0.4);
}

/* ------- Filter chips (radios para consulta) ------- */
.ecp-filter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ecp-chip { position: relative; cursor: pointer; }
.ecp-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ecp-chip-label {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    background: var(--ecp-surface-2);
    border: 1px solid var(--ecp-border);
    border-radius: 999px;
    font-size: 0.85rem; color: var(--ecp-muted);
    transition: all .15s;
}
.ecp-chip input:checked + .ecp-chip-label {
    background: var(--ecp-primary); color: #14171f;
    border-color: var(--ecp-primary); font-weight: 600;
}
.ecp-chip:hover .ecp-chip-label { color: var(--ecp-text); border-color: var(--ecp-primary); }

.ecp-filter-mini {
    display: inline-block; padding: 0.2rem 0.6rem;
    background: rgba(0,212,255,0.1); color: var(--ecp-electric);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 999px; font-size: 0.7rem;
    margin: 0.15rem 0.2rem 0.15rem 0;
}

/* ------- Filter groups (en modal de asignar) ------- */
.ecp-filter-groups {
    display: flex; flex-direction: column; gap: 0.85rem;
}
.ecp-filter-group {
    background: var(--ecp-surface-2);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius);
    padding: 0.85rem;
    margin: 0;
}
.ecp-filter-group-netflix { border-left: 4px solid var(--ecp-netflix); }
.ecp-filter-group-disney  { border-left: 4px solid var(--ecp-disney); }
.ecp-filter-group-title {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0; margin-bottom: 0.65rem;
    font-size: 0.9rem; font-weight: 600;
}
.ecp-filter-group-title .ecp-mini-link { margin-left: auto; }
.ecp-filter-group-mark {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 22px; padding: 0 6px;
    font-size: 0.7rem; font-weight: 800;
    border-radius: 4px;
}
.ecp-filter-group-body {
    display: grid; grid-template-columns: 1fr; gap: 0.35rem;
}
@media (min-width: 480px) { .ecp-filter-group-body { grid-template-columns: 1fr 1fr; } }

.ecp-filter-toggle {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--ecp-surface);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius-sm);
    cursor: pointer;
    transition: all .15s;
    font-size: 0.85rem;
}
.ecp-filter-toggle:has(input:checked) {
    border-color: var(--ecp-primary);
    background: rgba(255,138,0,0.08);
}
.ecp-filter-toggle.ecp-disabled { opacity: 0.35; cursor: not-allowed; }
.ecp-filter-toggle input { accent-color: var(--ecp-primary); }
.ecp-filter-toggle-name { color: var(--ecp-text); }

/* ============================================================================
 * PANEL SaaS — Sidebar layout
 * ============================================================================ */
.ecp-panel {
    background: var(--ecp-bg);
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    position: relative;
}
@media (min-width: 900px) {
    .ecp-panel {
        grid-template-columns: var(--ecp-sidebar-w) 1fr;
    }
}

.ecp-sidebar-toggle {
    display: flex; flex-direction: column; gap: 4px;
    position: fixed; top: 14px; left: 14px;
    z-index: 90;
    width: 42px; height: 42px;
    background: var(--ecp-surface);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius);
    align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
}
.ecp-sidebar-toggle span {
    display: block; width: 18px; height: 2px;
    background: var(--ecp-text); border-radius: 2px;
}
@media (min-width: 900px) {
    .ecp-sidebar-toggle { display: none; }
}

/* Sidebar */
.ecp-panel-sidebar {
    background: var(--ecp-surface);
    border-right: 1px solid var(--ecp-border);
    padding: 1.25rem 0.85rem;
    display: flex; flex-direction: column;
    position: fixed;
    top: 0; left: -100%;
    width: 80%; max-width: 280px;
    height: 100vh;
    z-index: 80;
    transition: left .25s ease;
    overflow-y: auto;
}
.ecp-panel-sidebar.is-open { left: 0; box-shadow: var(--ecp-shadow-lg); }
@media (min-width: 900px) {
    .ecp-panel-sidebar {
        position: sticky; top: 0; left: 0;
        width: var(--ecp-sidebar-w); max-width: none;
        height: 100vh; box-shadow: none;
    }
}

.ecp-sidebar-brand {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.5rem 0.65rem 1.25rem;
    border-bottom: 1px solid var(--ecp-border);
    margin-bottom: 1rem;
}
.ecp-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.ecp-brand-text strong { font-size: 0.92rem; }
.ecp-brand-text small { font-size: 0.7rem; color: var(--ecp-muted); }

.ecp-sidebar-nav {
    display: flex; flex-direction: column; gap: 0.2rem;
    flex: 1 1 auto;
}
.ecp-sidebar-nav .ecp-tab {
    display: flex; align-items: center; gap: 0.65rem;
    width: 100%; min-height: 44px;
    padding: 0 0.85rem;
    background: transparent; border: none;
    color: var(--ecp-text-dim);
    cursor: pointer;
    border-radius: var(--ecp-radius);
    font-family: inherit;
    font-size: 0.92rem; font-weight: 500;
    text-align: left;
    transition: all .15s;
}
.ecp-sidebar-nav .ecp-tab:hover {
    background: var(--ecp-surface-2); color: var(--ecp-text);
}
.ecp-sidebar-nav .ecp-tab.is-active {
    background: linear-gradient(135deg, rgba(255,138,0,0.18), rgba(255,200,87,0.05));
    color: var(--ecp-primary);
    box-shadow: inset 0 0 0 1px rgba(255,138,0,0.3);
}
.ecp-sidebar-nav .ecp-tab.is-active::before {
    content: ''; display: block;
    width: 3px; height: 18px;
    background: var(--ecp-primary);
    border-radius: 2px;
    margin-left: -0.85rem; margin-right: 0.4rem;
}

.ecp-sidebar-footer {
    margin-top: 1rem; padding-top: 1rem;
    border-top: 1px solid var(--ecp-border);
}
.ecp-sidebar-user {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.5rem 0.65rem; margin-bottom: 0.5rem;
}
.ecp-sidebar-avatar {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--ecp-electric), var(--ecp-primary));
    color: #14171f; font-weight: 700; font-size: 0.95rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.ecp-sidebar-user-info { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.ecp-sidebar-user-info strong { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecp-sidebar-user-info small { font-size: 0.7rem; color: var(--ecp-muted); }

.ecp-sidebar-logout {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    color: var(--ecp-muted);
    text-decoration: none; font-size: 0.85rem;
    border-radius: var(--ecp-radius);
    transition: all .15s;
}
.ecp-sidebar-logout:hover {
    background: rgba(255,61,113,0.1);
    color: var(--ecp-danger);
}

/* Iconos sidebar (mask SVG inline) */
.ecp-tab-icon {
    display: inline-block;
    width: 18px; height: 18px;
    background-color: currentColor;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-size: contain; mask-size: contain;
    flex-shrink: 0;
}
.ecp-icon-search { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>"); }
.ecp-icon-users  { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87'/><path d='M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87'/><path d='M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); }
.ecp-icon-logs   { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><path d='M14 2v6h6'/><line x1='9' y1='13' x2='15' y2='13'/><line x1='9' y1='17' x2='15' y2='17'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><path d='M14 2v6h6'/><line x1='9' y1='13' x2='15' y2='13'/><line x1='9' y1='17' x2='15' y2='17'/></svg>"); }
.ecp-icon-logout { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16 17 21 12 16 7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16 17 21 12 16 7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>"); }

/* Main area */
.ecp-panel-main {
    padding: 1.25rem 1rem;
    min-width: 0;
    padding-top: 4.25rem; /* espacio para el toggle en móvil */
}
@media (min-width: 900px) {
    .ecp-panel-main { padding: 2rem 2.5rem; }
}

/* Sections */
.ecp-section {
    background: var(--ecp-surface);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
@media (min-width: 768px) {
    .ecp-section { padding: 1.75rem; margin-bottom: 1.5rem; }
}
.ecp-section:last-child { margin-bottom: 0; }
.ecp-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 1.25rem; flex-wrap: wrap;
}
.ecp-section-head .ecp-section-title { margin: 0; }

.ecp-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ecp-muted);
    background: var(--ecp-surface-2);
    border-radius: var(--ecp-radius);
    border: 1px dashed var(--ecp-border);
}

/* ============================================================================
 * EMAIL CARDS (correos asignados al usuario)
 * ============================================================================ */
.ecp-grid-cards {
    display: grid; grid-template-columns: 1fr; gap: 0.75rem;
}
@media (min-width: 600px) { .ecp-grid-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .ecp-grid-cards { grid-template-columns: 1fr 1fr 1fr; } }

.ecp-email-card {
    background: var(--ecp-surface-2);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius);
    padding: 0.85rem;
    transition: all .15s;
    position: relative;
    overflow: hidden;
}
.ecp-email-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--ecp-primary);
}
.ecp-urgency-ok::before      { background: var(--ecp-success); }
.ecp-urgency-warning::before { background: var(--ecp-warning); }
.ecp-urgency-expired::before { background: var(--ecp-danger); }
.ecp-urgency-inf::before     { background: var(--ecp-electric); }
.ecp-email-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ecp-shadow);
    border-color: var(--ecp-primary);
}
.ecp-email-card-top {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.ecp-email-text {
    font-size: 0.85rem; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ecp-days-pill {
    flex-shrink: 0; padding: 0.15rem 0.55rem;
    background: var(--ecp-surface); border: 1px solid var(--ecp-border);
    border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.ecp-urgency-ok .ecp-days-pill      { color: var(--ecp-success); border-color: var(--ecp-success); }
.ecp-urgency-warning .ecp-days-pill { color: var(--ecp-warning); border-color: var(--ecp-warning); }
.ecp-urgency-expired .ecp-days-pill { color: var(--ecp-danger); border-color: var(--ecp-danger); }
.ecp-urgency-inf .ecp-days-pill     { color: var(--ecp-electric); border-color: var(--ecp-electric); }

.ecp-email-services { display: flex; gap: 0.3rem; margin-bottom: 0.5rem; }
.ecp-svc-tag {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 22px; padding: 0 6px;
    font-weight: 800; font-size: 0.7rem; border-radius: 4px; color: white;
}
.ecp-svc-netflix { background: var(--ecp-netflix); }
.ecp-svc-disney  { background: var(--ecp-disney); }

.ecp-email-filters { display: flex; flex-wrap: wrap; }

/* ============================================================================
 * CHILDREN TABLE (mayoristas/admin)
 * ============================================================================ */
.ecp-children-toolbar {
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.ecp-children-search { flex: 1 1 280px; max-width: 380px; }
.ecp-children-count {
    color: var(--ecp-muted); font-size: 0.85rem; white-space: nowrap;
}

.ecp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius);
    background: var(--ecp-surface);
}
.ecp-children-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.ecp-children-table thead th {
    text-align: left;
    padding: 0.75rem 0.85rem;
    background: var(--ecp-surface-2);
    color: var(--ecp-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    border-bottom: 1px solid var(--ecp-border);
    white-space: nowrap;
}
.ecp-children-table th.ecp-sortable { cursor: pointer; user-select: none; }
.ecp-children-table th.ecp-sortable:hover { color: var(--ecp-text); }
.ecp-sort-arrow {
    display: inline-block; width: 8px; height: 8px;
    margin-left: 4px; opacity: 0.3;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .15s;
}
.ecp-children-table th.ecp-sort-asc .ecp-sort-arrow { opacity: 1; transform: rotate(-135deg); margin-top: 4px; }
.ecp-children-table th.ecp-sort-desc .ecp-sort-arrow { opacity: 1; transform: rotate(45deg); margin-top: -2px; }
.ecp-children-table th.ecp-num, .ecp-children-table td.ecp-num { text-align: right; }
.ecp-children-table th.ecp-th-actions { width: 1%; white-space: nowrap; text-align: right; }
.ecp-children-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--ecp-border);
    vertical-align: middle;
}
.ecp-children-table tbody tr:last-child td { border-bottom: none; }
.ecp-children-table tbody tr:hover { background: var(--ecp-surface-2); }
.ecp-children-table tbody tr.ecp-row-hidden { display: none; }
.ecp-children-table code {
    font-family: monospace; font-size: 0.8rem;
    background: var(--ecp-surface-2); padding: 0.1rem 0.35rem;
    border-radius: 4px; color: var(--ecp-electric);
}
.ecp-children-table .ecp-td-name strong { font-weight: 600; }
.ecp-children-table .ecp-td-actions {
    text-align: right; white-space: nowrap;
}
.ecp-children-table .ecp-td-actions .ecp-btn { margin-left: 4px; }

.ecp-role-tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background: rgba(0,212,255,0.1);
    color: var(--ecp-electric);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Child detail row (expandible bajo la fila del hijo) */
.ecp-child-detail-row td {
    padding: 0;
    background: var(--ecp-surface-2);
}
.ecp-child-detail {
    padding: 1rem;
    border-left: 3px solid var(--ecp-primary);
}

/* Mini-list (assignments dentro de detail) */
.ecp-mini-list { list-style: none; padding: 0; margin: 0; }
.ecp-mini-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--ecp-border);
    font-size: 0.85rem;
}
.ecp-mini-item:last-child { border-bottom: none; }
.ecp-mi-email { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecp-mi-days {
    padding: 0.1rem 0.5rem;
    background: var(--ecp-surface); border-radius: 999px;
    font-size: 0.7rem; color: var(--ecp-muted);
}
.ecp-mi-expired { opacity: 0.5; }

/* ============================================================================
 * MODALES
 * ============================================================================ */
.ecp-modal {
    position: fixed; inset: 0; z-index: 999999;
    display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 768px) {
    .ecp-modal { align-items: center; }
}
.ecp-modal[hidden] { display: none; }
.ecp-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}
.ecp-modal-content {
    position: relative;
    background: var(--ecp-surface);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius-lg) var(--ecp-radius-lg) 0 0;
    width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    font-family: var(--ecp-font);
    color: var(--ecp-text);
}
@media (min-width: 768px) {
    .ecp-modal-content {
        border-radius: var(--ecp-radius-lg);
        box-shadow: var(--ecp-shadow-lg), 0 0 0 1px rgba(255,138,0,0.15);
    }
}
.ecp-modal-wide { max-width: 720px; }
.ecp-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem; padding-bottom: 1rem;
    border-bottom: 1px solid var(--ecp-border);
}
.ecp-modal-head h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.ecp-modal-close {
    background: transparent; border: none;
    color: var(--ecp-muted); font-size: 1.75rem; cursor: pointer;
    line-height: 1; padding: 0 0.4rem; border-radius: 4px;
}
.ecp-modal-close:hover { color: var(--ecp-danger); }
.ecp-modal-foot {
    display: flex; gap: 0.5rem; justify-content: flex-end;
    margin-top: 1.5rem; padding-top: 1rem;
    border-top: 1px solid var(--ecp-border);
}

/* ============================================================================
 * RESULT
 * ============================================================================ */
.ecp-result-container { margin-top: 1rem; }
.ecp-result-container:empty { display: none; }
.ecp-result {
    background: linear-gradient(135deg, var(--ecp-surface-2), var(--ecp-surface));
    border: 1px solid var(--ecp-primary);
    border-radius: var(--ecp-radius);
    padding: 1.25rem;
    box-shadow: var(--ecp-glow-primary);
    animation: ecp-fadein .3s ease;
}
@keyframes ecp-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ecp-result-header {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1rem; flex-wrap: wrap;
}
.ecp-service-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: white;
}
.ecp-service-netflix { background: var(--ecp-netflix); }
.ecp-service-disney  { background: var(--ecp-disney); }
.ecp-filter-name { font-weight: 600; }
.ecp-result-code {
    text-align: center;
    padding: 1rem;
    background: var(--ecp-bg);
    border-radius: var(--ecp-radius);
    margin-bottom: 1rem;
}
.ecp-result-code-label {
    display: block; font-size: 0.75rem; color: var(--ecp-muted);
    margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.ecp-result-code-value {
    display: block; font-size: 2.5rem; font-weight: 800;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, var(--ecp-primary), var(--ecp-gold));
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.ecp-result-link { margin-top: 0.5rem; text-align: center; }
.ecp-result-footer {
    margin-top: 1rem; padding-top: 0.75rem;
    border-top: 1px dashed var(--ecp-border);
    font-size: 0.75rem; color: var(--ecp-muted);
}

/* ============================================================================
 * LOGS
 * ============================================================================ */
.ecp-logs-filters {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    margin-bottom: 1rem;
}
.ecp-logs-filters .ecp-input { flex: 1 1 140px; }
.ecp-logs-container { overflow-x: auto; }

.ecp-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.ecp-table th {
    text-align: left; padding: 0.6rem;
    background: var(--ecp-surface-2); color: var(--ecp-muted);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--ecp-border);
}
.ecp-table td {
    padding: 0.6rem; border-bottom: 1px solid var(--ecp-border);
    vertical-align: middle;
}
.ecp-table tbody tr:hover { background: var(--ecp-surface-2); }
.ecp-table code {
    font-family: monospace; font-size: 0.8rem;
    background: var(--ecp-surface); padding: 0.15rem 0.4rem; border-radius: 4px;
}

.ecp-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem; border-radius: 4px;
    font-size: 0.7rem; font-weight: 600;
    text-transform: lowercase; letter-spacing: 0.02em;
}
.ecp-tag-event-query      { background: rgba(0,212,255,0.15); color: var(--ecp-electric); }
.ecp-tag-event-login      { background: rgba(46,194,126,0.15); color: var(--ecp-success); }
.ecp-tag-event-logout     { background: rgba(255,200,87,0.15); color: var(--ecp-gold); }
.ecp-tag-event-pwd_change { background: rgba(255,138,0,0.15); color: var(--ecp-primary); }

.ecp-tag-status-success           { background: rgba(46,194,126,0.15); color: var(--ecp-success); }
.ecp-tag-status-not_found         { background: rgba(255,200,87,0.15); color: var(--ecp-warning); }
.ecp-tag-status-unauthorized_email,
.ecp-tag-status-filter_not_allowed,
.ecp-tag-status-assignment_expired,
.ecp-tag-status-parse_failed,
.ecp-tag-status-imap_error { background: rgba(255,61,113,0.15); color: var(--ecp-danger); }

/* ------- Messages ------- */
.ecp-message {
    padding: 0.85rem 1rem;
    border-radius: var(--ecp-radius);
    margin: 1rem 0;
    font-size: 0.9rem;
}
.ecp-message-error   { background: rgba(255,61,113,0.1); border: 1px solid var(--ecp-danger); color: var(--ecp-danger); }
.ecp-message-success { background: rgba(46,194,126,0.1); border: 1px solid var(--ecp-success); color: var(--ecp-success); }
.ecp-warning         { color: var(--ecp-warning); font-size: 0.85rem; }

.ecp-actions {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    justify-content: center;
}

/* ============================================================================
 * v1.4 — Garantías, fila clicable, correos caídos
 * ============================================================================ */

/* Icono shield para la pestaña Soportes */
.ecp-icon-shield {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/></svg>");
}

/* --- Fila de hijo clicable --- */
.ecp-children-table tbody tr.ecp-child-row {
    cursor: pointer;
    transition: background .12s;
}
.ecp-children-table tbody tr.ecp-child-row:hover {
    background: var(--ecp-surface-3);
}
.ecp-row-caret {
    display: inline-block;
    width: 7px; height: 7px;
    margin-right: 8px;
    border-right: 2px solid var(--ecp-muted);
    border-bottom: 2px solid var(--ecp-muted);
    transform: rotate(-45deg);
    transition: transform .15s;
    vertical-align: middle;
}
.ecp-child-row.ecp-row-open .ecp-row-caret {
    transform: rotate(45deg);
    border-color: var(--ecp-primary);
}
.ecp-td-name { line-height: 1.35; }
.ecp-child-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ecp-text);
}
.ecp-child-mail-sub {
    display: block;
    margin-left: 15px;
    font-size: 0.78rem;
    color: var(--ecp-muted);
}

/* Contador de correos más visible */
.ecp-count-badge {
    display: inline-block;
    min-width: 30px;
    padding: 0.25rem 0.5rem;
    background: var(--ecp-surface-3);
    border: 1px solid var(--ecp-border-2);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ecp-gold);
    text-align: center;
}

/* --- Días dentro del detalle de asignaciones: GRANDES y legibles --- */
.ecp-mini-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid var(--ecp-border);
    flex-wrap: wrap;
}
.ecp-mi-email {
    flex: 1 1 200px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ecp-text);
}
.ecp-mi-days {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    background: var(--ecp-surface-3);
    border: 1px solid var(--ecp-border-2);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ecp-electric);
}
.ecp-mi-expired .ecp-mi-days { color: var(--ecp-danger); border-color: var(--ecp-danger); }

/* --- Correos caídos: gris y tachado --- */
.ecp-email-down {
    text-decoration: line-through;
    color: var(--ecp-muted) !important;
    opacity: 0.75;
}
.ecp-email-card-down {
    opacity: 0.92;
    border-style: dashed;
}
.ecp-email-card-down::before { background: var(--ecp-muted); }
.ecp-down-badge {
    flex-shrink: 0;
    padding: 0.15rem 0.55rem;
    background: rgba(255,61,113,0.15);
    color: var(--ecp-danger);
    border: 1px solid var(--ecp-danger);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.ecp-backup-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--ecp-border);
}
.ecp-backup-label {
    font-size: 0.78rem;
    color: var(--ecp-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ecp-backup-email {
    font-family: monospace;
    font-size: 0.82rem;
    background: rgba(46,194,126,0.12);
    color: var(--ecp-success);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

/* --- Pestaña Soportes --- */
.ecp-warranty-actions {
    margin: 1rem 0 1.5rem;
}
.ecp-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ecp-text);
    margin: 1.5rem 0 0.75rem;
}
.ecp-tag-event-warranty {
    background: rgba(255,138,0,0.15);
    color: var(--ecp-primary);
}

/* Tabla de garantías: correo caído tachado */
.ecp-table .ecp-email-down {
    text-decoration: line-through;
    color: var(--ecp-muted);
}

/* ============================================================================
 * v1.4.1 — Temas, loading, tipografía optimizada, resumen, garantías agrupadas
 * ============================================================================ */

/* ---- Iconos nuevos ---- */
.ecp-icon-list {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><line x1='8' y1='6' x2='21' y2='6'/><line x1='8' y1='12' x2='21' y2='12'/><line x1='8' y1='18' x2='21' y2='18'/><line x1='3' y1='6' x2='3.01' y2='6'/><line x1='3' y1='12' x2='3.01' y2='12'/><line x1='3' y1='18' x2='3.01' y2='18'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><line x1='8' y1='6' x2='21' y2='6'/><line x1='8' y1='12' x2='21' y2='12'/><line x1='8' y1='18' x2='21' y2='18'/><line x1='3' y1='6' x2='3.01' y2='6'/><line x1='3' y1='12' x2='3.01' y2='12'/><line x1='3' y1='18' x2='3.01' y2='18'/></svg>");
}
.ecp-icon-palette {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><circle cx='13.5' cy='6.5' r='.5'/><circle cx='17.5' cy='10.5' r='.5'/><circle cx='8.5' cy='7.5' r='.5'/><circle cx='6.5' cy='12.5' r='.5'/><path d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><circle cx='13.5' cy='6.5' r='.5'/><circle cx='17.5' cy='10.5' r='.5'/><circle cx='8.5' cy='7.5' r='.5'/><circle cx='6.5' cy='12.5' r='.5'/><path d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z'/></svg>");
}

/* ---- Spinner + loading overlay ---- */
.ecp-spinner {
    width: 38px; height: 38px;
    border: 3px solid var(--ecp-border-2);
    border-top-color: var(--ecp-primary);
    border-radius: 50%;
    animation: ecp-spin 0.7s linear infinite;
}
@keyframes ecp-spin { to { transform: rotate(360deg); } }

.ecp-query-loading {
    display: flex; flex-direction: column;
    align-items: center; gap: 0.85rem;
    padding: 2rem 1rem;
    color: var(--ecp-text-dim);
    font-size: 0.92rem;
}

.ecp-loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.62);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
}
/* El atributo hidden NO oculta elementos con display explícito.
   Esta regla garantiza que el overlay desaparezca cuando lleva [hidden]. */
.ecp-loading-overlay[hidden] {
    display: none !important;
}
.ecp-loading-box {
    display: flex; flex-direction: column;
    align-items: center; gap: 1rem;
    padding: 2rem 2.6rem;
    background: var(--ecp-surface);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius-lg);
    box-shadow: var(--ecp-shadow-lg);
}
.ecp-loading-box p { margin: 0; color: var(--ecp-text); font-size: 0.92rem; }

/* ============================================================================
 * Punto 6 — Tipografía y tablas optimizadas para PC
 * ============================================================================ */
.ecp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;          /* antes era muy pequeña */
    table-layout: auto;
}
.ecp-table thead th {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ecp-muted);
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--ecp-border-2);
    text-align: left;
    white-space: nowrap;
}
.ecp-table tbody td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--ecp-border);
    color: var(--ecp-text-dim);
    vertical-align: middle;
    line-height: 1.45;
}
.ecp-table tbody tr:hover { background: var(--ecp-surface-2); }
.ecp-table .ecp-num { text-align: right; white-space: nowrap; }
.ecp-table .ecp-td-strong { font-weight: 600; color: var(--ecp-text); }
.ecp-table code {
    font-size: 0.86rem;
    background: var(--ecp-surface-3);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
}
.ecp-td-note {
    max-width: 220px;
    font-size: 0.84rem;
    color: var(--ecp-muted);
}
/* Las tablas dejan de tener columnas absurdamente anchas */
.ecp-table-wrap { overflow-x: auto; }

/* En pantallas grandes el panel aprovecha mejor el ancho */
@media (min-width: 1100px) {
    /* Punto 2: letras más grandes y legibles en escritorio. */
    .ecp-panel-main { font-size: 1.02rem; }
    .ecp-section { max-width: 1180px; }
    .ecp-table { font-size: 1rem; }
    .ecp-table thead th { font-size: 0.82rem; }
    .ecp-section-title { font-size: 1.4rem; }
    .ecp-help-text { font-size: 0.95rem; }
    .ecp-label { font-size: 0.95rem; }
    .ecp-mi-email { font-size: 1.02rem; }
    .ecp-mi-days { font-size: 1.05rem; }
    .ecp-input, .ecp-textarea { font-size: 1rem; }
    .ecp-btn { font-size: 1rem; }
    .ecp-btn-tiny { font-size: 0.85rem; }
    .ecp-chip-label { font-size: 0.95rem; }
    .ecp-tab-label { font-size: 0.98rem; }
    .ecp-table code, .ecp-email-active, .ecp-email-down { font-size: 0.96rem; }
    .ecp-td-note { font-size: 0.92rem; }
}

/* ---- Garantías agrupadas: cadena de correos ---- */
.ecp-chain-downs {
    display: flex; flex-wrap: wrap;
    align-items: center; gap: 0.3rem 0.5rem;
}
.ecp-chain-arrow { color: var(--ecp-muted); font-size: 0.8rem; }
.ecp-email-active {
    background: rgba(46,194,126,0.14);
    color: var(--ecp-success);
}
.ecp-table-warranty td, .ecp-table-summary td { font-size: 0.88rem; }

/* ---- Botón WhatsApp ---- */
/* ---- Botón copiar mensaje ---- */
.ecp-btn-copied {
    background: var(--ecp-success) !important;
    color: #04210f !important;
}

/* ---- Personalizar: cuadros de mensajes ---- */
.ecp-textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
.ecp-vars-help {
    margin: 0.9rem 0 1.2rem;
    padding: 0.85rem 1rem;
    background: var(--ecp-surface-2);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius);
    font-size: 0.85rem;
}
.ecp-vars-help ul {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
}
.ecp-vars-help li { margin: 0.25rem 0; color: var(--ecp-text-dim); }
.ecp-vars-help code {
    background: var(--ecp-surface-3);
    color: var(--ecp-gold);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.84rem;
}
.ecp-form-actions { margin-top: 1rem; }

/* ============================================================================
 * Punto 8 — Personalizar: grid de temas
 * ============================================================================ */
.ecp-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1.2rem;
}
.ecp-theme-card {
    position: relative;
    display: flex; flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--ecp-surface-2);
    border: 2px solid var(--ecp-border);
    border-radius: var(--ecp-radius);
    cursor: pointer;
    transition: border-color .15s, transform .1s;
    text-align: left;
}
.ecp-theme-card:hover { transform: translateY(-2px); }
.ecp-theme-card.is-active { border-color: var(--ecp-primary); }
.ecp-theme-swatches { display: flex; gap: 6px; }
.ecp-theme-dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
}
.ecp-theme-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ecp-text);
}
.ecp-theme-check {
    position: absolute; top: 8px; right: 10px;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ecp-primary);
    color: #1a1205;
    border-radius: 50%;
    font-size: 0.7rem; font-weight: 800;
    opacity: 0;
    transition: opacity .15s;
}
.ecp-theme-card.is-active .ecp-theme-check { opacity: 1; }

/* ============================================================================
 * Punto 8 — Definición de los 6 temas (sobrescriben variables de .ecp)
 * ============================================================================ */

/* Dark ya es el tema por defecto: no necesita overrides */

/* Neón */
.ecp-theme-neon {
    --ecp-bg:#0d0221; --ecp-surface:#160b35; --ecp-surface-2:#1f1145;
    --ecp-surface-3:#2b1a5c; --ecp-border:#3a2470; --ecp-border-2:#523499;
    --ecp-text:#f3e9ff; --ecp-text-dim:#cdb9f0; --ecp-muted:#9b86c9;
    --ecp-primary:#f000ff; --ecp-primary-2:#ff5cff; --ecp-gold:#ffd23f;
    --ecp-electric:#00fff0; --ecp-glow-primary:0 0 0 1px rgba(240,0,255,0.5),0 0 22px rgba(240,0,255,0.4);
}
/* Matrix */
.ecp-theme-matrix {
    --ecp-bg:#000d00; --ecp-surface:#03160a; --ecp-surface-2:#062012;
    --ecp-surface-3:#0a2e1a; --ecp-border:#0f3d22; --ecp-border-2:#155a32;
    --ecp-text:#c9ffd6; --ecp-text-dim:#86e3a0; --ecp-muted:#4f9d68;
    --ecp-primary:#00ff41; --ecp-primary-2:#5cff85; --ecp-gold:#9dff00;
    --ecp-electric:#00d97a; --ecp-glow-primary:0 0 0 1px rgba(0,255,65,0.45),0 0 20px rgba(0,255,65,0.35);
}
/* Blanco */
.ecp-theme-light {
    --ecp-bg:#f4f5f7; --ecp-surface:#ffffff; --ecp-surface-2:#eef0f4;
    --ecp-surface-3:#e2e6ee; --ecp-border:#d8dde6; --ecp-border-2:#c2c9d6;
    --ecp-text:#1a1f2b; --ecp-text-dim:#414b5e; --ecp-muted:#6b7689;
    --ecp-primary:#2563eb; --ecp-primary-2:#3b82f6; --ecp-gold:#b7791f;
    --ecp-electric:#7c3aed; --ecp-shadow:0 4px 12px rgba(0,0,0,0.1);
    --ecp-shadow-lg:0 12px 32px rgba(0,0,0,0.15);
    --ecp-glow-primary:0 0 0 1px rgba(37,99,235,0.35),0 0 16px rgba(37,99,235,0.2);
}
/* Océano */
.ecp-theme-ocean {
    --ecp-bg:#0a1a2f; --ecp-surface:#0f2540; --ecp-surface-2:#163050;
    --ecp-surface-3:#1e3f66; --ecp-border:#244a78; --ecp-border-2:#2f5d93;
    --ecp-text:#e3f2ff; --ecp-text-dim:#a9caea; --ecp-muted:#7396bb;
    --ecp-primary:#38bdf8; --ecp-primary-2:#7dd3fc; --ecp-gold:#fcd34d;
    --ecp-electric:#22d3ee;
}
/* Atardecer */
.ecp-theme-sunset {
    --ecp-bg:#1a0f1f; --ecp-surface:#281530; --ecp-surface-2:#341c40;
    --ecp-surface-3:#472556; --ecp-border:#562d68; --ecp-border-2:#6f3a85;
    --ecp-text:#ffe9f0; --ecp-text-dim:#f0c2d2; --ecp-muted:#bd8fa3;
    --ecp-primary:#fb7185; --ecp-primary-2:#fda4af; --ecp-gold:#fbbf24;
    --ecp-electric:#f472b6;
}

/* ============================================================================
 * v1.4.4 — Diálogo de copia, grupos de asignación, agrupación de caídos
 * ============================================================================ */

/* ---- Diálogo flotante de copia ---- */
.ecp-copy-dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.66);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 100000;
    padding: 1rem;
}
.ecp-copy-dialog {
    width: 100%; max-width: 480px;
    background: var(--ecp-surface);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius-lg);
    box-shadow: var(--ecp-shadow-lg);
    padding: 1.5rem;
}
.ecp-copy-dialog h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: var(--ecp-text);
}
.ecp-copy-dialog .ecp-textarea {
    margin-top: 0.6rem;
    min-height: 130px;
}
.ecp-copy-dialog-actions {
    display: flex; gap: 0.6rem; justify-content: flex-end;
    margin-top: 1rem;
}

/* ---- Detalle de hijo: grupos de asignación (activo + caídos) ---- */
.ecp-assign-groups {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 0.85rem;
}
.ecp-assign-group {
    background: var(--ecp-surface-2);
    border: 1px solid var(--ecp-border);
    border-radius: var(--ecp-radius);
    overflow: hidden;
}
.ecp-mi-head {
    display: flex; align-items: center; gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
}
.ecp-mi-head.ecp-mi-active { border-left: 3px solid var(--ecp-success); }
.ecp-mi-head.ecp-mi-expired { border-left: 3px solid var(--ecp-danger); }

/* Correos caídos anidados bajo el activo */
.ecp-mi-downs {
    padding: 0.25rem 1rem 0.6rem 1.75rem;
    background: rgba(0,0,0,0.12);
}
.ecp-mi-down {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.4rem 0;
}
.ecp-mi-down-tag {
    flex-shrink: 0;
    padding: 0.1rem 0.5rem;
    background: rgba(255,61,113,0.15);
    color: var(--ecp-danger);
    border: 1px solid var(--ecp-danger);
    border-radius: 999px;
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase;
}

/* Responsive: en móvil los items se apilan */
@media (max-width: 560px) {
    .ecp-mi-head { gap: 0.5rem; }
    .ecp-mi-head .ecp-btn { flex: 1 1 auto; }
    .ecp-copy-dialog { padding: 1.1rem; }
}

/* ---- Crédito del creador en el sidebar ---- */
.ecp-sidebar-credit {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ecp-border);
    font-size: 0.72rem;
    color: var(--ecp-muted);
    text-align: center;
}
.ecp-sidebar-credit strong { color: var(--ecp-primary); }
