/* ═══════════════════════════════════════════════
   Sistema de Fondo Circulante - UES
   Estilos personalizados - Diseño institucional
   ═══════════════════════════════════════════════ */

/* ── Variables de marca UES ── */
:root {
    --ues-blue: #003366;
    --ues-blue-light: #00509e;
    --ues-blue-dark: #002244;
    --ues-gold: #C9A227;
    --ues-gold-light: #E6C65C;
    --ues-gray: #f4f6f9;
    --ues-text: #2c3e50;
    --ues-text-muted: #6c757d;
    --ues-border: rgba(0, 0, 0, 0.08);
    --ues-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --ues-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    --ues-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --ues-radius: 12px;
    --ues-radius-sm: 8px;
    --ues-transition: all 0.25s ease;
}

/* ── Tipografía ── */
body {
    background-color: var(--ues-gray);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ues-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ── Navbar ── */
.navbar {
    background: linear-gradient(135deg, var(--ues-blue) 0%, var(--ues-blue-light) 100%) !important;
    box-shadow: var(--ues-shadow);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    border-radius: var(--ues-radius-sm);
    padding: 0.5rem 0.9rem;
    transition: var(--ues-transition);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
}

.navbar-dark .navbar-nav .dropdown-menu {
    border: none;
    border-radius: var(--ues-radius-sm);
    box-shadow: var(--ues-shadow-lg);
}

.navbar .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

/* ── Cards ── */
.card {
    border: none;
    border-radius: var(--ues-radius);
    box-shadow: var(--ues-shadow-sm);
    transition: var(--ues-transition);
    background: #fff;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--ues-shadow);
    transform: translateY(-2px);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--ues-border);
    font-weight: 700;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header.bg-primary,
.card-header.bg-dark,
.card-header.bg-info,
.card-header.bg-warning,
.card-header.bg-secondary,
.card-header.bg-success,
.card-header.bg-danger {
    border-bottom: none;
}

.card-body {
    padding: 1.25rem;
}

/* ── Botones ── */
.btn {
    border-radius: var(--ues-radius-sm);
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: var(--ues-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ues-blue-light) 0%, var(--ues-blue) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ues-blue) 0%, var(--ues-blue-dark) 100%);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--ues-blue-light);
    color: var(--ues-blue-light);
}

.btn-outline-primary:hover {
    background-color: var(--ues-blue-light);
    border-color: var(--ues-blue-light);
}

.btn-lg {
    border-radius: var(--ues-radius);
    padding: 0.65rem 1.25rem;
}

.btn-sm {
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
}

/* ── Login ── */
.login-container {
    background: linear-gradient(135deg, var(--ues-blue-dark) 0%, var(--ues-blue) 50%, var(--ues-blue-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container > .row {
    width: 100%;
    justify-content: center;
    margin: 0;
}

.login-container .card {
    width: 100%;
    max-width: 420px;
}

.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(201, 162, 39, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.login-container .card {
    border: none;
    border-radius: var(--ues-radius);
    box-shadow: var(--ues-shadow-lg);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.login-container .card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--ues-gold) 0%, var(--ues-gold-light) 100%);
}

.login-container .card-body {
    padding: 2.5rem;
}

.login-logo {
    height: 110px;
    width: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.login-title {
    font-weight: 800;
    color: var(--ues-blue);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--ues-text-muted);
    font-size: 0.95rem;
}

/* ── Formularios ── */
.form-control, .form-select {
    border-radius: var(--ues-radius-sm);
    border: 1px solid #d1d9e0;
    padding: 0.55rem 0.9rem;
    transition: var(--ues-transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--ues-blue-light);
    box-shadow: 0 0 0 0.2rem rgba(0, 80, 158, 0.15);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ues-text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.35rem;
}

/* ── Tablas ── */
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--ues-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.85rem 1rem;
    border: none;
}

.table tbody td {
    font-size: 0.875rem;
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--ues-border);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 80, 158, 0.03);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.015);
}

/* ── Badges ── */
.badge {
    font-weight: 600;
    padding: 0.45em 0.75em;
    border-radius: 6px;
}

.badge.bg-outline-primary {
    background-color: rgba(0, 80, 158, 0.08);
    border: 1px solid rgba(0, 80, 158, 0.25);
    color: var(--ues-blue-light);
}

/* ── Stats cards del dashboard ── */
.stats-card {
    border: none;
    border-radius: var(--ues-radius);
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: var(--ues-transition);
}

.stats-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

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

.stats-card .card-title {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-card h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0;
}

.stats-card i {
    font-size: 2.8rem;
    opacity: 0.25;
}

/* ── Workflow Steps ── */
.workflow-step {
    padding: 12px 8px;
    transition: var(--ues-transition);
}

.workflow-step:hover {
    transform: translateY(-3px);
}

.workflow-step.active {
    transform: scale(1.05);
}

.workflow-step.active .step-icon {
    box-shadow: 0 0 0 5px rgba(0, 80, 158, 0.18);
}

.step-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.4rem;
    transition: var(--ues-transition);
}

/* ── Status bar en detalle ── */
.status-step {
    border-radius: var(--ues-radius-sm);
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    transition: var(--ues-transition);
}

.status-step i {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.status-connector {
    display: flex;
    align-items: center;
    color: var(--ues-text-muted);
}

/* ── Timeline / Historial ── */
.timeline .border-start {
    border-color: #d1d9e0 !important;
    border-width: 2px !important;
    padding-left: 1rem;
}

/* ── Alerts ── */
.alert {
    border-radius: var(--ues-radius-sm);
    border: none;
    box-shadow: var(--ues-shadow-sm);
}

/* ── Footer ── */
footer {
    margin-top: auto;
    background: linear-gradient(135deg, var(--ues-blue-dark) 0%, var(--ues-blue) 100%) !important;
}

footer small {
    opacity: 0.9;
}

/* ── Animaciones ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

main > .container-fluid > .card,
main > .container-fluid > .row {
    animation: fadeIn 0.4s ease-out;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .workflow-step small {
        font-size: 0.65rem;
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }

    .navbar-brand img {
        height: 30px;
    }

    .stats-card h2 {
        font-size: 1.6rem;
    }

    .login-container .card-body {
        padding: 1.75rem;
    }

    .login-logo {
        height: 85px;
    }
}

/* ── Print styles ── */
@media print {
    .navbar, footer, .btn, form {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
