/* ============================================================
   Implementaci?n Control - Design System
   Inspired by Monday.com / Airtable / Notion
   ============================================================ */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --purple: #8b5cf6;
    --teal: #14b8a6;

    /* Modo claro suave (gris claro, no blanco puro) */
    --bg-body: #e6e9ef;
    --bg-card: #f0f2f5;
    --bg-sidebar: #eceff3;
    --bg-sidebar-hover: rgba(15, 23, 42, 0.06);
    --bg-topbar: #eceff3;
    --bg-elevated: #f5f6f8;
    --text-primary: #0f172a;
    --text-secondary: #1e293b;
    --text-muted: #334155;
    --border-color: #d5dae3;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color-scheme: light;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0c0c14;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-topbar: #1e293b;
    --bg-elevated: #243247;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --primary-light: rgba(99, 102, 241, 0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    /* Bootstrap alineado al tema (evita kbd/blanco-sobre-blanco) */
    --bs-body-color: #f1f5f9;
    --bs-body-color-rgb: 241, 245, 249;
    --bs-body-bg: #0f172a;
    --bs-body-bg-rgb: 15, 23, 42;
    --bs-emphasis-color: #f1f5f9;
    --bs-emphasis-color-rgb: 241, 245, 249;
    --bs-secondary-color: #94a3b8;
    --bs-tertiary-color: #64748b;
    --bs-secondary-bg: #1e293b;
    --bs-tertiary-bg: #243247;
    --bs-border-color: #334155;
    --bs-heading-color: #f1f5f9;
    color-scheme: dark;
}

/* Bootstrap / tablas: evitar blanco puro en modo claro */
[data-theme="light"] .table,
:root:not([data-theme="dark"]) .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: color-mix(in srgb, var(--bg-body) 55%, var(--bg-card));
    --bs-table-hover-bg: color-mix(in srgb, var(--bg-body) 70%, var(--bg-card));
}
[data-theme="light"] .table-light,
:root:not([data-theme="dark"]) .table-light,
[data-theme="light"] .table > :not(caption) > * > .table-light,
:root:not([data-theme="dark"]) thead.table-light,
[data-theme="light"] .sticky-top.table-light,
:root:not([data-theme="dark"]) .table thead th {
    --bs-table-bg: var(--bg-elevated, #f5f6f8);
    background-color: var(--bg-elevated, #f5f6f8) !important;
    color: var(--text-primary);
}
[data-theme="light"] .dropdown-menu,
:root:not([data-theme="dark"]) .dropdown-menu {
    background-color: var(--bg-elevated, #f5f6f8);
    border-color: var(--border-color);
}
[data-theme="light"] .card,
:root:not([data-theme="dark"]) .card {
    background-color: var(--bg-card);
}
[data-theme="light"] .bg-white,
:root:not([data-theme="dark"]) .bg-white {
    background-color: var(--bg-card) !important;
}
[data-theme="light"] .btn-light,
:root:not([data-theme="dark"]) .btn-light {
    background-color: var(--bg-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

html.ic-theme-animate,
html.ic-theme-animate body,
html.ic-theme-animate .card,
html.ic-theme-animate .kpi-card,
html.ic-theme-animate .topbar,
html.ic-theme-animate .share-topbar,
html.ic-theme-animate .main-content,
html.ic-theme-animate .page-content,
html.ic-theme-animate .login-card,
html.ic-theme-animate .form-control,
html.ic-theme-animate .form-select,
html.ic-theme-animate .modal-content,
html.ic-theme-animate .modal-header,
html.ic-theme-animate .modal-footer,
html.ic-theme-animate .dropdown-menu,
html.ic-theme-animate .data-table-card,
html.ic-theme-animate .table-card,
html.ic-theme-animate .btn-outline-secondary,
html.ic-theme-animate .btn-outline-primary,
html.ic-theme-animate .alert,
html.ic-theme-animate .badge,
html.ic-theme-animate .dashboard-chart-card,
html.ic-theme-animate .share-layout-body {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease !important;
}

/* ========== APP LAYOUT ========== */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-secondary);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.brand-logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.brand-logo-img {
    display: block;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-logo-img--sidebar-icon {
    max-height: 40px;
    max-width: 40px;
    background: #fff;
    border-radius: 8px;
    padding: 3px;
}

.brand-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.brand-title-main {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.brand-title-main--login {
    font-size: 1.65rem;
    margin: 0.75rem 0 0;
    color: var(--text-primary);
}

.brand-logo-img--login-icon {
    max-height: 72px;
    max-width: 72px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.brand-logo-img--operis-login {
    max-height: 130px;
    max-width: min(450px, 90vw);
    width: auto;
    height: auto;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    padding: 14px 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    object-fit: contain;
    display: block;
}

.login-logo--operis {
    margin: 0 auto 1rem;
    width: auto;
    display: flex;
    justify-content: center;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-title-main--login.is-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.login-tagline {
    text-align: center;
    max-width: 32ch;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-decoration-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    padding: 14px 20px;
    margin: 0 auto 1.5rem;
    width: fit-content;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.login-decoration-logo img {
    display: block;
    max-height: 72px;
    max-width: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.chart-label-colors-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

.chart-label-color-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.chart-label-color-swatch,
.chart-label-color-input {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.15rem;
    flex-shrink: 0;
    cursor: pointer;
}

.chart-label-color-hex {
    width: 7.5rem;
    max-width: 40%;
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.chart-label-color-name {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.brand-logo-img--sidebar {
    max-height: 52px;
    max-width: 168px;
    background: #fff;
    border-radius: 10px;
    padding: 4px 8px;
}

.brand-logo-img--login {
    max-height: 150px;
    max-width: min(280px, 100%);
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.logo i { color: var(--primary); font-size: 1.5rem; }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; }

.nav-section { margin-bottom: 1.5rem; }

.nav-section-title {
    display: block;
    padding: 0 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    margin-bottom: 2px;
}

.nav-link:hover { background: var(--bg-sidebar-hover); color: var(--text-primary); }
.nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.nav-link-add { color: var(--primary) !important; opacity: 0.8; }
.nav-link-add:hover { opacity: 1; }

.nav-campo-group { margin-bottom: 0.75rem; }

/* Sidebar: acorde?n por campo */
.nav-section-tables {
    margin-bottom: 0.5rem;
}

.nav-campo-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-campo-accordion {
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    overflow: hidden;
    transition: border-color 0.22s ease;
}
.nav-campo-accordion.is-selected {
    border-color: color-mix(in srgb, var(--text-primary) 35%, transparent);
}

/* Fila principal: acordeón y embed misma altura */
.nav-campo-header-btn,
.nav-campo-embed-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.45rem 0.65rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: color 0.2s ease;
}
.nav-campo-header-btn:hover,
.nav-campo-embed-link:hover {
    color: var(--text-primary);
}
.nav-campo-header-btn.is-active,
.nav-campo-accordion.is-open > .nav-campo-header-btn,
.nav-campo-accordion.is-selected > .nav-campo-embed-link {
    color: var(--text-primary);
}

.nav-campo-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease;
}
.nav-campo-accordion.is-open .nav-campo-icon-wrap,
.nav-campo-header-btn.is-active .nav-campo-icon-wrap,
.nav-campo-accordion.is-selected > .nav-campo-embed-link .nav-campo-icon-wrap {
    background: var(--primary-light);
    color: var(--primary);
}
.nav-campo-icon-wrap.is-muted {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-muted);
}

.nav-campo-title-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none !important;
}

.nav-campo-count {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
    flex-shrink: 0;
}

.nav-campo-chevron {
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}
.nav-campo-accordion.is-open .nav-campo-chevron {
    transform: rotate(180deg);
    color: var(--text-primary);
}

/* Panel animado */
.nav-campo-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-campo-accordion.is-open .nav-campo-panel {
    grid-template-rows: 1fr;
}
.nav-campo-panel[hidden] {
    display: none !important;
}
.nav-campo-panel-inner {
    overflow: hidden;
    padding: 0 0.35rem 0.4rem;
}

.nav-link-campo-item,
.nav-link-view-all,
.nav-link-add-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.55rem 0.42rem 0.65rem !important;
    margin-bottom: 0.15rem;
    border-radius: 8px;
    font-size: 0.8rem !important;
    opacity: 0;
    transform: translateX(-6px);
    animation: none;
}
.nav-campo-accordion.is-open .nav-link-campo-item,
.nav-campo-accordion.is-open .nav-link-view-all,
.nav-campo-accordion.is-open .nav-link-add-item {
    animation: navCampoItemIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: var(--item-delay, 0ms);
}
@keyframes navCampoItemIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-link-campo-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}
.nav-link-campo-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-campo-item-count {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.nav-link-campo-item:hover {
    background: var(--bg-sidebar-hover) !important;
}
.nav-link-campo-item.active {
    background: transparent !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    box-shadow: inset 2px 0 0 var(--primary);
}
.nav-link-view-all {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin-top: 0.15rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.55rem !important;
    border-radius: 0 0 8px 8px;
}
.nav-link-add-item {
    color: var(--text-primary) !important;
    opacity: 1;
    transform: none;
    animation: none !important;
}
.nav-link-add-item:hover {
    color: var(--text-primary) !important;
}

.nav-link-customize-preview {
    color: var(--text-muted) !important;
    font-size: 0.78rem;
    margin-top: 0.15rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.5rem !important;
}
.nav-link-customize-preview:hover {
    color: var(--text-secondary) !important;
}
.nav-link-customize-preview i {
    opacity: 0.85;
}

.sidebar-preview-pick-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: min(58vh, 420px);
    overflow: auto;
    padding-right: 0.15rem;
}
.sidebar-preview-pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-card, #fff);
}
.sidebar-preview-pick-row.is-on {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.06);
}
.sidebar-preview-pick-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.sidebar-preview-pick-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}
.sidebar-preview-pick-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.table-progress-badge {
    max-width: 320px;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.08);
}
.table-progress-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}
.table-progress-meta strong {
    color: #16a34a;
}
#tableProgressPercent {
    font-weight: 700;
    font-size: 1rem;
}
.table-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
}
.table-progress-bar .progress-bar {
    border-radius: 999px;
}
.excel-cell--progress-ok,
select.excel-cell.excel-cell--progress-ok {
    font-weight: 600;
}
#tableProgressFilteredHint {
    font-size: 0.68rem;
    font-weight: 600;
}
[data-theme="dark"] .table-progress-badge {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
}
[data-theme="dark"] .sidebar-preview-pick-row {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(148, 163, 184, 0.2);
}
[data-theme="dark"] .sidebar-preview-pick-row.is-on {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(129, 140, 248, 0.45);
}

.nav-campo-empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
    color: #64748b;
}

/* Enlaces directos (RacooApp, Productividad) ? estilos en .nav-campo-embed-link arriba */

.nav-campo-disabled {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    opacity: 0.5;
}
.nav-campo-soon {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-muted);
}
[data-theme="dark"] .nav-campo-soon {
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
}

.chart-picker-sortable { margin-top: 0.25rem; }
.chart-picker-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0.5rem;
}
.chart-picker-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.chart-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    background: var(--bg-card, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chart-picker-table-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.55rem;
    margin-bottom: 0.15rem;
    padding: 0.35rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted, #94a3b8);
    border-bottom: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
}
.chart-picker-table-header:first-child {
    margin-top: 0;
}
.chart-picker-table-header i {
    opacity: 0.75;
}
.chart-picker-item.is-dragging {
    opacity: 0.55;
    border-color: rgba(99, 102, 241, 0.5);
}
.chart-picker-item.is-drag-over {
    border-color: rgba(99, 102, 241, 0.75);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}
.chart-picker-drag {
    flex-shrink: 0;
    color: var(--text-muted, #94a3b8);
    cursor: grab;
    padding: 0.15rem 0.2rem;
    line-height: 1;
    user-select: none;
}
.chart-picker-drag:active { cursor: grabbing; }
.chart-picker-item .form-check {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
.chart-picker-order-btns {
    display: flex;
    flex-shrink: 0;
    gap: 0.15rem;
}
.chart-picker-order-btns .btn {
    padding: 0.1rem 0.35rem;
    line-height: 1.2;
}

.campo-overview-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    --campo-accent: #6366f1;
}
.campo-overview-card:hover {
    border-color: var(--campo-accent);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--campo-accent) 15%, transparent);
    transform: translateY(-3px);
    color: inherit;
}
.campo-overview-card--disabled {
    opacity: 0.55;
    pointer-events: none;
}
.campo-overview-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--campo-accent) 14%, transparent);
    color: var(--campo-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.campo-overview-card:hover .campo-overview-icon {
    transform: scale(1.08);
}
.campo-overview-body { flex: 1; min-width: 0; }
.campo-overview-body h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
    font-weight: 600;
}
.campo-overview-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

.campo-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-right: 0.5rem;
    border-radius: 10px;
    vertical-align: middle;
    background: color-mix(in srgb, var(--campo-accent) 14%, transparent);
    color: var(--campo-accent);
    font-size: 1.1rem;
}
.campo-page-title {
    display: flex;
    align-items: center;
}

.nav-link-campo { padding-left: 1.25rem; font-size: 0.8125rem; }
.nav-link-disabled { opacity: 0.55; cursor: default; pointer-events: none; }

.campo-tabs { flex-wrap: wrap; }

.dashboard-tabs-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.5rem;
}

.dashboard-tabs-stack .ggc-subtabs-row {
    margin-left: 0;
}

/* Resumen Capacitaciones (panel + enlace) */
.cap-summary-hero {
    --cap-accent: #dc2626;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    margin-bottom: 0.9rem;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--cap-accent) 28%, var(--border-color));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--cap-accent) 16%, var(--bg-card)) 0%, var(--bg-card) 55%),
        var(--bg-card);
    overflow: hidden;
}
.cap-summary-hero--compact {
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
}
.cap-summary-hero__glow {
    position: absolute;
    inset: -40% auto auto -10%;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--cap-accent) 35%, transparent), transparent 70%);
    pointer-events: none;
}
.cap-summary-hero__icon {
    position: relative;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--cap-accent) 18%, transparent);
    color: var(--cap-accent);
    font-size: 1.25rem;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cap-accent) 35%, transparent);
}
.cap-summary-hero__copy { position: relative; min-width: 0; }
.cap-summary-hero__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--cap-accent) 75%, var(--text-secondary));
}
.cap-summary-hero__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cap-accent);
}
.cap-summary-hero__text {
    margin: 0;
    max-width: 46rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.45;
}
.cap-summary-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.cap-summary-hero__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    background: color-mix(in srgb, var(--cap-accent) 10%, var(--bg-body));
    border: 1px solid color-mix(in srgb, var(--cap-accent) 22%, var(--border-color));
}
.cap-summary-hero__chip i { color: var(--cap-accent); font-size: 0.8rem; }

