/* ============================================================
   Componentes UI
   ============================================================ */

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  display: grid;
  place-items: center;
  padding: var(--sp-4);
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: modal-fade var(--dur) var(--ease);
}
.modal__panel {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  /* min-width:0 anula el `min-width:auto` que CSS pone por default a los grid
     items (.modal__panel es item de .modal{display:grid}). Sin esto, una tabla
     ancha (ej. el desglose del Reporte Ejecutivo) infla el panel MÁS allá del
     viewport en mobile en vez de dejar que .table-wrap__scroll haga scroll-x:
     la ✕ del header se va fuera de pantalla y no se puede cerrar el modal. */
  min-width: 0;
  max-height: calc(100vh - var(--sp-8));
  display: flex;
  flex-direction: column;
  animation: modal-pop var(--dur) var(--ease);
}
.modal__panel--sm { max-width: 420px; }
.modal__panel--md { max-width: 640px; }
.modal__panel--lg { max-width: 960px; }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}
.modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-hi);
}
.modal__body {
  padding: var(--sp-5);
  overflow-y: auto;
  /* Igual que el panel: como flex-item de .modal__panel{display:flex}, sin
     min-width:0 no se encoge por debajo del contenido y rompe el scroll-x de
     las tablas anchas envueltas en .table-wrap__scroll. */
  min-width: 0;
}

/* Confirmación (confirmModal en modal.js) — reemplazo del window.confirm nativo. */
.confirm-modal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); padding: var(--sp-2) 0; }
.confirm-modal__icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(244, 67, 54, 0.12);
  color: var(--danger); font-size: 1.4rem; font-weight: 700;
}
.confirm-modal__msg { margin: 0; color: var(--text-md); font-size: var(--fs-sm); line-height: 1.5; }
.confirm-modal__actions {
  display: flex; justify-content: flex-end; gap: var(--sp-2);
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}
@media (max-width: 640px) {
  .confirm-modal__actions { flex-direction: column-reverse; }
  .confirm-modal__actions .btn { width: 100%; }
}

/* Scroll-lock robusto: `overflow:hidden` solo no basta en iOS Safari (la página
   de fondo hace rubber-band y arrastra el modal fixed). `position:fixed`+width
   lo congela; modal.js guarda y restaura el scrollY. Seguro en desktop: el body
   nunca scrollea (base.css → body{overflow:hidden}, .app-shell{height:100vh}),
   así que scrollY=0 y restaurarlo es no-op. */
body.modal-open { overflow: hidden; position: fixed; width: 100%; }

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* Modal full-screen en mobile: ocupa el viewport completo, sin radius/gap.
   El .modal__body mantiene overflow-y:auto (definido arriba) — scrollea
   internamente; el .modal__header queda sticky arriba para que el botón
   de cerrar siempre sea visible.

   Altura: `100dvh` (dynamic viewport height) en vez de `100vh`. En iOS/Android
   `100vh` es el viewport GRANDE (barra de direcciones oculta); con la barra
   visible el panel queda más alto que el área visible y empuja el header sticky
   (la ✕) bajo la barra de URL — el bug que reportó Tim. `100dvh` encoge con la
   barra y mantiene el header siempre alcanzable. El par `vh` va PRIMERO como
   fallback: el navegador sin soporte `dvh` lo descarta y conserva `vh`. */
@media (max-width: 640px) {
  .modal { padding: 0; place-items: stretch; }
  .modal__panel,
  .modal__panel--sm,
  .modal__panel--md,
  .modal__panel--lg {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;   /* fallback */
    height: 100vh;       /* fallback */
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .modal__header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-1);
  }
  /* Evita que el over-scroll del body arrastre la página de fondo. */
  .modal__body { overscroll-behavior: contain; }
}

/* ============ FORM (inputs, selects, textareas en modales/páginas) ============ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}
.form-grid .col-span-2 { grid-column: span 2; }

/* En mobile el form-grid colapsa a 1 col SIEMPRE (no depende de .grid--cols-*). */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
  .form-grid .col-span-2 { grid-column: span 1; }
}

