:root {
  --bg: #e9eff5;
  --bg2: #d8e3ee;
  --panel: #f8fbfe;
  --panel2: #e8eff6;
  --border: #cbd9e5;
  --text: #263544;
  --muted: #64798c;
  --accent: #557a9c;
  --accent2: #7d9fbe;
  --accent-soft: #dce8f2;
  --danger: #b65c5c;
  --ok: #4f8a7d;
  --radius: 26px;
  --radius-sm: 18px;
  --shadow-sm: 0 4px 14px rgba(50, 74, 96, 0.1);
  --shadow: 0 14px 34px rgba(50, 74, 96, 0.14);
  --shadow-lg: 0 26px 60px rgba(40, 62, 84, 0.2);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

/* Sin destello azul ni recuadro al tocar botones en móvil */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
button,
a,
input,
select,
textarea,
label,
summary,
.tab,
.subtab,
.seg,
.btn,
.picker-item,
.connect-url {
  touch-action: manipulation;
}
:focus { outline: none; }
:focus-visible {
  outline: 2px solid rgba(85, 122, 156, 0.62);
  outline-offset: 2px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: none; }

[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.05'/%3E%3C/svg%3E"),
    radial-gradient(1100px 620px at 8% -10%, #f5f9fc 0%, rgba(245, 249, 252, 0) 60%),
    radial-gradient(900px 520px at 100% 0%, #e4eef6 0%, rgba(228, 238, 246, 0) 62%),
    radial-gradient(760px 620px at 50% 120%, #dae6f1 0%, rgba(218, 230, 241, 0) 65%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 180px 180px, auto, auto, auto, auto;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Manchas difuminadas de fondo, muy discretas */
body::before {
  content: '';
  position: fixed;
  inset: -12%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(234, 242, 249, 0.82), rgba(234, 242, 249, 0)) 8% 12% / 46vmax 46vmax no-repeat,
    radial-gradient(closest-side, rgba(125, 159, 190, 0.3), rgba(125, 159, 190, 0)) 96% 4% / 40vmax 40vmax no-repeat,
    radial-gradient(closest-side, rgba(126, 163, 152, 0.18), rgba(126, 163, 152, 0)) 84% 96% / 44vmax 44vmax no-repeat;
  filter: blur(28px);
  animation: drift 26s ease-in-out infinite alternate;
}

/* ---------------------------------------------------------- Encabezado */
.app-header {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px auto 22px;
  max-width: 1240px;
  padding: 12px 20px;
  border: 1px solid rgba(203, 217, 229, 0.9);
  border-radius: 999px;
  background: rgba(248, 251, 254, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: slideDown 0.5s var(--ease) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 4px;
  border-radius: 16px;
  background: linear-gradient(150deg, #ffffff, #e6eff8);
  border: 1px solid #d3e2ef;
  box-shadow: 0 8px 18px rgba(85, 122, 156, 0.22);
  transition: transform 0.35s var(--ease);
  overflow: hidden;
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 19px; letter-spacing: 1.2px; }
.brand-text small { color: var(--muted); font-size: 11.5px; letter-spacing: 0.3px; }

.header-actions { display: flex; align-items: center; gap: 9px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #c6d8e7;
  color: #40607f;
  font-size: 12px;
  font-weight: 700;
}
.chip::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(79, 138, 125, 0.6);
  animation: pulse 2.4s infinite;
}

/* ---------------------------------------------------------- Pestañas */
.tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(620px, calc(100% - 24px));
  margin: 0 auto 24px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(226, 236, 245, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 14px 34px rgba(50, 74, 96, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(139, 166, 190, 0.16);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  overflow: hidden;
  isolation: isolate;
  animation: fadeUp 0.5s var(--ease) both;
}
.tabs::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  z-index: 0;
  width: calc(33.333% - 6px);
  border-radius: 999px;
  background: linear-gradient(135deg, #86a8c6, #5a7f9f);
  box-shadow:
    0 10px 20px rgba(85, 122, 156, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.45s var(--ease);
}
.tabs[data-active="customers"]::before { transform: translateX(100%); }
.tabs[data-active="finance"]::before { transform: translateX(200%); }
.tabs::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 24px;
  right: 24px;
  height: 1px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
}
.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #5f7488;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: color 0.25s, transform 0.3s var(--ease);
}
.tab svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.9;
  transition: transform 0.3s var(--ease), opacity 0.25s;
}
.tab:hover { color: #2f4456; }
.tab:hover svg { transform: translateY(-1px) scale(1.06); }
.tab:active { transform: scale(0.98); }
.tab.active { color: #fbfdff; }
.tab.active svg { opacity: 1; }

/* ---------------------------------------------------------- Contenido */
.content { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 20px 70px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}
.toolbar .row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------- Encabezado de sección */
.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(248, 251, 254, 0.97), rgba(226, 237, 246, 0.88));
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s var(--ease) both;
}
.page-hero h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: 0.2px; }
.page-hero p { margin: 0; color: var(--muted); font-size: 13.5px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------- Subpestañas de pedidos */
.subtabs {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(248, 251, 254, 0.86);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.55s var(--ease) both;
}
.subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.3s var(--ease), color 0.25s, transform 0.25s;
}
.subtab:hover { color: #2f4456; transform: translateY(-1px); }
.subtab.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fbfdff;
  box-shadow: 0 8px 16px rgba(85, 122, 156, 0.22);
}
.subtab .count {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #4a6c8a;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}
.subtab.active .count { background: rgba(251, 253, 255, 0.24); color: #fbfdff; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fbfdff;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(85, 122, 156, 0.22);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, filter 0.25s;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(85, 122, 156, 0.3); }
.btn:hover::after { left: 120%; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn.secondary:hover { background: #fff; }
.btn.danger { background: linear-gradient(135deg, #c47575, var(--danger)); box-shadow: 0 10px 20px rgba(182, 92, 92, 0.24); }
.btn.small { padding: 8px 15px; font-size: 12.5px; }

/* ---------------------------------------------------------- Resumen */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .stats { grid-template-columns: 1fr; }
}
.stat {
  background: rgba(248, 251, 254, 0.93);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.55s var(--ease) both;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; letter-spacing: -0.5px; color: #34536e; }
.stat span { color: var(--muted); font-size: 12.5px; letter-spacing: 0.3px; }
.stat:nth-child(2) { animation-delay: 0.06s; }
.stat:nth-child(3) { animation-delay: 0.12s; }
.stat:nth-child(4) { animation-delay: 0.18s; }
.stat-income b { color: var(--ok); }

/* ---------------------------------------------------------- Finanzas */
.month-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #f2f7fc;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.month-input:focus { border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(125, 159, 190, 0.16); }

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card { margin-bottom: 0; }
@media (max-width: 900px) {
  .finance-grid { grid-template-columns: 1fr; }
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head h3 { margin: 0; font-size: 16px; }
.card-head .muted { font-size: 12px; }

.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 228px;
  padding-top: 8px;
}
.bar-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}
.bar-value {
  height: 18px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(226, 237, 246, 0.2), rgba(226, 237, 246, 0.75));
  overflow: hidden;
}
.bar-fill {
  width: min(46px, 82%);
  min-height: 0;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  box-shadow: 0 6px 14px rgba(85, 122, 156, 0.18);
  transition: height 0.5s var(--ease);
}
.bar-col.current .bar-fill {
  background: linear-gradient(180deg, #7fb3a8, #4f8a7d);
  box-shadow: 0 6px 14px rgba(79, 138, 125, 0.24);
}
.bar-label {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text);
  text-transform: capitalize;
}
.bar-count { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.donut {
  position: relative;
  width: 158px;
  height: 158px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(#e3edf5 0deg 360deg);
  box-shadow: inset 0 0 0 1px rgba(203, 217, 229, 0.6);
}
.donut-hole {
  position: absolute;
  inset: 27px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(50, 74, 96, 0.1);
}
.donut-hole span { font-size: 15px; font-weight: 800; color: #34536e; }
.donut-hole small { font-size: 10.5px; color: var(--muted); }

.legend { display: flex; flex-direction: column; gap: 11px; min-width: 190px; }
.legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-name { color: var(--text); font-weight: 600; }
.legend-value { color: var(--muted); font-weight: 700; white-space: nowrap; }

.card { animation: fadeUp 0.55s var(--ease) both; }
.table-wrap.inner {
  margin-top: 4px;
  border-radius: var(--radius-sm);
  box-shadow: none;
  background: rgba(248, 251, 254, 0.7);
}
.table-wrap.inner .data-table { min-width: 640px; }
.table-wrap.inner .data-table th { top: -1px; }
.data-table tfoot td {
  padding: 14px 16px;
  border-top: 2px solid var(--border);
  font-size: 13px;
  background: rgba(226, 237, 246, 0.5);
}

/* ---------------------------------------------------------- Filtros */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(240, 246, 251, 0.82);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.6s var(--ease) both;
}
.filters input,
.filters select,
.form-row input,
.form-row textarea,
.form-row select {
  padding: 11px 15px;
  background: #f2f7fc;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.form-row textarea { border-radius: var(--radius-sm); }
.filters input { flex: 1 1 260px; min-width: 0; }
.filters select { flex: 0 1 195px; }
.filters input:focus,
.filters select:focus,
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(125, 159, 190, 0.16);
  background: #ffffff;
}
::placeholder { color: #93a7ba; }

/* ---------------------------------------------------------- Tablas */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(248, 251, 254, 0.95);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
  animation: fadeUp 0.65s var(--ease) both;
}
.data-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid #e6eef6;
  vertical-align: middle;
  white-space: nowrap;
}
.data-table th {
  background: linear-gradient(180deg, #e6eef6, #d8e4ef);
  color: #4c6579;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  position: sticky;
  top: 0;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.25s; animation: rowIn 0.45s var(--ease) both; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.03s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.09s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.12s; }
.data-table tbody tr:hover { background: #eef5fb; }
.data-table .num { text-align: right; }
.data-table .folio { font-weight: 800; color: #3f6488; letter-spacing: 0.6px; }
.order-row.is-deleted { background: rgba(249, 228, 224, 0.22); }
.order-row.is-deleted .folio { color: #a9503f; }
.deleted-note { color: #a9503f; }
.data-table .actions { display: flex; gap: 7px; align-items: center; }
.data-table .small-text { font-size: 11px; color: var(--muted); }
.status-select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 100%;
  padding: 6px 28px 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--panel2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2364798c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 9px 6px;
  color: #5a7186;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, filter 0.2s;
}
.status-select:hover { filter: brightness(0.97); }
.status-select:focus-visible { box-shadow: 0 0 0 3px rgba(85, 122, 156, 0.22); }
.status-select.pendiente { background-color: #fdf0d6; border-color: #f0d9ab; color: #a4741f; }
.status-select.en_proceso { background-color: #e8eef8; border-color: #cfdcf0; color: #4a6fa5; }
.status-select.listo { background-color: #e6f2e6; border-color: #cbe3cb; color: #4f7d4f; }
.status-select.entregado { background-color: #eaeff5; border-color: #d8e2ec; color: #5e7386; }
.status-select.cancelado { background-color: #f9e4e0; border-color: #efc9c2; color: #a9503f; }

.badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: #5a7186;
  transition: transform 0.25s var(--ease);
}
.badge:hover { transform: scale(1.05); }
.badge.pendiente { background: #fdf0d6; border-color: #f0d9ab; color: #a4741f; }
.badge.en_proceso { background: #e8eef8; border-color: #cfdcf0; color: #4a6fa5; }
.badge.listo { background: #e6f2e6; border-color: #cbe3cb; color: #4f7d4f; }
.badge.entregado { background: #eaeff5; border-color: #d8e2ec; color: #5e7386; }
.badge.cancelado { background: #f9e4e0; border-color: #efc9c2; color: #a9503f; }

.wa { color: #4e8f63; text-decoration: none; font-weight: 600; white-space: nowrap; }
.wa:hover { text-decoration: underline; }
.wa-icon {
  font-size: 9.5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}

/* ---------------------------------------------------------- Modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 46, 62, 0.42);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.25s ease both; }
.modal {
  background: linear-gradient(180deg, #f8fbfe, #eef4fa);
  border: 1px solid var(--border);
  border-radius: 30px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.4s var(--ease) both;
}
.modal h3 { margin: 0 0 16px; font-size: 20px; }
.form-row { margin-bottom: 13px; }
.form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.form-row input,
.form-row textarea,
.form-row select { width: 100%; }
.form-row textarea { min-height: 82px; resize: vertical; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.date-group { display: grid; grid-template-columns: 0.85fr 1.35fr 1fr; gap: 8px; }
.date-group select { width: 100%; }

.segmented {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel2);
}
.seg {
  padding: 9px 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.3s var(--ease), color 0.25s, transform 0.25s;
}
.seg:hover { transform: translateY(-1px); }
.seg.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fbfdff;
  box-shadow: 0 8px 16px rgba(85, 122, 156, 0.22);
}

/* ---------------------------------------------------------- Validación y buscador */
.field-error {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #a9503f;
}
.field-error:empty { display: none; }
.form-row.invalid input,
.form-row.invalid textarea,
.form-row.invalid select {
  border-color: #c4695a;
  background: #fdf1ee;
  box-shadow: 0 0 0 4px rgba(182, 92, 92, 0.15);
}
.form-alert {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #e7bdb4;
  background: #fbe8e3;
  color: #8c3c2d;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}
.form-alert[hidden] { display: none; }
.form-alert.warning {
  border-color: #ecd6ac;
  background: #fdf3dd;
  color: #8a6420;
}

.client-picker { position: relative; }
.picker-results {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f7fbfe;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
}
.picker-results[hidden] { display: none; }
.picker-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s;
}
.picker-item:hover,
.picker-item.active { background: var(--accent-soft); }
.picker-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.picker-meta { font-size: 11.5px; color: var(--muted); }
.picker-empty { padding: 11px 12px; font-size: 12.5px; color: var(--muted); }
.picker-info {
  margin-top: 7px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #3f6488;
  font-size: 12px;
  font-weight: 600;
}
.picker-info[hidden] { display: none; }

.mini-list { display: grid; gap: 9px; }
.mini-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(246, 250, 254, 0.9);
}
.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}
.mini-head b { font-size: 14px; color: #3f6488; letter-spacing: 0.4px; }
.mini-meta { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.mini-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---------------------------------------------------------- Fotos */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: block;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.3s;
}
.gallery a:hover img { transform: scale(1.04) rotate(-1deg); box-shadow: var(--shadow); }
.photo-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.file-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.photo-thumb { position: relative; animation: popIn 0.35s var(--ease) both; }
.photo-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: block;
}
.photo-remove {
  position: absolute;
  top: -7px; right: -7px;
  width: 27px; height: 27px;
  border-radius: 50%;
  border: 2px solid #fbfdff;
  background: var(--danger);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease);
}
.photo-remove:hover { transform: scale(1.12) rotate(90deg); }

/* ---------------------------------------------------------- Varios */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.card .muted { color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.thumb {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel2);
}
.item-row {
  display: grid;
  grid-template-columns: 1fr 70px 90px auto;
  gap: 9px;
  align-items: center;
  margin-bottom: 9px;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 56px 24px;
  font-size: 14.5px;
  background: rgba(248, 251, 254, 0.8);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 14px;
  animation: fadeUp 0.5s var(--ease) both;
}
.kv { display: flex; gap: 7px; font-size: 13.5px; padding: 4px 0; flex-wrap: wrap; }
.kv b { color: var(--muted); font-weight: 600; min-width: 116px; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------- Animaciones */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 138, 125, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(79, 138, 125, 0); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(1.5%, -1.5%, 0) scale(1.04); }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.02); }
}

/* ---------------------------------------------------------- Móvil y tablet vertical */
@media (max-width: 860px) {
  .app-header {
    top: 6px;
    margin: 6px 8px 12px;
    padding: 9px 12px;
    border-radius: 20px;
  }
  .brand-mark { width: 36px; height: 36px; border-radius: 12px; font-size: 11px; }
  .brand-text strong { font-size: 15.5px; }
  .brand-text small { font-size: 10px; }
  .chip { display: none; }
  .tabs { width: calc(100% - 16px); margin: 0 auto 12px; padding: 4px; }
  .tab { padding: 9px 8px; font-size: 12.5px; gap: 5px; }
  .tab svg { width: 15px; height: 15px; }
  .content { padding: 0 10px 46px; }
  .toolbar h2 { font-size: 18px; }
  .data-table { min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; }
  .page-hero { padding: 13px 14px; border-radius: 18px; margin-bottom: 12px; gap: 10px; }
  .page-hero h2 { font-size: 18.5px; margin-bottom: 2px; }
  .page-hero p { font-size: 12px; line-height: 1.4; }
  .hero-actions { width: 100%; gap: 6px; }
  .hero-actions .btn { flex: 1 1 auto; padding: 9px 11px; }
  .month-input { flex: 1 1 150px; padding: 9px 11px; }
  .subtabs { width: 100%; margin-bottom: 12px; padding: 4px; }
  .subtab { flex: 1; justify-content: center; gap: 5px; padding: 8px 6px; font-size: 11.5px; }
  .subtab .count { min-width: 20px; padding: 1px 6px; font-size: 10.5px; }
  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
    margin-bottom: 12px;
  }
  .filters input { min-width: 0; width: 100%; padding: 9px 12px; }
  .filters select { min-width: 0; width: 100%; padding: 9px 10px; grid-column: 1 / -1; }
  .filters #order-clear,
  .filters #customer-clear {
    grid-column: 2;
    grid-row: 1;
    padding: 9px 13px;
    font-size: 12.5px;
    line-height: 1;
  }

  .stats { gap: 8px; margin-bottom: 14px; }
  .stat { padding: 11px 13px; border-radius: 16px; }
  .stat b { font-size: 20px; }
  .stat span { font-size: 11px; }
  .finance-grid { gap: 10px; margin-bottom: 12px; }
  .card { padding: 14px; border-radius: 20px; margin-bottom: 12px; }
  .card-head { margin-bottom: 10px; gap: 6px; }
  .card-head h3 { font-size: 14.5px; }
  .card-head .muted { font-size: 10.5px; }
  .bars { height: 155px; gap: 3px; padding-top: 4px; }
  .bar-value { height: 14px; font-size: 7.5px; }
  .bar-label { margin-top: 5px; font-size: 10px; }
  .bar-count { font-size: 9px; }
  .bar-fill { width: min(30px, 78%); }
  .donut-wrap { flex-direction: column; gap: 12px; }
  .donut { width: 128px; height: 128px; }
  .donut-hole { inset: 22px; }
  .donut-hole span { font-size: 12.5px; }
  .legend { width: 100%; min-width: 0; gap: 8px; }
  .legend-item { grid-template-columns: 9px minmax(0, 1fr) auto; gap: 6px; font-size: 11px; }
  .legend-dot { width: 9px; height: 9px; }
  .legend-value { font-size: 10.5px; }
  .table-wrap.inner .data-table { min-width: 0; width: 100%; }
  .table-wrap.inner .data-table th,
  .table-wrap.inner .data-table td { padding: 9px 8px; font-size: 11.5px; }

  /* Tablas convertidas en tarjetas para que nada se salga del margen */
  #tab-orders .table-wrap,
  #tab-customers .table-wrap,
  .table-wrap.inner {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  #orders-table,
  #customers-table,
  #orders-table tbody,
  #customers-table tbody,
  .table-wrap.inner .data-table,
  .table-wrap.inner .data-table tbody { display: block; width: 100%; min-width: 0; }
  #orders-table thead,
  #customers-table thead,
  .table-wrap.inner .data-table thead { display: none; }

  #orders-table tr.order-row,
  #customers-table tr.customer-row,
  .table-wrap.inner .data-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    margin-bottom: 9px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
  }
  #orders-table tr.order-row:last-child,
  #customers-table tr.customer-row:last-child,
  .table-wrap.inner .data-table tbody tr:last-child { margin-bottom: 0; }
  #orders-table td,
  #customers-table td,
  .table-wrap.inner .data-table td {
    display: block;
    padding: 0;
    border: 0;
    white-space: normal;
    font-size: 12.5px;
    line-height: 1.35;
  }
  #orders-table td::before,
  #customers-table td::before,
  .table-wrap.inner .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
  }

  /* Pedidos */
  #orders-table td.folio { grid-area: 1 / 1; font-size: 11.5px; }
  #orders-table td.folio::before,
  #orders-table td.cell-status::before,
  #orders-table td.cell-client::before { display: none; }
  #orders-table td.cell-status { grid-area: 1 / 2; justify-self: end; align-self: start; }
  #orders-table td.cell-status .status-select {
    padding: 4px 22px 4px 10px;
    font-size: 10.5px;
    background-position: right 8px center;
    background-size: 8px 5px;
  }
  #orders-table td.cell-client { grid-area: 2 / 1 / 3 / 3; }
  #orders-table td.cell-client b { font-size: 14.5px; }
  #orders-table td.cell-client .small-text { font-size: 10.5px; }
  #orders-table td.cell-phone { grid-area: 3 / 1; padding-top: 6px; border-top: 1px dashed rgba(203, 217, 229, 0.7); }
  #orders-table td.cell-cost { grid-area: 3 / 2; padding-top: 6px; border-top: 1px dashed rgba(203, 217, 229, 0.7); text-align: right; }
  #orders-table td.cell-cost::before { text-align: right; }
  #orders-table td.cell-service { grid-area: 4 / 1; }
  #orders-table td.cell-date { grid-area: 4 / 2; text-align: right; }
  #orders-table td.cell-photos { display: none; }
  #orders-table td.actions { grid-area: 5 / 1 / 6 / 3; display: flex; gap: 6px; padding-top: 8px; border-top: 1px dashed rgba(203, 217, 229, 0.7); }
  #orders-table td.actions .btn { flex: 1; }

  /* Clientes */
  #customers-table td.cell-client { grid-area: 1 / 1; }
  #customers-table td.cell-client::before,
  #customers-table td.cell-phone::before,
  #customers-table td.cell-email::before { display: none; }
  #customers-table td.cell-client b { font-size: 14.5px; }
  #customers-table td.cell-count {
    grid-area: 1 / 2;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--panel2);
    font-size: 11.5px;
    font-weight: 800;
    color: #4c6579;
  }
  #customers-table td.cell-count::before { margin: 0; font-size: 8.5px; }
  #customers-table td.cell-phone { grid-area: 2 / 1 / 3 / 3; font-size: 12px; }
  #customers-table td.cell-email { grid-area: 3 / 1 / 4 / 3; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
  #customers-table td.actions { grid-area: 4 / 1 / 5 / 3; display: flex; gap: 6px; padding-top: 8px; border-top: 1px dashed rgba(203, 217, 229, 0.7); }
  #customers-table td.actions .btn { flex: 1; }

  /* Estado de cuenta */
  #finance-statement-body tr td::before,
  #finance-pending-body tr td::before { display: none; }
  .table-wrap.inner .data-table tbody tr.statement-row { gap: 4px 10px; padding: 11px 13px; }
  .statement-row td.folio { grid-area: 1 / 1; font-size: 11.5px; }
  .statement-row td.cell-cost { grid-area: 1 / 2; text-align: right; font-size: 13px; font-weight: 800; color: #34536e; }
  .statement-row td.cell-client { grid-area: 2 / 1 / 3 / 3; font-size: 13px; font-weight: 700; }
  .statement-row td.cell-service { grid-area: 3 / 1; font-size: 11.5px; color: var(--muted); }
  .statement-row td.cell-date { grid-area: 3 / 2; text-align: right; font-size: 11.5px; color: var(--muted); }
  .table-wrap.inner .data-table tbody tr.statement-row td.cell-status { display: none; }
  .table-wrap.inner .data-table tfoot,
  .table-wrap.inner .data-table tfoot tr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(226, 237, 246, 0.55);
  }
  .table-wrap.inner .data-table tfoot td {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12.5px;
  }

  /* Saldos por cliente */
  .table-wrap.inner .data-table tbody tr.balance-row { gap: 4px 10px; padding: 11px 13px; }
  .balance-row td.cell-client { grid-area: 1 / 1; font-size: 13.5px; }
  .balance-row td.cell-cost { grid-area: 1 / 2; text-align: right; font-size: 13px; font-weight: 800; color: #3f6488; }
  .balance-row td.cell-phone { grid-area: 2 / 1; font-size: 11.5px; }
  .balance-row td.cell-count { grid-area: 2 / 2; text-align: right; font-size: 11px; color: var(--muted); }
  .balance-row td.actions { grid-area: 3 / 1 / 4 / 3; padding-top: 6px; }
  .table-wrap.inner .data-table tbody tr.balance-row td.actions { display: flex; }
  .balance-row td.actions .btn { width: 100%; }

  .modal { padding: 18px; border-radius: 22px; }
  .date-group { gap: 6px; }
  .date-group select { padding: 10px 6px; }
  .modal-actions { gap: 8px; }
  .modal-actions .btn { flex: 1; }
  .picker-results { max-height: 200px; }
  .picker-name { font-size: 14px; }
  .form-alert { font-size: 12px; padding: 10px 12px; }
  #customers-table td.actions .btn { padding-left: 6px; padding-right: 6px; font-size: 11.5px; }
  .mini-item { padding: 11px 12px; border-radius: 14px; }
  input, select, textarea { font-size: 16px; } /* evita zoom en iOS */
  .btn { font-size: 13.5px; }
  .btn.small { font-size: 12.5px; }
  .item-row { grid-template-columns: 1fr; }
  .kv b { min-width: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}

/* ---------------------------------------------------------- Login */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 26px 18px;
}
.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  animation: popIn 0.6s var(--ease) both;
}
.login-card {
  position: relative;
  background: rgba(248, 251, 254, 0.95);
  border: 1px solid var(--border);
  border-radius: 34px;
  padding: 40px 32px 32px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  text-align: center;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: -90px; right: -70px;
  width: 210px; height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 159, 190, 0.28), rgba(125, 159, 190, 0));
  animation: floaty 7s ease-in-out infinite;
}
.login-card::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -80px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107, 164, 152, 0.18), rgba(107, 164, 152, 0));
  animation: floaty 9s ease-in-out infinite reverse;
}
.login-inner { position: relative; z-index: 1; }
.login-logo {
  display: grid;
  place-items: center;
  width: 96px; height: 96px;
  margin: 0 auto 20px;
  padding: 12px;
  border-radius: 30px;
  background: linear-gradient(150deg, #ffffff, #e6eff8);
  border: 1px solid #d3e2ef;
  box-shadow: 0 16px 30px rgba(85, 122, 156, 0.22);
  animation: floaty 5s ease-in-out infinite;
}
.login-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-card h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: 0.4px; }
.login-card p { margin: 0 0 26px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.login-card .btn { width: 100%; padding: 14px; margin-top: 6px; }
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 7px; }
.login-field input {
  width: 100%;
  padding: 15px 20px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #f2f7fc;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.login-field input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(125, 159, 190, 0.18);
}
.login-error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  opacity: 0;
  transition: opacity 0.25s;
}
.login-error.show { opacity: 1; }
.login-foot { margin-top: 22px; font-size: 11.5px; color: #7d92a6; }

/* ---------------------------------------------------------- Conectar */
.connect-wrap { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 10px 20px 70px; }
.connect-card {
  background: rgba(248, 251, 254, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s var(--ease) both;
}
.connect-url {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  color: #3f6488;
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 14px 24px;
  border-radius: 999px;
  margin: 10px 0 6px;
  cursor: pointer;
  user-select: all;
  word-break: break-all;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.connect-url:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.qr-box {
  background: #fff;
  padding: 16px;
  border-radius: 26px;
  display: inline-block;
  margin: 20px 0 8px;
  box-shadow: var(--shadow);
  animation: popIn 0.7s var(--ease) both;
}
.qr-box img { display: block; width: min(320px, 70vw); height: auto; border-radius: 12px; }
.steps { text-align: left; max-width: 520px; margin: 24px auto 0; color: var(--text); padding-left: 22px; }
.steps li { margin: 11px 0; line-height: 1.55; }
.tiny { color: var(--muted); font-size: 13px; line-height: 1.55; }
.copied { color: var(--ok); font-size: 13px; min-height: 18px; font-weight: 600; }

/* ---------------------------------------------------------- Móvil: Conectar */
@media (max-width: 860px) {
  .connect-wrap { padding: 0 10px 46px; }
  .connect-card { padding: 22px 16px; border-radius: 20px; }
  .connect-url {
    max-width: 100%;
    font-size: 19px;
    padding: 12px 18px;
    gap: 8px;
    word-break: normal;
    overflow-wrap: anywhere;
  }
}