.cap-summary-root { width: 100%; }
.cap-summary__shell {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
.cap-summary-root.is-loading .cap-summary__shell {
    opacity: 0.88;
}
.cap-summary__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-body) 65%, var(--bg-card)), var(--bg-card));
}
.cap-summary__bar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.cap-summary__search {
    position: relative;
    min-width: 14rem;
    flex: 1 1 16rem;
    max-width: 30rem;
}
.cap-summary__search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.9rem;
}
.cap-summary__search .form-control {
    padding-left: 2.15rem;
    border-radius: 10px;
    background: var(--bg-body);
    border-color: var(--border-color);
}
.cap-summary__search .form-control:focus {
    border-color: color-mix(in srgb, #dc2626 55%, var(--border-color));
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, #dc2626 18%, transparent);
}
.cap-summary__btn {
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    font-weight: 600;
}
.cap-summary__btn:hover,
.cap-summary__btn.active {
    border-color: color-mix(in srgb, #dc2626 45%, var(--border-color));
    background: color-mix(in srgb, #dc2626 12%, var(--bg-body));
    color: #fca5a5;
}
.cap-summary__btn--ghost {
    background: transparent;
}
.cap-summary__count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fecaca;
    background: color-mix(in srgb, #dc2626 16%, transparent);
    border: 1px solid color-mix(in srgb, #dc2626 28%, transparent);
    white-space: nowrap;
}
.cap-summary__filters-panel {
    padding: 0.75rem 1rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-body) 40%, var(--bg-card));
}
.cap-summary__filters-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.cap-summary__filters-label i { color: #f87171; }
.cap-summary__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.65rem;
}
.cap-summary__filters-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.cap-summary__filter {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 8.25rem;
    max-width: 12rem;
    margin: 0;
    padding: 0.4rem 0.5rem 0.5rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--bg-card);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cap-summary__filter.is-active {
    border-color: color-mix(in srgb, #dc2626 45%, var(--border-color));
    box-shadow: 0 0 0 1px color-mix(in srgb, #dc2626 18%, transparent);
}
.cap-summary__filter > span {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cap-summary__filter .form-select {
    border-radius: 8px;
    background: var(--bg-body);
}
.cap-summary__picker-wrap { position: relative; }
.cap-summary__picker {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 40;
    width: min(24rem, 92vw);
    max-height: min(26rem, 72vh);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.cap-summary__picker.d-none { display: none !important; }
.cap-summary__picker-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.85rem 0.95rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, color-mix(in srgb, #dc2626 12%, var(--bg-card)), var(--bg-card));
}
.cap-summary__picker-list {
    overflow: auto;
    padding: 0.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem 0.45rem;
}
.cap-summary__picker-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.4rem 0.45rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    cursor: pointer;
}
.cap-summary__picker-item:hover {
    background: color-mix(in srgb, #dc2626 12%, transparent);
}
.cap-summary__picker-item input { margin: 0; flex-shrink: 0; }
.cap-summary__picker-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
}
.cap-summary__length {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.cap-summary__length .form-select {
    width: auto;
    min-width: 5.25rem;
    border-radius: 8px;
    background: var(--bg-body);
}
.cap-summary__picker-actions {
    display: flex;
    gap: 0.25rem;
    padding: 0.15rem 0.55rem 0;
    border-bottom: 1px solid transparent;
}
.cap-summary__table-wrap {
    overflow: auto;
    max-height: min(82vh, 58rem);
    min-height: 22rem;
}
.cap-summary__table {
    margin: 0;
    font-size: 0.875rem;
    white-space: nowrap;
    border-collapse: separate;
    border-spacing: 0;
}
.cap-summary__table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.85rem 1rem;
    background: color-mix(in srgb, var(--bg-body) 88%, #7f1d1d);
    border-bottom: 1px solid color-mix(in srgb, #dc2626 30%, var(--border-color));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.cap-summary__table tbody td {
    padding: 0.85rem 1rem;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
}
.cap-summary__pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-body) 45%, var(--bg-card));
}
.cap-summary__pager.is-empty {
    display: none;
}
.cap-summary__pager-info {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.cap-summary__pager-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cap-summary__pager-page {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 5.5rem;
    text-align: center;
}
.cap-summary__table tbody tr {
    transition: background 0.12s ease;
}
.cap-summary__table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--bg-body) 35%, transparent);
}
.cap-summary__table tbody tr:hover {
    background: color-mix(in srgb, #dc2626 10%, transparent);
}
.cap-summary__td--notary { min-width: 9rem; }
.cap-summary__row--clickable {
    cursor: pointer;
}
.cap-summary__cell-link {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: #4f8cff;
    background: color-mix(in srgb, #4f8cff 14%, transparent);
}
.cap-summary__cell-link:hover { background: color-mix(in srgb, #4f8cff 26%, transparent); }
.cap-summary__table .cap-summary__th-actions,
.cap-summary__table .cap-summary__td-actions {
    position: sticky;
    right: 0;
    text-align: right;
    white-space: nowrap;
    background: var(--bg-card);
}
.cap-summary__row-btn {
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    background: transparent;
}
.cap-summary__row-btn + .cap-summary__row-btn {
    margin-left: 0.3rem;
}
.cap-summary__row-btn:hover {
    color: #1a73e8;
    border-color: #1a73e8;
}
.cap-summary__row-btn--danger:hover {
    color: #dc2626;
    border-color: #dc2626;
}
.cap-summary__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.2rem 0.55rem 0.2rem 0.35rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.78rem;
    background: color-mix(in srgb, var(--pill, #dc2626) 14%, transparent);
    color: var(--text-primary);
    border: 1px solid color-mix(in srgb, var(--pill, #dc2626) 30%, transparent);
}
.cap-summary__pill-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--pill, #dc2626);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pill, #dc2626) 22%, transparent);
    flex-shrink: 0;
}
.cap-summary__when {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.15;
    gap: 0.1rem;
}
.cap-summary__when-date { font-weight: 700; color: var(--text-primary); }
.cap-summary__when-time { font-size: 0.72rem; color: var(--text-secondary); }
.cap-summary__status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.cap-summary__status--ok {
    color: #86efac;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.28);
}
.cap-summary__status--warn {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.14);
    border: 1px solid rgba(220, 38, 38, 0.3);
}
.cap-summary__muted { color: var(--text-secondary); opacity: 0.7; }
.cap-summary__loading,
.cap-summary__empty {
    text-align: center !important;
    padding: 2.4rem 1rem !important;
    white-space: normal;
    color: var(--text-secondary);
}
.cap-summary__empty {
    display: table-cell;
}
.cap-summary__empty i {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
    color: #f87171;
}
.cap-summary__empty strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}
.cap-summary__empty--error i { color: #fbbf24; }
.btn-zoom,
.btn-zoom:focus {
    --zoom-blue: #2D8CFF;
    background: var(--zoom-blue) !important;
    border-color: var(--zoom-blue) !important;
    color: #fff !important;
    font-weight: 600;
}
.btn-zoom:hover {
    background: color-mix(in srgb, #2D8CFF 82%, #000) !important;
    border-color: color-mix(in srgb, #2D8CFF 82%, #000) !important;
    color: #fff !important;
}

/* ——— Tema Zoom (azul, distinto de notarías verde) ——— */
.zoom-hub,
.zoom-table-hero {
    --campo-accent: #2d8cff;
    --zoom-blue: #2d8cff;
}
.zoom-hub .notary-empty-card,
.zoom-empty-card {
    border-color: color-mix(in srgb, #2d8cff 40%, var(--border-color));
    background: color-mix(in srgb, #2d8cff 8%, var(--bg-card));
}
.zoom-hub .notary-empty-card__icon,
.zoom-empty-card .notary-empty-card__icon {
    color: #2d8cff;
    background: color-mix(in srgb, #2d8cff 16%, transparent);
}
.zoom-path.notary-path,
.zoom-hub .notary-path {
    background: color-mix(in srgb, #2d8cff 9%, var(--bg-elevated));
    border-color: color-mix(in srgb, #2d8cff 22%, transparent);
}
.zoom-path .notary-path__crumb,
.zoom-hub .notary-path__crumb {
    color: #2d8cff;
}
.zoom-path .notary-path__crumb:hover,
.zoom-hub .notary-path__crumb:hover {
    background: color-mix(in srgb, #2d8cff 16%, transparent);
    color: #1a73e8;
}
.zoom-path .notary-path__here,
.zoom-hub .notary-path__here {
    background: color-mix(in srgb, #2d8cff 22%, transparent);
    color: var(--text-primary);
}
.zoom-hub .notary-kicker,
.zoom-hub .notary-block-title {
    color: #2d8cff;
}
.zoom-hub .campo-page-icon,
.zoom-table-hero .campo-page-icon {
    background: color-mix(in srgb, #2d8cff 14%, transparent);
    color: #2d8cff;
}
.zoom-hub .btn-primary,
.zoom-table-hero .btn-primary {
    background: #2d8cff !important;
    border-color: #2d8cff !important;
}
.zoom-hub .btn-primary:hover,
.zoom-table-hero .btn-primary:hover {
    background: #1a73e8 !important;
    border-color: #1a73e8 !important;
}
.zoom-hub .btn-outline-primary {
    color: #2d8cff !important;
    border-color: color-mix(in srgb, #2d8cff 55%, transparent) !important;
}
.zoom-hub .zoom-share-toggle {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.15;
    padding: 0.22rem 0.5rem;
    white-space: nowrap;
}
.zoom-hub .zoom-share-toggle.dropdown-toggle::after {
    margin-left: 0.28rem;
    vertical-align: 0.08em;
}
.zoom-hub .btn-outline-primary:hover {
    background: color-mix(in srgb, #2d8cff 16%, transparent) !important;
    color: #1a73e8 !important;
    border-color: #2d8cff !important;
}
.zoom-hub .table-card:not(.notary-link-btn) {
    border-color: color-mix(in srgb, #2d8cff 32%, var(--border-color));
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #2d8cff 26%, transparent), transparent 62%),
        radial-gradient(90% 70% at 100% 100%, color-mix(in srgb, #2d8cff 10%, transparent), transparent 55%),
        var(--bg-card);
    box-shadow: 0 0 22px color-mix(in srgb, #2d8cff 18%, transparent);
}
.zoom-hub .table-card:not(.notary-link-btn):hover {
    border-color: color-mix(in srgb, #2d8cff 48%, var(--border-color));
    box-shadow: 0 0 28px color-mix(in srgb, #2d8cff 28%, transparent);
}
.zoom-hub .notary-folder-card {
    box-shadow: 0 10px 24px color-mix(in srgb, #2d8cff 10%, transparent);
}
.zoom-hub .notary-folder-card:hover {
    box-shadow: 0 14px 28px color-mix(in srgb, #2d8cff 16%, transparent);
}
body.is-zoom-context .alert-success,
.alert-zoom.alert-success {
    color: #bfdbfe;
    background: color-mix(in srgb, #2d8cff 18%, var(--bg-card));
    border-color: color-mix(in srgb, #2d8cff 40%, transparent);
}
body.is-zoom-context .alert-success .btn-close {
    filter: invert(1) grayscale(1);
}

.zoom-session-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.zoom-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    background: var(--card-bg, var(--bg-elevated, #1e2430));
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.zoom-session-item:hover:not(.is-pending) {
    border-color: #2d8cff;
    background: color-mix(in srgb, #2d8cff 10%, transparent);
    color: inherit;
}
.zoom-session-item.is-pending {
    opacity: 0.72;
    cursor: default;
}
.zoom-session-item__label {
    font-weight: 600;
}
.zoom-session-item__hint {
    font-size: 0.82rem;
    color: var(--text-muted, #9aa3b2);
}
.zoom-session-item .bi-chevron-right {
    color: var(--text-muted, #9aa3b2);
}
.zoom-show-block {
    margin-bottom: 2rem;
}
.zoom-refresh-progress {
    margin: -0.75rem 0 1.5rem;
}
.zoom-refresh-progress__log {
    max-height: 9rem;
    overflow-y: auto;
    padding-left: 1.25rem;
}
.zoom-show-block--inscritos {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.campo-tab { text-decoration: none; color: inherit; }
.campo-tab-disabled { opacity: 0.65; }

.dashboard-campo-panel.d-none { display: none !important; }
.dashboard-campo-empty { min-height: 200px; }

.edit-campo-section { border-left: 3px solid var(--primary); padding-left: 1rem; margin-bottom: 1.5rem; }
.edit-campo-section h6 { font-weight: 600; margin-bottom: 0.75rem; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.user-info { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar, .user-avatar-sm, .user-avatar-xs {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.875rem;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar.has-photo,
.user-avatar-sm.has-photo,
.user-avatar-xs.has-photo {
    background: var(--bg-card);
    border: 2px solid rgba(99, 102, 241, 0.35);
    padding: 0;
}
.user-avatar.has-photo img,
.user-avatar-sm.has-photo img,
.user-avatar-xs.has-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.user-avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.user-avatar-xs { width: 28px; height: 28px; font-size: 0.7rem; }
.profile-avatar-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.profile-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-avatar-wrap .profile-avatar,
.profile-avatar-wrap .user-avatar.profile-avatar {
    width: 120px;
    height: 120px;
    font-size: 2.5rem;
    margin: 0;
}
.profile-details dt { color: var(--text-muted); font-weight: 500; }
.login-tagline {
    color: var(--text-secondary);
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 0.875rem; color: var(--text-primary); font-weight: 500; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

/* Sidebar en oscuro: tipografía/claros sobre panel oscuro */
[data-theme="dark"] .sidebar {
    color: #cbd5e1;
}
[data-theme="dark"] .sidebar-header,
[data-theme="dark"] .sidebar-footer {
    border-color: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .brand-title-main,
[data-theme="dark"] .logo,
[data-theme="dark"] .user-name {
    color: #fff;
}
[data-theme="dark"] .nav-link {
    color: #94a3b8;
}
[data-theme="dark"] .nav-link:hover {
    color: #fff;
}
[data-theme="dark"] .nav-campo-header-btn,
[data-theme="dark"] .nav-campo-embed-link {
    color: #cbd5e1;
}
[data-theme="dark"] .nav-campo-header-btn:hover,
[data-theme="dark"] .nav-campo-embed-link:hover,
[data-theme="dark"] .nav-campo-header-btn.is-active,
[data-theme="dark"] .nav-campo-accordion.is-open > .nav-campo-header-btn,
[data-theme="dark"] .nav-campo-accordion.is-selected > .nav-campo-embed-link {
    color: #fff;
}
[data-theme="dark"] .nav-campo-accordion.is-selected {
    border-color: rgba(255, 255, 255, 0.45);
}
[data-theme="dark"] .nav-campo-icon-wrap {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
[data-theme="dark"] .nav-campo-accordion.is-open .nav-campo-icon-wrap,
[data-theme="dark"] .nav-campo-header-btn.is-active .nav-campo-icon-wrap,
[data-theme="dark"] .nav-campo-accordion.is-selected > .nav-campo-embed-link .nav-campo-icon-wrap {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
[data-theme="dark"] .nav-campo-count,
[data-theme="dark"] .nav-campo-item-count {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}
[data-theme="dark"] .nav-link-campo-item.active {
    color: #fff !important;
    box-shadow: inset 2px 0 0 #fff;
}
[data-theme="dark"] .nav-link-view-all,
[data-theme="dark"] .nav-link-add-item {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .nav-link-campo-dot {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.topbar-refresh { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.topbar-refresh.is-loading i { display: inline-block; animation: topbar-refresh-spin 0.7s linear infinite; }
@keyframes topbar-refresh-spin { to { transform: rotate(360deg); } }

.btn-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    position: relative;
}
.btn-icon:hover { background: var(--primary-light); color: var(--primary); }

.btn-user {
    display: flex; align-items: center; gap: 0.5rem;
    border: none; background: transparent;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}
.btn-user:hover { background: var(--primary-light); }

.notif-badge {
    position: absolute; top: 4px; right: 4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.notif-dropdown { width: 360px; max-height: 400px; overflow-y: auto; }

.page-content { padding: 1.5rem 2rem; flex: 1; min-width: 0; max-width: 100%; }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

/* ========== PAGE HEADER ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title { font-size: 1.75rem; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--text-secondary); margin: 0.25rem 0 0; font-size: 0.9rem; }
.page-asana-token-owner {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.page-asana-token-owner strong { color: var(--text-primary); font-weight: 600; }

/* Progreso NDJSON (Sheets / Calendar / migraciones) */
.ic-sync-progress {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-card, #fff);
    padding: 0.85rem 1rem;
}
.ic-sync-progress__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.ic-sync-progress__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}
.ic-sync-progress__bar { height: 0.55rem; }
.ic-sync-progress__stats {
    margin-top: 0.4rem;
    color: var(--text-secondary);
}
.ic-sync-progress__log {
    margin-top: 0.55rem;
    max-height: 140px;
    overflow: auto;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 0.4rem;
}
.ic-sync-progress__log-line { padding: 0.1rem 0; }
.ic-sync-progress__log-line.is-imported { color: #198754; }
.ic-sync-progress__log-line.is-unchanged { color: #6c757d; }
.ic-sync-progress__log-line.is-error { color: #dc3545; }
.ic-sync-progress__log-line.is-phase { color: var(--primary, #6366f1); font-weight: 600; }

.snapshot-filters-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.35;
}
.snapshot-filters-banner i { color: #3b82f6; }
.snapshot-filters-banner__label {
    font-weight: 600;
    color: var(--text-primary);
}
.snapshot-filters-banner__value {
    color: var(--text-primary);
    word-break: break-word;
}
.snapshot-filters-banner--muted {
    border-color: var(--border-color);
    background: var(--bg-card, #fff);
}
.snapshot-filters-banner--muted i { color: var(--text-secondary); }
.page-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.qc-toolbar { min-width: 0; }
.qc-modal-dialog { max-width: min(1140px, 96vw); }
.qc-saved-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.qc-saved-bar { min-width: 0; }
.qc-fields-row .form-label { font-size: 0.8rem; }
.qc-actions-row .qc-save-box--inline {
    min-width: 220px;
    max-width: 420px;
    padding: 0;
    border: 0;
    background: transparent;
}
.qc-headline {
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.qc-save-box {
    background: var(--bg-body, transparent);
}
.qc-full-page { max-width: 1400px; }
.qc-full-chart {
    min-height: min(70vh, 640px);
    height: 70vh;
    position: relative;
}
.qc-full-chart canvas { max-height: 100%; }

/* ========== KPI CARDS ========== */
.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease forwards;
}

.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.kpi-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}

.kpi-primary .kpi-icon { background: rgba(99,102,241,0.12); color: var(--primary); }
.kpi-success .kpi-icon { background: rgba(34,197,94,0.12); color: var(--success); }
.kpi-warning .kpi-icon { background: rgba(245,158,11,0.12); color: var(--warning); }
.kpi-danger .kpi-icon { background: rgba(239,68,68,0.12); color: var(--danger); }
.kpi-info .kpi-icon { background: rgba(6,182,212,0.12); color: var(--info); }
.kpi-secondary .kpi-icon { background: rgba(100,116,139,0.12); color: var(--text-secondary); }
.kpi-purple .kpi-icon { background: rgba(139,92,246,0.12); color: var(--purple); }
.kpi-teal .kpi-icon { background: rgba(20,184,166,0.12); color: var(--teal); }

.kpi-value { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.kpi-label { display: block; font-size: 0.8rem; color: var(--text-secondary); }

.dashboard-kpi-row {
    display: grid;
    gap: 1rem;
    width: 100%;
}
.dashboard-kpi-row[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-kpi-row[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-kpi-row[data-cols="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dashboard-kpi-item { min-width: 0; }
.dashboard-kpi-row .kpi-card { width: 100%; height: 100%; }

@media (max-width: 1199.98px) {
    .dashboard-kpi-row[data-cols="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .dashboard-kpi-row[data-cols="3"],
    .dashboard-kpi-row[data-cols="4"],
    .dashboard-kpi-row[data-cols="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .dashboard-kpi-row { grid-template-columns: 1fr !important; }
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}

.card-header h5 { margin: 0; font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }

.chart-card .card-body { padding: 1.25rem; }
.chart-preview-plot,
.saved-chart-plot {
    position: relative;
    height: 300px;
    max-height: 300px;
    overflow: hidden;
    border-radius: 12px;
}
.saved-chart-plot {
    height: 220px;
    max-height: 220px;
}
.chart-preview-plot canvas,
.saved-chart-plot canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Looker / Data Studio ? tablas verticales con filtro cruzado */
.chart-preview-plot.ds-tables-host,
.saved-chart-plot.ds-tables-host,
.dashboard-chart-plot.ds-tables-host,
[data-chart-style] .dashboard-chart-plot.ds-tables-host,
[data-theme="dark"] [data-chart-style] .dashboard-chart-plot.ds-tables-host {
    height: auto;
    max-height: none;
    min-height: 360px;
    overflow: auto;
    background: #000 !important;
    border-radius: 8px;
    padding: 10px 12px 12px;
    color: #e8eaed;
}
.saved-chart-plot.ds-tables-host {
    min-height: 320px;
    max-height: none !important;
    height: auto !important;
    overflow: auto;
}
.dashboard-chart-cell--data-estudio,
.dashboard-chart-cell[data-chart-tipo="tablas_verticales"] {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}
.dashboard-chart-cell--data-estudio .dashboard-chart-card,
.dashboard-chart-cell[data-chart-tipo="tablas_verticales"] .dashboard-chart-card {
    height: auto !important;
    min-height: 100%;
}
.dashboard-chart-cell--data-estudio .dashboard-chart-body,
.dashboard-chart-cell[data-chart-tipo="tablas_verticales"] .dashboard-chart-body {
    overflow: visible !important;
    flex: 1 1 auto;
    min-height: 280px;
}
.dashboard-chart-cell--data-estudio .dashboard-chart-plot,
.dashboard-chart-cell[data-chart-tipo="tablas_verticales"] .dashboard-chart-plot,
.dashboard-chart-plot.ds-tables-host {
    height: auto !important;
    max-height: none !important;
    min-height: 320px;
    overflow: auto !important;
    flex: 1 1 auto;
}
.ds-columns-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
    max-height: 180px;
    overflow: auto;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.ds-col-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.ds-col-check .form-check-label,
.ds-col-check span {
    color: var(--text-primary);
}
[data-theme="dark"] .ds-columns-checklist {
    background: var(--bg-elevated, #1e293b);
    border-color: var(--border-color, #334155);
}
.ds-tables-board {
    color: #e8eaed;
    font-family: "Google Sans", "Roboto", "Segoe UI", sans-serif;
    font-size: 12px;
}
.ds-tables-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.ds-tables-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.ds-tables-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ds-tables-meta {
    color: #bdc1c6;
    font-size: 11px;
}
.ds-reset-btn {
    border: 1px solid #8ab4f8;
    background: #1a73e8;
    color: #fff;
    border-radius: 4px;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.3;
}
.ds-reset-btn:hover {
    background: #1765cc;
    border-color: #aecbfa;
    color: #fff;
}
.ds-tables-empty {
    color: #bdc1c6;
    padding: 24px;
    text-align: center;
}
.ds-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: stretch;
}
.ds-linked-charts {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.12);
}
.ds-linked-charts__head {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9aa0a6;
    margin-bottom: 0.65rem;
}
.ds-linked-charts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.ds-linked-card {
    background: #111;
    border: 1px solid #3c4043;
    border-radius: 8px;
    padding: 0.55rem 0.65rem 0.75rem;
}
.ds-linked-card__title {
    font-size: 0.8rem;
    color: #e8eaed;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-linked-card__plot {
    position: relative;
    height: 220px;
}
.ds-linked-form-list {
    display: grid;
    gap: 0.45rem;
}
.ds-linked-form-item {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 0.4rem;
    align-items: center;
}
@media (max-width: 576px) {
    .ds-linked-form-item {
        grid-template-columns: 1fr;
    }
}
.ds-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #000;
}
.ds-panel-label {
    color: #fff !important;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    padding-left: 2px;
}
.ds-panel-scroll {
    flex: 1;
    min-height: 140px;
    max-height: 320px;
    overflow: auto;
    border: 1px solid #3c4043;
    background: #000;
}
.ds-panel-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: #e8eaed;
}
.ds-panel-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #4285f4 !important;
    color: #fff !important;
    font-weight: 600;
    text-align: left;
    padding: 6px 8px;
    white-space: nowrap;
}
.ds-panel-table tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid #202124;
    color: #fff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-panel-table tbody tr.ds-row {
    cursor: pointer;
}
.ds-panel-table tbody tr.ds-row:nth-child(odd) td {
    background: #000;
}
.ds-panel-table tbody tr.ds-row:nth-child(even) td {
    background: #202124;
}
.ds-panel-table tbody tr.ds-row:hover td {
    background: #303134;
}
.ds-panel-table tbody tr.ds-selected td {
    background: #fff !important;
    color: #202124 !important;
}
.ds-panel-table tbody tr.ds-empty-row td {
    color: #9aa0a6 !important;
    font-style: italic;
    cursor: default;
}
.ds-cell-text {
    display: inline-block;
    max-width: calc(100% - 2.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.ds-cell-count {
    float: right;
    color: #9aa0a6;
    font-size: 10px;
    margin-left: 6px;
}
.ds-panel-table tbody tr.ds-selected .ds-cell-count {
    color: #5f6368;
}
.ds-panel-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 2px;
    color: #bdc1c6;
    font-size: 11px;
    border: 1px solid #3c4043;
    border-top: 0;
    background: #000;
}
.ds-page-btn {
    border: none;
    background: transparent;
    color: #e8eaed;
    font-size: 16px;
    line-height: 1;
    padding: 0 6px;
    cursor: pointer;
}
.ds-page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.ds-page-btn:not(:disabled):hover {
    color: #8ab4f8;
}
.saved-chart-card {
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.18);
}
.saved-chart-card .card-body {
    padding: 0.5rem !important;
    overflow: hidden;
}
.saved-charts-scope .saved-charts-team-user.active {
    background: var(--primary, #6366f1);
    border-color: var(--primary, #6366f1);
    color: #fff;
}
.saved-chart-owner-badge {
    background: color-mix(in srgb, var(--info, #06b6d4) 18%, transparent);
    color: var(--text-primary);
    border: 1px solid color-mix(in srgb, var(--info, #06b6d4) 35%, transparent);
    font-weight: 500;
}
.chart-picker-item.is-dashboard-blocked {
    opacity: 0.92;
    background: color-mix(in srgb, var(--warning, #f59e0b) 6%, var(--bg-card));
    border-radius: var(--radius-sm, 8px);
}
.chart-picker-item.is-dashboard-blocked .form-check-label {
    color: var(--text-secondary);
}
.chart-fields-checks .chart-field-check {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    height: 100%;
}
.chart-fields-checks .chart-field-check:hover {
    border-color: color-mix(in srgb, var(--success) 45%, var(--border-color));
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.08);
    transform: translateY(-1px);
}
.chart-fields-checks .chart-field-check:has(.form-check-input:checked) {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 10%, var(--bg-body));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 25%, transparent);
}
.chart-fields-checks .chart-field-check .form-check-label {
    color: var(--text-primary) !important;
    word-break: break-word;
    line-height: 1.4;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}
.chart-fields-checks .form-check-input {
    border-color: var(--border-color);
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.2em;
    cursor: pointer;
}
.chart-fields-checks .form-check-input:checked {
    background-color: var(--success);
    border-color: var(--success);
}
.chart-fields-checks .form-check-input:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--success) 25%, transparent);
}
.chart-field-col {
    animation: chartFieldFadeIn 0.35s ease both;
}
@keyframes chartFieldFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bot?n editar campos en gr?ficas del dashboard */
.btn-chart-edit-fields {
    --cf-green: #22c55e;
    --cf-green-hover: #16a34a;
    color: var(--cf-green);
    background: color-mix(in srgb, var(--cf-green) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--cf-green) 40%, transparent);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-chart-edit-fields:hover,
.btn-chart-edit-fields:focus {
    color: #fff;
    background: var(--cf-green);
    border-color: var(--cf-green);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    transform: translateY(-1px);
}
.btn-chart-edit-fields:active {
    transform: translateY(0);
}

/* Modal campos de gr?fica */
.chart-fields-modal .modal-dialog {
    animation: chartFieldsModalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes chartFieldsModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.chart-fields-modal__panel {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    background: var(--bg-card);
}
.chart-fields-modal__header {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 55%, #4ade80 100%);
    border: none;
    padding: 1.1rem 1.25rem;
    color: #fff;
}
.chart-fields-modal__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.chart-fields-modal__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.chart-fields-modal__subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-top: 0.15rem;
}
.chart-fields-modal__body {
    padding: 1.25rem 1.35rem;
}
.chart-fields-modal__chart-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}
.chart-fields-modal__hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.chart-fields-modal__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.chart-fields-modal__empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem 0;
}
.chart-fields-modal__footer {
    border-top: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--bg-body);
}
.chart-fields-modal__footer-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}
.chart-fields-btn-ghost {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chart-fields-btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--text-muted);
}
.chart-fields-btn-apply {
    color: #fff;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 1.1rem;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.chart-fields-btn-apply:hover {
    color: #fff;
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.45);
    transform: translateY(-1px);
}
.chart-fields-btn-apply:active {
    transform: translateY(0);
}
[data-theme="dark"] .chart-fields-modal__panel {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .chart-fields-checks .chart-field-check {
    background: #0f172a;
}
[data-theme="dark"] .chart-fields-checks .chart-field-check:has(.form-check-input:checked) {
    background: color-mix(in srgb, var(--success) 14%, #0f172a);
}

/* ========== TABLE CARDS (cat?logo Sheets / Asana / etc.) ========== */
.tables-catalog {
    --tc-gap: 0.65rem;
}
.tables-catalog.row {
    --bs-gutter-x: var(--tc-gap);
    --bs-gutter-y: var(--tc-gap);
}
.table-card-col {
    display: flex;
    overflow: visible;
}
.table-card {
    background: var(--bg-card);
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--border-color);
    overflow: visible;
    transition: var(--transition);
    animation: fadeInUp 0.35s ease forwards;
    width: 100%;
    min-height: 86px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0.5rem 0.6rem 0.45rem;
    gap: 0.2rem;
    cursor: pointer;
}

.table-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: color-mix(in srgb, var(--card-color) 35%, var(--border-color));
}

.table-card-hit {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.table-card-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    position: relative;
}

.tip-zone {
    position: relative;
    z-index: 3;
    min-width: 0;
    overflow: visible;
}
.tip-zone--title {
    flex: 1;
}

.table-card-main {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
    text-decoration: none;
    color: inherit;
}
.table-card-main:hover .table-card-title {
    color: var(--card-color, var(--primary));
}

.table-card-actions {
    flex-shrink: 0;
    position: relative;
    z-index: 4;
    pointer-events: auto;
}
.table-card-actions .btn-link {
    padding: 0.15rem 0.3rem;
    line-height: 1;
    color: var(--text-muted);
}
.table-card-actions .btn-link:hover {
    color: var(--text-primary);
}

.table-card-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--card-color) 14%, transparent);
    color: var(--card-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.table-card-title {
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.25;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.table-card-desc {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-decoration: none;
}
a.table-card-desc:hover {
    color: var(--text-primary);
}
.table-card-desc.is-empty {
    color: var(--text-muted);
    font-style: italic;
    position: relative;
    z-index: 0;
    pointer-events: none;
}

/* Burbuja: t?tulo ? nombre; descripci?n ? descripci?n */
.tip-zone[data-tip]:hover::after,
.tip-zone[data-tip]:focus-within::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    z-index: 80;
    min-width: 140px;
    max-width: min(340px, 72vw);
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 450;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.28);
    pointer-events: none;
    text-align: left;
}
.tip-zone[data-tip]:hover::before,
.tip-zone[data-tip]:focus-within::before {
    content: '';
    position: absolute;
    left: 14px;
    bottom: calc(100% + 4px);
    z-index: 81;
    border: 6px solid transparent;
    border-top-color: #0f172a;
    pointer-events: none;
}

.table-card-stats {
    position: relative;
    z-index: 0;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.table-card-creator {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----- Vista lista ----- */
.tables-catalog.is-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow: visible;
}
.tables-catalog.is-list > .table-card-col {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    padding-left: 0;
    padding-right: 0;
}
.tables-catalog.is-list .table-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0.4rem 0.7rem;
    gap: 0.75rem;
}
.tables-catalog.is-list .table-card-top {
    flex: 0 1 260px;
    max-width: 320px;
}
.tables-catalog.is-list .tip-zone--desc {
    flex: 1 1 200px;
    min-width: 120px;
}
.tables-catalog.is-list .table-card-stats {
    flex: 0 0 auto;
    margin-top: 0;
    margin-left: auto;
}
.tables-catalog.is-list .tip-zone[data-tip]:hover::after,
.tables-catalog.is-list .tip-zone[data-tip]:focus-within::after {
    left: auto;
    right: 0;
}

.tables-view-toggle .btn {
    padding: 0.3rem 0.55rem;
}
.tables-view-toggle .btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

@media (max-width: 575.98px) {
    .tables-catalog.is-list .table-card {
        flex-wrap: wrap;
    }
    .tables-catalog.is-list .table-card-top {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .tables-catalog.is-list .table-card-stats {
        margin-left: 0;
    }
}

[data-theme="light"] .tip-zone[data-tip]:hover::after,
[data-theme="light"] .tip-zone[data-tip]:focus-within::after {
    background: #1e293b;
    color: #f8fafc;
}

/* ========== DATA TABLE ========== */
.data-table-card .card-body { padding: 0; }
.data-table-card .table { margin: 0; }
.data-table-card .table thead th {
    background: var(--bg-body);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    padding: 0.875rem 1rem;
    white-space: nowrap;
}
.data-table-card .table tbody td { padding: 0.75rem 1rem; vertical-align: middle; font-size: 0.875rem; }
.data-table-card .table tbody tr { transition: var(--transition); }
.data-table-card .table tbody tr:hover { background: var(--primary-light); }

/* Vista tabla Sheets ? scroll de p?gina, controles fuera del card */
.page-content:has(.table-view-fill) {
    display: block;
    padding-bottom: 2rem;
}
.page-content:has(.table-view-fill) .page-header--table-view {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.page-content:has(.table-view-fill) .page-header--table-view .page-header-block {
    width: 100%;
    min-width: 0;
}
.page-content:has(.table-view-fill) .page-header--table-view .page-actions--below {
    width: 100%;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    align-self: stretch;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-color);
}
#viewTable.view-panel.table-view-fill {
    display: block;
    width: 100%;
    max-width: 100%;
}
.table-zoom-shell.table-view-fill {
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
}
.table-toolbar { padding: 0 0.15rem; max-width: 100%; margin-bottom: 0.5rem; }
.table-zoom-bar { flex-shrink: 0; }
.table-zoom-label { min-width: 3.5rem; pointer-events: none; opacity: 1 !important; font-weight: 600; }
.table-dt-top,
.table-dt-bottom {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding: 0 0.15rem;
}
.table-dt-top {
    margin-bottom: 0.65rem;
}
.table-dt-bottom {
    margin-top: 0.65rem;
    padding-bottom: 0.25rem;
}
.table-dt-top .dt-table-top,
.table-dt-bottom .dt-table-bottom {
    margin: 0;
}
.table-dt-top .dataTables_filter label,
.table-dt-bottom .dataTables_info {
    margin-bottom: 0;
}
.table-zoom-size-host {
    display: block;
    width: 100%;
    max-width: 100%;
}
.table-zoom-scroll-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
}
.table-zoom-scroll-wrap.has-user-height {
    flex: none;
}
.table-height-resize {
    flex-shrink: 0;
    height: 12px;
    margin-top: 2px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--bg-body);
    cursor: row-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: background 0.15s ease;
}
.table-height-resize:hover,
.table-height-resize.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
}
.table-height-resize-grip {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1;
    pointer-events: none;
}
body.table-height-resizing {
    cursor: row-resize !important;
    user-select: none !important;
}
.table-zoom-viewport {
    overflow: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 1500px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    position: relative;
}
.table-zoom-scroll-bottom {
    display: none !important;
}
.table-zoom-scaler {
    display: block;
    width: max-content;
    min-width: 100%;
    transform-origin: top left;
    transition: zoom 0.12s ease, transform 0.12s ease;
    overflow: visible;
}
.table-zoom-scaler #recordsTable {
    width: max-content;
    min-width: 100%;
}
.table-zoom-viewport .dataTables_wrapper,
.table-zoom-viewport .dataTables_scroll,
.table-zoom-viewport .dataTables_scrollBody,
.table-zoom-viewport .dataTables_scrollHead {
    overflow: visible !important;
    max-height: none !important;
}
.table-zoom-scaler .data-table-card {
    margin-bottom: 0;
    border: none;
    box-shadow: none;
}
.table-zoom-scaler .data-table-card .card-body {
    padding-bottom: 0.5rem;
}
/* Tabla un poco m?s legible */
.table-zoom-viewport .data-table-card .table {
    font-size: 0.9rem;
}
.table-zoom-viewport .data-table-card .table thead th {
    padding: 0.65rem 0.85rem;
    font-size: 0.78rem;
}
.table-zoom-viewport .data-table-card .table tbody td {
    padding: 0.55rem 0.85rem;
}
.table-zoom-viewport .dataTables_wrapper .dataTables_length,
.table-zoom-viewport .dataTables_wrapper .dataTables_filter,
.table-zoom-viewport .dataTables_wrapper .dataTables_info,
.table-zoom-viewport .dataTables_wrapper .dataTables_paginate,
.table-dt-top .dataTables_length,
.table-dt-top .dataTables_filter,
.table-dt-bottom .dataTables_info,
.table-dt-bottom .dataTables_paginate {
    padding-left: 0.15rem;
    padding-right: 0.15rem;
}
.table-dt-top .dataTables_filter {
    text-align: left;
    float: none;
}
.table-dt-top .dataTables_filter label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    margin-bottom: 0;
    width: 100%;
}
.table-dt-top .dataTables_filter input {
    margin-left: 0 !important;
    max-width: 320px;
}

.table-col-filters-host {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding: 0 0.15rem;
    margin-bottom: 0.5rem;
}
.table-col-filters-bar {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
}
.table-col-filters-bar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}
.table-col-filters-bar__actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.table-col-filters-picker-wrap { position: relative; }
.table-col-filters-picker {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 40;
    width: min(18rem, 80vw);
    max-height: 22rem;
    overflow: auto;
    padding: 0.75rem;
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.table-col-filters-picker.d-none { display: none !important; }
.table-col-filters-picker__head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.45rem;
}
.table-col-filters-picker__actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}
.table-col-filters-picker__list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 12rem;
    overflow: auto;
    margin-bottom: 0.55rem;
}
.table-col-filters-picker__item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.25rem 0.2rem;
    font-size: 0.8125rem;
    cursor: pointer;
}
.table-col-filters-picker__item:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.table-col-filters-picker__item input { margin: 0; flex-shrink: 0; }
.table-col-filters-picker__foot {
    display: flex;
    justify-content: flex-end;
}
.table-col-filters-bar__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.table-col-filters-bar__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: flex-end;
}
.table-col-filter {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 9rem;
    max-width: 14rem;
    flex: 1 1 9rem;
}
.table-col-filter--date {
    min-width: 15rem;
    max-width: 20rem;
    flex: 1 1 15rem;
}
.table-col-filter--text {
    min-width: 11rem;
    max-width: 16rem;
    flex: 1 1 11rem;
}
.table-col-filter__label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
    margin: 0;
}
.table-col-filter__date-range {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.table-col-filter__date-range input {
    min-width: 0;
    flex: 1 1 6.5rem;
}
.table-col-filter__sep {
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.table-col-filter .form-select,
.table-col-filter .form-control {
    font-size: 0.8125rem;
    background: var(--bg-body);
    color: var(--text-primary);
    border-color: var(--border-color);
}
[data-theme="dark"] .table-col-filters-bar #btnClearTableColumnFilters {
    color: var(--primary);
}
[data-theme="dark"] .table-col-filter .form-select,
[data-theme="dark"] .table-col-filter .form-control {
    background: #0f172a;
    color: var(--text-primary);
    border-color: var(--border-color);
}
.table-dt-bottom .dt-table-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.table-dt-bottom .dataTables_info {
    flex: 1 1 auto;
    padding-top: 0;
}
.table-dt-bottom .dataTables_paginate {
    flex: 0 0 auto;
    margin-left: auto;
}
.table-height-resize {
    display: none !important;
}

/* Columnas fijas a la izquierda (acciones + #) */
#recordsTable {
    border-collapse: separate;
    border-spacing: 0;
}
#recordsTable .sticky-col {
    position: sticky;
    z-index: 5;
    background: var(--bg-card);
    background-clip: padding-box;
    box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
}
#recordsTable thead th {
    position: sticky;
    top: 0;
    z-index: 7;
    background: var(--bg-card);
}
#recordsTable thead .sticky-col {
    z-index: 10;
    background: var(--bg-body);
}
#recordsTable tbody td.user-sticky-col,
#recordsTable tfoot td.user-sticky-col {
    position: sticky;
    z-index: 6;
    background: var(--bg-card);
    background-clip: padding-box;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.12);
}
#recordsTable thead th.user-sticky-col {
    z-index: 12;
    background: var(--bg-body);
}
.sticky-column-picker .dropdown-menu {
    max-height: min(60vh, 24rem);
    min-width: 17rem;
    overflow-y: auto;
}
#recordsTable tbody td:not(.sticky-col):not(.user-sticky-col),
#recordsTable tfoot td:not(.sticky-col):not(.user-sticky-col) {
    position: relative;
    z-index: 1;
}
#recordsTable .col-actions {
    left: 0;
    min-width: 56px;
    width: 56px;
    max-width: 56px;
    padding-left: 4px;
    padding-right: 4px;
}
#recordsTable.has-actions-col .col-row-num {
    left: 56px;
}
.is-capacitaciones-table #recordsTable.has-actions-col .col-actions {
    min-width: 7.5rem;
    width: 7.5rem;
    max-width: 8.75rem;
}
.is-capacitaciones-table #recordsTable.has-actions-col .col-row-num {
    left: 7.5rem;
}
.is-capacitaciones-table #recordsTable .col-cap-cobrar {
    position: sticky;
    background: var(--bg-card);
    background-clip: padding-box;
    text-align: center;
    min-width: 4.5rem;
    width: 4.5rem;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.12);
}
.is-capacitaciones-table #recordsTable thead .col-cap-cobrar {
    z-index: 8;
    background: var(--bg-body);
}
.is-capacitaciones-table #recordsTable.has-actions-col .col-cap-cobrar {
    left: calc(7.5rem + 40px);
    z-index: 6;
}
.is-capacitaciones-table #recordsTable:not(.has-actions-col) .col-cap-cobrar {
    left: 40px;
    z-index: 6;
}
.cap-row-check-hit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.15rem;
    cursor: pointer;
}
.cap-row-check-hit--head {
    margin-left: 0.25rem;
    vertical-align: middle;
}
.cap-row-check {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
    accent-color: #dc2626;
}
#recordsTable:not(.has-actions-col) .col-row-num {
    left: 0;
}
#recordsTable .col-row-num {
    min-width: 40px;
    width: 40px;
    max-width: 44px;
    padding-left: 6px;
    padding-right: 10px;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}
#recordsTable th.col-porcentaje,
#recordsTable td.col-porcentaje {
    min-width: 52px;
    width: 52px;
    max-width: 64px;
    padding-left: 12px;
    padding-right: 12px;
    text-align: center;
    vertical-align: middle;
}
#recordsTable td.col-porcentaje .excel-progress-check {
    display: inline-flex;
    margin: 0 auto;
}
.excel-progress-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
    user-select: none;
    min-height: 1.75rem;
    padding: 0.15rem;
}
.excel-progress-check input.excel-cell--progress-check {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}
#recordsTable tbody tr:hover .sticky-col {
    background: var(--primary-light);
}

/* Columnas redimensionables */
#recordsTable thead th.resizable-col,
#recordsTable thead th[data-col] {
    position: sticky;
    top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
#recordsTable thead th.sticky-col {
    position: sticky;
}
.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 2;
}
.col-resize-handle:hover,
.col-resize-handle.active {
    background: rgba(99, 102, 241, 0.35);
}
body.col-resizing { cursor: col-resize !important; user-select: none !important; }

/* Modo Excel */
/* Modo Excel / edici?n inline */
.inline-edit-hint,
.excel-mode-hint {
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border-bottom: 1px solid rgba(34, 197, 94, 0.25);
    font-size: 0.8rem;
}
.table-section-row td {
    background: var(--section-bg, #111827) !important;
    border-color: color-mix(in srgb, var(--section-bg, #111827) 85%, #000) !important;
}
.table-section-row .section-actions-cell {
    background: var(--section-bg, #111827) !important;
    vertical-align: middle;
    text-align: center;
}
.table-section-row .section-label-cell {
    text-align: center;
    padding: 0.55rem 1rem !important;
}
.table-section-row .section-label {
    color: var(--section-fg, #fff);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.table-section-row:hover td {
    background: var(--section-bg, #111827) !important;
}
.table-section-row.section-dragging td {
    opacity: 0.65;
}
.table-section-row.section-drop-before td {
    box-shadow: inset 0 3px 0 #22c55e;
}
.table-section-row.section-drop-after td {
    box-shadow: inset 0 -3px 0 #22c55e;
}
#recordsTable tbody tr:not(.table-section-row).section-drop-before td {
    box-shadow: inset 0 3px 0 #22c55e;
}
#recordsTable tbody tr:not(.table-section-row).section-drop-after td {
    box-shadow: inset 0 -3px 0 #22c55e;
}
.section-drag-handle {
    cursor: grab;
    color: color-mix(in srgb, var(--section-fg, #fff) 75%, transparent);
}
.section-drag-handle:active {
    cursor: grabbing;
}

/* Reordenar columnas en Configurar tabla (tambi?n al crear) */
#columnsList .drag-handle {
    cursor: grab;
    color: var(--text-muted, #94a3b8);
    font-size: 1.1rem;
    padding: 0.35rem 0.25rem;
    display: inline-block;
    user-select: none;
}
#columnsList .drag-handle:active,
#columnsList .col-dragging .drag-handle {
    cursor: grabbing;
}
#columnsList tr.col-dragging {
    opacity: 0.55;
    background: rgba(99, 102, 241, 0.08);
}
#columnsList tr.col-drop-before td {
    box-shadow: inset 0 2px 0 0 var(--primary, #6366f1);
}
#columnsList tr.col-drop-after td {
    box-shadow: inset 0 -2px 0 0 var(--primary, #6366f1);
}
#columnsList .col-drag-cell {
    width: 40px;
    vertical-align: middle;
    text-align: center;
}
.sheets-sync-bar .sheets-url-preview {
    display: inline-block;
    vertical-align: middle;
}
.ic-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
    border-radius: var(--radius-sm, 0.375rem);
    background: var(--surface-2, rgba(15, 23, 42, 0.35));
    color: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.ic-collapse-toggle:hover {
    border-color: var(--primary, #6366f1);
}
.ic-collapse-toggle__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.ic-collapse-toggle__chevron {
    transition: transform 0.18s ease;
    opacity: 0.8;
}
.ic-collapse-toggle.is-collapsed .ic-collapse-toggle__chevron {
    transform: rotate(-90deg);
}
.ic-collapse-body {
    margin-bottom: 0.75rem;
}
.dash-edit-campo > .dash-edit-campo-toggle.ic-collapse-toggle {
    margin-bottom: 0;
    border-radius: var(--bs-card-inner-border-radius, 0.375rem) var(--bs-card-inner-border-radius, 0.375rem) 0 0;
    border: none;
    border-bottom: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
    background: var(--bs-card-cap-bg, rgba(15, 23, 42, 0.35));
    padding: 0.75rem 1rem;
}
.dash-edit-campo > .dash-edit-campo-toggle.ic-collapse-toggle.is-collapsed {
    border-radius: var(--bs-card-inner-border-radius, 0.375rem);
    border-bottom: none;
}
.dash-edit-campo-title {
    font-size: 1.05rem;
    font-weight: 600;
}
.dash-edit-campo > .card-body.ic-collapse-body {
    margin-bottom: 0;
}
.dash-edit-campo > .card-body.ic-collapse-body.d-none {
    display: none !important;
}
.table-picker-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.table-picker-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: var(--radius-sm, 0.375rem);
    background: var(--surface-2, rgba(15, 23, 42, 0.25));
}
.table-picker-item.is-dragging {
    opacity: 0.55;
}
.table-picker-item.is-drag-over {
    border-color: var(--primary, #6366f1);
}
.table-picker-item .form-check {
    min-width: 0;
}
.table-picker-item .form-check-label {
    word-break: break-word;
}
.sheets-sync-bar .ic-collapse-toggle {
    width: auto;
    min-width: 11rem;
}
.section-preview-wrap { margin-top: 0.5rem; }
.section-preview-bar {
    margin-top: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#recordsTable tbody tr.row-selected {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}
.excel-cell-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
}
.excel-cell-wrap .excel-cell-main {
    flex: 1;
    min-width: 0;
    width: 100%;
}
.excel-cell-wrap textarea.excel-cell {
    width: 100%;
}
.excel-cell-wrap .excel-attach-link {
    flex-shrink: 0;
    padding: 0.1rem 0.35rem;
    line-height: 1;
}
.excel-cell-wrap .excel-attach-link.has-link {
    color: var(--primary);
    border-color: var(--primary);
}
.excel-link-mini {
    flex-shrink: 0;
}
.cell-link-inline {
    font-size: 0.85rem;
    margin-left: 0.15rem;
}

.excel-mode-hint {
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border-bottom: 1px solid rgba(34, 197, 94, 0.25);
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.excel-mode-hint kbd {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.75rem;
}
.data-table-card.excel-mode .table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}
.data-table-card.excel-mode .table tbody td {
    padding: 0.25rem 0.35rem;
    vertical-align: top;
    white-space: normal;
    height: auto;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
}
.data-table-card.excel-mode .excel-cell {
    border: 1px solid transparent;
    border-radius: 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.875rem;
}
.data-table-card.excel-mode textarea.excel-cell {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    min-height: 2rem;
    height: auto;
    overflow-x: hidden;
    overflow-y: hidden;
    resize: none;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4;
    padding: 0.35rem 0.5rem;
    box-sizing: border-box;
}
.data-table-card.excel-mode input.excel-cell:not([type="checkbox"]) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 2rem;
    box-sizing: border-box;
}
.data-table-card.excel-mode .excel-cell:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    outline: none;
    position: relative;
    z-index: 1;
}
.data-table-card.excel-mode .excel-cell.excel-saved {
    background: rgba(34, 197, 94, 0.12);
}
.data-table-card.excel-mode .excel-cell.excel-cell--computed {
    background: rgba(15, 23, 42, 0.04);
    cursor: default;
    color: var(--text-secondary);
}
.data-table-card.excel-mode .excel-cell.excel-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--danger);
}
.data-table-card.excel-mode .excel-cell.excel-saving {
    opacity: 0.6;
}
.data-table-card.excel-mode tr.excel-new-row {
    background: rgba(34, 197, 94, 0.08);
}
.data-table-card.excel-mode tr.excel-new-row td {
    padding: 0.35rem;
}
.data-table-card.excel-mode .excel-new-cell .excel-cell {
    background: var(--bg-card);
}
.excel-enlace-cell {
    min-width: 140px;
}
.excel-enlace-cell .excel-link-preview {
    margin-bottom: 0.2rem;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.excel-enlace-cell .excel-link-preview .cell-link {
    font-size: 0.8rem;
    max-width: 100%;
}
.excel-enlace-cell .excel-link-field {
    font-size: 0.75rem;
    min-width: 120px;
}
.excel-embedded-link {
    margin-top: 0.15rem;
    font-size: 0.75rem;
}
#btnExcelMode.active {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pendiente, .status-abierta { background: rgba(245,158,11,0.15); color: #d97706; }
.status-en-proceso, .status-en-revisin { background: rgba(99,102,241,0.15); color: var(--primary); }
.status-finalizada, .status-cerrada { background: rgba(34,197,94,0.15); color: var(--success); }
.status-suspendida, .status-crtica { background: rgba(239,68,68,0.15); color: var(--danger); }

.smart-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    margin: 0.1rem 0.15rem 0.1rem 0;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--chip-bg, rgba(99,102,241,0.12));
    color: var(--chip-color, var(--primary));
    border: 1px solid color-mix(in srgb, var(--chip-color, var(--primary)) 25%, transparent);
    white-space: nowrap;
}

.cell-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-link:hover { text-decoration: underline; color: var(--primary); }

.excel-chips-wrap { min-width: 140px; }
.chip-quick-picks { display: flex; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.25rem; }
.chip-quick-picks .chip-pick-btn {
    border: none;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    cursor: pointer;
    background: rgba(99,102,241,0.1);
    color: var(--primary);
}
.chip-quick-picks .chip-pick-btn:hover { background: rgba(99,102,241,0.2); }

.excel-lista-multi { position: relative; min-width: 140px; }
.excel-lista-multi-toggle {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.excel-lista-multi-panel {
    position: absolute;
    z-index: 5000;
    left: 0;
    right: auto;
    top: 100%;
    margin-top: 2px;
    max-height: 240px;
    overflow: auto;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #111827);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    padding: 0.35rem;
}
body > .excel-lista-multi-panel {
    right: auto;
    margin-top: 0;
}
.excel-lista-multi-empty { padding: 0.35rem 0.5rem; font-size: 0.8rem; }
.excel-lista-multi-opt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
}
.excel-lista-multi-opt:hover { background: var(--primary-light, rgba(99,102,241,0.08)); }
.excel-lista-multi-opt input { margin: 0; }

.option-search-scope { min-width: 0; }
.option-search-scope:not(.is-search-open) > .option-search-control,
.option-search-scope:not(.is-search-open) > .option-search-empty {
    display: none;
}
.option-search-control {
    margin-bottom: 0.4rem;
    border-radius: var(--radius-sm, 8px);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.option-search-control:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.option-search-control .input-group-text {
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-color: var(--border-color);
}
.option-search-control .option-search-input {
    min-width: 0;
    border-left: 0;
    padding-left: 0.25rem;
}
.option-search-control .option-search-clear {
    border-color: var(--border-color);
}
.option-search-control .option-search-clear:disabled {
    opacity: 0.45;
}
.option-search-empty {
    padding: 0.2rem 0.35rem 0.4rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.excel-lista-multi-panel .option-search-control {
    position: sticky;
    top: -0.35rem;
    z-index: 1;
    padding-bottom: 0.25rem;
    background: var(--bg-card, #fff);
}
.excel-lista-multi-opt[hidden],
select option[hidden] { display: none !important; }

.deleted-records-list { display: flex; flex-direction: column; gap: 0.5rem; }
.deleted-record-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
}
.deleted-record-preview { font-size: 0.875rem; }
@media (max-width: 700px) {
    .deleted-record-row { grid-template-columns: 1fr; }
}

.row-overdue { background: rgba(239,68,68,0.06) !important; }

/* ========== ACTIVITY FEED ========== */
.activity-feed { padding: 0.5rem 0; }
.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}
.activity-item:hover { background: var(--primary-light); }
.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.activity-create { background: rgba(34,197,94,0.12); color: var(--success); }
.activity-update { background: rgba(99,102,241,0.12); color: var(--primary); }
.activity-delete { background: rgba(239,68,68,0.12); color: var(--danger); }
.activity-login { background: rgba(6,182,212,0.12); color: var(--info); }
.activity-circle { background: rgba(100,116,139,0.12); color: var(--text-secondary); }

.activity-content { flex: 1; }
.activity-content span { color: var(--text-secondary); margin-left: 0.25rem; }
.activity-time { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

/* ========== PROGRESS BAR ========== */
.progress-bar-mini {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    width: 80px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ========== ROLES ========== */
.role-admin { background: rgba(99,102,241,0.15); color: var(--primary); }
.role-supervisor { background: rgba(6,182,212,0.15); color: var(--info); }
.role-operador { background: rgba(245,158,11,0.15); color: var(--warning); }
.role-lectura { background: rgba(100,116,139,0.15); color: var(--text-secondary); }

/* ========== NOTIFICATIONS ========== */
.notif-list { padding: 0; }
.notif-item {
    display: flex; gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.notif-item.unread { background: var(--primary-light); }
.notif-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
}
.notif-content p { margin: 0.25rem 0; font-size: 0.875rem; color: var(--text-secondary); }

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 960px;
    margin: 2rem;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

.login-card {
    flex: 1;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
}
.login-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}
[data-theme="light"] .login-theme-toggle {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}
[data-theme="light"] .login-theme-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    background: transparent;
    border-radius: 0;
    width: auto;
    height: auto;
    font-size: inherit;
    color: inherit;
}
.login-header h1 { font-size: 1.5rem; margin: 0; color: var(--text-primary); }
.login-header p {
    color: var(--text-secondary);
    margin: 0.75rem auto 0;
    text-align: center;
}

.btn-login {
    padding: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--primary);
    border: none;
}
.btn-login:hover { background: var(--primary-hover); }

.login-footer { text-align: center; margin-top: 2rem; }

.login-decoration {
    flex: 1;
    background: linear-gradient(135deg, #1e1e2d 0%, #2d2d44 100%);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #fff;
}

.decoration-content {
    width: 100%;
    max-width: 360px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.decoration-content h2 { font-size: 1.75rem; margin-bottom: 1rem; }
.decoration-content p {
    color: #94a3b8;
    margin-bottom: 1.25rem;
    text-align: left;
}
.decoration-content .feature-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.feature-list div {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
    text-align: left;
}
.feature-list i { color: var(--success); }

/* ========== FORM OVERRIDES ========== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.875rem;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-outline-secondary {
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.modal-content {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

.table { color: var(--text-primary); }
.dropdown-menu {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
}
.dropdown-item { color: var(--text-primary); }
.dropdown-item:hover { background: var(--primary-light); }

/* ========== TOAST ========== */
.ic-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ic-toast {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
    min-width: 280px;
}
.ic-toast-success { background: var(--success); }
.ic-toast-error { background: var(--danger); }
.ic-toast-info { background: var(--primary); }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== VIEW TABS (Tabla / Gr?ficas) ========== */
.view-tabs {
    display: inline-flex;
    gap: 0.25rem;
    background: var(--bg-body);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.view-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.view-tab:hover { color: var(--text-primary); background: var(--primary-light); }
.view-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.view-panel { animation: fadeInUp 0.3s ease; }

/* Barra de scroll horizontal flotante (fija abajo) para tablas anchas */
.floating-hscroll {
    position: fixed;
    bottom: 0;
    z-index: 1025;
    height: 20px;
    overflow-x: scroll;
    overflow-y: hidden;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, rgba(148,163,184,0.4));
    border-bottom: 3px solid var(--primary, #6366f1);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.22);
    scrollbar-width: auto;
    scrollbar-color: var(--primary, #6366f1) var(--primary-light, rgba(99,102,241,0.18));
}
.floating-hscroll.d-none { display: none !important; }
.floating-hscroll-inner { height: 1px; }
.floating-hscroll::-webkit-scrollbar { height: 16px; }
.floating-hscroll::-webkit-scrollbar-track {
    background: var(--primary-light, rgba(99,102,241,0.15));
    border-radius: 8px;
}
.floating-hscroll::-webkit-scrollbar-thumb {
    background: var(--primary, #6366f1);
    border-radius: 8px;
    border: 3px solid var(--bg-card, #fff);
    min-width: 60px;
}
.floating-hscroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover, #4f46e5);
}

/* Dashboard gr?ficas redimensionables */
.dashboard-chart-cell.d-none { display: none !important; }
.dashboard-table-section.d-none { display: none !important; }
.dash-search-hidden { display: none !important; }

.dashboard-campo-search-wrap {
    max-width: 40rem;
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}
.dashboard-campo-search {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-card);
    flex: 1 1 auto;
    min-width: 0;
}
.dashboard-campo-reader-filters {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.dashboard-campo-search__icon {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.dashboard-campo-search__input {
    border: none;
    background: transparent;
    box-shadow: none !important;
    padding-left: 0;
    padding-right: 0;
    color: var(--text-primary);
}
.dashboard-campo-search__input:focus {
    background: transparent;
}
.dashboard-campo-search__clear {
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1;
    padding: 0 0.15rem;
}
.dashboard-campo-search__clear:hover {
    color: var(--text-primary);
}
.dashboard-search-empty {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.55rem 0.85rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-card);
    margin-bottom: 1rem;
}
[data-theme="dark"] .dashboard-campo-search,
[data-theme="dark"] .dashboard-search-empty {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.dashboard-charts-root {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.dashboard-table-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.dashboard-table-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-card);
}
.dashboard-table-heading.ic-collapse-toggle {
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.85rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    text-align: left;
    cursor: pointer;
    user-select: none;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dashboard-table-heading.ic-collapse-toggle:hover {
    background: var(--bg-hover, rgba(99, 102, 241, 0.06));
    border-color: var(--border-color);
}
.dashboard-table-heading.ic-collapse-toggle:focus-visible {
    outline: 2px solid var(--primary, #6366f1);
    outline-offset: 2px;
}
.dashboard-table-heading__chevron {
    margin-left: 0.15rem;
    flex-shrink: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}
.dashboard-table-heading.ic-collapse-toggle.is-collapsed .dashboard-table-heading__chevron {
    transform: rotate(-90deg);
}
.dashboard-table-charts-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0;
}
.dashboard-table-charts-body.d-none {
    display: none !important;
}
.dashboard-table-heading__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dashboard-table-reorder-handle,
.dashboard-chart-reorder-handle {
    flex-shrink: 0;
    cursor: grab;
    line-height: 1;
    opacity: 0.55;
    color: var(--text-muted);
    user-select: none;
}
.dashboard-table-reorder-handle i,
.dashboard-chart-reorder-handle i {
    pointer-events: none;
}
.dashboard-table-reorder-handle:hover,
.dashboard-chart-reorder-handle:hover {
    opacity: 1;
    color: var(--primary, #6366f1) !important;
}
.dashboard-table-reorder-handle:active,
.dashboard-chart-reorder-handle:active {
    cursor: grabbing;
}
.dashboard-table-section.is-panel-dragging,
.dashboard-chart-cell.is-panel-dragging {
    opacity: 0.55;
}
.dashboard-table-section.is-panel-drag-over,
.dashboard-chart-cell.is-panel-drag-over {
    outline: 2px dashed var(--primary, #6366f1);
    outline-offset: 2px;
}
.dashboard-table-heading__icon {
    font-size: 1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.dashboard-table-heading__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 0 1 auto;
    min-width: 0;
}
.dashboard-table-heading__link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.dashboard-table-heading__link:hover,
.dashboard-table-heading__link:focus-visible {
    color: var(--primary, #6366f1);
    text-decoration: underline;
    outline: none;
}
.dashboard-table-heading__link-icon {
    font-size: 0.78rem;
    opacity: 0.55;
    flex-shrink: 0;
}
.dashboard-table-heading__link:hover .dashboard-table-heading__link-icon,
.dashboard-table-heading__link:focus-visible .dashboard-table-heading__link-icon {
    opacity: 1;
}
.dashboard-table-heading__mode {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    padding: 0 0.5rem;
}
.dashboard-table-heading__filters {
    margin-left: auto;
    flex: 0 0 auto;
}
.dashboard-table-heading:has(.dashboard-table-heading__mode) .dashboard-table-heading__filters {
    margin-left: 0;
}
.dashboard-table-heading__count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    flex-shrink: 0;
}

/* Switch Normal / Data Estudio por tabla */
.dashboard-table-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    user-select: none;
}
.dashboard-table-mode-switch__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
}
.dashboard-table-mode-switch:has(.dashboard-table-ds-toggle:not(:checked)) .dashboard-table-mode-switch__label:not(.dashboard-table-mode-switch__label--ds),
.dashboard-table-mode-switch:has(.dashboard-table-ds-toggle:checked) .dashboard-table-mode-switch__label--ds {
    color: var(--text-primary);
}
.dashboard-table-mode-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}
.dashboard-table-mode-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.dashboard-table-mode-toggle__track {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #64748b;
    border: 1px solid transparent;
    position: relative;
    transition: background 0.18s ease;
}
.dashboard-table-mode-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease;
}
.dashboard-table-mode-toggle input:checked + .dashboard-table-mode-toggle__track {
    background: #3b82f6;
}
.dashboard-table-mode-toggle input:checked + .dashboard-table-mode-toggle__track::after {
    transform: translateX(16px);
}
.dashboard-table-mode-toggle input:focus-visible + .dashboard-table-mode-toggle__track {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* Host + tabla dinámica Data Estudio */
.dashboard-table-ds-host {
    width: 100%;
}
.dashboard-chart-cell.is-ds-filtering {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.dash-ds-board {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    background: #111827;
    color: #e5e7eb;
    overflow: hidden;
}
[data-theme="light"] .dash-ds-board {
    background: #f8fafc;
    color: #0f172a;
}
.dash-ds-board__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}
.dash-ds-board__title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
}
.dash-ds-board__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.dash-ds-board__meta {
    font-size: 0.75rem;
    color: #94a3b8;
}
[data-theme="light"] .dash-ds-board__meta {
    color: #64748b;
}
.dash-ds-board__empty {
    padding: 1.1rem 0.9rem;
    font-size: 0.85rem;
    color: #94a3b8;
}
.dash-ds-board__panels {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: 0;
}
.dashboard-table-empty-hint {
    flex: 0 0 100%;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 0.5rem;
    background: rgba(148, 163, 184, 0.06);
}
[data-theme="light"] .dashboard-table-empty-hint {
    background: rgba(15, 23, 42, 0.03);
}
.dashboard-ds-cell {
    position: relative;
}
.dashboard-ds-cell .dashboard-ds-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dashboard-ds-cell .dashboard-chart-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.dashboard-ds-cell .dash-ds-panel__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.dashboard-ds-cell .dash-ds-panel__table {
    width: 100%;
}
.dash-ds-panel {
    --ds-panel-w: 180px;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--ds-panel-w);
    width: var(--ds-panel-w);
    max-width: 100%;
    box-sizing: border-box;
    border-right: 1px solid rgba(148, 163, 184, 0.22);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: transparent;
    min-width: 120px;
    min-height: 220px;
    max-height: 360px;
}
.dash-ds-panel.is-dragging {
    opacity: 0.55;
}
.dash-ds-panel__head {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.45rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.45);
    cursor: grab;
}
[data-theme="light"] .dash-ds-panel__head {
    background: #e2e8f0;
}
.dash-ds-panel__drag {
    color: #94a3b8;
    font-size: 0.7rem;
    letter-spacing: -0.08em;
    line-height: 1;
}
.dash-ds-panel__label {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-ds-panel__remove {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
}
.dash-ds-panel__remove:hover {
    color: #f87171;
}
.dash-ds-panel__scroll {
    flex: 1 1 auto;
    overflow: auto;
    min-height: 0;
}
.dash-ds-panel__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.dash-ds-panel__table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: middle;
}
.dash-ds-row {
    cursor: pointer;
}
.dash-ds-row:hover td {
    background: rgba(59, 130, 246, 0.12);
}
.dash-ds-row.is-selected td {
    background: rgba(59, 130, 246, 0.28);
}
.dash-ds-hit {
    cursor: pointer;
}
.dash-ds-hit:hover {
    background: rgba(59, 130, 246, 0.12);
}
.dash-ds-hit.is-selected {
    background: rgba(59, 130, 246, 0.28);
}
.dash-ds-td-empty {
    cursor: default;
}
.dash-ds-cell-text {
    display: inline-block;
    max-width: calc(100% - 2.2rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.dash-ds-cell-count {
    float: right;
    font-size: 0.7rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.dash-ds-panel__pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.25rem 0.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    font-size: 0.68rem;
    color: #94a3b8;
}
.dash-ds-page {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: transparent;
    color: inherit;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    line-height: 1;
    cursor: pointer;
}
.dash-ds-page:disabled {
    opacity: 0.35;
    cursor: default;
}
.dash-ds-panel__resize {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 2;
}
.dash-ds-panel__resize:hover,
.dash-ds-panel__resize:active {
    background: rgba(59, 130, 246, 0.35);
}

.dash-ds-panel.is-unified {
    --ds-panel-w: 360px;
    min-width: 220px;
    max-width: 100%;
}
.dash-ds-panel__badge {
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
    line-height: 1.2;
}
[data-theme="light"] .dash-ds-panel__badge {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
}
.dash-ds-panel__table--unified {
    table-layout: auto;
    min-width: 100%;
}
.dash-ds-panel__table--unified thead th,
.dash-ds-panel__table--unified td {
    min-width: 7.5rem;
}
.dash-ds-panel__table--unified thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.35rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #cbd5e1;
    background: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    border-right: 1px solid rgba(148, 163, 184, 0.16);
}
[data-theme="light"] .dash-ds-panel__table--unified thead th {
    color: #334155;
    background: #e2e8f0;
}
.dash-ds-panel__table--unified td {
    padding: 0.35rem 0.45rem;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: middle;
}
.dash-ds-panel__table--unified th:last-child,
.dash-ds-panel__table--unified td:last-child {
    border-right: 0;
}
.dash-ds-cell-text--col {
    display: block;
    max-width: 100%;
}
.dash-ds-th-count,
.dash-ds-td-count {
    width: 2.2rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #94a3b8;
    font-size: 0.7rem;
    white-space: nowrap;
}
.dash-ds-col-picker {
    position: absolute;
    z-index: 1080;
    width: min(340px, calc(100vw - 24px));
    max-height: 460px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.dash-ds-col-picker__head {
    padding: 0.65rem 0.8rem;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}
.dash-ds-col-picker__list {
    overflow: auto;
    flex: 1 1 auto;
    padding: 0.35rem 0;
    max-height: 180px;
}
.dash-ds-col-picker__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.82rem;
}
.dash-ds-col-picker__item:hover {
    background: rgba(59, 130, 246, 0.12);
}
.dash-ds-col-picker__unify {
    border-top: 1px solid var(--border-color);
    padding: 0.55rem 0.75rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.dash-ds-col-picker__unify-head {
    font-size: 0.78rem;
    font-weight: 700;
}
.dash-ds-col-picker__hint {
    margin: 0;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
}
[data-theme="light"] .dash-ds-col-picker__hint {
    color: #64748b;
}
.dash-ds-col-picker__groups {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 110px;
    overflow: auto;
}
.dash-ds-col-picker__group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.35);
}
.dash-ds-col-picker__group-main {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}
.dash-ds-col-picker__group-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.dash-ds-col-picker__group-meta strong {
    font-variant-numeric: tabular-nums;
}
.dash-ds-col-picker__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.dash-ds-col-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.28);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-ds-col-picker__chip button {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}
.dash-ds-col-picker__chip button:hover {
    color: #f87171;
}
.dash-ds-col-picker__group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}
.dash-ds-col-picker__group span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[data-theme="light"] .dash-ds-col-picker__group {
    background: #f1f5f9;
}
[data-theme="light"] .dash-ds-col-picker__chip {
    background: rgba(59, 130, 246, 0.1);
}
.dash-ds-col-picker__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
    border-top: 1px solid var(--border-color);
}

/* Sección en modo Data Estudio: cards más Looker */
.dashboard-table-section.is-data-estudio .dashboard-chart-card,
.dashboard-table-section.is-data-estudio .card.dashboard-chart-card {
    background: #1a1c27;
    border-color: #2c2e3b;
}
[data-theme="light"] .dashboard-table-section.is-data-estudio .dashboard-chart-card,
[data-theme="light"] .dashboard-table-section.is-data-estudio .card.dashboard-chart-card {
    background: #fff;
    border-color: #dde1e6;
}
[data-theme="dark"] .dashboard-table-heading {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] .dashboard-table-heading__count {
    background: #0f172a;
}
.dashboard-table-section.is-data-estudio .dashboard-table-heading,
[data-theme="dark"] .dashboard-table-section.is-data-estudio .dashboard-table-heading {
    border-color: rgba(59, 130, 246, 0.45);
}

.dashboard-charts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}
.dashboard-chart-cell {
    box-sizing: border-box;
    min-width: 130px;
    flex-shrink: 0;
    overflow: hidden;
}
.dashboard-chart-style-wrap {
    background: var(--bg-card, transparent);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
}
.dashboard-chart-style-select {
    min-width: 11.5rem;
    max-width: 16rem;
    border: none;
    background: transparent;
    box-shadow: none;
    font-weight: 500;
}
.dashboard-chart-style-select:focus {
    box-shadow: none;
}

/* Variantes de tarjeta / plot ? profundidad distinta por dise?o */
@keyframes ic-chart-card-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ic-chart-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@keyframes ic-depth-pulse {
    0%, 100% {
        box-shadow:
            0 18px 40px -18px rgba(0, 0, 0, 0.72),
            0 0 0 0 rgba(148, 163, 184, 0),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    50% {
        box-shadow:
            0 18px 40px -18px rgba(0, 0, 0, 0.72),
            0 0 36px -10px rgba(96, 165, 250, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}
@keyframes ic-plot-sheen {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.dashboard-chart-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 10px 28px -16px rgba(15, 23, 42, 0.28);
    animation: ic-chart-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* —— Claro: Normal (limpio / profesional) —— */
[data-chart-style="claro_plano"] .dashboard-chart-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -14px rgba(15, 23, 42, 0.12);
}
[data-chart-style="claro_plano"] .dashboard-chart-card .card-header {
    background: transparent;
    border-bottom: 1px solid #eef2f7;
}
[data-chart-style="claro_plano"] .dashboard-chart-plot {
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.9);
}

/* —— Claro: Cristal Soft —— */
[data-chart-style="claro_mix"] .dashboard-chart-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 24px -16px rgba(15, 23, 42, 0.14);
}
[data-chart-style="claro_mix"] .dashboard-chart-card:hover {
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 12px 28px -16px rgba(15, 23, 42, 0.16);
}
[data-chart-style="claro_mix"] .dashboard-chart-card .card-header {
    background: transparent;
    border-bottom: 1px solid #eef2f7;
}
[data-chart-style="claro_mix"] .dashboard-chart-plot {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.85);
}

/* —— Oscuro: Normal (limpio / profesional) —— */
[data-theme="dark"] [data-chart-style="oscuro_plano"] .dashboard-chart-card {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: #111827;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 24px -16px rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] [data-chart-style="oscuro_plano"] .dashboard-chart-card .card-header {
    background: transparent;
    border-bottom-color: rgba(148, 163, 184, 0.12);
}
[data-theme="dark"] [data-chart-style="oscuro_plano"] .dashboard-chart-plot {
    background: #141b2b;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

/* —— Oscuro: Neón Soft (versión sobria) —— */
[data-theme="dark"] [data-chart-style="oscuro_neon"] .dashboard-chart-card {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: #0f1624;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 28px -18px rgba(0, 0, 0, 0.6);
    animation: ic-chart-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
[data-theme="dark"] [data-chart-style="oscuro_neon"] .dashboard-chart-card .card-header {
    background: transparent;
    border-bottom-color: rgba(148, 163, 184, 0.12);
}
[data-theme="dark"] [data-chart-style="oscuro_neon"] .dashboard-chart-plot {
    background: linear-gradient(180deg, #141b2b 0%, #0f1624 100%);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.07);
}

/* ?? Claro: Data Studio (Looker flat) ?? */
[data-chart-style="claro_datastudio"] .dashboard-chart-card {
    border-radius: 2px;
    border: 1px solid #dadce0;
    background: #f0f2f5;
    box-shadow: none;
    animation: none;
}
[data-chart-style="claro_datastudio"] .dashboard-chart-card .card-header {
    background: #f0f2f5;
    border-bottom: 1px solid #e0e3e8;
}
[data-chart-style="claro_datastudio"] .dashboard-chart-plot {
    background: #f0f2f5;
    border-radius: 0;
    box-shadow: none;
}

/* ?? Oscuro: Data Studio (Looker flat charcoal) ?? */
[data-theme="dark"] [data-chart-style="oscuro_datastudio"] .dashboard-chart-card {
    border-radius: 2px;
    border: 1px solid #373947;
    background: #2c2e3b;
    box-shadow: none;
    animation: none;
}
[data-theme="dark"] [data-chart-style="oscuro_datastudio"] .dashboard-chart-card .card-header {
    background: #2c2e3b;
    border-bottom: 1px solid #373947;
}
[data-theme="dark"] [data-chart-style="oscuro_datastudio"] .dashboard-chart-card .card-header strong,
[data-theme="dark"] [data-chart-style="oscuro_datastudio"] .dashboard-chart-card .card-header .text-muted {
    color: #e8eaed !important;
}
[data-theme="dark"] [data-chart-style="oscuro_datastudio"] .dashboard-chart-plot {
    background: #2c2e3b;
    border-radius: 0;
    box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-chart-card,
    [data-chart-style="claro_mix"] .dashboard-chart-card,
    [data-theme="dark"] [data-chart-style="oscuro_neon"] .dashboard-chart-card {
        animation: none !important;
    }
}

.dashboard-chart-card .chart-card-actions {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}
.dashboard-chart-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0.5rem;
}
.chart-density-bar {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 0 0 auto;
    margin: 0.15rem 0.35rem 0.1rem;
    padding: 0.15rem 0.2rem 0.05rem;
    font-size: 0.7rem;
    line-height: 1.2;
}
.chart-density-bar__row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.chart-density-bar__count {
    flex: 0 0 auto;
    min-width: 4.2rem;
    text-align: right;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}
.chart-density-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 auto;
    min-width: 0;
    height: 4px;
    margin: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 100%);
    outline: none;
    cursor: ew-resize;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}
.chart-density-slider:hover {
    background: linear-gradient(90deg, #dbe3ee 0%, #b8c4d4 100%);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}
.chart-density-slider:active {
    background: linear-gradient(90deg, #cbd5e1 0%, #94a3b8 100%);
}
.chart-density-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1.5px solid #94a3b8;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    cursor: grab;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.chart-density-slider:hover::-webkit-slider-thumb {
    border-color: #64748b;
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}
.chart-density-slider:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.12);
    border-color: #475569;
}
.chart-density-slider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
}
.chart-density-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1.5px solid #94a3b8;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    cursor: grab;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.chart-density-bar__btn {
    flex: 0 0 auto;
    padding: 0.2rem 0.55rem;
    font-size: 12px;
    line-height: 1.3;
    border-radius: 5px;
    border-color: #cbd5e1;
    color: #64748b;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chart-density-bar__btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}
.chart-html-legend {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 42%;
    overflow: auto;
    margin: 0.15rem 0.25rem 0;
    padding: 0.35rem 0.25rem 0.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.chart-html-legend__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    align-items: center;
}
.chart-html-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    font-size: 12px;
    color: var(--text-primary, #334155);
    line-height: 1.35;
}
.chart-html-legend__swatch {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.chart-html-legend__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 16rem;
}
.chart-html-legend__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.35rem;
}
.chart-html-legend__hint {
    font-size: 12px;
    color: #94a3b8;
}
.dashboard-chart-cell--expanded-labels .dashboard-chart-body {
    overflow: auto;
}
.dashboard-chart-cell--expanded-labels .chart-html-legend {
    max-height: none;
}
[data-theme="dark"] .chart-html-legend__item,
[data-theme="dark"] .chart-html-legend__text {
    color: var(--text-primary, #f1f5f9) !important;
}
[data-theme="dark"] .chart-html-legend__hint,
[data-theme="dark"] .chart-density-bar__count {
    color: var(--text-secondary, #94a3b8) !important;
}
[data-theme="dark"] .chart-density-slider {
    background: linear-gradient(90deg, #334155 0%, #475569 100%);
}
[data-theme="dark"] .chart-density-slider:hover {
    background: linear-gradient(90deg, #3f4f63 0%, #64748b 100%);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.1);
}
[data-theme="dark"] .chart-density-slider::-webkit-slider-thumb {
    background: #e2e8f0;
    border-color: #94a3b8;
}
[data-theme="dark"] .chart-density-bar__count,
[data-theme="dark"] .chart-html-legend__hint {
    color: #94a3b8;
}
[data-theme="dark"] .chart-html-legend {
    border-top-color: rgba(148, 163, 184, 0.2);
}
[data-theme="dark"] .chart-density-bar__btn {
    border-color: #475569;
    color: #cbd5e1;
}
[data-theme="dark"] .chart-density-bar__btn:hover {
    background: #1e293b;
    border-color: #64748b;
    color: #f1f5f9;
}
.dashboard-chart-plot {
    flex: 1 1 auto;
    min-height: 72px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}
.dashboard-chart-plot canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
[data-theme="dark"] .dashboard-chart-card,
[data-theme="dark"] .saved-chart-card {
    box-shadow: 0 14px 32px -14px rgba(0, 0, 0, 0.55);
}
body.dashboard-chart-resizing {
    user-select: none;
    cursor: nwse-resize;
}
body.dashboard-chart-resizing .dashboard-chart-card {
    pointer-events: none;
}
body.dashboard-chart-resizing .chart-resize-handle {
    pointer-events: auto;
}
.chart-resize-handle {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    opacity: 0.5;
    background: linear-gradient(135deg, transparent 50%, var(--primary) 50%);
    border-radius: 0 0 4px 0;
    z-index: 5;
    pointer-events: auto;
}
.chart-resize-handle:hover {
    opacity: 0.95;
}

.dashboard-refresh-group {
    flex-wrap: nowrap;
}
.dashboard-refresh-btn.dashboard-refresh-pending {
    border-color: #f59e0b;
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    animation: dashboard-refresh-pulse 2s ease-in-out infinite;
}
[data-theme="dark"] .dashboard-refresh-btn.dashboard-refresh-pending {
    border-color: #fbbf24;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.15);
}
@keyframes dashboard-refresh-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.dashboard-change-info-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}
#dashboardChangesList .list-group-item {
    border-left: 0;
    border-right: 0;
}

.chart-drill-header {
    gap: 0.75rem;
}
.chart-drill-header .modal-title {
    flex: 1 1 auto;
    min-width: 0;
}
.chart-drill-cols-btn {
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.4rem 0.9rem;
    margin-left: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.chart-drill-enlarge-btn {
    margin-left: auto;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.4rem 0.9rem;
    border-color: rgba(255, 255, 255, 0.45);
}
.chart-drill-enlarge-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.65);
}
.chart-drill-cols-btn:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}
.chart-drill-header .btn-close {
    flex-shrink: 0;
    margin-left: 0.25rem;
}

.chart-drill-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.chart-drill-column-panel {
    order: -1;
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.chart-drill-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    width: 100%;
}
.chart-drill-stat-card {
    flex: 1 1 100%;
    text-align: center;
    padding: 1.1rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--primary);
    background: var(--bg-card);
}
.chart-drill-stats:has(.chart-drill-stat-sum) .chart-drill-stat-card {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: min(100%, 220px);
}
.chart-drill-stat-primary .chart-drill-stat-value {
    color: var(--primary);
}
.chart-drill-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}
.chart-drill-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.chart-drill-stat-sum {
    border-color: var(--border-color);
    background: var(--bg-body);
}

.drill-full-layout-body {
    background: var(--bg-body);
    min-height: 100vh;
}
.drill-full-topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
.drill-full-main {
    max-width: 100%;
}
.chart-drill-full-table table {
    font-size: 0.9rem;
}
.chart-drill-full-table .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-card);
    box-shadow: inset 0 -1px 0 var(--border-color);
}