/* iOS hace auto-zoom al enfocar cualquier control de texto con font-size < 16px
   (el default --fs-sm es 13px), lo que desajusta el layout y "encoge" la ventana.
   Forzar 16px en mobile lo evita. Regla amplia a propósito: cubre TODOS los inputs
   de texto/select/textarea de la app (forms, combobox, multi-select, buscador,
   filtros) — no solo .field — para cerrar el hueco de raíz. Excluye checkbox/
   radio/range (no disparan zoom). Solo aplica ≤640px → desktop intacto. El login
   tiene su propia regla en auth.css (mayor especificidad). */
@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea { font-size: 16px; }
}

/* Editor de líneas inline (cotizaciones): el font-size vive en la clase, NO en
   style="" inline — así la regla anti-zoom de arriba (mayor especificidad que la
   clase) puede subirlo a 16px en ≤640px. Un font-size inline ganaría y volvería a
   disparar el zoom de iOS al enfocar. Desktop conserva 14px. */
.linea-inline-edit { font-size: 0.875rem; }

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}
.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-md);
}
.field__label .req {
  color: var(--danger);
  margin-left: 2px;
}
.field__hint {
  font-size: var(--fs-xs);
  color: var(--text-lo);
}
.field__error {
  font-size: var(--fs-xs);
  color: var(--danger);
  min-height: 16px;
}
.field input,
.field select,
.field textarea {
  height: 38px;
  padding: 0 var(--sp-3);
  background: var(--bg-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-hi);
  font-family: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  width: 100%;
  box-sizing: border-box;
}
.field textarea {
  height: auto;
  min-height: 80px;
  padding: var(--sp-2) var(--sp-3);
  resize: vertical;
  font-family: inherit;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding-top: var(--sp-4);
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

.form-error {
  padding: var(--sp-2) var(--sp-3);
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-3);
}
/* Sin texto, no se pinta la pildora roja vacia (contenedores de error que
   se llenan via JS, ej. #udError en el editor de usuarios). */
.form-error:empty {
  display: none;
}

/* ============ COMBOBOX (select con búsqueda) ============ */
.combobox {
  position: relative;
}
.combobox__input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 var(--sp-3);
  background: var(--bg-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-hi);
  font-family: inherit;
  font-size: var(--fs-sm);
  box-sizing: border-box;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.combobox__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.combobox__chevron {
  position: absolute;
  right: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  transition: transform var(--dur-fast) var(--ease);
}
.combobox[data-state="open"] .combobox__chevron {
  transform: translateY(-50%) rotate(180deg);
}
.combobox__menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.combobox[data-state="open"] .combobox__menu {
  display: block;
}
.combobox__option {
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-hi);
}
.combobox__option:hover,
.combobox__option.is-highlighted {
  background: var(--bg-2);
}
.combobox__option-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combobox__option-sublabel {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  flex-shrink: 0;
}
.combobox__empty {
  padding: var(--sp-3);
  color: var(--text-dim);
  text-align: center;
  font-size: var(--fs-sm);
}

/* ============ MULTI-SELECT (dropdown con checkboxes) ============ */
.multi-select {
  position: relative;
  width: 100%;
}
.multi-select__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 38px;
  padding: 0 var(--sp-3);
  background: var(--bg-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-hi);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.multi-select__toggle:hover { border-color: var(--border-strong); }
.multi-select[data-state="open"] .multi-select__toggle {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.multi-select__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-select__label--placeholder { color: var(--text-dim); }
.multi-select__toggle svg {
  color: var(--text-dim);
  margin-left: var(--sp-2);
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease);
}
.multi-select[data-state="open"] .multi-select__toggle svg {
  transform: rotate(180deg);
}
.multi-select__popup {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 240px;
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  overflow: hidden;
}
.multi-select[data-state="open"] .multi-select__popup { display: block; }
.multi-select__search {
  padding: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
}
.multi-select__search input {
  width: 100%;
  height: 30px;
  padding: 0 var(--sp-2);
  background: var(--bg-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  font-family: inherit;
  font-size: var(--fs-xs);
}
.multi-select__search input:focus {
  outline: none;
  border-color: var(--accent);
}
.multi-select__actions {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
}
.multi-select__actions button {
  flex: 1;
  padding: 4px var(--sp-2);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-md);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.multi-select__actions button:hover {
  background: var(--bg-2);
  color: var(--text-hi);
}
.multi-select__list {
  max-height: 260px;
  overflow-y: auto;
}
.multi-select__option {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-hi);
  user-select: none;
}
.multi-select__option:hover { background: var(--bg-2); }
.multi-select__option.is-checked { background: var(--accent-dim); }
.multi-select__option input[type="checkbox"] { flex-shrink: 0; cursor: pointer; }
.multi-select__opt-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-select__opt-sub {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  flex-shrink: 0;
}
.multi-select__empty {
  padding: var(--sp-3);
  color: var(--text-dim);
  text-align: center;
  font-size: var(--fs-sm);
}

