/* ==========================================================================
   MONSTER · Tema 2026.2 — «Bisel»

   La app es un aparato: el bisel (barra superior + riel lateral) es negro,
   la pantalla (contenido) es papel claro. El amarillo del logo es la única
   señal luminosa: selección, foco, marca. El rojo queda reservado para la
   acción principal y lo urgente.

   Capa de diseño sobre styles.css. No toca estructura, ids ni data-*.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* Solo para el logotipo: geométrica y rotunda, como el wordmark original. */
@font-face {
  font-family: "Monster Brand";
  src: url("/fonts/poppins-800-latin.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Marca */
  --red: #e11d2e;
  --red-dark: #b31222;
  --red-soft: #fdecec;
  --yellow: #f5e400;
  --yellow-dim: #d8c900;
  --yellow-soft: #fffbe0;
  --night: #0a0a0b;
  --night-2: #131315;
  --night-3: #1b1b1e;
  --night-line: rgba(255, 255, 255, 0.08);
  --night-text: rgba(255, 255, 255, 0.76);
  --night-muted: rgba(255, 255, 255, 0.46);

  /* Papel y tinta */
  --ink: #111110;
  --ink-soft: #33332e;
  --muted: #6f6f66;
  --muted-light: #9a9a90;
  --bg: #f2f2ee;
  --surface: #ffffff;
  --surface-2: #fafaf6;
  --line: #e4e4db;
  --line-strong: #d1d1c6;

  /* Estados */
  --success: #16794a;
  --success-soft: #e9f6ee;
  --warning: #a8500a;
  --warning-soft: #fdf3e5;
  --danger: #c81b25;
  --danger-soft: #fdeeee;
  --info: #1f4fb8;
  --info-soft: #eef2fd;

  /* Forma */
  --radius: 10px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 16, 0.05);
  --shadow: 0 18px 40px -32px rgba(17, 17, 16, 0.5);

  --topbar-h: 60px;
  --sidebar-w: 256px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-brand: "Monster Brand", "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas,
    "Liberation Mono", monospace;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(245, 228, 0, 0.55);
}

.topbar :focus-visible,
.sidebar :focus-visible,
.mobile-nav :focus-visible,
.cmdk :focus-visible {
  outline-color: var(--yellow);
  box-shadow: none;
}

h1,
h2,
h3,
.brand-text,
.stat-value,
.login-heading h2,
.login-brand-copy h1 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--yellow);
  box-shadow: 0 0 0 1px rgba(17, 17, 16, 0.18);
}

.mono {
  font-family: var(--font-mono);
}

.num,
.stat-value,
.cell-mono,
.doc-number,
.bar-list-value {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Barra superior — el bisel
   -------------------------------------------------------------------------- */
.topbar {
  height: var(--topbar-h);
  gap: 8px;
  padding: 0 12px;
  background: var(--night);
  border-bottom: 1px solid var(--night-line);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.topbar::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--yellow);
}

.topbar.is-scrolled {
  box-shadow: 0 18px 32px -30px rgba(0, 0, 0, 0.9);
}

.brand {
  gap: 10px;
  color: #fff;
}

.brand-mark {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid var(--yellow);
  border-radius: 9px;
  background: transparent;
  color: var(--yellow);
  box-shadow: none;
  display: grid;
  place-items: center;
}

.brand-mark svg {
  width: 14px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-text {
  font-family: var(--font-brand);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--yellow);
}

.brand-text small {
  margin-top: 3px;
  font-family: var(--font);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.36em;
  color: rgba(255, 255, 255, 0.4);
}

.topbar .icon-btn {
  color: rgba(255, 255, 255, 0.7);
}

.topbar .icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.topbar .user-chip-text strong {
  color: #fff;
}

.topbar .user-chip-text small {
  color: rgba(255, 255, 255, 0.48);
}

.topbar .btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.84);
}

.topbar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  color: var(--ink-soft);
}

.icon-btn:hover {
  background: #f0f0ea;
  color: var(--ink);
}

.alerts-badge {
  border-color: var(--night);
}

