:root {
  --ip-bg: #f8f6f3; --ip-ink: #151a2b; --ip-ink-2: #2a3150; --ip-muted: #6b7280;
  --ip-line: #ece8e3; --ip-card: #ffffff; --ip-green: #1f9d6e; --ip-green-soft: #dff3ea; --ip-red: #d92d20;
}

/* Componentes ip-* de las pantallas propias anteriores al rediseño (Panel y cobranza).
   Los cargan las dos carcasas: el admin (admin/base_site.html, junto con ip.css) y la nueva
   (ui/base.html, junto con app.css). Se irán reemplazando módulo por módulo. */

.ip-title {
  position: relative; margin: 0 0 22px; padding-bottom: 12px;
  font-weight: 700; font-size: 40px; letter-spacing: -.02em; color: var(--ip-ink);
}
.ip-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 56px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--ip-green), transparent);
}

/* ---------- Panel general ---------- */
.ip-page { max-width: 1240px; }
.ip-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px; margin-bottom: 24px;
}
.ip-span-2 { grid-column: span 2; }
.ip-card {
  background: var(--ip-card); border: 1px solid var(--ip-line);
  border-radius: 22px; padding: 28px 30px;
  box-shadow: 0 1px 2px rgba(21, 26, 43, .04);
}
.ip-card-dark { background: var(--ip-ink); border-color: var(--ip-ink); color: #fff; }
.ip-label {
  margin: 0 0 14px; font-size: 12.5px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ip-muted);
}
.ip-card-dark .ip-label { color: #aab1c5; }
.ip-big { margin: 0 0 18px; font-size: 38px; font-weight: 700; letter-spacing: -.02em; }
.ip-num { margin: 0 0 6px; font-size: 40px; font-weight: 700; letter-spacing: -.02em; }
.ip-sub { color: var(--ip-muted); font-size: 15px; }
.ip-green { color: #3ddc97; }

.ip-rows { margin: 0; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 14px; }
.ip-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 16px; }
.ip-rows dt, .ip-rows dd { margin: 0; padding: 0; font-weight: 400; }
.ip-rows dd { font-weight: 500; }
.ip-rows-light { border-top-color: var(--ip-line); }
.ip-rows-light small { color: var(--ip-muted); }

.ip-h2 { font-size: 22px; font-weight: 700; margin: 8px 0 14px; }
.ip-list { padding: 0; overflow: hidden; }
.ip-list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 26px; border-bottom: 1px solid var(--ip-line);
}
.ip-list-row:last-child { border-bottom: 0; }
.ip-list-row .ip-sub { display: block; font-size: 13.5px; margin-top: 2px; }
.ip-pill {
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.ip-pill-ok { background: var(--ip-green-soft); color: #0f6a49; }
.ip-pill-err { background: #fde8e6; color: #b42318; }
.ip-pill-muted { background: #eeebe6; color: var(--ip-muted); }
.ip-pill-warn { background: #fef3d6; color: #8a5a00; }

/* ---------- Cobranza (vistas propias) ---------- */
.ip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ip-head-actions, .ip-row-actions, .ip-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ip-actions { margin-top: 14px; }
.ip-actions form { margin: 0; }
.ip-block { display: block; }
.ip-btn, a.ip-btn, button.ip-btn {
  display: inline-block; border: 0; border-radius: 12px; padding: 9px 16px; cursor: pointer;
  background: var(--ip-ink); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; line-height: 1.3;
}
.ip-btn:hover { background: var(--ip-ink-2); color: #fff; }
.ip-btn-light, a.ip-btn-light { background: #fff; color: var(--ip-ink); border: 1px solid var(--ip-line); }
.ip-btn-light:hover { background: #f4f1ed; color: var(--ip-ink); }
.ip-btn-danger, a.ip-btn-danger, button.ip-btn-danger { background: var(--ip-red); }
.ip-btn-danger:hover { background: #b42318; }
.ip-link-danger { color: var(--ip-red); font-weight: 600; }
.ip-search, .ip-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.ip-search input[type=search] { flex: 1; min-width: 220px; border: 1px solid var(--ip-line); border-radius: 12px; padding: 10px 14px; background: #fff; }
.ip-filtros label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.ip-table-wrap { padding: 0; overflow-x: auto; margin-bottom: 18px; }
.ip-table { width: 100%; border-collapse: collapse; }
.ip-table th, .ip-table td { padding: 12px 14px; border-bottom: 1px solid var(--ip-line); text-align: left; vertical-align: middle; }
.ip-table thead th { color: var(--ip-muted); font-size: 13px; font-weight: 600; background: #faf8f5; }
.ip-table tfoot th, .ip-table tfoot td { border-bottom: 0; font-size: 16px; }
.ip-num-col { text-align: right !important; white-space: nowrap; }
.ip-anulado td { color: var(--ip-muted); text-decoration: line-through; }
.ip-anulado td:last-child { text-decoration: none; }
.ip-form { display: block; padding: 18px 22px; margin: 0 0 18px; }
.ip-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-width: 520px; }
.ip-field label, .ip-field .ip-label { font-weight: 600; }
.ip-field ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 16px; }
.ip-field .errorlist { color: var(--ip-red); }
.ip-aviso { background: #fef3d6; color: #8a5a00; border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; }
.ip-aviso-err { background: #fde8e6; color: #912018; }
.ip-servicio { padding: 0; margin-bottom: 14px; overflow: hidden; }
.ip-grid-2 { grid-template-columns: 1fr 1fr; }
.ip-paginacion { display: flex; gap: 16px; align-items: center; margin: 8px 0 18px; }


/* Campos dentro de las pantallas anteriores: tamaño natural (app.css los pone a ancho completo). */
.ip-page :is(input:not([type=checkbox]):not([type=radio]), select) { width: auto; min-height: 0; padding: 9px 12px; border-radius: 12px; }
.ip-page textarea { min-height: 0; border-radius: 12px; }
.ip-page .ip-field :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { width: 100%; }

@media (max-width: 1000px) {
  .ip-grid { grid-template-columns: 1fr; }
  .ip-span-2 { grid-column: auto; }
}
