/* ============================================================
   Sistema Parroquial — Hoja de estilos principal
   Bootstrap 5 + estilos propios
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --sidebar-w:        240px;
    --sidebar-bg:       #1a2744;
    --sidebar-hover:    #243460;
    --sidebar-active:   #2d4080;
    --sidebar-text:     #c8d0e7;
    --sidebar-muted:    #6b7a9e;
    --topbar-h:         56px;
    --accent:           #4f7ef8;
    --accent-light:     #e8effe;
    --success:          #1db954;
    --radius:           8px;
    --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
    --shadow:           0 2px 8px rgba(0,0,0,.12);
}

/* ── Reset / base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif;
       background: #f4f6fb; color: #1e2430; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1.2rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .02em;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand i { font-size: 1.4rem; color: var(--accent); }

.sidebar-nav { flex: 1; padding: .75rem 0; }

.nav-section-label {
    padding: .8rem 1.2rem .25rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1.2rem;
    color: var(--sidebar-text);
    border-radius: 0;
    transition: background .15s, color .15s;
    font-size: .9rem;
}
.sidebar-nav .nav-link i { font-size: 1rem; width: 1.1rem; }
.sidebar-nav .nav-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #fff; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,.07);
    color: var(--sidebar-text);
    font-size: .85rem;
}
.sidebar-user i { font-size: 1.5rem; color: var(--sidebar-muted); }
.sidebar-user-info { display: flex; flex-direction: column; gap: .1rem; }
.sidebar-user-name { color: #fff; font-weight: 500; font-size: .85rem;
                     white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                     max-width: 150px; }
.sidebar-user-logout { color: var(--sidebar-muted); font-size: .78rem;
                        text-decoration: none; }
.sidebar-user-logout:hover { color: #fff; }

/* ── Contenido principal ────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin-left .25s ease;
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e3e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}
.topbar .breadcrumb-item + .breadcrumb-item::before { color: #adb5bd; }

.page-content { padding: 1.75rem 1.5rem; }

/* ── Tarjetas ───────────────────────────────────────────────── */
.card {
    border: 1px solid #e3e8f0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #e3e8f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* ── Página — header ────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a2744;
    margin: 0;
}
.page-title small {
    font-size: .8rem;
    font-weight: 400;
    color: #6b7a9e;
    margin-left: .5rem;
}

/* ── Tabla ──────────────────────────────────────────────────── */
.table-card { background: #fff; border-radius: var(--radius);
               border: 1px solid #e3e8f0; overflow: hidden; }
.table thead th { background: #f8f9fd; font-size: .78rem; font-weight: 600;
                  text-transform: uppercase; letter-spacing: .05em;
                  color: #6b7a9e; border-bottom: 1px solid #e3e8f0; }
.table tbody tr:hover { background: #f8f9fd; }
.table td { vertical-align: middle; font-size: .9rem; }

/* ── Badges de estado ───────────────────────────────────────── */
.badge-activo   { background: #d1fae5; color: #065f46; }
.badge-inactivo { background: #fee2e2; color: #991b1b; }
.badge-pendiente{ background: #fef3c7; color: #92400e; }
.badge-aprobada { background: #d1fae5; color: #065f46; }
.badge-rechazada{ background: #fee2e2; color: #991b1b; }

/* ── Botones ────────────────────────────────────────────────── */
.btn-primary   { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #3a6ae0; border-color: #3a6ae0; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex;
             align-items: center; justify-content: center; border-radius: 6px; }

/* ── Formularios ────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .88rem; margin-bottom: .3rem; }
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #d0d7e8;
    font-size: .9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79,126,248,.15);
}

/* ── Upload de imagen ───────────────────────────────────────── */
.img-preview {
    width: 120px; height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e3e8f0;
}
.img-preview-placeholder {
    width: 120px; height: 120px;
    border-radius: 8px;
    border: 2px dashed #d0d7e8;
    display: flex; align-items: center; justify-content: center;
    color: #adb5bd; font-size: 2rem; background: #f8f9fd;
}

/* ── Dashboard — stats ──────────────────────────────────────── */
.stat-card {
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: #6b7a9e; margin-top: .2rem; }

/* ── Login ──────────────────────────────────────────────────── */
.login-body {
    background: linear-gradient(135deg, #1a2744 0%, #2d4080 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
    font-size: 2.5rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: .5rem;
}
.login-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1a2744;
    margin-bottom: .25rem;
}
.login-subtitle {
    text-align: center;
    color: #6b7a9e;
    font-size: .88rem;
    margin-bottom: 2rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
.sidebar-collapsed .sidebar          { transform: translateX(-100%); }
.sidebar-collapsed .main-content     { margin-left: 0; }

@media (max-width: 768px) {
    .sidebar     { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .sidebar.open { transform: translateX(0); }
    .page-content { padding: 1rem; }
}