/* ============ MINI BAR CHART (facturación mensual) ============ */
.months-chart {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.months-chart__row {
  display: grid;
  grid-template-columns: 64px 1fr 110px;
  gap: var(--sp-3);
  align-items: center;
  font-size: var(--fs-sm);
}
.months-chart__label {
  color: var(--text-lo);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.months-chart__bar-wrap {
  height: 8px;
  background: var(--bg-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.months-chart__bar {
  height: 100%;
  background: linear-gradient(to right, var(--accent), #3B82F6);
  border-radius: inherit;
  transition: width var(--dur) var(--ease);
  min-width: 2px;
}
.months-chart__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-md);
  font-size: var(--fs-sm);
}

/* ============ BOTONES ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--grad-accent);
  color: var(--bg-0);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, var(--shadow-sm);
}
.btn--primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn--primary:active:not(:disabled) { transform: translateY(0); }

.btn--secondary {
  background: var(--bg-2);
  color: var(--text-hi);
  border-color: var(--border);
}
.btn--secondary:hover:not(:disabled) { background: var(--bg-3); border-color: var(--border-strong); }

.btn--ghost { background: transparent; color: var(--text-md); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-2); color: var(--text-hi); }

.btn--danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: var(--danger);
}
.btn--danger:hover:not(:disabled) { background: var(--danger); color: white; }

.btn--success {
  background: var(--success);
  color: var(--bg-0);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, var(--shadow-sm);
}
.btn--success:hover:not(:disabled) { filter: brightness(1.08); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn--success:active:not(:disabled) { transform: translateY(0); }

.btn--sm { height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { height: 44px; padding: 0 var(--sp-5); font-size: var(--fs-md); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-md);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  position: relative;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text-hi); }
.icon-btn[data-active="true"] { background: var(--bg-2); color: var(--accent); }

/* Tamaño táctil mínimo (Apple HIG / Material): 44x44 en mobile. */
@media (max-width: 640px) {
  .btn { min-height: 44px; padding: 0 var(--sp-4); }
  .btn--sm { min-height: 40px; padding: 0 var(--sp-3); }
  .icon-btn { width: 44px; height: 44px; }
}

/* Theme toggle — muestra sol/luna según tema */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ============ CARDS ============ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.card:hover { border-color: var(--border); }

.card--interactive { cursor: pointer; }
.card--interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  gap: var(--sp-3);
}

.card__title {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-md);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card__body { color: var(--text-md); }

/* ============ KPI CARDS ============ */
.kpi {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
  transition: all var(--dur-fast) var(--ease);
}

.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--kpi-accent, var(--accent));
  opacity: 0.6;
}

.kpi:hover { border-color: var(--border); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.kpi__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.kpi__icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}

.kpi__icon--success { background: var(--success-dim); color: var(--success); }
.kpi__icon--warning { background: var(--warning-dim); color: var(--warning); }
.kpi__icon--danger { background: var(--danger-dim); color: var(--danger); }
.kpi__icon--info { background: var(--info-dim); color: var(--info); }

.kpi__value {
  font-family: var(--font-mono);
  font-size: var(--fs-3xl);
  font-weight: 600;
  color: var(--text-hi);
  margin-top: var(--sp-3);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi__unit {
  font-size: var(--fs-md);
  color: var(--text-lo);
  margin-left: var(--sp-1);
}

.kpi__footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-lo);
}

/* ============ REPORTE EJECUTIVO ============ */
/* Cada sección es un panel agrupador (bg-1) sobre el fondo de página (bg-0),
   con tiles internos (bg-2) → profundidad en 3 niveles + aire entre bloques. */
.rep-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
  box-shadow: var(--shadow-sm);
}