.share-layout-body {
    background: var(--bg-body);
    min-height: 100vh;
}
.share-topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}
.share-unified-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.share-unified-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}
.share-unified-nav__btn:hover {
    color: var(--text-body);
    border-color: var(--bs-primary);
}
.share-unified-nav__btn.is-active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}
.share-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 720px;
}
.share-hub-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.25rem 1.15rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: inherit;
    text-decoration: none;
}
.share-hub-card:hover {
    border-color: var(--bs-primary);
    color: inherit;
}
.share-hub-card__icon {
    font-size: 1.5rem;
}
.share-hub-card__title {
    font-size: 1.15rem;
    font-weight: 700;
}
.col-cap-comentarios {
    min-width: 220px !important;
    width: 220px;
}

.excel-cell--locked {
    pointer-events: none;
    opacity: 0.92;
}
.col-cap-pagos {
    min-width: 160px !important;
    width: 160px;
}
.col-cap-periodo {
    min-width: 125px !important;
    width: 125px;
}
.col-cap-fecha-pago {
    min-width: 148px !important;
    width: 148px;
}
.pagos-share-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.35rem;
}
.pagos-share-back:hover {
    color: var(--text-body);
}
.pagos-share-title-file {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.payments-share-view .page-header {
    margin-bottom: 0.75rem;
}
.payments-share-view .data-table-card {
    min-height: calc(100vh - 9rem);
}
.payments-share-view #tableActions {
    display: none;
}
.payments-share-view #viewCharts,
.payments-share-view #viewSavedQueries {
    display: none !important;
}

