:root {
  --navy: #1f3a5f;
  --navy-soft: #2a4a73;
  --gold: #c8a04a;
  --bg: #eef2f6;
  --surface: #ffffff;
  --muted: #64748b;
  --line: #e2e8f0;
  --r: #dc2626;
  --a: #d97706;
  --v: #059669;
  --shadow: 0 1px 3px rgba(31, 58, 95, 0.08);
  --radius: 14px;
  --nav-w: 220px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: #0f172a;
  min-height: 100dvh;
}

.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.shell.authed { flex-direction: row; }

/* —— Login —— */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: min(100%, 420px);
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 12px 40px rgba(31, 58, 95, 0.12);
}
.login-kicker {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.login-title {
  text-align: center;
  font-size: 1.65rem;
  font-weight: 650;
  color: var(--navy);
  margin: 8px 0 0;
  line-height: 1.2;
}
.login-sub { text-align: center; font-size: 0.875rem; color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
.login-meta { text-align: center; font-size: 0.8125rem; color: var(--muted); margin: 12px 0 0; }
.login-step { margin-top: 16px; animation: loginFadeIn 0.22s ease; }
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.8125rem;
  line-height: 1.4;
  text-align: left;
}
.login-profile-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.login-profile-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.login-profile-card:active { transform: scale(0.99); }
.login-profile-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.login-profile-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--navy), #2d5080);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.login-profile-card b { color: var(--navy); display: block; font-size: 1rem; }
.login-profile-card .login-profile-role { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.login-selected-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #f4f7fb;
  margin-bottom: 12px;
}
.login-pilot-password { margin: 0 0 12px; text-align: left; }
.login-pilot-password label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; }
.login-password-row { display: flex; gap: 8px; align-items: stretch; }
.login-pilot-password input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
}
.login-toggle-password {
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--navy);
  font-size: 0.75rem;
  cursor: pointer;
}
.login-primary-btn {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}
.login-primary-btn:disabled { opacity: 0.55; cursor: wait; }
.login-ghost-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: underline;
}
.role-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.role-btn:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.role-btn b { color: var(--navy); display: block; }
.role-btn span { font-size: 12px; color: var(--muted); }
.login-card-wide { width: min(100%, 460px); max-height: min(92vh, 720px); overflow-y: auto; }
.login-group-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 18px 0 0;
  font-weight: 600;
}
.login-group-label:first-of-type { margin-top: 16px; }
.role-btn-extend { border-left: 3px solid var(--navy); }
.card-semaforo-r { border-left: 4px solid var(--r, #dc2626); }
.card-semaforo-a { border-left: 4px solid #d97706; }
.card-semaforo-g { border-left: 4px solid #059669; }
.card-semaforo-o { border-left: 4px solid #ea580c; }
.almacen-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.almacen-actions .day-btn { font-size: 12px; }
.almacen-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin: 12px 0 20px;
}
@media (max-width: 960px) {
  .almacen-board { grid-template-columns: 1fr; }
}
.almacen-col {
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px 14px;
  min-height: 120px;
}
.almacen-col-head { margin-bottom: 10px; }
.almacen-col-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.25;
}
.almacen-col-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}
.almacen-col-count {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 6px;
  margin-left: 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  border-radius: 999px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #cbd5e1);
  vertical-align: middle;
}
.almacen-col-stack { display: flex; flex-direction: column; gap: 10px; }
.almacen-col-empty { font-size: 12px; margin: 8px 0; padding: 0; }
.almacen-history summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
}
.almacen-history summary::-webkit-details-marker { display: none; }
.almacen-history-stack .card-static { opacity: 0.88; }
.almacen-exceptions { margin-top: 8px; border-color: #fdba74; }
.sae-perm { font-size: 0.8125rem; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; line-height: 1.4; }
.sae-perm-read { background: #f1f5f9; color: var(--muted); }
.sae-perm-warn { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.sae-perm-write { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }

/* —— Sidebar (desktop) —— */
.sidebar {
  display: none;
  width: var(--nav-w);
  background: var(--navy);
  color: #fff;
  flex-direction: column;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand { padding: 4px 10px 20px; }
.brand small { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.brand strong { font-size: 1.1rem; font-weight: 600; }
.nav-main { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9375rem;
  cursor: pointer;
  font-weight: 500;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.on { background: rgba(200, 160, 74, 0.22); color: #fff; font-weight: 600; }
.sidebar-foot { padding: 10px; font-size: 12px; opacity: 0.75; border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 8px; }

/* —— Main column —— */
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-weight: 600; color: var(--navy); font-size: 1rem; flex: 1; min-width: 0; }
.topbar-sub { font-size: 11px; color: var(--muted); display: block; font-weight: 400; }
.search-wrap { flex: 1; max-width: 360px; display: none; }
.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.875rem;
}
.topbar-logout {
  display: none;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.topbar-logout:active { background: #f1f5f9; }

.icon-btn {
  border: none;
  background: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
}
.content { flex: 1; padding: 16px; padding-bottom: 88px; max-width: 920px; width: 100%; margin: 0 auto; box-sizing: border-box; overflow-x: hidden; }
.content.inicio-wide { max-width: 1080px; }

/* —— Bottom nav (móvil) —— mismo lenguaje que sidebar —— */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  justify-content: space-around;
  gap: 4px;
  box-shadow: 0 -4px 20px rgba(31, 58, 95, 0.15);
}
.bottom-nav button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  border-radius: 10px;
}
.bottom-nav button:active { background: rgba(255, 255, 255, 0.08); }
.bottom-nav button.on {
  color: #fff;
  font-weight: 600;
  background: rgba(200, 160, 74, 0.22);
}

.shell.authed { flex-direction: row; }
.sidebar { order: 0; flex-shrink: 0; }
.main-col { order: 1; flex: 1; min-width: 0; }

@media (max-width: 899px) {
  .sidebar { display: none !important; }
  .bottom-nav { display: flex; }
  .topbar-logout { display: inline-flex; align-items: center; }
  #btn-search-mobile { display: inline-flex !important; align-items: center; justify-content: center; }
  #q-mobile:not(.hidden) { display: block !important; max-width: 140px; }
}
@media (min-width: 900px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .content { padding-bottom: 24px; }
  .search-wrap { display: block; }
  .topbar-title { flex: 0 0 auto; min-width: 140px; }
  #btn-search-mobile, #q-mobile { display: none !important; }
  .topbar-logout { display: none !important; }
}

/* —— Sections —— */
.section-title { font-size: 1.125rem; font-weight: 650; color: var(--navy); margin: 0 0 4px; }
.section-lead { font-size: 0.8125rem; color: var(--muted); margin: 0 0 16px; }
.block { margin-bottom: 24px; }
.block h3 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }

.alert-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.alert-row:hover { border-color: var(--gold); }
.alert-dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.alert-dot.r { background: var(--r); }
.alert-dot.a { background: var(--a); }
.alert-text { flex: 1; font-size: 0.9375rem; font-weight: 500; }
.alert-count { font-size: 0.8125rem; color: var(--muted); }

.day-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.day-item:last-child { border-bottom: none; }
.day-item:hover { background: #f8fafc; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 10px; }
.day-time { font-size: 0.8125rem; font-weight: 600; color: var(--navy); min-width: 52px; }
.day-body { flex: 1; }
.day-body strong { display: block; font-size: 0.9375rem; }
.day-body span { font-size: 0.8125rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.chip.on { border-color: var(--navy); background: #e8eef5; color: var(--navy); font-weight: 600; }
.chip-clear { color: var(--muted); }

.seg { display: inline-flex; background: #e2e8f0; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.seg button {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--muted);
}
.seg button.on { background: var(--surface); color: var(--navy); font-weight: 600; box-shadow: var(--shadow); }

.list-stack { display: flex; flex-direction: column; gap: 10px; }
.card-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.card-btn:hover { border-color: var(--gold); }
.card-static {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-id { font-weight: 650; color: var(--navy); }
.card-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.card-cli { font-size: 0.9375rem; margin-top: 4px; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; vertical-align: middle; }
.crm-tag {
  font-size: 10px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  font-weight: 500;
}

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.kpi b { display: block; font-size: 1.35rem; color: var(--navy); }
.kpi span { font-size: 11px; color: var(--muted); }
.kpi.imp { grid-column: 1 / -1; background: var(--navy); color: #fff; border: none; }
.kpi.imp b { color: #fff; font-size: 1.5rem; }
.kpi.imp span { color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }

.empty { font-size: 0.875rem; color: var(--muted); padding: 16px 0; }

/* —— Sheet —— */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .sheet-backdrop { align-items: center; }
}
.sheet {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 20px;
}
@media (min-width: 600px) {
  .sheet { border-radius: 20px; }
}
.sheet-handle { width: 40px; height: 4px; background: #e2e8f0; border-radius: 99px; margin: 0 auto 16px; }
.sheet-k { font-size: 12px; color: var(--muted); }
.sheet-t { font-size: 1.35rem; font-weight: 650; color: var(--navy); margin: 4px 0 12px; }
.sheet-body { font-size: 0.9375rem; line-height: 1.5; }
.followup-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.followup-dismiss,
.followup-skip-log { width: 100%; margin-top: 4px; }
.followup-skip-log { margin-top: 0; }
.followup-commercial-slot { margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.followup-commercial-block .commercial-note-form { margin-top: 8px; }
.cotiz-follow-actions,
.cotiz-pipeline-actions { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.outreach-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  white-space: pre-wrap;
  margin: 8px 0;
}
.outreach-log { list-style: none; padding: 0; margin: 8px 0 0; }
.outreach-log li { font-size: 0.8125rem; color: var(--muted); margin: 4px 0; }
.outreach-qr { width: 220px; height: auto; background: #fff; border-radius: 8px; margin: 8px 0; }
#settings-outreach { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cotiz-follow-actions.compact .modal-btn,
.cotiz-pipeline-actions.compact .modal-btn { font-size: 0.8125rem; padding: 10px 12px; }
.sheet-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.sheet-actions button {
  border: none;
  background: #f1f5f9;
  padding: 12px 8px;
  border-radius: 12px;
  font-size: 0.8125rem;
  cursor: pointer;
}
.sheet-close { width: 100%; margin-top: 10px; border: none; background: transparent; color: var(--muted); padding: 12px; cursor: pointer; }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.875rem;
  z-index: 60;
  white-space: nowrap;
}
@media (min-width: 900px) { .toast { bottom: 24px; } }

.hidden { display: none !important; }
.corte-banner { font-size: 11px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 12px; margin-bottom: 16px; }

.card-signal {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-signal.r { background: #fef2f2; color: #991b1b; }
.card-signal.a { background: #fffbeb; color: #92400e; }
.card-signal.v { background: #ecfdf5; color: #065f46; }
.card-signal.n { background: #f1f5f9; color: #475569; font-weight: 500; }

.card-btn.focus-card, .card-static.focus-card {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(200, 160, 74, 0.35);
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.quick-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
}
.quick-stat b { display: block; font-size: 1.1rem; color: var(--navy); }
.quick-stat span { font-size: 10px; color: var(--muted); line-height: 1.2; }

.flow-block {
  border-left: 3px solid var(--gold);
  padding-left: 12px;
  margin: 14px 0;
}
.flow-block h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.flow-block p { margin: 0; font-size: 0.9375rem; }
.cotiz-cliente-ficha { display: flex; flex-direction: column; gap: 8px; font-size: 0.9375rem; }
.cotiz-cliente-kv-grid { display: flex; flex-direction: column; gap: 6px; }
.cotiz-cliente-kv {
  display: grid;
  grid-template-columns: minmax(6.5rem, 34%) 1fr;
  gap: 6px 10px;
  align-items: baseline;
}
.cotiz-cliente-k {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.cotiz-cliente-v { font-size: 0.9375rem; color: var(--navy); word-break: break-word; }
.cotiz-cliente-ficha-actions { margin-top: 4px; margin-bottom: 0; }
.cotiz-cliente-contactos-wrap { margin-top: 4px; }
.cotiz-cliente-contactos { margin: 4px 0 0; padding-left: 1.1rem; font-size: 0.875rem; }
.cotiz-cliente-contactos li { margin: 2px 0; }

.cotiz-partidas-body { margin-top: 6px; }
.cotiz-partidas-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cotiz-partidas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cotiz-partidas-table th,
.cotiz-partidas-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.cotiz-partidas-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.cotiz-partidas-table td.n,
.cotiz-partidas-table th.n { text-align: right; white-space: nowrap; }
.cotiz-partidas-table .cotiz-part-num { color: var(--muted); width: 2rem; }
.cotiz-part-desc { color: var(--muted); font-size: 11px; line-height: 1.35; }

.report-link {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  text-align: left;
}
.report-link:hover { border-color: var(--gold); }

.list-count { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* —— Inicio (centro de trabajo) —— */
.home-greet { margin-bottom: 20px; }
.home-greet h1 { font-size: 1.35rem; font-weight: 650; color: var(--navy); margin: 0 0 4px; line-height: 1.25; }
.home-greet p { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.home-greet-min { margin-bottom: 8px; }
.home-greet-min h1 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.home-greet-meta { font-size: 11px; color: var(--muted); margin-top: 2px !important; }
.inicio-prior {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}
@media (min-width: 900px) {
  .inicio-prior { flex-direction: row; align-items: flex-start; }
  .inicio-prior.inicio-prior-single .inicio-col { flex: 1; max-width: 420px; }
  .inicio-prior .inicio-col { flex: 1; min-width: 0; }
}
.home-section { margin-bottom: 20px; }
.home-section.home-cotiz-primary { margin-bottom: 16px; padding-top: 0; border-top: none; }
.home-section.home-cotiz-primary > h2 {
  font-size: 0.875rem;
  color: var(--navy);
  letter-spacing: 0.04em;
}
.home-section.home-seguimiento-list,
.home-section.home-leads-list { padding-top: 4px; border-top: 1px solid var(--line); }
.home-section.home-alerts,
.home-section.home-mi-dia { padding-top: 4px; border-top: 1px solid var(--line); }
.mi-dia-count { margin: 0 0 10px; font-size: 0.85rem; }
.mi-dia-pendiente .day-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.mi-dia-pendiente .day-task-head { gap: 10px; }
.mi-dia-imp { font-weight: 600; color: var(--navy-soft); }
.inicio-cotiz-chips { margin: 8px 0 4px; }
.cotiz-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  margin: 14px 0 4px;
  padding: 10px 0;
}
.pager-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  background: #fff;
  color: var(--navy, #1e3a5f);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.pager-btn:not(:disabled):active { background: #e8eef5; }
.pager-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pager-meta { font-size: 0.88rem; color: var(--muted, #64748b); text-align: center; }
.inicio-new-lead { margin: 8px 0 4px; }
.home-section > h2 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 600;
}
.alert-card {
  width: 100%;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.alert-card:hover { border-color: var(--gold); }
.alert-emoji { font-size: 1.1rem; line-height: 1.3; flex-shrink: 0; }
.alert-body { flex: 1; min-width: 0; }
.alert-body strong { display: block; font-size: 0.9375rem; color: var(--navy); margin-bottom: 4px; }
.alert-body p { margin: 0 0 8px; font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.alert-cta { font-size: 0.8125rem; font-weight: 600; color: var(--navy-soft); }

.day-task {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.day-task-head { display: flex; gap: 12px; align-items: flex-start; }
.day-time-lg { font-size: 0.9375rem; font-weight: 700; color: var(--navy); min-width: 52px; }
.day-task-main { flex: 1; min-width: 0; }
.day-task-main strong { display: block; font-size: 0.9375rem; margin-bottom: 4px; }
.day-task-main span { font-size: 0.8125rem; color: var(--muted); line-height: 1.35; display: block; }
.day-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.day-btn {
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.8125rem;
  cursor: pointer;
  font-weight: 500;
}
.day-btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.day-pending-title { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin: 16px 0 8px; }
.day-check { display: flex; align-items: flex-start; gap: 8px; font-size: 0.875rem; margin-bottom: 8px; color: var(--navy); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 600px) { .summary-grid { grid-template-columns: repeat(4, 1fr); } }

.home-kpi-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 720px) { .home-kpi-bar { grid-template-columns: repeat(4, 1fr); } }
.home-kpi-bar .kpi { margin: 0; }
.home-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
@media (max-width: 520px) {
  .home-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.home-kpi-strip .kpi-strip-tile {
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
}
.home-kpi-strip .kpi-strip-tile b {
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.2;
  color: var(--navy);
}
.home-kpi-strip .kpi-strip-tile span {
  font-size: 9px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.home-kpi-strip .kpi-strip-valor {
  border-color: rgba(15, 39, 68, 0.22);
  background: linear-gradient(180deg, #f4f7fb 0%, var(--surface) 100%);
}
.home-kpi-strip .kpi-strip-valor b { font-size: 0.875rem; }

.supervision-page { max-width: 1100px; }
.sup-coverage-warn {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
}
.supervision-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.sup-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.sup-input {
  min-width: 120px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 14px;
}
.supervision-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .supervision-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.supervision-kpi {
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.supervision-kpi.on {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
}
.sup-age-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
  font-size: 12px;
}
.sup-age {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.sup-age b { font-weight: 650; }
.sup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sup-table th,
.sup-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.sup-table .num { text-align: right; white-space: nowrap; }
.sup-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.35;
  max-width: 12rem;
}
.sup-pill.sup-comm { background: #eef2ff; color: #1e3a8a; }
.sup-pill.sup-doc { background: #f0fdf4; color: #166534; }
.table-wrap { overflow-x: auto; }
button.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.home-cotiz-stack { display: flex; flex-direction: column; gap: 8px; }
.home-cotiz-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.home-cotiz-row:hover { border-color: var(--gold); }
.home-cotiz-days {
  flex-shrink: 0;
  width: 54px;
  min-width: 54px;
  max-width: 54px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 3px;
  border-radius: 8px;
  background: #f1f5f9;
  text-align: center;
  overflow: hidden;
}
.home-cotiz-days b { font-size: 1.0625rem; line-height: 1.05; color: var(--navy); display: block; }
.home-cotiz-days-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  margin-top: 1px;
  gap: 0;
}
.home-cotiz-days-line {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 0.5rem;
  line-height: 1.08;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.home-cotiz-role-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
}
.home-cotiz-days-urgent { background: #fef2f2; border: 1px solid #fecaca; }
.home-cotiz-days-urgent b { color: #b91c1c; }
.home-cotiz-main { flex: 1; min-width: 0; }
.home-cotiz-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.home-cotiz-main .card-sub { margin-top: 6px; }
.home-cotiz-main .card-sub .card-signal { font-size: 0.75rem; }

.alert-card-compact { padding: 10px 12px; margin-bottom: 8px; }
.alert-card-compact .alert-body p { display: none; }
.home-alerts { margin-bottom: 16px; }
.home-drill-links { display: flex; flex-direction: column; gap: 8px; }
.day-task-compact .day-actions { display: none; }

.cal-page .cal-block { margin-top: 18px; }
.cal-page .cal-block h3 { font-size: 0.9375rem; color: var(--navy); margin: 0 0 10px; }
.cal-block-overdue h3 { color: var(--r); }
.cal-overdue { border-left: 3px solid var(--r); }
.cal-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cal-owner { font-weight: 400; }
.day-empty { font-size: 0.875rem; }
.summary-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}
.summary-tile:hover { border-color: var(--gold); }
.summary-tile b { display: block; font-size: 1.15rem; color: var(--navy); }
.summary-tile span { font-size: 11px; color: var(--muted); line-height: 1.25; }

@media (max-width: 899px) {
  .summary-panel {
    background: var(--navy);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 14px 12px 12px;
    margin-top: 4px;
    box-shadow: var(--shadow);
  }
  .summary-panel > h2 {
    color: var(--gold);
    letter-spacing: 0.08em;
  }
  .summary-panel .list-count {
    color: rgba(255, 255, 255, 0.65);
    margin-top: 10px !important;
  }
  .summary-panel .summary-tile {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
  }
  .summary-panel .summary-tile b { color: #fff; }
  .summary-panel .summary-tile span { color: rgba(255, 255, 255, 0.78); }
  .summary-panel .summary-tile.on,
  .summary-panel .summary-tile:active { background: rgba(200, 160, 74, 0.25); border-color: rgba(200, 160, 74, 0.45); }
}

.feed-list { display: flex; flex-direction: column; gap: 10px; }
.feed-item { font-size: 0.8125rem; color: var(--muted); line-height: 1.45; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-item strong { color: var(--navy); font-weight: 600; }

.sheet-schedule {
  width: 100%;
  margin-top: 12px;
  border: 1px dashed var(--gold);
  background: #fffbeb;
  color: #92400e;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}
.field-label { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }
.field-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 0.9375rem; box-sizing: border-box; }
.almacen-inv-block { margin-bottom: 16px; }
.almacen-inv-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.almacen-inv-heading { margin-top: 0; }
.almacen-inv-table-wrap {
  overflow: auto;
  max-height: min(70vh, 560px);
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  border-bottom: 2px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: #f8fafc; }
.data-table th.n,
.data-table td.n {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.almacen-inv-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.almacen-inv-qty { font-weight: 600; color: var(--navy); }
.almacen-inv-desc {
  max-width: 28rem;
  line-height: 1.45;
  color: var(--navy);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.almacen-inv-compact .almacen-inv-table { font-size: 0.8125rem; }
.almacen-inv-compact .almacen-inv-table-wrap { max-height: 240px; }
.field-input:disabled { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
.clie-contact-block .field-hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.clie-contact-edit-btn {
  margin-top: 8px;
  width: 100%;
}
.clie-contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.clie-contact-actions.hidden {
  display: none;
}
.clie-contact-block .modal-btn.secondary {
  background: #f1f5f9;
  color: var(--navy);
  border: 1px solid #e2e8f0;
}
.clie-contact-block .modal-btn { margin-top: 0; width: 100%; }
.clie-contact-block .modal-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.clie-contact-block .modal-btn.clie-save-blocked { opacity: 0.55; cursor: not-allowed; }
.clie-contact-block .modal-btn.linkish {
  margin-top: 8px;
  width: 100%;
  background: transparent;
  color: var(--navy);
  border: 1px dashed #cbd5e1;
  font-size: 13px;
}
.clie-field-dirty { outline: 2px solid rgba(217, 119, 6, 0.35); outline-offset: 0; }
.clie-contact-status {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.clie-contact-status.hidden { display: none; }
.clie-contact-status-pending { background: #fffbeb; color: #92400e; }
.clie-contact-status-saving { background: #eff6ff; color: #1e40af; }
.clie-contact-status-success { background: #ecfdf5; color: #065f46; }
.clie-contact-status-dry_run { background: #f0f9ff; color: #0369a1; }
.clie-contact-status-error { background: #fef2f2; color: #991b1b; }
.clie-contact-status-conflict { background: #fef3c7; color: #92400e; }
.clie-contact-status-warn { background: #fff7ed; color: #9a3412; }
.modal-sub { font-size: 0.875rem; color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
.modal-btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.diag-panel {
  font-size: 0.8125rem;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  line-height: 1.45;
}
.diag-panel p { margin: 0 0 6px; }

.connector-banner {
  margin: 0;
  padding: 10px 16px;
  font-size: 0.8125rem;
  background: #fff7ed;
  color: #9a3412;
  border-bottom: 1px solid #fed7aa;
  text-align: center;
}
.connector-banner.connector-banner--offline {
  background: #fef2f2;
  color: #991b1b;
  border-bottom-color: #fecaca;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  max-width: 400px;
  width: 100%;
}
.modal h3 { margin: 0 0 8px; color: var(--navy); }
.modal p { font-size: 0.875rem; color: var(--muted); margin: 0 0 16px; line-height: 1.45; }
.modal-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: #f1f5f9;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.875rem;
  cursor: pointer;
  margin-bottom: 8px;
}
.modal-btn.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.modal-btn.ghost { background: transparent; border: none; color: var(--muted); margin-bottom: 0; }
#settings-modal .modal { max-height: min(92vh, 760px); overflow: auto; }
.role-config-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 8px;
}
.role-config-row .field-label { margin: 6px 0 4px; }
.role-config-row .role-active {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.8125rem;
  margin: 0 0 4px;
}
.password-state {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy);
}
.password-row-hint { margin: 4px 0 0; }

/* —— CRM visual (pipeline, ficha tabs, embudo) —— */
.badge-src {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  vertical-align: middle;
  margin-right: 4px;
}
.badge-sae { background: var(--navy); color: #fff; }
.badge-ext { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.crm-semaforo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.sem-tile {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
}
.sem-tile b { display: block; font-size: 1.5rem; }
.sem-r b { color: var(--r); }
.sem-a b { color: var(--a); }
.sem-v b { color: var(--v); }
.sem-tile span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.sem-tile.sem-static { cursor: default; }
.crm-pipe-mini-btn {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.crm-pipe-bar {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--line);
}
.crm-pipe-bar span { min-width: 2px; }
.seg-emit { background: #94a3b8; }
.seg-crm { background: var(--gold); }
.seg-ped { background: var(--navy-soft); }
.seg-win { background: var(--v); }
.seg-loss { background: #cbd5e1; }
.crm-kanban {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.crm-kanban-col {
  flex: 0 0 180px;
  max-width: 200px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  scroll-snap-align: start;
}
.crm-kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.crm-kanban-count {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}
.crm-kanban-cards .card-btn { margin-bottom: 8px; }
.crm-kanban-more { margin: 4px 0 0; font-size: 11px; }
.crm-funnel { margin-top: 12px; }
.crm-funnel-row {
  display: grid;
  grid-template-columns: 1fr minmax(80px, 2fr) 32px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
.crm-funnel-label { color: var(--muted); }
.crm-funnel-track {
  height: 10px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
}
.crm-funnel-fill { display: block; height: 100%; border-radius: 6px; }
.bar-emit { background: #94a3b8; }
.bar-crm { background: var(--gold); }
.bar-ped { background: var(--navy-soft); }
.bar-win { background: var(--v); }
.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.sheet-tab {
  border: 1px solid var(--line);
  background: #f1f5f9;
  color: var(--navy);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.sheet-tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.crm-timeline { border-left: 2px solid var(--line); padding-left: 12px; margin: 8px 0 12px; }
.crm-timeline-item { margin-bottom: 12px; font-size: 13px; line-height: 1.45; }
.crm-timeline-item small { color: var(--muted); display: block; margin-bottom: 2px; }
.commercial-meta { margin: 4px 0 8px; font-size: 13px; line-height: 1.45; }
.commercial-log-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.commercial-log-grid { display: grid; grid-template-columns: minmax(120px, 140px) 1fr; gap: 8px; }
.commercial-log-form input,
.commercial-log-form select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); width: 100%; box-sizing: border-box; }
.commercial-full { width: 100%; }
@media (max-width: 520px) {
  .commercial-log-grid { grid-template-columns: 1fr; }
}
.crm-sheet-badges { font-size: 13px; margin: 8px 0; }
.linkish-inline {
  background: none;
  border: none;
  padding: 0;
  color: var(--navy);
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.comercial-nav { margin-bottom: 14px; }

.config-page {
  max-width: 720px;
}
.config-page .diag-panel {
  margin-top: 8px;
}
.config-landing .section-intro {
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.45;
}
.ventas-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 12px 0 16px;
  max-width: 520px;
}
.ventas-controls .field-input { flex: 1; min-width: 100px; }
.ventas-controls .modal-btn { width: auto; margin: 0; flex: 1 1 100%; }
.ventas-filtros {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 12px;
  align-items: end;
  max-width: none;
}
.ventas-filtros .ventas-control-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ventas-filtros .field-input { width: 100%; box-sizing: border-box; }
.ventas-filtros #btn-ventas-refresh { grid-column: 1 / -1; justify-self: start; max-width: 280px; }
.ventas-filter-hint { margin: 0 0 12px; font-size: 0.8125rem; }
.venta-chart .crm-funnel-row { grid-template-columns: 1fr minmax(100px, 2fr) 72px; }

/* —— Reportes (mobile) —— */
@media (max-width: 520px) {
  .reportes-panel .reportes-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .reportes-panel .kpi {
    padding: 12px 10px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .reportes-panel .kpi b { font-size: 1.25rem; }
  .reportes-panel .kpi span { font-size: 10px; line-height: 1.35; }
  .reportes-panel .kpi.imp { min-height: auto; padding: 14px 12px; }
  .reportes-panel .kpi.imp b { font-size: 1.35rem; word-break: break-word; }
  .reportes-seg {
    display: flex;
    width: 100%;
    box-sizing: border-box;
  }
  .reportes-seg button {
    flex: 1;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 12px;
  }
  .reportes-panel .report-link {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 0.875rem;
  }
  .reportes-semaforo { gap: 8px; }
  .reportes-semaforo .sem-tile {
    padding: 10px 6px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .reportes-semaforo .sem-tile b { font-size: 1.35rem; }
  .reportes-panel .ventas-controls {
    flex-direction: column;
    align-items: stretch;
    max-width: none;
  }
  .reportes-panel .ventas-controls .modal-btn {
    width: 100%;
    flex: 1 1 auto;
    min-height: 44px;
  }
  .reportes-vendedor .card-static {
    padding: 12px;
    font-size: 0.875rem;
  }
}
@media (max-width: 899px) {
  .reportes-panel .section-lead { line-height: 1.45; }
  .venta-chart .crm-funnel-row {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 1.5fr) 56px;
    gap: 8px;
    font-size: 12px;
  }
}