.rep-panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.rep-panel__icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}
.rep-panel__icon--success { background: var(--success-dim); color: var(--success); }
.rep-panel__icon--warning { background: var(--warning-dim); color: var(--warning); }
.rep-panel__icon--info    { background: var(--info-dim);    color: var(--info); }
.rep-panel__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-hi);
  margin: 0;
}
.rep-panel__hint {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--text-lo);
  text-align: right;
}

.rep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }

.rep-stat {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 108px;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.rep-stat:hover { border-color: var(--border); transform: translateY(-2px); }
/* Tile clickable → abre el desglose factura por factura (drill-down). */
.rep-stat--clickable { cursor: pointer; }
.rep-stat--clickable:hover { border-color: var(--accent); }
.rep-stat--clickable:active { transform: translateY(0); }
.rep-stat--clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rep-stat__drill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
  opacity: 0.6;
  transition: opacity var(--dur-fast) var(--ease);
}
.rep-stat--clickable:hover .rep-stat__drill { opacity: 1; }
.rep-stat__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-lo);
}
.rep-stat__value {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: auto;
}
.rep-stat__value--date { font-family: var(--font-sans); font-size: var(--fs-lg); }
.rep-stat__sub { font-size: var(--fs-xs); color: var(--text-lo); }

/* Tile destacado: el "Total estimado" (la cifra que resume la sección). */
.rep-stat--feature {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-dim) 0%, var(--bg-1) 70%);
}
.rep-stat--feature .rep-stat__value { color: var(--accent); }

/* Tile liquidado: la obligación ya está pagada (Impuestos). Verde tenue —
   espejo del --feature pero en success — para que el dueño vea de un vistazo
   que no hay nada pendiente y no lea "por pagar" sobre algo ya saldado. */
.rep-stat--paid {
  border-color: var(--success-dim);
  background: linear-gradient(180deg, var(--success-dim) 0%, var(--bg-1) 70%);
}
.rep-stat--paid .rep-stat__value { color: var(--success); }
.rep-stat__sub--ok { color: var(--success); font-weight: 600; }

/* Toggle "En reporte" (excluir_planeacion) en el desglose de CxC/CxP + fila
   oculta. Marcado = visible; desmarcar oculta la factura de la foto (no cancela
   el CFDI). Espeja el patrón .pf-* de /planeacion-financiera. */
.rep-toggle-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.rep-toggle-cell { white-space: nowrap; }
tr.rep-row-oculta td { opacity: 0.5; }
tr.rep-row-oculta td.rep-toggle-cell { opacity: 1; }
tr.rep-row-oculta td.rep-saldo-cell { text-decoration: line-through; }

/* Escalera 3→2→1 en breakpoints canónicos (768 iPad / 640 phone). El 1-col a
   ≤640 alinea con donde el resto de la app pasa a mobile (forms 1-col, modales
   full-screen) y libra el apretón de 2-col en teléfonos grandes (521-640px). */
@media (max-width: 768px) { .rep-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .rep-grid { grid-template-columns: 1fr; } }

/* ============ MOVIMIENTOS — cards en mobile ============ */
/* La tabla principal (6 col: Fecha·Concepto·Categoría·Monto·Saldo·Estado)
   obliga a swipe horizontal en teléfono para llegar al Monto. En ≤640px se
   cambia a una lista de tarjetas (Concepto + Monto arriba; Fecha/Categoría/
   Estado/Saldo abajo) legible de un vistazo. Estrategia render-both + toggle
   por CSS: el JS pinta tabla Y cards, el CSS muestra la que toca. En desktop
   las cards quedan display:none → la vista queda intacta.
   .mv-grid-3-2 es el grid del resumen (Saldos 3fr / Movimiento 2fr) que colapsa
   a 1 columna en teléfono. */
.mv-cards { display: none; }
.mv-grid-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: var(--sp-4); }

@media (max-width: 640px) {
  .mv-table-wrap { display: none; }
  .mv-cards { display: flex; flex-direction: column; gap: var(--sp-2); }
  .mv-grid-3-2 { grid-template-columns: 1fr; }
}

.mv-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
  text-align: left;
  padding: var(--sp-3);
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.mv-card:active { background: var(--bg-2); }
.mv-card__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.mv-card__concepto { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-card__monto { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.mv-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-lo); }
.mv-card__saldo { margin-left: auto; font-family: var(--font-mono); }

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-weight: 600;
}
.trend--up { color: var(--success); }
.trend--down { color: var(--danger); }

