/* ===================================================
   The Place 818 — Pantalla del Cajero
=================================================== */

/* ---- Layout ---- */
.cajero-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---- Cards de sección ---- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: 1.25rem;
}
.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-bottom: 1.1rem;
    text-transform: uppercase;
    color: var(--color-muted);
}

.sec-tasa    { border-left-color: #3b82f6; }
.sec-pagos   { border-left-color: #10b981; }
.sec-gastos  { border-left-color: #ef4444; }
.sec-consumo { border-left-color: #f59e0b; }
.sec-resumen { border-left-color: #8b5cf6; }

/* ---- Banner caja cerrada ---- */
.banner-cerrado {
    background: rgba(233, 69, 96, 0.12);
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 0.65rem 1rem;
    text-align: center;
    text-transform: uppercase;
}

/* ---- Tasa BCV ---- */
.tasa-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.tasa-row input {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: right;
    letter-spacing: 0.5px;
}
.tasa-activa {
    margin-top: 0.85rem;
    padding: 0.6rem 0.85rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tasa-activa strong {
    color: #3b82f6;
    font-size: 1rem;
    font-weight: 800;
}

/* ---- Métodos de pago ---- */
.metodo-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 0.6rem;
    overflow: hidden;
}
.metodo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
}
.metodo-icon  { font-size: 1rem; }
.metodo-label { font-size: 0.85rem; font-weight: 600; flex: 1; }
.metodo-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tag-bs  { background: rgba(16,185,129,0.12); color: #10b981; }
.tag-usd { background: rgba(59,130,246,0.12); color: #3b82f6; }

.metodo-body {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
}
.input-currency {
    font-size: 0.8rem;
    color: var(--color-muted);
    font-weight: 600;
    min-width: 20px;
}
.metodo-input {
    flex: 1;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    padding: 0.55rem 0.75rem;
    text-align: right;
    transition: border-color 0.2s;
}
.metodo-input:focus { border-color: #10b981; }
.metodo-conversion {
    font-size: 0.82rem;
    color: #10b981;
    font-weight: 600;
    min-width: 90px;
    text-align: right;
    white-space: nowrap;
}

/* ---- Totales de sección ---- */
.section-totales {
    border-top: 1px solid var(--color-border);
    margin-top: 0.85rem;
    padding-top: 0.85rem;
}
.totales-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.totales-row > span:first-child {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-weight: 600;
}
.totales-nums {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}
.t-usd { font-size: 1.15rem; font-weight: 800; color: #10b981; }
.t-bs  { font-size: 0.78rem; color: var(--color-muted); }

/* ---- Botones de acción ---- */
.btn-green  { background: #10b981; color: #fff; }
.btn-green:hover:not(:disabled) { background: #059669; }
.btn-red    { background: #ef4444; color: #fff; }
.btn-red:hover:not(:disabled)   { background: #dc2626; }
.btn-amber  { background: #f59e0b; color: #111; font-weight: 700; }
.btn-amber:hover:not(:disabled) { background: #d97706; }
.btn-cerrar {
    background: transparent;
    border: 2px solid var(--color-accent) !important;
    color: var(--color-accent);
    font-size: 0.95rem;
    padding: 0.85rem;
    letter-spacing: 0.5px;
}
.btn-cerrar:hover:not(:disabled) { background: var(--color-accent); color: #fff; }

/* ---- Formulario de agregar ---- */
.add-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.conversion-hint {
    font-size: 0.82rem;
    color: var(--color-muted);
    text-align: right;
    margin-top: -0.4rem;
    margin-bottom: 0.65rem;
    min-height: 1.1rem;
}
.conversion-hint span { color: #10b981; font-weight: 600; }

/* ---- Lista de ítems (gastos / consumo) ---- */
.lista-items {
    margin-top: 0.25rem;
}
.item-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}
.item-row:last-child { border-bottom: none; }
.item-info {
    flex: 1;
    min-width: 0;
}
.item-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
    flex-wrap: wrap;
}
.item-desc {
    font-size: 0.82rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
}
.item-monto-usd { font-size: 0.9rem; font-weight: 700; }
.item-monto-bs  { font-size: 0.72rem; color: var(--color-muted); }

/* Badges */
.badge-cat, .badge-resp {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}
.cat-materia_prima { background: rgba(16,185,129,0.15); color: #10b981; }
.cat-operativos    { background: rgba(59,130,246,0.15);  color: #3b82f6; }
.cat-nomina        { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.cat-otros         { background: rgba(139,92,246,0.15);  color: #8b5cf6; }
.badge-resp        { background: rgba(239,68,68,0.15);   color: #ef4444; }

.btn-del {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 4px;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.3rem 0.45rem;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.btn-del:hover { background: rgba(239, 68, 68, 0.12); border-color: #ef4444; }

/* ---- Resumen del día ---- */
.resumen-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}
.resumen-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem;
}
.resumen-card.full { grid-column: 1 / -1; background: rgba(255,255,255,0.05); }
.resumen-label-sm {
    display: block;
    font-size: 0.7rem;
    color: var(--color-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.resumen-num {
    font-size: 1.1rem;
    font-weight: 800;
}
.num-green  { color: #10b981; }
.num-red    { color: #ef4444; }
.num-amber  { color: #f59e0b; }
.num-purple { color: #8b5cf6; }
.num-up     { color: #10b981; }
.num-down   { color: #ef4444; }

/* ---- Estado vacío ---- */
.empty-msg {
    color: var(--color-muted);
    font-size: 0.85rem;
    padding: 0.75rem 0;
    text-align: center;
}

/* ---- Toast ---- */
.toast {
    border-radius: 8px;
    bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    left: 50%;
    min-width: 220px;
    padding: 0.75rem 1.5rem;
    position: fixed;
    text-align: center;
    transform: translateX(-50%);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: opacity 0.35s;
}
.toast-ok  { background: #10b981; color: #fff; }
.toast-err { background: #ef4444; color: #fff; }

/* ---- Estado cerrado ---- */
body.is-cerrado .metodo-input,
body.is-cerrado .add-form input,
body.is-cerrado .add-form select,
body.is-cerrado .add-form textarea,
body.is-cerrado #observaciones {
    opacity: 0.55;
    pointer-events: none;
}
body.is-cerrado .hide-cerrado { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 420px) {
    .cajero-main    { padding: 0.65rem 0.65rem 3rem; }
    .resumen-grid   { grid-template-columns: 1fr; }
    .form-grid-2    { grid-template-columns: 1fr; }
    .metodo-conversion { min-width: 72px; font-size: 0.75rem; }
}
