/* ═══ BLOQUE 3 — Generador Modelo 303 ═══ */

/* ── Form header ── */
.m303-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 16px;
}
.m303-header-icon { font-size: 28px; }
.m303-header-title { font-size: 18px; font-weight: 800; }
.m303-header-sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.m303-header-right { margin-left: auto; text-align: right; }
.m303-header-periodo { font-size: 20px; font-weight: 800; }
.m303-header-limit { font-size: 10px; opacity: 0.8; }

/* ── Selector ── */
.m303-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.m303-trim-btn {
    padding: 8px 18px;
    border: 2px solid var(--brd);
    border-radius: 10px;
    background: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: var(--t2);
    transition: all .15s;
}
.m303-trim-btn:hover { border-color: var(--acc); color: var(--acc); }
.m303-trim-btn.active {
    background: #166534;
    color: #fff;
    border-color: #166534;
}

/* ── Section ── */
.m303-section {
    background: var(--card, #fff);
    border: 1px solid var(--brd);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}
.m303-section-h {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--brd);
    display: flex;
    align-items: center;
    gap: 8px;
}
.m303-section-body { padding: 12px 14px; }

/* ── Casilla rows ── */
.m303-row {
    display: grid;
    grid-template-columns: 50px 1fr 100px 100px;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--brd);
    font-size: 12px;
}
.m303-row:last-child { border-bottom: none; }
.m303-row-cas {
    font-weight: 700;
    color: var(--t3);
    font-size: 10px;
    text-align: center;
    background: var(--bg2);
    padding: 3px 6px;
    border-radius: 4px;
}
.m303-row-label { color: var(--t2); }
.m303-row-val {
    text-align: right;
    font-weight: 600;
    color: var(--t1);
    font-family: 'SF Mono', 'Consolas', monospace;
}

@media(max-width:600px) {
    .m303-row { grid-template-columns: 40px 1fr 80px; }
    .m303-row > :nth-child(3) { display: none; }
}

/* ── Result box ── */
.m303-result {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin: 12px 0;
}
.m303-result.ingresar { background: #fee2e2; border: 2px solid #fca5a5; }
.m303-result.devolver { background: #dcfce7; border: 2px solid #86efac; }
.m303-result.compensar { background: #dbeafe; border: 2px solid #93c5fd; }
.m303-result.cero { background: #f3f4f6; border: 2px solid #d1d5db; }
.m303-result-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 4px;
}
.m303-result-val { font-size: 28px; font-weight: 800; }
.m303-result-action {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
}

/* ── Detail list ── */
.m303-detail-toggle {
    border: none;
    background: none;
    font-size: 11px;
    color: var(--acc);
    cursor: pointer;
    padding: 6px 0;
    font-weight: 600;
}
.m303-detail-toggle:hover { text-decoration: underline; }
.m303-detail-list { display: none; }
.m303-detail-list.show { display: block; }

.m303-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 8px;
}
.m303-detail-table th {
    text-align: left;
    padding: 5px 6px;
    background: var(--bg2);
    font-size: 10px;
    font-weight: 600;
    color: var(--t3);
    border-bottom: 1px solid var(--brd);
}
.m303-detail-table td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--brd);
    color: var(--t1);
}
.m303-detail-table tr:hover { background: var(--bg2); }

/* ── Actions bar ── */
.m303-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--brd);
}