/* Import preview */
.import-info {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}
.import-info i { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.import-preview-table { max-height: 200px; overflow: auto; }
.import-preview-table th { background: var(--bg-body); font-size: 0.75rem; white-space: nowrap; }
.import-preview-table td { font-size: 0.8rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ========== RESPONSIVE ========== */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; }
    .login-decoration { display: none; }
    .page-content { padding: 1rem; }
}

@media (max-width: 575.98px) {
    .login-card { padding: 2rem 1.5rem; }
    .kpi-value { font-size: 1.35rem; }
}

/* DataTables dark mode */
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background: var(--bg-body);
    color: var(--text-primary);
    border-color: var(--border-color);
}
[data-theme="dark"] .page-link { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); }

/* ========== DARK MODE (global) ========== */
[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(99, 102, 241, 0.1);
    --bs-table-active-bg: rgba(99, 102, 241, 0.14);
}

[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
}

[data-theme="dark"] .table thead th,
[data-theme="dark"] .data-table-card .table thead th {
    background: #162032;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .table tbody tr,
[data-theme="dark"] .data-table-card .table tbody tr {
    background: var(--bg-card);
}

[data-theme="dark"] .table tbody tr:nth-child(even),
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .table-hover > tbody > tr:hover > *,
[data-theme="dark"] .data-table-card .table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .page-header,
[data-theme="dark"] .view-tabs,
[data-theme="dark"] .table-card {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background: #0f172a;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input:focus {
    background: #0f172a;
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark;
}

[data-theme="dark"] .data-table-card.excel-mode .excel-cell,
[data-theme="dark"] .data-table-card.excel-mode input.excel-cell:not([type="checkbox"]),
[data-theme="dark"] .data-table-card.excel-mode textarea.excel-cell,
[data-theme="dark"] .data-table-card.excel-mode select.excel-cell {
    background: #0f172a;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .data-table-card.excel-mode .excel-cell:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .data-table-card.excel-mode .excel-new-cell .excel-cell {
    background: #132033;
}

[data-theme="dark"] #recordsTable .sticky-col {
    background: var(--bg-card);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] #recordsTable thead .sticky-col {
    background: #162032;
}

