/* Restaura botones Bootstrap y aplica el color principal elegido. */
:root {
    --regadix-primary: #0d9488;
    --regadix-primary-rgb: 13 148 136;
    --regadix-primary-hover: #0f766e;
    --regadix-primary-hover-rgb: 15 118 110;
    --regadix-sidebar: #0d9488;
    --regadix-sidebar-rgb: 13 148 136;
    --regadix-sidebar-hover: #0f766e;
    --regadix-sidebar-hover-rgb: 15 118 110;
    --regadix-sidebar-active: #115e59;
    --regadix-sidebar-active-rgb: 17 94 89;
    --regadix-sidebar-text: #ecfdf5;
    --regadix-sidebar-text-rgb: 236 253 245;
    --regadix-sidebar-muted: #99f6e4;
    --regadix-sidebar-muted-rgb: 153 246 228;
}

.regadix-sidebar-panel {
    background-color: var(--regadix-sidebar) !important;
    color: var(--regadix-sidebar-text) !important;
}

.bo-nav-active {
    background-color: var(--regadix-sidebar-active) !important;
    color: #fff !important;
}

.bo-nav-idle {
    color: var(--regadix-sidebar-text) !important;
}

.bo-nav-idle:hover {
    background-color: var(--regadix-sidebar-hover) !important;
    color: #fff !important;
}

.bo-btn-brand {
    background-color: var(--regadix-primary) !important;
    color: #fff !important;
}

.bo-btn-brand:hover {
    background-color: var(--regadix-primary-hover) !important;
}

.btn-primary,
.btn-info,
.btn-success {
    background-color: var(--regadix-primary) !important;
    border-color: var(--regadix-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-info:hover,
.btn-info:focus,
.btn-success:hover,
.btn-success:focus {
    background-color: var(--regadix-primary-hover) !important;
    border-color: var(--regadix-primary-hover) !important;
    color: #fff !important;
}

.btn-danger {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #fff !important;
}

.btn-warning {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: #fff !important;
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: #b45309 !important;
    border-color: #b45309 !important;
    color: #fff !important;
}

.btn-secondary {
    background-color: #64748b !important;
    border-color: #64748b !important;
    color: #fff !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #475569 !important;
    border-color: #475569 !important;
    color: #fff !important;
}

.text-regadix-primary {
    color: var(--regadix-primary) !important;
}

.hover\:text-regadix-primary-hover:hover {
    color: var(--regadix-primary-hover) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--regadix-primary) !important;
    box-shadow: 0 0 0 0.2rem rgb(var(--regadix-primary-rgb) / 0.25) !important;
}

.pagination .page-item.active .page-link {
    background-color: var(--regadix-primary);
    border-color: var(--regadix-primary);
}

.pagination .page-link {
    color: var(--regadix-primary);
}

h2,
label {
    color: var(--regadix-primary-hover);
}

.page-header {
    border-bottom-color: var(--regadix-primary) !important;
}

.bo-theme-switch {
    position: relative;
}

.bo-theme-switch > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #ecfdf5;
    background: transparent;
}

.bo-theme-switch > summary::-webkit-details-marker {
    display: none;
}

.bo-theme-switch > summary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bo-theme-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.15);
    flex-shrink: 0;
}

.bo-theme-panel {
    position: absolute;
    z-index: 60;
    bottom: calc(100% + 4px);
    left: 0;
    width: 248px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 25px rgb(15 23 42 / 0.15);
}

.bo-theme-title {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.bo-theme-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.bo-theme-preset {
    display: block;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    margin: 0 auto;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px #cbd5e1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.bo-theme-preset:hover {
    transform: scale(1.06);
}

.bo-theme-preset.is-selected {
    box-shadow: 0 0 0 2px #1e293b;
}

.bo-theme-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
}

.bo-theme-custom span {
    flex-shrink: 0;
    font-size: 12px;
    color: #64748b;
}

.bo-theme-custom input[type='color'] {
    width: 100%;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.bo-theme-reset {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--regadix-primary);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.bo-theme-reset:hover {
    background: #f1f5f9;
}

.bo-dash {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.bo-dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.bo-dash-year {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 11rem;
}

.bo-dash-year label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.bo-dash-year select {
    min-height: 42px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.bo-dash-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.bo-dash-kpi {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    min-height: 132px;
    padding: 1.2rem 1.3rem;
    border: 1px solid #e2e8f0;
    border-radius: 1.1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 28px rgb(15 23 42 / 0.05);
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.bo-dash-kpi:hover,
.bo-dash-kpi:focus {
    transform: translateY(-3px);
    border-color: rgb(var(--regadix-primary-rgb) / 0.35);
    box-shadow: 0 16px 32px rgb(15 23 42 / 0.1);
    color: inherit;
    text-decoration: none;
}

.bo-dash-kpi-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
}

.bo-dash-kpi-icon svg {
    width: 22px;
    height: 22px;
}

.bo-dash-kpi-icon--ok {
    background: #ecfdf5;
    color: #059669;
}

.bo-dash-kpi-icon--brand {
    background: rgb(var(--regadix-primary-rgb) / 0.12);
    color: var(--regadix-primary-hover);
}

.bo-dash-kpi-icon--warn {
    background: #fef2f2;
    color: #dc2626;
}

.bo-dash-kpi-label {
    display: block;
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #64748b;
}

.bo-dash-kpi-value {
    display: block;
    margin-top: 6px;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #0f172a;
}

.bo-dash-kpi-value--ok { color: #047857; }
.bo-dash-kpi-value--brand { color: var(--regadix-primary-hover); }
.bo-dash-kpi-value--warn { color: #b91c1c; }

.bo-dash-kpi-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
}

.bo-dash-water {
    padding: 1.4rem 1.5rem 1.55rem;
    border: 1px solid rgb(var(--regadix-primary-rgb) / 0.18);
    border-radius: 1.2rem;
    background:
        radial-gradient(circle at 100% 0, rgb(var(--regadix-primary-rgb) / 0.14), transparent 42%),
        linear-gradient(180deg, #fff, #f8fafc);
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 14px 32px rgb(15 23 42 / 0.06);
}

.bo-dash-water-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.15rem;
}

.bo-dash-water-period,
.bo-dash-water-source {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
}

.bo-dash-meters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.bo-dash-meter {
    padding: 1.1rem 1.15rem 1.2rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.86);
    color: inherit;
    text-decoration: none;
}

a.bo-dash-meter:hover,
a.bo-dash-meter:focus {
    border-color: rgb(var(--regadix-primary-rgb) / 0.35);
    color: inherit;
    text-decoration: none;
}

.bo-dash-meter-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bo-dash-meter h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.bo-dash-meter-hero {
    margin: 10px 0 0;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--regadix-primary-hover);
}

.bo-dash-meter-hero.is-over {
    color: #b91c1c;
}

.bo-dash-bar {
    margin-top: 14px;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.bo-dash-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--regadix-primary), var(--regadix-primary-hover));
}

.bo-dash-bar-fill.is-over {
    background: linear-gradient(90deg, #f59e0b, #dc2626);
}

.bo-dash-meter-scale {
    margin: 8px 0 0;
    font-size: 12px;
    color: #64748b;
}

.bo-dash-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.bo-dash-badge--over {
    background: #fef2f2;
    color: #b91c1c;
}

@media (max-width: 1100px) {
    .bo-dash-meters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .bo-dash-kpis {
        grid-template-columns: 1fr;
    }
}
