:root {
    --primario: #0d3b66;
    --primario-claro: #1a5da6;
    --fondo: #f4f6f9;
    --texto: #1f2937;
    --borde: #e5e7eb;
    --verde: #16a34a;
    --rojo: #dc2626;
    --sidebar-w: 250px;
}

* { box-sizing: border-box; }

body {
    background: var(--fondo);
    color: var(--texto);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
}

a { text-decoration: none; }

/* ---------- LOGIN ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d3b66 0%, #1a5da6 100%);
    padding: 20px;
}
.login-card {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 14px;
    padding: 40px 36px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card .logo-title {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 6px;
}
.login-card .logo-title svg { color: var(--primario); }
.login-card h1 {
    font-size: 22px;
    text-align: center;
    margin: 0 0 4px;
    color: var(--primario);
}
.login-card p.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 28px;
    font-size: 14px;
}
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--borde);
    padding: 10px 12px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primario-claro);
    box-shadow: 0 0 0 3px rgba(26,93,166,.15);
}
.btn-primario {
    background: var(--primario);
    border: none;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
}
.btn-primario:hover { background: var(--primario-claro); color: #fff; }

/* ---------- LAYOUT ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: #0b1f3a;
    color: #cbd5e1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand small { display:block; font-weight:400; font-size:11px; color:#94a3b8; }
.sidebar nav { padding: 14px 10px; flex: 1; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 3px;
    font-size: 14.5px;
    transition: background .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--primario-claro); color: #fff; }
.sidebar .sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: 12px;
    color: #64748b;
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--borde);
    padding: 14px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar h1 { font-size: 19px; margin: 0; color: var(--primario); }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; }
.topbar .user-chip .avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primario); color:#fff; display:flex; align-items:center; justify-content:center;
    font-weight:600; font-size:14px;
}

.page-content { padding: 24px 26px 60px; }

.card-box {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 22px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card .icon {
    width: 46px; height: 46px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
}
.stat-card .value { font-size: 24px; font-weight: 700; color: var(--texto); }
.stat-card .label { font-size: 13px; color: #6b7280; }

.table-wrap { background: #fff; border-radius: 12px; border: 1px solid var(--borde); overflow: hidden; }
table.table { margin-bottom: 0; }
table.table thead { background: #f8fafc; }
table.table thead th { border-bottom: 1px solid var(--borde); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; padding: 12px 16px; }
table.table tbody td { padding: 12px 16px; vertical-align: middle; font-size: 14.5px; border-bottom: 1px solid #f1f5f9; }
table.table tbody tr:last-child td { border-bottom: none; }

.badge-activo { background: #dcfce7; color: #166534; padding: 4px 10px; border-radius: 20px; font-weight: 600; font-size: 12px; }
.badge-inactivo { background: #fee2e2; color: #991b1b; padding: 4px 10px; border-radius: 20px; font-weight: 600; font-size: 12px; }

.btn-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--borde); background: #fff; color: #475569; }
.btn-icon:hover { background: #f1f5f9; }
.btn-icon.danger:hover { background: #fee2e2; color: var(--rojo); }

.section-title { font-size: 16px; font-weight: 700; color: var(--primario); margin-bottom: 16px; }

/* ---------- HOJA DE VIDA IMPRIMIBLE ---------- */
.hoja-vida {
    background: #fff;
    max-width: 850px;
    margin: 0 auto;
    padding: 40px;
    border: 1px solid var(--borde);
    border-radius: 10px;
}
.hoja-vida .hv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primario);
    padding-bottom: 14px;
    margin-bottom: 20px;
}
.hoja-vida .hv-header h2 { color: var(--primario); margin: 0; font-size: 20px; }
.hoja-vida .hv-header .hv-optica { text-align: right; font-size: 13px; color: #475569; }
.hoja-vida h3.hv-section {
    background: #f1f5f9;
    padding: 6px 12px;
    font-size: 13.5px;
    color: var(--primario);
    margin: 22px 0 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.hoja-vida table.hv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hoja-vida table.hv-table th, .hoja-vida table.hv-table td {
    border: 1px solid var(--borde); padding: 7px 10px; text-align: center;
}
.hoja-vida table.hv-table th { background: #f8fafc; }
.hoja-vida .hv-datos p { margin: 3px 0; font-size: 13.5px; }
.hoja-vida .hv-datos strong { color: #334155; }

@media print {
    body * { visibility: hidden; }
    .hoja-vida, .hoja-vida * { visibility: visible; }
    .hoja-vida { position: absolute; top: 0; left: 0; border: none; margin: 0; padding: 10px; }
    .no-print { display: none !important; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    
    
}


