/* ===================================================
   YEMMA ISP — Componentes de la pantalla de clientes
   =================================================== */

/* ===================================================
   Header de la pantalla de clientes
   =================================================== */

.clientes-screen {
    padding-bottom: .5rem;
}

.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon { width: 32px; height: 32px; }

.brand-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--navy);
}

/* ===================================================
   Barra de mes
   =================================================== */

.month-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
}

.month-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    color: var(--navy);
    background: none;
    border: none;
    border-radius: 50%;
    line-height: 1;
    transition: background .12s;
    -webkit-tap-highlight-color: transparent;
}

.month-arrow:active { background: rgba(44, 123, 229, 0.14); }

.month-label {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink);
    text-transform: capitalize;
    min-width: 140px;
    display: block;
    line-height: 1;
}

.month-label.current { color: var(--navy); }

/* ===================================================
   Barra de resumen
   =================================================== */

.summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
}

.summary-item { text-align: center; }

.summary-num {
    display: block;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .95rem;
    color: var(--ink);
}

.summary-num.green { color: var(--paid); }
.summary-num.warn  { color: var(--warn); }

.summary-label {
    display: block;
    font-size: 0.62rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 2px;
}

.summary-divider {
    width: 1px;
    height: 30px;
    background: var(--line);
}

/* ===================================================
   Buscador
   =================================================== */

.search-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .92rem;
    background: var(--surface);
    color: var(--ink);
    outline: none;
    margin-bottom: 10px;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}

.search-input:focus {
    border-color: var(--navy);
    box-shadow: var(--glow-navy);
}

.search-input::placeholder { color: var(--muted); }

/* ===================================================
   Filtros
   =================================================== */

.filter-row {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all .15s ease;
    min-height: 34px;
}

.filter-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* ===================================================
   Lista de clientes
   =================================================== */

.client-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-size: .88rem;
}

.btn-add-first {
    margin-top: 1rem;
    padding: 12px 24px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .9rem;
}

/* Card de cliente */
.client-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
    gap: 10px;
    animation: fadeSlide .18s ease both;
    border-left: 3px solid transparent;
    transition: border-color .15s;
}

.client-card.card-suspendido { border-left-color: var(--warn); }
.client-card.card-baja       { opacity: .55; border-left-color: var(--muted); }

.client-card[data-hidden="true"] { display: none; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.card-name {
    font-weight: 600;
    font-size: .86rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-suspended {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--warn);
    background: var(--warn-bg);
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(217, 91, 42, .25);
    white-space: nowrap;
    flex-shrink: 0;
}

.card-meta {
    font-size: 0.69rem;
    color: var(--muted);
    margin-top: 2px;
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Stamp */
.stamp {
    border-radius: 999px;
    padding: 6px 12px;
    font-family: var(--font-display);
    font-size: .64rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: transparent;
    cursor: pointer;
    transition: transform .12s ease, opacity .12s;
    -webkit-tap-highlight-color: transparent;
    min-height: 34px;
    display: flex;
    align-items: center;
}

.stamp.pending {
    border: 2px dashed var(--line);
    color: var(--muted);
}

.stamp.paid {
    border: 2px solid var(--paid);
    color: var(--paid);
    background: var(--paid-bg);
    transform: rotate(-3deg);
    box-shadow: inset 0 0 0 1px var(--paid);
}

.stamp:active {
    opacity: .7;
    transform: scale(.94);
}

.stamp.paid:active {
    transform: rotate(-3deg) scale(.94);
}

.stamp.loading {
    opacity: .5;
    pointer-events: none;
}

.stamp-readonly {
    border-radius: 999px;
    padding: 6px 12px;
    font-family: var(--font-display);
    font-size: .64rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stamp-readonly.pending { border: 2px dashed var(--line); color: var(--muted); }
.stamp-readonly.paid    { border: 2px solid var(--paid); color: var(--paid); transform: rotate(-3deg); display: inline-block; }
.stamp-readonly.exento  { border: 2px dashed var(--navy-light); color: var(--navy-light); background: rgba(26, 100, 153, 0.08); }

/* ===================================================
   Historial de pagos (bottom sheet del cliente)
   =================================================== */

.section-sep {
    height: 1px;
    background: var(--line);
    margin: 1.25rem 0;
}

.historial-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin-bottom: .75rem;
}

.historial-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.historial-mes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line);
    background: var(--bg-elevated);
    cursor: default;
    transition: border-color .12s;
}

.historial-mes.pagado {
    border-color: var(--paid);
    background: var(--paid-bg);
}

.historial-mes.sin-info {
    opacity: .4;
}

.historial-mes-label {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--muted);
    text-transform: uppercase;
    text-align: center;
}