/* ============ GRID ============ */
.grid { display: grid; gap: var(--sp-4); }
.grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid--auto-fit { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

@media (max-width: 1100px) {
  .grid--cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid--cols-3, .grid--cols-4, .grid--cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid--cols-2, .grid--cols-3, .grid--cols-4, .grid--cols-5 { grid-template-columns: 1fr; }
}

/* Grid 1.4:1 del detalle de cliente (Facturación 6M + OCs). Antes era un
   style="" inline que ganaba sobre el colapso de .grid--cols-2 y se quedaba en
   2 columnas en el teléfono. Como clase, conserva el ratio en desktop y colapsa
   a 1 col en ≤640px. */
.cli-grid-1-4 { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 640px) { .cli-grid-1-4 { grid-template-columns: 1fr; } }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  background: var(--bg-3);
  color: var(--text-md);
  border: 1px solid var(--border-subtle);
  text-transform: capitalize;
  white-space: nowrap;
}

.badge--success { background: var(--success-dim); color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-dim); color: var(--warning); border-color: transparent; }
.badge--danger { background: var(--danger-dim); color: var(--danger); border-color: transparent; }
.badge--info { background: var(--info-dim); color: var(--info); border-color: transparent; }
.badge--accent { background: var(--accent-dim); color: var(--accent); border-color: transparent; }
.badge--purple { background: var(--purple-dim); color: var(--purple); border-color: transparent; }

/* ============ TABLAS ============ */
.table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-wrap__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.table-wrap__title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-hi);
}

.table-wrap__scroll { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table thead th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.table thead th.text-right { text-align: right; }
.table thead th.text-center { text-align: center; }

.table tbody td {
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-md);
  vertical-align: middle;
}

.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: var(--bg-3); }
.table tbody tr:last-child td { border-bottom: none; }

.table tbody td strong { color: var(--text-hi); font-weight: 600; }

.table .num, .table .mono {
  font-family: var(--font-mono);
  text-align: right;
}

.table__empty {
  padding: var(--sp-12);
  text-align: center;
  color: var(--text-lo);
}

/* Mobile: 1ª columna pegada a la izquierda durante swipe horizontal.
   Las vistas agrupadas (facturas por cliente/proveedor) usan <div> de
   encabezado encima de cada <table> independiente, así que no hay filas
   de grupo dentro de la misma tabla — el sticky funciona naturalmente.
   Padding reducido para que la 1ª col no se coma demasiado ancho. */
@media (max-width: 768px) {
  .table thead th:first-child,
  .table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg-1);
    box-shadow: 1px 0 0 var(--border-subtle);
  }
  /* El thead.first-child necesita z-index mayor para no quedar tapado
     por la celda sticky del body cuando ambos compiten. */
  .table thead th:first-child { z-index: 2; }
  .table tbody tr:hover td:first-child { background: var(--bg-3); }
  .table thead th, .table tbody td { padding: var(--sp-3) var(--sp-3); }
}

/* Tablas anchas DENTRO de un modal: en celular (modal full-screen) una .table
   es width:100% sin piso de ancho, así que prefiere APRETUJAR/partir texto para
   caber en ~375px en vez de hacer scroll-x limpio por .table-wrap__scroll. Estas
   clases le dan un min-width para que prefiera scroll horizontal (con la 1ª col
   sticky de arriba conservando contexto). Es OPT-IN por tabla — NO todas las
   tablas de modal lo necesitan (las de ≤2 col o de puros tokens cortos caben
   limpio y un min-width las regresionaría). Acotado a ≤640px (donde el modal es
   full-screen y más angosto): en tablet/desktop la tabla se comporta como hoy. */
@media (max-width: 640px) {
  .modal__body .table--scroll-sm { min-width: 480px; }
  .modal__body .table--scroll-md { min-width: 600px; }
  .modal__body .table--scroll-lg { min-width: 700px; }
}

/* ============ FORMS ============ */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field__label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-md);
}

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 var(--sp-3);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-hi);
  font-size: var(--fs-sm);
  font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.textarea { height: auto; padding: var(--sp-3); min-height: 80px; resize: vertical; }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input::placeholder, .textarea::placeholder { color: var(--text-lo); }

