:root {
    --ph-azul: #123a5e;
    --ph-azul-osc: #0d2c48;
    --ph-acento: #1c7ed6;
    --sidebar-w: 250px;
    --topbar-h: 56px;
}

body {
    background: #f2f5f9;
    font-size: 0.925rem;
    padding-top: var(--topbar-h);
}

/* ------------------------------------------------------------- Estructura */

.app-topbar {
    background: var(--ph-azul);
    height: var(--topbar-h);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    z-index: 1040;
}

.app-sidebar {
    background: var(--ph-azul-osc);
    color: #fff;
    width: var(--sidebar-w);
}

@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        top: var(--topbar-h);
        bottom: 0;
        left: 0;
        overflow-y: auto;
        z-index: 1030;
    }
    .app-main {
        margin-left: var(--sidebar-w);
    }
}

.app-sidebar .nav-link {
    color: #cdd8e4;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    border-left: 3px solid transparent;
    font-size: .9rem;
}

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

.app-sidebar .nav-link.active {
    background: rgba(28, 126, 214, .25);
    border-left-color: var(--ph-acento);
    color: #fff;
    font-weight: 500;
}

.app-sidebar .nav-link i {
    width: 18px;
    text-align: center;
}

.sidebar-group {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #7d97b0;
    padding: 1rem 1rem .35rem;
    font-weight: 600;
}

/* ---------------------------------------------------------------- Tarjetas */

.card {
    border: 1px solid #e3e9f0;
    border-radius: .6rem;
    box-shadow: 0 1px 2px rgba(16, 42, 67, .04);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    font-weight: 600;
    padding: .7rem 1rem;
}

.kpi {
    border-left: 4px solid var(--ph-acento);
}

.kpi .kpi-valor {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    color: #17324d;
}

.kpi .kpi-label {
    font-size: .78rem;
    color: #6b7c8f;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.kpi.kpi-danger { border-left-color: #dc3545; }
.kpi.kpi-warning { border-left-color: #f59f00; }
.kpi.kpi-success { border-left-color: #2b8a3e; }
.kpi.kpi-info { border-left-color: #1098ad; }

.page-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #17324d;
    margin: 0;
}

/* ----------------------------------------------------------------- Tablas */

.table {
    font-size: .875rem;
}

.table > thead th {
    background: #f7f9fc;
    color: #56697d;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    white-space: nowrap;
}

.table-hover > tbody > tr:hover > * {
    background-color: #f3f8ff;
}

.tabla-acciones {
    white-space: nowrap;
    width: 1%;
}

.dl-ficha dt {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7c8f;
    font-weight: 600;
    margin-bottom: .1rem;
}

.dl-ficha dd {
    margin-bottom: .9rem;
    color: #23384f;
}

.doc-item {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .55rem .25rem;
    border-bottom: 1px dashed #e6ecf3;
}

.doc-item:last-child { border-bottom: 0; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0d2c48, #1c7ed6);
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: .8rem;
}

.timeline-item {
    border-left: 2px solid #e3e9f0;
    padding: 0 0 .9rem 1rem;
    margin-left: .4rem;
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -6px;
    top: .3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ph-acento);
}

/* --------------------------------------------------------------- Impresión */

@media print {
    body { padding-top: 0; background: #fff; }
    .app-topbar, .app-sidebar, .d-print-none, .btn, .pagination, form.filtros { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; break-inside: avoid; }
    a[href]:after { content: ""; }
    .table { font-size: 11px; }
    .encabezado-impresion { display: block !important; }
}

.encabezado-impresion { display: none; }
