/* ==========================================================================
   FIAPE - SISTEMA DE CONTROL DE FIADOS (ETAPA 1)
   DISEÑO MODERNO MOBILE-FIRST & RESPONSIVO (MOCKUP EXACTO)
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Fondo general y superficies */
  --canvas: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-alt: #f8fafc;

  /* Tipografía y textos */
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  /* Paleta del Mockup */
  --primary-blue: #1665d8;
  --primary-blue-hover: #1252b5;
  --primary-blue-light: #eff6ff;

  --success-green: #16a34a;
  --success-green-hover: #15803d;
  --success-green-light: #ecfdf5;

  --danger-red: #dc2626;
  --danger-red-hover: #b91c1c;
  --danger-red-light: #fef2f2;

  --warning-amber: #d97706;
  --warning-amber-light: #fffbeb;

  --purple-accent: #7c3aed;
  --purple-light: #f5f3ff;

  /* Tarjetas de acción rápida (2x2) */
  --card-fiado-bg: #feecef;
  --card-fiado-border: #fcd5dc;
  --card-fiado-icon: #ef4444;

  --card-pago-bg: #e6f8f0;
  --card-pago-border: #c8f2de;
  --card-pago-icon: #10b981;

  --card-voz-bg: #f0edfc;
  --card-voz-border: #ded7fa;
  --card-voz-icon: #8b5cf6;

  --card-buscar-bg: #ebf5fe;
  --card-buscar-border: #cee4fd;
  --card-buscar-icon: #3b82f6;

  /* Tarjetas métricas de resumen (2x2) */
  --metric-coral-bg: #feecef;
  --metric-coral-border: #fcd5dc;

  --metric-mint-bg: #e6f8f0;
  --metric-mint-border: #c8f2de;

  --metric-amber-bg: #fffbeb;
  --metric-amber-border: #fef3c7;

  --metric-lavender-bg: #f0edfc;
  --metric-lavender-border: #ded7fa;

  /* Compatibilidad con variables legacy */
  --violet: var(--primary-blue);
  --violet-dark: var(--primary-blue-hover);
  --violet-soft: var(--primary-blue-light);
  --violet-wash: #bfdbfe;
  --danger: var(--danger-red);
  --danger-soft: var(--danger-red-light);
  --success: var(--success-green);
  --success-soft: var(--success-green-light);
  --warning: var(--warning-amber);
  --warning-soft: var(--warning-amber-light);
  --white: #ffffff;
  --primary: var(--primary-blue);
  --primary-dark: var(--primary-blue-hover);
  --primary-light: var(--primary-blue-light);
  --danger-light: var(--danger-red-light);
  --success-light: var(--success-green-light);
  --warning-light: var(--warning-amber-light);
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Radios y sombras */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 25px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 20px 35px -5px rgba(15, 23, 42, 0.12);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--primary-blue);
  text-decoration: none;
}

code, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

::selection {
  background: #dbeafe;
  color: var(--primary-blue);
}

:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.view {
  min-height: 100vh;
}

.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.page-loading h2 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.page-loading p {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.5;
}

.page-loading .btn {
  margin-top: 4px;
}

.loading-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.page-error-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fef2f2;
  color: var(--danger-red);
}

.page-error-icon svg {
  width: 24px;
  height: 24px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation-duration: 1.6s;
  }
}

.ui-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ==========================================================================
   LAYOUT PRINCIPAL Y RESPONSIVE
   ========================================================================== */

.app-layout,
.client-dashboard {
  display: flex;
  min-height: 100vh;
  background: var(--canvas);
}

.main-content {
  flex: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 96px;
  width: 100%;
}

/* Top Nav Bar Móvil / Status Header */
.top-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  margin-bottom: 4px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.store-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

.store-icon svg {
  width: 20px;
  height: 20px;
}

.store-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.btn-icon-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-icon-bell:hover {
  background: var(--surface-soft);
}

.btn-icon-bell:active {
  transform: scale(0.95);
}

.btn-icon-bell svg {
  width: 18px;
  height: 18px;
}

.bell-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  background: var(--danger-red);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.bell-dot.is-hidden {
  display: none;
}

/* Sección de Bienvenida */
.welcome-section {
  margin-bottom: 22px;
}

.welcome-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.welcome-subtitle {
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 400;
}

/* ==========================================================================
   PANTALLA 1: ACCIONES RÁPIDAS (2x2 GRID)
   ========================================================================== */

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.action-card {
  padding: 16px 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.action-card:active {
  transform: scale(0.98);
}

.card-fiado {
  background: var(--card-fiado-bg);
  border-color: var(--card-fiado-border);
}

.card-pago {
  background: var(--card-pago-bg);
  border-color: var(--card-pago-border);
}

.card-voz {
  background: var(--card-voz-bg);
  border-color: var(--card-voz-border);
}

.card-buscar {
  background: var(--card-buscar-bg);
  border-color: var(--card-buscar-border);
}

.action-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #ffffff;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.icon-red {
  background: #ef4444;
}

