/* =============================================
   ACERVO BIBLIOTECA - Estilos principales
   Sistema de Biblioteca FCAV  |  v2.2
   Naranja institucional UAT: #d05f27 (plantilla 2025)
   ============================================= */

:root {
    /* Paleta institucional UAT 2025 (extraida de STT-Kiosco) */
    --orange:       #d05f27;   /* Naranja plantilla 2025 */
    --orange-dk:    #b34e1c;   /* Naranja oscuro */
    --orange-lt:    #fdf0e8;
    --accent-blue:  #003d5c;   /* Azul plantilla 2025 */
    --accent-green: #1e9e6b;

    /* UI */
    --bg:           #f0f4f8;
    --card-bg:      #ffffff;
    --text:         #2d3748;
    --text-light:   #718096;
    --border:       #e2e8f0;
    --shadow:       0 4px 20px rgba(0,0,0,.08);
    --radius-sm:    8px;
    --radius-md:    12px;
    --radius-lg:    16px;
    --transition:   .25s cubic-bezier(.4,0,.2,1);

    /* Sidebar - ahora FLOTANTE */
    --sidebar-w:     240px;
    --header-h:      60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ============================================
   LAYOUT - sin desplazamiento por sidebar
   ============================================ */
.acv-layout {
    display: flex;
    min-height: 100vh;
    /* El main ocupa todo el ancho; el sidebar flota encima */
}

/* ============================================
   SIDEBAR FLOTANTE (overlay)
   ============================================ */
.acv-sidebar {
    width: var(--sidebar-w);
    background: var(--orange);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 300;         /* Por encima del header y contenido */
    transition: transform var(--transition);
    box-shadow: 4px 0 24px rgba(0,0,0,.25);

    /* Decoracion fondo igual que STT */
    overflow: hidden;
}

/* Pseudo-fondo con mural, igual que STT header */
.acv-sidebar::before {
    content: '';
    position: absolute;
    inset: -15px;
    background: url('../images/muralfondo.jpg') center/cover no-repeat;
    filter: blur(5px);
    z-index: -2;
}

.acv-sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        175deg,
        rgba(0,35,55,0.88) 0%,
        rgba(0,35,55,0.78) 30%,
        rgba(208,95,39,0.80) 65%,
        rgba(208,95,39,0.94) 100%
    );
    z-index: -1;
}

/* Sidebar CERRADA: oculta a la izquierda */
.acv-sidebar.collapsed {
    transform: translateX(-100%);
}

/* Overlay oscuro cuando sidebar esta abierta */
.acv-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 299;
    cursor: pointer;
}

.acv-sidebar-overlay.active {
    display: block;
}

/* -- TOP: hamburguesa en sidebar -- */
.acv-sidebar__top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .85rem 0;
    border-bottom: 1px solid rgba(255,255,255,.2);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.acv-hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    padding: .4rem .6rem;
    border-radius: 7px;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.acv-hamburger:hover {
    background: rgba(255,255,255,.2);
}

/* -- NAV ITEMS -- */
.acv-sidebar__nav {
    list-style: none;
    padding: .75rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

.acv-nav-item {
    display: block;
}

.acv-nav-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1.1rem;
    color: rgba(255,255,255,.92);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.acv-nav-link:hover,
.acv-nav-link.active {
    background: rgba(255,255,255,.18);
    color: #fff;
    border-left-color: #fff;
}

.acv-nav-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 1.4rem;
    text-align: center;
}

/* -- FOOTER SIDEBAR: matricula + carrera -- */
.acv-sidebar__footer {
    flex-shrink: 0;
    padding-bottom: .75rem;
    position: relative;
    z-index: 1;
}

.acv-sidebar__sep {
    height: 1px;
    background: rgba(255,255,255,.28);
    margin: 0 .75rem .75rem;
}

.acv-user-card {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .55rem 1rem;
    overflow: hidden;
}

