/* =====================================================================
   Sistema ARRENDAMIENTOS — 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;
    }
}