.icon-green {
  background: #10b981;
}

.icon-purple {
  background: #8b5cf6;
}

.icon-blue {
  background: #3b82f6;
}

.action-card-icon svg {
  width: 20px;
  height: 20px;
}

.action-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.action-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

/* ==========================================================================
   PANTALLA 1: RESUMEN DE TU BODEGA (2x2 GRID)
   ========================================================================== */

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

.section-title {
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.link-more {
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary-blue);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.link-more:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.metric-card {
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  display: flex;
  flex-direction: column;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.metric-card:active {
  transform: scale(0.98);
}

.metric-coral {
  background: var(--metric-coral-bg);
  border-color: var(--metric-coral-border);
}

.metric-mint {
  background: var(--metric-mint-bg);
  border-color: var(--metric-mint-border);
}

.metric-amber {
  background: var(--metric-amber-bg);
  border-color: var(--metric-amber-border);
}

.metric-lavender {
  background: var(--metric-lavender-bg);
  border-color: var(--metric-lavender-border);
}

.metric-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  flex-shrink: 0;
}

.metric-icon svg {
  width: 14px;
  height: 14px;
}

.metric-icon.coral {
  color: #ef4444;
}

.metric-icon.mint {
  color: #10b981;
}

.metric-icon.amber {
  color: #f59e0b;
}

.metric-icon.lavender {
  color: #8b5cf6;
}

.metric-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.metric-amount {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.amount-red {
  color: #dc2626;
}

.amount-dark {
  color: #0f172a;
}

.amount-green {
  color: #16a34a;
}

.metric-sub {
  font-size: 11.5px;
  font-weight: 500;
}

.sub-red {
  color: #dc2626;
}

.sub-purple {
  color: #7c3aed;
}

.sub-muted {
  color: var(--muted);
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR (MOCKUP: INICIO, CLIENTES, MOVIMIENTOS, MÁS)
   ========================================================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding: 0 8px;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  padding: 6px 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  transition: color 0.15s ease, transform 0.12s ease;
  user-select: none;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: stroke 0.15s ease, transform 0.15s ease;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-item.active {
  color: var(--primary-blue);
  font-weight: 700;
}

.bottom-nav-item.active svg {
  stroke: var(--primary-blue);
  stroke-width: 2.2;
}

/* ==========================================================================
   PANTALLA 4: BUSCAR CLIENTE (TAB CLIENTES)
   ========================================================================== */

.page-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: relative;
}

.btn-header-back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: background 0.15s ease;
}

.btn-header-back:hover {
  background: var(--surface-soft);
}

.header-nav-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-align: center;
  flex: 1;
}

.btn-header-add {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--primary-blue);
  color: #ffffff;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-header-add:hover {
  background: var(--primary-blue-hover);
}

.btn-header-add:active {
  transform: scale(0.95);
}

/* Buscador redondeado con icono de lupa */
.search-bar-wrap {
  position: relative;
  margin-bottom: 14px;
}

.search-bar-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search-bar-input {
  width: 100%;
  height: 44px;
  padding: 10px 14px 10px 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(22, 101, 216, 0.12);
}

/* Pills de Filtro (Todos, Con deuda, Al día) */
.filter-pills-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

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

.filter-pill {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.filter-pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #ffffff;
  font-weight: 600;
}

/* Tarjetas Móviles de Clientes (Sección requerida por Pruebas: .client-cards-mobile) */
.client-cards-mobile {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow: var(--shadow-sm);
}

.client-card-item:hover {
  transform: translateY(-1.5px);
  box-shadow: var(--shadow);
}

.client-card-item:active {
  transform: scale(0.99);
}

.client-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.client-item-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.avatar-green {
  background: #dcfce7;
  color: #15803d;
}

.avatar-pink {
  background: #fee2e2;
  color: #dc2626;
}

.avatar-orange {
  background: #ffedd5;
  color: #c2410c;
}

.avatar-purple {
  background: #f3e8ff;
  color: #7e22ce;
}

.avatar-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.client-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.client-item-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-item-phone {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.client-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.client-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.client-item-debt {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.client-item-debt.is-debt {
  color: #dc2626;
}

.client-item-debt.is-clean {
  color: #16a34a;
}

.client-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}

.badge-aldia {
  background: #dcfce7;
  color: #15803d;
}

.badge-deuda {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-revision {
  background: #fef3c7;
  color: #b45309;
}

.client-item-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted-2);
}

/* ==========================================================================
   PANTALLA 5: HISTORIAL DE MOVIMIENTOS (TAB MOVIMIENTOS)
   ========================================================================== */

.movements-view-container {
  display: flex;
  flex-direction: column;
}

.movements-date-group {
  margin-bottom: 20px;
}

.movements-date-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: capitalize;
  margin-bottom: 10px;
  padding-left: 2px;
}

.movement-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.movement-item-card:hover {
  transform: translateY(-1px);
}

.movement-item-card.is-void {
  opacity: 0.65;
  background: #f8fafc;
}

