/* ============================================================
   Grupo AYR Hub · pase visual 2026-11-03
   Objetivo: más contraste, jerarquía clara y botones/tablas legibles.
   Se carga después de style.css; no requiere tocar el CSS base.
   ============================================================ */

:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --text: #0d1b2a;
  --muted: #4a5b70;
  --line: #c6d0dc;
  --primary: #0a2a5e;
  --primary-2: #17407f;
  --accent: #b3122b;
  --accent-2: #d61f3a;
  --brand-soft: #eef4ff;
  --success: #0b7a39;
  --danger: #a3122b;
  --shadow: 0 1px 2px rgba(13, 27, 42, .05), 0 10px 28px rgba(13, 27, 42, .07);
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, .06);
  --radius: 10px;
}

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

h1, h2, h3, h4 {
  color: #0a1f3d;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-weight: 650;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(26px, 2.2vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p, .muted { color: var(--muted); }
small { color: var(--muted); }
a { color: #0b4aa2; }
a:hover { color: #08357a; }

/* ---------- Barra lateral oscura: separación real del contenido ---------- */
.sidebar {
  background: linear-gradient(180deg, #081a33 0%, #0a2347 60%, #0b2a55 100%);
  color: #e8eef6;
  border-right: 1px solid #07152a;
  box-shadow: 4px 0 24px rgba(8, 26, 51, .12);
  padding: 18px 16px;
}
.sidebar .brand {
  border-bottom-color: rgba(255, 255, 255, .14);
  padding-bottom: 16px;
  margin-bottom: 18px;
}
.sidebar .brand-logo {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.sidebar .brand strong { color: #ffffff; font-weight: 650; }
.sidebar .brand span { color: #b9cbe0; }

.sidebar .login-box {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
}
.sidebar .login-box label { color: #dbe6f2; }
.sidebar .login-box small,
.sidebar .auth-message { color: #b9cbe0; }
.sidebar .session-user { color: #ffffff; font-weight: 650; }
.sidebar .session-role { color: #b9cbe0; }

.sidebar .nav .nav-group {
  color: #93aac2;
  font-weight: 700;
  letter-spacing: .10em;
  margin: 18px 8px 6px;
}
.sidebar .nav button {
  color: #d7e3f0;
  font-weight: 550;
  border-radius: 8px;
  min-height: 40px;
  padding: 10px 12px;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.sidebar .nav button:hover {
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
  box-shadow: none;
}
.sidebar .nav button.active {
  background: rgba(255, 255, 255, .13);
  color: #ffffff;
  font-weight: 650;
  box-shadow: inset 3px 0 0 #e11d48;
}
.sidebar .nav-company-switch,
.sidebar .nav-company-pill {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .18);
  color: #e8eef6;
  border-radius: 8px;
}
.sidebar .nav-company-switch label { color: #b9cbe0; }
.sidebar .nav-company-switch select {
  background: #ffffff;
  color: #0a1f3d;
  border-color: #8fa2b8;
  font-weight: 600;
}

/* ---------- Barra superior con separación y sombra ---------- */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(13, 27, 42, .04), 0 6px 18px rgba(13, 27, 42, .04);
  backdrop-filter: none;
}
.eyebrow { color: #b3122b; font-weight: 750; }
.badge {
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--line);
  font-weight: 600;
}

/* ---------- Botones: jerarquía y área de toque ---------- */
.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0;
  box-shadow: none;
  transition: background .14s ease, border-color .14s ease, transform .06s ease;
}
.primary-btn {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #ffffff;
}
.primary-btn:hover { background: #123a78; border-color: #123a78; }
.primary-btn:active { transform: translateY(1px); }
.secondary-btn {
  background: #ffffff;
  border: 1px solid #9fb0c3;
  color: #0a2a5e;
}
.secondary-btn:hover { background: #eef4fb; border-color: #6f8aa6; }
.danger-btn {
  background: #fdecec;
  border: 1px solid #e7b4bd;
  color: #a3122b;
}
.danger-btn:hover { background: #fbd5d5; border-color: #d98a96; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .45);
  outline-offset: 2px;
}
.mini { min-height: 32px; padding: 6px 10px; font-size: 12px; }

/* ---------- Tarjetas y métricas ---------- */
.card,
.metric {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 20px; }
.card h2, .card h3 { color: #0a1f3d; margin-bottom: 10px; }
.card h2::after,
.card h3::after {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.card p { color: #3f4f63; }
.metric {
  min-height: 132px;
  border-top: 4px solid var(--primary);
  padding: 18px 20px;
}
.metric.executive { border-left: 4px solid #8fa2b8; }
.metric span {
  color: #4a5b70;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.metric strong {
  color: #0a1f3d;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.metric small { color: #5b6b80; }

/* ---------- Formularios ---------- */
.field label, label {
  color: #334155;
  font-weight: 650;
  font-size: 12.5px;
}
.field input, .field select, .field textarea,
input, select, textarea {
  background: #ffffff;
  color: var(--text);
  border: 1px solid #8fa2b8;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
  box-shadow: none;
}
.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus {
  border-color: #1d4ed8;
  outline: 3px solid rgba(37, 99, 235, .20);
  outline-offset: 1px;
}
input::placeholder, textarea::placeholder { color: #6b7c91; opacity: 1; }
select { cursor: pointer; }

/* ---------- Tablas ---------- */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  scrollbar-color: #9fb0c3 #eef2f7;
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e8eef6;
  color: #0a1f3d;
  border-bottom: 2px solid #b9c8d8;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .02em;
  text-align: left;
  padding: 11px 12px;
  white-space: nowrap;
}
.table-wrap tbody td {
  border-bottom: 1px solid #e2e8f0;
  color: #1e2f45;
  padding: 10px 12px;
  vertical-align: top;
}
.table-wrap tbody tr:nth-child(even) { background: #f8fafc; }
.table-wrap tbody tr:hover { background: #eef4fb; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap td strong { color: #0a1f3d; }
.table-wrap td small { color: #5b6b80; }

/* ---------- Pills y avisos ---------- */
.pill { font-weight: 650; border: 1px solid transparent; }
.pill.success { background: #dcfce7; color: #0b6b33; border-color: #a7e3bc; }
.pill.warning { background: #fef3c7; color: #8a4b00; border-color: #f6d77a; }
.pill.danger { background: #fee2e2; color: #9f1239; border-color: #f3b6c0; }
.pill.dark { background: #dbeafe; color: #1e3a8a; border-color: #b6cdf5; }
.pill.neutral { background: #eef2f7; color: #334155; border-color: #c6d0dc; }

.notice {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  border-radius: 10px;
  padding: 12px 14px;
}
.notice.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.notice.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.notice.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* ---------- Login ---------- */
.private-login-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(13, 27, 42, .14);
  padding: 28px;
}
.private-login-card h2 { color: #0a1f3d; }
.private-login-card p { color: #4a5b70; }
.login-company-picker button {
  background: #ffffff;
  border: 1px solid #c6d0dc;
  border-radius: 10px;
  color: #334155;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.login-company-picker button:hover { border-color: #6f8aa6; background: #f6f8fb; }
.login-company-picker button.active {
  border-color: var(--primary);
  background: #eef4fb;
  box-shadow: inset 0 0 0 1px var(--primary);
  color: #0a1f3d;
  font-weight: 650;
}
.private-login-form input { border-color: #8fa2b8; }

/* ---------- Módulos y piezas operativas ---------- */
.module-tile {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 3px #0a2a5e, var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.module-tile:hover {
  transform: translateY(-2px);
  border-color: #6f8aa6;
  background: #ffffff;
  box-shadow: inset 0 3px #b3122b, 0 12px 26px rgba(13, 27, 42, .12);
}
.module-tile span { color: #b3122b; font-weight: 700; }
.module-tile strong { color: #0a1f3d; font-weight: 650; }
.module-tile small { color: #5b6b80; }

.ops-hero {
  background: #0a1f3d;
  border-color: #0a1f3d;
  border-radius: 10px;
  box-shadow: inset 4px 0 #e11d48;
}
.ops-hero h2 { color: #ffffff; }
.ops-date { color: #c6d4e1; }
.ops-item { background: #f8fafc; border-color: #dbe3ec; border-radius: 8px; }
.ops-item strong { color: #0a1f3d; }

/* ---------- Detalle fino ---------- */
.card:hover { border-color: #b9c8d8; }
.table-wrap { box-shadow: var(--shadow-sm); }
hr { border: 0; border-top: 1px solid var(--line); }
::selection { background: #c7d9f7; color: #0a1f3d; }

/* ---------- Responsivo ---------- */
@media (max-width: 1050px) {
  .content { padding: 16px 18px 28px; }
  .topbar { margin: -16px -18px 18px; padding: 12px 18px; }
  .sidebar { padding: 16px 14px; }
}
@media (max-width: 760px) {
  body { font-size: 13.5px; }
  .card { padding: 16px; }
  .metric { min-height: 118px; padding: 16px; }
  .metric strong { font-size: 28px; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .top-actions .primary-btn,
  .top-actions .secondary-btn,
  .top-actions .danger-btn { flex: 1 1 auto; }
  .table-wrap thead th, .table-wrap tbody td { padding: 9px 10px; font-size: 12.5px; }
  .private-login-card { padding: 20px; }
}
@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; }
  .topbar h1 { font-size: 24px; }
  .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Accesibilidad: más contraste si el sistema lo pide */
@media (prefers-contrast: more) {
  :root { --muted: #334155; --line: #8fa2b8; }
  .card, .metric, .table-wrap { border-width: 2px; }
  .sidebar .nav button { color: #ffffff; }
}

/* ============================================================
   Gerry · agente de ventas
   ============================================================ */
.gerry-shell { display: grid; gap: 16px; }
.gerry-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, #0a1f3d 0%, #0f2f5e 65%, #123a78 100%);
  color: #fff; border-radius: 12px; padding: 20px 22px;
  box-shadow: 0 12px 30px rgba(10, 31, 61, .18);
}
.gerry-head h2 { margin: 0; color: #fff; font-size: 28px; letter-spacing: -.02em; }
.gerry-head p { margin: 2px 0 0; color: #b9cbe0; font-size: 13px; }
.gerry-tabs { display: flex; gap: 4px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); padding: 4px; border-radius: 10px; }
.gerry-tab { border: 0; background: transparent; color: #d7e3f0; padding: 9px 16px; border-radius: 7px; font-weight: 650; font-size: 13px; }
.gerry-tab:hover { background: rgba(255,255,255,.10); color: #fff; }
.gerry-tab.active { background: #fff; color: #0a1f3d; box-shadow: 0 2px 8px rgba(0,0,0,.18); }

.gerry-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 18px; }
.gerry-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.gerry-field { display: grid; gap: 4px; }
.gerry-field label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #475569; font-weight: 700; }
.gerry-field input, .gerry-field select, .gerry-field textarea {
  min-height: 38px; padding: 8px 10px; border: 1px solid #9fb0c3; border-radius: 7px; background: #fff; color: #0f172a;
}
.gerry-field input:focus, .gerry-field select:focus, .gerry-field textarea:focus {
  border-color: #1d4ed8; outline: 3px solid rgba(37,99,235,.18); outline-offset: 1px;
}

.gerry-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.gerry-table thead th {
  background: #0a1f3d; color: #fff; text-align: left; padding: 9px 10px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.gerry-table tbody td { border-bottom: 1px solid #e2e8f0; padding: 8px 10px; vertical-align: middle; }
.gerry-table tbody tr:nth-child(even) td { background: #f8fafc; }
.gerry-table tbody tr:hover td { background: #eef4fb; }
.gerry-table input, .gerry-table select {
  width: 100%; min-height: 34px; padding: 6px 8px; border: 1px solid #b9c8d8; border-radius: 6px; background: #fff; color: #0f172a;
}
.gerry-table .gerry-part { min-width: 130px; font-weight: 650; }
.gerry-table .gerry-qty { width: 78px; }
.gerry-table .gerry-product { min-width: 250px; }
.gerry-cat { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #e8eef6; color: #0a2a5e; font-size: 11px; font-weight: 700; white-space: nowrap; }
.gerry-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 750; }
.gerry-badge.ok { background: #dcfce7; color: #166534; }
.gerry-badge.warn { background: #fef3c7; color: #92400e; }
.gerry-badge.bad { background: #fee2e2; color: #991b1b; }
.gerry-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.gerry-empty { color: #5b6b80; padding: 26px 12px; text-align: center; font-size: 13px; }

.gerry-chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow: auto; padding: 4px 2px 14px; }
.gerry-msg { max-width: 78%; padding: 10px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.gerry-msg.user { align-self: flex-end; background: #0a2a5e; color: #fff; border-bottom-right-radius: 3px; }
.gerry-msg.assistant { align-self: flex-start; background: #f1f5f9; color: #0f172a; border: 1px solid #e2e8f0; border-bottom-left-radius: 3px; }
.gerry-chat-input { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.gerry-attach-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.gerry-attach-row small { color: #5b6b80; font-size: 11px; }
.gerry-chat-input textarea { flex: 1; min-height: 46px; max-height: 130px; resize: vertical; border: 1px solid #9fb0c3; border-radius: 8px; padding: 10px 12px; }
.gerry-chat-input textarea:focus { border-color: #1d4ed8; outline: 3px solid rgba(37,99,235,.18); }

@media (max-width: 760px) {
  .gerry-head { padding: 16px; align-items: flex-start; }
  .gerry-tabs { width: 100%; overflow-x: auto; }
  .gerry-tab { flex: 1; white-space: nowrap; }
  .gerry-panel { padding: 12px; }
  .gerry-table { font-size: 12px; }
  .gerry-table thead th, .gerry-table tbody td { padding: 7px 8px; }
  .gerry-msg { max-width: 92%; }
  .gerry-actions { justify-content: stretch; }
  .gerry-actions .primary-btn, .gerry-actions .secondary-btn, .gerry-actions .danger-btn { flex: 1; }
}

/* ============================================================
   Gerry · chat limpio tipo asistente
   ============================================================ */
.gerry-head {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.gerry-head h2 { color: #0f172a; }
.gerry-head p { color: #64748b; }
.gerry-tabs { background: #eef2f7; border: 1px solid #e2e8f0; }
.gerry-tab { color: #475569; }
.gerry-tab:hover { background: #e2e8f0; color: #0f172a; }
.gerry-tab.active { background: #0a1f3d; color: #ffffff; box-shadow: 0 2px 8px rgba(15, 23, 42, .18); }

.gerry-chat-shell {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  height: calc(100vh - 260px);
  min-height: 520px;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .07);
  overflow: hidden;
}
.gerry-chat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #eef2f7;
  background: #ffffff;
}
.gerry-chat-avatar,
.gerry-welcome-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a2a5e;
  color: #ffffff;
  font-weight: 750;
  font-size: 15px;
}
.gerry-chat-title { display: grid; line-height: 1.2; }
.gerry-chat-title strong { font-size: 14.5px; color: #0f172a; }
.gerry-chat-title small { font-size: 11.5px; color: #64748b; }
.gerry-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-left: auto;
  box-shadow: 0 0 0 3px #dcfce7;
}
.gerry-chat-shell .gerry-chat-log {
  flex: 1;
  max-height: none;
  overflow: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #ffffff;
}
.gerry-msg-row { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.gerry-msg-row.user { flex-direction: row-reverse; }
.gerry-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 750;
  background: #eef2f7;
  color: #0a2a5e;
}
.gerry-msg-row.user .gerry-msg-avatar { background: #0a2a5e; color: #ffffff; }
.gerry-bubble {
  max-width: min(80%, 720px);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  overflow-wrap: anywhere;
}
.gerry-msg-row.user .gerry-bubble {
  background: #0a2a5e;
  color: #ffffff;
  border-color: #0a2a5e;
  border-bottom-right-radius: 6px;
}
.gerry-msg-row.assistant .gerry-bubble { border-bottom-left-radius: 6px; }
.gerry-bubble a { color: #1d4ed8; text-decoration: underline; }
.gerry-msg-row.user .gerry-bubble a { color: #dbeafe; }
.gerry-bubble code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.gerry-msg-row.user .gerry-bubble code { background: rgba(255,255,255,.15); color: #ffffff; }

.gerry-welcome { margin: auto; text-align: center; max-width: 560px; padding: 28px 10px; }
.gerry-welcome h3 { margin: 12px 0 4px; font-size: 22px; color: #0f172a; }
.gerry-welcome p { margin: 0 0 18px; color: #64748b; font-size: 13.5px; }
.gerry-welcome-avatar { margin: 0 auto; width: 52px; height: 52px; font-size: 22px; }
.gerry-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gerry-chip {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.gerry-chip:hover { background: #f8fafc; border-color: #cbd5e1; }

.gerry-composer-wrap {
  position: relative;
  padding: 12px 18px 14px;
  border-top: 1px solid #eef2f7;
  background: #ffffff;
}
.gerry-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 26px;
  padding: 6px 6px 6px 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
  background: #ffffff;
}
.gerry-composer:focus-within {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14), 0 4px 16px rgba(15, 23, 42, .06);
}
.gerry-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
}
.gerry-plus:hover { background: #eef2f7; }
.gerry-composer textarea {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  min-height: 36px;
  max-height: 140px;
  padding: 9px 4px;
  font-size: 14.5px;
  background: transparent;
  color: #0f172a;
}
.gerry-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0a2a5e;
  color: #ffffff;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 38px;
}
.gerry-send:hover { background: #123a78; }
.gerry-send:disabled { opacity: .4; cursor: not-allowed; }
.gerry-hint { text-align: center; color: #94a3b8; font-size: 10.5px; margin-top: 8px; }
.gerry-plus-menu {
  position: absolute;
  bottom: 72px;
  left: 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
  padding: 6px;
  display: grid;
  gap: 2px;
  z-index: 10;
  min-width: 180px;
}
.gerry-plus-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
}
.gerry-plus-menu button:hover { background: #f1f5f9; }
.gerry-typing { display: inline-flex; gap: 4px; padding: 5px 2px; }
.gerry-typing i { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: gerry-bounce 1s infinite; }
.gerry-typing i:nth-child(2) { animation-delay: .15s; }
.gerry-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gerry-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 760px) {
  .gerry-chat-shell { height: calc(100dvh - 200px); min-height: 420px; border-radius: 12px; }
  .gerry-chat-shell .gerry-chat-log { padding: 16px 14px; gap: 14px; }
  .gerry-bubble { max-width: 88%; font-size: 14px; }
  .gerry-composer-wrap { padding: 10px 12px 12px; }
  .gerry-head { border-radius: 12px; }
}

/* Gerry · APIs por vendedor (2026-11-10) */
.gerry-settings { display: flex; flex-direction: column; gap: 16px; }
.gerry-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gerry-settings-head h2 { margin: 0 0 4px; }
.gerry-settings-head p { margin: 0; color: var(--muted); }
.gerry-settings-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.gerry-settings-list { min-width: 0; }
.gerry-settings-list h3 { margin: 0 0 10px; }
.gerry-settings-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.gerry-settings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gerry-settings-table th { background: var(--primary); color: #fff; text-align: left; padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.gerry-settings-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.gerry-settings-table tr.selected td { background: var(--brand-soft); }
.gerry-settings-table small { display: block; color: var(--muted); margin-top: 2px; }
.gerry-settings-table .gerry-badge { margin-right: 6px; }
.gerry-settings-form { display: flex; flex-direction: column; gap: 12px; }
.gerry-settings-form h3 { margin: 0 0 4px; }
.gerry-settings-form p { margin: 0; color: var(--muted); font-size: 12.5px; }
.gerry-settings-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gerry-settings-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 650; font-size: 12.5px; color: var(--text); }
.gerry-settings-form input, .gerry-settings-form select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
.gerry-settings-form input:focus, .gerry-settings-form select:focus { outline: 2px solid var(--primary-2); outline-offset: 1px; }
.gerry-settings-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gerry-settings-result { min-height: 62px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 12.5px; background: var(--surface-2); }
.gerry-settings-ok { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.gerry-settings-ok strong { color: var(--success); }
.gerry-settings-warning { color: var(--danger); font-weight: 600; margin-top: 4px; }
.gerry-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.gerry-settings-note { color: var(--muted); font-size: 11.5px; }
.gerry-settings-note code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }
@media (max-width: 1050px) { .gerry-settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .gerry-settings-head { flex-direction: column; } .gerry-settings-two { grid-template-columns: 1fr; } }


/* Gerry · carga de foto y búsqueda manual de parte (2026-11-11) */
.gerry-load-title { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.gerry-load-title strong { color: var(--text); font-size: 14px; }
.gerry-load-title span { color: var(--muted); font-size: 12.5px; }
.gerry-photo-preview { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface-2); margin-top: 12px; }
.gerry-photo-preview img { max-height: 220px; max-width: 44%; border-radius: 8px; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.gerry-photo-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gerry-photo-copy strong { color: var(--text); word-break: break-word; }
.gerry-photo-copy span { color: var(--muted); font-size: 12.5px; }
.gerry-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.gerry-part-cell { display: flex; gap: 6px; align-items: center; min-width: 220px; }
.gerry-part-cell .gerry-part { flex: 1; min-width: 130px; }
@media (max-width: 760px) { .gerry-photo-preview { flex-direction: column; } .gerry-photo-preview img { max-width: 100%; max-height: 180px; } .gerry-part-cell { flex-wrap: wrap; } }


/* Gerry · pase de UX, tamaños y contraste (2026-11-11) */
.gerry-shell { gap: 18px; }
.gerry-head { align-items: center; padding: 18px 22px; border-radius: 14px; }
.gerry-head h2 { font-size: 26px; }
.gerry-tabs { padding: 5px; border-radius: 12px; }
.gerry-tab { min-height: 40px; padding: 10px 18px; transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease; }
.gerry-tab:active { transform: translateY(1px); }
.gerry-panel { padding: 22px; border-radius: 14px; }
.gerry-load-title { margin-bottom: 16px; }
.gerry-load-title strong { font-size: 15px; }
.gerry-load-title span { font-size: 13px; color: #526176; }
.gerry-load-grid { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(320px, 1.2fr); gap: 16px; align-items: stretch; }
.gerry-upload-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 184px; padding: 22px; border: 1.5px dashed #b7c5d6; border-radius: 14px; background: #f8fafc; text-align: center; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, transform .12s ease; }
.gerry-upload-card:hover { border-color: #1d4ed8; background: #f2f6ff; }
.gerry-upload-card:active { transform: translateY(1px); }
.gerry-upload-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gerry-upload-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #e5edf8; color: #0a2a5e; font-size: 26px; line-height: 1; font-weight: 400; }
.gerry-upload-card strong { color: #0f172a; font-size: 14px; }
.gerry-upload-card small { color: #5b6b80; font-size: 12px; max-width: 220px; line-height: 1.4; }
.gerry-text-card { display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; border: 1px solid #d8e1ec; border-radius: 14px; background: #ffffff; }
.gerry-text-card label { color: #334155; font-size: 10.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.gerry-text-card textarea { width: 100%; min-height: 140px; flex: 1; resize: vertical; border: 1px solid #c3cfdd; border-radius: 10px; padding: 12px 13px; background: #ffffff; color: #0f172a; font: inherit; font-size: 14px; line-height: 1.55; }
.gerry-text-card textarea::placeholder { color: #7b8794; }
.gerry-text-card textarea:focus { outline: 3px solid rgba(37, 99, 235, .16); border-color: #1d4ed8; }
.gerry-text-card small { color: #5b6b80; font-size: 12px; }
.gerry-load-actions { display: flex; justify-content: flex-end; margin: 14px 0 2px; }
.gerry-load-actions .primary-btn { min-width: 172px; min-height: 44px; }
.gerry-photo-preview { margin-top: 14px; }
.gerry-photo-preview img { max-width: 40%; }
.gerry-empty { color: #526176; padding: 22px 12px 10px; }
.gerry-table tbody td { padding: 9px 10px; }
.gerry-part-cell { min-width: 250px; }
.gerry-part-cell .secondary-btn { min-height: 38px; white-space: nowrap; }
.gerry-chat-shell { max-width: 1240px; height: clamp(560px, calc(100dvh - 230px), 940px); border-radius: 16px; }
.gerry-chat-top { padding: 16px 22px; }
.gerry-chat-title small { color: #526176; }
.gerry-chat-shell .gerry-chat-log { padding: 24px 22px; gap: 17px; }
.gerry-bubble { max-width: min(78%, 700px); padding: 11px 15px; line-height: 1.6; }
.gerry-msg-row.user .gerry-bubble { border-bottom-right-radius: 6px; }
.gerry-msg-row.assistant .gerry-bubble { border-bottom-left-radius: 6px; }
.gerry-composer-wrap { padding: 12px 20px 15px; }
.gerry-composer { min-height: 54px; }
.gerry-plus { width: 38px; height: 38px; flex-basis: 38px; font-size: 21px; }
.gerry-composer textarea { min-height: 38px; padding: 8px 4px; }
.gerry-send { width: 40px; height: 40px; flex-basis: 40px; }
.gerry-hint { color: #64748b; font-size: 11px; }
.gerry-chip { border-color: #cbd5e1; transition: background-color .16s ease, border-color .16s ease, transform .12s ease; }
.gerry-chip:active { transform: translateY(1px); }
.gerry-shell button:focus-visible { outline: 3px solid rgba(29, 78, 216, .25); outline-offset: 2px; }
.gerry-shell button:disabled { cursor: not-allowed; opacity: .55; }
@media (min-width: 1900px) { .gerry-chat-shell { max-width: 1360px; } }
@media (max-width: 900px) { .gerry-chat-shell { max-width: 100%; height: calc(100dvh - 210px); min-height: 520px; border-radius: 14px; } .gerry-load-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .gerry-chat-shell { height: calc(100dvh - 180px); min-height: 440px; } .gerry-chat-shell .gerry-chat-log { padding: 16px 14px; gap: 14px; } .gerry-bubble { max-width: 90%; } .gerry-composer-wrap { padding: 10px 12px 12px; } .gerry-head { padding: 16px; } .gerry-panel { padding: 16px; } .gerry-load-actions .primary-btn { width: 100%; } .gerry-photo-preview img { max-width: 100%; max-height: 190px; } }
@media (prefers-reduced-motion: reduce) { .gerry-shell *, .gerry-shell *::before, .gerry-shell *::after { transition: none !important; animation-duration: .01ms !important; } }

.gerry-shell .primary-btn,
.gerry-shell .secondary-btn,
.gerry-shell .gerry-send,
.gerry-shell .gerry-plus { transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease; }
.gerry-shell .primary-btn:active,
.gerry-shell .secondary-btn:active,
.gerry-shell .gerry-send:active,
.gerry-shell .gerry-plus:active { transform: translateY(1px); }

.gerry-shell, .gerry-panel, .gerry-chat-shell, .gerry-chat-log, .gerry-msg-row, .gerry-composer, .gerry-load-grid, .gerry-text-card, .gerry-upload-card { min-width: 0; }
.gerry-chat-shell { width: 100%; }
.gerry-composer textarea { min-width: 0; }
.gerry-tabs { max-width: 100%; overflow-x: auto; }
@media (max-width: 620px) { .gerry-tabs { width: 100%; } .gerry-tab { flex: 1 0 auto; } }
.gerry-upload-card input { inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: auto; cursor: pointer; z-index: 2; }

.gerry-split-check { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: #334155; font-weight: 650; }
.gerry-split-check input { width: 16px; height: 16px; accent-color: #0a2a5e; cursor: pointer; }
.gerry-table th:last-child { white-space: nowrap; }

.gerry-line-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; }
.gerry-line-tools span { color: #5b6b80; font-size: 12px; }
.gerry-line-delete { width: 34px; height: 34px; border-radius: 9px; border: 1px solid #fecaca; background: #fff7f7; color: #b91c1c; font-size: 20px; line-height: 1; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, transform .12s ease; }
.gerry-line-delete:hover { background: #fee2e2; border-color: #fca5a5; }
.gerry-line-delete:active { transform: translateY(1px); }
.gerry-table td:last-child { width: 42px; text-align: center; }
@media (max-width: 760px) { .gerry-line-tools { align-items: flex-start; flex-direction: column; } }

.gerry-part-cell { flex-wrap: wrap; }
.gerry-part-status { flex-basis: 100%; color: #5b6b80; font-size: 11px; line-height: 1.35; }
.gerry-part-status.bad { color: #b91c1c; font-weight: 650; }

.gerry-shell .link-btn { border: 0; background: transparent; color: #1d4ed8; font: inherit; font-weight: 700; padding: 0; cursor: pointer; text-decoration: underline; }

.gerry-orders-panel { max-width: 1180px; margin: 0 auto; }
.gerry-orders-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.gerry-orders-head > div { display: flex; flex-direction: column; gap: 2px; }
.gerry-orders-head strong { color: #0f172a; font-size: 16px; }
.gerry-orders-head small { color: #5b6b80; font-size: 12px; }
.gerry-order-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gerry-order-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.gerry-order-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.gerry-order-card-top > div { display: flex; flex-direction: column; gap: 2px; }
.gerry-order-card-top small, .gerry-order-meta small { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.gerry-order-card-top strong { color: #0f172a; font-size: 16px; }
.gerry-order-customer { color: #334155; font-weight: 650; overflow-wrap: anywhere; }
.gerry-order-meta { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid #eef2f7; }
.gerry-order-meta > span { display: flex; flex-direction: column; gap: 2px; color: #475569; font-size: 12px; }
.gerry-order-meta strong { color: #0f172a; font-size: 15px; }
.gerry-order-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 2px; }
.gerry-order-actions a, .gerry-order-actions button { white-space: nowrap; }
@media (max-width: 760px) { .gerry-order-list { grid-template-columns: 1fr; } .gerry-orders-panel { max-width: 100%; } }

.notice.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.gerry-stock-cell { font-size: 11.5px; color: #334155; white-space: nowrap; }

.gerry-cross-panel { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; }
.gerry-cross-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; color: #1e3a8a; }
.gerry-cross-options { display: grid; gap: 6px; }
.gerry-cross-option { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; padding: 8px 10px; border: 1px solid #bfdbfe; border-radius: 8px; background: #fff; color: #0f172a; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.gerry-cross-option:hover { border-color: #1d4ed8; background: #f8fbff; }
.gerry-cross-option small { color: #64748b; margin-left: auto; white-space: nowrap; }
.gerry-cross-web { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.gerry-cross-web a { color: #1d4ed8; text-decoration: underline; overflow-wrap: anywhere; }
.gerry-cross-note, .gerry-cross-empty { color: #475569; font-size: 11.5px; }
