/* ==========================================================================
 * Portal de Recibos de Sueldo — Municipalidad de Estancia Grande
 * Desarrollo web / aplicativo a medida
 *
 * Cabure Agencia Digital
 * https://cabure.ar
 * ========================================================================== */

:root {
    --azul:        #14508c;
    --azul-osc:    #0e3a66;
    --azul-claro:  #eaf1f8;
    --texto:       #1c2733;
    --muted:       #667284;
    --linea:       #dde3ea;
    --fondo:       #f4f6f9;
    --blanco:      #ffffff;
    --ok:          #1a7f52;
    --ok-bg:       #e5f4ec;
    --warn:        #9a6a00;
    --warn-bg:     #fbf1d8;
    --error:       #b32020;
    --error-bg:    #fbe6e6;
    --radio:       10px;
    --sombra:      0 1px 3px rgba(18,40,70,.08), 0 6px 20px rgba(18,40,70,.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--texto);
    background: var(--fondo);
    line-height: 1.5;
}

/* ---------- Topbar ---------- */
.topbar {
    background: var(--azul);
    color: #fff;
    box-shadow: var(--sombra);
}
.topbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 40px; height: 40px;
    background: #fff; color: var(--azul);
    border-radius: 9px;
    display: grid; place-items: center;
    font-weight: 800; font-size: 20px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; }
.brand-text span { font-size: 12.5px; opacity: .85; }

.topnav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topnav a { color: #fff; text-decoration: none; font-size: 14px; opacity: .92; }
.topnav a:hover { opacity: 1; text-decoration: underline; }
.user-chip { font-size: 14px; opacity: .95; display: inline-flex; align-items: center; gap: 8px; }
.badge {
    background: rgba(255,255,255,.2);
    padding: 1px 8px; border-radius: 20px;
    font-size: 11px; font-style: normal; letter-spacing: .3px;
}
.btn-logout {
    border: 1px solid rgba(255,255,255,.4);
    padding: 5px 12px; border-radius: 8px;
}

/* ---------- Layout ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 28px 20px 48px; }
.footer {
    text-align: center; color: var(--muted);
    font-size: 12.5px; padding: 24px; border-top: 1px solid var(--linea);
}
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; }
h1, h2, h3 { color: var(--texto); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-title { margin: 30px 0 12px; font-size: 18px; }

/* ---------- Cards ---------- */
.card {
    background: var(--blanco);
    border: 1px solid var(--linea);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    margin-bottom: 18px;
    overflow: hidden;
}
.card.highlight {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    border-left: 4px solid var(--azul);
}
.card-body { padding: 20px 22px; }
.card.highlight .card-body { padding: 20px 22px; }
.card-actions { padding: 20px 22px; display: flex; gap: 10px; }
.eyebrow {
    text-transform: uppercase; letter-spacing: .6px;
    font-size: 11.5px; color: var(--azul); font-weight: 700;
}
.card.highlight h2 { margin: 6px 0 2px; font-size: 22px; }

/* ---------- Botones ---------- */
.btn {
    display: inline-block; cursor: pointer;
    border: 1px solid transparent; border-radius: 8px;
    padding: 10px 18px; font-size: 14px; font-weight: 600;
    text-decoration: none; text-align: center;
    transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-osc); }
.btn-ghost { background: #fff; color: var(--azul); border-color: var(--linea); }
.btn-ghost:hover { background: var(--azul-claro); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Login ---------- */
.login-wrap { display: grid; place-items: center; min-height: 60vh; }
.login-card {
    background: #fff; border: 1px solid var(--linea);
    border-radius: 14px; box-shadow: var(--sombra);
    padding: 34px 32px; width: 100%; max-width: 400px;
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card form { margin-top: 18px; display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: #3a4756; }
input[type=text], input[type=password], input[type=file], select {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--linea); border-radius: 8px;
    font-size: 14px; font-weight: 400; color: var(--texto);
    background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--azul-claro); border-color: var(--azul); }
.login-card .muted.small { margin-top: 16px; text-align: center; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #f0c2c2; }
.alert-ok    { background: var(--ok-bg);    color: var(--ok);    border: 1px solid #bfe3cf; }

/* ---------- Historial ---------- */
.year-block { margin-bottom: 22px; }
.year-title {
    font-size: 15px; color: var(--muted);
    border-bottom: 1px solid var(--linea);
    padding-bottom: 6px; margin: 0 0 14px;
}
.recibo-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.recibo-item {
    background: #fff; border: 1px solid var(--linea); border-radius: 10px;
    padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.recibo-meta { display: flex; flex-direction: column; }
.recibo-meta .mes { font-weight: 700; font-size: 15px; }
.recibo-meta .periodo { font-size: 12.5px; color: var(--muted); }

/* ---------- Stats ---------- */
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
    background: #fff; border: 1px solid var(--linea); border-radius: 10px;
    padding: 16px 22px; flex: 1; min-width: 140px; text-align: center;
    box-shadow: var(--sombra);
}
.stat-num { display: block; font-size: 30px; font-weight: 800; color: var(--azul); }
.stat-lbl { font-size: 13px; color: var(--muted); }

/* ---------- Formularios inline (admin) ---------- */
.form-inline { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin-top: 12px; }
.form-inline label { font-size: 12.5px; }

/* ---------- Tablas ---------- */
.tabla { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.tabla th, .tabla td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linea); }
.tabla th { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.tabla tbody tr:hover { background: #fafbfd; }

.pill { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.pill-ok   { background: var(--ok-bg);   color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }

code { background: #eef1f5; padding: 2px 6px; border-radius: 5px; font-size: 13px; }

@media (max-width: 560px) {
    .card.highlight { flex-direction: column; align-items: stretch; }
    .card-actions { padding-top: 0; }
    .topbar-inner { flex-direction: column; align-items: flex-start; }
}
