:root {
    --app-primary: #2c5aa0;
    --app-primary-dark: #1a3a6b;
    --app-success: #27ae60;
    --app-warning: #f39c12;
    --app-info: #3498db;
    --app-danger: #e74c3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    background: #f4f6f9;
}

.bg-primary-app { background: linear-gradient(90deg, var(--app-primary), var(--app-primary-dark)); }
.text-primary-app { color: var(--app-primary) !important; }

/* Menú lateral */
.sidebar {
    min-height: calc(100vh - 56px);
    border-right: 1px solid #e3e6ea;
    background: #fff !important;
}
.sidebar .nav-link {
    color: #333;
    padding: .45rem .75rem;
    border-radius: 6px;
    margin: 1px 6px;
    font-size: .9rem;
}
.sidebar .nav-link .bi { margin-right: .35rem; color: #6c757d; }
.sidebar .nav-link:hover { background: #eef3fb; }
.sidebar .nav-link.active { background: var(--app-primary); color: #fff; }
.sidebar .nav-link.active .bi { color: #fff; }
.sidebar-heading {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8a939c;
    padding: 1rem 1rem .3rem;
    margin: 0;
}

/* Tarjetas */
.card { border: none; border-radius: 10px; }
.card-header { font-weight: 600; border-radius: 10px 10px 0 0 !important; }
.stat-card { border-left: 4px solid var(--app-primary); }
.stat-card.success { border-left-color: var(--app-success); }
.stat-card.warning { border-left-color: var(--app-warning); }
.stat-card.info { border-left-color: var(--app-info); }
.stat-card.danger { border-left-color: var(--app-danger); }
.stat-card .stat-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: #6c757d; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-card .bi { font-size: 2rem; opacity: .35; }

.table { font-size: .9rem; }
.table thead th { background: #f8f9fa; font-weight: 600; white-space: nowrap; }

.form-control:focus, .form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 .2rem rgba(44, 90, 160, .2);
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding-bottom: .75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}
.page-header h1 { font-size: 1.5rem; margin: 0; }

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .15rem 1rem;
    max-height: 360px;
    overflow-y: auto;
    padding: .25rem;
}
.check-grid .form-check { font-size: .88rem; }

/* Vista de formulario (documento) */
.doc {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 0 12px rgba(0, 0, 0, .06);
}
.doc-header { border-bottom: 3px solid var(--app-primary); padding-bottom: .75rem; margin-bottom: 1.25rem; }
.doc-numero { font-size: 1.4rem; font-weight: 700; color: var(--app-danger); }
.doc h2 { font-size: 1rem; text-transform: uppercase; color: var(--app-primary); border-bottom: 1px solid #dee2e6; padding-bottom: .25rem; margin-top: 1.25rem; }
.doc dl { margin-bottom: 0; }
.doc dt { font-weight: 600; font-size: .8rem; color: #6c757d; text-transform: uppercase; }
.doc dd { margin-bottom: .6rem; }
.firma { border-top: 1px solid #000; margin-top: 3rem; padding-top: .25rem; text-align: center; font-size: .85rem; }

/* Autenticación */
.auth-body {
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 1rem 0;
}
.auth-card {
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    overflow: hidden;
}
.auth-header {
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
    color: #fff;
    text-align: center;
    padding: 1.75rem;
}
.auth-header .bi { font-size: 2.75rem; }

.barra { height: 10px; background: var(--app-primary); border-radius: 4px; min-width: 2px; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; font-size: 10pt; }
    main { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; margin: 0 !important; padding: 0 !important; }
    .doc { box-shadow: none; padding: 0; }
    .card { box-shadow: none !important; border: 1px solid #999; }
    .badge { border: 1px solid #000; color: #000 !important; background: transparent !important; }
    a { text-decoration: none; color: #000; }
}
