/* ═══════════════════════════════════════════
   INTELLIGENCE REPORT — Estilos
   ═══════════════════════════════════════════ */

/* ── Toast animation ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; display: inline-block; }

/* ── Page Header (match BI style) ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* En móvil `styles.css` pasa la cabecera a `flex-direction: column` con
   `align-items: stretch`, pero el `align-items: center` de acá NO está dentro de
   ninguna media query y este archivo carga DESPUÉS de styles.css, así que le ganaba
   siempre. Con dirección columna, ese `center` centraba horizontalmente el botón de
   menú y el título (en el chat se veía bien porque su cabecera es otra). */
@media (max-width: 480px) {
    .page-header { align-items: stretch; }
    .page-header-left,
    .page-header-right { width: 100%; justify-content: flex-start; }
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.page-header-left h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.page-icon {
    font-size: 1.5rem;
    color: var(--accent-blue);
}
.page-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Report Grid ── */
.rpt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 4px 0;
}

/* ── Report Card ── */
.rpt-card {
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.rpt-card:hover {
    border-color: var(--accent-blue, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.1);
}
.rpt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.rpt-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.rpt-card-icon .material-symbols-rounded { font-size: 22px; }
.rpt-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.rpt-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.rpt-badge-draft       { background: rgba(156,163,175,0.15); color: #9ca3af; }
.rpt-badge-published   { background: rgba(16,185,129,0.15);  color: #10b981; }
.rpt-badge-archived    { background: rgba(107,114,128,0.15); color: #6b7280; }
.rpt-badge-pub         { background: rgba(99,102,241,0.15);  color: var(--accent-blue); }
.rpt-badge-sched       { background: rgba(245,158,11,0.15);  color: #f59e0b; }

.rpt-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text-primary, #f1f5f9);
}
.rpt-card-desc {
    font-size: 13px;
    color: var(--text-secondary, #9ca3af);
    margin: 0 0 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rpt-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}
.rpt-card-footer span { display: flex; align-items: center; gap: 4px; }
.rpt-card-db {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--accent-blue, #3b82f6);
    opacity: 0.85;
}
.rpt-card-actions {
    position: absolute;
    top: 12px; right: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}
.rpt-card:hover .rpt-card-actions { opacity: 1; }

/* ── Report Viewer ── */
.rpt-viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #353a44);
}
.rpt-viewer-toolbar .btn { font-size: 13px; }

/* ── Toolbar (editor view) ── */
.rpt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.rpt-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.rpt-toolbar-title h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rpt-toolbar-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.rpt-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.rpt-toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--bg-secondary);
    margin: 0 4px;
}
.rpt-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--accent-blue);
}
.rpt-export-group {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

#viewerTitle {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary, #f1f5f9);
}
#viewerDesc {
    font-size: 14px;
    color: var(--text-secondary, #9ca3af);
    margin: 0 0 16px;
}

