/* ===== OptiWeb - estilos generales ===== */
html, body { font-family: 'Segoe UI', sans-serif; }

#blazor-error-ui {
    background: #ffc;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.tabla-receta th { font-size: 0.85rem; text-align: center; vertical-align: middle; }
.tabla-receta td { text-align: center; vertical-align: middle; }

/* Validation messages helper */
.validation-message { color: #dc3545; font-size: .875em; }

.opti-navbar .container-fluid {
    gap: 1rem;
}

.opti-menu-btn {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
}

.opti-desktop-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-right: auto;
}

.opti-desktop-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.opti-desktop-user span {
    white-space: nowrap;
}

.opti-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, .45);
}

.opti-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    width: min(20rem, 86vw);
    padding: 1rem;
    color: #fff;
    background: #0d6efd;
    box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .35);
}

.opti-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.opti-sidebar-nav {
    display: grid;
    gap: .5rem;
    padding: 1rem 0;
}

.opti-sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .8rem;
    color: #fff;
    text-decoration: none;
    border-radius: .375rem;
}

.opti-sidebar-link:hover,
.opti-sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .18);
}

.opti-sidebar-user {
    display: grid;
    gap: .25rem;
    padding: 1rem 0;
    overflow-wrap: anywhere;
    border-top: 1px solid rgba(255, 255, 255, .25);
}

.report-kpi {
    min-height: 4.5rem;
    padding: .75rem;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    background: #f8f9fa;
}

.report-kpi div {
    color: #6c757d;
    font-size: .875rem;
}

.report-kpi strong {
    display: block;
    margin-top: .25rem;
    font-size: 1.25rem;
}

.md-field {
    position: relative;
}

.md-field .form-control {
    height: 2.5rem;
    padding: 1rem .75rem .35rem .75rem;
    background-color: #fff;
}

.md-field.md-field-sm .form-control {
    height: 2rem;
    padding: .8rem .5rem .2rem .5rem;
    font-size: .875rem;
}

.md-field label {
    position: absolute;
    top: 50%;
    left: .65rem;
    z-index: 2;
    max-width: calc(100% - 1.3rem);
    padding: 0 .25rem;
    color: #6c757d;
    line-height: 1;
    pointer-events: none;
    background: #fff;
    transform: translateY(-50%);
    transform-origin: left center;
    transition: transform .12s ease, top .12s ease, color .12s ease, font-size .12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-field.md-field-sm label {
    left: .4rem;
    font-size: .875rem;
}

.md-field .form-control:focus + label,
.md-field .form-control:not(:placeholder-shown) + label {
    top: 0;
    color: #0d6efd;
    font-size: .75rem;
    transform: translateY(-50%);
}

.md-field.md-field-sm .form-control:focus + label,
.md-field.md-field-sm .form-control:not(:placeholder-shown) + label {
    font-size: .7rem;
}

.report-modal-dialog {
    max-width: min(1180px, 96vw);
}

.report-modal-content {
    height: 92vh;
}

.report-modal-content .modal-body {
    min-height: 0;
}

.report-modal-frame {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: 0;
    background: #e9ecef;
}

@media (max-width: 991.98px) {
    .opti-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .opti-desktop-nav,
    .opti-desktop-user {
        display: none;
    }
}

@media (min-width: 992px) {
    .opti-sidebar,
    .opti-sidebar-backdrop {
        display: none;
    }
}

/* No-print */
@media print {
    .no-print { display: none !important; }
    main.container-fluid { margin-top: 0 !important; }
    .reporte-print-area { font-size: 11px; }
    .reporte-print-area .table-dark th {
        color: #000 !important;
        background: #e9ecef !important;
        border-color: #adb5bd !important;
    }
    .reporte-print-area .table {
        border-color: #adb5bd !important;
    }
}