[data-theme="dark"] #recordsTable tbody tr:hover .sticky-col {
    background: rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .table-zoom-toolbar,
[data-theme="dark"] .excel-mode-hint,
[data-theme="dark"] .view-tab,
[data-theme="dark"] .btn-outline-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .view-tab.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .text-dark { color: var(--text-primary) !important; }
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white {
    background-color: #162032 !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .badge.bg-light {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}
[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1) brightness(1.4);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
}

[data-theme="dark"] .sidebar-overlay {
    background: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] hr,
[data-theme="dark"] .dropdown-divider {
    border-color: var(--border-color);
    opacity: 1;
}

[data-theme="dark"] .import-info {
    background: rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .import-preview-table th {
    background: #162032;
}

/* ---- Modo oscuro: contraste (evitar fondo blanco + texto blanco) ---- */
[data-theme="dark"] kbd,
[data-theme="dark"] .excel-mode-hint kbd {
    background: #0b1220 !important;
    color: #f1f5f9 !important;
    border: 1px solid var(--border-color);
    box-shadow: none;
}

[data-theme="dark"] code,
[data-theme="dark"] samp {
    background: #0b1220;
    color: #e2e8f0;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
}

[data-theme="dark"] pre {
    background: #0b1220;
    color: #e2e8f0;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] input[type="file"].form-control,
[data-theme="dark"] input[type="file"] {
    background: #0f172a;
    color: var(--text-primary);
    border-color: var(--border-color);
    color-scheme: dark;
}

[data-theme="dark"] input[type="file"]::file-selector-button,
[data-theme="dark"] input[type="file"]::-webkit-file-upload-button {
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.85rem;
    margin-inline-end: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

[data-theme="dark"] input[type="file"]:hover::file-selector-button,
[data-theme="dark"] input[type="file"]:hover::-webkit-file-upload-button {
    background: #243247;
    border-color: #475569;
}

[data-theme="dark"] .input-group-text {
    background: #162032;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-outline-light {
    background: #1e293b;
    color: #f1f5f9;
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-light:hover,
[data-theme="dark"] .btn-outline-light:hover {
    background: #243247;
    color: #fff;
    border-color: #475569;
}

[data-theme="dark"] .list-group-item {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .accordion-item,
[data-theme="dark"] .accordion-button {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: #162032;
    color: var(--text-primary);
    box-shadow: none;
}

[data-theme="dark"] .accordion-button::after {
    filter: invert(1) brightness(1.4);
}

[data-theme="dark"] .accordion-body {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .popover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .popover-header {
    background: #162032;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .popover-body {
    color: var(--text-primary);
}

[data-theme="dark"] .tooltip .tooltip-inner {
    background: #0b1220;
    color: #f1f5f9;
}

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled,
[data-theme="dark"] .form-control[readonly] {
    background: #132033;
    color: var(--text-secondary);
    opacity: 1;
}

[data-theme="dark"] .form-select option,
[data-theme="dark"] select option {
    background: #0f172a;
    color: #f1f5f9;
}

[data-theme="dark"] .table-light,
[data-theme="dark"] .table > :not(caption) > * > .table-light,
[data-theme="dark"] thead.table-light th {
    --bs-table-bg: #162032;
    background-color: #162032 !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .progress {
    background: #162032;
}

[data-theme="dark"] .toast {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .toast-header {
    background: #162032;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .offcanvas {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .page-item.disabled .page-link {
    background: var(--bg-card);
    color: var(--text-muted);
    border-color: var(--border-color);
}

/* Página actual de las tablas: que se vea en qué página estás (en oscuro el fondo se perdía). */
.page-item.active .page-link,
[data-theme="dark"] .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--primary-light);
    position: relative;
    z-index: 3;
}

[data-theme="dark"] .form-text,
[data-theme="dark"] .text-body-secondary {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .alert-info,
[data-theme="dark"] .alert-primary,
[data-theme="dark"] .alert-warning,
[data-theme="dark"] .alert-secondary {
    color: var(--text-primary);
}

[data-theme="dark"] .alert-info {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.35);
}

[data-theme="dark"] .alert-primary {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

[data-theme="dark"] .alert-secondary {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.3);
}

/* Vista de presentaci?n (dashboard) */
body.present-layout-body {
    background: var(--bg-body);
    min-height: 100vh;
}
.present-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.present-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
}
.present-hero {
    text-align: center;
    padding: 0.5rem 0 1rem;
}
.present-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.present-subtitle {
    font-size: 1.05rem;
}
.present-charts-grid {
    gap: 1.25rem;
}
.present-chart-card {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}
.present-chart-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}
.present-chart-card .card-header strong {
    font-size: 1.05rem;
}
.present-empty-card {
    border-style: dashed;
}

/* Modal ampliar gr?fica (presentaci?n / enlace solo lectura) */
.chart-focus-dialog {
    --bs-modal-width: min(96vw, 1100px);
}
.chart-focus-content {
    min-height: min(88vh, 820px);
    background: var(--bg-card, var(--bs-body-bg));
    border: 1px solid var(--border-color);
}
.chart-focus-header {
    border-bottom: 1px solid var(--border-color);
    gap: 0.75rem;
    flex-wrap: wrap;
}
.chart-focus-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}
.chart-focus-tabs .btn.active {
    background: var(--primary, #6366f1);
    border-color: var(--primary, #6366f1);
    color: #fff;
}
.chart-focus-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}
.chart-focus-pane {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.chart-focus-hint {
    flex-shrink: 0;
}
.chart-focus-plot {
    flex: 1 1 auto;
    min-height: min(62vh, 560px);
    position: relative;
    padding: 0.5rem 1rem 1rem;
}
.chart-focus-plot canvas {
    width: 100% !important;
    height: 100% !important;
}
.chart-focus-table-wrap {
    overflow: auto;
    max-height: min(78vh, 720px);
}
.btn-chart-focus {
    line-height: 1;
    padding: 0.2rem 0.45rem;
}

[data-theme="dark"] .page-content {
    background: var(--bg-body);
}

/* ?? Dashboard reader filters (Looker / Data Studio) ?? */
.ds-reader-filter-bar {
    margin: 0.45rem 0 0.75rem;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    background: #202124;
    border: 1px solid #3c4043;
    color: #e8eaed;
}
.ds-reader-filter-bar--campo {
    max-width: min(56rem, 100%);
}
.ds-reader-filter-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.ds-reader-filter-bar__label {
    font-size: 0.8rem;
    color: #9aa0a6;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.25rem;
}
.ds-reader-filter-bar__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1 1 auto;
}
.ds-reader-chip,
button.ds-reader-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #5f6368 !important;
    background: #303134 !important;
    color: #e8eaed !important;
    border-radius: 4px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    cursor: pointer;
    line-height: 1.2;
    box-shadow: none !important;
}
.ds-reader-chip:hover,
button.ds-reader-chip:hover {
    border-color: #8ab4f8 !important;
    background: #3c4043 !important;
    color: #e8eaed !important;
}
.ds-reader-chip__remove {
    margin-left: 0.15rem;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.75;
    padding: 0 0.15rem;
}
.ds-reader-chip__remove:hover {
    opacity: 1;
    color: #f28b82;
}
.ds-reader-reset {
    border: 1px solid #8ab4f8 !important;
    background: #1a73e8 !important;
    color: #fff !important;
    font-size: 0.75rem !important;
    padding: 0.2rem 0.65rem !important;
}
.ds-reader-reset:hover {
    background: #1765cc !important;
    color: #fff !important;
}
.ds-reader-period-changes {
    width: 100%;
    margin-top: 0.55rem;
    padding-top: 0.5rem;
    border-top: 1px solid #3c4043;
    font-size: 0.8rem;
    color: #e8eaed;
}
.ds-reader-period-changes__title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #e8eaed;
}
.ds-reader-period-changes__group {
    margin-bottom: 0.45rem;
}
.ds-reader-period-changes__table {
    font-weight: 600;
    color: #8ab4f8;
    margin-bottom: 0.15rem;
}
.ds-reader-period-changes ul {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.15rem;
}
.ds-reader-period-changes li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.12rem 0;
    color: #dadce0;
}
.ds-reader-period-changes__day {
    color: #9aa0a6;
    min-width: 6.5rem;
    flex: 0 0 auto;
}
.ds-reader-period-changes__empty {
    color: #9aa0a6;
    font-size: 0.8rem;
}
.ds-period-hint {
    max-width: 16rem;
    line-height: 1.35;
}

.ds-reader-menu {
    position: absolute;
    z-index: 1080;
    min-width: 280px;
    max-width: 340px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.18);
    border: 1px solid #dadce0;
    overflow: hidden;
}
[data-theme="dark"] .ds-reader-menu {
    background: #2d2e30;
    border-color: #5f6368;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
}
.ds-reader-menu__content {
    padding: 0.35rem 0;
    max-height: min(70vh, 420px);
    overflow: auto;
}
.ds-reader-menu__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    color: #202124;
    cursor: pointer;
}
[data-theme="dark"] .ds-reader-menu__item {
    color: #e8eaed;
}
.ds-reader-menu__item i,
.ds-reader-menu__icon {
    font-size: 1.1rem;
    color: #5f6368;
    width: 1.25rem;
    height: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.ds-reader-menu__icon svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
    pointer-events: none;
}
[data-theme="dark"] .ds-reader-menu__item i,
[data-theme="dark"] .ds-reader-menu__icon {
    color: #9aa0a6;
}
.ds-reader-menu__item:hover:not(.is-disabled) {
    background: #f1f3f4;
}
[data-theme="dark"] .ds-reader-menu__item:hover:not(.is-disabled) {
    background: #3c4043;
}
.ds-reader-menu__item.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.ds-reader-menu__divider {
    height: 1px;
    background: #dadce0;
    margin: 0.35rem 0;
}
[data-theme="dark"] .ds-reader-menu__divider {
    background: #5f6368;
}

.ds-reader-popover {
    position: absolute;
    z-index: 1085;
    min-width: 280px;
    max-width: 420px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    color: #202124;
}
[data-theme="dark"] .ds-reader-popover {
    background: #2d2e30;
    border-color: #5f6368;
    color: #e8eaed;
}
.ds-reader-popover__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #e0e3e8;
    font-size: 0.9rem;
}
[data-theme="dark"] .ds-reader-popover__head {
    border-bottom-color: #5f6368;
    background: #3c4043;
}
.ds-reader-popover__body,
.ds-reader-period-dates {
    padding: 0.75rem 0.85rem;
}
.ds-reader-period-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.ds-reader-popover__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem 0.75rem;
    border-top: 1px solid #e0e3e8;
}
[data-theme="dark"] .ds-reader-popover__foot {
    border-top-color: #5f6368;
}
.ds-reader-period-head {
    background: #3c4043;
    color: #e8eaed;
    border-bottom-color: #5f6368 !important;
}
.ds-reader-period-head .form-select {
    max-width: 12rem;
    background: #202124;
    color: #e8eaed;
    border-color: #5f6368;
}
.ds-reader-include-today {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    margin: 0;
    color: #e8eaed;
}
.ds-reader-dropdown-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.55rem 0.85rem 0.25rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--border-color, #dadce0);
    border-radius: 4px;
    background: var(--bg-elevated, #f8f9fa);
}
[data-theme="dark"] .ds-reader-dropdown-search {
    background: #202124;
    border-color: #5f6368;
}
.ds-reader-dropdown-search input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    color: inherit;
    font-size: 0.85rem;
}
.ds-reader-dropdown-list {
    max-height: 240px;
    overflow: auto;
    padding: 0.25rem 0.5rem 0.5rem;
}
.ds-reader-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.4rem;
    margin: 0;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
}
.ds-reader-dropdown-item:hover {
    background: rgba(26, 115, 232, 0.12);
}
.ds-reader-dropdown-item__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ds-reader-filter-btn {
    white-space: nowrap;
}

/* Reader filters period ? oscuro (igual que lista desplegable) */
.ds-reader-popover--period-looker {
    min-width: 560px;
    max-width: min(920px, 96vw);
    padding: 0;
    background: #202124 !important;
    color: #e8eaed !important;
    border: 1px solid #3c4043;
    z-index: 2000;
}
.ds-reader-popover--period-looker.has-submenu {
    min-width: 760px;
}
.ds-period-looker {
    display: flex;
    align-items: stretch;
    min-height: 300px;
}
.ds-period-cal {
    flex: 0 0 240px;
    padding: 0.85rem;
    border-right: 1px solid #3c4043;
    background: #202124;
    color: #e8eaed;
}
.ds-period-date-inputs {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.65rem;
}
.ds-period-date-inputs label {
    display: grid;
    gap: 0.2rem;
    color: #9aa0a6;
}
.ds-period-date-inputs input[type="date"] {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    min-height: 2rem;
    background: #303134;
    color: #e8eaed;
    border: 1px solid #5f6368;
    border-radius: 4px;
    color-scheme: dark;
}
.ds-period-date-inputs input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    filter: invert(1);
}
.ds-period-menus {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    background: #202124;
}
.ds-period-menu-primary,
.ds-period-menu-sub {
    flex: 1 1 200px;
    border-left: 1px solid #3c4043;
    max-height: 380px;
    overflow: auto;
    padding: 0.35rem 0;
    background: #202124;
}
.ds-period-menu-primary {
    border-left: none;
}
.ds-period-menu-sub.d-none {
    display: none !important;
}
.ds-period-cal__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0 0.35rem;
}
.ds-period-cal__nav button {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    color: #9aa0a6;
    padding: 0 0.35rem;
}
.ds-period-cal__label {
    font-size: 0.75rem;
    color: #9aa0a6;
    margin-bottom: 0.35rem;
}
.ds-period-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.ds-period-cal__dow {
    font-size: 0.7rem;
    color: #9aa0a6;
    padding: 0.2rem 0;
}
.ds-period-cal__day {
    border: none;
    background: transparent;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    font-size: 0.8rem;
    cursor: pointer;
    color: #e8eaed;
}
.ds-period-cal__day.is-empty {
    cursor: default;
}
.ds-period-cal__day.is-in {
    background: rgba(138, 180, 248, 0.2);
    border-radius: 0;
}
.ds-period-cal__day.is-start,
.ds-period-cal__day.is-end {
    background: #1a73e8;
    color: #fff;
}
.ds-period-cal__day:hover:not(.is-empty):not(.is-start):not(.is-end) {
    background: #3c4043;
}
.ds-period-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    color: #e8eaed;
    cursor: pointer;
}
.ds-period-menu-item:hover,
.ds-period-menu-item.is-active {
    background: rgba(138, 180, 248, 0.16);
    color: #8ab4f8;
}
.ds-reader-popover--period-looker .ds-reader-popover__foot {
    border-top: 1px solid #3c4043;
    background: #202124;
}
.ds-reader-popover--period-looker .ds-reader-include-today {
    color: #bdc1c6;
}
.ds-reader-popover--period-looker .form-select {
    background: #303134;
    color: #e8eaed;
    border-color: #5f6368;
}
.ds-reader-popover--period-looker [data-cal-range] {
    color: #9aa0a6 !important;
}
.ds-reader-popover--dark {
    background: #202124 !important;
    border-color: #3c4043 !important;
    color: #e8eaed !important;
}
.ds-reader-popover--dark .ds-reader-popover__head {
    background: #303134;
    border-bottom-color: #3c4043;
    color: #e8eaed;
}
.ds-reader-popover--dark .ds-reader-popover__foot {
    border-top-color: #3c4043;
}
.ds-reader-popover--dark .ds-reader-dropdown-search {
    background: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}
.ds-reader-dropdown-item__count {
    color: #9aa0a6;
    font-size: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}
.ds-reader-inline-control {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #303134;
    border: 1px solid #5f6368;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    color: #e8eaed;
    font-size: 0.8rem;
}
.ds-reader-inline-label {
    white-space: nowrap;
    color: #bdc1c6;
}
.ds-reader-inline-input {
    width: 7.5rem;
    background: #202124 !important;
    border-color: #5f6368 !important;
    color: #e8eaed !important;
    font-size: 0.8rem !important;
    padding: 0.15rem 0.35rem !important;
}
.ds-reader-adv .form-select {
    width: auto;
    max-width: 8.5rem;
    background: #202124;
    color: #e8eaed;
    border-color: #5f6368;
    font-size: 0.75rem;
    padding: 0.15rem 0.35rem;
}
.ds-reader-mini-apply {
    padding: 0.1rem 0.4rem !important;
    font-size: 0.7rem !important;
}
.ds-reader-fixed-list {
    margin-top: 0.55rem;
    border: 1px solid #3c4043;
    border-radius: 6px;
    background: #202124;
    max-width: 320px;
}
.ds-reader-fixed-list__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid #3c4043;
    color: #e8eaed;
    font-size: 0.85rem;
}
.ds-reader-fixed-list__body {
    max-height: 220px;
    overflow: auto;
    padding: 0.25rem 0.35rem;
}
.ds-reader-cb {
    cursor: pointer;
}
.ds-reader-sel-count {
    font-weight: 500;
    color: #9aa0a6;
}