.movement-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.movement-item-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.movement-item-icon.icon-pago {
  background: #dcfce7;
  color: #16a34a;
}

.movement-item-icon.icon-fiado {
  background: #fee2e2;
  color: #dc2626;
}

.movement-item-icon.icon-anulado {
  background: #e2e8f0;
  color: #64748b;
}

.movement-item-icon svg {
  width: 18px;
  height: 18px;
}

.movement-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.movement-item-topline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.badge-tag-pago {
  padding: 1.5px 6px;
  border-radius: 6px;
  background: #dcfce7;
  color: #15803d;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-tag-fiado {
  padding: 1.5px 6px;
  border-radius: 6px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.movement-item-time {
  font-size: 11.5px;
  color: var(--muted);
}

.movement-item-concept {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movement-item-balance {
  font-size: 12px;
  color: var(--muted);
}

.movement-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.movement-item-amount {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.movement-receipt-thumb {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}

.movement-receipt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s var(--ease);
}

.movement-receipt-thumb:hover img {
  transform: scale(1.06);
}

.movement-receipt-detail {
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.movement-receipt-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.movement-receipt-detail-head strong {
  color: var(--ink);
}

.movement-receipt-detail-head a {
  color: var(--primary-blue);
  font-size: 12px;
  font-weight: 700;
}

.movement-receipt-detail > a {
  display: block;
}

.movement-receipt-detail img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.movement-receipt-mobile {
  margin-top: 8px;
}

.amount-credit {
  color: #16a34a;
}

.amount-debit {
  color: #dc2626;
}

/* ==========================================================================
   PANTALLA 6: DETALLE DEL CLIENTE
   ========================================================================== */

.client-detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 20px;
}

.hero-avatar-large {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary-blue);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(22, 101, 216, 0.15);
}

.hero-client-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.hero-client-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
}

/* 3 Column Metric Summary Box */
.client-metrics-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 10px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.trio-col {
  display: flex;
  flex-direction: column;
  padding: 0 4px;
}

.trio-col:not(:last-child) {
  border-right: 1px solid var(--line);
}

.trio-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.trio-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* 2 Action Buttons Side-by-Side */
.client-hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

.btn-hero-fiado {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-blue);
  color: #ffffff;
  font-weight: 700;
  font-size: 14.5px;
  box-shadow: 0 4px 12px rgba(22, 101, 216, 0.22);
  transition: background 0.15s ease, transform 0.12s ease;
}

.btn-hero-fiado:hover {
  background: var(--primary-blue-hover);
}

.btn-hero-fiado:active {
  transform: scale(0.98);
}

.btn-hero-pago {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: 14px;
  background: var(--success-green);
  color: #ffffff;
  font-weight: 700;
  font-size: 14.5px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.22);
  transition: background 0.15s ease, transform 0.12s ease;
}

.btn-hero-pago:hover {
  background: var(--success-green-hover);
}

.btn-hero-pago:active {
  transform: scale(0.98);
}

/* Lista de Tarjetas de Opciones con Chevron */
.detail-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.detail-menu-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.detail-menu-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.detail-menu-card:active {
  transform: scale(0.99);
}

.detail-menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-menu-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-2);
}

.detail-menu-icon svg {
  width: 18px;
  height: 18px;
}

.detail-menu-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.detail-menu-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted-2);
}

/* ==========================================================================
   PANTALLA 2 & 3: FORMULARIOS DE FIADO Y PAGO (MOCKUPS EXACTOS)
   ========================================================================== */

/* Tarjeta Selector de Cliente en Modal */
.modal-client-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.modal-client-card:hover {
  border-color: var(--primary-blue);
}

.modal-client-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-client-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 15px;
}

.modal-client-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.modal-client-debt {
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  margin-top: 2px;
}

.modal-client-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

/* Inputs con Iconos en Prefijo */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-prefix {
  position: absolute;
  left: 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
  font-weight: 600;
  font-size: 14px;
}

.input-icon-prefix svg {
  width: 18px;
  height: 18px;
}

.input-with-icon {
  width: 100%;
  height: 48px;
  padding: 10px 14px 10px 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-icon:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(22, 101, 216, 0.12);
}

/* Banner Destacado: Total del fiado (Mockup 2) */
.total-fiado-banner {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 16px;
  padding: 16px 20px;
  text-align: center;
  margin: 18px 0;
}

.total-fiado-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.total-fiado-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
}

/* Selector de Métodos de Pago (Mockup 3: Yape, Efectivo, Otro) */
.payment-methods-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.method-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.method-select-card:hover {
  border-color: var(--line-strong);
}

.method-select-card.active {
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
}

.method-icon-box {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.method-icon-box.icon-yape {
  background: #7c3aed;
  color: #ffffff;
}

.method-icon-box.icon-cash {
  background: #10b981;
  color: #ffffff;
}

.method-icon-box.icon-other {
  background: #475569;
  color: #ffffff;
}

.method-icon-box svg {
  width: 18px;
  height: 18px;
}

.method-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

/* Botones Principales de Guardar (Píldora Ancha) */
.btn-submit-action {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  margin-top: 10px;
}

.btn-submit-action.btn-blue {
  background: var(--primary-blue);
  box-shadow: 0 4px 14px rgba(22, 101, 216, 0.28);
}

.btn-submit-action.btn-blue:hover {
  background: var(--primary-blue-hover);
}

.btn-submit-action.btn-green {
  background: var(--success-green);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.28);
}

