/* ===== Tarjetas de mermas ===== */
.hint-busqueda {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 14px;
}
.mermas-tarjetas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.merma-tarjeta {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    background: #fff;
}
.merma-tarjeta-header { margin-bottom: 6px; }
.merma-tarjeta-valor {
    font-size: 1.6em;
    font-weight: 700;
    margin: 8px 0 2px;
}
.merma-tarjeta-desde {
    font-size: 0.8em;
    color: #777;
    margin-bottom: 10px;
}
.td-vacio { color: #888; font-style: italic; }
.badge-activo {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
}

/* ===== Botones ===== */
.btn-barra {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
}
.btn-secundario {
    background: var(--header-bg);
    color: #fff;
}
.btn-secundario:hover { background: #16301f; }
.icono-accion {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    color: #555;
}
.icono-accion:hover { color: #000; }
.icono-editar { color: #1976d2; }
.icono-borrar { color: #c62828; }
.acciones-wrapper { display: flex; gap: 4px; justify-content: center; }

/* ===== Modales ===== */
.admin-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.admin-modal-overlay.activo {
    display: flex;
}
.confirmation-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.confirmation-card h3 {
    margin-top: 0;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.confirmation-card .form-group {
    margin-bottom: 14px;
}
.confirmation-card .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9em;
}
.confirmation-card input[type="text"],
.confirmation-card input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}
.confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.btn-cancelar {
    background: #eee;
    color: #333;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
}
.btn-confirmar {
    background: var(--header-bg);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
}

/* ===== Histórico (details/summary) ===== */
.mermas-historial-detalle {
    margin-top: 10px;
}
.mermas-historial-detalle summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Ajuste: --header-bg no existe en el panel de Reparto (solo en Condóminos).
   Se sustituye por --primary-color, ya definida en caudalimetros-admin.css. */
#panel-caudal-medias-aforos .btn-secundario,
#panel-caudal-medias-aforos .btn-confirmar {
    background: var(--primary-color);
}
#panel-caudal-medias-aforos .btn-secundario:hover {
    background: var(--secondary-color);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#medias-aforos-table {
    min-width: 1400px;
    border-collapse: collapse;
}   