:root {
    --navy: #0e1a3a;
    --navy-light: #16264f;
    --accent: #2563eb;
    --accent-soft: #eaf1ff;
    --ink: #1f2937;
    --muted: #6b7280;
    --border: #e6e9f0;
}

body {
    background: #f4f6fb;
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: var(--navy);
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    gap: .7rem;
    align-items: center;
    padding: 1.3rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: .6rem;
    background: rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sidebar-brand-text strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.sidebar-brand-text small {
    color: rgba(255, 255, 255, .55);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: .9rem .75rem;
    gap: .15rem;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, .68);
    text-decoration: none;
    padding: .6rem .85rem;
    display: flex;
    gap: .65rem;
    align-items: center;
    font-size: .89rem;
    border-radius: .5rem;
}

.sidebar-nav a i {
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
}

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

.sidebar-nav a.active {
    background: var(--accent);
    color: #fff;
    font-weight: 500;
}

.main-content {
    min-height: 100vh;
}

.topbar {
    background: #fff;
    padding: .8rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.topbar-search i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.topbar-search input {
    width: 100%;
    border: 1px solid var(--border);
    background: #f7f8fb;
    border-radius: 2rem;
    padding: .5rem 1rem .5rem 2.3rem;
    font-size: .88rem;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .6rem .3rem .3rem;
    border-radius: 2rem;
    background: #f7f8fb;
}

.user-chip .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-chip .user-name {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.1;
}

.user-chip .user-role {
    font-size: .72rem;
    color: var(--muted);
}

.content-header {
    margin-bottom: 1.25rem;
}

.breadcrumb-trail {
    color: var(--muted);
    font-size: .8rem;
    margin-bottom: .15rem;
}

.page-title {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--ink);
}

.stat-card {
    background: #fff;
    border-radius: .85rem;
    padding: 1.1rem 1.3rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}

.stat-label {
    color: var(--muted);
    font-size: .8rem;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--ink);
}

.card {
    border: none;
    border-radius: .85rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}

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

.table thead th {
    color: var(--muted);
    font-weight: 600;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom-width: 1px;
}

.login-body {
    min-height: 100vh;
    background: var(--navy);
}

.login-card {
    width: 360px;
    border-radius: 1rem;
}

.stepper {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stepper li {
    padding: .45rem 0 .45rem 1.6rem;
    position: relative;
    font-size: .85rem;
    text-transform: capitalize;
    color: var(--muted);
}

.stepper li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .65rem;
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: #d1d5db;
}

.stepper li.done { color: #15803d; }
.stepper li.done::before { background: #15803d; }
.stepper li.current { color: var(--accent); font-weight: 600; }
.stepper li.current::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.badge {
    text-transform: capitalize;
    font-weight: 600;
    padding: .35em .7em;
}

/* Colores por estado, alineados a las capturas de referencia */
.badge.estado-solicitud_recibida,
.badge.estado-pendiente,
.badge.estado-abierto { background: #e5e7eb; color: #374151; }

.badge.estado-documentacion,
.badge.estado-aprobado { background: #bbf7d0; color: #065f46; }

.badge.estado-en_revision { background: #fde68a; color: #92400e; }

.badge.estado-elaboracion { background: #bfdbfe; color: #1e3a8a; }

.badge.estado-revision_juridica { background: #ddd6fe; color: #5b21b6; }

.badge.estado-firma,
.badge.estado-rechazado { background: #fecaca; color: #991b1b; }

.badge.estado-cerrado { background: #d1fae5; color: #065f46; }