.btn-submit-action.btn-green:hover {
  background: var(--success-green-hover);
}

.btn-submit-action:active {
  transform: scale(0.98);
}

.btn-submit-action:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.icon-circle-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.icon-circle-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

/* ==========================================================================
   PANTALLA 7: CHAT CON CLIENTE
   ========================================================================== */

.chat-panel {
  position: fixed;
  inset: 0;
  background: var(--canvas);
  z-index: 1100;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.chat-back-btn,
.chat-menu-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  transition: background 0.15s ease;
}

.chat-back-btn:hover,
.chat-menu-btn:hover {
  background: #e2e8f0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 14px;
}

.chat-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.chat-status {
  font-size: 11.5px;
  color: var(--success-green);
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

/* Burbujas del Chat */
.chat-bubble {
  max-width: 82%;
  padding: 12px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

/* Mensajes automáticos de la tienda (Burbuja azul Mockup 7) */
.chat-bubble-own {
  align-self: flex-end;
  background: #1665d8;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-own .chat-bubble-sender {
  font-weight: 700;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2px;
}

.chat-bubble-own .chat-bubble-time {
  align-self: flex-end;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 4px;
}

/* Mensajes del cliente o reporte de discrepancia (Burbuja blanca con borde) */
.chat-bubble-other {
  align-self: flex-start;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.chat-bubble-other .chat-bubble-sender,
.chat-bubble-dispute .chat-bubble-sender {
  font-weight: 700;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.chat-bubble-dispute.chat-bubble-other {
  border-color: #fca5a5;
}

.chat-bubble-dispute .chat-bubble-sender {
  color: #dc2626;
}

.chat-bubble-other .chat-bubble-time,
.chat-bubble-dispute.chat-bubble-other .chat-bubble-time {
  align-self: flex-start;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 4px;
}

/* Input inferior de chat con botón de avión */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.chat-input-area input {
  flex: 1;
  height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 14.5px;
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.chat-send-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(22, 101, 216, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}

.chat-send-btn:hover {
  background: var(--primary-blue-hover);
}

.chat-send-btn:active {
  transform: scale(0.92);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

/* ==========================================================================
   PANTALLA 8: MENÚ ADICIONAL ("MÁS")
   ========================================================================== */

.more-menu-container {
  display: flex;
  flex-direction: column;
}

.more-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}

.more-menu-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.more-menu-card:hover {
  transform: translateY(-1.5px);
  box-shadow: var(--shadow);
}

.more-menu-card:active {
  transform: scale(0.99);
}

.more-menu-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.more-menu-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.more-menu-icon.icon-bodega {
  background: #fee2e2;
  color: #dc2626;
}

.more-menu-icon.icon-pagos {
  background: #fce7f3;
  color: #db2777;
}

.more-menu-icon.icon-cloud {
  background: #dbeafe;
  color: #2563eb;
}

.more-menu-icon.icon-config {
  background: #f1f5f9;
  color: #475569;
}

.more-menu-icon.icon-ayuda {
  background: #f3e8ff;
  color: #7c3aed;
}

.more-menu-icon svg {
  width: 20px;
  height: 20px;
}

.more-menu-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.more-menu-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted-2);
}

.btn-logout-card {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 1.5px solid #fecaca;
  background: #fff5f5;
  color: #dc2626;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.btn-logout-card:hover {
  background: #fee2e2;
}

.btn-logout-card:active {
  transform: scale(0.98);
}

.btn-logout-card svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   FORMULARIOS, MODALES Y COMPONENTES
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 1200;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow-float);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  animation: modalIn 0.22s var(--ease);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.modal-header-back {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
}

.modal-header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  text-align: center;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Selector de cliente (fiado, fiado por voz y pago) */
.picker-modal-header {
  align-items: flex-start;
  padding: 18px 20px 15px;
}

.picker-heading {
  flex: 1;
  min-width: 0;
}

.picker-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--primary-blue);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.picker-title {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.picker-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.picker-modal-header .modal-close {
  flex-shrink: 0;
  margin-top: 2px;
}

.picker-modal .modal-body {
  padding-top: 16px;
  overscroll-behavior: contain;
}

.picker-search-wrap {
  margin-bottom: 12px;
}

.picker-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 12px;
  color: var(--muted);
  font-size: 12px;
}

.picker-scope {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.picker-scope::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.picker-count {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 4px;
}

.picker-item {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
}

.picker-item:focus-visible {
  outline: 3px solid rgba(22, 101, 216, 0.18);
  outline-offset: 2px;
  border-color: var(--primary-blue);
}

.picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-alt);
  text-align: center;
}