/* ── Report Sections Grid ── */
.rpt-sections {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.rpt-sec-full  { grid-column: span 6; }
.rpt-sec-half  { grid-column: span 3; }
.rpt-sec-third { grid-column: span 2; }

@media (max-width: 768px) {
    .rpt-sections { grid-template-columns: 1fr; }

    /* `.rpt-sec-full` FALTABA acá y era la causa de que el reporte se viera roto en
       el celular: con la grilla en 1 columna, un hijo que pide `span 6` obliga a CSS
       Grid a crear 6 columnas implícitas. Medido: la grilla quedaba en
       "242px 151px 146px 0 0 0" dentro de un contenedor de 370px, así que los KPI se
       apretaban y la tabla se salía de la pantalla. */
    .rpt-sec-full, .rpt-sec-half, .rpt-sec-third { grid-column: span 1; }

    /* Los items de grid traen `min-width: auto`, así que el contenido más ancho
       (la tabla) impedía que la columna encogiera: quedaba de 619px en 370px.
       Con min-width:0 la columna se ajusta y la tabla scrollea DENTRO de su
       wrapper (que ya tiene overflow-x:auto), en vez de desbordar la página. */
    .rpt-sections,
    .rpt-sections > *,
    .rpt-section { min-width: 0; max-width: 100%; }

    /* La barra de acciones (Excel/Word/PDF/IA/…) medía 732px: tenía flex-wrap pero
       también flex-shrink:0, que le impedía encoger y por lo tanto envolver. */
    .rpt-toolbar-right {
        flex-shrink: 1;
        width: 100%;
        justify-content: flex-start;
    }
    .rpt-export-group { flex-wrap: wrap; }
}

/* ── Section Base ── */
.rpt-section {
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 12px;
    padding: 20px 20px 20px 24px;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.rpt-section:hover { border-color: var(--border-hover, #4b5563); }
.rpt-sec-actions {
    position: absolute;
    top: 10px; right: 10px;
    display: flex; gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}
.rpt-section:hover .rpt-sec-actions { opacity: 1; }
.rpt-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Header Section ── */
.rpt-sec-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(59,130,246,0.08));
    border: none;
    padding: 32px 28px;
    text-align: center;
}
.rpt-sec-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #f1f5f9);
}
.rpt-header-content {
    font-size: 15px;
    color: var(--text-secondary, #9ca3af);
    margin-top: 8px;
}

/* ── Text Section ── */
.rpt-text-content {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary, #f1f5f9);
}

/* ── KPI Section ── */
.rpt-sec-kpi {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.rpt-kpi-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.rpt-kpi-icon .material-symbols-rounded { font-size: 26px; }
.rpt-kpi-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 6px;
}
.rpt-kpi-label {
    font-size: 13px;
    color: var(--text-secondary, #9ca3af);
    font-weight: 500;
}

/* ── Chart Section ── */
.rpt-chart-container {
    height: 280px;
    position: relative;
}

/* ── Chart Context Menu ── */
.rpt-ctx-menu {
    position: fixed;
    z-index: 9999;
    min-width: 220px;
    background: var(--bg-card, #282c34);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
    padding: 6px;
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    backdrop-filter: blur(16px);
}
.rpt-ctx-menu.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}
.rpt-ctx-menu-header {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #6b7280);
    display: flex;
    align-items: center;
    gap: 6px;
}
.rpt-ctx-menu-divider {
    height: 1px;
    background: var(--border-color, #353a44);
    margin: 4px 6px;
}
.rpt-ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary, #e4e6eb);
    transition: background 0.12s;
    text-align: left;
}
.rpt-ctx-item:hover {
    background: var(--accent-blue-bg, rgba(59,130,246,0.12));
}
.rpt-ctx-item .material-symbols-rounded {
    font-size: 18px;
    color: var(--text-secondary, #9ca3af);
}
.rpt-ctx-item:hover .material-symbols-rounded {
    color: var(--accent-blue, #3b82f6);
}
.rpt-ctx-item-label { flex: 1; }
.rpt-ctx-item-hint {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}
/* submenu: chart type icons row */
.rpt-ctx-types {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    flex-wrap: wrap;
}
.rpt-ctx-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background: none;
    cursor: pointer;
    color: var(--text-secondary, #9ca3af);
    font-size: 10px;
    transition: all 0.12s;
    min-width: 48px;
}
.rpt-ctx-type-btn .material-symbols-rounded { font-size: 20px; }
.rpt-ctx-type-btn:hover {
    background: var(--accent-blue-bg, rgba(59,130,246,0.1));
    color: var(--accent-blue, #3b82f6);
}
.rpt-ctx-type-btn.active {
    border-color: var(--accent-blue, #3b82f6);
    background: var(--accent-blue-bg, rgba(59,130,246,0.12));
    color: var(--accent-blue, #3b82f6);
}
/* color swatches */
.rpt-ctx-colors {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    flex-wrap: wrap;
    align-items: center;
}
.rpt-ctx-swatch {
    width: 22px; height: 22px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.12s;
    position: relative;
}
.rpt-ctx-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.rpt-ctx-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--accent-blue, #3b82f6);
}
.rpt-ctx-swatch-custom {
    width: 22px; height: 22px;
    border-radius: 6px;
    border: 2px dashed var(--border-color, #353a44);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    transition: all 0.12s;
}
.rpt-ctx-swatch-custom:hover {
    border-color: var(--accent-blue, #3b82f6);
    color: var(--accent-blue, #3b82f6);
}
.rpt-ctx-swatch-custom input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}
/* bar info inside context menu */
.rpt-ctx-bar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 8px;
    font-size: 12px;
    color: var(--text-secondary, #9ca3af);
}
.rpt-ctx-bar-preview {
    width: 14px; height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ── Table Section ── */
.rpt-table-wrapper {
    overflow-x: auto;
    max-height: 400px;
}
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.rpt-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--bg-card, #23262d);
    color: var(--text-secondary, #9ca3af);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color, #353a44);
    position: sticky; top: 0;
    z-index: 1;
}
.rpt-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color, #353a44);
    color: var(--text-primary, #f1f5f9);
}
.rpt-table td.rpt-td-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.rpt-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.rpt-table-more {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    text-align: center;
    margin: 8px 0 0;
}
.rpt-no-data, .rpt-error {
    text-align: center;
    color: var(--text-muted, #6b7280);
    padding: 20px;
    font-size: 13px;
}
.rpt-error { color: #ef4444; }

/* ── Divider Section ── */
.rpt-sec-divider {
    background: none;
    border: none;
    padding: 4px 0;
}
.rpt-sec-divider hr {
    border: none;
    border-top: 1px solid var(--border-color, #353a44);
}

/* ── Generate Modal: Template Grid ── */
.rpt-template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.rpt-template {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #353a44);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card, #23262d);
}
.rpt-template:hover { border-color: var(--accent-blue, #3b82f6); }
.rpt-template.selected {
    border-color: var(--accent-blue, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.rpt-template .material-symbols-rounded {
    font-size: 28px;
    color: var(--accent-blue, #3b82f6);
}
.rpt-template span:last-child {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
}

/* ── Publish: Page Template Selector ── */
.rpt-pub-templates {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.rpt-pub-template {
    padding: 14px 16px;
    border: 1px solid var(--border-color, #353a44);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.rpt-pub-template:hover { border-color: var(--accent-blue, #3b82f6); }
.rpt-pub-template.selected {
    border-color: var(--accent-blue, #3b82f6);
    background: rgba(59,130,246,0.08);
}
.rpt-pub-template strong {
    display: block;
    font-size: 13px;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 2px;
}
.rpt-pub-template span {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

/* ── Publish Info Banner ── */
.rpt-pub-info {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.rpt-pub-info code {
    flex: 1;
    font-size: 13px;
    color: #10b981;
}

/* ═══════════════════════════════════════════════════
   SCHEDULE WIZARD — Professional Multi-Step
   ═══════════════════════════════════════════════════ */

/* ── Wizard Modal Container ── */
.sched-wiz-modal {
    max-width: 780px !important;
    width: 96% !important;
    max-height: 92vh !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-xl, 18px) !important;
}

/* ── Header ── */
.sched-wiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color, #353a44);
}
.sched-wiz-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sched-wiz-logo {
    font-size: 28px;
    color: #3b82f6;
    background: #3b82f620;
    padding: 10px;
    border-radius: 12px;
}
.sched-wiz-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    margin: 0;
    line-height: 1.2;
}
.sched-wiz-subtitle {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    font-weight: 400;
}

/* ── Existing Schedules Bar (legacy, unused) ── */

/* ── Schedule Management View ── */
.sched-management-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sched-mgmt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border-color, #353a44);
    background: var(--bg-secondary, #1e2128);
}
.sched-mgmt-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}
.sched-mgmt-count .material-symbols-rounded { font-size: 20px; color: var(--primary, #06b6d4); }
.sched-mgmt-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sched-mgmt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
}
.sched-mgmt-empty .material-symbols-rounded { font-size: 40px; opacity: 0.4; }
.sched-mgmt-card {
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.sched-mgmt-card:hover { border-color: var(--primary, #06b6d4); }
.sched-mgmt-card.paused { opacity: 0.7; }
.sched-mgmt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
}
.sched-mgmt-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.sched-mgmt-card-title strong {
    font-size: 14px;
    color: var(--text-primary, #f1f5f9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sched-mgmt-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.sched-mgmt-status.active { background: #10b98120; color: #10b981; }
.sched-mgmt-status.paused { background: #f59e0b20; color: #f59e0b; }
.sched-mgmt-card-actions {
    display: flex;
    gap: 2px;
    align-items: center;
}
.sched-mgmt-card-body {
    padding: 0 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sched-mgmt-card-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary, #9ca3af);
}
.sched-mgmt-card-detail .material-symbols-rounded { color: var(--text-muted, #6b7280); }
.sched-mgmt-card-detail.next-send { color: var(--primary, #06b6d4); }
.sched-mgmt-card-detail.next-send .material-symbols-rounded { color: var(--primary, #06b6d4); }
.sched-mgmt-card-formats {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}
.sched-mgmt-card-result {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    margin-top: 2px;
}
.sched-mgmt-card-result.error { color: #ef4444; }
.sched-mgmt-card-result.success { color: #10b981; }

.sched-fmt-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.sched-fmt-badge.pdf { background: #ef444420; color: #ef4444; }
.sched-fmt-badge.word { background: #3b82f620; color: #3b82f6; }
.sched-fmt-badge.excel { background: #10b98120; color: #10b981; }
.sched-fmt-badge.link { background: #06b6d420; color: #06b6d4; }

/* ── Stepper ── */
.sched-wiz-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 28px 16px;
    gap: 0;
    border-bottom: 1px solid var(--border-color, #353a44);
    background: var(--bg-secondary, #1e2128);
}
.sched-wiz-step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.45;
    transition: opacity 0.25s, transform 0.25s;
    cursor: default;
}
.sched-wiz-step.active {
    opacity: 1;
    transform: scale(1.02);
}
.sched-wiz-step.completed { opacity: 0.75; }
.sched-wiz-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: var(--bg-card, #23262d);
    color: var(--text-muted, #6b7280);
    border: 2px solid var(--border-color, #353a44);
    transition: all 0.25s;
    flex-shrink: 0;
}
.sched-wiz-step.active .sched-wiz-step-num {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 12px #3b82f640;
}
.sched-wiz-step.completed .sched-wiz-step-num {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}
.sched-wiz-step-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sched-wiz-step-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    line-height: 1.2;
}
.sched-wiz-step-desc {
    font-size: 10px;
    color: var(--text-muted, #6b7280);
}
.sched-wiz-step-line {
    width: 24px;
    height: 2px;
    background: var(--border-color, #353a44);
    margin: 0 6px;
    flex-shrink: 0;
    border-radius: 2px;
    transition: background 0.25s;
}

/* ── Body (Panels) ── */
.sched-wiz-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}
.sched-wiz-panel {
    display: none;
    animation: schedFadeIn 0.25s ease;
}
.sched-wiz-panel.active { display: block; }
@keyframes schedFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sched-step-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    margin: 0 0 6px;
}
.sched-step-heading .material-symbols-rounded {
    font-size: 22px;
    color: #3b82f6;
}
.sched-step-hint {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
    margin: 0 0 20px;
    line-height: 1.5;
}
.sched-field-hint {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    margin-top: 4px;
    margin-bottom: 8px;
}
.sched-wiz-panel .form-group {
    margin-bottom: 20px;
}
.sched-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 10px;
}

/* ── Step 2: Frequency Cards ── */
.sched-freq-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.sched-freq-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    background: var(--bg-card, #23262d);
    border: 2px solid var(--border-color, #353a44);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.sched-freq-card:hover {
    border-color: var(--text-muted, #6b7280);
    background: var(--bg-secondary, #1e2128);
}
.sched-freq-card.active {
    border-color: #3b82f6;
    background: #3b82f610;
    box-shadow: 0 0 0 1px #3b82f640;
}
.sched-freq-card .material-symbols-rounded {
    font-size: 24px;
    color: var(--text-muted, #6b7280);
    transition: color 0.2s;
}
.sched-freq-card.active .material-symbols-rounded { color: #3b82f6; }
.sched-freq-card strong {
    font-size: 13px;
    color: var(--text-primary, #f1f5f9);
}
.sched-freq-desc {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}

/* ── Step 2: Time Row ── */
.sched-time-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}
.sched-time-row .form-group { flex: 0 0 auto; margin-bottom: 0; }
.sched-next-send {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #3b82f610;
    border: 1px solid #3b82f630;
    border-radius: 10px;
    font-size: 12px;
    color: #93bbfc;
    flex: 1;
}
.sched-next-send .material-symbols-rounded { font-size: 16px; color: #3b82f6; }

/* ── Step 2: Day Picker (Weekly) ── */
.sched-days-section { margin-bottom: 16px; }
.sched-day-picker {
    display: flex;
    gap: 8px;
}
.sched-day-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color, #353a44);
    background: var(--bg-card, #23262d);
    color: var(--text-secondary, #9ca3af);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sched-day-btn:hover {
    border-color: #3b82f680;
    background: #3b82f610;
}
.sched-day-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 2px 8px #3b82f640;
}

/* ── Step 2: Month Grid ── */
.sched-month-section { margin-bottom: 16px; }
.sched-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.sched-month-day {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid var(--border-color, #353a44);
    background: var(--bg-card, #23262d);
    color: var(--text-secondary, #9ca3af);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sched-month-day:hover {
    border-color: #3b82f680;
    background: #3b82f610;
}
.sched-month-day.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 2px 6px #3b82f630;
}

/* ── Step 3: Format Cards ── */
.sched-format-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.sched-format-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card, #23262d);
    border: 2px solid var(--border-color, #353a44);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.sched-format-card:hover {
    border-color: var(--text-muted, #6b7280);
}
.sched-format-card.active {
    border-color: var(--fc, #3b82f6);
    background: color-mix(in srgb, var(--fc, #3b82f6) 8%, transparent);
}
.sched-format-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--fc, #3b82f6) 12%, transparent);
    flex-shrink: 0;
}
.sched-format-icon .material-symbols-rounded {
    font-size: 22px;
    color: var(--fc, #3b82f6);
}
.sched-format-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sched-format-info strong {
    font-size: 14px;
    color: var(--text-primary, #f1f5f9);
}
.sched-format-info span {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
}
.sched-format-check {
    opacity: 0;
    transition: opacity 0.2s;
}
.sched-format-card.active .sched-format-check {
    opacity: 1;
}
.sched-format-check .material-symbols-rounded {
    font-size: 22px;
    color: var(--fc, #10b981);
}
.sched-format-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #10b98110;
    border: 1px solid #10b98130;
    border-radius: 10px;
    font-size: 12px;
    color: #6ee7b7;
}
.sched-format-summary .material-symbols-rounded { font-size: 16px; color: #10b981; }

/* ── Wizard Global Input Overrides (dark theme) ── */
.sched-wiz-modal input[type="text"],
.sched-wiz-modal input[type="email"],
.sched-wiz-modal input[type="time"],
.sched-wiz-modal input[type="datetime-local"],
.sched-wiz-modal input[type="number"],
.sched-wiz-modal select,
.sched-wiz-modal textarea {
    background: var(--bg-input, #1e2128);
    border: 1px solid var(--border-input, #353a44);
    border-radius: var(--radius-sm, 8px);
    color: var(--text-primary, #f1f5f9);
    font-size: 0.9rem;
    font-family: inherit;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s;
}
.sched-wiz-modal input:focus,
.sched-wiz-modal select:focus,
.sched-wiz-modal textarea:focus {
    border-color: var(--border-focus, #3b82f6);
}
.sched-wiz-modal input::placeholder,
.sched-wiz-modal textarea::placeholder {
    color: var(--text-muted, #6b7280);
}
.sched-wiz-modal select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ── Step 4: Recipients ── */
.sched-add-recipient { margin-bottom: 16px; }
.sched-add-recipient-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.sched-input-email { flex: 2; }
.sched-input-name { flex: 1.5; }
.sched-input-type {
    width: 80px;
    flex-shrink: 0;
}
.sched-bulk-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 0;
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}
.sched-bulk-btn:hover { color: #60a5fa; }
.sched-bulk-btn .material-symbols-rounded { font-size: 16px; }
.sched-bulk-area {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sched-bulk-area textarea {
    font-size: 12px;
    resize: vertical;
}
.sched-recipients-list {
    min-height: 60px;
    max-height: 260px;
    overflow-y: auto;
}
.sched-recipients-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px;
    color: var(--text-muted, #6b7280);
    font-size: 13px;
}
.sched-recipients-empty .material-symbols-rounded {
    font-size: 32px;
    opacity: 0.4;
}
.sched-recipient-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 13px;
    transition: background 0.15s;
}
.sched-recipient-chip:hover { background: var(--bg-secondary, #1e2128); }
.sched-recipient-chip-info { flex: 1; display: flex; flex-direction: column; }
.sched-recipient-chip-email { color: var(--text-primary, #f1f5f9); font-weight: 500; }
.sched-recipient-chip-name { font-size: 11px; color: var(--text-muted, #6b7280); }
.sched-recipient-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sched-recipient-type.to { background: #3b82f620; color: #3b82f6; }
.sched-recipient-type.cc { background: #f59e0b20; color: #f59e0b; }
.sched-recipient-type.bcc { background: #8b5cf620; color: #8b5cf6; }
.sched-recipients-count {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}
.sched-recipients-count .material-symbols-rounded { font-size: 16px; }

/* ── Step 5: Review ── */
.sched-review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.sched-review-card {
    padding: 14px 16px;
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 12px;
}
.sched-review-card-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #6b7280);
    margin-bottom: 6px;
}
.sched-review-card-label .material-symbols-rounded { font-size: 16px; }
.sched-review-card-value {
    font-size: 14px;
    color: var(--text-primary, #f1f5f9);
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
}

/* ── Step 5: Test Section ── */
.sched-test-section {
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 14px;
    padding: 18px 20px;
}
.sched-test-header {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.sched-test-header .material-symbols-rounded {
    font-size: 24px;
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 2px;
}
.sched-test-header strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 2px;
}
.sched-test-header span {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
}
.sched-test-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.sched-test-input { flex: 1; }
.sched-test-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sched-test-status.sending {
    background: #3b82f610;
    border: 1px solid #3b82f630;
    color: #93bbfc;
}
.sched-test-status.success {
    background: #10b98110;
    border: 1px solid #10b98130;
    color: #6ee7b7;
}
.sched-test-status.error {
    background: #ef444410;
    border: 1px solid #ef444430;
    color: #fca5a5;
}

/* ── Footer ── */
.sched-wiz-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-top: 1px solid var(--border-color, #353a44);
    background: var(--bg-secondary, #1e2128);
}
.sched-wiz-footer-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Legacy (keep for existing schedule list items) ── */
.rpt-schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 10px;
    margin-bottom: 8px;
}
.rpt-schedule-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rpt-schedule-info strong { font-size: 14px; color: var(--text-primary, #f1f5f9); }
.rpt-schedule-meta {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}
.rpt-schedule-result {
    font-size: 11px;
    margin-top: 2px;
}
.rpt-schedule-result.error { color: #ef4444; }
.rpt-schedule-result.success { color: #10b981; }
.rpt-schedule-actions { display: flex; gap: 6px; align-items: center; }

/* ── Recipients List (legacy compat) ── */
.rpt-recipient {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-card, #23262d);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 6px;
}
.rpt-recipient span:nth-child(2) { flex: 1; }

/* ── Responsive adjustments ── */
@media (max-width: 600px) {
    .sched-wiz-stepper { flex-wrap: wrap; gap: 4px; padding: 14px 16px 12px; }
    .sched-wiz-step-info { display: none; }
    .sched-wiz-step-line { width: 12px; }
    .sched-freq-cards { grid-template-columns: repeat(2, 1fr); }
    .sched-review-grid { grid-template-columns: 1fr; }
    .sched-add-recipient-row { flex-wrap: wrap; }
    .sched-add-recipient-row .sched-input-name { flex: 1 1 100%; }
    .sched-wiz-body { padding: 18px 16px; }
    .sched-wiz-header { padding: 16px; }
    .sched-wiz-footer { padding: 12px 16px; }
}

/* ── Section Type Selector (NEW HORIZONTAL MODAL) ── */
.sec-modal {
    max-width: 1100px !important;
    width: 96% !important;
    max-height: 90vh !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sec-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border-color, #353a44);
}
.sec-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sec-modal-icon {
    font-size: 28px;
    color: var(--accent-blue, #3b82f6);
    background: rgba(59, 130, 246, 0.12);
    border-radius: 10px;
    padding: 8px;
}
.sec-modal-header h2 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #f1f5f9);
}
.sec-modal-subtitle {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}
.sec-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}
.sec-panel-left {
    width: 300px;
    min-width: 300px;
    border-right: 1px solid var(--border-color, #353a44);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    background: rgba(0,0,0,0.08);
}
.sec-panel-right {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
}
.sec-panel-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

/* Type buttons */
.sec-type-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sec-type-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #9ca3af);
}
.sec-type-btn .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-muted, #6b7280);
    transition: color 0.2s;
}
.sec-type-btn:hover {
    background: rgba(59, 130, 246, 0.06);
    color: var(--text-primary, #f1f5f9);
}
.sec-type-btn.selected {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--accent-blue, #3b82f6);
    font-weight: 600;
}
.sec-type-btn.selected .material-symbols-rounded {
    color: var(--accent-blue, #3b82f6);
}

/* Width buttons */
.sec-width-grid {
    display: flex;
    gap: 4px;
}
.sec-width-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 6px;
    border: 1px solid var(--border-color, #353a44);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.sec-width-btn .material-symbols-rounded { font-size: 16px; }
.sec-width-btn:hover { border-color: var(--accent-blue, #3b82f6); }
.sec-width-btn.active {
    border-color: var(--accent-blue, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue, #3b82f6);
}

/* AI editing section */
.sec-ai-section {
    border-top: 1px solid var(--border-color, #353a44);
    padding-top: 16px;
}
.sec-ai-prompt-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sec-ai-prompt-area textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 8px;
    color: var(--text-primary, #f1f5f9);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}
.sec-ai-prompt-area textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}
.sec-ai-btn {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-weight: 600 !important;
    gap: 6px;
    font-size: 12px !important;
    transition: all 0.2s;
}
.sec-ai-btn:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}
.sec-ai-btn:disabled {
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}
.sec-ai-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.sec-ai-hint {
    padding: 4px 10px;
    border-radius: 14px;
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, #353a44);
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    transition: all 0.2s;
}
.sec-ai-hint:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Form groups (right panel) */
.sec-form-group {
    margin-bottom: 16px;
}
.sec-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 6px;
}
.sec-form-group label .material-symbols-rounded {
    font-size: 18px;
    color: var(--text-muted, #6b7280);
}
.sec-form-group input[type="text"],
.sec-form-group textarea,
.sec-form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 8px;
    color: var(--text-primary, #f1f5f9);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.sec-form-group input:focus,
.sec-form-group textarea:focus,
.sec-form-group select:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
}
.sec-form-hint {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    margin-top: 4px;
}
.sec-sql-editor {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.5;
}
.sec-color-input {
    width: 100% !important;
    height: 40px !important;
    padding: 4px !important;
    cursor: pointer;
    border-radius: 8px !important;
    background: var(--bg-primary, #1a1d23) !important;
    border: 1px solid var(--border-color, #353a44) !important;
}
.sec-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 900px) {
    .sec-form-row { grid-template-columns: 1fr; }
}

/* Footer */
.sec-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color, #353a44);
    background: rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
    .sec-modal-body { flex-direction: column; }
    .sec-panel-left {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #353a44);
        max-height: 200px;
    }
}

/* ── Width Selector (kept for backwards compat) ── */
.rpt-width-selector { display: flex; gap: 8px; }
.rpt-width-btn {
    flex: 1;
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border-color, #353a44);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    transition: all 0.2s;
    background: var(--bg-primary, #1a1d23);
}
.rpt-width-btn:hover { border-color: var(--accent-blue, #3b82f6); }
.rpt-width-btn.active {
    border-color: var(--accent-blue, #3b82f6);
    background: rgba(59,130,246,0.1);
    color: var(--accent-blue, #3b82f6);
}

/* ── Empty & Error States ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #9ca3af);
}
.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary, #f1f5f9);
    margin: 16px 0 8px;
}
.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
}

/* ── Button helpers ── */
.btn-xs {
    padding: 4px 6px !important;
    font-size: 12px !important;
    min-width: unset !important;
}
.btn-ghost {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted, #6b7280) !important;
    cursor: pointer;
}
.btn-ghost:hover { color: var(--text-primary, #f1f5f9) !important; }

/* ── Status Bar ── */
#rptStatus {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--accent-blue, #3b82f6);
    height: 20px;
    margin-bottom: 8px;
}

/* ── Modal overrides for reports ── */
.rpt-modal-content select,
.rpt-modal-content input[type="text"],
.rpt-modal-content input[type="email"],
.rpt-modal-content input[type="number"],
.rpt-modal-content input[type="time"],
.rpt-modal-content input[type="date"],
.rpt-modal-content input[type="password"],
.rpt-modal-content textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 8px;
    color: var(--text-primary, #f1f5f9);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.rpt-modal-content select:focus,
.rpt-modal-content input:focus,
.rpt-modal-content textarea:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
}

/* ── Checkbox/Toggle inline ── */
.rpt-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary, #f1f5f9);
}
.rpt-toggle-row input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--accent-blue, #3b82f6);
}

/* ── Form groups ── */
.rpt-form-group {
    margin-bottom: 14px;
}
.rpt-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 6px;
}
.rpt-form-row {
    display: flex;
    gap: 10px;
}
.rpt-form-row > * { flex: 1; }

/* ── Inline recipient add row ── */
.rpt-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.rpt-add-row input { flex: 1; }
.rpt-add-row button { white-space: nowrap; }

/* ── Status area ── */
#rptStatus:empty { display: none; }

/* ═══════════════════════════════════════════
   WIZARD — GENERAR REPORTE
   ═══════════════════════════════════════════ */

/* ── Wizard Modal ── */
.wiz-modal {
    max-width: 920px !important;
    width: 96% !important;
    max-height: 92vh !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Wizard Header ── */
.wiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--border-color, #353a44);
}
.wiz-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.wiz-logo {
    font-size: 32px;
    color: var(--accent-blue, #3b82f6);
    background: rgba(59, 130, 246, 0.12);
    border-radius: 12px;
    padding: 8px;
}
.wiz-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #f1f5f9);
}
.wiz-subtitle {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

/* ── Stepper ── */
.wiz-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 28px;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--border-color, #353a44);
}
.wiz-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
    opacity: 0.45;
}
.wiz-step.active {
    opacity: 1;
    background: rgba(59, 130, 246, 0.1);
}
.wiz-step.completed { opacity: 0.8; }
.wiz-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: var(--bg-card, #23262d);
    border: 2px solid var(--border-color, #353a44);
    color: var(--text-muted, #6b7280);
    transition: all 0.25s;
    flex-shrink: 0;
}
.wiz-step.active .wiz-step-num {
    background: var(--accent-blue, #3b82f6);
    border-color: var(--accent-blue, #3b82f6);
    color: #fff;
}
.wiz-step.completed .wiz-step-num {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}
.wiz-step-info {
    display: flex;
    flex-direction: column;
}
.wiz-step-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}
.wiz-step-desc {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}
.wiz-step-line {
    width: 32px;
    height: 2px;
    background: var(--border-color, #353a44);
    margin: 0 4px;
    border-radius: 2px;
    transition: background 0.25s;
}
.wiz-step-line.done {
    background: #10b981;
}

@media (max-width: 768px) {
    .wiz-step-info { display: none; }
    .wiz-step { padding: 6px 8px; }
    .wiz-step-line { width: 16px; }
}

/* ── Wizard Body (scrollable) ── */
.wiz-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}
.wiz-panel {
    display: none;
}
.wiz-panel.active {
    display: block;
    animation: wizFadeIn 0.3s ease;
}
@keyframes wizFadeIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}
.wiz-panel-header {
    margin-bottom: 20px;
}
.wiz-panel-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary, #f1f5f9);
}
.wiz-panel-header p {
    font-size: 14px;
    color: var(--text-secondary, #9ca3af);
    margin: 0;
    line-height: 1.5;
}

/* ── Step 1: Report Type Grid ── */
.wiz-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
@media (max-width: 640px) {
    .wiz-type-grid { grid-template-columns: 1fr; }
}
.wiz-type-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    border-radius: 14px;
    border: 2px solid var(--border-color, #353a44);
    cursor: pointer;
    transition: all 0.25s;
    background: var(--bg-card, #23262d);
    position: relative;
}
.wiz-type-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.04);
}
.wiz-type-card.selected {
    border-color: var(--accent-blue, #3b82f6);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.wiz-type-card.selected::after {
    content: 'check_circle';
    font-family: 'Material Symbols Rounded';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    color: var(--accent-blue, #3b82f6);
}
.wiz-type-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    flex-shrink: 0;
}
.wiz-type-icon .material-symbols-rounded {
    font-size: 26px;
    color: var(--accent-blue, #3b82f6);
}
.wiz-type-info {
    flex: 1;
    min-width: 0;
}
.wiz-type-info strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 4px;
}
.wiz-type-info p {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    margin: 0;
    line-height: 1.4;
}

/* Mini previews */
.wiz-type-preview {
    width: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.wiz-mini-table { width: 100%; }
.wiz-mini-row {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin-bottom: 3px;
}
.wiz-mini-head { background: rgba(59, 130, 246, 0.25); }
.wiz-mini-dash {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    width: 100%;
}
.wiz-mini-kpi {
    height: 14px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 3px;
}
.wiz-mini-chart {
    height: 20px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 3px;
    grid-column: span 2;
}
.wiz-mini-tbl {
    height: 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    grid-column: span 2;
}
.wiz-mini-kpis {
    display: flex;
    gap: 3px;
    width: 100%;
}
.wiz-mini-kpi-card {
    flex: 1;
    height: 28px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 4px;
}
.wiz-mini-mixed {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}
.wiz-mini-bar {
    height: 22px;
    background: linear-gradient(90deg, rgba(59,130,246,0.3), rgba(59,130,246,0.1));
    border-radius: 3px;
}
.wiz-mini-tbl2 {
    height: 16px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
}

/* Template sub-select */
.wiz-subselect {
    border-top: 1px solid var(--border-color, #353a44);
    padding-top: 16px;
}
.wiz-subselect label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 10px;
    display: block;
}
.wiz-template-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.wiz-tpl-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #353a44);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary, #1a1d23);
    font-size: 13px;
    color: var(--text-secondary, #9ca3af);
}
.wiz-tpl-chip:hover { border-color: var(--accent-blue, #3b82f6); }
.wiz-tpl-chip.selected {
    border-color: var(--accent-blue, #3b82f6);
    background: rgba(59,130,246,0.1);
    color: var(--accent-blue, #3b82f6);
}
.wiz-tpl-chip .material-symbols-rounded { font-size: 18px; }

/* ── Step 2: Data Sources ── */
.wiz-conn-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.wiz-conn-selected {
    min-height: 56px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px dashed var(--border-color, #353a44);
    background: rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.wiz-conn-selected:has(.wiz-conn-chip) {
    border-style: solid;
    border-color: rgba(59,130,246,0.3);
    background: rgba(59,130,246,0.04);
}
.wiz-conn-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted, #6b7280);
    font-size: 13px;
    width: 100%;
    justify-content: center;
    padding: 8px 0;
}
.wiz-conn-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    font-size: 13px;
    color: var(--text-primary, #e4e6eb);
    font-weight: 500;
}
.wiz-conn-chip.primary {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.1);
}
.wiz-conn-chip .wiz-conn-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    font-weight: 700;
}
.wiz-conn-chip .btn { padding: 2px 4px !important; }

.wiz-conn-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 10px;
    margin-bottom: 10px;
}
.wiz-conn-search .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-muted, #6b7280);
}
.wiz-conn-search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary, #f1f5f9);
    font-size: 14px;
    outline: none;
}
.wiz-conn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}
.wiz-conn-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #353a44);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card, #23262d);
}
.wiz-conn-item:hover {
    border-color: rgba(59,130,246,0.4);
    background: rgba(59,130,246,0.04);
}
.wiz-conn-item.selected {
    border-color: var(--accent-blue, #3b82f6);
    background: rgba(59,130,246,0.1);
}
.wiz-conn-item.selected::before {
    content: 'check_circle';
    font-family: 'Material Symbols Rounded';
    font-size: 20px;
    color: var(--accent-blue, #3b82f6);
}
.wiz-conn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.12);
    flex-shrink: 0;
}
.wiz-conn-icon .material-symbols-rounded { font-size: 20px; color: var(--accent-blue); }
.wiz-conn-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}
.wiz-conn-detail {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}
.wiz-multi-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    font-size: 13px;
    color: var(--text-secondary, #9ca3af);
    margin-top: 12px;
}
.wiz-multi-hint .material-symbols-rounded {
    font-size: 22px;
    color: var(--accent-blue);
}

/* ── Step 3: Prompt ── */
.wiz-prompt-area {
    margin-bottom: 20px;
}
.wiz-prompt-area textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 10px;
    color: var(--text-primary, #f1f5f9);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}
.wiz-prompt-area textarea:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
}
.wiz-prompt-area input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 10px;
    color: var(--text-primary, #f1f5f9);
    font-size: 14px;
    font-family: inherit;
}
.wiz-prompt-area input:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
}
.wiz-prompt-suggestions {
    margin-top: 12px;
}
.wiz-suggestion-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    margin-bottom: 8px;
    display: block;
}
.wiz-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wiz-suggestion {
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, #353a44);
    font-size: 12px;
    color: var(--text-secondary, #9ca3af);
    cursor: pointer;
    transition: all 0.2s;
}
.wiz-suggestion:hover {
    border-color: var(--accent-blue, #3b82f6);
    color: var(--accent-blue, #3b82f6);
}

/* Summary Card */
.wiz-summary-card {
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 12px;
    padding: 16px 18px;
}
.wiz-summary-card h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary, #9ca3af);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wiz-summary-card h4 .material-symbols-rounded { font-size: 18px; }
.wiz-summary-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wiz-summary-item {
    display: flex;
    gap: 10px;
    font-size: 13px;
}
.wiz-sum-label {
    color: var(--text-muted, #6b7280);
    min-width: 70px;
}
.wiz-sum-value {
    color: var(--text-primary, #f1f5f9);
    font-weight: 500;
}

/* ── Step 4: Generate + Preview ── */
.wiz-review-card {
    background: var(--bg-card, #23262d);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
}
.wiz-review-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wiz-review-row:last-child { border-bottom: none; }
.wiz-review-row .material-symbols-rounded {
    font-size: 22px;
    color: var(--text-muted, #6b7280);
    margin-top: 1px;
}
.wiz-review-row strong {
    color: var(--text-secondary, #9ca3af);
    font-size: 13px;
    margin-right: 4px;
}
.wiz-review-row div {
    font-size: 14px;
    color: var(--text-primary, #f1f5f9);
    line-height: 1.5;
}
.wiz-rev-prompt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
    color: var(--text-secondary, #9ca3af) !important;
}

.wiz-generate-action {
    text-align: center;
    padding: 20px 0;
}
.wiz-btn-generate {
    font-size: 16px !important;
    padding: 14px 32px !important;
    border-radius: 14px !important;
    gap: 10px;
}
.wiz-btn-generate .material-symbols-rounded { font-size: 22px; }
.wiz-gen-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    margin-top: 10px;
}

/* Preview header */
.wiz-preview-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}
.wiz-preview-header h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #f1f5f9);
}
.wiz-preview-header p {
    font-size: 13px;
    color: var(--text-secondary, #9ca3af);
    margin: 2px 0 0;
}

/* Format Cards */
.wiz-format-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
@media (max-width: 640px) {
    .wiz-format-cards { grid-template-columns: 1fr; }
}
.wiz-format-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #353a44);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card, #23262d);
}
.wiz-format-card:hover {
    border-color: rgba(59,130,246,0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.wiz-format-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wiz-format-icon .material-symbols-rounded { font-size: 24px; }
.wiz-format-excel {
    background: rgba(16,185,129,0.12);
    color: #10b981;
}
.wiz-format-excel .material-symbols-rounded { color: #10b981; }
.wiz-format-word {
    background: rgba(59,130,246,0.12);
    color: #3b82f6;
}
.wiz-format-word .material-symbols-rounded { color: #3b82f6; }
.wiz-format-pdf {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}
.wiz-format-pdf .material-symbols-rounded { color: #ef4444; }
.wiz-format-info {
    flex: 1;
    min-width: 0;
}
.wiz-format-info strong {
    display: block;
    font-size: 13px;
    color: var(--text-primary, #f1f5f9);
}
.wiz-format-info span {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}

/* Inline Preview */
.wiz-preview-container {
    border: 1px solid var(--border-color, #353a44);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-primary, #1a1d23);
}
.wiz-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color, #353a44);
    font-size: 13px;
    color: var(--text-secondary, #9ca3af);
    font-weight: 600;
}
.wiz-preview-frame {
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
}
.wiz-preview-frame table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.wiz-preview-frame table th {
    text-align: left;
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary, #9ca3af);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color, #353a44);
}
.wiz-preview-frame table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-primary, #f1f5f9);
}
.wiz-preview-frame .wiz-pv-section {
    margin-bottom: 16px;
}
.wiz-preview-frame .wiz-pv-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wiz-preview-frame .wiz-pv-kpi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(99,102,241,0.08);
    border-radius: 10px;
    margin: 0 8px 8px 0;
}
.wiz-preview-frame .wiz-pv-kpi-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-blue);
}
.wiz-preview-frame .wiz-pv-kpi-label {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}
.wiz-preview-frame .wiz-pv-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary, #f1f5f9);
}

/* ── Wizard Footer ── */
.wiz-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-top: 1px solid var(--border-color, #353a44);
    background: rgba(0,0,0,0.1);
}
.wiz-footer-right {
    display: flex;
    gap: 8px;
}
.wiz-footer .btn { min-width: 100px; }

/* ═══════════════════════════════════════════
   MULTI-SOURCE & EXPORT (kept for report viewer)
   ═══════════════════════════════════════════ */

/* ── Multi-connection badge ── */
.rpt-badge-multi {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* ── Export buttons ── */
.rpt-export-group {
    display: flex;
    gap: 2px;
    border: 1px solid var(--border-color, #353a44);
    border-radius: 8px;
    overflow: hidden;
}
.rpt-export-group .btn {
    border-radius: 0;
    border: none;
    gap: 4px;
}
.rpt-export-group .btn:first-child { border-radius: 7px 0 0 7px; }
.rpt-export-group .btn:last-child  { border-radius: 0 7px 7px 0; }
.rpt-btn-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Sources management modal ── */
.rpt-sources-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rpt-source-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-elevated, #22262e);
    border: 1px solid var(--border-color, #353a44);
}
.rpt-source-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rpt-source-info strong {
    font-size: 13px;
}

/* ── Section connection indicator ── */
.rpt-sec-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.08);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT IA — Drawer lateral para edición de reportes en vivo
   ═══════════════════════════════════════════════════════════════ */

.rpt-chat-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    cursor: pointer;
}
.rpt-chat-toggle:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}
.rpt-chat-toggle.active {
    background: linear-gradient(135deg, #4f46e5, #6d28d9) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5), 0 4px 16px rgba(99, 102, 241, 0.4);
}
.rpt-chat-toggle .material-symbols-rounded { font-size: 18px; }
.rpt-chat-toggle-label { white-space: nowrap; }

/* ── Drawer container ── */
.rpt-chat-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}
.rpt-chat-drawer.open {
    transform: translateX(0);
}

body.rpt-chat-open .main-content {
    margin-right: 420px;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body:not(.rpt-chat-open) .main-content {
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Header ── */
.rpt-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
}
.rpt-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rpt-chat-icon {
    font-size: 28px;
    color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.12);
    padding: 8px;
    border-radius: 12px;
}
.rpt-chat-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}
.rpt-chat-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Model selector bar ── */
.rpt-chat-model-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    flex-shrink: 0;
}
.rpt-chat-model-icon {
    font-size: 16px;
    color: var(--text-muted);
}
.rpt-chat-model-bar select {
    flex: 1;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: auto;
}
.rpt-chat-model-bar select:hover {
    border-color: var(--border-input);
}
.rpt-chat-model-bar select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.15);
}

/* ── Messages area ── */
.rpt-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.rpt-chat-messages::-webkit-scrollbar { width: 5px; }
.rpt-chat-messages::-webkit-scrollbar-track { background: transparent; }
.rpt-chat-messages::-webkit-scrollbar-thumb { background: var(--bg-secondary); border-radius: 4px; }
.rpt-chat-messages::-webkit-scrollbar-thumb:hover { background: var(--border-input); }

/* ── Welcome screen ── */
.rpt-chat-welcome {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-muted);
}
.rpt-chat-welcome-icon {
    font-size: 48px;
    color: var(--accent-blue);
    display: block;
    margin: 0 auto 16px;
    opacity: 0.6;
}
.rpt-chat-welcome h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
}
.rpt-chat-welcome p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* ── Chat bubbles ── */
.rpt-chat-msg {
    max-width: 90%;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: visible;
    animation: rptChatMsgIn 0.25s ease-out;
}
@keyframes rptChatMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.rpt-chat-msg-user {
    align-self: flex-end;
    background: var(--accent-blue);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.rpt-chat-msg-assistant {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.rpt-chat-msg-assistant p { margin: 0 0 6px; }
.rpt-chat-msg-assistant p:last-child { margin-bottom: 0; }
.rpt-chat-msg-assistant code {
    background: rgba(99, 102, 241, 0.15);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #a5b4fc;
    word-break: break-all;
}
.rpt-chat-msg-assistant pre {
    background: var(--bg-card);
    padding: 10px 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 0.78rem;
    max-width: 100%;
}
.rpt-chat-msg-assistant ol,
.rpt-chat-msg-assistant ul {
    padding-left: 1.2em;
    margin: 4px 0;
}
.rpt-chat-msg-assistant pre code {
    background: none;
    padding: 0;
}

/* ── Action chips ── */
.rpt-chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.rpt-chat-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    white-space: nowrap;
}
.rpt-chat-action-chip.agregar {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}
.rpt-chat-action-chip.modificar {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.rpt-chat-action-chip.eliminar {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ── Token badge ── */
.rpt-chat-token-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
    font-size: 0.65rem;
    color: rgba(148, 163, 184, 0.5);
    letter-spacing: 0.02em;
    user-select: none;
    transition: color .2s;
}
.rpt-chat-msg-assistant:hover .rpt-chat-token-badge {
    color: rgba(148, 163, 184, 0.8);
}

/* ── Typing indicator ── */
.rpt-chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    max-width: 90%;
}
.rpt-chat-typing-dots {
    display: flex;
    gap: 4px;
}
.rpt-chat-typing-dots span {
    width: 7px;
    height: 7px;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: rptTypingBounce 1.4s infinite ease-in-out;
}
.rpt-chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.rpt-chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes rptTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── Suggestions ── */
.rpt-chat-suggestions {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.rpt-chat-suggestions::-webkit-scrollbar { display: none; }
.rpt-chat-suggestions:empty { display: none; }
.rpt-chat-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    color: #a5b4fc;
    font-size: 0.78rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.rpt-chat-suggestion:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
}
.rpt-chat-suggestion .material-symbols-rounded {
    font-size: 14px;
}

/* ── Input area ── */
.rpt-chat-input-area {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
}

/* ── Archivo adjunto: preview ── */
.rpt-chat-file-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.rpt-chat-file-preview img {
    width: 48px; height: 48px;
    object-fit: cover;
    border-radius: 6px;
}
.rpt-chat-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpt-chat-file-remove {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 2px; border-radius: 4px; display: flex;
}
.rpt-chat-file-remove:hover { color: var(--text-primary); background: var(--bg-card); }
.rpt-chat-attach-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px 2px; display: flex; align-items: center;
    border-radius: 6px; transition: color .15s; flex-shrink: 0;
}
.rpt-chat-attach-btn:hover { color: var(--text-primary); }
.rpt-chat-file-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; margin-bottom: 6px;
    background: rgba(99,102,241,0.1); border-radius: 6px;
    font-size: 0.78rem; color: var(--accent-blue);
}
.rpt-chat-file-chip .material-symbols-rounded { font-size: .85rem; }
.rpt-chat-file-chip-img { flex-direction: column; align-items: flex-start; padding: 6px; }
.rpt-chat-file-chip-img img { max-width: 180px; max-height: 120px; border-radius: 6px; object-fit: cover; }
.rpt-chat-file-chip-img span { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; word-break: break-all; }
.rpt-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: 14px;
    padding: 4px;
    transition: border-color 0.2s ease;
}
.rpt-chat-input-wrap:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
#rptChatInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.87rem;
    padding: 10px 12px;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    line-height: 1.4;
    outline: none;
    font-family: inherit;
}
#rptChatInput::placeholder { color: var(--text-muted); }
.rpt-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.rpt-chat-send:hover { background: #4f46e5; }
.rpt-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.rpt-chat-send .material-symbols-rounded { font-size: 18px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .rpt-chat-drawer { width: 100%; }
    body.rpt-chat-open .main-content { margin-right: 0; }
    .rpt-chat-toggle-label { display: none; }
}
@media (max-width: 480px) {
    .rpt-chat-toggle-label { display: none; }
}

/* ═══════════════════════════════════════════
   EDIT MODE — Drag & Drop + Inline Editing
   ═══════════════════════════════════════════ */

/* ── Edit Mode Toggle Button ── */
.rpt-edit-active {
    background: var(--accent-blue, #3b82f6) !important;
    color: #fff !important;
    border-radius: 8px;
}
.rpt-edit-active .material-symbols-rounded {
    color: #fff !important;
}

/* ── Edit Mode: Floating Cards ── */
.rpt-edit-mode .rpt-section {
    border: 2px dashed var(--border-color, #4b5563);
    border-radius: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.rpt-edit-mode .rpt-section:hover {
    border-color: var(--accent-blue, #3b82f6);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}
.rpt-edit-mode .rpt-sec-actions {
    opacity: 1 !important;
    background: var(--bg-card, #23262d);
    border-radius: 8px;
    padding: 2px 4px;
    border: 1px solid var(--border-color, #353a44);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── Drag Handle (siempre visible al hover) ── */
.rpt-drag-handle {
    position: absolute;
    top: 50%;
    left: -2px;
    transform: translateY(-50%);
    width: 26px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--text-tertiary, #6b7280);
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 5;
    opacity: 0;
    background: transparent;
}
.rpt-section:hover .rpt-drag-handle {
    opacity: 0.7;
}
.rpt-drag-handle:hover {
    color: var(--accent-blue, #3b82f6);
    background: rgba(59, 130, 246, 0.12);
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.1);
}
.rpt-drag-handle:active {
    cursor: grabbing;
    color: #fff;
    background: var(--accent-blue, #3b82f6);
    opacity: 1 !important;
}
.rpt-drag-handle .material-symbols-rounded {
    font-size: 20px;
}

/* ── Dragging States ── */
.rpt-dragging {
    opacity: 0.35 !important;
    border-color: var(--accent-blue, #3b82f6) !important;
    border-style: dashed !important;
    border-width: 2px !important;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.25) !important;
    transform: rotate(1deg) scale(0.98);
    transition: all 0.15s ease;
}
.rpt-drag-over-top {
    border-top: 3px solid var(--accent-blue, #3b82f6) !important;
    box-shadow: 0 -4px 12px rgba(59, 130, 246, 0.2);
}
.rpt-drag-over-bottom {
    border-bottom: 3px solid var(--accent-blue, #3b82f6) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.rpt-drag-over-top,
.rpt-drag-over-bottom {
    background: rgba(59, 130, 246, 0.03);
    transition: all 0.15s ease;
}

/* ── Inline Editing ── */
.rpt-editable,
.rpt-editable-html {
    cursor: text;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 1em;
}
.rpt-editable:hover,
.rpt-editable-html:hover {
    outline: 2px dashed var(--accent-blue, #3b82f6)55;
    outline-offset: 4px;
}
.rpt-editable:focus,
.rpt-editable-html:focus,
.rpt-editing-active {
    outline: 2px solid var(--accent-blue, #3b82f6) !important;
    outline-offset: 4px;
    background: rgba(59, 130, 246, 0.04);
    border-radius: 6px;
}
[contenteditable="true"]:empty::before {
    content: 'Haz clic para editar...';
    color: var(--text-tertiary, #6b7280);
    font-style: italic;
    pointer-events: none;
}

/* ── Edit mode: section numbering badge ── */
.rpt-edit-mode .rpt-section::before {
    content: attr(data-section-id);
    display: none;
}

/* ── Duplicate Button ── */
.rpt-sec-actions .btn-ghost[title="Duplicar"] .material-symbols-rounded {
    font-size: 16px;
}

/* ── Edit Mode: Body indicator ── */
body.rpt-editing .rpt-toolbar {
    border-bottom: 2px solid var(--accent-blue, #3b82f6);
}

/* ═══════════════════════════════════════════════════════════
   ICON PICKER
   ═══════════════════════════════════════════════════════════ */
.icon-picker-field {
    position: relative;
}

/* ── Trigger Button ── */
.icon-picker-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input, #181b20);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 10px;
    color: var(--text-primary, #e5e7eb);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-align: left;
}
.icon-picker-trigger:hover {
    border-color: var(--accent-blue, #6366f1);
    background: rgba(99, 102, 241, 0.04);
}
.icon-picker-trigger:focus {
    outline: none;
    border-color: var(--accent-blue, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.icon-picker-preview {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-blue, #6366f1);
    border-radius: 8px;
    flex-shrink: 0;
}
.icon-picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: capitalize;
    color: var(--text-secondary, #9ca3af);
}
.icon-picker-arrow {
    font-size: 20px;
    color: var(--text-tertiary, #6b7280);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.icon-picker-dropdown.active + .icon-picker-trigger .icon-picker-arrow,
.icon-picker-trigger:focus .icon-picker-arrow {
    transform: rotate(180deg);
}

/* ── Dropdown ── */
.icon-picker-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 340px;
    max-height: 0;
    overflow: hidden;
    background: var(--bg-card, #1e2128);
    border: 1px solid var(--border-color, #353a44);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.08);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.icon-picker-dropdown.active {
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    overflow: visible;
}

/* ── Search ── */
.icon-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color, #353a44);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 14px 14px 0 0;
}
.icon-picker-search .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-tertiary, #6b7280);
}
.icon-picker-search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary, #e5e7eb);
    font-size: 14px;
    outline: none;
}
.icon-picker-search input::placeholder {
    color: var(--text-tertiary, #6b7280);
}

/* ── Category Chips ── */
.icon-picker-categories {
    display: flex;
    gap: 6px;
    padding: 10px 14px 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.icon-picker-categories::-webkit-scrollbar { display: none; }

.icon-cat-chip {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color, #353a44);
    background: transparent;
    color: var(--text-secondary, #9ca3af);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}
.icon-cat-chip:hover {
    border-color: var(--accent-blue, #6366f1);
    color: var(--accent-blue, #6366f1);
    background: rgba(99, 102, 241, 0.08);
}
.icon-cat-chip.active {
    background: var(--accent-blue, #6366f1);
    color: #fff;
    border-color: var(--accent-blue, #6366f1);
}

/* ── Icon Grid ── */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 4px;
    padding: 8px 10px 12px;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #353a44) transparent;
}

.icon-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 4px 6px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary, #9ca3af);
    cursor: pointer;
    transition: all 0.15s;
}
.icon-grid-item .material-symbols-rounded {
    font-size: 26px;
    transition: all 0.15s;
}
.icon-grid-name {
    font-size: 9px;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    opacity: 0.6;
    text-transform: capitalize;
}
.icon-grid-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--accent-blue, #6366f1);
    transform: scale(1.08);
}
.icon-grid-item:hover .material-symbols-rounded {
    color: var(--accent-blue, #6366f1);
}
.icon-grid-item:hover .icon-grid-name {
    opacity: 1;
}
.icon-grid-item.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-blue, #6366f1);
    color: var(--accent-blue, #6366f1);
}
.icon-grid-item.selected .material-symbols-rounded {
    color: var(--accent-blue, #6366f1);
}
.icon-grid-item.selected .icon-grid-name {
    opacity: 1;
    color: var(--accent-blue, #6366f1);
}

/* ── Empty state ── */
.icon-picker-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary, #6b7280);
    font-size: 13px;
    grid-column: 1 / -1;
}