/* Saludo de cumpleaños al iniciar sesión */
.ic-bday-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 18, 0.55);
    backdrop-filter: blur(2px);
}
.ic-bday-overlay canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.ic-bday-card {
    position: relative;
    z-index: 1;
    max-width: 28rem;
    margin: 1.5rem;
    padding: 1.75rem 1.5rem 1.25rem;
    border-radius: 1.25rem;
    text-align: center;
    background: var(--bg-card, #1e293b);
    color: var(--text-primary, #f8fafc);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.ic-bday-card .ic-bday-cake {
    font-size: 2.6rem;
    color: #fb7185;
    display: block;
    margin-bottom: 0.5rem;
}
.ic-bday-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}
.ic-bday-card p {
    margin: 0 0 1rem;
    color: var(--text-secondary, #94a3b8);
}
.ic-bday-names {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fb7185;
}

/* Notarías: menú con halo verde; la pestaña del panel copia ese diseño */
.nav-section-notarias {
    position: relative;
    isolation: isolate;
    margin: 0 0 1.15rem;
    padding: 0.45rem 0.4rem 0.55rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, #34a853 22%, transparent);
    background:
        radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, #34a853 22%, transparent), transparent 58%),
        radial-gradient(90% 70% at 100% 100%, color-mix(in srgb, #34a853 10%, transparent), transparent 55%),
        color-mix(in srgb, #34a853 6%, transparent);
    box-shadow: 0 0 32px color-mix(in srgb, #34a853 18%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.nav-section-notarias::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 18px;
    background: radial-gradient(circle at 18% 0%, color-mix(in srgb, #34a853 38%, transparent), transparent 70%);
    filter: blur(18px);
    opacity: 0.65;
    z-index: -1;
    pointer-events: none;
}
.nav-section-notarias .nav-notary-accordion {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.nav-section-notarias .nav-notary-accordion.is-open,
.nav-section-notarias .nav-notary-accordion.is-selected {
    border: none;
    background: transparent;
    box-shadow: none;
}
[data-theme="dark"] .nav-section-notarias .nav-notary-accordion.is-open,
[data-theme="dark"] .nav-section-notarias .nav-notary-accordion.is-selected {
    border: none;
    background: transparent;
    box-shadow: none;
}
.nav-section-notarias .nav-notary-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.35rem 0.4rem 0.35rem 0.55rem;
    color: #34a853;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 650;
}
.nav-section-notarias .nav-notary-hub-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.15rem 0.2rem 0.15rem 0;
}
.nav-section-notarias .nav-notary-hub-link:hover {
    color: #34a853;
}
.nav-section-notarias .nav-notary-hub-link:hover .nav-campo-title-text {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}
.nav-section-notarias .nav-notary-hub-link.is-current .nav-campo-title-text {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}
.nav-section-notarias .nav-notary-toggle.nav-campo-header-btn {
    width: auto;
    min-height: 1.75rem;
    padding: 0.15rem 0.25rem;
    gap: 0.3rem;
    flex: 0 0 auto;
    color: inherit;
}
.nav-section-notarias .nav-notary-accordion.is-open .nav-campo-icon-wrap,
.nav-section-notarias .nav-notary-hub-link.is-current .nav-campo-icon-wrap {
    background: color-mix(in srgb, #34a853 22%, transparent);
    color: #34a853;
}
.nav-notary-folder-count {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, #34a853 18%, transparent);
    color: #34a853;
    flex-shrink: 0;
}
.nav-section-notarias .nav-link:hover {
    background: color-mix(in srgb, #34a853 12%, transparent);
}
.nav-section-notarias .nav-link.active {
    background: color-mix(in srgb, #34a853 20%, transparent);
    color: #34a853;
    box-shadow: 0 0 12px color-mix(in srgb, #34a853 22%, transparent);
}
.campo-tab--notarias {
    border: 1px solid color-mix(in srgb, #34a853 28%, transparent) !important;
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #34a853 26%, transparent), transparent 62%),
        color-mix(in srgb, #34a853 10%, transparent) !important;
    color: #34a853 !important;
    font-weight: 650;
    letter-spacing: 0.04em;
    box-shadow: 0 0 18px color-mix(in srgb, #34a853 22%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.campo-tab--notarias:hover {
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #34a853 32%, transparent), transparent 62%),
        color-mix(in srgb, #34a853 14%, transparent) !important;
    color: #34a853 !important;
}
.campo-tab--notarias.active {
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #34a853 34%, transparent), transparent 62%),
        color-mix(in srgb, #34a853 16%, transparent) !important;
    color: #34a853 !important;
    border-color: color-mix(in srgb, #34a853 42%, transparent) !important;
    box-shadow: 0 0 22px color-mix(in srgb, #34a853 30%, transparent);
}
.campo-tab--notarias .badge {
    background: color-mix(in srgb, #34a853 28%, transparent) !important;
    color: #34a853 !important;
}
.campo-tab--zoom .badge {
    background: color-mix(in srgb, #2d8cff 28%, transparent) !important;
    color: #2d8cff !important;
}
.dashboard-notary-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0.35rem 0 1rem;
}
.dashboard-zoom-banner {
    background: color-mix(in srgb, #2d8cff 12%, #fff);
    border-color: color-mix(in srgb, #2d8cff 35%, #cbd5e1);
}
.dashboard-zoom-banner:hover {
    background: color-mix(in srgb, #2d8cff 18%, #fff);
}
.dashboard-zoom-group .dashboard-chart-checklist,
.dashboard-zoom-group a.dashboard-chart-checklist.dashboard-chart-check-link {
    color: #2d8cff;
}
.dashboard-zoom-group a.dashboard-chart-check-link:hover,
.dashboard-zoom-group a.dashboard-chart-check-link:focus-visible {
    color: #1a73e8;
}
.dashboard-zoom-group .dashboard-chart-open-inline {
    color: #2d8cff;
}
.dashboard-notary-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.dashboard-notary-body.d-none {
    display: none !important;
}
.dashboard-chart-checklist {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #34a853;
    line-height: 1.25;
}
a.dashboard-chart-check-link {
    text-decoration: none;
    color: inherit;
}
a.dashboard-chart-checklist.dashboard-chart-check-link {
    color: #34a853;
}
a.dashboard-chart-check-link:hover,
a.dashboard-chart-check-link:focus-visible {
    text-decoration: underline;
    color: #22c55e;
}
.dashboard-chart-check-link__icon {
    font-size: 0.78em;
    margin-left: 0.25rem;
    opacity: 0.7;
}
.dashboard-chart-open-inline {
    color: #34a853;
    font-weight: 600;
    text-decoration: none;
}
.dashboard-chart-open-inline:hover,
.dashboard-chart-open-inline:focus-visible {
    text-decoration: underline;
    color: #22c55e;
}
.dashboard-chart-title {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.12rem;
}
.zoom-name-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.9rem;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--text-muted);
}
.zoom-name-stats strong {
    color: var(--text-primary);
    font-weight: 650;
}
.dashboard-notary-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, #34a853 22%, transparent);
    border-left: 4px solid #34a853;
    background:
        radial-gradient(120% 80% at 0% 50%, color-mix(in srgb, #34a853 14%, transparent), transparent 70%),
        color-mix(in srgb, #34a853 6%, var(--bg-card));
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}
.dashboard-notary-banner.ic-collapse-toggle {
    width: 100%;
}
.dashboard-notary-banner:hover {
    border-color: color-mix(in srgb, #34a853 45%, transparent);
}
.dashboard-notary-banner strong,
.dashboard-notary-banner__link {
    flex: 1;
    min-width: 0;
}
.dashboard-notary-banner__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}
.dashboard-notary-banner__link strong {
    flex: 0 1 auto;
}
.dashboard-notary-banner__link:hover,
.dashboard-notary-banner__link:focus-visible {
    color: #22c55e;
    text-decoration: underline;
}
.dashboard-notary-banner__link-icon {
    font-size: 0.85em;
    opacity: 0.75;
}
.dashboard-notary-banner__count {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.dashboard-notary-banner__chevron {
    margin-left: 0.1rem;
    color: var(--text-muted);
}
.notary-hub-header {
    padding: 1.15rem 1.25rem;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--campo-accent, #34a853) 22%, transparent);
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--campo-accent, #34a853) 16%, transparent), transparent 58%),
        var(--bg-card);
    margin-bottom: 1.35rem;
}
.notary-hub-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.notary-path {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: wrap;
    margin: 0 0 0.9rem;
    padding: 0.22rem;
    border-radius: 999px;
    background: color-mix(in srgb, #34a853 9%, var(--bg-elevated));
    border: 1px solid color-mix(in srgb, #34a853 22%, transparent);
    font-size: 0.78rem;
}
.notary-path__crumb,
.notary-path__here {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-weight: 600;
}
.notary-path__crumb {
    color: #34a853;
    text-decoration: none;
}
.notary-path__crumb:hover {
    background: color-mix(in srgb, #34a853 16%, transparent);
    color: #34a853;
}
.notary-path__sep {
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1;
}
.notary-path__here {
    background: color-mix(in srgb, #34a853 22%, transparent);
    color: var(--text-primary);
    font-weight: 650;
}
.notary-folder-hero__icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    font-size: 1.35rem;
}
.notary-folder-hero__main {
    min-width: 0;
    flex: 1;
}
.notary-folder-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}
.notary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    max-width: 100%;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    background: color-mix(in srgb, #34a853 12%, transparent);
    color: var(--text-secondary);
    border: 1px solid color-mix(in srgb, #34a853 20%, transparent);
}
.notary-chip--status {
    font-weight: 700;
    letter-spacing: 0.01em;
}
.notary-chip--status.is-on {
    color: #4ade80;
    background: color-mix(in srgb, #22c55e 22%, transparent);
    border-color: #22c55e;
}
.notary-chip--status.is-off {
    color: #f87171;
    background: color-mix(in srgb, #ef4444 20%, transparent);
    border-color: #ef4444;
}
.notary-status-pick {
    display: flex;
    gap: 0.5rem;
}
.notary-status-pick__opt {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.6rem 0.75rem;
    border-radius: 0.7rem;
    border: 1px solid color-mix(in srgb, var(--text-secondary, #94a3b8) 35%, transparent);
    color: var(--text-secondary, #94a3b8);
    font-weight: 700;
    cursor: pointer;
}
.notary-status-pick__opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.notary-status-pick__opt.is-on:has(input:checked) {
    color: #4ade80;
    background: color-mix(in srgb, #22c55e 24%, transparent);
    border-color: #22c55e;
    box-shadow: 0 0 0 1px #22c55e;
}
.notary-status-pick__opt.is-off:has(input:checked) {
    color: #f87171;
    background: color-mix(in srgb, #ef4444 22%, transparent);
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}
.notary-chip--muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 36rem;
}
.notary-table-path-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}
.notary-table-path-row .notary-path {
    margin-bottom: 0;
}
.page-header--table-view.notary-table-hero {
    padding: 1rem 1.15rem 0.85rem;
    margin-bottom: 1rem;
}
.notary-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--campo-accent, #34a853);
}
.notary-show-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}
.notary-filter-saved {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-height: 1.85rem;
    margin: 0 0 0.65rem;
}
.notary-filter-chip-wrap {
    display: inline-flex;
    align-items: stretch;
    height: 1.75rem;
}
.notary-filter-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid color-mix(in srgb, #34a853 35%, var(--border-color));
    background: color-mix(in srgb, #34a853 12%, var(--bg-card));
    color: var(--text-primary);
    border-radius: 999px 0 0 999px;
    padding: 0 0.7rem;
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
}
.notary-filter-chip-wrap form {
    display: flex;
    margin: 0;
}
.notary-filter-chip-wrap:not(:has(form)) .notary-filter-chip {
    border-radius: 999px;
}
.notary-filter-chip.is-active {
    background: #34a853;
    border-color: #34a853;
    color: #fff;
}
.notary-filter-chip__x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    border: 1px solid color-mix(in srgb, #34a853 35%, var(--border-color));
    border-left: 0;
    background: color-mix(in srgb, #34a853 8%, var(--bg-card));
    color: var(--text-muted);
    border-radius: 0 999px 999px 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
}
.notary-filter-chip__x:hover {
    color: #f06a6a;
}
.notary-filters {
    margin: 0 0 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    overflow: hidden;
}
.notary-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.55rem;
    padding: 0.35rem 0.65rem 0.35rem 0.9rem;
}
.notary-filters__title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    font-weight: 650;
    color: var(--text-primary);
}
.notary-filters__title i {
    color: #34a853;
}
.notary-filters__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 6.4rem;
    height: 1.75rem;
    padding: 0 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1;
}
.notary-filters__toggle:hover {
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--text-muted) 55%, var(--border-color));
}
.notary-filters__panel {
    margin: 0;
    padding: 0.8rem 0.9rem 0.85rem;
    border: 0;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
}
.notary-filters__panel[hidden] {
    display: none;
}
.notary-filters__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem 0.7rem;
}
.notary-filters__field .form-label {
    margin: 0 0 0.28rem;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.notary-filters .form-select,
.notary-filters .form-control {
    height: 2.05rem;
    min-height: 2.05rem;
    padding-top: 0;
    padding-bottom: 0;
    border-radius: 8px;
    background-color: var(--bg-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
    font-size: 0.82rem;
}
.notary-filters .form-select {
    text-overflow: ellipsis;
}
.notary-filters input[type="date"] {
    color-scheme: light;
}
[data-theme="dark"] .notary-filters input[type="date"] {
    color-scheme: dark;
}
.notary-filters__sistemas {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 0.75rem 1.25rem;
    margin-top: 0.85rem;
}
.notary-filters__group {
    margin: 0 0 0.4rem;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.notary-filters__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.notary-filters__pill {
    position: relative;
    margin: 0;
    cursor: pointer;
}
.notary-filters__pill input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.notary-filters__pill span {
    display: inline-flex;
    align-items: center;
    height: 1.7rem;
    padding: 0 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
}
.notary-filters__pill input:checked + span {
    border-color: #34a853;
    background: color-mix(in srgb, #34a853 18%, var(--bg-card));
    color: var(--text-primary);
}
.notary-filters__pill input:focus-visible + span {
    outline: 2px solid #34a853;
    outline-offset: 2px;
}
.notary-filters__save {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}
.notary-filters__save input {
    flex: 1 1 12rem;
    max-width: 16rem;
}
.notary-filters__save .btn {
    height: 2.05rem;
    white-space: nowrap;
}
.notary-folder-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: -0.35rem 0 0.75rem;
}
.notary-folder-search {
    flex: 1 1 16rem;
    max-width: 28rem;
}
.notary-folder-empty {
    margin: 1.5rem 0 0.5rem;
    text-align: center;
    color: var(--text-muted);
}
.notary-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.notary-folder-grid.is-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.notary-folder-grid.is-list .notary-folder-card {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    min-height: 0;
    padding: 0.65rem 2.5rem 0.65rem 0.9rem;
    gap: 0.55rem 0.75rem;
}
.notary-folder-grid.is-list .notary-folder-card__tab {
    display: none;
}
.notary-folder-grid.is-list .notary-folder-card__icon {
    width: 2rem;
    height: 2rem;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.notary-folder-grid.is-list .notary-folder-card__title {
    flex: 0 1 16rem;
    min-width: 7rem;
}
.notary-folder-grid.is-list .notary-offer-chips {
    flex: 1 1 14rem;
    margin-top: 0;
}
.notary-folder-grid.is-list .notary-folder-card__creator {
    flex: 0 0 auto;
}
.notary-folder-grid.is-list .notary-folder-card__footer {
    margin-top: 0;
    margin-left: auto;
}
.notary-folder-grid.is-list .notary-folder-card__actions {
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
}
@media (max-width: 640px) {
    .notary-folder-grid.is-list .notary-offer-chips {
        flex-basis: 100%;
    }
    .notary-folder-grid.is-list .notary-folder-card__footer {
        margin-left: 0;
    }
}
.notary-folder-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 9.75rem;
    padding: 1.35rem 1rem 0.95rem;
    border-radius: 16px;
    color: inherit;
    border: 1px solid color-mix(in srgb, var(--card-color, #34a853) 28%, var(--border-color));
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--card-color, #34a853) 18%, transparent), transparent 62%),
        var(--bg-card);
    box-shadow: 0 10px 24px color-mix(in srgb, #34a853 8%, transparent);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.notary-folder-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-color, #34a853);
    box-shadow: 0 14px 28px color-mix(in srgb, #34a853 14%, transparent);
}
.notary-folder-card__hit {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}
.notary-folder-card__actions {
    position: absolute;
    top: 0.35rem;
    right: 0.25rem;
    z-index: 4;
}
.notary-folder-card__actions .btn-link {
    color: var(--text-muted);
    padding: 0.15rem 0.35rem;
}
.notary-folder-card__tab {
    position: absolute;
    top: 0;
    left: 1.1rem;
    width: 2.75rem;
    height: 7px;
    border-radius: 0 0 7px 7px;
    background: color-mix(in srgb, var(--card-color, #34a853) 72%, #166534);
}
.notary-folder-card__icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--card-color, #34a853) 16%, transparent);
    color: var(--card-color, #34a853);
    font-size: 1.25rem;
}
.notary-folder-card__title {
    font-weight: 650;
    font-size: 0.98rem;
    line-height: 1.3;
    color: var(--text-primary);
}
.notary-folder-card .notary-offer-chips {
    margin-top: 0.1rem;
}
.notary-folder-card__status {
    align-self: flex-start;
}
.notary-folder-card__creator {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.notary-folder-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}
.notary-folder-card__meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.notary-folder-card__ext {
    position: relative;
    z-index: 2;
    align-self: flex-start;
}
.notary-ext-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    color: #34a853;
    background: color-mix(in srgb, #34a853 14%, transparent);
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1;
}
.notary-ext-link:hover {
    color: #166534;
    background: color-mix(in srgb, #34a853 24%, transparent);
}
.notary-ext-link.btn {
    width: auto;
    height: auto;
    padding: 0.375rem 0.8rem;
    border-radius: var(--radius-sm);
}
.notary-title-link {
    margin-left: 0.35rem;
}
.notary-link-field {
    position: relative;
}
.notary-link-field > i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #34a853;
    pointer-events: none;
}
.notary-link-field .form-control {
    padding-left: 2.2rem;
}
.page-content:has(.notary-form-card) {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height));
    max-height: calc(100vh - var(--topbar-height));
    overflow: hidden;
}
.notary-hub:has(.notary-form-card) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.notary-form-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: min(1120px, 100%);
    margin: 0 auto;
    border: 1px solid color-mix(in srgb, #34a853 22%, var(--border-color));
    border-radius: 16px;
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: 0 10px 28px color-mix(in srgb, #34a853 8%, transparent);
}
.notary-form-card__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 1.35rem 1.1rem;
}
.notary-form-card__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.85rem 1.35rem;
    border-top: 1px solid var(--border-color);
    background: color-mix(in srgb, #34a853 5%, var(--bg-elevated));
}
.notary-sheet-modal {
    width: min(1140px, calc(100vw - 1.5rem));
    max-width: none;
    height: calc(100vh - 1.5rem);
    margin: 0.75rem auto;
}
.notary-sheet-modal--checks {
    width: min(920px, calc(100vw - 1.5rem));
}
.notary-sheet-modal .modal-content {
    height: 100%;
    max-height: calc(100vh - 1.5rem);
    border: 1px solid color-mix(in srgb, #34a853 22%, var(--border-color));
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}
.notary-sheet-modal .modal-body {
    overflow-y: auto;
}
.llamada-modal {
    width: min(1200px, calc(100vw - 2rem));
    max-width: none;
    height: calc(100vh - 1.5rem);
    margin: 0.75rem auto;
}
.llamada-modal .modal-content {
    height: 100%;
    max-height: calc(100vh - 1.5rem);
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, #1a73e8 28%, var(--border-color));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.llamada-modal .modal-header {
    align-items: flex-start;
    padding: 1.1rem 1.35rem 0.85rem;
    border-bottom: 1px solid color-mix(in srgb, #1a73e8 18%, var(--border-color));
}
.llamada-modal__kicker {
    margin: 0 0 0.1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8ab4f8;
}
.llamada-modal .modal-title {
    font-size: 1.25rem;
}
.llamada-modal .modal-body {
    overflow-y: auto;
    padding: 1.15rem 1.35rem 1.25rem;
}
.llamada-modal .modal-footer {
    padding: 0.85rem 1.35rem;
    border-top: 1px solid color-mix(in srgb, #1a73e8 18%, var(--border-color));
}
.llamada-cliente {
    position: relative;
}
.llamada-cliente__list {
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    top: calc(100% + 0.3rem);
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    max-height: 12rem;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid color-mix(in srgb, #1a73e8 35%, var(--border-color));
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}
.llamada-cliente__list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
}
.llamada-cliente__list button:hover,
.llamada-cliente__list button.is-active {
    background: color-mix(in srgb, #1a73e8 18%, transparent);
}
.llamada-cliente__list {
    max-height: 16rem;
}
.llamada-cliente__row {
    display: flex;
    gap: 0.4rem;
}
.llamada-cliente__add {
    flex: 0 0 auto;
    width: 2.6rem;
}
.llamada-cliente__name {
    display: block;
    font-weight: 600;
}
.llamada-cliente__meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.llamada-cliente__notary {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    color: #1a73e8;
    background: color-mix(in srgb, #1a73e8 14%, transparent);
}
.llamada-cliente__picked {
    margin-top: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    font-size: 0.85rem;
    background: color-mix(in srgb, #1a73e8 10%, var(--bg-card));
    border: 1px solid color-mix(in srgb, #1a73e8 30%, var(--border-color));
}
.llamada-cliente__picked[hidden] {
    display: none;
}
.llamada-cliente__list button.llamada-cliente__create {
    color: #1a73e8;
    font-weight: 600;
}
.llamada-nuevo-cliente {
    padding: 1rem;
    border: 1px dashed color-mix(in srgb, #1a73e8 55%, var(--border-color));
    border-radius: 14px;
    background: color-mix(in srgb, #1a73e8 6%, var(--bg-card));
}
.llamada-nuevo-cliente__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    margin-bottom: 0.85rem;
}
.llamada-nuevo-cliente__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.85rem;
}
.llamada-modal--import {
    max-width: min(720px, calc(100vw - 2rem));
}
.racoo-import__errors {
    max-height: 14rem;
    overflow-y: auto;
    padding-left: 1.1rem;
}
.llamada-modal--client {
    max-width: min(960px, calc(100vw - 2rem));
}
.racoo-tabs {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
}
.racoo-tabs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 9px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
}
.racoo-tabs__item:hover {
    color: inherit;
    background: color-mix(in srgb, #1a73e8 10%, transparent);
}
.racoo-tabs__item.is-active {
    color: #fff;
    background: #1a73e8;
}
.racoo-clientes__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}
.racoo-clientes__search {
    flex: 1 1 16rem;
}
.racoo-clientes__notary,
.racoo-clientes__state {
    width: auto;
    min-width: 11rem;
}
.racoo-clientes__table tr.is-disabled td {
    opacity: 0.55;
}
.racoo-clientes__desc {
    max-width: 18rem;
    white-space: pre-line;
}
.llamada-resultado {
    display: flex;
    gap: 0.5rem;
}
.llamada-resultado label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    cursor: pointer;
}
.llamada-resultado label:has(input:checked) {
    border-color: #1a73e8;
    background: color-mix(in srgb, #1a73e8 14%, var(--bg-card));
}
.notary-form-card .notary-design-pick,
.notary-sheet-modal .notary-design-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
    gap: 0.55rem;
}
.notary-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.notary-name-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    gap: 0.85rem 1rem;
    align-items: end;
}
.notary-identity {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(14rem, 0.9fr);
    gap: 0.65rem 0.85rem;
    align-items: end;
}
.notary-identity__core {
    display: grid;
    grid-template-columns: 10.5rem 6.5rem minmax(0, 1fr);
    gap: 0.55rem 0.65rem;
    align-items: end;
    min-width: 0;
    padding: 0.7rem 0.75rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg-elevated) 70%, var(--bg-card));
}
.notary-identity [data-notary-emp-wrap] {
    display: none;
}
.notary-identity.is-empresa {
    grid-template-columns: 1fr;
}
.notary-identity.is-empresa .notary-identity__core {
    grid-template-columns: 10.5rem minmax(0, 1.1fr) minmax(0, 1fr);
}
.notary-identity.is-empresa [data-notary-num-wrap],
.notary-identity.is-empresa [data-notary-deleg-wrap] {
    display: none;
}
.notary-identity.is-empresa [data-notary-emp-wrap] {
    display: block;
}
.notary-identity__preview {
    grid-column: 1 / -1;
}
.notary-offer__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}
.notary-offer__toggle:hover,
.notary-offer.is-open .notary-offer__toggle {
    border-color: #34a853;
}
.notary-offer__text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notary-offer__text.is-placeholder {
    color: var(--text-muted);
}
.notary-offer__toggle .bi {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.notary-offer__menu {
    position: fixed;
    z-index: 2000;
    max-height: min(70vh, 34rem);
    overflow-y: auto;
    padding: 0.35rem 0 0.45rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
.notary-offer__block + .notary-offer__block {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-color);
}
.notary-offer__group {
    margin: 0.35rem 0.85rem 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #34a853;
}
.notary-offer__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.38rem 0.85rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.notary-offer__item:hover {
    background: color-mix(in srgb, #34a853 10%, transparent);
}
.notary-offer__item input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: #34a853;
    flex-shrink: 0;
}
.notary-folder-hero .campo-page-title {
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
}
.notary-offer-chips {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
}
.notary-offer-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35;
    color: #1d4ed8;
    background: color-mix(in srgb, #3b82f6 12%, var(--bg-card));
    border: 1px solid color-mix(in srgb, #3b82f6 32%, transparent);
}
[data-theme="dark"] .notary-offer-chip {
    color: #93c5fd;
}
.notary-form-section {
    margin-top: 1.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
}
.notary-form-section__title {
    font-size: 0.92rem;
    font-weight: 650;
    margin: 0 0 0.25rem;
}
.notary-form-section__hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
}
.notary-design-pick {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.notary-design-pick__item {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    margin: 0;
    background: var(--bg-elevated);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.notary-design-pick__item:hover {
    border-color: #34a853;
}
.notary-design-pick__item:has(input:checked) {
    border-color: #34a853;
    background: color-mix(in srgb, #34a853 10%, var(--bg-card));
}
.notary-empty-card {
    text-align: center;
    padding: 2.75rem 1.5rem;
    border-radius: 16px;
    border: 1px dashed color-mix(in srgb, #34a853 40%, var(--border-color));
    background: color-mix(in srgb, #34a853 5%, var(--bg-card));
}
.notary-empty-card__icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 0.85rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    color: #34a853;
    background: color-mix(in srgb, #34a853 14%, transparent);
}
.notary-empty-card__title {
    font-weight: 650;
    margin: 0 0 0.35rem;
    color: var(--text-primary);
}
.notary-empty-card__text {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.notary-hub-footnote {
    margin: 1.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.nav-notary-row {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.nav-notary-row .nav-link-notary {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
.nav-notary-ext {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.78rem;
}
.is-checklist-table .col-check-fixed {
    text-align: center;
    width: 4.25rem;
    max-width: 5.5rem;
}
.is-checklist-table .col-check-fixed input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
}
.is-checklist-table textarea.excel-cell[data-slug="tarea"] {
    min-width: 16rem;
    min-height: 2.5rem;
}
.cap-cons-cut {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 0.15rem;
    padding: 0.12rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #dc2626;
    line-height: 1.2;
    white-space: nowrap;
    background: #fef2f2;
    border-radius: 999px;
}
.cap-cons-cut:empty {
    display: none;
}
.is-capacitaciones-table .cap-cobrar-hit {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.5rem;
    margin: 0;
    cursor: pointer;
}
.is-capacitaciones-table .cap-cobrar-check {
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    cursor: pointer;
    accent-color: #dc2626;
}
.is-capacitaciones-table .cap-cons-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    min-width: 5.5rem;
}
.is-capacitaciones-table .cap-cons-cut {
    margin-top: 0;
}
.is-capacitaciones-table textarea.excel-cell[data-slug="usuarios"] {
    min-height: 3.2rem;
    min-width: 10rem;
}
.is-capacitaciones-table select.excel-cell[data-slug="ini"],
.is-capacitaciones-table select.excel-cell[data-slug="fin"] {
    min-width: 4.75rem;
}
.is-capacitaciones-table .excel-cell--computed[data-slug="ingreso-antes-de-impuestos"] {
    font-weight: 700;
}
[data-theme="dark"] .is-capacitaciones-table .cap-cons-cut {
    background: rgba(220, 38, 38, 0.22);
    color: #fca5a5;
}
.cap-dup-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    flex-wrap: wrap;
}
.cap-dup-count {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 1.7rem;
    padding: 0 0.15rem;
    font-size: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    color: inherit;
}
.is-capacitaciones-table .duplicate-record {
    color: var(--text-secondary);
}
.is-capacitaciones-table .duplicate-record:hover {
    color: var(--primary);
}
@media (max-width: 992px) {
    .notary-identity,
    .notary-identity.is-empresa .notary-identity__core,
    .notary-filters__grid,
    .notary-filters__sistemas {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 768px) {
    .notary-form-grid,
    .notary-name-row,
    .notary-identity,
    .notary-identity__core,
    .notary-identity.is-empresa .notary-identity__core,
    .notary-filters__grid,
    .notary-filters__sistemas {
        grid-template-columns: 1fr;
    }
    .notary-show-actions {
        justify-content: flex-start;
    }
}
.notary-agenda {
    margin-top: 0.45rem;
    max-width: 36rem;
}
.notary-agenda--links {
    max-width: 40rem;
}
.notary-link-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.notary-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2.15rem;
    padding: 0.2rem 0.55rem 0.2rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-elevated);
}
.notary-link-row > a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}
.notary-link-row > a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notary-link-row > a:hover {
    color: #34a853;
}
.notary-link-row__actions {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.notary-link-row__actions form {
    margin: 0;
}
.notary-link-add {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.65rem;
}
.notary-link-add input {
    flex: 1 1 9rem;
    min-width: 0;
}
.notary-agenda__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: transparent;
    color: #34a853;
    font-weight: 650;
    font-size: 0.86rem;
    padding: 0.15rem 0;
}
.notary-agenda__toggle-close { display: none; }
.notary-agenda__toggle:not(.is-collapsed) .notary-agenda__toggle-open { display: none; }
.notary-agenda__toggle:not(.is-collapsed) .notary-agenda__toggle-close { display: inline; }
.notary-agenda__chevron {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}
.notary-agenda__toggle:not(.is-collapsed) .notary-agenda__chevron {
    transform: rotate(-180deg);
}
.notary-agenda__body {
    margin-top: 0.55rem;
}
.notary-agenda__body.d-none { display: none; }
.notary-agenda__field,
.notary-people-edit {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-elevated);
    padding: 0.85rem 1rem;
}
.notary-agenda__field {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.95rem 1.35rem;
}
.notary-info__role,
.notary-person-edit__role {
    margin: 0 0 0.12rem;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.notary-info__name {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--text-primary);
    line-height: 1.3;
}
.notary-info__line {
    margin: 0.18rem 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.notary-info__line a {
    color: inherit;
    text-decoration: none;
}
.notary-info__line a:hover { color: #34a853; }
.notary-info__line i { font-size: 0.78rem; }
.notary-info__line--empty { font-style: italic; opacity: 0.75; }
.notary-agenda__empty {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.notary-people-edit {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.notary-person-edit + .notary-person-edit {
    padding-top: 0.75rem;
    border-top: 1px dashed color-mix(in srgb, var(--border-color) 85%, transparent);
}
.notary-person-edit__head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}
.notary-person-edit__fields {
    display: grid;
    grid-template-columns: 1.15fr 1.2fr 0.85fr;
    gap: 0.4rem;
}
.notary-person-edit .form-control-sm {
    min-height: 2rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.82rem;
}
.notary-person-remove {
    padding: 0;
    line-height: 1;
}
.notary-block-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    font-weight: 650;
    margin: 1.15rem 0 0.65rem;
    color: var(--text-primary);
}
.notary-block-title:first-of-type { margin-top: 0.35rem; }
.notary-block-grid { margin-bottom: 0.25rem; }
.notary-link-col {
    min-width: 9.25rem;
}
.notary-hub .table-card:not(.notary-link-btn) {
    border-color: color-mix(in srgb, #34a853 32%, var(--border-color));
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #34a853 26%, transparent), transparent 62%),
        radial-gradient(90% 70% at 100% 100%, color-mix(in srgb, #34a853 10%, transparent), transparent 55%),
        var(--bg-card);
    box-shadow: 0 0 22px color-mix(in srgb, #34a853 18%, transparent);
}
.notary-hub .table-card:not(.notary-link-btn):hover {
    border-color: color-mix(in srgb, #34a853 48%, var(--border-color));
    box-shadow: 0 0 28px color-mix(in srgb, #34a853 28%, transparent);
}
.notary-link-btn {
    border-color: color-mix(in srgb, #4285f4 32%, var(--border-color));
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #4285f4 26%, transparent), transparent 62%),
        radial-gradient(90% 70% at 100% 100%, color-mix(in srgb, #4285f4 10%, transparent), transparent 55%),
        var(--bg-card);
    box-shadow: 0 0 22px color-mix(in srgb, #4285f4 18%, transparent);
    color: inherit;
}
.notary-link-btn:hover {
    border-color: color-mix(in srgb, #4285f4 48%, var(--border-color));
    box-shadow: 0 0 28px color-mix(in srgb, #4285f4 28%, transparent);
}
@media (max-width: 768px) {
    .notary-agenda__field,
    .notary-person-edit__fields {
        grid-template-columns: 1fr;
    }
}
.notary-add-kind {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}
.notary-add-kind__btn {
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    font-weight: 600;
    font-size: 0.88rem;
}
.notary-add-kind__btn.is-active {
    border-color: #34a853;
    background: color-mix(in srgb, #34a853 12%, var(--bg-card));
    color: #34a853;
}
.notary-add-kind__btn[data-add-kind="link"].is-active {
    border-color: #4285f4;
    background: color-mix(in srgb, #4285f4 14%, var(--bg-card));
    color: #4285f4;
}

.train-ctl__score {
    min-width: 5.5rem;
    text-align: center;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    background: color-mix(in srgb, #2563eb 14%, var(--bg-card));
    border: 1px solid color-mix(in srgb, #2563eb 28%, var(--border-color));
}
.train-ctl__score strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1.1;
    color: #60a5fa;
}
.train-ctl__score span {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.train-ctl__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 1rem;
}
.train-ctl__toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.train-ctl-type {
    display: flex;
    gap: 0.45rem;
}
.train-ctl-type__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    font-size: 0.9rem;
}
.train-ctl-type__btn i {
    color: var(--track-accent, #2563eb);
}
.train-ctl-type__btn.is-active {
    border-color: var(--track-accent, #2563eb);
    background: color-mix(in srgb, var(--track-accent, #2563eb) 14%, var(--bg-card));
    color: var(--track-accent, #2563eb);
}
.train-ctl-type__btn.is-locked,
.train-ctl-type__btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    text-decoration: line-through;
}
.train-ctl-chart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}
.train-ctl__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
    align-items: start;
}
.train-ctl__grid.is-single {
    grid-template-columns: 1fr;
    max-width: 44rem;
}
.train-ctl-track {
    background: var(--bg-card);
    border: 1px solid color-mix(in srgb, var(--track-accent, #2563eb) 28%, var(--border-color));
    border-radius: 16px;
    padding: 1rem 1.05rem 1.15rem;
    box-shadow: 0 0 22px color-mix(in srgb, var(--track-accent, #2563eb) 10%, transparent);
}
.train-ctl-track__head {
    margin-bottom: 0.85rem;
}
.train-ctl-track__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.train-ctl-track__title i {
    font-size: 1.2rem;
    color: var(--track-accent, #2563eb);
}
.train-ctl-track__title h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.train-ctl-track__bar {
    height: 6px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--track-accent, #2563eb) 16%, var(--bg-elevated));
    overflow: hidden;
}
.train-ctl-track__bar span {
    display: block;
    height: 100%;
    background: var(--track-accent, #2563eb);
    border-radius: 99px;
    transition: width 0.2s ease;
}
.train-ctl-track__head small {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.train-ctl-phase {
    margin: 0.85rem 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--track-accent, #2563eb);
}
.train-ctl-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.train-ctl-list li + li {
    margin-top: 0.35rem;
}
.train-ctl-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.5rem 0.55rem;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
}
.train-ctl-item:hover {
    background: color-mix(in srgb, var(--track-accent, #2563eb) 8%, var(--bg-elevated));
}
.train-ctl-item.is-done span {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}
.train-ctl-check {
    margin-top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--track-accent, #2563eb);
    flex-shrink: 0;
}
.train-ctl-item span {
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--text-primary);
}
.train-ctl-card {
    border-color: color-mix(in srgb, var(--card-color, #2563eb) 32%, var(--border-color));
}
.train-ctl-card__bar {
    height: 5px;
    margin: 0 0.85rem 0.55rem;
    border-radius: 99px;
    background: color-mix(in srgb, var(--card-color, #2563eb) 16%, var(--bg-elevated));
    overflow: hidden;
}
.train-ctl-card__bar span {
    display: block;
    height: 100%;
    background: var(--card-color, #2563eb);
}
@media (max-width: 900px) {
    .train-ctl__grid {
        grid-template-columns: 1fr;
    }
}

.train-fmt-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: start;
}
.train-fmt-col {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 0.8rem 0.85rem;
}
.train-fmt-col h6 {
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.train-fmt-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.train-fmt-item {
    display: flex;
    gap: 0.35rem;
    align-items: flex-start;
}
.train-fmt-item textarea {
    flex: 1;
    min-height: 3.4rem;
    resize: vertical;
}
.train-fmt-item__ops {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.train-fmt-add {
    margin-top: 0.55rem;
    width: 100%;
}
@media (max-width: 900px) {
    .train-fmt-cols {
        grid-template-columns: 1fr;
    }
}

.fmt-hub {
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 1fr);
    gap: 1rem;
    min-height: 26rem;
    align-items: start;
}
.fmt-hub__nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-right: 1px solid var(--border-color);
    padding-right: 0.75rem;
    max-height: 32rem;
    overflow: auto;
}
.fmt-hub__legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.fmt-hub__swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    border: 2px solid currentColor;
    vertical-align: -0.05rem;
    margin-right: 0.2rem;
}
.fmt-hub__swatch--builtin {
    color: #34a853;
    background: color-mix(in srgb, #34a853 22%, transparent);
}
.fmt-hub__swatch--custom {
    color: #2563eb;
    background: color-mix(in srgb, #2563eb 22%, transparent);
}
.fmt-hub__row {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
}
.fmt-hub__row .fmt-hub__item {
    flex: 1;
    min-width: 0;
}
.fmt-hub__del {
    flex: 0 0 auto;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: #dc2626;
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    line-height: 1;
}
.fmt-hub__del:hover {
    background: color-mix(in srgb, #dc2626 12%, var(--bg-card));
}
.fmt-hub__item {
    text-align: left;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
}
.fmt-hub__item--builtin {
    border-color: #34a853;
    border-width: 2px;
}
.fmt-hub__item--builtin.is-active {
    border-color: #34a853;
    background: color-mix(in srgb, #34a853 14%, var(--bg-card));
}
.fmt-hub__item--custom {
    border-color: #2563eb;
    border-width: 2px;
}
.fmt-hub__item--custom.is-active {
    border-color: #2563eb;
    background: color-mix(in srgb, #2563eb 14%, var(--bg-card));
}
.fmt-hub__item strong {
    display: block;
    font-size: 0.84rem;
}
.fmt-hub__item small {
    color: var(--text-muted);
    font-size: 0.72rem;
}
.fmt-hub__item--new {
    border-style: dashed;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.fmt-hub__section {
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0.35rem 0 0.5rem;
}
@media (max-width: 800px) {
    .fmt-hub {
        grid-template-columns: 1fr;
    }
    .fmt-hub__nav {
        border-right: 0;
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
        padding-right: 0;
    }
}