.picker-empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.picker-empty-icon svg {
  width: 22px;
  height: 22px;
}

.picker-empty h4 {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.picker-empty p {
  max-width: 260px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(22, 101, 216, 0.12);
}

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

.form-group .input-with-icon {
  padding-left: 46px;
}

.detailed-item-row {
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.detailed-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin-bottom: 6px;
}

.detailed-item-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}

.detailed-item-remove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #ffffff;
  color: #dc2626;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.detailed-item-remove:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.detailed-item-row .form-group {
  margin-bottom: 10px;
}

.detailed-item-row .form-row-2col .form-group {
  margin-bottom: 0;
}

.detailed-item-name {
  margin-bottom: 10px;
}

.detailed-item-row .form-group label {
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.detailed-item-row .form-group input {
  height: 42px;
  font-size: 14px;
}

.detailed-item-row .form-group .input-with-icon {
  padding-left: 42px;
}

.detailed-item-row .input-icon-prefix {
  left: 12px;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-blue-hover);
}

.btn-success {
  background: var(--success-green);
  color: #ffffff;
}

.btn-danger {
  background: var(--danger-red);
  color: #ffffff;
}

.btn-outline {
  border-color: var(--line-strong);
  color: var(--ink);
  background: #ffffff;
}

.btn-outline:hover {
  background: var(--surface-soft);
}

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

.btn-outline:disabled:hover {
  background: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-float);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.toast-error {
  background: #dc2626;
}

.toast.toast-warning {
  background: #d97706;
}

.toast.toast-info {
  background: #2563eb;
}

/* Voice dictation styling */
.voice-fiado-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--purple-light);
  color: var(--purple-accent);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #ddd6fe;
  cursor: pointer;
  margin-bottom: 12px;
}

.voice-fiado-btn.listening {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Desktop Sidebar */
.sidebar,
.client-sidebar {
  width: 250px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.brand-badge-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.brand-badge-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-brand h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.sidebar-brand span {
  font-size: 11px;
  color: var(--muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-item.active {
  background: var(--primary-blue);
  color: #ffffff;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item.active svg {
  stroke: #ffffff;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 13px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.user-role {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}

/* Auth Container */
.auth-container,
.role-select-container {
  display: grid;
  place-items: center;
  padding: 20px;
  background: #f8fafc;
}

.auth-card,
.role-card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.auth-card h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.auth-card .subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 24px;
}

.auth-toggle {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted);
}

.auth-toggle a {
  font-weight: 600;
  cursor: pointer;
}

.role-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.role-option {
  padding: 20px 14px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.role-option:hover {
  border-color: var(--line-strong);
}

.role-option.selected {
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
}

.role-option .icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--primary-blue);
  margin-bottom: 12px;
}

.role-option.selected .icon {
  background: #ffffff;
}

/* ==========================================================================
   MEDIA QUERY MOBILE (SECCIÓN 10 / PRUEBA 12 DE ACEPTACIÓN)
   Debe incluir @media (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .section-header-row {
    align-items: flex-start;
  }

  .section-title {
    flex: 1 1 auto;
  }

  .sidebar,
  .client-sidebar {
    display: none;
  }

  .main-content {
    padding: 16px 16px 84px;
  }

  .table-activity-desktop,
  .table-clients-desktop,
  .table-movements-desktop {
    display: none;
  }

  .client-cards-mobile {
    display: flex;
    flex-direction: column;
  }

  .bottom-nav {
    display: flex;
  }

  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    margin-top: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .picker-modal .modal-body {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }

  .sidebar,
  .client-sidebar {
    display: flex;
  }

  .quick-action-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .chat-panel {
    inset: auto 24px 24px auto;
    width: 400px;
    height: 580px;
    border-radius: 20px;
    box-shadow: var(--shadow-float);
    border: 1px solid var(--line);
    overflow: hidden;
  }
}

/* Chat: ficha del vendedor e imágenes */
.chat-header-info {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 6px 10px;
  border-radius: 14px;
  cursor: default;
  transition: background 0.15s ease;
}

.chat-header-info.is-clickable {
  cursor: pointer;
}

.chat-header-info.is-clickable:hover {
  background: var(--surface-soft);
}

.chat-header-info:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.chat-header-info:disabled {
  opacity: 1;
}

.chat-header-info.is-clickable .chat-status {
  color: var(--primary-blue);
}

.chat-header-chevron {
  display: none;
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: 0 0 auto;
}

.chat-header-info.is-clickable .chat-header-chevron {
  display: block;
}

.chat-bubble-image-link {
  display: block;
  margin: 3px 0 7px;
  border-radius: 12px;
  overflow: hidden;
}

.chat-bubble-image {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: 12px;
  background: #ffffff;
}

.chat-payment-action {
  margin: 3px 0 7px;
}

.chat-register-payment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.chat-register-payment-btn:hover {
  background: #dbeafe;
  border-color: rgba(37, 99, 235, 0.45);
}

.chat-register-payment-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.chat-payment-registered {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11.5px;
  font-weight: 700;
}

.chat-payment-registered svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.chat-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
}

.chat-image-preview img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.chat-image-preview span {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.chat-image-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 19px;
  line-height: 1;
}

.chat-attach-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  flex: 0 0 auto;
  transition: background 0.15s ease, color 0.15s ease;
}

