:root {
    --primary-dark: #0a2b44;
    --primary-medium: #1e4a76;
    --primary-light: #2c6e9e;
    --accent: #3b82f6;
    --secondary-gray: #4a5b6e;
    --light-gray: #f4f7fc;
    --border-light: #e2e8f0;
    --text-dark: #1e2a3a;
    --text-muted: #5b6e8c;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    color: var(--primary-dark);
    letter-spacing: -0.2px;
}

h1 {
    font-size: 1.75rem;
}

/* ========== NAVBAR ========== */
.navbar {
    background-color: var(--primary-dark) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 500;
    font-size: 1rem;
}

.navbar-brand span {
    color: white;
}

.navbar-brand img {
    background: transparent !important;
    border-radius: 0 !important;
    object-fit: contain;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white;
}

/* ========== TARJETA CON SOMBREADO DIFERENCIADO ========== */
.shadow-sistema {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.shadow-sistema:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Imagen izquierda rectangular */
.sistema-img-izquierda {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    max-height: 120px;
    min-height: 100px;
}

/* Título */
.sistema-titulo {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Descripción */
.sistema-descripcion {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-height: 3.8rem;
    overflow-y: auto;
    margin-bottom: 0.75rem;
    padding-right: 4px;
}

.sistema-descripcion::-webkit-scrollbar {
    width: 3px;
}

.sistema-descripcion::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

/* ========== BOTÓN ESTÉTICO ========== */
.btn-sistema {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.35rem 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.btn-sistema:hover {
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(30, 74, 118, 0.25);
    color: white;
}

/* ========== BUSCADOR ========== */
.input-group-text {
    background-color: white;
    border-right: none;
    color: var(--text-muted);
}

#buscador {
    background-color: white;
    font-size: 0.85rem;
    border-left: none;
}

#buscador:focus {
    box-shadow: none;
    border-color: var(--primary-light);
}

/* ========== FORMULARIOS ========== */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem 1.25rem;
}

.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(44, 110, 158, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-medium));
    border: none;
    border-radius: 30px;
    padding: 0.45rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-medium), var(--primary-light));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-link {
    color: var(--primary-medium);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========== FOOTER ========== */
footer {
    background-color: var(--primary-dark) !important;
    color: #cbd5e1;
    border-top: none;
    margin-top: 2rem;
}

footer h5 {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

footer p, footer li {
    font-size: 0.75rem;
}

footer a.text-white-50 {
    color: #cbd5e1 !important;
    transition: color 0.2s;
}

footer a.text-white-50:hover {
    color: white !important;
    text-decoration: underline !important;
}

/* ========== TABLAS ADMIN ========== */
.table {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table thead th {
    background-color: var(--primary-dark);
    color: white;
    font-weight: 500;
    border: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(30, 74, 118, 0.03);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sistema-titulo {
        font-size: 0.8rem;
    }
    .sistema-descripcion {
        font-size: 0.65rem;
        max-height: 3.4rem;
    }
    .btn-sistema {
        font-size: 0.6rem;
        padding: 0.3rem 0.8rem;
    }
    .navbar-brand span {
        font-size: 0.8rem;
    }
    h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .col-md-4 {
        width: 100%;
    }
    .sistema-img-izquierda {
        max-height: 100px;
        min-height: 80px;
    }
    .sistema-titulo {
        font-size: 0.85rem;
    }
    .btn-sistema {
        font-size: 0.65rem;
    }
}

/* ========== TÍTULO PRINCIPAL CENTRADO - ESTILO CORPORATIVO ========== */
.titulo-principal {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #0a2b44;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    line-height: 1.2;
}

.subtitulo-principal {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: normal;
    color: #1e4a76;
    text-transform: none;
    display: block;
    margin-top: 0.25rem;
}

/* Texto de introducción */
.texto-introduccion {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #2d3e50;
}

.texto-introduccion strong {
    color: #0a2b44;
}

/* Responsive para título */
@media (max-width: 768px) {
    .titulo-principal {
        font-size: 1.5rem;
    }
    .subtitulo-principal {
        font-size: 0.85rem;
    }
    .texto-introduccion {
        font-size: 0.8rem;
        padding: 1rem !important;
    }
}

@media (max-width: 576px) {
    .titulo-principal {
        font-size: 1.2rem;
    }
}