/* Anti-zoom (continuación): la regla de elemento `input/select/textarea`{16px}
   de arriba tiene especificidad 0,0,1 para select/textarea, así que la PIERDE
   contra `.field textarea` (0,1,1) y `.textarea`/`.select` (0,1,0) — sus 13px
   (--fs-sm) ganaban y un <textarea> seguía disparando el auto-zoom de iOS al
   enfocar. Esta regla iguala la especificidad y va DESPUÉS de las bases (gana por
   orden de cascada, sin !important). Solo ≤640px → desktop conserva 13px. */
@media (max-width: 640px) {
  .field input, .field select, .field textarea,
  .input, .select, .textarea { font-size: 16px; }
}

/* ============ EMPTY STATES ============ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16) var(--sp-6);
  text-align: center;
  color: var(--text-lo);
  gap: var(--sp-3);
}

.empty__icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  margin-bottom: var(--sp-2);
}

.empty__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-hi);
}

.empty__desc { font-size: var(--fs-sm); max-width: 480px; }

/* ============ SKELETON LOADER ============ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 0%, var(--bg-4) 50%, var(--bg-3) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton--text { height: 12px; width: 100%; }
.skeleton--kpi { height: 148px; border-radius: var(--radius-lg); }
.skeleton--row { height: 48px; }

/* ============ TOASTS ============ */
.toast-stack {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 380px;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-hi);
  animation: slide-in var(--dur) var(--ease);
  min-width: 260px;
}

.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--danger { border-left-color: var(--danger); }

@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============ LOADING DOTS ============ */
.dots::after {
  content: '';
  display: inline-block;
  width: 1ch;
  text-align: left;
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ============ DETAIL LISTS ============ */
.detail-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--sp-3) var(--sp-5);
  font-size: var(--fs-sm);
}

.detail-list dt {
  color: var(--text-lo);
  font-weight: 500;
}

.detail-list dd {
  color: var(--text-hi);
  font-weight: 500;
  word-break: break-word;
}

/* ------------------------------------------------------------
   Segmented tabs (filtros tipo "Todos · Core · No-core · ...")
   ------------------------------------------------------------ */
.seg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-1);
  margin-bottom: var(--sp-4);
}

.seg-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 4px);
  color: var(--text-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.seg-tabs__item:hover {
  background: var(--bg-3);
  color: var(--text-hi);
}

.seg-tabs__item.is-active {
  background: var(--bg-1);
  color: var(--text-hi);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.seg-tabs__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  background: var(--bg-3);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-md);
}

.seg-tabs__item.is-active .seg-tabs__count {
  background: var(--accent-dim);
  color: var(--accent);
}

/* En mobile el seg-tabs (filtros tipo Todos·Core·No-core·…) y los chips
   de periodo prefieren scroll horizontal antes que wrap — wrap rompe la
   alineación visual y desperdicia vertical. */
@media (max-width: 640px) {
  .seg-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .seg-tabs__item { flex-shrink: 0; }
}

/* ============ PLAN DATE INPUTS ============
   Input editable de fecha de planeación (cobro/pago) usado en
   /facturas-emitidas, /facturas-recibidas y /planeacion-financiera.
   Persiste en facturas.fecha_planeacion_cobro / facturas_proveedor.fecha_planeacion_pago
   (migración 0078). Visual:
     - is-overriding: highlight cuando hay valor (acento azul)
     - .plan-date-clear: botón × que limpia el override
*/
.plan-date-input {
  background: var(--bg-3);
  border: 1px solid var(--border-subtle);
  color: var(--text-md);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  width: 130px;
}
.plan-date-input:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}
.plan-date-input.is-overriding {
  background: rgba(99, 179, 237, 0.18);
  border-color: var(--accent);
}
.plan-date-clear {
  background: transparent;
  border: 0;
  color: var(--text-lo);
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
  line-height: 1;
}
.plan-date-clear:hover { color: var(--danger); }

/* ============ ADMIN · MODAL DE ACCESO (permisos) ============
   Rediseño del editor de acceso por usuario (/admin/usuarios → "Editar acceso").
   Submódulos como pills (click-to-toggle), visibilidad de clientes/proveedores
   en 2 columnas con selector "lista compacta + chips", y confirmación compacta. */