.chat-attach-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.chat-attach-btn svg {
  width: 19px;
  height: 19px;
}

/* Configuración de métodos de pago */
.payment-settings-intro {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 16px;
}

.payment-config-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  margin-bottom: 12px;
}

.payment-config-card.payment-config-cash {
  background: var(--surface-soft);
}

.payment-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-method-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.payment-method-brand strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
}

.payment-method-brand span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.payment-config-fields {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.payment-config-fields .form-group:last-child {
  margin-bottom: 0;
}

.payment-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.payment-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.payment-switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}

.payment-switch-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.payment-switch input:checked + .payment-switch-slider {
  background: var(--primary-blue);
}

.payment-switch input:checked + .payment-switch-slider::before {
  transform: translateX(20px);
}

.payment-switch input:focus-visible + .payment-switch-slider {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.payment-always-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.payment-qr-preview {
  width: 168px;
  max-width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.payment-qr-preview img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
}

.payment-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pago-receipt-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafc;
}

.pago-receipt-preview a {
  flex: 0 0 auto;
}

.pago-receipt-preview img {
  display: block;
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.pago-receipt-preview span {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.payment-upload-status {
  min-height: 17px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}

.payment-upload-status.success {
  color: var(--success-green);
}

.payment-upload-status.error {
  color: var(--danger-red);
}

.payment-upload-status.info {
  color: var(--primary-blue);
}

.payment-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

/* Ficha pública del vendedor */
.seller-profile-head {
  text-align: center;
  margin-bottom: 20px;
}

.seller-profile-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary-blue);
  font-size: 24px;
  font-weight: 800;
}

.seller-profile-head h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.seller-profile-head p {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.seller-payment-section h3 {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.seller-payment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.seller-payment-card-details {
  align-items: flex-start;
}

.seller-payment-info {
  flex: 1;
  min-width: 0;
}

.seller-payment-info strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.seller-payment-info > span {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}

.seller-payment-data {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 12.5px;
}

.seller-payment-data span {
  color: var(--muted);
}

.seller-payment-data strong {
  font-size: 13px;
  letter-spacing: 0.02em;
  word-break: break-all;
  text-align: right;
}

.seller-qr-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  text-align: center;
}

.seller-qr-box a {
  display: inline-block;
}

.seller-qr-box img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: 180px;
  object-fit: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.seller-qr-box span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.seller-payment-note {
  margin: 14px 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 480px) {
  .payment-settings-actions {
    flex-direction: column-reverse;
  }

  .payment-settings-actions .btn {
    width: 100%;
  }

  .chat-header-info {
    padding: 4px 6px;
  }

  .chat-name {
    font-size: 14px;
  }

  .chat-status {
    font-size: 10.5px;
  }
}

.client-pin-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.copy-pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--primary-blue);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.copy-pin-btn:hover {
  background: #e8f0ff;
  border-color: var(--primary-blue);
}

.copy-pin-btn .ui-icon {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   CLIENTE: INICIO, TIENDAS, CHAT Y VINCULACIÓN
   ========================================================================== */

.client-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 24px;
}

.client-page-head > div:first-child {
  min-width: 0;
}

.client-page-head h1 {
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(27px, 3vw, 35px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

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

.client-page-head p strong {
  color: var(--ink-2);
}

.client-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-blue);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.client-page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.client-page-actions .btn {
  white-space: nowrap;
}

.client-page-actions .btn svg,
.client-store-open svg,
.client-action-arrow svg,
.client-seller-cta svg,
.client-seller-arrow svg,
.client-linked-note svg,
.client-help-note svg {
  width: 16px;
  height: 16px;
}

.client-account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(230px, 0.85fr);
  align-items: center;
  gap: 22px 30px;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(440px 220px at 100% 0%, rgba(22, 101, 216, 0.09), transparent 66%),
    var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.client-account-hero.is-clear {
  border-color: rgba(22, 163, 74, 0.18);
  background:
    radial-gradient(440px 220px at 100% 0%, rgba(22, 163, 74, 0.09), transparent 66%),
    var(--surface);
}

.client-store-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.client-store-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: linear-gradient(145deg, #2b7aee, var(--primary-blue));
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px -8px rgba(22, 101, 216, 0.5);
}

.client-account-hero .client-store-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 25px;
}

.client-store-copy {
  min-width: 0;
}

.client-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.client-store-copy h2 {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.client-status-row {
  margin-top: 8px;
}

.client-balance-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.client-balance-block > span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.client-balance-block > strong {
  margin-top: 5px;
  color: var(--danger);
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.client-account-hero.is-clear .client-balance-block > strong {
  color: var(--success);
}

.client-balance-block p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
}

.client-mini-stats {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.client-mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.8);
}

.client-mini-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.client-mini-stat strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.client-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.client-action-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}

