/* =====================================================================
   Sistema MOTEL — hoja de estilo del panel
   Bootstrap 5.3 + layout propio
   ===================================================================== */

:root {
    --arr-sidebar-ancho: 264px;
    --arr-sidebar-bg: #0f2f2a;
    --arr-sidebar-bg-hover: rgba(255, 255, 255, .10);
    --arr-sidebar-activo: #1e9e6a;
    --arr-sidebar-texto: rgba(255, 255, 255, .82);
    --arr-navbar-alto: 58px;
    --arr-fondo: #f2f4f7;
    --arr-borde: #e3e7ec;
}

body {
    background: var(--arr-fondo);
    font-size: .925rem;
}

/* ============================ LAYOUT ============================ */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--arr-sidebar-ancho);
    background: var(--arr-sidebar-bg);
    color: var(--arr-sidebar-texto);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .2s ease;
}

.app-main {
    margin-left: var(--arr-sidebar-ancho);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease;
}

.app-navbar {
    height: var(--arr-navbar-alto);
    background: #fff;
    border-bottom: 1px solid var(--arr-borde);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-contenido {
    flex: 1;
    padding: 1.25rem;
}

/* Sidebar plegado en escritorio */

body.sidebar-oculto .app-sidebar {
    transform: translateX(-100%);
}

body.sidebar-oculto .app-main {
    margin-left: 0;
}

@media (max-width: 991.98px) {

    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-main {
        margin-left: 0;
    }

    body.sidebar-visible .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-visible .app-backdrop {
        display: block;
    }
}

.app-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1035;
}

/* ============================ MARCA ============================ */

.app-marca {
    display: flex;
    align-items: center;
    gap: .6rem;
    height: var(--arr-navbar-alto);
    padding: 0 1rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    flex-shrink: 0;
}

.app-marca:hover {
    color: #fff;
}

.app-marca i {
    font-size: 1.35rem;
    color: var(--arr-sidebar-activo);
}

.app-marca span {
    font-weight: 600;
    letter-spacing: .3px;
}

/* ============================ USUARIO ============================ */

.app-usuario {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    flex-shrink: 0;
}

.app-usuario .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--arr-sidebar-activo);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.app-usuario .datos {
    min-width: 0;
}

.app-usuario .datos strong {
    display: block;
    color: #fff;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-usuario .datos small {
    color: rgba(255, 255, 255, .60);
    font-size: .75rem;
}

/* ============================ MENU ============================ */

.app-menu {
    overflow-y: auto;
    padding: .75rem .6rem 1.5rem;
    flex: 1;
}

.app-menu a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    margin-bottom: 2px;
    border-radius: .45rem;
    color: var(--arr-sidebar-texto);
    text-decoration: none;
    font-size: .9rem;
}

.app-menu a:hover {
    background: var(--arr-sidebar-bg-hover);
    color: #fff;
}

.app-menu a.activo {
    background: var(--arr-sidebar-activo);
    color: #fff;
    font-weight: 500;
}

.app-menu i {
    width: 18px;
    text-align: center;
    font-size: 1rem;
}

.app-menu .flecha {
    margin-left: auto;
    font-size: .75rem;
    transition: transform .2s ease;
}

.app-menu a[aria-expanded="true"] .flecha {
    transform: rotate(90deg);
}

.app-menu .submenu {
    list-style: none;
    padding: 0 0 0 1.35rem;
    margin: 0;
}

.app-menu .submenu a {
    font-size: .86rem;
    padding: .45rem .7rem;
}

.app-menu::-webkit-scrollbar {
    width: 6px;
}

.app-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .25);
    border-radius: 10px;
}

/* ============================ TARJETAS ============================ */

.card {
    border: 1px solid var(--arr-borde);
    border-radius: .6rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--arr-borde);
    font-weight: 600;
    padding: .85rem 1rem;
}

.tarjeta-indicador .valor {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.1;
}

.tarjeta-indicador .icono {
    width: 46px;
    height: 46px;
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

/* ============================ TABLAS ============================ */

table.dataTable thead th {
    background: #f8fafc;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #5b6472;
    white-space: nowrap;
}

table.dataTable tbody td {
    vertical-align: middle;
}

div.dt-container .dt-length select,
div.dt-container .dt-search input {
    display: inline-block;
    width: auto;
}

.acciones .btn {
    padding: .2rem .45rem;
    line-height: 1;
}

/* ============================ LOGIN ============================ */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2f2a 0%, #1e9e6a 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: .75rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .25);
}

.login-card .icono {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #0f2f2a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    margin: 0 auto 1rem;
}

/* ============================ INFORMES / IMPRESIÓN ============================ */

.tarjeta-informe .valor {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.15;
}

@media print {

    .app-sidebar,
    .app-navbar,
    .app-backdrop,
    footer,
    .no-imprimir,
    .dt-length,
    .dt-search,
    .dt-paging,
    .dt-info {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .app-contenido {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    table.dataTable {
        width: 100% !important;
    }
}

/* ============================ TABLERO DE HABITACIONES ============================ */

.tablero {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.hab {
    position: relative;
    border-radius: .85rem;
    padding: 1rem 1rem .85rem;
    color: #fff;
    cursor: pointer;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(15, 47, 42, .12);
    transition: transform .12s ease, box-shadow .12s ease;
    user-select: none;
}

.hab:hover,
.hab:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 47, 42, .22);
    outline: none;
}

.hab .hab-nombre {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.hab .hab-clase {
    font-size: .75rem;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.hab .hab-estado {
    margin-top: auto;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.hab .hab-tiempo {
    font-variant-numeric: tabular-nums;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: .35rem;
}

.hab .hab-icono {
    position: absolute;
    top: .75rem;
    right: .85rem;
    font-size: 1.35rem;
    opacity: .9;
}

.hab .hab-extra {
    font-size: .78rem;
    opacity: .92;
}

.hab-disponible { background: linear-gradient(135deg, #1e9e6a, #17855a); }
.hab-ocupado    { background: linear-gradient(135deg, #d63a4a, #b52a3a); }
.hab-detenido   { background: linear-gradient(135deg, #e8833a, #cc6a24); }
.hab-limpiando  { background: linear-gradient(135deg, #b0418f, #8f2f74); }

.hab-excedido .hab-tiempo {
    animation: parpadeo 1.2s ease-in-out infinite;
}

@keyframes parpadeo {
    50% { opacity: .45; }
}

.leyenda-estado {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--bs-secondary-color);
}

.leyenda-estado .punto {
    width: .8rem;
    height: .8rem;
    border-radius: 50%;
    display: inline-block;
}

/* Panel de operación de una habitación */

.panel-total {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.lista-productos {
    position: absolute;
    z-index: 1060;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
}

.btn-modo.active {
    font-weight: 600;
}

/* ============================ TICKET 80 MM ============================ */

.ticket {
    width: 72mm;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #000;
}

.ticket hr {
    border: 0;
    border-top: 1px dashed #000;
    margin: 6px 0;
    opacity: 1;
}

.ticket table {
    width: 100%;
    border-collapse: collapse;
}

.ticket td {
    padding: 1px 0;
    vertical-align: top;
}

@media print {

    @page {
        margin: 4mm;
    }

    .ticket-acciones {
        display: none !important;
    }
}
