:root {
    --bg: #0a0a0f;
    --bg-sidebar: #0e0e16;
    --bg-card: #14141f;
    --bg-hover: #1c1c28;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --accent: #e50914;
    --accent-hover: #f40612;
    --border: rgba(255, 255, 255, 0.08);
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius: 12px;
    --font: 'Poppins', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.app-body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    font-size: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-logo-img {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.brand-logo-img.hidden { display: none !important; }

.logo-upload-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.logo-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.logo-picker-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.logo-preview-circle,
.logo-preview-box {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
    border: 2px solid var(--border);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.logo-preview-circle .brand-logo-emoji,
.logo-preview-box .brand-logo-emoji,
.logo-preview-emoji {
    font-size: 2.1rem;
    line-height: 1;
}

.logo-preview-circle .brand-logo-img,
.logo-preview-box .brand-logo-img,
.logo-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: none;
}

.logo-picker-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.logo-action-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.12s;
}

.logo-action-circle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.logo-action-circle--danger:hover {
    border-color: #f87171;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
}

.logo-paste-zone {
    border: 2px dashed var(--border);
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.logo-paste-zone:focus,
.logo-paste-zone.is-dragover {
    outline: none;
    border-color: rgba(229, 9, 20, 0.55);
    background: rgba(229, 9, 20, 0.06);
}

.logo-icons-label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.logo-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo-icon-option {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.logo-icon-option:hover {
    background: var(--bg-hover);
    transform: scale(1.06);
}

.logo-icon-option.is-selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}

.logo-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 180px;
}

.logo-upload-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand small { color: var(--text-muted); font-size: 0.75rem; }

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-item.active {
    background: rgba(229, 9, 20, 0.15);
    color: var(--accent);
    font-weight: 500;
}

.nav-item i { width: 1.25rem; text-align: center; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.nav-link-out {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.nav-link-out:hover { color: var(--text); }

.nav-link-out--btn {
    margin-top: 0.65rem;
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.nav-link-out--btn:hover {
    color: var(--accent);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 300;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
}

/* Main layout */
.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.plan-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    background: rgba(229, 9, 20, 0.2);
    color: var(--accent);
    border-radius: 999px;
}

.user-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.topbar-logout-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: var(--bg-hover);
}

.content {
    flex: 1;
    padding: 1.5rem 1.75rem 2.5rem;
}

.panel { display: none; }
.panel.active { display: block; }

.panel-desc {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* Cards */
.welcome-card,
.steps-card,
.placeholder-card,
.plan-card-app {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.welcome-card h2 { font-size: 1.35rem; margin-bottom: 0.5rem; }
.welcome-card p { color: var(--text-muted); }

.welcome-imap-hint {
    margin-top: 0.75rem;
    font-size: 0.88rem;
    padding: 0.65rem 0.85rem;
    background: rgba(234, 179, 8, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.btn-inline-link {
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.welcome-imap-hint {
    margin-top: 0.75rem;
    font-size: 0.88rem;
    padding: 0.65rem 0.85rem;
    background: rgba(234, 179, 8, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.btn-inline-link {
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.steps-card h3 { font-size: 1rem; margin-bottom: 1rem; }

.steps-list {
    list-style: none;
    margin-bottom: 1.25rem;
}

.steps-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.steps-list li span {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.quick-services h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-text:hover { color: var(--accent); }

/* Service grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.service-grid-compact {
    margin-bottom: 0;
}

.service-btn {
    padding: 1.1rem 0.75rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.service-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.service-btn.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--accent);
}

.service-btn .service-icon { font-size: 1.5rem; }
.service-btn .service-name { font-size: 0.8rem; font-weight: 500; }

.svc-netflix { background: linear-gradient(145deg, #e50914, #b20710); }
.svc-disney { background: linear-gradient(145deg, #113ccf, #0d2d9e); }
.svc-amazon { background: linear-gradient(145deg, #00a8e1, #0077b6); }
.svc-max { background: linear-gradient(145deg, #002be7, #001a8c); }
.svc-paramount { background: linear-gradient(145deg, #0064ff, #0047b3); }
.svc-universal { background: linear-gradient(145deg, #444, #222); }
.svc-chrunchiroll { background: linear-gradient(145deg, #f47521, #d45a10); }
.svc-appletv { background: linear-gradient(145deg, #1d1d1f, #000); }

.consultar-vacio {
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem;
    font-size: 0.95rem;
}

.add-section-title {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 1.25rem 0 0.75rem;
}

.add-section-title:first-of-type {
    margin-top: 0;
}

.add-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
}

.add-service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    position: relative;
}

.add-service-pick:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.add-service-card-active {
    cursor: default;
}

.add-svc-icon {
    font-size: 1.75rem;
}

.add-svc-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.add-svc-action {
    font-size: 0.75rem;
    color: #86efac;
    margin-top: 0.25rem;
}

.add-svc-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.service-grid-active-preview {
    margin-bottom: 0.5rem;
}

.btn-remove-svc {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.btn-remove-svc:hover {
    background: var(--accent);
}

.add-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 0.75rem 0;
}

.service-grid-compact .service-btn {
    padding: 0.65rem 0.4rem;
}

.service-grid-compact .service-name {
    font-size: 0.7rem;
}

/* Search panel */
.search-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.search-panel-header h2 { font-size: 1.2rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-search { width: 100%; justify-content: center; padding: 0.85rem; }

.resultado {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.6;
}

.resultado.success { border-color: rgba(34, 197, 94, 0.4); }
.resultado.error { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.resultado.loading { color: var(--text-muted); }

.resultado .code-box {
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-align: center;
}

/* Placeholder sections */
.placeholder-card {
    text-align: center;
    max-width: 420px;
    margin: 2rem auto;
}

.placeholder-card i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.placeholder-card h2 { margin-bottom: 0.5rem; }
.placeholder-card p { color: var(--text-muted); font-size: 0.9rem; }

.historial-list {
    list-style: none;
    margin-top: 1.5rem;
    text-align: left;
}

.historial-list li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.historial-list:empty::after {
    content: 'Aún no hay búsquedas guardadas.';
    display: block;
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.plan-card-app h2 { margin-bottom: 0.75rem; }
.plan-card-app p { color: var(--text-muted); margin-bottom: 1rem; }

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.help-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.help-item h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-item h3 i { color: var(--accent); }
.help-item p { color: var(--text-muted); font-size: 0.85rem; }

/* Resultados y copiar */
.resultado.resultado-flex,
.resultado-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.resultado-texto {
    width: 100%;
    text-align: center;
    word-break: break-word;
}

.resultado-link {
    color: var(--accent);
    font-weight: 500;
}

.resultado-pais-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.resultado-pais {
    font-size: 1.35rem;
    font-weight: 700;
}

.btn-netflix-link {
    display: block;
    width: 100%;
    max-width: 320px;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
}

.btn-netflix-link:hover { background: var(--accent-hover); }

.copy-button {
    padding: 0.5rem 1rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    font-size: 0.85rem;
}

.copy-button:hover { border-color: var(--accent); }

.copy-success {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
}

/* Reenvío Gmail → Kurama */
.forward-email-card {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), var(--bg-card));
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.forward-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.forward-email-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.forward-email {
    font-size: 1.15rem;
    font-weight: 600;
    color: #facc15;
    background: var(--bg);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    word-break: break-all;
}

.forward-hint {
    margin-top: 0.65rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* 3 modos de conexión de correo */
.conn-mode-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.conn-mode-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.conn-mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.conn-mode-card strong {
    font-size: 0.95rem;
    color: var(--text);
}

.conn-mode-card small {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.conn-mode-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.conn-mode-card:hover {
    border-color: rgba(234, 179, 8, 0.35);
}

.conn-mode-card--active,
.conn-mode-card:has(input:checked) {
    border-color: rgba(234, 179, 8, 0.65);
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1), var(--bg-card));
}

.conn-panel {
    margin-top: 0.5rem;
}

.conn-panel.hidden {
    display: none !important;
}

.conn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.imap-server-preview {
    padding: 0.5rem 0.75rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    color: #93c5fd;
}

.conn-advanced {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.conn-advanced summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    user-select: none;
}

.conn-advanced[open] summary {
    margin-bottom: 0.75rem;
}

.guide-link-row {
    margin: 0.75rem 0 1rem;
}

.btn-google-direct {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 600;
}

.guide-steps a {
    color: #93c5fd;
    text-decoration: underline;
}

.guide-steps a:hover {
    color: #bfdbfe;
}

.flow-diagram {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.flow-diagram i {
    color: var(--accent);
    font-size: 0.75rem;
}

.guide-why {
    background: rgba(59, 130, 246, 0.08);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.guide-alert-ok {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.guide-alert-ok i { color: #86efac !important; }

.admin-only.hidden { display: none !important; }

.imap-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.imap-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.imap-mode-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.imap-mode-badge.mode-test {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.imap-mode-badge.mode-prod {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.imap-status-detail {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.imap-probar-result {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.imap-probar-result.ok { color: #86efac; }
.imap-probar-result.err { color: #fca5a5; }
.imap-probar-result.loading { color: var(--text-muted); }

.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.guide-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.guide-phase {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.guide-phase:last-of-type { border-bottom: none; }

.guide-phase h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.phase-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.phase-test { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.phase-prod { background: rgba(34, 197, 94, 0.2); color: #86efac; }

.guide-steps {
    margin-left: 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.guide-steps ul {
    margin: 0.5rem 0 0 1rem;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.guide-table th,
.guide-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.guide-table th {
    width: 140px;
    color: var(--text-muted);
    font-weight: 500;
}

.guide-bullets {
    margin-left: 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.guide-alert {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(229, 9, 20, 0.25);
    border-radius: 10px;
    margin-top: 1rem;
}

.guide-alert i { color: var(--accent); margin-top: 0.15rem; }
.guide-alert p { color: var(--text-muted); font-size: 0.9rem; }

.guide-card .panel-desc {
    margin-bottom: 0.75rem;
}

code {
    font-size: 0.85em;
    background: var(--bg);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

/* Mobile */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-main {
        margin-left: 0;
        padding-top: 3rem;
    }

    .topbar {
        padding-left: 4rem;
    }
}

/* Plan vencido: logueado pero funciones pausadas */
.plan-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.plan-badge-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.plan-badge-warn {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.plan-expired-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.plan-expired-banner i {
    color: #f87171;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
}

.plan-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.plan-actions-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.plan-purchase-block {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.plan-purchase-title {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.plan-payment-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #b794f6;
    background: rgba(118, 75, 162, 0.15);
    border: 1px solid rgba(118, 75, 162, 0.4);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    margin-bottom: 1rem;
}

.plan-purchase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.plan-purchase-card {
    background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.plan-purchase-card--featured {
    border-color: var(--accent, #e50914);
    box-shadow: 0 0 0 1px rgba(229, 9, 20, 0.25);
}

.plan-purchase-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.plan-purchase-tag--best {
    background: rgba(229, 9, 20, 0.2);
    color: #ff6b6b;
}

.plan-purchase-card h4 {
    font-size: 1.05rem;
    margin: 0;
}

.plan-purchase-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.plan-purchase-features {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    flex: 1;
}

.plan-purchase-features li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.2rem 0;
    padding-left: 1.1rem;
    position: relative;
}

.plan-purchase-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4ade80;
    font-size: 0.8rem;
}

.plan-pay-stack {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.plan-pay-label {
    margin: 0.35rem 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.plan-pay-row {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.65rem;
    margin-top: auto;
}

.plan-pay-chip {
    flex: 1;
    max-width: 7.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.65rem 0.5rem 0.55rem;
    border-radius: 14px;
    border: 2px solid transparent;
    background: var(--bg);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    color: var(--text);
}

.plan-pay-chip:hover {
    transform: translateY(-2px);
}

.plan-pay-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    font-size: 1.1rem;
}

.plan-pay-name {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.plan-pay-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.plan-pay-chip--wompi .plan-pay-icon {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
}

.plan-pay-chip--wompi {
    border-color: rgba(239, 68, 68, 0.35);
}

.plan-pay-chip--wompi:hover {
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.2);
}

.plan-pay-chip--binance .plan-pay-icon {
    background: rgba(234, 179, 8, 0.18);
    color: #facc15;
}

.plan-pay-chip--binance {
    border-color: rgba(234, 179, 8, 0.35);
}

.plan-pay-chip--binance:hover {
    border-color: rgba(234, 179, 8, 0.65);
    box-shadow: 0 6px 18px rgba(234, 179, 8, 0.15);
}

.plan-pay-row:has(.plan-pay-chip:not(.hidden):only-of-type) .plan-pay-chip {
    max-width: 9rem;
}

.plan-price-alt {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-block {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.nav-item--locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.plan-inactivo .quick-services,
.plan-inactivo #section-consultar,
.plan-inactivo #section-agregar-servicio,
.plan-inactivo #section-historial,
.plan-inactivo #section-vincular-reenvio {
    pointer-events: none;
    opacity: 0.55;
}

.plan-inactivo #section-consultar *,
.plan-inactivo #section-agregar-servicio * {
    user-select: none;
}

#themePickerGrid.pointer-lock {
    pointer-events: none;
    opacity: 0.5;
}

/* Modal suscripción (panel) */
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.app-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.app-modal-box {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.app-modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.app-modal-box h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}

.app-modal-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.app-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.brand-simple-card {
    max-width: 520px;
}

.google-session-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.google-session-hint i {
    color: #4285f4;
    margin-right: 0.35rem;
}

.imap-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.imap-toggle-row input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
}

.link-preview-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.75rem 0 1rem;
    word-break: break-all;
    line-height: 1.45;
}

.app-modal-box--wide {
    max-width: 520px;
}

body.app-modal-scroll-lock {
    overflow: hidden;
}

.app-modal-box--binance {
    max-width: min(520px, 96vw);
    max-height: 92vh;
    padding: 1.15rem 1.2rem 1.3rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-modal-box--binance::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.app-modal-box--binance h2 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.app-modal-box--binance .app-modal-sub {
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
    line-height: 1.45;
}

.app-modal-box--binance .binance-manual-summary {
    margin-bottom: 0.7rem;
    padding: 0.6rem 0.8rem;
}

.app-modal-box--binance .binance-manual-summary strong {
    font-size: 1.15rem;
}

.app-modal-box--binance .binance-qr-row {
    padding: 0.5rem;
    margin-bottom: 0.65rem;
    background: transparent;
    border: none;
}

.app-modal-box--binance .binance-qr-img {
    max-width: min(280px, 82vw);
    background: transparent;
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.app-modal-box--binance .binance-copy-row {
    margin-bottom: 0.55rem;
}

.app-modal-box--binance .binance-manual-steps {
    margin: 0.45rem 0 0.65rem;
    font-size: 0.8rem;
    line-height: 1.45;
}

.app-modal-box--binance .binance-capture-paste-zone {
    padding: 0.6rem;
    font-size: 0.78rem;
    margin-bottom: 0.45rem;
}

.app-modal-box--binance .binance-capture-preview img {
    max-height: 140px;
}

.app-modal-box--binance .brand-form-group {
    margin-bottom: 0.75rem;
}

.app-modal-box--binance .copy-button {
    font-size: 0;
    padding: 0.4rem 0.5rem;
    flex-shrink: 0;
}

.app-modal-box--binance .copy-button i {
    font-size: 0.9rem;
}

.binance-qr-row {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.binance-qr-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.binance-qr-img {
    max-width: min(320px, 90vw);
    width: 100%;
    border-radius: 12px;
    background: #fff;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.binance-manual-summary {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.binance-manual-summary strong {
    font-size: 1.25rem;
    color: #facc15;
}

.binance-copy-row {
    margin-bottom: 0.75rem;
}

.binance-copy-row label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.binance-copy-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
}

.binance-copy-field code {
    flex: 1;
    word-break: break-all;
    font-size: 0.85rem;
    color: #93c5fd;
}

.binance-manual-steps {
    margin: 0.75rem 0 1rem;
    font-size: 0.85rem;
}

.binance-capture-preview {
    margin-top: 0.5rem;
}

.binance-capture-preview img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.binance-capture-file-hidden {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.binance-capture-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.binance-file-label {
    cursor: pointer;
    margin: 0;
}

.binance-capture-paste-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 0.85rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s, background 0.15s;
}

.binance-capture-paste-zone:focus,
.binance-capture-paste-zone.is-dragover {
    outline: none;
    border-color: rgba(234, 179, 8, 0.6);
    background: rgba(234, 179, 8, 0.06);
}

.binance-note-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.binance-note-row input {
    flex: 1;
    min-width: 0;
}

.binance-note-row .btn {
    flex-shrink: 0;
}

/* Chat / soporte flotante */
.support-fab {
    position: fixed;
    right: 1.15rem;
    bottom: 1.15rem;
    z-index: 450;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 56px;
    height: 56px;
    padding: 0 1rem 0 0.9rem;
    border-radius: 999px;
    border: none;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.support-fab i {
    font-size: 1.45rem;
    line-height: 1;
}

.support-fab span {
    white-space: nowrap;
}

.support-fab--whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.support-fab--email {
    background: linear-gradient(135deg, var(--accent), #b20710);
}

.support-fab:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    color: #fff;
}

.support-inline-link {
    color: #86efac;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.support-inline-link:hover {
    color: #bbf7d0;
}

.help-item--support .support-help-btn {
    margin-top: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 520px) {
    .support-fab {
        right: 0.85rem;
        bottom: 0.85rem;
        padding: 0;
        width: 56px;
        justify-content: center;
    }

    .support-fab span {
        display: none;
    }
}