.acv-user-avatar {
    font-size: 1.85rem;
    color: rgba(255,255,255,.85);
    flex-shrink: 0;
    line-height: 1;
    margin-top: .1rem;
}

.acv-user-info {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    overflow: hidden;
    min-width: 0;
}

.acv-user-matricula {
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Carrera: puede bajar de linea para nombres largos */
.acv-user-career {
    font-size: .72rem;
    color: rgba(255,255,255,.82);
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

/* ============================================
   MAIN WRAPPER - ocupa todo el ancho
   ============================================ */
.acv-main-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   HEADER con mural de fondo (estilo STT)
   ============================================ */
.acv-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
    color: #fff;
    overflow: hidden;
}

/* Fondo mural difuminado (igual que STT) */
.acv-header::before {
    content: '';
    position: absolute;
    inset: -15px;
    background: url('images/muralfondo.jpg') center/cover no-repeat;
    filter: blur(6px);
    z-index: -2;
}

/* Gradiente institucional sobre el mural */
.acv-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0,35,55,0.92) 0%,
        rgba(0,35,55,0.82) 35%,
        rgba(208,95,39,0.85) 65%,
        rgba(208,95,39,0.95) 100%
    );
    z-index: -1;
}

/* Boton hamburguesa en header para abrir sidebar */
.acv-header__menu-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    padding: .35rem .55rem;
    border-radius: 7px;
    transition: background var(--transition);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
}

.acv-header__menu-btn:hover {
    background: rgba(255,255,255,.15);
}

.acv-header__brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .85rem;
}

.acv-header__title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
}

.acv-header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* Nombre del usuario en header */
.acv-header__user-name {
    font-size: .85rem;
    font-weight: 500;
    opacity: .92;
    display: flex;
    align-items: center;
    gap: .4rem;
    color: #fff;
}

.acv-btn-logout {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 8px;
    padding: .35rem .9rem;
    font-size: .82rem;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.acv-btn-logout:hover {
    background: rgba(255,255,255,.3);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   CONTENIDO
   ============================================ */
.acv-content {
    flex: 1;
    padding: 2rem 1.75rem;
}

/* ============================================
   TABLAS - diseño mejorado
   ============================================ */

/* Contenedor con scroll interno */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    background: var(--card-bg);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .88rem;
}

/* Encabezados: fondo azul oscuro, letras blancas */
table thead th,
table tr:first-child th {
    background: var(--accent-blue) !important;
    color: #fff !important;
    font-weight: 700;
    padding: .85rem 1rem;
    text-align: left;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .78rem;
    border-bottom: 2px solid var(--accent-blue);
    white-space: nowrap;
}

table thead th:first-child { border-top-left-radius:  var(--radius-md); }
table thead th:last-child  { border-top-right-radius: var(--radius-md); }

table tbody tr td {
    padding: .78rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

table tbody tr:last-child td { border-bottom: none; }
table tbody tr:last-child td:first-child { border-bottom-left-radius:  var(--radius-md); }
table tbody tr:last-child td:last-child  { border-bottom-right-radius: var(--radius-md); }

table tbody tr:hover td { background: #f7f9fc; }
table tbody tr:nth-child(even) td { background: #fafbfc; }
table tbody tr:nth-child(even):hover td { background: #f2f5f8; }

/* DataTables overrides */
.dataTables_wrapper { padding: 1rem; }

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: .35rem .65rem;
    font-size: .85rem;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(208,95,39,.12);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--orange) !important;
    color: #fff !important;
    border: 1px solid var(--orange-dk) !important;
    border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--orange-lt) !important;
    color: var(--orange-dk) !important;
    border-radius: 6px;
}

/* ============================================
   FOOTER
   ============================================ */
.acv-footer {
    text-align: center;
    font-size: .75rem;
    color: var(--text-light);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

/* ============================================
   TITULO DE PAGINA
   ============================================ */
.acv-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: .65rem;
    border-bottom: 3px solid var(--orange);
    display: inline-block;
}
