/* GAMMA IMPOSITIVO — paleta GAMMA SG oficial
   Fondo #0F0F0F · Amarillo #FFEB3B · Blanco #FFFFFF · Montserrat */

:root {
    --bg: #0F0F0F;
    --bg-card: #1A1A1A;
    --bg-elev: #212121;
    --border: #2A2A2A;
    --border-strong: #3A3A3A;
    --text: #FFFFFF;
    --text-muted: #A0A0A0;
    --text-dim: #6B6B6B;
    --yellow: #FFEB3B;
    --yellow-dim: #FFD600;
    --success: #4CAF50;
    --warn: #FFA726;
    --danger: #EF5350;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 500;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
i[data-lucide] { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }

/* ---------- Marca ---------- */
.brand-mark { display: flex; align-items: center; gap: .75rem; }
.brand-mark.small .gear-wrap { width: 32px; height: 32px; }
.brand-mark.small .brand-title { font-size: .95rem; }
.brand-mark.small .brand-sub { font-size: .7rem; }
.gear-wrap {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--yellow);
    display: grid; place-items: center;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--yellow-dim);
}
.gear-g {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    color: #000; font-size: 1.5rem; line-height: 1;
}
.brand-mark.small .gear-g { font-size: 1rem; }
.brand-title { font-family: 'Montserrat', sans-serif; font-weight: 900; letter-spacing: 1px; color: var(--text); font-size: 1.4rem; }
.brand-sub { font-weight: 500; color: var(--yellow); font-size: .8rem; text-transform: uppercase; letter-spacing: 1.5px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
    padding: 2.5rem 2rem; width: 100%; max-width: 380px;
}
.login-card .brand-mark { margin-bottom: 2rem; justify-content: center; }
.login-card form { display: flex; flex-direction: column; gap: .75rem; }

/* ---------- Inputs / buttons ---------- */
.input, .select, .textarea {
    width: 100%; background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: 10px; padding: .7rem .9rem; color: var(--text); font-size: .9rem;
    transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--yellow); }
.textarea { min-height: 4.5rem; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23A0A0A0' d='M6 8 0 0h12z'/></svg>"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2rem; }
label.checkbox-row { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-muted); }
input[type="checkbox"] { accent-color: var(--yellow); width: 16px; height: 16px; }

.btn { font-weight: 700; padding: .65rem 1.1rem; border-radius: 10px; font-size: .85rem; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yellow); color: #000; }
.btn-primary:hover { background: var(--yellow-dim); }
.btn-block { width: 100%; }
.btn-ghost { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-muted); padding: .4rem .7rem; border-radius: 8px; }
.btn-ghost:hover { color: var(--yellow); background: rgba(255, 235, 59, .05); }
.btn-outline { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text); border: 1px solid var(--border-strong); padding: .5rem .9rem; border-radius: 10px; }
.btn-outline:hover { border-color: var(--yellow); color: var(--yellow); }
.btn-danger { background: var(--danger); color: #fff; font-size: .75rem; padding: .35rem .6rem; border-radius: 6px; font-weight: 700; }
.btn-danger:hover { background: #c62828; }
.btn-icon { color: var(--text-muted); padding: .3rem; border-radius: 6px; }
.btn-icon:hover { color: var(--yellow); }
.error-msg { color: var(--danger); font-size: .8rem; margin-top: .3rem; }

/* ---------- Layout ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(15, 15, 15, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: .9rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.tabs { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; display: flex; gap: .2rem; overflow-x: auto; }
.tab-btn { padding: .8rem 1rem; font-size: .8rem; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; transition: color .15s, border-color .15s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--yellow); border-bottom-color: var(--yellow); }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.25rem; }
.card + .card { margin-top: .75rem; }
.card-title { font-weight: 700; font-size: .95rem; margin-bottom: .25rem; }
.card-sub { color: var(--text-muted); font-size: .8rem; }
.kpi-value { font-family: 'Montserrat'; font-weight: 900; font-size: 2rem; color: var(--yellow); margin-top: .5rem; line-height: 1; }
.section-title { font-family: 'Montserrat'; font-weight: 900; font-size: 1.2rem; letter-spacing: .5px; text-transform: uppercase; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: .5rem; flex-wrap: wrap; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Badges / estados ---------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .65rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.badge-pend { background: rgba(255, 167, 38, .15); color: var(--warn); }
.badge-pagado { background: rgba(76, 175, 80, .15); color: var(--success); }
.badge-vencido { background: rgba(239, 83, 80, .15); color: var(--danger); }
.badge-tipo { background: rgba(255, 235, 59, .1); color: var(--yellow); }

/* ---------- Meses grid (calendario columnas más anchas) ---------- */
.meses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: .6rem; }
.mes-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: .8rem 1rem; display: flex; flex-direction: column; min-width: 0; }
.mes-card.current { border-color: var(--yellow); }

