/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 15px; color: #1a1a2e; background: #f5f7fa; line-height: 1.6; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Navbar ===== */
.navbar { background: #1a1a2e; color: #fff; display: flex; align-items: center; padding: 0 1.5rem; height: 56px; gap: 2rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.nav-brand { font-weight: 700; font-size: 1.2rem; color: #60a5fa; }
.nav-menu { display: flex; gap: 1rem; flex: 1; }
.nav-menu a { color: #cbd5e1; padding: .4rem .8rem; border-radius: 6px; font-size: .9rem; }
.nav-menu a:hover { background: #2d2d4e; color: #fff; text-decoration: none; }
.nav-user { font-size: .85rem; color: #94a3b8; }

/* ===== Main ===== */
.main-content { min-height: calc(100vh - 56px - 48px); padding: 1.5rem; }
.container { max-width: 1100px; margin: 0 auto; }

/* ===== Page Header ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { margin: 0; }

/* ===== Alerts ===== */
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.alert-warning { background: #fef9c3; color: #ca8a04; border: 1px solid #fde047; }

/* ===== Buttons ===== */
.btn { display: inline-block; padding: .5rem 1.1rem; border-radius: 7px; font-size: .9rem; font-weight: 500; cursor: pointer; border: none; transition: all .15s; }
.btn:hover { text-decoration: none; filter: brightness(.92); }
.btn-primary { background: #2563eb; color: #fff; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-success { background: #16a34a; color: #fff; }
.btn-warning { background: #d97706; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; text-align: center; }
.btn-lg { padding: .7rem 1.5rem; font-size: 1rem; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: .35rem; font-size: .88rem; color: #475569; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], select, textarea {
    width: 100%; padding: .55rem .8rem; border: 1.5px solid #cbd5e1; border-radius: 7px; font-size: .95rem;
    background: #fff; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }
.input-monto { width: 120px; }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.table thead { background: #f1f5f9; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid #e2e8f0; font-size: .9rem; }
.table tbody tr:hover { background: #f8fafc; }

/* ===== Cards ===== */
.stat-card { background: #fff; border-radius: 12px; padding: 1.5rem; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.stat-card h3 { font-size: 2rem; color: #2563eb; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.grupo-card { background: #fff; border-radius: 12px; padding: 1.25rem; box-shadow: 0 2px 8px rgba(0,0,0,.07); display: flex; flex-direction: column; gap: .5rem; }
.grupos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.semanas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.semana-card { background: #fff; border-radius: 10px; padding: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: .4rem; border-left: 4px solid #e2e8f0; }
.semana-card.semana-abierta { border-left-color: #2563eb; }
.semana-card.semana-cerrada { border-left-color: #16a34a; }
.semana-card.semana-pendiente { opacity: .6; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .78rem; font-weight: 600; background: #e2e8f0; color: #475569; }
.badge-administrador { background: #7c3aed; color: #fff; }
.badge-supervisor { background: #0891b2; color: #fff; }
.badge-tesorero { background: #2563eb; color: #fff; }
.badge-presidente { background: #d97706; color: #fff; }
.badge-secretario { background: #64748b; color: #fff; }
.badge-warning { background: #fef9c3; color: #92400e; }
.badge-lg { font-size: .9rem; padding: .3rem .9rem; }

/* ===== Login ===== */
.login-page { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 380px; padding: 1rem; }
.login-card { background: #fff; border-radius: 16px; padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-card h1 { color: #2563eb; font-size: 1.8rem; margin-bottom: .2rem; }
.login-card h2 { color: #64748b; font-size: 1rem; font-weight: 400; margin-bottom: 1.5rem; }

/* ===== Info cards ===== */
.ciclo-info { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.ciclo-info span { background: #fff; padding: .5rem 1rem; border-radius: 8px; font-size: .88rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.detalle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.detalle-grid div { background: #fff; padding: 1rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.detalle-grid label { display: block; font-size: .78rem; color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.semana-info { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.info-card { background: #fff; padding: 1rem 1.5rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.info-card label { display: block; font-size: .78rem; color: #64748b; margin-bottom: .2rem; }
.info-success { border-left: 4px solid #16a34a; }
.info-danger { border-left: 4px solid #dc2626; }

/* ===== Misc ===== */
.text-muted { color: #94a3b8; font-size: .9rem; }
.text-success { color: #16a34a; }
.text-danger { color: #dc2626; }
.actions-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
.total-row { background: #f1f5f9; padding: 1rem; border-radius: 8px; margin: 1rem 0; font-size: 1.1rem; }
.ciclo-status { background: #fff; padding: 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.no-ciclo { background: #fff; padding: 2rem; border-radius: 12px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.07); margin-bottom: 1.5rem; }
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 { font-size: 5rem; color: #cbd5e1; }
.comprobantes-grid { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.comprobante-item { background: #fff; border-radius: 8px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.07); text-align: center; max-width: 200px; }
.comprobante-item img { max-width: 100%; border-radius: 6px; }
.pdf-icon { display: block; font-size: 2rem; color: #dc2626; padding: 1rem; }

/* ===== Footer ===== */
.footer { background: #1a1a2e; color: #64748b; text-align: center; padding: .75rem; font-size: .82rem; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .navbar { flex-wrap: wrap; height: auto; padding: .75rem; }
    .nav-menu { gap: .5rem; }
    .semanas-grid { grid-template-columns: repeat(2, 1fr); }
    .table { font-size: .8rem; }
    .table th, .table td { padding: .5rem .6rem; }
}
