/*
 * repox.css — estilos aditivos del refactor.
 *
 * IMPORTANTE: se carga DESPUÉS de style.css, pages.css y theme.css.
 * Evitamos pisar reglas del legacy (.container, .container-page, .card, .btn,
 * .navbar, .report-table, etc.). Solo agregamos lo nuevo: breadcrumb, badges
 * del admin, filtros del shell SPA-lite, métricas, paginación y charts.
 */

/* ==============================================================
   Navbar — complementa al .navbar legacy sin pisarlo.
   ============================================================== */
.br-navbar-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 8px;
    vertical-align: middle;
}
.br-navbar-tools {
    margin-left: auto;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.br-theme-toggle {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, .15);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

/* ==============================================================
   Breadcrumb
   ============================================================== */
.br-breadcrumb { font-size: 13px; color: #6b7280; margin: 8px 0 12px 0; }
.br-breadcrumb a { color: #0d6efd; text-decoration: none; }
.br-breadcrumb a:hover { text-decoration: underline; }
.br-breadcrumb .sep { margin: 0 6px; color: #9ca3af; }

/* ==============================================================
   Alertas
   ============================================================== */
.br-alert {
    margin: 10px 0;
    padding: 12px 14px;
    border-radius: 6px;
    white-space: pre-wrap;
}
.br-alert-error { background: #fdecea; color: #922b21; border: 1px solid #f5c2c0; }
.br-alert-warn  { background: #fff8e1; color: #8a6d1d; border: 1px solid #f0d98a; }
.br-alert-ok    { background: #e8f5e9; color: #256029; border: 1px solid #b7e1bb; }

/* ==============================================================
   Filtros del shell SPA-lite
   ============================================================== */
.br-filters-form { margin: 10px 0 14px 0; }
.br-filters-form fieldset {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
}
.br-filters-form legend {
    padding: 0 8px;
    font-weight: 600;
    color: #111827;
}
.br-filter-field {
    display: inline-block;
    margin: 6px 14px 6px 0;
    vertical-align: top;
}
.br-filter-field > label {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #374151;
}
.br-filter-field input[type="text"],
.br-filter-field input[type="number"],
.br-filter-field input[type="date"],
.br-filter-field input[type="search"],
.br-filter-field select,
.br-filter-field textarea {
    min-width: 220px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.br-filter-field textarea { min-height: 70px; font-family: inherit; }
.br-filter-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ==============================================================
   Toolbar
   ============================================================== */
.br-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 10px 0 12px 0;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}
.br-toolbar-left,
.br-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.br-input-search {
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    min-width: 200px;
}
.br-muted { color: #6b7280; }
.br-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.br-inline select { padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }

/* ==============================================================
   Dropdowns y menús
   ============================================================== */
.br-dropdown { position: relative; display: inline-block; }
.br-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 60;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    padding: 6px 0;
    display: none;
}
.br-menu.open { display: block; }
.br-menu-title {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.br-menu-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    text-decoration: none;
    color: #111827;
    cursor: pointer;
    font-size: 13px;
}
.br-menu-item:hover { background: #f3f4f6; }
.br-menu-actions {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
}

/* ==============================================================
   Métricas
   ============================================================== */
.metrics-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 10px 0;
}
.metrics-summary strong { display: block; margin-bottom: 6px; }
.br-metrics-table { width: auto; border-collapse: collapse; font-size: 13px; }
.br-metrics-table th,
.br-metrics-table td { padding: 4px 12px 4px 0; text-align: left; }
.br-metrics-table th { color: #6b7280; font-weight: 600; border-bottom: 1px solid #e5e7eb; }

/* ==============================================================
   Paginación
   ============================================================== */
.br-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0;
    padding: 10px 0;
    border-top: 1px solid #e5e7eb;
}
.br-pagination-info { font-size: 13px; color: #374151; }
.br-pagination-nav { display: flex; gap: 4px; flex-wrap: wrap; }

/* ==============================================================
   Tabla de reporte (complementa a .report-table legacy)
   ============================================================== */
.screen-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    /* Barra de scroll horizontal SIEMPRE visible cuando el contenido desborda */
    scrollbar-width: auto;         /* Firefox */
    scrollbar-gutter: stable;
    /* En browsers WebKit: mostrar barra siempre */
}
.screen-table-wrapper::-webkit-scrollbar {
    height: 14px;
    background: #f1f5f9;
}
.screen-table-wrapper::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 7px;
    border: 3px solid #f1f5f9;
}
.screen-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
a.br-sort-link { color: inherit; text-decoration: none; }
a.br-sort-link:hover { text-decoration: underline; }

html[data-theme="dark"] .screen-table-wrapper::-webkit-scrollbar {
    background: #1f2937;
}
html[data-theme="dark"] .screen-table-wrapper::-webkit-scrollbar-thumb {
    background: #475569;
    border-color: #1f2937;
}

/* ==============================================================
   Charts container
   ============================================================== */
#br-charts-container {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}
#br-charts-container .br-chart-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
}

/* ==============================================================
   Dark mode hooks
   ============================================================== */
html[data-theme="dark"] .br-filters-form fieldset,
html[data-theme="dark"] .metrics-summary,
html[data-theme="dark"] .br-menu,
html[data-theme="dark"] #br-charts-container .br-chart-card {
    background: #151922;
    border-color: rgba(255, 255, 255, .12);
    color: #e5e7eb;
}
html[data-theme="dark"] .br-breadcrumb { color: #9ca3af; }
html[data-theme="dark"] .br-input-search,
html[data-theme="dark"] .br-filter-field input,
html[data-theme="dark"] .br-filter-field select,
html[data-theme="dark"] .br-filter-field textarea,
html[data-theme="dark"] .br-inline select {
    background: #0f1115;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, .18);
}
html[data-theme="dark"] .br-menu-item { color: #e5e7eb; }
html[data-theme="dark"] .br-menu-item:hover { background: rgba(255, 255, 255, .06); }

/* ==============================================================
   Print
   ============================================================== */
@media print {
    .no-print { display: none !important; }
}

/* ==============================================================
   Dashboard grid (SPA)
   ============================================================== */
.br-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
    margin-top: 14px;
}
.br-dashboard-block {
    grid-column: span 6;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
}
.br-dashboard-block.col-12 { grid-column: span 12; }
.br-dashboard-block.col-8  { grid-column: span 8; }
.br-dashboard-block.col-6  { grid-column: span 6; }
.br-dashboard-block.col-4  { grid-column: span 4; }
.br-dashboard-block.col-3  { grid-column: span 3; }
.br-dashboard-block.col-2  { grid-column: span 2; }

@media (max-width: 900px) {
    .br-dashboard-block { grid-column: span 12 !important; }
}

.br-block-title {
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}
.br-block-body { flex: 1; min-height: 0; position: relative; }
.br-block-body canvas { max-height: 360px; }
.br-block-loading {
    color: #6b7280; font-size: 13px; padding: 20px; text-align: center;
}

/* KPIs */
.br-kpi { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.br-kpi-value { font-size: 36px; font-weight: 800; color: #0d6efd; line-height: 1.1; }
.br-kpi-label { font-size: 13px; color: #6b7280; margin-top: 8px; }

html[data-theme="dark"] .br-dashboard-block {
    background: #151922;
    border-color: rgba(255, 255, 255, .12);
}
html[data-theme="dark"] .br-block-title { color: #e5e7eb; border-color: rgba(255, 255, 255, .12); }
html[data-theme="dark"] .br-kpi-value   { color: #60a5fa; }

/* ==============================================================
   Sticky horizontal scrollbar — se pega al bottom del viewport
   cuando la tabla es más alta que la pantalla.
   ============================================================== */
.br-sticky-hscroll {
    position: fixed;
    bottom: 0;
    z-index: 40;
    height: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, .06);
    display: none;       /* el JS lo muestra cuando hay overflow horizontal */
}
.br-sticky-hscroll-inner {
    height: 1px;
    background: transparent;
}
.br-sticky-hscroll::-webkit-scrollbar { height: 14px; background: transparent; }
.br-sticky-hscroll::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 7px;
    border: 3px solid #f1f5f9;
}
.br-sticky-hscroll::-webkit-scrollbar-thumb:hover { background: #64748b; }

html[data-theme="dark"] .br-sticky-hscroll {
    background: #1f2937;
    border-top-color: rgba(255, 255, 255, .12);
}
html[data-theme="dark"] .br-sticky-hscroll::-webkit-scrollbar-thumb {
    background: #475569; border-color: #1f2937;
}

@media print { .br-sticky-hscroll { display: none !important; } }

/* ==============================================================
   Editor de reportes (Fase C)
   ============================================================== */
.br-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}
.br-editor-header .badge {
    background: #e5e7eb; color: #111827;
    padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.br-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.br-save-state {
    display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
    background: #e5e7eb; color: #374151;
}
.br-save-state.is-dirty  { background: #fef3c7; color: #92400e; }
.br-save-state.is-saving { background: #dbeafe; color: #1e40af; }
.br-save-state.is-saved  { background: #d1fae5; color: #065f46; }

.br-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 14px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}
.br-tab {
    padding: 8px 14px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}
.br-tab:hover { color: #111827; background: #f9fafb; }
.br-tab.is-active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
}

.br-section { display: none; }
.br-section.is-active { display: block; }

.br-grid-2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 700px) { .br-grid-2 { grid-template-columns: 1fr; } }
.br-field { margin-bottom: 14px; }
.br-field label { display: block; font-weight: 600; color: #374151; font-size: 13px; margin-bottom: 4px; }
.br-field input[type="text"],
.br-field input[type="number"],
.br-field input[type="password"],
.br-field input[type="date"],
.br-field select,
.br-field textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.br-field textarea { font-family: ui-monospace, monospace; font-size: 12px; }
.br-field small.text-muted { display: block; margin-top: 3px; color: #6b7280; font-size: 11px; }
.br-field .req { color: #dc2626; }

.br-builder { background: #f9fafb; padding: 8px; border-radius: 6px; }
.br-builder-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.br-builder-row select, .br-builder-row input { padding: 4px 8px; font-size: 13px; }

/* Listas de items (campos, charts, filtros, blocks, etc.) */
.br-items-list { display: flex; flex-direction: column; gap: 8px; }
.br-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    transition: box-shadow .1s;
}
.br-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.br-item.is-dragging { opacity: .55; }
.br-item.is-collapsed .br-item-body { display: none; }
.br-item-head {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; user-select: none;
}
.br-item-drag {
    cursor: grab; color: #9ca3af; font-size: 18px;
    padding: 0 4px;
}
.br-item-drag:active { cursor: grabbing; }
.br-item-title {
    flex: 1; font-weight: 600; font-size: 14px;
}
.br-item-title .br-item-key {
    font-family: ui-monospace, monospace; font-size: 12px;
    color: #6b7280; font-weight: 400; margin-left: 6px;
}
.br-item-toggle { color: #6b7280; font-size: 12px; }
.br-item-body {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}

.br-item-delete {
    border: 0; background: transparent;
    color: #dc2626; cursor: pointer;
    padding: 4px 8px; border-radius: 4px;
    font-weight: 700;
}
.br-item-delete:hover { background: #fee2e2; }

.br-empty-state {
    padding: 30px 20px; text-align: center;
    color: #6b7280; background: #f9fafb;
    border: 2px dashed #e5e7eb; border-radius: 8px;
}

.br-add-btn {
    margin-top: 10px; width: 100%;
    padding: 8px; background: #fff;
    border: 2px dashed #d1d5db; border-radius: 8px;
    color: #6b7280; font-size: 13px; cursor: pointer;
}
.br-add-btn:hover { border-color: #0d6efd; color: #0d6efd; background: #f0f7ff; }

/* Dark mode */
html[data-theme="dark"] .br-item { background: #151922; border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .br-tab { color: #9ca3af; }
html[data-theme="dark"] .br-tab:hover { background: rgba(255,255,255,.04); color: #e5e7eb; }
html[data-theme="dark"] .br-tab.is-active { color: #60a5fa; border-bottom-color: #60a5fa; }
html[data-theme="dark"] .br-tabs { border-bottom-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .br-field input, html[data-theme="dark"] .br-field select, html[data-theme="dark"] .br-field textarea {
    background: #0f1115; color: #e5e7eb; border-color: rgba(255,255,255,.18);
}
html[data-theme="dark"] .br-field label { color: #e5e7eb; }
html[data-theme="dark"] .br-builder { background: rgba(255,255,255,.04); }
html[data-theme="dark"] .br-empty-state, html[data-theme="dark"] .br-add-btn {
    background: rgba(255,255,255,.02); color: #9ca3af; border-color: rgba(255,255,255,.12);
}

/* ==============================================================
   Editor de Campos v2 — tabla compacta + drawer lateral
   ============================================================== */

/* --- Toolbar sticky --- */
.br-fields-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    flex-wrap: wrap;
}
.br-fields-toolbar .br-input-search {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}
.br-muted { color: #6b7280; }

/* --- Bulk bar (cuando hay selección) --- */
.br-fields-bulkbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #dbeafe 0%, #eff6ff 100%);
    border: 1px solid #93c5fd;
    border-radius: 8px;
    color: #1e40af;
    font-size: 13px;
    font-weight: 600;
    flex-wrap: wrap;
}

/* --- Tabla compacta de campos --- */
.br-fields-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    /* Scroll interno: el header sticky abajo se pega al borde superior
       del wrap, sin solaparse con la toolbar global. */
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    overflow-x: hidden;
}
.br-fields-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.br-fields-table thead th {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
    /* Sticky relativo al wrapper (que tiene overflow:auto). */
    position: sticky;
    top: 0;
    z-index: 2;
}
/* Primer y último th: redondear esquinas (porque el wrap ya no tiene overflow:hidden) */
.br-fields-table thead th:first-child { border-top-left-radius: 8px; }
.br-fields-table thead th:last-child  { border-top-right-radius: 8px; }
.br-fields-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}
.br-fields-table tbody tr:hover { background: #f9fafb; cursor: pointer; }
.br-fields-table tbody tr.is-active {
    background: #eff6ff;
    box-shadow: inset 3px 0 0 #0d6efd;
}
.br-fields-table tbody tr.is-dragging { opacity: .4; }
.br-fields-table td {
    padding: 6px 10px;
    vertical-align: middle;
}
.br-drag-handle {
    cursor: grab;
    color: #9ca3af;
    text-align: center;
    user-select: none;
    font-size: 14px;
}
.br-drag-handle:active { cursor: grabbing; color: #0d6efd; }

/* Inputs inline en la tabla */
.br-inline-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
}
.br-inline-input:hover { border-color: #e5e7eb; background: #fff; }
.br-inline-input:focus {
    outline: none;
    border-color: #0d6efd;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, .15);
}
.br-inline-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* --- Drawer lateral --- */
.br-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .35);
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    animation: brDrawerFadeIn .15s ease-out;
}
@keyframes brDrawerFadeIn { from { opacity: 0; } to { opacity: 1; } }

.br-drawer {
    width: min(540px, 95vw);
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, .12);
    display: flex;
    flex-direction: column;
    animation: brDrawerSlideIn .2s ease-out;
}
@keyframes brDrawerSlideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.br-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.br-drawer-close {
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
}
.br-drawer-close:hover { background: #f3f4f6; color: #111827; }

.br-drawer-tabs {
    display: flex;
    gap: 2px;
    padding: 0 12px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    overflow-x: auto;
}
.br-drawer-tab {
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}
.br-drawer-tab:hover { color: #111827; background: #f9fafb; }
.br-drawer-tab.is-active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
}

.br-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}
.br-drawer-field { margin-bottom: 14px; }
.br-drawer-label {
    display: block;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.br-drawer-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.br-drawer-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .15);
}
textarea.br-drawer-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.br-drawer-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

/* btn-link y btn-danger por si no estaban */
.btn-link {
    background: transparent;
    border: 0;
    color: #0d6efd;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 6px;
}
.btn-link:hover { color: #084298; }

/* Dark mode */
html[data-theme="dark"] .br-fields-toolbar,
html[data-theme="dark"] .br-fields-table-wrap,
html[data-theme="dark"] .br-drawer { background: #151922; border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .br-fields-table thead th { background: #1f2937; color: #e5e7eb; border-bottom-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .br-fields-table tbody tr:hover { background: rgba(255,255,255,.04); }
html[data-theme="dark"] .br-fields-table tbody tr.is-active { background: rgba(96, 165, 250, .12); box-shadow: inset 3px 0 0 #60a5fa; }
html[data-theme="dark"] .br-fields-table tbody tr { border-bottom-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .br-inline-input { color: #e5e7eb; }
html[data-theme="dark"] .br-inline-input:hover { background: #0f1115; border-color: rgba(255,255,255,.18); }
html[data-theme="dark"] .br-inline-input:focus { background: #0f1115; border-color: #60a5fa; }
html[data-theme="dark"] .br-drawer-head, html[data-theme="dark"] .br-drawer-tabs { border-bottom-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .br-drawer-footer { background: rgba(255,255,255,.02); border-top-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .br-drawer-input { background: #0f1115; color: #e5e7eb; border-color: rgba(255,255,255,.18); }
html[data-theme="dark"] .br-drawer-checkbox { background: rgba(255,255,255,.04) !important; }

/* Responsive: drawer ocupa ancho completo en móvil */
@media (max-width: 640px) {
    .br-drawer { width: 100vw; }
    .br-fields-table { font-size: 12px; }
    .br-fields-table th:nth-child(5), .br-fields-table td:nth-child(5) { display: none; }
}

/* ==============================================================
   Cortes de control (control breaks) — filas de subtotales
   ============================================================== */
.report-table tr.br-break-row {
    background: #f1f5f9;
    border-top: 2px solid #cbd5e1;
}
.report-table tr.br-break-row:hover { background: #e2e8f0; cursor: default; }
.report-table .br-break-cell {
    padding: 8px 12px !important;
    font-size: 13px;
    color: #1e293b;
}
.br-break-prefix { color: #64748b; font-family: ui-monospace, monospace; }
.br-break-value {
    background: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
    color: #0d6efd;
}
.br-break-metric {
    display: inline-block;
    margin-left: 12px;
    color: #475569;
}
.br-break-metric em {
    font-style: normal;
    color: #64748b;
    font-weight: 500;
}

/* Niveles más externos: fondo más oscuro para jerarquía visual */
.report-table tr.br-break-level-1 { background: #cbd5e1; font-size: 14px; }
.report-table tr.br-break-level-2 { background: #d4dde8; }
.report-table tr.br-break-level-3 { background: #dde4ec; }
/* Niveles 4-9 quedan con el fondo default br-break-row */

.report-table tr.br-grand-total-row {
    background: #0f172a !important;
    color: #fff !important;
    border-top: 3px double #475569;
    font-size: 14px;
}
.report-table tr.br-grand-total-row .br-break-cell { color: #fff !important; padding: 12px !important; }
.report-table tr.br-grand-total-row .br-break-metric { color: #cbd5e1 !important; }

html[data-theme="dark"] .report-table tr.br-break-row { background: rgba(255,255,255,.04); border-top-color: rgba(255,255,255,.15); }
html[data-theme="dark"] .report-table tr.br-break-row:hover { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .br-break-cell { color: #e5e7eb; }
html[data-theme="dark"] .br-break-value { background: #1f2937; color: #60a5fa; }
html[data-theme="dark"] .report-table tr.br-break-level-1 { background: rgba(255,255,255,.10); }
html[data-theme="dark"] .report-table tr.br-break-level-2 { background: rgba(255,255,255,.07); }
html[data-theme="dark"] .report-table tr.br-break-level-3 { background: rgba(255,255,255,.05); }

/* ==============================================================
   Menú flotante de drilldown (varios destinos)
   ============================================================== */
.br-drill-menu {
    position: fixed;
    z-index: 9000;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    min-width: 240px;
    max-width: 360px;
    padding: 4px;
    animation: brDrillMenuIn .12s ease-out;
}
@keyframes brDrillMenuIn {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}
.br-drill-menu-head {
    padding: 6px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #64748b;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
}
.br-drill-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    border-radius: 4px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #1e293b;
}
.br-drill-menu-item:hover { background: #eff6ff; color: #0d6efd; }
.br-drill-menu-item:active { background: #dbeafe; }
.br-drill-menu-arrow { color: #94a3b8; font-weight: 700; }
.br-drill-menu-item:hover .br-drill-menu-arrow { color: #0d6efd; }
.br-drill-menu-label { flex: 1; font-weight: 500; }
.br-drill-menu-code { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; color: #94a3b8; }

html[data-theme="dark"] .br-drill-menu { background: #151922; border-color: rgba(255,255,255,.15); }
html[data-theme="dark"] .br-drill-menu-head { color: #94a3b8; border-bottom-color: rgba(255,255,255,.10); }
html[data-theme="dark"] .br-drill-menu-item { color: #e5e7eb; }
html[data-theme="dark"] .br-drill-menu-item:hover { background: rgba(96,165,250,.12); color: #60a5fa; }

/* ==============================================================
   Vista jerárquica de cortes de control (drill-down server-side)
   ============================================================== */
.br-breaks-tree {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.br-breaks-grand-total {
    background: #0f172a;
    color: #fff;
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 2px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}
.br-breaks-grand-total .br-breaks-count,
.br-breaks-grand-total .br-breaks-subtotal {
    color: #cbd5e1;
}
.br-breaks-grand-total .br-breaks-count { min-width: 90px; text-align: right; flex: 0 0 auto; }
.br-breaks-grand-total .br-breaks-subtotal { min-width: 150px; text-align: right; flex: 0 0 auto; }
.br-breaks-grand-total .br-breaks-subtotal:first-of-type { margin-left: auto; }
.br-breaks-grand-total .br-breaks-subtotal em { color: #94a3b8; font-style: normal; }

.br-breaks-group {
    border-bottom: 1px solid #f1f5f9;
}
.br-breaks-group.is-expanded { background: #fafbfc; }
.br-breaks-group:last-child { border-bottom: none; }

.br-breaks-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color .12s;
}
.br-breaks-group-head:hover { background: #eff6ff; }

.br-breaks-arrow {
    color: #64748b;
    font-size: 14px;
    width: 16px;
    display: inline-block;
    transition: transform .15s;
}
.br-breaks-group.is-expanded > .br-breaks-group-head > .br-breaks-arrow {
    transform: rotate(0deg);
}

.br-breaks-value {
    font-weight: 600;
    color: #1e40af;
    background: #dbeafe;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.br-breaks-count {
    color: #64748b;
    font-size: 12px;
    flex: 0 0 auto;
    min-width: 90px;
    text-align: right;
}

/* Subtotales alineados en columnas a la derecha: el primero empuja con
   margin-left:auto, y cada uno toma un ancho fijo para que las columnas
   de distintas filas queden alineadas verticalmente. */
.br-breaks-subtotal {
    color: #475569;
    font-size: 13px;
    flex: 0 0 auto;
    min-width: 150px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.br-breaks-subtotal:first-of-type { margin-left: auto; }
.br-breaks-subtotal em {
    font-style: normal;
    color: #94a3b8;
    font-weight: 500;
    margin-right: 3px;
}
.br-breaks-subtotal-desc {
    color: #64748b;
    font-style: italic;
    font-size: 12px;
    margin-left: 4px;
}
html[data-theme="dark"] .br-breaks-subtotal-desc { color: #94a3b8; }

.br-breaks-group-body {
    padding: 8px 0 12px;
    background: #fff;
}

.br-breaks-loading {
    padding: 12px;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}

/* Tabla detalle dentro de la hoja */
.br-breaks-detail-table { font-size: 12px; }
.br-breaks-detail-table th { background: #f8fafc; font-size: 11px; }
.br-breaks-detail-table td { padding: 4px 8px; }

/* Niveles: profundidad visual */
.br-breaks-level-1 .br-breaks-group-head { background: #f1f5f9; font-weight: 600; }
.br-breaks-level-1 .br-breaks-value { background: #cbd5e1; color: #0f172a; }
.br-breaks-level-2 .br-breaks-group-head { font-size: 13px; }
.br-breaks-level-3 .br-breaks-group-head { font-size: 12px; }

html[data-theme="dark"] .br-breaks-tree {
    background: #151922;
    border-color: rgba(255,255,255,.10);
}
html[data-theme="dark"] .br-breaks-group { border-bottom-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .br-breaks-group-head { color: #e5e7eb; }
html[data-theme="dark"] .br-breaks-group-head:hover { background: rgba(96,165,250,.10); }
html[data-theme="dark"] .br-breaks-value { background: rgba(96,165,250,.15); color: #93c5fd; }
html[data-theme="dark"] .br-breaks-group-body { background: #1a1f2e; }
html[data-theme="dark"] .br-breaks-level-1 .br-breaks-group-head { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .br-breaks-group.is-expanded { background: rgba(255,255,255,.03); }
html[data-theme="dark"] .br-breaks-level-1 .br-breaks-value { background: rgba(96,165,250,.25); color: #93c5fd; }
html[data-theme="dark"] .br-breaks-count { color: #94a3b8; }
html[data-theme="dark"] .br-breaks-subtotal { color: #cbd5e1; }
html[data-theme="dark"] .br-breaks-detail-table th { background: rgba(255,255,255,.05); color: #e5e7eb; }
html[data-theme="dark"] .br-breaks-detail-pagination { background: rgba(255,255,255,.03); border-top-color: rgba(255,255,255,.06); }

/* Paginación dentro del árbol de cortes */
.br-breaks-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    flex-wrap: wrap;
}
.br-breaks-pagination-info { color: #64748b; }
.br-breaks-pagination-info strong { color: #1e293b; }
.br-breaks-pagination-nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-wrap: wrap;
}
.br-breaks-pagination-nav .btn { padding: 2px 8px; font-size: 11px; }
.br-breaks-detail-pagination {
    border-top: 1px solid #e5e7eb;
    background: #fafbfc;
    margin-top: 4px;
}

html[data-theme="dark"] .br-breaks-pagination { background: rgba(255,255,255,.03); border-top-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .br-breaks-pagination-info { color: #94a3b8; }
html[data-theme="dark"] .br-breaks-pagination-info strong { color: #e5e7eb; }

/* ==============================================================
   Modal de progreso de generación de PDF (background job)
   ============================================================== */
.br-pdf-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}
.br-pdf-box {
    background: #fff;
    border-radius: 10px;
    padding: 24px 28px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.br-pdf-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #0f172a;
}
.br-pdf-msg {
    color: #475569;
    font-size: 14px;
    margin-bottom: 14px;
    min-height: 18px;
}
.br-pdf-bar-wrap {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.br-pdf-bar {
    height: 100%;
    background: #3b82f6;
    width: 30%;
    border-radius: 4px;
    transition: width .3s ease;
}
.br-pdf-bar-indeterminate {
    width: 30%;
    animation: brPdfSlide 1.4s ease-in-out infinite;
}
@keyframes brPdfSlide {
    0%   { margin-left: -30%; }
    100% { margin-left: 100%; }
}
.br-pdf-stats {
    display: flex;
    gap: 6px;
    align-items: center;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 12px;
}
.br-pdf-stats strong { color: #1e293b; }
.br-pdf-sep { color: #cbd5e1; }
.br-pdf-note {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #78350f;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}
html[data-theme="dark"] .br-pdf-box { background: #1a1f2e; color: #e5e7eb; }
html[data-theme="dark"] .br-pdf-title { color: #f1f5f9; }
html[data-theme="dark"] .br-pdf-msg { color: #cbd5e1; }
html[data-theme="dark"] .br-pdf-stats strong { color: #e5e7eb; }
html[data-theme="dark"] .br-pdf-note {
    background: rgba(252, 211, 77, 0.1);
    border-color: rgba(252, 211, 77, 0.3);
    color: #fcd34d;
}

/* ==============================================================
   Resumen arriba del reporte: total general + métricas inline
   ============================================================== */
.br-header-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 14px;
    padding: 10px 14px;
    background: linear-gradient(90deg, #f0f9ff 0%, #eff6ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    align-items: center;
}
.br-hs-item {
    padding: 4px 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #dbeafe;
    font-size: 13px;
}
.br-hs-item.br-hs-count {
    background: #1e40af;
    color: #fff;
    border-color: #1e40af;
    font-weight: 500;
}
.br-hs-count .br-hs-label { color: #bfdbfe; }
.br-hs-count strong { color: #fff; }
.br-hs-label {
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-right: 4px;
}
.br-hs-item strong { color: #1e293b; }

html[data-theme="dark"] .br-header-summary {
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-color: rgba(96, 165, 250, 0.3);
}
html[data-theme="dark"] .br-hs-item {
    background: #1a1f2e;
    border-color: rgba(96, 165, 250, 0.2);
}
html[data-theme="dark"] .br-hs-item strong { color: #f1f5f9; }

/* ==============================================================
   Filtro con búsqueda (autocomplete server-side para "equals")
   ============================================================== */
.br-search-filter-input {
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}
.br-search-filter-dropdown .br-search-opt:hover {
    background: #eff6ff;
}
html[data-theme="dark"] .br-search-filter-input {
    background: #1a1f2e;
    border-color: rgba(148,163,184,.3);
    color: #e7e7e7;
}
html[data-theme="dark"] .br-search-filter-dropdown {
    background: #1a1f2e !important;
    border-color: rgba(148,163,184,.3) !important;
}
html[data-theme="dark"] .br-search-filter-dropdown .br-search-opt:hover {
    background: rgba(96,165,250,.15) !important;
}

/* ==============================================================
   Editor de bloques del dashboard: drag & drop
   ============================================================== */
.br-block-item { transition: box-shadow .15s, opacity .15s; }
.br-block-dragging { opacity: .5; }
.br-block-drop-target {
    box-shadow: 0 -3px 0 0 #6b21a8;   /* línea superior indicando dónde caería */
}
.br-block-item .br-item-drag {
    user-select: none;
    padding: 0 4px;
}
.br-block-item .br-item-drag:active { cursor: grabbing; }

/* ==============================================================
   Dashboard widgets v2: cards, multi-kpi, gauge, sparkline, text
   ============================================================== */
.br-dashboard-block {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .15s, transform .15s;
}
.br-block-clickable { cursor: pointer; }
.br-block-clickable:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    transform: translateY(-2px);
}
.br-block-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Multi-KPI */
.br-multi-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}
.br-multi-kpi-cell {
    text-align: center;
    padding: 8px;
    background: #f9fafb;
    border-radius: 8px;
}
.br-multi-kpi-value { font-size: 22px; font-weight: 700; color: #111827; }
.br-multi-kpi-label { font-size: 11px; color: #6b7280; margin-top: 4px; text-transform: uppercase; letter-spacing: .3px; }

/* Gauge */
.br-gauge { text-align: center; }
.br-gauge-label { font-size: 13px; color: #374151; margin-top: 4px; font-weight: 600; }
.br-gauge-range { font-size: 11px; color: #9ca3af; }

/* Sparkline */
.br-sparkline-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.br-sparkline-value { font-size: 24px; font-weight: 700; color: #111827; }
.br-sparkline-delta { font-size: 13px; font-weight: 600; }

/* Texto / nota */
.br-block-text { font-size: 14px; color: #374151; line-height: 1.5; }
.br-block-text h2 { font-size: 18px; margin: 6px 0; }
.br-block-text h3 { font-size: 16px; margin: 6px 0; }
.br-block-text h4 { font-size: 14px; margin: 6px 0; }
.br-block-text ul { margin: 6px 0; padding-left: 20px; }

/* Paginador de tabla */
.br-block-pager {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin-top: 10px; padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}
.br-block-pager-info { font-size: 12px; color: #6b7280; }

/* Dark mode */
html[data-theme="dark"] .br-dashboard-block { background: #1a1f2e; border-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .br-multi-kpi-cell { background: #232838; }
html[data-theme="dark"] .br-multi-kpi-value,
html[data-theme="dark"] .br-sparkline-value { color: #f1f5f9; }
html[data-theme="dark"] .br-block-text { color: #cbd5e1; }

/* ==============================================================
   Home: pestañas de tipo de reporte
   ============================================================== */
.br-type-tabs {
    display: flex; gap: 4px; margin-bottom: 14px;
    border-bottom: 2px solid #e5e7eb; flex-wrap: wrap;
}
.br-type-tab {
    background: none; border: none; padding: 8px 14px;
    font-size: 13px; color: #6b7280; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    display: flex; align-items: center; gap: 6px;
}
.br-type-tab:hover { color: #374151; }
.br-type-tab.is-active { color: #1e40af; border-bottom-color: #1e40af; font-weight: 600; }
.br-type-tab-count {
    background: #e5e7eb; color: #6b7280; font-size: 11px;
    padding: 1px 7px; border-radius: 10px; font-weight: 600;
}
.br-type-tab.is-active .br-type-tab-count { background: #dbeafe; color: #1e40af; }

/* Badge de tipo en la tabla */
.br-type-badge {
    font-size: 11px; padding: 2px 8px; border-radius: 4px;
    font-weight: 600; white-space: nowrap;
}
.br-type-single_source { background: #e0f2fe; color: #075985; }
.br-type-multi_source  { background: #f3e8ff; color: #6b21a8; }
.br-type-dashboard     { background: #dcfce7; color: #166534; }

/* ==============================================================
   Diagrama de drilldown
   ============================================================== */
.br-drillmap-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.br-drillmap-legend {
    display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px;
    font-size: 12px; color: #6b7280;
}
.br-drillmap-legend span { display: flex; align-items: center; gap: 6px; }
.br-dm-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1.5px solid; }
.br-dm-root    { background: #1e40af; border-color: #1e40af; }
.br-dm-single  { background: #fff;    border-color: #cbd5e1; }
.br-dm-multi   { background: #f3e8ff; border-color: #a855f7; }
.br-dm-missing { background: #fef2f2; border-color: #dc2626; }
.br-drillmap-canvas {
    overflow: auto; border: 1px solid #e5e7eb; border-radius: 10px;
    background: #fafafa; padding: 10px;
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
}
.br-dm-node:hover rect { filter: brightness(0.97); }
.br-drillmap-empty {
    padding: 30px; text-align: center; color: #6b7280;
    background: #f9fafb; border-radius: 10px; border: 1px dashed #d1d5db;
}

/* ==============================================================
   Overlay de carga + placeholder "presioná Ejecutar"
   ============================================================== */
.br-loading-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(255,255,255,.65);
    display: flex; align-items: center; justify-content: center;
}
.br-loading-box {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 26px 38px; box-shadow: 0 10px 40px rgba(0,0,0,.15);
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.br-loading-spinner {
    width: 38px; height: 38px; border-radius: 50%;
    border: 4px solid #e5e7eb; border-top-color: #1e40af;
    animation: br-spin .8s linear infinite;
}
@keyframes br-spin { to { transform: rotate(360deg); } }
.br-loading-text { font-size: 14px; color: #374151; font-weight: 600; }

.br-run-placeholder {
    padding: 60px 20px; text-align: center; color: #6b7280;
    background: #f9fafb; border: 1px dashed #d1d5db; border-radius: 10px;
}
.br-run-placeholder-icon { font-size: 34px; margin-bottom: 10px; }
.br-run-placeholder-text { font-size: 14px; }

html[data-theme="dark"] .br-loading-overlay { background: rgba(15,18,28,.65); }
html[data-theme="dark"] .br-loading-box { background: #1a1f2e; border-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .br-loading-text { color: #e2e8f0; }
html[data-theme="dark"] .br-run-placeholder { background: #161b29; border-color: rgba(255,255,255,.12); }

/* ==============================================================
   Cross-filter del dashboard: barra de filtros activos por click
   ============================================================== */
.br-crossfilter-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin: 8px 0 14px; padding: 8px 12px;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
}
.br-crossfilter-label { font-size: 12px; font-weight: 600; color: #1e40af; }
.br-crossfilter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #1e40af; color: #fff; font-size: 12px;
    padding: 3px 6px 3px 10px; border-radius: 14px;
}
.br-crossfilter-x {
    background: rgba(255,255,255,.25); border: none; color: #fff;
    width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
    font-size: 10px; line-height: 1; display: inline-flex;
    align-items: center; justify-content: center; padding: 0;
}
.br-crossfilter-x:hover { background: rgba(255,255,255,.45); }
.br-crossfilter-clear {
    background: none; border: none; color: #1e40af; cursor: pointer;
    font-size: 12px; text-decoration: underline; padding: 2px 4px;
}
html[data-theme="dark"] .br-crossfilter-bar { background: #1a2236; border-color: #2a3550; }
html[data-theme="dark"] .br-crossfilter-label,
html[data-theme="dark"] .br-crossfilter-clear { color: #93c5fd; }

/* Celdas de tabla cliqueables para cross-filter del dashboard */
.br-cf-cell { cursor: pointer; position: relative; }
.br-cf-cell:hover {
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #93c5fd;
}
html[data-theme="dark"] .br-cf-cell:hover {
    background: rgba(59,130,246,.15);
    box-shadow: inset 0 0 0 1px #3b82f6;
}

/* ==============================================================
   Login / auth
   ============================================================== */
body.br-body-auth {
    display: flex; min-height: 100vh; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    margin: 0;
}
.br-auth-main { width: 100%; max-width: 380px; padding: 20px; }
.br-login-card {
    background: #fff; border-radius: 14px; padding: 34px 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.br-login-brand {
    font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    color: #1e40af; margin-bottom: 6px;
}
.br-login-title { font-size: 20px; margin: 0 0 20px; color: #111827; }
.br-login-form label { display: block; margin-bottom: 14px; }
.br-login-form label span { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.br-login-form input {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
    border-radius: 7px; box-sizing: border-box; font-size: 14px;
}
.br-login-form input:focus { outline: none; border-color: #1e40af; box-shadow: 0 0 0 3px rgba(30,64,175,.12); }

/* Navbar: usuario + logout */
.br-navbar-user {
    font-size: 13px; color: #cbd5e1; padding: 0 8px;
    display: inline-flex; align-items: center;
}
.br-navbar-logout { margin-right: 4px; }

html[data-theme="dark"] .br-login-card { background: #1a1f2e; }
html[data-theme="dark"] .br-login-title { color: #f1f5f9; }
html[data-theme="dark"] .br-login-form input { background: #0f1420; border-color: #2a3550; color: #e2e8f0; }

/* Filas de tabla del dashboard con drilldown */
.br-drill-row { cursor: pointer; }
.br-drill-row:hover { background: #eff6ff; }
html[data-theme="dark"] .br-drill-row:hover { background: rgba(59,130,246,.15); }

/* Tabla key-value del modal de detalle de fila */
.br-kv-label {
    text-align: left;
    padding: 4px 8px;
    background: #f3f4f6;
    white-space: nowrap;
    width: 1%;
    font-weight: 500;
}
.br-kv-value {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
}
html[data-theme="dark"] .br-kv-label {
    background: rgba(255,255,255,.06);
    color: #e5e7eb;
}
html[data-theme="dark"] .br-kv-value {
    border-bottom-color: rgba(255,255,255,.08);
    color: #e5e7eb;
}