.mes-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-bottom: .55rem; border-bottom: 1px solid var(--border); margin-bottom: .55rem; }
.mes-name { font-family: 'Montserrat'; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text); }
.mes-name .mes-badge-inline { font-size: .55rem; color: var(--yellow); margin-left: .4rem; font-weight: 500; letter-spacing: 1.5px; }
.mes-totales { display: flex; gap: 1rem; }
.mes-total-block { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.mes-total-block .label { font-size: .55rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: .2rem; }
.mes-total-block .value { font-family: 'Montserrat'; font-weight: 700; font-size: .85rem; }
.mes-total-block.debe .value { color: var(--yellow); }
.mes-total-block.pagado .value { color: var(--success); }

.pagos-list { display: flex; flex-direction: column; gap: .15rem; }
.pago-item { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: .4rem; align-items: center; padding: .35rem .1rem; border-radius: 4px; }
.pago-item:hover { background: rgba(255, 235, 59, .03); }
.pago-item.pagado .pago-concepto, .pago-item.pagado .pago-monto, .pago-item.pagado .pago-dia { text-decoration: line-through; opacity: .55; }
.pago-concepto { font-weight: 500; font-size: .78rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pago-monto { font-family: 'Montserrat'; font-weight: 700; font-size: .8rem; color: var(--text); text-align: right; white-space: nowrap; }
.pago-dia { font-size: .65rem; color: var(--text-muted); white-space: nowrap; }
.check-btn { padding: .1rem; display: grid; place-items: center; }
.check-btn i { width: .95rem; height: .95rem; }

.editable { outline: none; border-radius: 3px; transition: background .1s; cursor: text; padding: 0 .15rem; }
.editable:hover { background: rgba(255, 255, 255, .04); }
.editable:focus { background: rgba(255, 235, 59, .08); box-shadow: inset 0 0 0 1px var(--yellow); }

.pago-add { display: grid; grid-template-columns: 1fr 90px 50px auto; gap: .3rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--border); }
.quick-input { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: .35rem .5rem; color: var(--text); font-size: .75rem; font-family: inherit; min-width: 0; }
.quick-input:focus { outline: none; border-color: var(--yellow); }
.add-btn { padding: 0; display: grid; place-items: center; border-radius: 5px; width: 32px; }
.add-btn i { width: 13px; height: 13px; }

.add-mes-wrap { grid-column: 1 / -1; display: flex; justify-content: center; margin-top: .5rem; }
.btn-add-mes { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-muted); padding: .6rem 1.2rem; border-radius: 8px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; display: inline-flex; align-items: center; gap: .4rem; transition: border-color .15s, color .15s; }
.btn-add-mes:hover { border-color: var(--yellow); color: var(--yellow); }
.tachado { text-decoration: line-through; opacity: .6; }

/* ---------- Actividades ---------- */
.act-group { margin-bottom: 1.5rem; }
.act-group-title { font-family: 'Montserrat'; font-weight: 900; font-size: .8rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--yellow); margin-bottom: .75rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.act-row { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--border); }
.act-row:first-of-type { border-top: none; }
.act-codigo { font-family: 'Montserrat'; font-weight: 900; font-size: .7rem; color: var(--yellow); background: rgba(255, 235, 59, .1); padding: .2rem .5rem; border-radius: 6px; white-space: nowrap; }
.act-nombre { font-weight: 700; font-size: .85rem; line-height: 1.3; }
.act-notas { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; font-style: italic; }

/* ---------- Modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .8); display: grid; place-items: center; padding: 1rem; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-weight: 700; font-size: 1rem; }
.modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 60; background: var(--bg-elev); border: 1px solid var(--border-strong); padding: .7rem 1.1rem; border-radius: 10px; font-size: .85rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.toast.err { border-color: var(--danger); color: var(--danger); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--yellow); }
