@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;900&display=swap');

html, body {
    font-family: 'Montserrat', sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TD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3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Tablas y grids unificados: mismo estilo que Group Users by Grupo (TreeGrid) */
.app-table-wrap {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.app-table {
    margin-bottom: 0;
    border-collapse: collapse;
    width: 100%;
    font-size: 0.875rem;
}

.app-table th,
.app-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

.app-table thead th {
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
}

.app-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.app-table tbody tr td {
    background-color: #fff;
}

/* Fila de filtros: mismo tono que header */
.app-table .table-light th,
.app-table .table-light td {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Botones en tablas: mismo estilo que TreeGrid (btn-sm btn-primary, btn-secondary, btn-success, btn-danger) */
.app-table .btn {
    font-size: 0.8125rem;
}

/* Dark mode en toda la solución */
body.e-dark,
body.e-dark .page,
body.e-dark main {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.e-dark .top-row {
    background-color: #2d2d2d;
    border-bottom-color: #404040;
}

body.e-dark .sidebar {
    background-image: linear-gradient(180deg, #1a1a2e 0%, #16213e 70%);
}

/* Welcome usuario logueado en el menú */
.nav-item-welcome {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 0.25rem;
}

.nav-welcome-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

body.e-dark .nav-welcome-text {
    color: rgba(255, 255, 255, 0.9);
}

body.e-dark .content,
body.e-dark article {
    background-color: #1e1e1e;
}

body.e-dark .text-muted {
    color: #a0a0a0 !important;
}

body.e-dark .app-table-wrap {
    background: #2d2d2d;
    border-color: #404040;
}

body.e-dark .table,
body.e-dark .app-table {
    --bs-table-bg: #2d2d2d;
    --bs-table-border-color: #404040;
    --bs-table-striped-bg: #353535;
    --bs-table-hover-bg: #383838;
    color: #e0e0e0 !important;
}

body.e-dark .app-table th,
body.e-dark .app-table td {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.e-dark .table td,
body.e-dark .table th,
body.e-dark .app-table td,
body.e-dark .app-table th {
    color: #ffffff !important;
}

body.e-dark .table-secondary,
body.e-dark .table-secondary > th {
    background-color: #383838 !important;
    color: #ffffff !important;
    border-color: #404040;
}

body.e-dark .table-light,
body.e-dark .table-light td,
body.e-dark .table-light th {
    background-color: #353535 !important;
    color: #ffffff !important;
}

body.e-dark .table-success,
body.e-dark .table-success td,
body.e-dark .table-success th {
    background-color: #1e4620 !important;
    color: #ffffff !important;
}

/* Syncfusion TreeGrid / Grid en dark mode - texto blanco en celdas */
body.e-dark .e-treegrid .e-cell,
body.e-dark .e-treegrid .e-headercell,
body.e-dark .e-treegrid .e-rowcell,
body.e-dark .e-grid .e-cell,
body.e-dark .e-grid .e-headercell,
body.e-dark .e-grid .e-rowcell,
body.e-dark [class*="e-treegrid"] .e-cell,
body.e-dark [class*="e-treegrid"] .e-headercell,
body.e-dark [class*="e-treegrid"] .e-rowcell {
    color: #ffffff !important;
}

body.e-dark .form-control,
body.e-dark .form-select {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.e-dark .form-control:focus,
body.e-dark .form-select:focus {
    background-color: #2d2d2d;
    border-color: #0d6efd;
    color: #e0e0e0;
}

body.e-dark .nav-tabs .nav-link {
    color: #a0a0a0;
}

body.e-dark .nav-tabs .nav-link.active {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.e-dark .modal-content {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.e-dark .modal-header {
    border-bottom-color: #404040;
}

body.e-dark .modal-footer {
    border-top-color: #404040;
}

body.e-dark .btn-close {
    filter: invert(1);
}

/* Home: logo de fondo difuminado + KPIs */
.home-hero {
    position: relative;
    min-height: calc(100vh - 5rem);
    padding: 1.5rem 1.5rem 2rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-top: -1.1rem;
    padding-top: calc(1.1rem + 1.5rem);
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background-color: #fff;
}

.home-hero-bg img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72%;
    height: 72%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    object-position: center;
    filter: blur(16px);
    opacity: 0.38;
}

.home-hero-content {
    position: relative;
    z-index: 1;
}

.home-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.home-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.home-kpis {
    max-width: 900px;
}

.home-kpi-card {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.home-kpi-card .card-body {
    padding: 1rem 1.25rem;
}

.home-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1b6ec2;
}

.home-kpi-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

body.e-dark .home-hero-bg {
    background-color: #1e1e1e;
}

body.e-dark .home-hero-bg img {
    opacity: 0.28;
}

body.e-dark .home-kpi-card {
    background-color: #2d2d2d;
    border-color: #404040;
    box-shadow: none;
}

body.e-dark .home-kpi-value {
    color: #6ea8fe;
}

body.e-dark .home-kpi-label {
    color: #a0a0a0;
}

/* Home: gráficas */
.home-chart-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 900px;
}

@media (max-width: 768px) {
    .home-chart-section {
        grid-template-columns: 1fr;
    }
}

.home-chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #212529;
}

.home-bar-section {
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
    min-width: 0;
}

.home-bar-chart {
    padding: 0;
}

.home-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.home-bar-row:last-child {
    margin-bottom: 0;
}

.home-bar-label {
    flex: 0 0 110px;
    font-size: 0.8rem;
    color: #495057;
}

.home-bar-track {
    flex: 1;
    height: 1.25rem;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.home-bar-fill {
    height: 100%;
    border-radius: 6px;
    min-width: 4%;
    transition: width 0.5s ease-out;
}

.home-bar-fill-1 { background: linear-gradient(90deg, #1b6ec2, #0d6efd); }
.home-bar-fill-2 { background: linear-gradient(90deg, #198754, #20c997); }
.home-bar-fill-3 { background: linear-gradient(90deg, #6f42c1, #0d6efd); }
.home-bar-fill-4 { background: linear-gradient(90deg, #fd7e14, #ffc107); }

.home-bar-value {
    flex: 0 0 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1b6ec2;
    text-align: right;
}

.home-pie-section {
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
}

.home-pie-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.home-pie {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    flex-shrink: 0;
}

.home-pie-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.home-pie-legend-item {
    font-size: 0.85rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-pie-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

body.e-dark .home-chart-title {
    color: #e0e0e0;
}

body.e-dark .home-bar-section,
body.e-dark .home-pie-section {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.e-dark .home-bar-label,
body.e-dark .home-pie-legend-item {
    color: #c0c0c0;
}

body.e-dark .home-bar-track {
    background: #404040;
}

body.e-dark .home-bar-value {
    color: #6ea8fe;
}