/* ============================================
   INTELLIGENCE — Content Inspiration System
   ============================================ */

/* ─── BUTTON ──────────────────────────────────────── */
.btn-intelligence {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-intelligence:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-intelligence.active {
    background: linear-gradient(135deg, #5b21b6 0%, #4c1d95 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    transform: none;
}

/* ─── MAIN LAYOUT ─────────────────────────────────── */
.intel-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* ─── TABS ─────────────────────────────────────────── */
.intel-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light, #eee);
    padding-bottom: 0;
    flex-shrink: 0;
}

.intel-tab {
    padding: 8px 18px;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.intel-tab:hover { color: var(--text-primary, #333); }

.intel-tab.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
    font-weight: 600;
}

/* ─── STATS BAR ────────────────────────────────────── */
.intel-stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.intel-stat {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #eee);
    border-radius: 8px;
    padding: 10px 16px;
    text-align: center;
    flex: 1;
}

.intel-stat-number {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.intel-stat-label {
    font-size: 10px;
    color: var(--text-muted, #999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── FILTERS ──────────────────────────────────────── */
/* Sub-tabs Propias / Referencias */
.intel-filters-accounttype {
    gap: 0;
    margin-bottom: 8px;
    background: var(--tag-bg, #f5f5f5);
    border-radius: 10px;
    padding: 3px;
    display: inline-flex;
    width: fit-content;
}

.intel-actype-btn {
    padding: 5px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #888);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 7px;
    transition: all 0.15s;
    white-space: nowrap;
}

.intel-actype-btn:hover { color: var(--text-primary, #333); }

.intel-actype-btn.active {
    background: var(--bg-card, #fff);
    color: #7c3aed;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.intel-actype-btn.own.active { color: #d97706; }
.intel-actype-btn.reference.active { color: #0891b2; }

.intel-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

.intel-filter-group {
    display: flex;
    gap: 4px;
    background: var(--tag-bg, #f5f5f5);
    border-radius: 8px;
    padding: 3px;
}

.intel-filter-btn {
    padding: 4px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #666);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.intel-filter-btn:hover { background: var(--bg-card, #fff); color: var(--text-primary, #333); }

.intel-filter-btn.active {
    background: var(--bg-card, #fff);
    color: #7c3aed;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.intel-select {
    padding: 4px 10px;
    border: 1px solid var(--border-light, #eee);
    border-radius: 6px;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #333);
    font-size: 11px;
    cursor: pointer;
    outline: none;
}

/* ─── FILTER BAR (layout organizado en filas) ──────── */
.intel-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.intel-filter-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.intel-filter-spacer { flex: 1; min-width: 8px; }

.intel-filter-group-labeled {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.intel-filter-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary, #999);
    padding-left: 4px;
    opacity: 0.8;
}

/* Categorías: scroll horizontal sin barra */
.intel-filter-group--scrollable {
    overflow-x: auto;
    max-width: 360px;
    flex-wrap: nowrap;
    scrollbar-width: none;
}
.intel-filter-group--scrollable::-webkit-scrollbar { display: none; }

/* Trending: color especial al activarse */
.intel-filter-btn.trending-btn.active {
    background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
    color: white !important;
    box-shadow: 0 1px 4px rgba(239,68,68,0.3);
}

/* ─── FEED GRID ────────────────────────────────────── */
.intel-feed {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.intel-grid,
.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    padding-bottom: 20px;
}

/* ─── PINNED SECTION ────────────────────────────────── */
.intel-pinned-section {
    margin-bottom: 20px;
}
.intel-pinned-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.2);
    border-radius: 8px;
}
.intel-pinned-title {
    font-size: 13px;
    font-weight: 600;
    color: #fbbf24;
}
.intel-pinned-hint {
    font-size: 11px;
    color: #6b7280;
}
.intel-pinned-grid {
    padding-bottom: 0;
}

/* ─── VIDEO CARD — estilo TikTok portrait ───────────── */
.intel-card {
    background: #111;
    border: 1px solid #1e1e1e;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
    position: relative;
    cursor: pointer;
}

.intel-card:hover {
    border-color: #3a3a3a;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* Thumbnail — retrato completo */
.intel-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    background: #1a1a1a;
    overflow: hidden;
}

.intel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.intel-card:hover .intel-thumb img {
    transform: scale(1.03);
}

.intel-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #444;
}

/* Platform badge */
.intel-platform-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white;
    z-index: 2;
}

.intel-platform-badge.instagram { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }
.intel-platform-badge.tiktok { background: rgba(0,0,0,0.75); border: 1px solid rgba(255,255,255,0.15); }
.intel-platform-badge.twitter { background: #1DA1F2; }

/* Trending badge */
.intel-trending-badge {
    position: absolute;
    bottom: 30px;
    left: 8px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    animation: intel-pulse 2s infinite;
    z-index: 2;
}

@keyframes intel-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Tiempo relativo — esquina superior izquierda (bajo el badge de plataforma) */
.intel-time-ago {
    position: absolute;
    top: 34px;
    left: 8px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    color: #d1d5db;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    z-index: 2;
    white-space: nowrap;
}

/* Stats en columna — esquina inferior derecha (estilo TikTok) */
.intel-stats-col {
    position: absolute;
    bottom: 38px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    z-index: 2;
}

/* Stats sobreimpresos — (compat con el nombre viejo) */
.intel-thumb-stats {
    position: absolute;
    bottom: 38px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    z-index: 2;
}

.intel-stat-pill {
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 7px;
    display: block;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* Pie del thumbnail — username */
.intel-thumb-footer {
    position: absolute;
    bottom: 8px;
    left: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
}

.intel-thumb-user {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 6px rgba(0,0,0,0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Barra de engagement */
.intel-engagement-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0,0,0,0.3);
    z-index: 2;
}

.intel-engagement-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #7c3aed);
}

/* Checkbox de selección — top-right del thumb */
.intel-card-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    z-index: 4;
    opacity: 0;
    cursor: pointer;
    accent-color: #dc2626;
    transition: opacity 0.15s;
    border-radius: 4px;
}
.intel-card:hover .intel-card-checkbox,
.intel-card-checkbox:checked { opacity: 1; }

/* Estado seleccionado */
.intel-card--selected {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220,38,38,0.35) !important;
}

/* Video en hover */
.intel-hover-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Botones de acción — centrados verticalmente a la derecha del thumb */
.intel-card-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.18s;
    z-index: 5;
}

.intel-card:hover .intel-card-actions {
    opacity: 1;
}

.intel-card-actions .intel-btn {
    padding: 0;
    width: 30px;
    height: 30px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.12);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.intel-card-actions .intel-btn:hover { background: rgba(255,255,255,0.18); }
.intel-card-actions .intel-btn.danger:hover { background: rgba(239,68,68,0.5); border-color: rgba(239,68,68,0.4); }
.intel-card-actions .intel-btn.pinned { background: rgba(245,158,11,0.35); border-color: rgba(245,158,11,0.5); }
.intel-card-actions .intel-btn.drive.done { background: rgba(16,185,129,0.35); border-color: rgba(16,185,129,0.5); }
.intel-card-actions .intel-btn.drive.loading { opacity: 0.5; cursor: default; }

/* ─── BULK ACTION BAR (popup inferior) ──────────────── */
.intel-bulk-bar {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 16px 20px;
    min-width: 280px;
    z-index: 9999;
    box-shadow: 0 12px 48px rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: bulkBarIn 0.22s cubic-bezier(0.34,1.4,0.64,1);
}
@keyframes bulkBarIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
.intel-bulk-count {
    text-align: center;
    font-size: 14px;
    color: #e5e7eb;
}
.intel-bulk-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.intel-bulk-btn {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #3a3a3a;
    background: #2a2a2a;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.intel-bulk-btn:hover { background: #3a3a3a; }
.intel-bulk-btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.intel-bulk-btn.danger:hover { background: #b91c1c; }

/* Overlay para elegir modelo en bulk */
.intel-bulk-model-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.intel-bulk-model-modal {
    background: #141414;
    border: 1px solid #272727;
    border-radius: 16px;
    padding: 24px;
    min-width: 280px;
    max-width: 340px;
}

/* Caption debajo de la imagen */
.intel-card-caption {
    padding: 7px 9px;
    font-size: 11px;
    color: #aaa;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: #111;
    border-top: 1px solid #1e1e1e;
}

.intel-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-light, #eee);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #666);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    white-space: nowrap;
}

.intel-btn:hover {
    background: var(--tag-bg, #f5f5f5);
    color: var(--text-primary, #333);
}

.intel-btn.primary {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
    border-color: transparent;
}

.intel-btn.primary:hover {
    background: linear-gradient(135deg, #6d28d9, #4c1d95);
    transform: none;
}

.intel-btn.danger { color: #ef4444; border-color: #fee2e2; }
.intel-btn.danger:hover { background: #fee2e2; }
.intel-btn.pinned { color: #f59e0b; border-color: #fef3c7; background: rgba(245,158,11,0.1); }
.intel-btn.pinned:hover { background: #fef3c7; }
.intel-btn.drive { color: #0ea5e9; border-color: #e0f2fe; }
.intel-btn.drive:hover { background: #e0f2fe; }
.intel-btn.drive.loading { color: #94a3b8; border-color: #e2e8f0; cursor: default; }
.intel-btn.drive.done { color: #10b981; border-color: #d1fae5; background: rgba(16,185,129,0.08); text-decoration: none; }
.intel-btn.drive.done:hover { background: #d1fae5; }
.intel-btn.drive.error { color: #ef4444; border-color: #fee2e2; }
.intel-btn.drive.error:hover { background: #fee2e2; }

/* ─── EMPTY STATE ──────────────────────────────────── */
.intel-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #999);
}

.intel-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.intel-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #666);
    margin-bottom: 6px;
}

.intel-empty-desc {
    font-size: 12px;
    line-height: 1.5;
}

/* ─── ACCOUNTS TAB ─────────────────────────────────── */
.intel-accounts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.intel-platform-section {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #eee);
    border-radius: 10px;
    overflow: hidden;
}

.intel-platform-header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light, #eee);
}

.intel-platform-header.instagram { background: linear-gradient(135deg, rgba(240,148,51,0.1), rgba(220,39,67,0.1)); color: #dc2743; }
.intel-platform-header.tiktok { background: rgba(1,1,1,0.05); color: var(--text-primary, #333); }
.intel-platform-header.twitter { background: rgba(29,161,242,0.08); color: #1DA1F2; }

.intel-account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle, #f9f9f9);
    transition: background 0.15s;
}

.intel-account-type-section .intel-account-row:last-of-type { border-bottom: none; }
.intel-account-row:hover { background: var(--tag-bg, #fafafa); }

.intel-account-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.intel-account-info {
    flex: 1;
    min-width: 0;
}

.intel-account-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intel-account-meta {
    font-size: 10px;
    color: var(--text-muted, #999);
}

.intel-account-actions {
    display: flex;
    gap: 4px;
}

.intel-icon-btn {
    padding: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted, #999);
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.15s;
}

.intel-icon-btn:hover { background: var(--tag-bg, #f0f0f0); color: var(--text-primary, #333); }
.intel-icon-btn.delete:hover { color: #ef4444; background: #fee2e2; }

.intel-add-account-form {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-light, #eee);
    background: var(--tag-bg, #fafafa);
}

.intel-input {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid var(--border-light, #eee);
    border-radius: 6px;
    font-size: 11px;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #333);
    outline: none;
}

.intel-input:focus { border-color: #7c3aed; }

.intel-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}

.intel-add-btn {
    padding: 5px 12px;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.intel-add-btn:hover { background: #6d28d9; }
.intel-add-btn.secondary { background: transparent; border: 1px solid #7c3aed; color: #a78bfa; }
.intel-add-btn.secondary:hover { background: rgba(124,58,237,0.15); color: #c4b5fd; }

/* ─── ACCOUNT TYPE SECTIONS ─────────────────────────── */
.intel-account-type-section {
    border-bottom: 1px solid var(--border-light, #eee);
}
.intel-account-type-section:last-child { border-bottom: none; }

.intel-account-type-label {
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}
.intel-account-type-label.reference {
    color: #6366f1;
    background: rgba(99,102,241,0.06);
    border-bottom: 1px solid rgba(99,102,241,0.12);
}
.intel-account-type-label.own {
    color: #db2777;
    background: rgba(219,39,119,0.06);
    border-bottom: 1px solid rgba(219,39,119,0.12);
}
.intel-account-type-count {
    background: var(--border-light, #eee);
    color: var(--text-muted, #999);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 600;
}
.intel-account-type-empty {
    padding: 8px 14px;
    font-size: 10px;
    color: var(--text-muted, #bbb);
    font-style: italic;
}

/* ─── MODEL PROFILES TAB ───────────────────────────── */
.intel-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

/* ─── GLARE CARD (Aceternity-style 3D tilt + shine) ── */
.glare-card {
    position: relative;
    border-radius: 14px;
    background: linear-gradient(145deg, #18181b 0%, #1e1b2e 50%, #18181b 100%);
    border: 1px solid rgba(124, 58, 237, 0.15);
    padding: 2px;
    cursor: pointer;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.5s ease, box-shadow 0.4s ease;
}
.glare-card:hover {
    box-shadow:
        0 8px 32px rgba(124, 58, 237, 0.2),
        0 0 0 1px rgba(124, 58, 237, 0.25);
}

.glare-card-shine {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.glare-card-border {
    position: absolute;
    inset: -1px;
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 1.5px;
}

.glare-card-content {
    position: relative;
    z-index: 2;
    padding: 18px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Header: avatar + nombre + acciones */
.glare-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.glare-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.glare-card-name {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: #f0eef6;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glare-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.glare-card:hover .glare-card-actions {
    opacity: 1;
}

.glare-card-action {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #a5a3b3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.glare-card-action:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #c4b5fd;
}
.glare-card-action.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Aesthetic description */
.glare-card-aesthetic {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags */
.glare-card-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.glare-card-tag {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(124, 58, 237, 0.12);
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.15);
    letter-spacing: 0.2px;
}

/* Platform icons */
.glare-card-platforms {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #6b7280;
}
.glare-card-platforms svg {
    opacity: 0.6;
    transition: opacity 0.15s;
}
.glare-card-platforms svg:hover {
    opacity: 1;
    color: #c4b5fd;
}

/* CTA button */
.glare-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
    padding: 9px 0;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(219, 39, 119, 0.1) 100%);
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.glare-card-btn:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3) 0%, rgba(219, 39, 119, 0.2) 100%);
    color: #ede9fe;
    transform: translateY(-1px);
}
.glare-card-btn svg {
    transition: transform 0.2s;
}
.glare-card-btn:hover svg {
    transform: translateX(3px);
}

/* ─── ASSIGNMENTS TAB ──────────────────────────────── */
.intel-assignments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intel-assignment-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #eee);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.intel-assignment-thumb {
    width: 60px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--tag-bg, #f0f0f0);
}

.intel-assignment-body {
    flex: 1;
    min-width: 0;
}

.intel-assignment-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.intel-assignment-model {
    font-size: 13px;
    font-weight: 700;
    color: #7c3aed;
}

.intel-assignment-date {
    font-size: 10px;
    color: var(--text-muted, #999);
    margin-left: auto;
}

.intel-assignment-caption {
    font-size: 11px;
    color: var(--text-secondary, #666);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.intel-assignment-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.status-sent { background: #dbeafe; color: #2563eb; }
.status-in_production { background: #fef3c7; color: #d97706; }
.status-published { background: #d1fae5; color: #059669; }
.status-rejected { background: #fee2e2; color: #dc2626; }

/* Feedback stars */
.intel-feedback-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 12px;
}

/* ─── MODALS ───────────────────────────────────────── */
.intel-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    animation: intel-fade-in 0.2s ease;
}

@keyframes intel-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.intel-modal {
    background: #141414;
    border: 1px solid #272727;
    border-radius: 18px;
    width: 540px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,58,237,0.08);
    animation: intel-slide-up 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}

@keyframes intel-slide-up {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.intel-modal-header {
    padding: 20px 22px 18px;
    background: linear-gradient(135deg, #1c1030 0%, #0e0e18 100%);
    border-bottom: 1px solid rgba(124,58,237,0.18);
    border-radius: 18px 18px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.intel-modal-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2px;
}

.intel-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
}

.intel-modal-close:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
    transform: rotate(90deg);
}

.intel-modal-body {
    padding: 20px 22px;
    background: #141414;
}

.intel-modal-footer {
    padding: 14px 22px;
    background: #0f0f0f;
    border-top: 1px solid #1e1e1e;
    border-radius: 0 0 18px 18px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Botones en el footer del modal */
.intel-modal-footer .intel-btn {
    padding: 9px 20px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    flex: none !important;
    letter-spacing: 0.2px;
    transition: all 0.2s ease !important;
}

.intel-modal-footer .intel-btn:not(.primary) {
    background: #1c1c1c !important;
    border: 1px solid #2e2e2e !important;
    color: #9ca3af !important;
}

.intel-modal-footer .intel-btn:not(.primary):hover {
    background: #252525 !important;
    border-color: #444 !important;
    color: #e5e7eb !important;
    transform: none !important;
}

.intel-modal-footer .intel-btn.primary {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 2px 14px rgba(124,58,237,0.35) !important;
}

.intel-modal-footer .intel-btn.primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 22px rgba(124,58,237,0.5) !important;
}

/* Botones pequeños en el body (URLs) */
.intel-modal-body .intel-btn {
    background: #1e1e1e !important;
    border: 1px solid #2e2e2e !important;
    color: #9ca3af !important;
    border-radius: 8px !important;
    transition: all 0.15s !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
}

.intel-modal-body .intel-btn:hover {
    background: #272727 !important;
    border-color: #7c3aed !important;
    color: #d1d5db !important;
    transform: none !important;
}

/* Video detail preview */
.intel-video-preview {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px;
    background: #1a1a1a;
    border: 1px solid #252525;
    border-radius: 12px;
}

.intel-video-preview-thumb {
    width: 76px;
    height: 102px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #333;
    background: #222;
    flex-shrink: 0;
}

.intel-video-preview-info {
    flex: 1;
    min-width: 0;
}

.intel-modal-label {
    font-size: 10px;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    margin-bottom: 8px;
    display: block;
    margin-top: 16px;
}

.intel-modal-label:first-child { margin-top: 0; }

/* Input en modal */
.intel-modal-body .intel-input {
    background: #1a1a1a !important;
    border: 1px solid #272727 !important;
    color: #d1d5db !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

.intel-modal-body .intel-input:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.12) !important;
    outline: none !important;
}

/* Model selector */
.intel-model-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}

.intel-model-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid #272727;
    background: #1a1a1a;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.intel-model-option:hover { border-color: #7c3aed; background: rgba(124,58,237,0.08); }
.intel-model-option.selected { border-color: #7c3aed; background: rgba(124,58,237,0.15); }
.intel-model-option.already-sent { opacity: 0.4; cursor: not-allowed; }
.intel-model-option.already-sent:hover { border-color: #272727; background: #1a1a1a; }

.intel-model-option-name {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
    color: #e5e7eb;
}

.intel-model-option-badge {
    font-size: 10px;
    color: #f87171;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Briefing / caption preview */
.intel-briefing-preview {
    background: #1a1a1a;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.65;
    color: #b0b8c4;
    margin-top: 8px;
    white-space: pre-wrap;
    min-height: 48px;
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}

/* Sent badges */
.intel-sent-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.25);
    color: #10b981;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* Textarea */
.intel-textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #272727;
    border-radius: 10px;
    font-size: 12px;
    color: #d1d5db;
    background: #1a1a1a;
    resize: vertical;
    min-height: 80px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.5;
}

.intel-textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

/* ─── ADD VIDEO MANUAL FORM ─────────────────────────── */
.intel-add-video-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.intel-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.intel-form-group.full { grid-column: 1 / -1; }

.intel-form-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── LOADING ───────────────────────────────────────── */
.intel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted, #999);
    font-size: 13px;
    gap: 10px;
}

.intel-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light, #eee);
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: intel-spin 0.8s linear infinite;
}

@keyframes intel-spin {
    to { transform: rotate(360deg); }
}

/* ─── TOAST ─────────────────────────────────────────── */
.intel-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    animation: intel-toast-in 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

@keyframes intel-toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.intel-toast.success { background: #10b981; }
.intel-toast.error { background: #ef4444; }
.intel-toast.info { background: #7c3aed; }

/* ─── DARK MODE ─────────────────────────────────────── */
[data-theme="dark"] .intel-model-tag { background: rgba(124,58,237,0.2); }
[data-theme="dark"] .intel-briefing-preview { background: rgba(124,58,237,0.1); border-color: rgba(124,58,237,0.3); }
[data-theme="dark"] .intel-model-option:hover { background: rgba(124,58,237,0.15); }
[data-theme="dark"] .intel-model-option.selected { background: rgba(124,58,237,0.2); }
[data-theme="dark"] .intel-platform-header.instagram { background: rgba(240,148,51,0.07); }
[data-theme="dark"] .intel-platform-header.tiktok { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .intel-platform-header.twitter { background: rgba(29,161,242,0.07); }

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 1200px) {
    .intel-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .intel-accounts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .intel-stats-bar { flex-wrap: wrap; }
    .intel-stat { min-width: 80px; }
}

/* ══════════════════════════════════════════════════════════════
   STORIES PLANNER TAB — diseño fullscreen
   ══════════════════════════════════════════════════════════════ */

/* Container base: ocupa todo el espacio disponible */
.stories-container {
    width: 100%;
    min-height: calc(100vh - 220px);
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ── Botones globales ────────────────────────────────────────── */
.stories-btn-primary {
    padding: 11px 22px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.stories-btn-primary:hover  { background: #6d28d9; }
.stories-btn-primary:active { transform: scale(0.97); }
.stories-btn-secondary {
    padding: 11px 22px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.stories-btn-secondary:hover { border-color: #7c3aed; color: #a78bfa; }

/* ── Vista SETUP ─────────────────────────────────────────────── */
.stories-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 48px 24px;
    text-align: center;
}

.stories-setup-hero {
    font-size: 56px;
    margin-bottom: 12px;
    line-height: 1;
    filter: drop-shadow(0 0 24px rgba(124,58,237,0.4));
}

.stories-setup-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.stories-setup-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 420px;
}

.stories-setup-form {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.stories-model-select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    font-size: 15px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}
.stories-model-select:focus { outline: none; border-color: #7c3aed; }

.stories-plan-type-toggle {
    display: flex;
    gap: 8px;
    width: 100%;
}

.stories-plan-type-btn {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.stories-plan-type-btn.active {
    background: rgba(124,58,237,0.12);
    color: #a78bfa;
    border-color: #7c3aed;
    font-weight: 700;
}

.stories-setup-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}
.stories-setup-actions .stories-btn-primary  { flex: 1; padding: 14px; font-size: 14px; border-radius: 12px; }
.stories-setup-actions .stories-btn-secondary { flex: 1; padding: 14px; font-size: 14px; border-radius: 12px; }

/* ── Vista de CARPETAS ───────────────────────────────────────── */
.stories-folders-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px 32px;
}

.stories-folders-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stories-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 14px;
    min-width: 0;
}

.stories-crumb-item {
    color: #a78bfa;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.stories-crumb-item:hover { background: rgba(124,58,237,0.12); }

.stories-crumb-sep { color: var(--text-muted); font-size: 16px; }

.stories-folders-actions { display: flex; gap: 8px; flex-shrink: 0; }

.stories-folders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.stories-folder-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.stories-folder-row:hover {
    border-color: #7c3aed;
    background: rgba(124,58,237,0.05);
    transform: translateY(-1px);
}
.stories-folder-icon { font-size: 22px; flex-shrink: 0; }
.stories-folder-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.stories-folder-arrow { font-size: 18px; color: var(--text-muted); flex-shrink: 0; }
.stories-folders-empty { padding: 40px 0; font-size: 14px; color: var(--text-muted); text-align: center; grid-column: 1/-1; }

/* ── Timeline del PLAN ───────────────────────────────────────── */
.stories-plan-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* permite que flex shrink funcione correctamente */
}

.stories-plan-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0; /* nunca se encoge — siempre visible */
    padding: 18px 32px 14px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary, #0a0a0a);
}

.stories-plan-title { font-size: 16px; font-weight: 800; flex: 1; color: var(--text-primary); }

/* Contenedor scrolleable del timeline (header queda fijo arriba) */
.stories-timeline-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px 32px;
}

.stories-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
    align-items: start;
}

.stories-day-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
}
.stories-day-header {
    padding: 10px 16px;
    background: rgba(124,58,237,0.08);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}
.stories-day-date { font-weight: 700; }
.stories-day-theme {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 8px;
    border-radius: 8px;
    margin: 0 8px;
    /* conexión = verde, storytelling = morado */
    color: #a78bfa;
    background: rgba(124,58,237,0.12);
}
.stories-day-theme.conexion {
    color: #34d399;
    background: rgba(16,185,129,0.12);
}
.stories-day-theme.visual {
    color: #f59e0b;
    background: rgba(245,158,11,0.12);
}
.stories-day-count { font-weight: 400; color: var(--text-muted); }
.stories-day-stories { padding: 8px; display: flex; flex-direction: column; gap: 6px; }

/* Story items */
.stories-story-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.02); }
.stories-story-item.lifestyle    { border-left: 3px solid #10b981; }
.stories-story-item.hook         { border-left: 3px solid #f97316; }
.stories-story-item.bts          { border-left: 3px solid #eab308; }
.stories-story-item.emotional    { border-left: 3px solid #8b5cf6; }
.stories-story-item.social_proof { border-left: 3px solid #3b82f6; }
.stories-story-item.poll         { border-left: 3px solid #06b6d4; }
.stories-story-item.seductora    { border-left: 3px solid #ec4899; }
.stories-story-item.countdown    { border-left: 3px solid #ef4444; }
.stories-story-item.conversion   { border-left: 3px solid #7c3aed; }
.stories-story-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; cursor: pointer; transition: opacity 0.15s; }
.stories-story-thumb:hover { opacity: 0.8; }
.stories-story-thumb-placeholder { width: 44px; height: 44px; border-radius: 6px; background: var(--tag-bg); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stories-story-body { flex: 1; min-width: 0; }
.stories-story-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }

/* Botón marcar story como subida */
.stories-upload-check { margin-left: auto; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border-light); background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.stories-upload-check:hover { border-color: #10b981; color: #10b981; }
.stories-upload-check.done { background: #10b981; color: #fff; border-color: #10b981; }
.stories-upload-check.done:hover { background: #059669; border-color: #059669; }
.stories-copy-btn, .stories-download-btn { background: none; border: none; cursor: pointer; font-size: 14px; opacity: 0.5; padding: 2px 4px; border-radius: 4px; text-decoration: none; transition: opacity 0.15s; }
.stories-copy-btn:hover, .stories-download-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }

/* Story marcada como subida */
.stories-story-item.uploaded { opacity: 0.45; }
.stories-story-item.uploaded .stories-story-caption { text-decoration: line-through; }
.stories-story-badge { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.stories-story-badge.lifestyle    { background: #d1fae5; color: #065f46; }
.stories-story-badge.hook         { background: #ffedd5; color: #9a3412; }
.stories-story-badge.bts          { background: #fef9c3; color: #713f12; }
.stories-story-badge.emotional    { background: #ede9fe; color: #4c1d95; }
.stories-story-badge.social_proof { background: #dbeafe; color: #1e3a8a; }
.stories-story-badge.poll         { background: #cffafe; color: #164e63; }
.stories-story-badge.seductora    { background: #fce7f3; color: #9d174d; }
.stories-story-badge.countdown    { background: #fee2e2; color: #7f1d1d; }
.stories-story-badge.conversion   { background: #f5f3ff; color: #5b21b6; }
.stories-story-time { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.stories-story-file { font-size: 10px; color: var(--text-secondary); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stories-story-caption { font-size: 11px; color: var(--text-secondary); line-height: 1.5; font-style: italic; }

/* ── Historial ───────────────────────────────────────────────── */
.stories-history-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px 32px;
}

.stories-history-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.stories-history-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.stories-history-row:hover { border-color: #7c3aed; transform: translateY(-1px); }
.stories-history-info { flex: 1; }
.stories-history-title { font-size: 14px; font-weight: 600; }
.stories-history-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.stories-history-count { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.stories-status-badge { font-size: 10px; padding: 3px 10px; border-radius: 10px; font-weight: 600; }
.stories-status-badge.draft  { background: #fef3c7; color: #92400e; }
.stories-status-badge.active { background: #d1fae5; color: #065f46; }
.stories-history-delete {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.4;
    padding: 4px 6px;
    border-radius: 6px;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
}
.stories-history-delete:hover { opacity: 1; background: rgba(239,68,68,0.12); }

/* ─── BRIEFINGS ──────────────────────────────────────────────────────────── */
.stories-briefing-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.stories-briefing-divider::before,
.stories-briefing-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}
.stories-btn-briefing {
    flex: 1;
    padding: 9px 14px;
    background: var(--tag-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s;
}
.stories-btn-briefing:hover { border-color: #7c3aed; color: #7c3aed; }
.stories-btn-briefing-export {
    padding: 7px 14px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.stories-btn-briefing-export:hover { background: #6d28d9; }

.stories-briefing-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 24px;
}
.stories-briefing-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 12px;
}
.stories-briefing-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Clases usadas en el HTML generado (briefing) */
.bf-section { background: var(--bg-card); border-left: 4px solid #7c3aed; padding: 12px 16px; margin-bottom: 14px; border-radius: 8px; }
.bf-section h2 { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.bf-item { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.bf-item:last-child { border-bottom: none; }
.bf-badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 9px; font-weight: 700; text-transform: uppercase; vertical-align: middle; }
.bf-badge.seq    { background: #fce7f3; color: #9d174d; }
.bf-badge.single { background: #ede9fe; color: #5b21b6; }
.bf-count { font-weight: 700; color: #7c3aed; }
.bf-tip { background: rgba(245,158,11,0.1); border-left: 3px solid #f59e0b; padding: 8px 12px; margin-top: 8px; font-size: 12px; color: var(--text-secondary); border-radius: 4px; }
.bf-gap { background: rgba(239,68,68,0.08); border-left: 3px solid #ef4444; padding: 10px 14px; margin-bottom: 8px; border-radius: 4px; font-size: 12px; }
.bf-ok  { background: rgba(16,185,129,0.08); border-left: 3px solid #10b981; padding: 10px 14px; margin-bottom: 8px; border-radius: 4px; font-size: 12px; }

/* Drive scan loader */
.stories-drive-scan {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.stories-scan-icon {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.stories-scan-emoji {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    z-index: 2;
}

.stories-scan-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #7c3aed;
    animation: stories-spin 1.1s linear infinite;
}

.stories-scan-ring--2 {
    inset: 8px;
    border-top-color: #a78bfa;
    animation-duration: 0.9s;
    animation-direction: reverse;
}

.stories-scan-ring--3 {
    inset: 16px;
    border-top-color: #c4b5fd;
    animation-duration: 1.4s;
}

@keyframes stories-spin {
    to { transform: rotate(360deg); }
}

.stories-scan-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stories-scan-model {
    font-size: 13px;
    color: #a78bfa;
    font-weight: 600;
    margin-bottom: 16px;
}

.stories-scan-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.stories-scan-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7c3aed;
    opacity: 0.3;
    animation: stories-dot-pulse 1.2s ease-in-out infinite;
}

.stories-scan-dots span:nth-child(2) { animation-delay: 0.2s; }
.stories-scan-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes stories-dot-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.3); }
}

.stories-scan-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Opciones avanzadas (idea #5) ────────────────────────────────────────── */
.stories-options-details {
    width: 100%;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
}
.stories-options-summary {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}
.stories-options-summary::-webkit-details-marker { display: none; }
.stories-options-summary:hover { background: rgba(124,58,237,0.06); }
.stories-options-details[open] .stories-options-summary { color: #a78bfa; border-bottom: 1px solid var(--border-light); }
.stories-options-hint { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.stories-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(124,58,237,0.03);
}
.stories-option-field { display: flex; flex-direction: column; gap: 5px; }
.stories-option-field--full { grid-column: 1 / -1; }
.stories-option-field label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.stories-option-select, .stories-option-input {
    padding: 9px 12px;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.15s;
}
.stories-option-select:focus, .stories-option-input:focus { outline: none; border-color: #7c3aed; }
.stories-option-select { appearance: none; cursor: pointer; }

.stories-option-input::placeholder { color: var(--text-muted); }

/* ─── TAB IDEAS ──────────────────────────────────────────────────────────── */

.intel-ideas-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.ideas-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ideas-model-select {
    flex: 1;
    min-width: 160px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.ideas-actions-group {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ideas-action-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    background: #7c3aed;
    color: #fff;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.ideas-action-btn:hover { opacity: 0.85; }
.ideas-action-btn.secondary { background: var(--bg-card); border: 1.5px solid var(--border-light); color: var(--text-primary); }
.ideas-action-btn.secondary:hover { border-color: #7c3aed; color: #7c3aed; }

/* ── Tab bar Pending / Completed ── */
.ideas-tab-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    padding-bottom: 4px;
}

.ideas-tabs-left {
    display: flex;
    gap: 4px;
}

.ideas-tab-btn {
    padding: 6px 16px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--text-muted, #888);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ideas-tab-btn:hover { color: var(--text-primary, #e5e7eb); }

.ideas-tab-btn.active {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.ideas-tab-count {
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
}

.ideas-mark-all-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--border-light, #333);
    background: transparent;
    color: var(--text-secondary, #aaa);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.ideas-mark-all-btn:hover {
    background: var(--bg-hover, #1e1e1e);
    color: var(--text-primary, #e5e7eb);
    border-color: #555;
}

.ideas-grid {
    flex: 1;
    overflow-y: auto;
    align-content: start;
}

/* ── Separador de día (línea centrada estilo WhatsApp) ── */
.ideas-day-separator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 4px;
    margin: 4px 0;
}
.ideas-day-separator::before,
.ideas-day-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(124, 58, 237, 0.15);
}
.ideas-day-separator span {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ideas-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Tarjeta de idea (portal-style) ── */
.idea-content-card {
    background: #111;
    border: 1px solid #1e1e1e;
    border-radius: 14px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    position: relative;
}
.idea-content-card:hover { border-color: #3a3a3a; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.5); }

/* Thumbnail portrait */
.idea-card-thumb {
    position: relative;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #1a1a1a;
    flex-shrink: 0;
    border-radius: 14px 14px 0 0;
}
.idea-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.idea-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #333;
    background: #1a1a1a;
}

/* Platform badge — top left with real SVG */
.idea-plat-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.idea-plat-badge svg { flex-shrink: 0; }

/* Date overlay — below platform badge */
.idea-date-overlay {
    position: absolute;
    top: 34px;
    left: 8px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    color: #d1d5db;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    z-index: 2;
    white-space: nowrap;
}

/* Action buttons row — top right, always visible */
.idea-thumb-actions-row {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
    align-items: center;
    z-index: 5;
}

.idea-card-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #dc2626;
    transition: opacity 0.15s;
}

.idea-thumb-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s;
    text-decoration: none;
}
.idea-thumb-action-btn:hover { background: rgba(0,0,0,0.85); }
.idea-thumb-action-btn.disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.idea-thumb-action-btn.danger:hover { background: rgba(220,38,38,0.6); }

/* Stats pills — bottom right of thumbnail */
.idea-stats-col {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    z-index: 2;
}
.idea-stat-pill {
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

/* Viral score badge — bottom left of thumbnail */
.idea-viral-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    z-index: 3;
    cursor: default;
}
.idea-viral-badge svg { width: 14px; height: 14px; }

/* Global viral tooltip (position: fixed) */
.idea-viral-tooltip-global {
    display: none;
    position: fixed;
    width: 220px;
    background: rgba(15,15,15,0.97);
    backdrop-filter: blur(12px);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #d1d5db;
    line-height: 1.5;
    z-index: 20000;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

/* Done label below thumbnail */
.idea-done-label {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    color: #22c55e;
}

/* Estado seleccionado */
.idea-card--selected {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220,38,38,0.35) !important;
}

/* Info debajo de la imagen */
.idea-card-info {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.idea-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.idea-card-notes {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Caption toggle (expandable) */
.idea-caption-toggle {
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-top: 1px solid #1e1e1e;
    background: transparent;
    color: #9ca3af;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.15s;
}
.idea-caption-toggle:hover { color: #e5e7eb; }
.idea-caption-arrow { transition: transform 0.2s; }
.idea-caption-toggle.open .idea-caption-arrow { transform: rotate(180deg); }

.idea-caption-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.idea-caption-toggle.open + .idea-caption-content {
    max-height: 200px;
}
.idea-caption-inner {
    padding: 6px 10px 10px;
    border-top: 1px solid #1e1e1e;
}
.idea-caption-text {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.45;
    margin-bottom: 6px;
}
.idea-caption-source {
    font-size: 11px;
    color: #7c3aed;
    text-decoration: none;
}
.idea-caption-source:hover { text-decoration: underline; }

/* ── Bulk bar fija (bottom) ── */
.ideas-bulk-bar-fixed {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20,20,30,0.95);
    backdrop-filter: blur(16px);
    border: 1px solid #333;
    border-radius: 14px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 15000;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    animation: bulkBarSlideUp 0.25s ease;
}
@keyframes bulkBarSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.ideas-bulk-left { display: flex; align-items: center; gap: 8px; }
.ideas-bulk-count {
    font-size: 13px;
    font-weight: 600;
    color: #d1d5db;
    white-space: nowrap;
}
.ideas-bulk-actions { display: flex; gap: 8px; }
.ideas-bulk-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.ideas-bulk-action-btn:active { transform: scale(0.97); }
.ideas-bulk-action-btn.delete { background: #dc2626; color: white; }
.ideas-bulk-action-btn.delete:hover { background: #ef4444; }
.ideas-bulk-action-btn.transfer { background: #7c3aed; color: white; }
.ideas-bulk-action-btn.transfer:hover { background: #8b5cf6; }
.ideas-bulk-action-btn.complete { background: #22c55e; color: white; }
.ideas-bulk-action-btn.complete:hover { background: #16a34a; }

/* ── Transfer modal ── */
.transfer-modal {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 24px;
    width: 420px;
    max-width: 95vw;
}
.transfer-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.transfer-modal-header h3 { margin: 0; color: #fff; font-size: 18px; }
.transfer-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
}
.transfer-modal-subtitle {
    color: #9ca3af;
    font-size: 13px;
    margin: 0 0 16px;
}
.transfer-modal-label {
    display: block;
    color: #aaa;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.transfer-modal-select {
    width: 100%;
    background: #0d0d1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}
.transfer-modal-actions {
    display: flex;
    gap: 10px;
}
.transfer-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.transfer-btn.transfer {
    background: #7c3aed;
    color: white;
}
.transfer-btn.transfer:hover { background: #8b5cf6; }
.transfer-btn.transfer-remove {
    background: #dc2626;
    color: white;
}
.transfer-btn.transfer-remove:hover { background: #ef4444; }

/* ══════════════════════════════════════════════
   MODAL ACCESOS — Rediseño completo
   ══════════════════════════════════════════════ */

/* Overlay */
.access-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: accessFadeIn 0.25s ease-out forwards;
}
@keyframes accessFadeIn {
    to { opacity: 1; }
}

/* Container */
.access-modal {
    background: linear-gradient(165deg, #1a1a2e 0%, #16162a 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    padding: 0;
    width: 580px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    animation: accessSlideUp 0.3s ease-out forwards;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 40px rgba(124,58,237,0.08);
}
@keyframes accessSlideUp {
    to { transform: translateY(0) scale(1); }
}

/* Header */
.access-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.access-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.access-modal-header h3 svg {
    width: 18px; height: 18px;
    color: #7c3aed;
}
.access-modal-close {
    background: none;
    border: none;
    color: #555;
    font-size: 18px;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.access-modal-close:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

/* Portal link bar */
.access-portal-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(124, 58, 237, 0.06);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.access-portal-bar-label {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}
.access-portal-bar-url {
    font-size: 13px;
    color: #a78bfa;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: rgba(0,0,0,0.3);
    padding: 6px 12px;
    border-radius: 8px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.access-portal-bar-copy {
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: #a78bfa;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.access-portal-bar-copy:hover {
    background: rgba(124, 58, 237, 0.3);
    color: #c4b5fd;
}
.access-portal-bar-copy.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

/* Body scrollable */
.access-modal-body {
    padding: 16px 24px 20px;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

/* Section label */
.access-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #555;
    margin-bottom: 10px;
}

/* Credential cards */
.access-cred-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.access-cred-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.access-cred-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(124, 58, 237, 0.15);
}
.access-cred-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #7c3aed;
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity 0.2s;
}
.access-cred-card:hover::before {
    opacity: 1;
}

/* Avatar */
.access-cred-avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

/* Info block */
.access-cred-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Row 1: Name + username + status */
.access-cred-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
}
.access-cred-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.access-cred-user {
    font-size: 11px;
    color: #a78bfa;
    font-family: 'SF Mono', 'Fira Code', monospace;
    opacity: 0.8;
}

/* Status badge (inline in row 1) */
.access-cred-status {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}
.access-cred-status.active {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}
.access-cred-status.inactive {
    background: rgba(255,255,255,0.05);
    color: #555;
}

/* Row 2: Details (last login, accounts, ideas) */
.access-cred-row2 {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}
.access-cred-sep {
    color: #333;
    font-size: 10px;
    margin: 0 6px;
}
.access-cred-detail {
    font-size: 11px;
    color: #666;
    position: relative;
    cursor: default;
}
.access-cred-detail.has-tip {
    color: #888;
    cursor: help;
    border-bottom: 1px dotted rgba(255,255,255,0.15);
}
.access-cred-detail.has-tip:hover {
    color: #a78bfa;
    border-bottom-color: rgba(124, 58, 237, 0.3);
}
.access-cred-detail.pending {
    color: #f59e0b;
}
.access-cred-detail.done {
    color: #4ade80;
}

/* Tooltip for details */
.access-cred-detail[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    background: #16162a;
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: #ddd;
    font-size: 10px;
    font-weight: 400;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.access-cred-detail[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Actions on card */
.access-cred-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.access-cred-action {
    width: 32px; height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.access-cred-action:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.access-cred-action.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
.access-cred-action svg {
    width: 14px; height: 14px;
}

/* Inline edit row */
.access-cred-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.access-edit-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    padding: 7px 10px;
    outline: none;
    flex: 1;
    min-width: 80px;
    font-family: inherit;
}
.access-edit-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}
.access-edit-save {
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    white-space: nowrap;
}
.access-edit-save:hover { background: #6d28d9; }
.access-edit-save:disabled { opacity: 0.5; cursor: wait; }
.access-edit-cancel {
    background: transparent;
    color: #666;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 12px;
    padding: 7px 14px;
    cursor: pointer;
    white-space: nowrap;
}
.access-edit-cancel:hover { color: #fff; border-color: rgba(255,255,255,0.2); }

/* Divider */
.access-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 16px 0;
}

/* New access form */
.access-new-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px dashed rgba(124, 58, 237, 0.25);
    color: #7c3aed;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}
.access-new-toggle:hover {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.4);
    color: #a78bfa;
}
.access-new-toggle svg {
    width: 16px; height: 16px;
}

/* Form area */
.access-form {
    background: rgba(124, 58, 237, 0.04);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 12px;
    padding: 18px;
    animation: accessFormSlide 0.25s ease-out forwards;
}
@keyframes accessFormSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.access-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.access-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.access-form-field.full-width {
    grid-column: 1 / -1;
}
.access-form-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}
.access-form-select,
.access-form-input {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    transition: all 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.access-form-select:focus,
.access-form-input:focus {
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}
.access-form-select option {
    background: #1a1a2e;
}

/* Password field with toggle */
.access-pw-wrapper {
    position: relative;
}
.access-pw-wrapper input {
    padding-right: 40px;
}
.access-pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}
.access-pw-toggle:hover {
    color: #aaa;
    background: rgba(255,255,255,0.05);
}
.access-pw-toggle svg {
    width: 16px; height: 16px;
}

/* Submit button */
.access-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.access-form-submit {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.access-form-submit:hover {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
.access-form-submit:active {
    transform: translateY(0);
}
.access-form-submit.saving {
    opacity: 0.7;
    pointer-events: none;
}
.access-form-cancel {
    background: rgba(255,255,255,0.06);
    border: none;
    color: #888;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.access-form-cancel:hover {
    background: rgba(255,255,255,0.1);
    color: #aaa;
}

/* Empty state */
.access-empty {
    text-align: center;
    padding: 24px 0 8px;
}
.access-empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.6;
}
.access-empty-text {
    font-size: 13px;
    color: #555;
}

/* Counter badge */
.access-count {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
}

.idea-scrape-preview-inner { display: flex; gap: 12px; align-items: flex-start; }