.client-action-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.client-action-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.client-action-icon.is-blue {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.client-action-icon.is-purple {
  background: var(--purple-light);
  color: var(--purple-accent);
}

.client-action-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.client-action-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-action-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-action-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted-2);
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}

.client-action-card:hover .client-action-arrow {
  color: var(--primary-blue);
  transform: translateX(3px);
}

.client-history-card,
.client-link-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.client-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.client-history-head h2,
.client-link-card h2,
.client-help-card h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.client-history-head p,
.client-link-card-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.client-report-btn {
  flex: 0 0 auto;
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--danger);
}

.client-report-btn:hover {
  border-color: rgba(220, 38, 38, 0.4);
  background: var(--danger-soft);
}

.client-history-table {
  width: 100%;
  border-collapse: collapse;
}

.client-history-table th {
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.065em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.client-history-table th:first-child,
.client-history-table td:first-child {
  padding-left: 24px;
}

.client-history-table th:last-child,
.client-history-table td:last-child {
  padding-right: 24px;
}

.client-history-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  vertical-align: middle;
}

.client-history-table tbody tr:last-child td {
  border-bottom: none;
}

.client-history-table tbody tr {
  transition: background 0.15s ease;
}

.client-history-table tbody tr:hover {
  background: #fbfdff;
}

.client-history-table tr.is-void {
  background: var(--surface-alt);
  opacity: 0.62;
}

.client-history-date {
  color: var(--muted);
  font-size: 12px !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.client-history-desc {
  display: block;
  max-width: 360px;
  overflow-wrap: anywhere;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
}

.client-history-receipt {
  margin-top: 7px;
}

.client-history-amount {
  font-size: 13.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.client-history-amount.credit {
  color: var(--success);
}

.client-history-amount.debit {
  color: var(--danger);
}

.client-history-amount.muted {
  color: var(--muted);
}

.client-footnote {
  margin-top: 22px;
  text-align: center;
}

.client-text-btn {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.client-text-btn.is-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.client-store-grid,
.client-seller-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.client-store-tile,
.client-seller-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.client-store-tile:hover,
.client-seller-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.client-store-tile-top,
.client-seller-top {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-width: 0;
}

.client-store-tile-copy,
.client-seller-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.client-store-tile-copy > strong,
.client-seller-copy > strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.client-store-tile-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.client-store-tile-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
}

.client-store-tile-balance > span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.client-store-tile-balance > strong,
.client-seller-stat > strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.client-store-tile-balance > strong.is-debt,
.client-seller-stat > strong.is-debt {
  color: var(--danger);
}

.client-store-tile-balance > strong.is-clear,
.client-seller-stat > strong.is-clear {
  color: var(--success);
}

.client-store-tile-foot,
.client-seller-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.client-store-tile-meta {
  color: var(--muted);
  font-size: 11.5px;
}

.client-store-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary-blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.client-seller-card.is-active {
  border-color: rgba(22, 101, 216, 0.45);
  box-shadow: 0 0 0 4px rgba(22, 101, 216, 0.08), var(--shadow);
}

.client-seller-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  font-size: 18px;
  font-weight: 800;
}

.client-seller-card.is-active .client-seller-avatar {
  background: var(--primary-blue);
  color: #ffffff;
}

.client-seller-copy .client-seller-sub {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.client-seller-top > .badge-al-dia,
.client-seller-top > .badge-aldia,
.client-seller-top > .badge-parcial,
.client-seller-top > .badge-pendiente,
.client-seller-top > .badge-revision {
  flex: 0 0 auto;
}

.client-seller-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.client-seller-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.client-seller-stat small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.client-seller-stat strong {
  font-size: 14px;
}

.client-seller-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  font-size: 12px;
  font-weight: 800;
}

.client-seller-arrow {
  display: grid;
  place-items: center;
  color: var(--muted-2);
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}

.client-seller-card:hover .client-seller-arrow {
  color: var(--primary-blue);
  transform: translateX(3px);
}

.client-empty-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 52px 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.client-empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.client-empty-icon svg {
  width: 25px;
  height: 25px;
}

.client-empty-card h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.client-empty-card p {
  max-width: 380px;
  margin: 6px auto 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.client-link-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: start;
  gap: 18px;
  max-width: 940px;
  margin: 0 auto;
}

.client-link-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.client-link-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.client-link-icon svg {
  width: 22px;
  height: 22px;
}

.client-step,
.client-help-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--primary-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.client-link-card-head > div:last-child {
  min-width: 0;
}

.client-link-card-head h2 {
  font-size: 19px;
  line-height: 1.2;
}

.client-link-body {
  padding: 20px 24px 24px;
}

.client-pin-group .pin-input {
  height: 64px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--surface-alt);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-align: center;
}

.client-pin-group .pin-input::placeholder {
  color: var(--muted-2);
  letter-spacing: 0.24em;
}

.client-field-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
}

.client-link-submit {
  min-height: 46px;
  margin-top: 2px;
}

