/* ============================================================
   FVDI Federados — Panel de administración
   ============================================================ */

:root {
    --fvdi-navy:        #1B3A6B;
    --fvdi-navy-dark:   #122952;
    --fvdi-navy-light:  #243e70;
    --fvdi-blue:        #3B7DBF;
    --fvdi-orange:      #F5A623;
    --fvdi-orange-dark: #d98e0f;
    --sidebar-width:    250px;
    --topbar-height:    56px;
}

/* ── Layout ──────────────────────────────────────────────── */

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f4f8;
    color: #2d3748;
}

#sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--fvdi-navy);
    overflow-y: auto;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

#page-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Sidebar brand ───────────────────────────────────────── */

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-decoration: none;
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-brand span {
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .3px;
    line-height: 1.2;
}

/* ── Sidebar nav ─────────────────────────────────────────── */

.sidebar-section {
    padding: 18px 16px 6px;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.4);
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .875rem;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}

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

.sidebar-nav a.active {
    background: rgba(245,166,35,.12);
    color: var(--fvdi-orange);
    border-left-color: var(--fvdi-orange);
    font-weight: 600;
}

.sidebar-nav a i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: .8rem;
    color: rgba(255,255,255,.4);
}

/* ── Topbar ──────────────────────────────────────────────── */

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar .page-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--fvdi-navy);
    flex: 1;
}

.topbar .user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: #4a5568;
}

.topbar .user-badge .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--fvdi-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
}

/* ── Main content ────────────────────────────────────────── */

.main-content {
    flex: 1;
    padding: 24px;
}

/* ── Cards ───────────────────────────────────────────────── */

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #edf2f7;
    font-weight: 600;
    font-size: .9rem;
    border-radius: 10px 10px 0 0 !important;
    padding: 14px 20px;
}

.card-body { padding: 20px; }

/* Stat cards */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border-left: 4px solid var(--fvdi-navy);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card.orange  { border-left-color: var(--fvdi-orange); }
.stat-card.blue    { border-left-color: var(--fvdi-blue); }
.stat-card.green   { border-left-color: #48bb78; }
.stat-card.red     { border-left-color: #fc8181; }

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(27,58,107,.1);
    color: var(--fvdi-navy);
    flex-shrink: 0;
}

.stat-card.orange .icon { background: rgba(245,166,35,.12); color: var(--fvdi-orange-dark); }
.stat-card.blue .icon   { background: rgba(59,125,191,.1);  color: var(--fvdi-blue); }
.stat-card.green .icon  { background: rgba(72,187,120,.1);  color: #2f855a; }
.stat-card.red .icon    { background: rgba(252,129,129,.1); color: #c53030; }

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--fvdi-navy);
    line-height: 1;
}

.stat-card .label {
    font-size: .78rem;
    color: #718096;
    margin-top: 2px;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn-fvdi {
    background: var(--fvdi-navy);
    color: #fff;
    border: none;
}
.btn-fvdi:hover { background: var(--fvdi-navy-dark); color: #fff; }

.btn-orange {
    background: var(--fvdi-orange);
    color: #fff;
    border: none;
    font-weight: 600;
}
.btn-orange:hover { background: var(--fvdi-orange-dark); color: #fff; }

/* ── Tables ──────────────────────────────────────────────── */

.table thead th {
    background: #f7fafc;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #718096;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.table tbody tr:hover { background: #f7fafc; }

.table td { vertical-align: middle; font-size: .875rem; }

/* ── Badges ──────────────────────────────────────────────── */

.badge-pendiente  { background: #FEF3C7; color: #92400E; }
.badge-confirmado { background: #D1FAE5; color: #065F46; }
.badge-activa     { background: #D1FAE5; color: #065F46; }
.badge-anulado,
.badge-anulada    { background: #FEE2E2; color: #991B1B; }
.badge-caducada   { background: #F3F4F6; color: #4B5563; }
.badge-tarjeta    { background: #DBEAFE; color: #1E40AF; }
.badge-licencia   { background: #EDE9FE; color: #5B21B6; }

.badge-estado {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}

/* ── Login page ──────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--fvdi-navy) 0%, #2a5298 60%, var(--fvdi-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.login-logo {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    object-fit: cover;
    border: 3px solid #e2e8f0;
}

.login-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fvdi-navy);
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    font-size: .8rem;
    color: #718096;
    margin-bottom: 28px;
}

/* ── Pagination ──────────────────────────────────────────── */

.pagination .page-link { color: var(--fvdi-navy); }
.pagination .page-item.active .page-link {
    background: var(--fvdi-navy);
    border-color: var(--fvdi-navy);
}

/* ── Breadcrumb ──────────────────────────────────────────── */

.breadcrumb { font-size: .82rem; margin: 0; background: transparent; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: #a0aec0; }
.breadcrumb-item a { color: var(--fvdi-navy); text-decoration: none; }
.breadcrumb-item.active { color: #718096; }

/* ── Form helpers ────────────────────────────────────────── */

.form-label { font-size: .83rem; font-weight: 500; color: #4a5568; }
.form-control:focus, .form-select:focus {
    border-color: var(--fvdi-blue);
    box-shadow: 0 0 0 .2rem rgba(59,125,191,.2);
}

/* ── Misc ────────────────────────────────────────────────── */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fvdi-navy);
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #a0aec0;
}

.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }
