
/* =====================================================
   TODO LIMPIO - LAVANDERÍA
   Hoja de estilos principal
   Blazor WebAssembly
===================================================== */

/* ================= VARIABLES ================= */

:root {
    --tl-azul: #082b91;
    --tl-azul-oscuro: #061e68;
    --tl-azul-medio: #1645b8;
    --tl-azul-brillante: #2563eb;
    --tl-azul-claro: #eaf0ff;
    --tl-blanco: #ffffff;
    --tl-fondo: #f1f5fb;
    --tl-texto: #24324b;
    --tl-texto-secundario: #64748b;
    --tl-borde: #dce5f3;
    --tl-sombra: 0 4px 16px rgba(8, 43, 145, .08);
    --tl-radio: 12px;
}

/* ================= BASE ================= */

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--tl-fondo);
    color: var(--tl-texto);
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--tl-azul-brillante);
}

    a:hover {
        color: var(--tl-azul-oscuro);
    }

/* ================= ESTRUCTURA PRINCIPAL ================= */

.page {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--tl-fondo);
}

/* ================= BARRA LATERAL ================= */

.app-sidebar {
    width: 250px !important;
    min-width: 250px !important;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--tl-azul) !important;
    border: none !important;
    box-shadow: 3px 0 18px rgba(0, 0, 0, .12);
    z-index: 10;
}

/* Zona del logo */

.sidebar-brand {
    min-height: 125px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px 14px;
    background: var(--tl-blanco) !important;
    border-bottom: 4px solid var(--tl-azul-brillante);
}

.sidebar-logo {
    display: block;
    max-width: 215px;
    max-height: 95px;
    width: 100%;
    object-fit: contain;
}

/* ================= MENÚ ================= */

.tl-menu {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - 125px);
    padding: 12px 0 18px;
    background: var(--tl-azul) !important;
}

/* Información del usuario */

.tl-user {
    margin: 8px 14px 20px;
    padding: 15px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .10) !important;
    border: 1px solid rgba(255, 255, 255, .15);
}

.tl-user-name {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tl-user-role {
    color: #93c5fd !important;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: 1px;
}

/* Enlaces */

.tl-navigation {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 12px;
}

.app-sidebar .tl-navigation .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    margin: 0;
    border-radius: 9px;
    color: #e4edff !important;
    background: transparent !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .2s ease, color .2s ease;
}

.tl-navigation .nav-link span {
    font-size: 18px;
    min-width: 22px;
}

.app-sidebar .tl-navigation .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .14) !important;
}

.app-sidebar .tl-navigation .nav-link.active {
    color: #ffffff !important;
    background: var(--tl-azul-brillante) !important;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
}

/* Cerrar sesión */

.tl-logout {
    margin: auto 14px 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

    .tl-logout button {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
        color: #fecaca !important;
        background: rgba(220, 38, 38, .10) !important;
        border: 1px solid rgba(248, 113, 113, .4);
        border-radius: 9px;
        font-size: 13px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        transition: background .2s ease;
    }

        .tl-logout button:hover {
            color: #ffffff !important;
            background: #dc2626 !important;
        }

/* ================= CONTENIDO PRINCIPAL ================= */

.app-main {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    overflow-x: auto;
    background: var(--tl-fondo) !important;
}

.app-content {
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    color: var(--tl-texto);
}

/* ================= TARJETAS ================= */

.card {
    background: #ffffff;
    border: 1px solid var(--tl-borde);
    border-radius: var(--tl-radio);
    box-shadow: var(--tl-sombra);
}

.card-header {
    background: var(--tl-azul-claro);
    color: var(--tl-azul-oscuro);
    border-bottom: 1px solid var(--tl-borde);
    font-weight: 700;
}

/* ================= BOTONES ================= */

.btn-primary {
    color: #ffffff !important;
    background-color: var(--tl-azul-brillante) !important;
    border-color: var(--tl-azul-brillante) !important;
}

    .btn-primary:hover {
        background-color: var(--tl-azul-oscuro) !important;
        border-color: var(--tl-azul-oscuro) !important;
    }

.btn-outline-primary {
    color: var(--tl-azul) !important;
    border-color: var(--tl-azul) !important;
}

    .btn-outline-primary:hover {
        color: #ffffff !important;
        background-color: var(--tl-azul) !important;
    }

/* ================= FORMULARIOS ================= */

.form-control,
.form-select {
    border: 1px solid var(--tl-borde);
    border-radius: 8px;
    color: var(--tl-texto);
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--tl-azul-brillante);
        box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15);
    }

/* ================= TABLAS ================= */

.table {
    color: var(--tl-texto);
    vertical-align: middle;
}

    .table thead th {
        color: var(--tl-azul-oscuro);
        background: var(--tl-azul-claro);
        border-bottom: 2px solid var(--tl-borde);
    }

    .table tbody tr:hover {
        background: #f4f7ff;
    }

/* ================= ALERTAS ================= */

.alert {
    border-radius: 9px;
}

/* ================= ENLACES Y NAVEGACIÓN BOOTSTRAP ================= */

.nav-tabs {
    border-bottom: 1px solid var(--tl-borde);
}

    .nav-tabs .nav-link {
        color: var(--tl-texto-secundario);
    }

        .nav-tabs .nav-link.active {
            color: var(--tl-azul);
            border-color: var(--tl-borde) var(--tl-borde) #ffffff;
            font-weight: 700;
        }

/* ================= CARGA DE BLAZOR ================= */

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e5e7eb;
        stroke-width: .6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--tl-azul-brillante);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%;
            transition: stroke-dasharray .05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Cargando");
    }

/* ================= ERRORES DE BLAZOR ================= */

#blazor-error-ui {
    background: #fff4ce;
    bottom: 0;
    box-shadow: 0 -1px 4px 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;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffffff;
}

    .blazor-error-boundary::after {
        content: "Ha ocurrido un error.";
    }

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
    .app-sidebar {
        width: 190px !important;
        min-width: 190px !important;
    }

    .sidebar-brand {
        min-height: 110px;
    }

    .sidebar-logo {
        max-width: 165px;
    }

    .tl-menu {
        min-height: calc(100vh - 110px);
    }

    .app-content {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .app-sidebar {
        width: 165px !important;
        min-width: 165px !important;
    }

    .sidebar-logo {
        max-width: 145px;
    }

    .tl-navigation {
        padding: 0 8px;
    }

    .app-sidebar .tl-navigation .nav-link {
        padding: 11px 9px;
        font-size: 12px;
    }

    /* LOGIN - IDENTIDAD TODO LIMPIO */

    .login-layout {
        min-height: 100vh;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 24px;
        background: linear-gradient(135deg, #082b91, #1645b8);
    }

        .login-layout > * {
            width: 100%;
            max-width: 430px;
        }

    .login-logo {
        display: block;
        width: min(260px, 80%);
        max-height: 130px;
        object-fit: contain;
        margin: 0 auto 25px;
    }

}