.historial-mes-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ===================================================
   Métodos de pago (modal pago)
   =================================================== */

.metodos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: .5rem;
}

.metodo-btn {
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line);
    background: var(--bg-elevated);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    transition: all .12s;
    min-height: 42px;
}

.metodo-btn.active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

/* ===================================================
   Form grid
   =================================================== */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.form-grid .full-width { grid-column: 1 / -1; }

/* En móvil muy pequeño, una sola columna */
@media (max-width: 360px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full-width { grid-column: 1; }
    .historial-grid { grid-template-columns: repeat(3, 1fr); }
    .metodos-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===================================================
   Arqueo / Configuración / Historial
   =================================================== */

.expense-list { display: flex; flex-direction: column; gap: 8px; }

.expense-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.expense-info { min-width: 0; }
.expense-concepto { font-weight: 600; font-size: .92rem; color: var(--ink); }
.expense-meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.expense-monto { font-family: var(--font-mono); font-weight: 700; color: var(--warn); white-space: nowrap; }
.expense-monto.positivo { color: var(--paid); }

.btn-remove-row {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.btn-remove-row:active { background: var(--warn-bg); color: var(--warn); }

.finance-card.finance-warn .finance-amount { color: var(--warn); }
.finance-card.finance-highlight { border: 1.5px solid var(--navy); }

.plan-edit-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
}
.plan-edit-title { font-weight: 700; color: var(--navy); margin-bottom: 8px; font-size: .92rem; }
.plan-edit-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; }
.plan-edit-grid .form-group { margin: 0; }
@media (max-width: 480px) {
    .plan-edit-grid { grid-template-columns: 1fr; }
}

.log-list { display: flex; flex-direction: column; gap: 6px; }
.log-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .82rem;
}
.log-accion { font-weight: 600; color: var(--ink); }
.log-detalle { color: var(--muted); }
.log-fecha { color: var(--muted); font-family: var(--font-mono); font-size: .76rem; white-space: nowrap; }

/* ===================================================
   Badges de tipo (ingresos extra)
   =================================================== */

.badge-tipo {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}

.badge-reclamo {
    color: var(--suspended);
    background: var(--suspended-bg);
    border: 1px solid rgba(226, 85, 91, .3);
}

.badge-instalacion {
    color: var(--navy-light);
    background: rgba(78, 155, 255, 0.12);
    border: 1px solid rgba(78, 155, 255, .3);
}

/* ===================================================
   Toggle de tipo (modal ingreso extra)
   =================================================== */

.tipo-toggle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: .5rem;
}

.tipo-btn {
    padding: 9px 6px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line);
    background: var(--bg-elevated);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    min-height: 40px;
}

.tipo-btn.active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

/* ===================================================
   Selector de cliente tipo "combobox" (arqueo → ingreso extra)
   =================================================== */

.client-picker { position: relative; }

.client-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 4px);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
    animation: fadeIn .15s ease;
}

.client-suggestions.show { display: block; }

.client-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-size: .85rem;
    text-align: left;
}

.client-suggestion:last-child { border-bottom: none; }

.cs-nombre { font-weight: 600; }
.cs-meta { font-size: .74rem; color: var(--muted); font-family: var(--font-mono); }

.client-suggestion-empty {
    padding: 12px;
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
}

.client-picked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 13px;
    border: 1.5px solid var(--navy);
    border-radius: var(--radius-sm);
    background: rgba(44, 123, 229, 0.1);
    color: var(--ink);
    font-size: .88rem;
    font-weight: 600;
}

.client-picked button {
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    padding: 2px 6px;
}

.client-picked button:active { color: var(--suspended); }

/* ===================================================
   Reclamos (dentro del modal de cliente)
   =================================================== */

.reclamos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: .75rem;
}

.reclamo-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--navy);
    border-radius: var(--radius-md);
    animation: fadeInUp .2s ease both;
}

.reclamo-info { min-width: 0; flex: 1; }
.reclamo-titulo { font-weight: 600; font-size: .9rem; color: var(--ink); }
.reclamo-desc { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.reclamo-meta { font-size: .72rem; color: var(--muted); margin-top: 4px; font-family: var(--font-mono); }

.reclamo-estado {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: var(--bg-elevated);
    color: var(--ink);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.reclamo-estado.estado-abierto    { border-color: var(--suspended); color: var(--suspended); background: var(--suspended-bg); }
.reclamo-estado.estado-en_proceso { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.reclamo-estado.estado-resuelto   { border-color: var(--paid); color: var(--paid); background: var(--paid-bg); }

.reclamo-form {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 8px;
    animation: fadeInUp .2s ease both;
}

.quick-btn-accent {
    border-color: var(--navy);
    background: rgba(44, 123, 229, 0.08);
}
