/*-----------------------------------------------------------------------------
 Archivo: app.css
 Proposito: Estilos globales base para la app multi-tenant HMLR.
-----------------------------------------------------------------------------*/

:root {
    --hmlr-primary: #0d6efd;
    --hmlr-sidebar-bg: #102033;
    --hmlr-sidebar-text: #dbe7f3;
    --hmlr-sidebar-active: #ffffff;
    --hmlr-body-bg: #f5f7fb;
    --hmlr-border: #dee2e6;
    --hmlr-sidebar-width: 270px;
    --hmlr-content-gutter: clamp(0.75rem, 2vw, 1.5rem);
}

html,
body {
    min-height: 100%;
    background: var(--hmlr-body-bg);
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--hmlr-body-bg);
}

.sidebar {
    width: var(--hmlr-sidebar-width);
    flex: 0 0 var(--hmlr-sidebar-width);
    min-height: 100vh;
    color: var(--hmlr-sidebar-text);
    background: var(--hmlr-sidebar-bg);
    position: sticky;
    top: 0;
    align-self: flex-start;
    z-index: 1020;
}

    .sidebar .nav {
        padding: 1rem 0.75rem;
    }

    .sidebar .nav-link {
        color: var(--hmlr-sidebar-text);
        border-radius: 0.5rem;
        margin-bottom: 0.25rem;
        padding: 0.65rem 0.75rem;
    }

        .sidebar .nav-link:hover {
            color: var(--hmlr-sidebar-active);
            background: rgba(255, 255, 255, 0.08);
        }

        .sidebar .nav-link.active {
            color: var(--hmlr-sidebar-active);
            background: rgba(255, 255, 255, 0.16);
            font-weight: 600;
        }

    .sidebar .material-icons,
    .sidebar .material-symbols-outlined {
        font-size: 1.25rem;
    }

main {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.card {
    border-color: var(--hmlr-border);
}

.btn .material-icons,
.btn .material-symbols-outlined,
.nav-link .material-icons,
.nav-link .material-symbols-outlined {
    vertical-align: middle;
}

.hmlr-material-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.content .container,
.content .container-fluid {
    max-width: 100%;
}

.content .card,
.content .alert,
.content form {
    min-width: 0;
}

.content .table-responsive {
    border-radius: 0.85rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.content .table {
    margin-bottom: 0;
    vertical-align: middle;
}

.content .table th {
    white-space: nowrap;
}

.content .table td {
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .page {
        flex-direction: column;
        min-height: 100dvh;
    }

    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        min-height: auto;
        position: sticky;
        top: 0;
        box-shadow: 0 0.75rem 1.5rem rgba(16, 32, 51, 0.16);
    }

        .sidebar .nav {
            flex-direction: row !important;
            gap: 0.35rem;
            overflow-x: auto;
            overflow-y: visible;
            white-space: nowrap;
            scrollbar-width: thin;
            padding: 0.75rem;
            scroll-snap-type: x proximity;
        }

        .sidebar .nav-link {
            scroll-snap-align: start;
            margin-bottom: 0;
        }

    main {
        width: 100%;
        overflow-x: auto;
    }

    .content {
        padding-left: var(--hmlr-content-gutter) !important;
        padding-right: var(--hmlr-content-gutter) !important;
    }

    .content .row {
        --bs-gutter-x: 0.85rem;
    }

    .content .card-body {
        padding: 1rem;
    }

    .content .d-flex:has(> .btn),
    .content .btn-toolbar,
    .content .btn-group {
        flex-wrap: wrap;
    }

    .content .table {
        min-width: 760px;
        font-size: 0.9rem;
    }

    .content .table-responsive {
        margin-inline: -0.15rem;
        padding-bottom: 0.25rem;
    }
}

@media (max-width: 575.98px) {
    .sidebar .border-bottom {
        padding: 0.85rem !important;
    }

        .sidebar .border-bottom h5 {
            font-size: 1rem;
        }

        .sidebar .border-bottom small {
            display: block;
            max-width: 18rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .content {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .content h1,
    .content .h1 {
        font-size: 1.65rem;
    }

    .content h2,
    .content .h2 {
        font-size: 1.35rem;
    }

    .content .card-header,
    .content .card-body {
        padding: 0.85rem;
    }

    .content .btn {
        max-width: 100%;
        white-space: normal;
    }

    .content .table {
        min-width: 680px;
        font-size: 0.85rem;
    }
}
