/* ============================================================
   BOiT Bitácora — Estilos personalizados
   Bootstrap 5.3 como base
   ============================================================ */

:root {
    --boit-primary:       #1e3a5f;
    --boit-primary-dark:  #152b48;
    --boit-primary-light: #2d5488;
    --boit-accent:        #3a7fc1;
    --sidebar-width:      250px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.9rem;
}

#wrapper {
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--boit-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.25s ease;
    z-index: 1000;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand i {
    font-size: 1.4rem;
    color: var(--boit-accent);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    font-size: 0.875rem;
}

.sidebar-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-link.active {
    background-color: var(--boit-accent);
    color: #fff;
    font-weight: 600;
}

.sidebar-link i {
    width: 1.1rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-divider {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.sidebar-user span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
#page-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mobile-topbar {
    background-color: var(--boit-primary);
    padding: 0.4rem 0;
}

/* ============================================================
   RESPONSIVE — MOBILE SIDEBAR
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    #page-content-wrapper {
        width: 100%;
    }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
body.login-page {
    background: linear-gradient(135deg, var(--boit-primary) 0%, var(--boit-primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-logo {
    color: var(--boit-primary);
    font-size: 2.5rem;
}

.login-title {
    color: var(--boit-primary);
    font-weight: 700;
}

/* ============================================================
   CARDS Y STATS
   ============================================================ */
.stat-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* ============================================================
   TABLAS
   ============================================================ */
.table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.table tbody tr:hover {
    background-color: #f0f4ff;
}

/* ============================================================
   BADGES DE ESTADO
   ============================================================ */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-label {
    font-weight: 500;
    color: #344767;
    margin-bottom: 0.3rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--boit-accent);
    box-shadow: 0 0 0 0.2rem rgba(58, 127, 193, 0.2);
}

.required-mark {
    color: #dc3545;
    margin-left: 2px;
}

/* ============================================================
   SECCIÓN DE EVIDENCIAS
   ============================================================ */
.paste-area {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 0.875rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.paste-area:hover,
.paste-area.drag-over {
    border-color: var(--boit-accent);
    background-color: #eef4fb;
    color: var(--boit-primary);
}

.evidencia-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.evidencia-item .evidencia-icon {
    color: var(--boit-accent);
    font-size: 1.1rem;
}

.evidencia-preview img {
    max-width: 120px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* ============================================================
   LOG DE AUDITORÍA
   ============================================================ */
.log-entry {
    font-size: 0.8rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.log-entry:last-child {
    border-bottom: none;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn-boit {
    background-color: var(--boit-primary);
    border-color: var(--boit-primary);
    color: #fff;
}

.btn-boit:hover {
    background-color: var(--boit-primary-dark);
    border-color: var(--boit-primary-dark);
    color: #fff;
}

/* ============================================================
   FILTROS
   ============================================================ */
.filtros-card {
    background: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
}

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.pagination .page-link {
    color: var(--boit-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--boit-primary);
    border-color: var(--boit-primary);
}

/* ============================================================
   PERMISOS MATRIZ (admin_usuarios)
   ============================================================ */
.permiso-modulo-header {
    background: #f8f9fa;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--boit-primary);
    margin-bottom: 0.3rem;
}

.permiso-check-row {
    padding: 0.15rem 0.5rem;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.text-truncate-desc {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-header h1, .page-header h2 {
    margin-bottom: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--boit-primary);
}

.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 10px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    color: var(--boit-primary);
}