.perm-section { margin-bottom: var(--sp-4); }
.perm-section__title {
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-hi);
  margin: 0 0 var(--sp-2);
}
.perm-rol { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.perm-rol .field__label { margin: 0; }

/* --- Submódulos: pills por módulo --- */
.perm-modgroup { margin-bottom: var(--sp-3); }
.perm-modgroup__head {
  display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2);
}
.perm-modgroup__name {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-lo);
}
.perm-modgroup__all {
  background: none; border: none; color: var(--accent);
  font-size: var(--fs-xs); cursor: pointer; padding: 0 2px;
}
.perm-modgroup__all:hover { text-decoration: underline; }
.perm-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.perm-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: var(--radius-full);
  border: 1px solid var(--border-strong); background: var(--bg-2);
  color: var(--text-md); font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.perm-pill:hover { border-color: var(--accent-border); color: var(--text-hi); }
.perm-pill::before {
  content: ''; width: 13px; height: 13px; border-radius: 4px; flex: 0 0 auto;
  border: 1.5px solid var(--border-strong);
  background-position: center; background-repeat: no-repeat; background-size: 10px;
  transition: background-color 120ms, border-color 120ms;
}
.perm-pill.is-on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.perm-pill.is-on::before {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

/* --- Visibilidad en 2 columnas --- */
.perm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 640px) { .perm-cols { grid-template-columns: 1fr; } }
.perm-vis {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--sp-3); background: var(--bg-1);
}
.perm-vis__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2); margin-bottom: var(--sp-3);
}
.perm-vis__title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-hi); }

.perm-seg {
  display: inline-flex; background: var(--bg-2);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 2px;
}
.perm-seg__btn {
  border: none; background: transparent; color: var(--text-md);
  font-size: var(--fs-xs); font-weight: 500; padding: 4px 10px;
  border-radius: calc(var(--radius-md) - 4px); cursor: pointer; white-space: nowrap;
}
.perm-seg__btn.is-active {
  background: var(--bg-1); color: var(--text-hi); box-shadow: var(--shadow-sm);
}
.perm-vis__note { color: var(--text-lo); font-size: var(--fs-sm); padding: var(--sp-2) 0; }

.perm-search { margin-bottom: var(--sp-2); }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-2); min-height: 4px; }
.perm-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 4px 3px 9px; border-radius: var(--radius-full);
  background: var(--accent-dim); color: var(--accent);
  font-size: var(--fs-xs); font-weight: 500; max-width: 100%;
}
.perm-chip__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-chip__x {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 3px; opacity: .65;
}
.perm-chip__x:hover { opacity: 1; }
.perm-chips__empty { color: var(--text-lo); font-size: var(--fs-xs); font-style: italic; }

.perm-list {
  max-height: 168px; overflow-y: auto; scrollbar-width: thin;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
.perm-list__row {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  cursor: pointer; font-size: var(--fs-sm); color: var(--text-md);
}
.perm-list__row:hover { background: var(--bg-2); color: var(--text-hi); }
.perm-list__row input { flex: 0 0 auto; }
.perm-list__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.perm-list__code { color: var(--text-lo); font-family: var(--font-mono, monospace); font-size: var(--fs-xs); margin-left: auto; padding-left: var(--sp-2); flex: 0 0 auto; }
.perm-list__empty { padding: var(--sp-3); color: var(--text-lo); font-size: var(--fs-sm); text-align: center; }

/* --- Confirmación compacta (overlay centrado, no full-bleed) --- */
.perm-confirm-ov {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); border-radius: inherit; padding: var(--sp-4);
}
.perm-confirm {
  width: 100%; max-width: 460px; background: var(--bg-1);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-4); box-shadow: var(--shadow-lg);
}
.perm-confirm__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.perm-confirm__icon {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--warning-dim); color: var(--warning);
}
.perm-confirm__title { margin: 0; font-size: var(--fs-md); }
.perm-confirm__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.perm-confirm__list li { display: flex; gap: var(--sp-2); font-size: var(--fs-sm); line-height: 1.4; }
.perm-confirm__k { color: var(--text-lo); flex: 0 0 86px; }
.perm-confirm__v { color: var(--text-hi); }