.client-linked-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--success-soft);
  color: #15803d;
  font-size: 11.5px;
  line-height: 1.45;
}

.client-linked-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.client-help-card {
  padding: 24px;
  border: 1px solid #dbeafe;
  border-radius: 24px;
  background:
    radial-gradient(260px 180px at 100% 0%, rgba(22, 101, 216, 0.08), transparent 70%),
    linear-gradient(155deg, #f8fbff, #eff6ff);
}

.client-help-card h2 {
  margin-bottom: 18px;
}

.client-help-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.client-help-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.client-help-step-num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #ffffff;
  color: var(--primary-blue);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.client-help-step strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
}

.client-help-step p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.client-help-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(22, 101, 216, 0.14);
  color: #1e40af;
  font-size: 11.5px;
  line-height: 1.5;
}

.client-help-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* Badges compartidos */
.badge-al-dia,
.badge-aldia,
.badge-parcial,
.badge-pendiente,
.badge-deuda,
.badge-revision,
.badge-anulado,
.badge-tipo-pago,
.badge-tipo-fiado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1;
  white-space: nowrap;
}

.badge-al-dia,
.badge-aldia {
  background: #dcfce7;
  color: #15803d;
}

.badge-parcial {
  background: #fef3c7;
  color: #b45309;
}

.badge-pendiente,
.badge-deuda {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-revision {
  background: #fef3c7;
  color: #b45309;
}

.badge-anulado {
  background: var(--surface-soft);
  color: var(--muted);
}

.badge-tipo-pago {
  background: #dcfce7;
  color: #15803d;
  letter-spacing: 0.05em;
}

.badge-tipo-fiado {
  background: #fee2e2;
  color: #b91c1c;
  letter-spacing: 0.05em;
}

.badge-icon {
  width: 13px;
  height: 13px;
}

/* Estados compartidos */
.movement-status {
  color: var(--success);
  font-size: 11.5px;
  font-weight: 700;
}

.row-note-danger {
  margin-top: 3px;
  color: var(--danger);
  font-size: 11px;
}

.empty-state {
  padding: 42px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state .icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 17px;
  background: var(--surface-soft);
  color: var(--muted);
}

.empty-state .icon svg {
  width: 22px;
  height: 22px;
}

.empty-state h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.empty-state p {
  font-size: 12.5px;
}

.error-msg {
  display: none;
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Tablas móviles compartidas */
.movements-mobile,
.client-cards-mobile {
  display: none;
  flex-direction: column;
}

.movement-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.movement-card:last-child {
  border-bottom: none;
}

.movement-card.is-void {
  opacity: 0.58;
}

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

.movement-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.movement-date {
  color: var(--muted);
  font-size: 11px;
}

.movement-amount {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.movement-amount.credit {
  color: var(--success);
}

.movement-amount.debit {
  color: var(--danger);
}

.movement-amount.muted {
  color: var(--muted);
}

.movement-desc {
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
}

.movement-foot {
  margin-top: 8px;
}

@media (max-width: 960px) {
  .client-account-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .client-balance-block {
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: none;
  }

  .client-link-layout {
    grid-template-columns: 1fr;
    max-width: 620px;
  }

  .client-history-table {
    display: none;
  }

  .client-history-mobile {
    display: flex;
  }
}

@media (max-width: 768px) {
  .client-page-head {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .client-page-head h1 {
    font-size: 27px;
  }

  .client-page-actions {
    width: 100%;
  }

  .client-page-actions .btn {
    flex: 1;
  }

  .client-account-hero {
    padding: 20px;
    border-radius: 22px;
  }

  .client-account-hero .client-store-avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 22px;
  }

  .client-store-copy h2 {
    font-size: 20px;
  }

  .client-balance-block > strong {
    font-size: 38px;
  }

  .client-mini-stat {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .client-action-grid {
    grid-template-columns: 1fr;
  }

  .client-history-head {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }

  .client-history-head .btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .client-history-card {
    border-radius: 22px;
  }

  .client-store-grid,
  .client-seller-grid {
    grid-template-columns: 1fr;
  }

  .client-link-card-head {
    padding: 20px 18px 16px;
  }

  .client-link-body {
    padding: 18px;
  }

  .client-help-card {
    padding: 20px;
  }

  .movements-mobile {
    display: flex;
  }

  .client-cards-mobile {
    display: flex;
  }
}

@media (max-width: 480px) {
  .client-page-head h1 {
    font-size: 25px;
  }

  .client-mini-stats {
    grid-template-columns: 1fr;
  }

  .client-store-tile,
  .client-seller-card {
    padding: 18px;
  }

  .client-seller-top {
    flex-wrap: wrap;
  }

  .client-seller-top > .badge-al-dia,
  .client-seller-top > .badge-aldia,
  .client-seller-top > .badge-parcial,
  .client-seller-top > .badge-pendiente,
  .client-seller-top > .badge-revision {
    margin-left: 61px;
  }

  .client-link-card-head {
    flex-direction: column;
  }

  .client-empty-card {
    padding: 42px 20px;
  }
}