.avatar {
  width: 34px;
  height: 34px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  box-shadow: none;
}

.user-chip {
  padding: 3px 4px;
  gap: 9px;
}

.user-chip-text strong {
  font-size: 12.5px;
  max-width: 210px;
}

/* Botón de búsqueda */
.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
  font-weight: 600;
}

.topbar-search:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
  box-shadow: none;
}

.topbar-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Riel de navegación
   -------------------------------------------------------------------------- */
.sidebar {
  padding: 14px 12px 18px;
  background: var(--night);
  border-right: 1px solid var(--night-line);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar.is-open {
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.55);
}

.sidebar-store {
  margin: 0 0 6px;
  padding: 10px 11px;
  border: 1px solid var(--night-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-store .eyebrow {
  color: var(--night-muted);
  font-size: 9.5px;
}

.sidebar-store .eyebrow::before {
  box-shadow: none;
}

.sidebar-store strong {
  margin-top: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.nav {
  gap: 0;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 14px;
}

.nav-group:first-child {
  margin-top: 6px;
}

.nav-group-label {
  margin: 0;
  padding: 0 10px 6px;
  color: var(--night-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  min-height: 38px;
  gap: 10px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--night-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-link::before {
  display: none;
}

.nav-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.62;
  transition: opacity 0.14s ease;
}

.nav-link .nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-link:hover svg {
  opacity: 1;
}

.nav-link.is-active {
  background: rgba(245, 228, 0, 0.1);
  color: var(--yellow);
  font-weight: 600;
}

.nav-link.is-active svg {
  opacity: 1;
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--yellow);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 8px 2px;
  border-top: 1px solid var(--night-line);
}

.sidebar-footer p,
.sidebar-footer .muted {
  color: var(--night-muted);
}

.sidebar-footer .btn {
  width: 100%;
  border-color: var(--night-line);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
}

.sidebar-footer .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Contenido — la pantalla
   -------------------------------------------------------------------------- */
.main {
  padding: 20px 14px 56px;
}

.page-head {
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  margin-top: 6px;
  font-size: clamp(25px, 3.2vw, 32px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.page-head p {
  margin-top: 7px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 64ch;
  color: var(--muted);
}

.page-actions {
  gap: 8px;
}

.card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
}

.card-header {
  margin-bottom: 14px;
  gap: 12px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-header p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.grid > .card:has(> a.btn) {
  transition: border-color 0.16s ease, background 0.16s ease;
}

.grid > .card:has(> a.btn):hover {
  transform: none;
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: none;
}

.grid > .card:has(> a.btn) > a.btn {
  margin-top: 12px;
}

/* Cifras */
.stat-card {
  padding: 16px 18px;
  border-radius: var(--radius);
}

/* Cinco cifras caben en una fila; si no, se acomodan solas. */
.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.stat-value {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stat-hint {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn {
  border-radius: 8px;
  font-weight: 650;
  font-size: 13.5px;
  border-width: 1px;
  transition: background 0.14s ease, border-color 0.14s ease,
    color 0.14s ease, transform 0.1s ease;
}

.btn-primary {
  background: var(--red);
  border-color: var(--red-dark);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-primary:hover {
  background: var(--red-dark);
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-dark {
  background: var(--night);
  border-color: var(--night);
  color: #fff;
}

.btn-dark:hover {
  background: var(--night-3);
  transform: none;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: #b9b9ad;
  color: var(--ink);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: #f3c4c6;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fbe0e2;
}

.btn-sm {
  border-radius: 7px;
  font-size: 12.5px;
}

.btn-link {
  color: var(--red);
  font-weight: 650;
}

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.form-group label,
.form-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.input,
.select,
.textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="date"],
select,
textarea {
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
select:hover,
textarea:hover {
  border-color: #b9b9ad;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(245, 228, 0, 0.45);
}

/* Los campos numéricos no llevan las flechitas del navegador: rompen el
   bisel, se comen el borde de foco y no aportan nada en un POS táctil. */
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6f66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
}

.form-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--red);
}

.fieldset-note {
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
}

/* --------------------------------------------------------------------------
   Tablas
   -------------------------------------------------------------------------- */
.table-wrap {
  border-radius: 8px;
  border-color: var(--line);
}

thead th {
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 11px 12px;
  border-top: 1px solid #eeeee7;
}

tbody tr:hover {
  background: var(--surface-2);
}

/* Usuarios: cuatro acciones por fila; en dos columnas la fila respira. */
#users-table .table-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-width: 138px;
}

#users-table .table-actions .btn {
  padding: 0 6px;
}

#users-table td:first-child {
  min-width: 136px;
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.empty-state {
  padding: 34px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
}

.empty-state strong {
  font-family: var(--font-display);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Sellos, avisos y pestañas
   -------------------------------------------------------------------------- */
.badge {
  border-radius: var(--radius-xs);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 1px;
}

.badge-role {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--yellow);
  letter-spacing: 0.1em;
}

.notice {
  border-left: 3px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 12.5px;
}

.notice-warning {
  border-left-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.tabs {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 3px;
  gap: 2px;
}

.tab {
  border-radius: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.tab.is-active {
  background: var(--night);
  color: var(--yellow);
}

/* --------------------------------------------------------------------------
   Componentes de dominio
   -------------------------------------------------------------------------- */
.alert-card {
  border-radius: 8px;
  border-color: var(--line);
  box-shadow: none;
}

.alert-card.alert-prestamo {
  border-left: 3px solid var(--yellow-dim);
}

.alert-section-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cash-banner {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
}

.cash-banner-main strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* El gráfico es su propio contenedor: si la tarjeta es angosta, los valores
   por barra se ocultan y queda el tooltip. */
.chart-bars {
  container-type: inline-size;
}

@container (max-width: 440px) {
  .chart-bar-value {
    display: none;
  }
}

.chart-bar-track {
  display: flex;
  align-items: flex-end;
  width: min(46px, 100%);
  height: 130px;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
}

.chart-bar-fill {
  width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--night);
}

.chart-bar-value,
.bar-list-value {
  font-family: var(--font-mono);
  font-size: 11px;
}

.bar-list-track {
  background: #ecece5;
  border-radius: 3px;
}

.bar-list-fill {
  border-radius: 3px;
  background: var(--red);
}

.data-row {
  border-color: var(--line);
}

.data-row-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.filter-bar {
  border-radius: var(--radius);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

.pos-cart-card {
  border-radius: var(--radius);
}

.cart-totals,
.cart-total-row {
  font-variant-numeric: tabular-nums;
}

.detail-title {
  font-family: var(--font-display);
}

.device-card {
  border-radius: var(--radius);
  box-shadow: none;
}

.kv {
  border-color: var(--line);
}

.kv dt {
  font-size: 11.5px;
  color: var(--muted);
}

.kv dd {
  font-size: 13px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Compras de usados y préstamos
   -------------------------------------------------------------------------- */
.purchase-item,
.draft-item {
  border-radius: 8px;
  border-color: var(--line);
  background: var(--surface-2);
}

.selected-person {
  border-radius: 8px;
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.purchase-total,
.draft-total strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.draft-total {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}

.draft-total strong {
  margin-top: 3px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Modales
   -------------------------------------------------------------------------- */
.swal2-popup {
  border-radius: 12px !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 40px 80px -44px rgba(17, 17, 16, 0.6) !important;
}

.swal2-title {
  font-family: var(--font-display) !important;
  font-size: 22px !important;
  letter-spacing: -0.025em !important;
}

/* El botón de cancelar de los modales usa el mismo fantasma que el resto:
   SweetAlert lo trae gris azulado y rompe la paleta. */
.swal2-styled.swal2-cancel {
  background: var(--surface) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--ink) !important;
}

.swal2-styled.swal2-cancel:hover {
  background: var(--surface-2) !important;
  border-color: #b9b9ad !important;
}

.swal2-styled.swal2-confirm {
  border: 1px solid var(--red) !important;
}

.swal2-styled.swal2-confirm:hover {
  background: var(--red-dark) !important;
}

/* Los iconos de SweetAlert traen su propia paleta; se alinean a los estados
   del sistema sin perder el significado. */
.swal2-icon.swal2-error {
  border-color: var(--danger);
  color: var(--danger);
}

.swal2-icon.swal2-error [class^="swal2-x-mark-line"] {
  background-color: var(--danger);
}

.swal2-icon.swal2-warning {
  border-color: var(--warning);
  color: var(--warning);
}

.swal2-icon.swal2-info {
  border-color: var(--info);
  color: var(--info);
}

.swal2-icon.swal2-question {
  border-color: var(--muted);
  color: var(--muted);
}

.swal2-icon.swal2-success {
  border-color: var(--success);
  color: var(--success);
}

.swal2-icon.swal2-success [class^="swal2-success-line"] {
  background-color: var(--success);
}

.swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(22, 121, 74, 0.3);
}

.swal2-container.swal2-backdrop-show {
  background: rgba(10, 10, 11, 0.6) !important;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   Paleta de comandos (Ctrl / Cmd + K) — panel oscuro, como el bisel
   -------------------------------------------------------------------------- */
.cmdk {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 24px;
}

.cmdk-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 11, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: cmdk-fade 0.16s ease both;
}

.cmdk-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 2px solid var(--yellow);
  border-radius: 10px;
  background: var(--night-2);
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.8);
  animation: cmdk-in 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cmdk-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cmdk-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cmdk-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--night-line);
}

.cmdk-field svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: var(--yellow);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cmdk-input,
.cmdk .cmdk-input {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-color: transparent;
  color: #fff;
  font-size: 14.5px;
  outline: none;
  box-shadow: none;
}

.cmdk-input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.cmdk-input:focus,
.cmdk .cmdk-input:focus {
  border: 0;
  background-color: transparent;
  box-shadow: none;
}

.cmdk-kbd,
.cmdk-foot kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 700;
}

.cmdk-list {
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
}

.cmdk-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.cmdk-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmdk-item-group {
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cmdk-item.is-active,
.cmdk-item:hover {
  background: rgba(245, 228, 0, 0.14);
  color: var(--yellow);
}

.cmdk-item.is-active svg,
.cmdk-item:hover svg {
  opacity: 1;
}

.cmdk-empty {
  margin: 0;
  padding: 22px 16px 26px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
  text-align: center;
}

.cmdk-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 9px 15px;
  border-top: 1px solid var(--night-line);
  color: rgba(255, 255, 255, 0.42);
  font-size: 10.5px;
}

.cmdk-foot span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.cmdk-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Navegación inferior (móvil)
   -------------------------------------------------------------------------- */
.mobile-nav {
  position: fixed;
  z-index: 45;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--night-line);
  background: var(--night);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-nav-item.is-active {
  color: var(--yellow);
  background: rgba(245, 228, 0, 0.1);
}

body.has-mobile-nav .main {
  padding-bottom: 96px;
}

/* --------------------------------------------------------------------------
   Inicio — mostrador
   -------------------------------------------------------------------------- */
.home-head {
  align-items: flex-start;
}

.home-head .page-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-key {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-value {
  font-size: 12px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-item-wide {
  flex: 1 1 220px;
}

.status-strip .btn {
  margin-left: auto;
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.home-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.quick-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.quick-group-label {
  grid-column: 1 / -1;
  margin: 12px 0 2px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quick-group-label:first-child {
  margin-top: 0;
}

.quick-link {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid #f0f0ea;
  transition: background 0.12s ease;
}

.quick-link:last-child {
  border-bottom: 0;
}

.quick-link:hover {
  background: var(--surface-2);
}

.quick-link:hover .quick-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-soft);
}

.quick-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-link.is-primary .quick-icon {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.quick-body {
  min-width: 0;
}

.quick-title {
  display: block;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.quick-sub {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-arrow {
  color: var(--muted-light);
  opacity: 0.5;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.quick-arrow svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-session .kv {
  font-size: 12.5px;
}

.home-session .kv dt {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-session .kv dd {
  font-size: 12.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.project-state {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}

.project-state > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-soft);
  user-select: none;
}

.project-state > summary::-webkit-details-marker {
  display: none;
}

.project-state > summary::after {
  content: "Abrir";
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-state[open] > summary::after {
  content: "Cerrar";
}

.project-state[open] > summary {
  border-bottom: 1px solid var(--line);
}

.project-state-body {
  padding: 16px 18px 18px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .main {
    padding: 24px 20px 64px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
  }

  .quick-link {
    border-bottom: 1px solid #f0f0ea;
  }
}

@media (min-width: 900px) {
  .topbar {
    padding: 0 20px;
  }

  .sidebar .nav-group-label {
    transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.sidebar-collapsed .sidebar .nav-group-label {
    opacity: 0;
    transform: translateX(-12px);
  }

  .main {
    margin-left: var(--sidebar-w);
    max-width: calc(1280px + var(--sidebar-w));
    padding: 28px 30px 72px;
  }

  body.sidebar-collapsed .main {
    margin-left: 0;
  }

  .mobile-nav {
    display: none;
  }

  body.has-mobile-nav .main {
    padding-bottom: 72px;
  }

  .home-columns {
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .topbar {
    padding-left: 26px;
    padding-right: 26px;
  }

  .main {
    padding-left: 40px;
    padding-right: 40px;
  }
}

@media (max-width: 899px) {
  .topbar-search {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .topbar-search-label,
  .topbar-kbd {
    display: none;
  }

  /* El cajón cuelga del bisel: la barra superior queda visible y el botón
     de menú sigue sirviendo para cerrarlo. */
  .sidebar {
    top: var(--topbar-h);
    z-index: 46;
  }

  .sidebar-overlay {
    top: var(--topbar-h);
    z-index: 44;
  }

  /* Evita el zoom automático de iOS al enfocar la paleta. */
  .cmdk .cmdk-input {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .topbar {
    gap: 6px;
    padding: 0 10px;
  }

  .brand {
    flex: 0 0 auto;
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .brand-mark svg {
    width: 12px;
    height: 18px;
  }

  .brand-text {
    font-size: 11px;
    letter-spacing: 0.07em;
  }

  .topbar-actions {
    gap: 4px;
  }

  .topbar .icon-btn {
    width: 38px;
  }

  .topbar .btn-sm {
    padding: 0 9px;
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 6px;
  }

  .topbar .user-chip {
    display: none;
  }

  .brand-text {
    font-size: 13px;
    letter-spacing: 0.12em;
  }

  .status-strip {
    gap: 8px 16px;
  }

  .status-strip .btn {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-text small {
    display: none;
  }

  .brand-text {
    font-size: 12px;
  }

  .user-chip-text {
    display: none;
  }
}

@media (max-width: 520px) {
  .scan-row {
    grid-template-columns: 1fr;
  }

  .scan-row .scan-add {
    width: 100%;
    min-height: 46px;
  }

  .home-head .page-actions {
    justify-content: flex-start;
  }

  .quick-sub {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
  }

  /* En el móvil las cifras van de dos en dos para no alargar la página. */
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid .stat-card {
    padding: 12px 13px;
  }

  .kpi-grid .stat-value {
    margin-top: 6px;
    font-size: 19px;
    letter-spacing: -0.05em;
  }

  .kpi-grid .stat-hint {
    font-size: 10.5px;
  }
}

@media (max-width: 899px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  input[type="date"],
  select,
  textarea,
  .input,
  .select,
  .textarea {
    font-size: 16px;
  }
}

/* --------------------------------------------------------------------------
   Deudas por objeto
   -------------------------------------------------------------------------- */
.debt-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--night-line);
  background: var(--night);
  color: #fff;
}

.debt-hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 38%;
  height: 3px;
  background: var(--yellow);
}

.debt-hero-main {
  min-width: 0;
}

.debt-hero-main .eyebrow {
  color: var(--yellow);
}

.debt-hero-main > strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: clamp(34px, 5vw, 48px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--yellow);
}

.debt-hero-main > p {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--night-text);
}

.debt-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  align-self: stretch;
  border: 1px solid var(--night-line);
  border-radius: 8px;
  background: var(--night-line);
}

.debt-hero-stat {
  padding: 13px 14px;
  background: var(--night-2);
}

.debt-hero-stat span {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--night-muted);
}

.debt-hero-stat strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: #fff;
}

#debt-overdue-count {
  color: #fff;
}

#debt-overdue-count.is-alert {
  color: var(--yellow);
}

.debt-target-tabs {
  max-width: 480px;
}

.debt-target-tabs .tab {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
}

.debt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#debt-panel {
  scroll-margin-top: 84px;
}

.debt-card {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.debt-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.debt-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.debt-object {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.debt-object-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--night);
  color: var(--yellow);
}

.debt-object-mark svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.debt-title {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.debt-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.debt-badge-pendiente {
  border-color: var(--yellow-dim);
  background: var(--yellow-soft);
  color: #6b5f00;
}

.debt-badge-vencida {
  border-color: #f3c4c6;
  background: var(--danger-soft);
  color: var(--danger);
}

.debt-badge-pagada {
  border-color: #b9e2c9;
  background: var(--success-soft);
  color: var(--success);
}

.debt-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.debt-amounts span {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.debt-amounts strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.debt-amounts .debt-balance {
  color: var(--red);
}

.debt-progress {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #ecece5;
}

.debt-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--yellow-dim);
}

.debt-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.debt-creditor {
  flex: 1 1 220px;
  min-width: 0;
}

.debt-due {
  flex: 0 1 140px;
  min-width: 0;
}

.debt-creditor span,
.debt-due span {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.debt-creditor strong,
.debt-due strong {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.debt-payments-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.debt-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

.debt-detail {
  text-align: left;
}

.debt-detail-object {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.debt-detail-object .eyebrow {
  color: var(--muted);
}

.debt-detail-object > strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.debt-detail-object > p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.debt-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.debt-detail-grid span {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.debt-detail-grid strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.debt-detail-grid .debt-balance {
  color: var(--red);
}

.debt-detail-notes {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--yellow);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
}

.debt-detail-notes span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.debt-detail-notes p {
  margin-top: 3px;
  font-size: 12.5px;
}

.debt-detail-payments {
  margin-top: 16px;
}

.debt-detail-payments h3 {
  font-size: 13px;
}

.debt-detail-payments table {
  font-size: 11.5px;
}

.debt-detail-danger {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.debt-pay-head {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--night);
  color: #fff;
  text-align: left;
}

.debt-pay-head .eyebrow {
  color: var(--yellow);
}

.debt-pay-head > strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  color: var(--yellow);
}

.debt-pay-head > p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--night-text);
}

.swal2-html-container .form-group {
  margin-top: 10px;
  text-align: left;
}

.swal2-html-container .form-group label {
  display: block;
  margin-bottom: 4px;
}

.swal2-html-container .form-group input,
.swal2-html-container .form-group select {
  width: 100%;
}

@media (max-width: 899px) {
  .debt-hero {
    grid-template-columns: 1fr;
  }

  .debt-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .debt-card {
    padding: 14px;
  }

  .debt-amounts {
    gap: 8px;
  }

  .debt-amounts strong {
    font-size: 14px;
  }

  .debt-payments-count {
    width: 100%;
    margin-left: 0;
  }

  .debt-actions {
    width: 100%;
  }

  .debt-actions .btn {
    flex: 1;
  }

  .debt-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Impresión y movimiento reducido
   -------------------------------------------------------------------------- */
@media print {
  .topbar,
  .sidebar,
  .sidebar-overlay,
  .mobile-nav,
  .cmdk,
  .status-strip {
    display: none !important;
  }

  .main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    animation: none !important;
  }

  body.has-mobile-nav .main {
    padding-bottom: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .main,
  .cmdk-backdrop,
  .cmdk-panel {
    animation: none !important;
  }

  .grid > .card:has(> a.btn),
  .btn,
  .quick-link,
  .quick-arrow {
    transition: none !important;
  }
}
