:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f1f5f9;
  --line: #d1d9e6;
  --line-2: #9aa9bf;
  --text: #0f172a;
  --muted: #5b6474;
  --primary: #2563eb;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

select, select option, select optgroup {
  color: #0f172a;
}
.field select, .field input {
  color: var(--text) !important;
  background: #ffffff !important;
}
.field select option, .field select optgroup {
  color: #0f172a !important;
  background: #ffffff !important;
}
button { font: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.app-shell {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
  transition: grid-template-columns .2s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 92px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 18px 24px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  overflow: hidden;
}
.app-shell.sidebar-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 16px;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-toggle-button {
  position: sticky;
  top: 14px;
  flex: 0 0 auto;
  z-index: 3;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.app-shell.sidebar-collapsed .brand-row {
  justify-content: center;
}
.app-shell.sidebar-collapsed .sidebar-toggle-button {
  margin-left: 0;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 22px;
  box-shadow: var(--shadow);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}
.app-shell.sidebar-collapsed .brand-title,
.app-shell.sidebar-collapsed .brand-subtitle,
.app-shell.sidebar-collapsed .sidebar-badge-row,
.app-shell.sidebar-collapsed .nav-link span,
.app-shell.sidebar-collapsed .user-meta {
  display: none;
}
.app-shell.sidebar-collapsed .brand { justify-content: center; }
.app-shell.sidebar-collapsed .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.sidebar-collapsed .sidebar-footer { left: 12px; right: 12px; justify-content: center; }

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 16px;
  color: #334155;
  border: 1px solid transparent;
  transition: .18s ease;
}

.nav-link i { width: 18px; text-align: center; }
.nav-link:hover,
.nav-link.is-active {
  color: #0f172a;
  background: #edf2f7;
  border-color: #d4deea;
}

.sidebar-footer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .20);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.user-meta { display: grid; gap: 3px; }
.user-meta span { color: var(--muted); font-size: 13px; }

.main-layout { padding: 24px 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar h1 { margin: 0; font-size: 30px; line-height: 1.1; }
.topbar p { margin: 6px 0 0; color: var(--muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}
.ghost-button:hover, .icon-button:hover { border-color: #b8c7db; background: #f6f9fc; }

.icon-button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; }

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.notice {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #d7e0ee;
  background: #f8fbff;
  color: #244170;
}

.content-area {
  display: grid;
  gap: 18px;
}

.global-loading {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.62);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.global-loading-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 300px;
  padding: 18px 20px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 3px solid #dbe7ff;
  border-top-color: #2563eb;
  animation: spin .8s linear infinite;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card,
.panel,
.table-shell,
.hero,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.kpi-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.kpi-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.kpi-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-foot {
  color: var(--muted);
  font-size: 13px;
}

.hero {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 18px;
}

.hero h2 { margin: 0 0 10px; font-size: 28px; }
.hero p { margin: 0; color: var(--muted); line-height: 1.6; }

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  border: 0;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel { padding: 20px; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-title { font-size: 18px; font-weight: 700; }
.panel-subtitle { color: var(--muted); font-size: 13px; }

.list-clean {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.list-clean li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5ebf3;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.success { background: #e9f9ee; color: #17673a; }
.badge.warning { background: #fff5e8; color: #9a5a00; }
.badge.danger { background: #fcebea; color: #a3261a; }
.badge.info { background: #eaf2ff; color: #2856a4; }

.table-shell { overflow: hidden; }
.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
th { color: #475569; font-size: 13px; font-weight: 700; background: #f8fafc; }
tr:hover td { background: #f8fbff; }

.placeholder {
  padding: 26px;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  border: 1px dashed #d8e1ee;
  color: var(--muted);
}

.metric-stack {
  display: grid;
  gap: 12px;
}
.metric-stack .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.skeleton {
  background: linear-gradient(90deg, #eef2f7, #f8fafc, #eef2f7);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 14px;
  min-height: 96px;
}

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

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -320px;
    width: 290px;
    z-index: 30;
    transition: .2s ease;
  }
  .sidebar.is-open { left: 0; }
  .mobile-only { display: inline-grid; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-right { justify-content: flex-start; flex-wrap: wrap; }
  .grid-2, .grid-3, .kpi-grid { grid-template-columns: 1fr; }
}


.filter-panel { display: grid; gap: 18px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.field {
  display: grid;
  gap: 8px;
}
.field span {
  font-size: 13px;
  color: var(--muted);
}
.field input,
.field select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: #ffffff;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  padding: 12px 14px;
  outline: none;
  min-height: 46px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

.field select {
  appearance: auto;
  background-color: #ffffff !important;
  color: var(--text) !important;
}

.field select option {
  color: #0f172a !important;
  background: #ffffff !important;
}

.field select:focus,
.field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.report-status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}
.report-status-dot.red { background: #ef4444; }
.report-status-dot.orange { background: #f59e0b; }
.report-status-dot.green { background: #22c55e; }
.report-link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.report-link-button[disabled] {
  color: var(--muted);
  cursor: default;
}
.report-inline-media {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.report-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: pointer;
}
.report-empty {
  color: var(--muted);
}
.report-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1200;
}
.report-modal-backdrop[hidden] { display: none; }
.report-modal {
  width: min(980px, 96vw);
  max-height: 88vh;
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 30px 80px rgba(15,23,42,.38);
}
.report-modal-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 22px;
  border-bottom:1px solid rgba(15,23,42,.08);
}
.report-modal-body {
  padding: 22px;
}
.report-modal-close {
  border:0;
  background:#eef2ff;
  color:#1e3a8a;
  width:38px;
  height:38px;
  border-radius:999px;
  cursor:pointer;
  font-size:20px;
}
.report-map-grid {
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}
.report-map-box {
  min-height: 380px;
  background: #eef2ff;
  border-radius: 18px;
  padding: 12px;
  position: relative;
  overflow: hidden;
}
.report-map-live-shell { padding: 0; }
.report-map-live {
  width: 100%;
  min-height: 380px;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #e2e8f0;
}
.report-map-fallback {
  min-height: 380px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#475569;
  font-weight:600;
  padding: 24px;
}
.report-media-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.report-media-grid img {
  width:100%;
  height:160px;
  object-fit:cover;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.08);
}
.report-detail-list {
  display:grid;
  gap:8px;
  margin:0;
  padding:0;
  list-style:none;
}
.report-detail-list li {
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius:12px;
  background:#f8fafc;
}
@media (max-width: 980px) {
  .report-map-grid { grid-template-columns: 1fr; }
}

.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tab-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tab-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.tab-button.is-active {
  color: var(--primary);
  background: #eef4ff;
  border-color: #cfe0ff;
}
.mini-kpis .stat-card {
  padding: 18px 20px;
  display: grid;
  gap: 10px;
}
.stat-card span {
  color: var(--muted);
  font-size: 13px;
}
.stat-card strong {
  font-size: 24px;
}
.compact-list li {
  padding-top: 10px;
  padding-bottom: 10px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.photo-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}
.photo-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.photo-card-head strong { display: block; }
.photo-card-head span { color: var(--muted); font-size: 13px; }
.photo-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}
.photo-strip img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}
.photo-empty {
  grid-column: 1 / -1;
  padding: 24px 14px;
  text-align: center;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .filter-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
}


.filter-grid-wide {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.toolbar-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}
.kpi-delta {
  margin-top: 2px;
}
.delta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.delta-chip.success { background: rgba(34,197,94,.12); color: #86efac; }
.delta-chip.danger { background: rgba(239,68,68,.12); color: #fca5a5; }
.delta-chip.info { background: rgba(96,165,250,.12); color: #bfdbfe; }
.chart-stack {
  display: grid;
  gap: 14px;
}
.chart-row {
  display: grid;
  gap: 8px;
}
.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.chart-meta strong {
  color: var(--text);
}
.chart-bar {
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}
.chart-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.spark-grid {
  min-height: 180px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 10px;
  align-items: end;
}
.spark-item {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-items: end;
}
.spark-item span {
  width: 100%;
  min-height: 10px;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, rgba(94,234,212,.9), rgba(96,165,250,.9));
}
.spark-item small {
  color: var(--muted);
  font-size: 11px;
}
.ranking-list {
  display: grid;
  gap: 14px;
}
.ranking-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}
.ranking-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.ranking-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 4px;
}
.pagination-info {
  color: var(--muted);
  font-size: 13px;
}
.pagination-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.secondary-button[disabled] {
  opacity: .5;
  cursor: not-allowed;
}
@media (max-width: 1200px) {
  .filter-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .toolbar-row { align-items: stretch; }
  .filter-grid-wide { grid-template-columns: 1fr; }
  .pagination-bar { align-items: stretch; }
}


/* Preview login */
.login-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 32px;
  display: grid;
  place-items: center;
}
.login-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(96,165,250,.18), transparent 24%),
    radial-gradient(circle at 85% 15%, rgba(94,234,212,.14), transparent 22%),
    radial-gradient(circle at 50% 80%, rgba(34,197,94,.08), transparent 18%);
  pointer-events: none;
}
.login-grid {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 28px;
  align-items: center;
}
.login-copy,
.login-card {
  background: linear-gradient(180deg, rgba(24,34,65,0.96), rgba(18,25,49,0.96));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.login-copy {
  padding: 42px;
}
.login-card {
  padding: 32px;
}
.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(94,234,212,.12);
  border: 1px solid rgba(94,234,212,.18);
  color: #ccfbf1;
  font-size: 13px;
  margin-bottom: 14px;
}
.login-copy h1 {
  margin: 0 0 12px;
  font-size: 52px;
  line-height: 1;
}
.login-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 680px;
}
.feature-stack {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}
.feature-card {
  display: grid;
  gap: 6px;
  padding: 18px 18px;
  background: rgba(255,255,255,.04);
  border-radius: 18px;
  border: 1px solid var(--line);
}
.feature-card strong { font-size: 15px; }
.feature-card span { color: var(--muted); line-height: 1.6; }
.login-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.login-form {
  display: grid;
  gap: 16px;
}
.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.login-demo-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  display: grid;
  gap: 8px;
}
.login-demo-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #dbeafe;
  font-size: 13px;
}
.sidebar-badge-row {
  display: flex;
  gap: 8px;
  padding: 0 10px 18px;
}
.delta-chip.danger {
  color: #fecaca;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.18);
}
.delta-chip.success {
  color: #dcfce7;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.18);
}
.delta-chip.info {
  color: #dbeafe;
  background: rgba(96,165,250,.12);
  border: 1px solid rgba(96,165,250,.18);
}
@media (max-width: 980px) {
  .login-grid {
    grid-template-columns: 1fr;
  }
  .login-copy h1 {
    font-size: 40px;
  }
}

/* Clientes v2 */
.clientes-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .95fr);
  gap: 16px;
  align-items: start;
}
.client-row { cursor: pointer; }
.client-row.is-selected td {
  background: rgba(96,165,250,.12);
}
.client-cell-title {
  font-weight: 700;
}
.client-cell-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.detail-stack {
  display: grid;
  gap: 16px;
}
.detail-card {
  position: sticky;
  top: 16px;
}
.detail-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.mini-stat {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.04);
  display: grid;
  gap: 6px;
}
.mini-stat span,
.detail-grid span {
  color: var(--muted);
  font-size: 12px;
}
.mini-stat strong {
  font-size: 15px;
  line-height: 1.4;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-grid > div {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
  display: grid;
  gap: 6px;
}
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.detail-photo-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.detail-photo-strip img {
  height: 92px;
}
.timeline-list {
  display: grid;
  gap: 10px;
}
.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}
.timeline-item strong {
  display: block;
  margin-bottom: 5px;
}
.timeline-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.client-form-wrapper {
  margin-bottom: 18px;
}
.client-form {
  padding: 20px;
}
.clientes-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.field-span-2 {
  grid-column: span 2;
}
.clientes-mini-kpis {
  margin-bottom: 16px;
}
#clientes-list code,
#clientes-detail code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #dbeafe;
}
@media (max-width: 1200px) {
  .clientes-layout {
    grid-template-columns: 1fr;
  }
  .detail-card {
    position: static;
  }
  .clientes-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .detail-kpis,
  .detail-grid,
  .clientes-form-grid {
    grid-template-columns: 1fr;
  }
  .field-span-2 {
    grid-column: span 1;
  }
  .detail-photo-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Light console refresh */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f1f5f9;
  --line: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #60a5fa;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}
body {
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
  color: var(--text);
}
.sidebar {
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
}
.sidebar-footer,
.notice,
.ghost-button,
.icon-button,
.pill,
.secondary-button,
.list-clean li,
.placeholder,
.photo-card,
.photo-empty,
.tab-button,
.chart-bar,
.field input,
.field select,
.report-detail-list li,
.table-shell,
.report-map-shell,
.report-map-canvas,
.login-copy,
.login-card {
  background: #ffffff !important;
}
.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: #eef4ff;
  border-color: rgba(37,99,235,0.10);
}
.notice {
  color: #1e3a8a;
  border-color: rgba(37,99,235,0.14);
}
.kpi-card,
.panel,
.table-shell,
.hero,
.stat-card {
  background: #ffffff !important;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.secondary-button,
.ghost-button,
.icon-button,
.pill,
.tab-button,
.chart-meta strong,
.topbar h1,
.panel-title,
.brand-title,
.kpi-value,
.stat-card strong {
  color: var(--text);
}
.brand-subtitle,
.panel-subtitle,
.kpi-foot,
.kpi-label,
.topbar p,
.chart-meta,
.photo-card-head span,
.stat-card span,
.list-clean li,
.pill,
.notice span {
  color: var(--muted);
}
.tab-button.is-active {
  background: #eaf2ff !important;
  border-color: rgba(37,99,235,0.18);
  color: #1d4ed8;
}
.field input,
.field select {
  color: #0f172a !important;
  border-color: rgba(15,23,42,0.10) !important;
}
.field select option,
.field select optgroup {
  color: #0f172a !important;
  background: #ffffff !important;
}
.list-clean li,
.placeholder,
.photo-card,
.photo-empty,
.chart-bar,
.report-detail-list li {
  border-color: rgba(15,23,42,0.06);
}
tr:hover td {
  background: #f8fbff;
}
.login-backdrop {
  background:
    radial-gradient(circle at top right, rgba(37,99,235,0.10), transparent 28%),
    radial-gradient(circle at bottom left, rgba(96,165,250,0.10), transparent 28%);
}
.primary-button,
.brand-mark {
  color: #ffffff;
}
.badge.success { background: rgba(34,197,94,.12); color: #166534; }
.badge.warning { background: rgba(245,158,11,.15); color: #92400e; }
.badge.danger { background: rgba(239,68,68,.12); color: #991b1b; }
.badge.info { background: rgba(37,99,235,.10); color: #1d4ed8; }
.delta-chip.success { background: rgba(34,197,94,.12); color: #166534; }
.delta-chip.danger { background: rgba(239,68,68,.12); color: #991b1b; }
.delta-chip.info { background: rgba(37,99,235,.10); color: #1d4ed8; }

#reportes-detail .table-scroll table { min-width: 1290px; }
#reportes-detail th, #reportes-detail td { font-size: 13px; }
#reportes-detail th.col-fecha, #reportes-detail td.col-fecha,
#reportes-detail th:first-child, #reportes-detail td:first-child { width: 82px; min-width: 82px; }
#reportes-detail td:nth-child(3), #reportes-detail th:nth-child(3) { min-width: 170px; }
#reportes-detail td:nth-child(10), #reportes-detail th:nth-child(10) { min-width: 190px; }
#reportes-detail .small-cell { font-size: 12px; line-height: 1.35; }
#reportes-detail .muted { display: inline-block; color: #64748b; margin-top: 4px; line-height: 1.35; font-size: 12px; }
#reportes-detail .report-inline-media { white-space: nowrap; }
.lazy-panel { margin-bottom: 16px; }
.hero-executive { align-items: start; }
.topbar-left { min-width: 0; }
.topbar h1 { color: #0f172a; }
.app-shell.sidebar-collapsed .topbar h1 { font-size: 28px; }

.time-stack { display:grid; gap:4px; min-width: 180px; }
.time-stack strong { font-size: 13px; color:#0f172a; }

.date-input-wrap { display:flex; align-items:center; gap:8px; }
.date-input-wrap input { flex:1; }
.date-picker-button { width:44px; height:46px; border-radius:14px; border:1px solid var(--line-2); background:#fff; color:#1d4ed8; cursor:pointer; }
.date-picker-button:hover { border-color:#2563eb; background:#f7fbff; }
.button-static { cursor:default; pointer-events:none; }

.time-stack { display:grid; gap:4px; min-width:180px; }
.time-stack strong { font-size:13px; white-space:nowrap; }
.time-stack .muted { color: var(--muted); font-size:12px; }

.clientes-directory-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
}

.clientes-advisor-panel {
  align-self: start;
  position: sticky;
  top: 24px;
}

.advisor-pill-list {
  display: grid;
  gap: 10px;
  max-height: 68vh;
  overflow: auto;
  padding-right: 4px;
}

.advisor-pill {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.advisor-pill span { font-weight: 600; color: var(--text); }
.advisor-pill small { color: var(--muted); }
.advisor-pill:hover,
.advisor-pill.is-active { border-color: #2563eb; background: #f7fbff; }

@media (max-width: 1200px) {
  .clientes-directory-grid { grid-template-columns: 1fr; }
  .clientes-advisor-panel { position: static; }
}

.reportes-filter-grid, .clientes-filter-grid { align-items: end; }
.toolbar-row { display:flex; justify-content:space-between; gap:12px; align-items:center; flex-wrap:wrap; }

@media (max-width: 960px) { .toolbar-row { align-items: stretch; } .date-input-wrap { width:100%; } }


/* Section loading and faster split rendering */
.global-loading { display: none !important; }
.section-loader {
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  border:1px dashed rgba(37,99,235,.24);
  border-radius:14px;
  background:#f8fbff;
  color:#1e3a8a;
  font-size:14px;
}
.section-loader .loading-spinner {
  width:18px;
  height:18px;
  border-width:2px;
}
.panel-soft {
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  padding:14px 16px;
}
.quick-filter-panel {
  display:grid;
  gap:12px;
}
.quick-advisor-list {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.quick-advisor-pill {
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  color:#0f172a;
  border-radius:999px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:600;
}
.quick-advisor-pill:hover,
.quick-advisor-pill.is-active {
  border-color:#2563eb;
  background:#edf4ff;
  color:#1d4ed8;
}
.quick-advisor-pill small {
  color:#64748b;
  font-weight:500;
  margin-left:6px;
}
.clientes-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, .9fr);
}
.clientes-main-stack {
  display:grid;
  gap:16px;
}
.clientes-directory-grid {
  display:block;
}
.clientes-advisor-panel { display:none; }
.detail-card {
  position: static;
}
.detail-kpis,
.detail-grid,
.mini-stat,
.detail-grid > div,
.timeline-item {
  background:#fff;
  border-color:rgba(15,23,42,.08);
}
.table-shell--compact table th,
.table-shell--compact table td {
  vertical-align:top;
}
.time-stack {
  min-width:150px;
}
.time-stack strong,
.time-stack .muted {
  display:block;
}
.clientes-empty-state {
  min-height:220px;
  display:grid;
  place-items:center;
}
@media (max-width: 1200px) {
  .clientes-layout { grid-template-columns: 1fr; }
}


.clientes-layout--clean {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .85fr);
}
.client-map-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 18px;
}
.client-map-modal-grid iframe {
  width: 100%;
  min-height: 420px;
  border: 0;
  border-radius: 18px;
  background: #e5e7eb;
}
.report-modal--map {
  width: min(1040px, 96vw);
}
.timeline-item--compact {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
}
.timeline-item--compact small {
  display: block;
  margin-top: 6px;
  color: #64748b;
}
#clientes-detail .detail-stack {
  gap: 16px;
}
#clientes-detail .detail-card,
#clientes-detail .panel {
  overflow: hidden;
}
#clientes-list .table-scroll table {
  min-width: 760px;
}
#clientes-list th,
#clientes-list td {
  font-size: 13px;
}
#clientes-list .client-cell-sub {
  font-size: 12px;
}
@media (max-width: 1200px) {
  .clientes-layout--clean,
  .client-map-modal-grid { grid-template-columns: 1fr; }
}


.detail-anchor {
  scroll-margin-top: 92px;
}

.plan-layout {
  display: grid;
  gap: 18px;
}

.plan-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.plan-table td.is-tight,
.plan-table th.is-tight {
  white-space: nowrap;
  width: 1%;
}

.plan-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
}
.plan-status-pill.success { color: #166534; background: #ecfdf3; border-color: #b7ebc6; }
.plan-status-pill.warning { color: #92400e; background: #fff7ed; border-color: #fed7aa; }

.plan-empty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1200px) {
  .plan-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cell-muted { color: var(--muted); font-size: 13px; line-height: 1.45; }

.coverage-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.coverage-tab {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.coverage-tab:hover,
.coverage-tab.is-active {
  border-color: #b9c8de;
  background: #f8fbff;
}

.coverage-hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.coverage-main-column,
.coverage-side-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.coverage-bottom-panel {
  margin-top: 18px;
}

.coverage-summary-panel {
  display: grid;
  gap: 14px;
}

.coverage-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.coverage-detail-grid > .panel,
.coverage-detail-grid > .placeholder {
  margin: 0;
}

.coverage-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.coverage-stat-card {
  min-height: 104px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.coverage-stat-card strong {
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.coverage-stat-card small {
  color: var(--muted);
  font-size: 12px;
}

.coverage-map-panel {
  overflow: hidden;
}


.coverage-map--large {
  height: 620px;
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #eef3f8;
}

.coverage-subpanel {
  padding-bottom: 6px;
  height: 100%;
}

.coverage-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.coverage-mini-table th,
.coverage-mini-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e6edf6;
  vertical-align: top;
  text-align: left;
}

.coverage-mini-table thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.coverage-mini-table tbody tr:hover {
  background: #f8fbff;
}

.cell-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.coverage-list--compact {
  display: grid;
  gap: 10px;
}

.coverage-list--two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.coverage-client-card--compact {
  padding: 14px;
}

.coverage-client-meta--compact {
  grid-template-columns: 1fr;
  gap: 4px;
}
@media (max-width: 1180px) {
  .coverage-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coverage-hub-layout {
    grid-template-columns: 1fr;
  }

  .coverage-detail-grid,
  .coverage-list--two-cols {
    grid-template-columns: 1fr;
  }

  .coverage-map--large {
    height: 520px;
  }
}

@media (max-width: 760px) {
  .coverage-kpis {
    grid-template-columns: 1fr;
  }

  .coverage-map--large {
    height: 420px;
  }
}

.ghost-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.ghost-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.ghost-btn-sm {
  padding: 6px 9px;
  font-size: 11px;
}
.coverage-side-panel .coverage-client-card--compact {
  padding: 12px 14px;
}
.coverage-side-panel .coverage-client-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.coverage-side-panel .coverage-client-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.coverage-side-panel .coverage-client-meta--compact {
  margin-top: 8px;
}
.coverage-stat-card strong {
  word-break: break-word;
}


.route-km-value {
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.route-time-range {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.coverage-inline-list {
  display: grid;
  gap: 10px;
}

.coverage-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
}

.coverage-inline-row--action {
  gap: 18px;
}

.coverage-inline-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
}

.coverage-inline-main strong {
  font-size: 14px;
  line-height: 1.2;
}

.coverage-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.coverage-inline-meta span {
  white-space: nowrap;
}

.coverage-inline-address {
  min-width: 220px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.coverage-inline-badge {
  flex: 0 0 auto;
}

.coverage-inline-action {
  flex: 0 0 auto;
}

@media (max-width: 860px) {
  .route-km-value { font-size: 28px; }
  .route-time-range { font-size: 18px; }
  .coverage-inline-row,
  .coverage-inline-row--action {
    align-items: flex-start;
    flex-direction: column;
  }
  .coverage-inline-badge,
  .coverage-inline-action {
    align-self: flex-end;
  }
  .coverage-inline-meta span,
  .coverage-inline-address {
    white-space: normal !important;
  }
}

.team-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.team-summary-panels {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 18px;
  align-items: start;
}

.team-table td,
.team-table th {
  white-space: nowrap;
}

.team-row {
  cursor: pointer;
}

.team-row:hover {
  background: rgba(15, 23, 42, 0.03);
}

.team-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.team-zone-inline {
  color: var(--muted);
  font-size: 13px;
}

.team-detail-panel {
  padding-bottom: 20px;
}

.team-profile-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 22px 8px;
}

.team-avatar {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.team-profile-card h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.team-profile-card p {
  margin: 0;
  color: var(--muted);
}

.team-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 12px;
  background: #eef4ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.16);
}

.team-chip--soft {
  background: #f8fafc;
  color: #334155;
  border-color: rgba(148, 163, 184, 0.2);
}

.team-detail-grid {
  padding: 0 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.team-mini-card {
  padding: 16px 18px;
}

.team-mini-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.team-mini-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.team-list-panel {
  margin: 16px 22px 0;
  padding: 0 0 8px;
}

.team-permission-group {
  padding: 12px 18px 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.team-permission-group strong {
  display: block;
  margin-bottom: 8px;
}

@media (max-width: 1180px) {
  .team-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-summary-panels,
  .team-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .team-summary-grid,
  .team-detail-grid {
    grid-template-columns: 1fr;
  }

  .team-profile-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .team-avatar {
    margin: 0 auto;
  }
}

.team-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.team-tab {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.team-tab.is-active {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.25);
  color: #1d4ed8;
}

.team-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.team-tab-panel { display: none; }
.team-tab-panel.is-active { display: block; }

.team-form-body {
  padding: 0 22px 22px;
}

.team-profile-card--form {
  padding-left: 0;
  padding-right: 0;
}

.team-photo-fields {
  display: grid;
  gap: 10px;
}

.team-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 18px;
}

.team-ops-grid--stacked {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-op-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: #fff;
  padding: 0 0 8px;
}

.panel-header-compact {
  padding: 18px 18px 0;
}

.team-check-grid {
  padding: 14px 18px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.team-check-grid--inline {
  grid-template-columns: 1fr;
  padding-top: 2px;
}

.team-zone-grid {
  padding: 14px 18px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.team-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #334155;
  font-size: 13px;
}

.team-check input {
  margin-top: 3px;
}

.team-check--compact {
  align-items: center;
}

.team-warning-list {
  margin: 0 18px 14px;
  display: grid;
  gap: 10px;
}

.team-warning-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  font-size: 13px;
}

.field-actions {
  display: flex;
  align-items: flex-end;
}

.toolbar-row--end {
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .team-ops-grid,
  .team-ops-grid--stacked {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .team-zone-grid,
  .team-check-grid {
    grid-template-columns: 1fr;
  }
}


.health-form-body {
  gap: 14px;
}

.health-zone-summary {
  display: grid;
  gap: 10px;
  padding: 0 18px 14px;
}

.health-zone-summary--current {
  padding: 14px 18px 0;
}

.health-zone-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.health-zone-grid {
  padding: 0 18px 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.health-zone-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.health-zone-check input {
  margin: 0;
}

.health-check-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.health-legacy-card,
.health-zones-card,
.health-permission-card {
  overflow: hidden;
}

.health-legacy-list {
  padding: 0 18px 16px;
  display: grid;
  gap: 10px;
}

.health-legacy-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.health-legacy-row strong {
  font-size: 14px;
  color: var(--text);
}

.health-legacy-row span {
  font-size: 13px;
  color: var(--muted);
}

.health-table-migration td:nth-child(2),
.health-table-migration th:nth-child(2),
.health-table-migration td:nth-child(3),
.health-table-migration th:nth-child(3) {
  white-space: nowrap;
}

/* Salud operativa / migración de accesos */
.compact-stack {
  display: grid;
  gap: 10px;
}

.health-summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .health-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .health-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Salud operativa v2 */
.health-migration-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: 18px;
  align-items: start;
}

.health-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  gap: 16px;
  align-items: start;
}

.health-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.health-check-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  display: grid;
  gap: 12px;
  min-height: 172px;
}

.health-check-card__header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.health-check-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.compact-gap {
  gap: 8px;
}

.health-fix-check {
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .health-migration-grid,
  .health-preview-grid,
  .health-check-grid,
  .health-check-grid-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .health-zone-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Presupuestos mensuales */
.budget-summary-grid {
  margin-bottom: 18px;
}

.budget-table .budget-input {
  width: 150px;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, .45);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: #0f172a;
  outline: none;
}

.budget-table .budget-input:focus {
  border-color: rgba(249, 115, 22, .75);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .12);
}

.budget-table tr.is-dirty {
  background: rgba(250, 204, 21, .12);
}

.budget-detail-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.budget-ranking-table th,
.budget-ranking-table td {
  white-space: nowrap;
}

/* Consulta de actividades por cliente */
.client-activity-query {
  overflow: visible;
}
.client-activity-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}
.client-activity-filter-grid .field-action {
  align-self: end;
}
.client-activity-filter-grid .field-action .primary-button {
  width: 100%;
  justify-content: center;
}
.client-activity-results {
  display: grid;
  gap: 14px;
}
.client-activity-kpis .stat-card small {
  color: #64748b;
  font-size: 12px;
}
.client-activity-table-shell table {
  min-width: 780px;
}
.client-activity-table-shell .badge + .badge {
  margin-left: 6px;
}
@media (max-width: 900px) {
  .client-activity-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Seguimiento: spinner compacto para botón Consultar durante consultas pesadas */
.loading-spinner.mini {
  width: 14px;
  height: 14px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
}

/* Seguimiento > Ranking comercial: contención profesional de cards y tablas */
.ranking-commercial-view,
.ranking-commercial-view * {
  box-sizing: border-box;
}

.ranking-commercial-view {
  display: grid;
  gap: 16px;
  max-width: 100%;
  overflow: hidden;
}

.ranking-commercial-view .ranking-commercial-kpis {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.ranking-commercial-view .kpi-card,
.ranking-commercial-view .panel,
.ranking-commercial-view .panel-header,
.ranking-commercial-view .panel-header > div {
  min-width: 0;
}

.ranking-commercial-view .kpi-card {
  overflow: hidden;
  align-content: start;
}

.ranking-commercial-view .kpi-label {
  min-width: 0;
  gap: 10px;
}

.ranking-commercial-view .kpi-label span:first-child,
.ranking-commercial-view .kpi-value,
.ranking-commercial-view .kpi-foot,
.ranking-commercial-view .panel-title,
.ranking-commercial-view .panel-subtitle {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.ranking-commercial-view .kpi-value {
  font-size: clamp(21px, 2.2vw, 30px);
  line-height: 1.08;
}

.ranking-commercial-view .kpi-foot {
  line-height: 1.35;
}

.ranking-commercial-view .ranking-commercial-tables {
  align-items: start;
}

.ranking-commercial-view .ranking-table-panel {
  overflow: hidden;
}

.ranking-commercial-view .ranking-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  -webkit-overflow-scrolling: touch;
}

.ranking-commercial-view .budget-ranking-table {
  min-width: 860px;
  table-layout: fixed;
}

.ranking-commercial-view .budget-ranking-table th,
.ranking-commercial-view .budget-ranking-table td {
  padding: 12px 10px;
  vertical-align: middle;
}

.ranking-commercial-view .budget-ranking-table .rank-pos {
  width: 46px;
  text-align: center;
}

.ranking-commercial-view .budget-ranking-table .rank-advisor {
  width: 185px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.ranking-commercial-view .budget-ranking-table .rank-zone {
  width: 120px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.ranking-commercial-view .budget-ranking-table .rank-number,
.ranking-commercial-view .budget-ranking-table .rank-money,
.ranking-commercial-view .budget-ranking-table .rank-percent,
.ranking-commercial-view .budget-ranking-table .rank-gap {
  white-space: nowrap;
}

.ranking-commercial-view .budget-ranking-table .rank-number {
  width: 88px;
  text-align: right;
}

.ranking-commercial-view .budget-ranking-table .rank-money {
  width: 122px;
  text-align: right;
}

.ranking-commercial-view .budget-ranking-table .rank-percent {
  width: 105px;
  text-align: center;
}

.ranking-commercial-view .budget-ranking-table .rank-gap {
  width: 122px;
  text-align: right;
}

.ranking-scroll-hint {
  display: none;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .ranking-commercial-view .ranking-commercial-tables {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ranking-commercial-view {
    gap: 14px;
  }
  .ranking-commercial-view .ranking-commercial-kpis {
    grid-template-columns: 1fr;
  }
  .ranking-commercial-view .kpi-value {
    font-size: 24px;
  }
  .ranking-scroll-hint {
    display: block;
  }
}

/* Cartera de clientes: flujo Zona → Asesor → Buscar dentro del resultado */
.clientes-search-field {
  grid-column: span 2;
}
.clientes-search-field input {
  min-width: 0;
}
@media (max-width: 1200px) {
  .clientes-search-field { grid-column: span 3; }
}
@media (max-width: 960px) {
  .clientes-search-field { grid-column: span 1; }
}
.clientes-local-empty {
  margin: 12px 20px 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 600;
}

/* Seguimiento: velocidad percibida y respuesta inmediata */
.report-skeleton {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.report-skeleton-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-skeleton-kpis span,
.report-skeleton-table span {
  display: block;
  min-height: 74px;
  border-radius: 18px;
  background: linear-gradient(90deg, #eef3fb 0%, #f8fbff 45%, #eef3fb 100%);
  background-size: 220% 100%;
  animation: reportSkeletonShimmer 1.15s ease-in-out infinite;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.report-skeleton-table {
  display: grid;
  gap: 9px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #ffffff;
}

.report-skeleton-table span {
  min-height: 24px;
  border-radius: 999px;
}

.report-cache-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: #f7fbff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.report-cache-notice i {
  color: #f59e0b;
}

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

@media (max-width: 900px) {
  .report-skeleton-kpis {
    grid-template-columns: 1fr;
  }
}


/* === Home live feed === */
.home-live-panel { position: relative; overflow: visible; }
.live-feed-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.compact-button { padding: 9px 12px; border-radius: 12px; }
.live-feed-table-wrap { max-height: 560px; }
.live-feed-table th, .live-feed-table td { white-space: nowrap; }
.live-map-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(37,99,235,.25);
  border-radius: 13px;
  color: #1d4ed8;
  background: rgba(37,99,235,.08);
  cursor: pointer;
}
.live-map-button:hover { background: rgba(37,99,235,.14); transform: translateY(-1px); }
.live-map-tooltip {
  position: absolute;
  z-index: 50;
  width: 320px;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15,23,42,.22);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
}
.live-map-card iframe { width: 100%; height: 170px; border: 0; display:block; }
.live-map-info { display:grid; gap:4px; padding: 12px 14px; }
.live-map-info strong { font-size: 14px; }
.live-map-info > span { color: var(--muted); font-size: 12px; }
.live-map-prev { display:flex; align-items:flex-start; gap:8px; margin-top:6px; color:#334155; font-size:12px; line-height:1.35; }
.live-map-prev i { color:#2563eb; margin-top:2px; }

/* === Time analytics === */
.time-analytics-hero {
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.time-hero-card {
  padding: 20px;
  border-radius: 22px;
  background:#ffffff;
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  display:grid;
  gap:7px;
}
.time-hero-card span { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.time-hero-card strong { font-size: 27px; line-height:1.1; color:#0f172a; }
.time-hero-card small { color: var(--muted); line-height:1.35; }
.time-hero-card.primary { border-color: rgba(37,99,235,.22); background: linear-gradient(180deg, #ffffff, #f4f8ff); }
.time-hero-card.warning { border-color: rgba(217,119,6,.24); background: linear-gradient(180deg, #ffffff, #fff8ed); }
.time-hero-card.success { border-color: rgba(22,163,74,.24); background: linear-gradient(180deg, #ffffff, #f0fff5); }
.time-hero-card.info { border-color: rgba(14,165,233,.24); background: linear-gradient(180deg, #ffffff, #f0f9ff); }
.time-progress { margin-top: 8px; height: 8px; border-radius: 999px; background:#e5eaf2; overflow:hidden; min-width:130px; }
.time-progress span { display:block; height:100%; border-radius:999px; background: linear-gradient(90deg, #2563eb, #16a34a); }
.time-challenge-box { display:flex; gap:14px; align-items:flex-start; padding:16px; border-radius:18px; background:#f8fafc; border:1px solid var(--line); }
.time-challenge-box i { color:#d97706; font-size:24px; margin-top:2px; }
.time-challenge-box p { margin:0; color:#334155; line-height:1.5; }
.time-table-shell { margin-top: 18px; }

/* === IA config === */
.ai-hero { align-items: stretch; }
.ai-security-card p { margin:0; color:#334155; line-height:1.55; }
.ai-config-grid { align-items:start; }
.ai-config-form textarea {
  width:100%;
  resize: vertical;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
  font: inherit;
  color: var(--text);
  background:#ffffff;
  outline:none;
}
.ai-config-form textarea:focus { border-color:#93b4ff; box-shadow:0 0 0 4px rgba(37,99,235,.10); }
.ai-switch { display:inline-flex; align-items:center; gap:9px; font-weight:700; color:#334155; }
.ai-switch input { width:18px; height:18px; accent-color: var(--primary); }
.ai-preview-panel { position: sticky; top: 20px; }
.ai-flow-note { margin-top:16px; padding:15px; border-radius:18px; background:#f8fafc; border:1px solid var(--line); display:grid; gap:6px; color:#334155; line-height:1.45; }
.form-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }

@media (max-width: 1100px) {
  .time-analytics-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-preview-panel { position: static; }
}
@media (max-width: 720px) {
  .time-analytics-hero { grid-template-columns: 1fr; }
  .live-map-tooltip { position: fixed; left: 12px !important; right: 12px; top: 120px !important; width: auto; }
}
#app-root { position: relative; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Home · Análisis Comercial Ejecutivo PRO
   Emula una pantalla ejecutiva compacta: KPIs, alertas,
   filtros aplicados, tendencia, barras, donut y zonas.
   ========================================================= */
.ps-executive-page {
  display: grid;
  gap: 14px;
  margin-top: -2px;
}

.ps-exec-topbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  align-items: start;
  gap: 22px;
  padding: 4px 0 6px;
}

.ps-exec-title-block h2 {
  margin: 0;
  color: #101a33;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -.035em;
  line-height: 1.05;
  font-weight: 820;
}

.ps-exec-title-block p {
  margin: 8px 0 0;
  color: #525b6d;
  font-size: 15px;
}

.ps-exec-filterbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 520px;
}

.ps-exec-filterbar label {
  display: grid;
  gap: 6px;
  min-width: 132px;
}

.ps-exec-filterbar label span {
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: .01em;
}

.ps-exec-filterbar select {
  height: 40px;
  border: 1px solid #dce4f0;
  background: #ffffff;
  color: #0f172a;
  border-radius: 2px;
  padding: 0 34px 0 13px;
  font-weight: 650;
  font-size: 13px;
  outline: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .035);
}

.ps-exec-filterbar select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .11);
}

.ps-filter-clear {
  height: 42px;
  border: 0;
  border-radius: 2px;
  background: #071a44;
  color: #ffffff;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(7, 26, 68, .18);
}

.ps-filter-clear:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(7, 26, 68, .22);
}

.ps-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.ps-kpi-pro {
  min-height: 150px;
  background: #ffffff;
  border: 1px solid #ecf0f7;
  border-radius: 8px;
  padding: 17px 20px 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: hidden;
  position: relative;
}

.ps-kpi-pro::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  opacity: .9;
  background: #2563eb;
}
.ps-kpi-pro.green::before { background: #16a34a; }
.ps-kpi-pro.indigo::before { background: #1d4ed8; }
.ps-kpi-pro.cyan::before { background: #0ea5e9; }
.ps-kpi-pro.slate::before { background: #64748b; }

.ps-kpi-pro-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 820;
}

.ps-kpi-pro-title i {
  color: #aab4c5;
  font-size: 16px;
}

.ps-kpi-pro strong {
  font-size: 29px;
  letter-spacing: -.035em;
  line-height: 1.05;
  color: #0b2d72;
}

.ps-kpi-pro-delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-weight: 820;
  font-size: 12px;
}
.ps-kpi-pro-delta.up { color: #047857; }
.ps-kpi-pro-delta.down { color: #b91c1c; }
.ps-kpi-pro-delta.neutral { color: #64748b; }
.ps-kpi-pro-delta span { color: #526078; font-weight: 700; }

.ps-kpi-pro small {
  color: #697586;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
}

.ps-spark {
  width: 100%;
  height: 34px;
  display: block;
  margin-top: 2px;
}
.ps-spark polyline {
  fill: none;
  stroke: #0b56c5;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ps-kpi-bar {
  height: 10px;
  background: #e8edf4;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 5px;
}
.ps-kpi-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.ps-alert-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 13px;
  align-items: stretch;
}

.ps-insights-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ps-insight {
  min-height: 104px;
  border-radius: 7px;
  border: 1px solid #e5e9f2;
  background: #ffffff;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}
.ps-insight.danger { background: linear-gradient(135deg, rgba(220, 38, 38, .08), #ffffff 78%); border-color: rgba(220, 38, 38, .2); }
.ps-insight.warning { background: linear-gradient(135deg, rgba(217, 119, 6, .11), #ffffff 76%); border-color: rgba(217, 119, 6, .23); }
.ps-insight.success { background: linear-gradient(135deg, rgba(22, 163, 74, .09), #ffffff 76%); border-color: rgba(22, 163, 74, .22); }

.ps-insight-icon {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 27px;
}
.ps-insight.danger .ps-insight-icon { color: #b91c1c; background: rgba(220, 38, 38, .12); }
.ps-insight.warning .ps-insight-icon { color: #a16207; background: rgba(217, 119, 6, .16); }
.ps-insight.success .ps-insight-icon { color: #047857; background: rgba(22, 163, 74, .13); }

.ps-insight strong {
  display: block;
  color: #14305f;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.16;
  margin-bottom: 5px;
}
.ps-insight span {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.ps-applied-filters {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #ecf0f7;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
  padding: 17px 18px;
  display: grid;
  gap: 10px;
}
.ps-applied-filters h3 {
  margin: 0 0 2px;
  font-size: 15px;
  color: #0f172a;
}
.ps-filter-pill-list {
  display: grid;
  gap: 9px;
}
.ps-filter-pill-list div {
  border: 1px solid #edf1f7;
  border-radius: 3px;
  min-height: 46px;
  padding: 8px 10px;
  display: grid;
  align-content: center;
  gap: 2px;
  background: #fbfcff;
}
.ps-filter-pill-list span,
.ps-applied-filters small {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
}
.ps-filter-pill-list strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ps-main-analytics-grid {
  display: grid;
  grid-template-columns: minmax(480px, 1.45fr) minmax(330px, .9fr) minmax(330px, .9fr);
  gap: 13px;
  align-items: stretch;
}

.ps-trend-panel,
.ps-seller-panel,
.ps-donut-panel,
.ps-region-panel {
  border-radius: 8px;
  border-color: #ecf0f7;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.panel-header.compact {
  margin-bottom: 8px;
}

.ps-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.ps-chart-legend span {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 999px;
}
.ps-chart-legend .current { background: #0057d9; }
.ps-chart-legend .previous { background: #8b96a8; }

.ps-exec-line-chart {
  width: 100%;
  display: block;
  min-height: 235px;
}
.ps-chart-grid {
  stroke: #e8eef7;
  stroke-width: 1;
}
.ps-chart-axis {
  fill: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.ps-chart-axis.y {
  font-size: 10px;
}
.ps-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ps-line.current { stroke: #0057d9; }
.ps-line.previous { stroke: #8b96a8; stroke-width: 3; stroke-dasharray: 8 7; }
.ps-line-dot { fill: #ffffff; stroke: #0057d9; stroke-width: 3; }

.ps-horizontal-bars {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
.ps-hbar-row {
  display: grid;
  grid-template-columns: 105px minmax(120px, 1fr) 105px;
  align-items: center;
  gap: 11px;
  min-height: 24px;
}
.ps-hbar-row span,
.ps-hbar-row strong {
  color: #263147;
  font-size: 12.5px;
  font-weight: 790;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-hbar-row strong { text-align: right; }
.ps-hbar-row small { color: #64748b; font-weight: 700; }
.ps-hbar-track {
  height: 17px;
  border-radius: 1px;
  background: #edf2fa;
  overflow: hidden;
}
.ps-hbar-track em {
  display: block;
  height: 100%;
  background: #0b56c5;
  border-radius: 1px;
}

.ps-donut-layout {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 208px;
}
.ps-donut {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: conic-gradient(var(--donut));
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .05);
}
.ps-donut::after {
  content: '';
  position: absolute;
  inset: 42px;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}
.ps-donut-legend {
  display: grid;
  gap: 10px;
}
.ps-donut-legend div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.ps-donut-legend strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-weight: 820;
}
.ps-donut-legend em {
  color: #64748b;
  font-style: normal;
  font-weight: 800;
}
.ps-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.ps-dot.dot-0 { background: #0057d9; }
.ps-dot.dot-1 { background: #0b2f7f; }
.ps-dot.dot-2 { background: #8b96a8; }
.ps-dot.dot-3 { background: #6db7ee; }
.ps-dot.dot-4 { background: #16a34a; }
.ps-dot.dot-5 { background: #f59e0b; }
.ps-dot.dot-6 { background: #dc2626; }
.ps-dot.dot-7 { background: #7c3aed; }

.ps-bottom-analytics-grid {
  display: grid;
  grid-template-columns: minmax(260px, .88fr) minmax(260px, .88fr) minmax(520px, 1.45fr);
  gap: 13px;
}

.ps-exec-table,
.ps-zone-table {
  width: 100%;
  border-collapse: collapse;
}
.ps-exec-table th,
.ps-exec-table td,
.ps-zone-table th,
.ps-zone-table td {
  padding: 10px 9px;
  border-bottom: 1px solid #edf1f7;
  color: #1f2937;
  font-size: 12.5px;
  text-align: left;
  vertical-align: middle;
}
.ps-exec-table th,
.ps-zone-table th {
  color: #334155;
  font-weight: 830;
  font-size: 12px;
  background: #fbfcff;
}
.ps-exec-table td strong,
.ps-zone-table td strong {
  font-size: 12.5px;
  color: #111827;
}
.ps-table-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.ps-table-delta.up { color: #047857; background: #ecfdf5; }
.ps-table-delta.down { color: #b91c1c; background: #fff1f2; }
.ps-table-delta.neutral { color: #64748b; background: #f1f5f9; }

.ps-region-content {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) minmax(260px, .9fr);
  gap: 14px;
  align-items: stretch;
}

.ps-zone-scorecard {
  min-height: 246px;
  border: 1px solid #e6edf7;
  border-radius: 6px;
  background:
    radial-gradient(circle at 14% 18%, rgba(0, 87, 217, .12), transparent 28%),
    linear-gradient(135deg, #f8fbff 0%, #ffffff 58%, #eef6ff 100%);
  padding: 15px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.ps-zone-leader-card {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e8eef7;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  padding: 14px 15px;
  display: grid;
  gap: 4px;
}
.ps-zone-leader-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ps-zone-leader-card strong {
  color: #0b2f7f;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.08;
}
.ps-zone-leader-card em {
  color: #334155;
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}
.ps-zone-mini-bars {
  display: grid;
  gap: 10px;
}
.ps-zone-mini-row {
  display: grid;
  gap: 6px;
}
.ps-zone-mini-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}
.ps-zone-mini-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-zone-mini-track {
  height: 9px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}
.ps-zone-mini-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #0057d9;
}
.ps-zone-mini-track i.zone-1 { background: #0b2f7f; }
.ps-zone-mini-track i.zone-2 { background: #6db7ee; }
.ps-zone-mini-track i.zone-3 { background: #16a34a; }
.ps-zone-mini-track i.zone-4 { background: #f59e0b; }
.ps-zone-scorecard small {
  display: block;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
}

.ps-live-after-exec {
  margin-top: 6px;
}

@media (max-width: 1480px) {
  .ps-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ps-main-analytics-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); }
  .ps-donut-panel { grid-column: 1 / -1; }
  .ps-bottom-analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-region-panel { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  .ps-exec-topbar { grid-template-columns: 1fr; }
  .ps-exec-filterbar { min-width: 0; justify-content: flex-start; }
  .ps-alert-filter-grid { grid-template-columns: 1fr; }
  .ps-insights-row { grid-template-columns: 1fr; }
  .ps-main-analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .ps-kpi-row,
  .ps-bottom-analytics-grid { grid-template-columns: 1fr; }
  .ps-exec-filterbar label,
  .ps-filter-clear { width: 100%; }
  .ps-region-content { grid-template-columns: 1fr; }
  .ps-donut-layout { grid-template-columns: 1fr; justify-items: center; }
  .ps-donut-legend { width: 100%; }
  .ps-hbar-row { grid-template-columns: 1fr; gap: 6px; }
  .ps-hbar-row strong { text-align: left; }
}

/* =========================================================
   Home Executive · ajuste de mapa y coherencia tipográfica
   ========================================================= */
.ps-executive-page {
  --ps-ink: var(--text, #0f172a);
  --ps-heading: #101a33;
  --ps-body: #334155;
  --ps-muted: var(--muted, #5b6474);
  --ps-soft: #eef4fb;
  --ps-blue: var(--primary, #2563eb);
  --ps-blue-dark: #0b2f7f;
  --ps-navy: #071a44;
  color: var(--ps-ink);
}
.ps-executive-page .panel-title,
.ps-executive-page .ps-kpi-pro-title,
.ps-executive-page .ps-applied-filters h3 {
  color: var(--ps-ink);
}
.ps-executive-page .panel-subtitle,
.ps-executive-page .ps-kpi-pro small,
.ps-executive-page .ps-chart-legend,
.ps-executive-page .placeholder {
  color: var(--ps-muted);
}
.ps-executive-page .ps-exec-title-block h2,
.ps-executive-page .ps-kpi-pro strong,
.ps-executive-page .ps-insight strong {
  color: var(--ps-heading);
}
.ps-executive-page .ps-kpi-pro strong,
.ps-executive-page .ps-zone-table td strong,
.ps-executive-page .ps-exec-table td strong {
  font-weight: 860;
}
.ps-executive-page .ps-hbar-row span,
.ps-executive-page .ps-hbar-row strong,
.ps-executive-page .ps-donut-legend strong,
.ps-executive-page .ps-zone-table td,
.ps-executive-page .ps-exec-table td {
  color: var(--ps-body);
}
.ps-executive-page .ps-zone-table th,
.ps-executive-page .ps-exec-table th {
  color: var(--ps-ink);
}
.ps-executive-page .ps-filter-pill-list strong,
.ps-executive-page .ps-exec-filterbar label span {
  color: var(--ps-ink);
}
.ps-executive-page .ps-filter-pill-list span,
.ps-executive-page .ps-applied-filters small,
.ps-executive-page .ps-donut-legend em {
  color: var(--ps-muted);
}

.ps-zone-map-card {
  min-height: 292px;
  border: 1px solid #e4ecf7;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto auto;
}
.ps-zone-map-empty {
  min-height: 292px;
  place-items: center;
  padding: 20px;
}
.ps-zone-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 15px 10px;
  border-bottom: 1px solid #edf2fa;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.ps-zone-map-header div {
  display: grid;
  gap: 2px;
}
.ps-zone-map-header span {
  color: var(--ps-muted);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.ps-zone-map-header strong {
  color: var(--ps-ink);
  font-size: 14px;
  font-weight: 880;
}
.ps-zone-map-header em {
  color: var(--ps-blue-dark);
  background: #eef6ff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 5px 9px;
  font-style: normal;
  font-size: 11px;
  font-weight: 880;
}
.ps-zone-svg {
  width: 100%;
  min-height: 210px;
  height: 100%;
  display: block;
}
.ps-map-current {
  fill: none;
  stroke: rgba(37, 99, 235, .22);
  stroke-width: 2;
  stroke-linecap: round;
}
.ps-map-current.soft {
  stroke: rgba(11, 47, 127, .12);
  stroke-width: 1.6;
}
.ps-map-boundary {
  fill: none;
  stroke: #cbdaf0;
  stroke-width: 1.35;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
}
.ps-map-pulse {
  opacity: .15;
}
.ps-map-dot {
  fill: var(--ps-blue);
  stroke: #ffffff;
  stroke-width: 3;
  filter: drop-shadow(0 10px 8px rgba(15, 23, 42, .14));
}
.ps-map-pulse.map-0, .ps-map-dot.map-0 { fill: #2563eb; }
.ps-map-pulse.map-1, .ps-map-dot.map-1 { fill: #0b2f7f; }
.ps-map-pulse.map-2, .ps-map-dot.map-2 { fill: #0ea5e9; }
.ps-map-pulse.map-3, .ps-map-dot.map-3 { fill: #16a34a; }
.ps-map-pulse.map-4, .ps-map-dot.map-4 { fill: #f59e0b; }
.ps-map-pulse.map-5, .ps-map-dot.map-5 { fill: #64748b; }
.ps-map-label-main {
  fill: var(--ps-ink);
  font-size: 12px;
  font-weight: 890;
  paint-order: stroke;
  stroke: rgba(255,255,255,.88);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.ps-map-label-sub {
  fill: var(--ps-muted);
  font-size: 10px;
  font-weight: 780;
  paint-order: stroke;
  stroke: rgba(255,255,255,.88);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.ps-map-footer {
  display: grid;
  grid-template-columns: minmax(130px, .78fr) minmax(0, 1.22fr);
  gap: 12px;
  padding: 12px 15px;
  border-top: 1px solid #edf2fa;
  background: #ffffff;
}
.ps-map-leader {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fbff;
  border: 1px solid #e8eef7;
}
.ps-map-leader span {
  color: var(--ps-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ps-map-leader strong {
  color: var(--ps-blue-dark);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.08;
}
.ps-map-leader em {
  color: var(--ps-body);
  font-size: 12px;
  font-style: normal;
  font-weight: 840;
}
.ps-map-chips {
  display: flex;
  align-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.ps-map-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid #e8eef7;
  background: #fbfdff;
  color: var(--ps-body);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 760;
}
.ps-map-chips i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ps-blue);
  flex: 0 0 auto;
}
.ps-map-chips i.map-1 { background: #0b2f7f; }
.ps-map-chips i.map-2 { background: #0ea5e9; }
.ps-map-chips strong {
  color: var(--ps-blue-dark);
  font-weight: 900;
}
.ps-zone-map-card > small {
  display: block;
  padding: 0 15px 12px;
  color: var(--ps-muted);
  font-size: 10.5px;
  font-weight: 720;
  line-height: 1.35;
  background: #ffffff;
}

@media (max-width: 760px) {
  .ps-map-footer { grid-template-columns: 1fr; }
  .ps-zone-svg { min-height: 190px; }
}

/* =========================================================
   Home Executive · organización de tarjetas + mapa real
   ========================================================= */
.ps-executive-page {
  display: grid;
  gap: 16px;
}

.ps-kpi-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.ps-kpi-pro {
  min-height: 176px;
  display: grid;
  grid-template-rows: auto auto auto minmax(30px, auto) auto;
  align-content: start;
  gap: 9px;
  padding: 17px 17px 15px;
}

.ps-kpi-pro-title {
  min-height: 27px;
  align-items: flex-start;
}

.ps-kpi-pro > strong {
  line-height: 1.04;
  min-height: 36px;
  display: flex;
  align-items: flex-end;
}

.ps-kpi-pro-delta {
  min-height: 21px;
  align-items: center;
}

.ps-kpi-pro small {
  align-self: end;
  min-height: 18px;
}

.ps-alert-filter-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 14px;
  align-items: stretch;
}

.ps-insights-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  height: 100%;
}

.ps-insight {
  min-height: 108px;
  height: 100%;
  align-items: flex-start;
}

.ps-applied-filters {
  height: 100%;
  min-height: 108px;
}

.ps-main-analytics-grid {
  grid-template-columns: minmax(440px, 1.55fr) minmax(300px, .78fr) minmax(300px, .78fr);
  gap: 14px;
  align-items: stretch;
}

.ps-main-analytics-grid > .panel,
.ps-bottom-analytics-grid > .panel {
  height: 100%;
}

.ps-trend-panel,
.ps-seller-panel,
.ps-donut-panel {
  display: flex;
  flex-direction: column;
}

.ps-trend-panel .ps-exec-line-chart,
.ps-seller-panel .ps-horizontal-bars,
.ps-donut-panel .ps-donut-layout {
  flex: 1 1 auto;
}

.ps-bottom-analytics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.ps-region-panel {
  grid-column: 1 / -1;
}

.ps-region-content {
  grid-template-columns: minmax(560px, 1.45fr) minmax(330px, .8fr);
  gap: 15px;
  align-items: stretch;
}

.ps-region-content .table-scroll {
  max-height: 520px;
}

.ps-zone-table th,
.ps-zone-table td,
.ps-exec-table th,
.ps-exec-table td {
  padding: 12px 11px;
  line-height: 1.35;
}

.ps-real-coverage-card {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto minmax(330px, 1fr) auto;
  border-radius: 14px;
  border: 1px solid #dfe8f5;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
}

.ps-real-map-wrap {
  position: relative;
  min-height: 340px;
  background: #eef3f8;
  border-top: 1px solid #edf2fa;
  border-bottom: 1px solid #edf2fa;
}

.ps-real-coverage-map {
  width: 100%;
  height: 100%;
  min-height: 360px;
  background: #eef3f8;
  z-index: 1;
}

.ps-real-coverage-map .leaflet-container,
.ps-real-coverage-map.leaflet-container {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ps-map-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: #334155;
  text-align: center;
  background: rgba(248, 251, 255, .86);
  backdrop-filter: blur(2px);
}

.ps-map-loading-overlay.hidden {
  display: none;
}

.ps-map-loading-overlay strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}

.ps-map-loading-overlay span:not(.loading-spinner) {
  max-width: 360px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.ps-map-loading-overlay.is-error i {
  color: #dc2626;
  font-size: 20px;
}

.ps-real-map-footer {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(230px, .8fr);
  gap: 12px;
  padding: 13px 15px 15px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.ps-map-live-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ps-map-live-stats div,
.ps-map-summary-grid div {
  min-width: 0;
  border: 1px solid #e7edf6;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 11px;
  display: grid;
  gap: 3px;
}

.ps-map-live-stats span,
.ps-map-summary-grid span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ps-map-live-stats strong,
.ps-map-summary-grid strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ps-map-summary-grid em {
  color: #475569;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ps-map-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ps-exec-map-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border-top: 0;
  background: transparent;
}

.ps-exec-map-legend .pill {
  background: #f8fbff;
  border: 1px solid #e7edf6;
  color: #334155;
  font-size: 11.5px;
  font-weight: 800;
}

.compact-placeholder {
  min-height: auto;
  padding: 11px;
  font-size: 12px;
}

@media (max-width: 1540px) {
  .ps-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ps-main-analytics-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); }
  .ps-donut-panel { grid-column: 1 / -1; }
}

@media (max-width: 1240px) {
  .ps-alert-filter-grid,
  .ps-main-analytics-grid,
  .ps-region-content {
    grid-template-columns: 1fr;
  }
  .ps-insights-row,
  .ps-map-live-stats,
  .ps-real-map-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .ps-kpi-row,
  .ps-insights-row,
  .ps-bottom-analytics-grid,
  .ps-map-live-stats,
  .ps-map-summary-grid,
  .ps-real-map-footer {
    grid-template-columns: 1fr;
  }
  .ps-real-coverage-card { min-height: 0; }
  .ps-real-map-wrap,
  .ps-real-coverage-map { min-height: 360px; }
}


/* --------------------------------------------------------------------------
   Home ejecutivo PRO v2: compactación y emulación más fiel al mockup ejecutivo
   -------------------------------------------------------------------------- */
.ps-executive-page {
  --ps-exec-navy: #0f1d3a;
  --ps-exec-blue: #0b5bd3;
  --ps-exec-text: #111827;
  --ps-exec-muted: #5f6b7a;
  --ps-exec-line: #e8edf4;
  gap: 12px;
}

.ps-exec-topbar {
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 0 0 4px;
}

.ps-exec-title-block h2 {
  color: var(--ps-exec-navy);
  font-size: clamp(25px, 2.15vw, 34px);
  font-weight: 760;
  letter-spacing: -.025em;
  line-height: 1.08;
}

.ps-exec-title-block p {
  margin-top: 6px;
  color: var(--ps-exec-muted);
  font-size: 14px;
  font-weight: 500;
}

.ps-exec-filterbar {
  gap: 10px;
  min-width: 0;
}

.ps-exec-filterbar label {
  gap: 5px;
  min-width: 124px;
}

.ps-exec-filterbar label span {
  color: #25324a;
  font-size: 11.5px;
  font-weight: 750;
}

.ps-exec-filterbar select {
  height: 39px;
  border-radius: 12px;
  border-color: #d9e2ef;
  color: #172033;
  font-size: 13px;
  font-weight: 650;
  padding-left: 12px;
  box-shadow: none;
}

.ps-filter-clear,
.ps-filter-clear.secondary-button.compact-button {
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  padding: 0 14px;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  transform: none;
}

.ps-filter-clear:hover,
.ps-filter-clear.secondary-button.compact-button:hover {
  border-color: #b8c7db;
  background: #f6f9fc;
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.ps-filter-clear i { color: #334155; }

.ps-exec-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 282px);
  gap: 12px;
  align-items: stretch;
}

.ps-exec-overview-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ps-kpi-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ps-kpi-pro {
  min-height: 118px;
  border-radius: 14px;
  padding: 13px 15px 12px;
  gap: 6px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
}

.ps-kpi-pro::before { width: 2px; }

.ps-kpi-pro-title {
  font-size: 12.8px;
  font-weight: 760;
  color: #182339;
}

.ps-kpi-pro-title i {
  font-size: 14px;
  color: #9aa7ba;
}

.ps-kpi-pro strong {
  font-size: clamp(22px, 1.65vw, 27px);
  font-weight: 720;
  color: #0b347d;
  letter-spacing: -.028em;
}

.ps-kpi-pro-delta {
  font-size: 11.4px;
  font-weight: 720;
  gap: 4px;
}

.ps-kpi-pro-delta span {
  color: #657286;
  font-weight: 600;
}

.ps-spark {
  height: 24px;
  margin-top: 0;
}

.ps-kpi-bar {
  height: 7px;
  margin: 6px 0 2px;
}

.ps-kpi-pro small {
  display: none;
}

.ps-insights-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  height: auto;
}

.ps-insight {
  min-height: 78px;
  height: auto;
  border-radius: 14px;
  padding: 12px 15px;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.ps-insight-icon {
  width: 46px;
  height: 46px;
  font-size: 21px;
}

.ps-insight strong {
  color: #17305e;
  font-size: clamp(14px, .95vw, 16px);
  font-weight: 760;
  line-height: 1.16;
  margin-bottom: 3px;
}

.ps-insight span {
  color: #5f6b7a;
  font-size: 11.8px;
  font-weight: 560;
  line-height: 1.25;
}

.ps-applied-filters {
  border-radius: 14px;
  padding: 14px 14px;
  gap: 9px;
  min-height: 100%;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
}

.ps-applied-filters h3 {
  color: #182339;
  font-size: 14px;
  font-weight: 760;
}

.ps-filter-pill-list {
  gap: 7px;
}

.ps-filter-pill-list div {
  min-height: 40px;
  border-radius: 10px;
  padding: 7px 10px;
}

.ps-filter-pill-list span,
.ps-applied-filters small {
  font-size: 10.8px;
  font-weight: 650;
}

.ps-filter-pill-list strong {
  color: #172033;
  font-size: 12.6px;
  font-weight: 720;
}

.ps-applied-filters > small {
  display: none;
}

.ps-main-analytics-grid,
.ps-bottom-analytics-grid,
.ps-region-content {
  gap: 12px;
}

.ps-trend-panel,
.ps-seller-panel,
.ps-donut-panel,
.ps-region-panel,
.ps-bottom-analytics-grid > .panel {
  border-radius: 14px;
}

.ps-executive-page .panel-title {
  color: #17305e;
  font-size: 14.3px;
  font-weight: 760;
}

.ps-executive-page .panel-subtitle {
  color: #64748b;
  font-size: 12.2px;
  font-weight: 500;
}

@media (max-width: 1540px) {
  .ps-exec-overview-grid { grid-template-columns: 1fr; }
  .ps-applied-filters { min-height: 0; }
  .ps-filter-pill-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1240px) {
  .ps-exec-topbar { grid-template-columns: 1fr; align-items: start; }
  .ps-exec-filterbar { justify-content: flex-start; }
  .ps-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ps-insights-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .ps-kpi-row,
  .ps-filter-pill-list { grid-template-columns: 1fr; }
  .ps-insight { min-height: 74px; }
}

/* --------------------------------------------------------------------------
   Home ejecutivo PRO v3: mapa a todo el ancho para una lectura más ordenada
   -------------------------------------------------------------------------- */
.ps-region-content {
  grid-template-columns: 1fr;
  gap: 14px;
}

.ps-region-content > .ps-zone-map-card,
.ps-region-content > .ps-real-coverage-card,
.ps-region-content > .table-scroll,
.ps-region-content > .placeholder {
  width: 100%;
}

.ps-region-panel .ps-zone-map-card,
.ps-region-panel .ps-real-coverage-card {
  min-height: 560px;
}

.ps-region-panel .ps-real-map-wrap,
.ps-region-panel .ps-real-coverage-map {
  min-height: 400px;
}

.ps-region-panel .table-scroll {
  border: 1px solid #e8edf4;
  border-radius: 12px;
  overflow: auto;
  background: #ffffff;
}

@media (max-width: 760px) {
  .ps-region-panel .ps-zone-map-card,
  .ps-region-panel .ps-real-coverage-card {
    min-height: 0;
  }

  .ps-region-panel .ps-real-map-wrap,
  .ps-region-panel .ps-real-coverage-map {
    min-height: 340px;
  }
}

/* --------------------------------------------------------------------------
   Cobertura comercial · Recorridos: análisis de huecos entre paradas
   -------------------------------------------------------------------------- */
.route-stops-panel {
  overflow: hidden;
}

.route-stops-note {
  margin: 0 0 12px;
  border: 1px solid rgba(37, 99, 235, .16);
  background: #f8fbff;
  color: #334155;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}

.route-stops-note i {
  color: #2563eb;
  margin-top: 2px;
}

.route-stops-table-wrap {
  width: 100%;
  max-height: 720px;
  border: 1px solid #e6edf6;
  border-radius: 16px;
  background: #ffffff;
}

.route-stops-table {
  min-width: 1180px;
}

.route-stops-table th,
.route-stops-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.route-stops-table th:nth-child(2),
.route-stops-table td:nth-child(2) {
  min-width: 220px;
  white-space: normal;
}

.route-stop-row.route-gap-alert {
  background: linear-gradient(90deg, rgba(254, 226, 226, .62), #ffffff 34%);
}

.route-stop-row.route-gap-warning {
  background: linear-gradient(90deg, rgba(254, 243, 199, .64), #ffffff 34%);
}

.route-gap-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 850;
  border: 1px solid transparent;
  line-height: 1;
}

.route-gap-badge.ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.route-gap-badge.warning {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.route-gap-badge.alert {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.route-gap-badge.primera,
.route-gap-badge.sin_base,
.route-gap-badge.sin_distancia {
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
}

@media (max-width: 860px) {
  .route-stops-table-wrap {
    max-height: 620px;
  }
}

/* --------------------------------------------------------------------------
   Cobertura comercial · Recorridos: validación PRO con Google Routes
   -------------------------------------------------------------------------- */
.route-stops-table {
  min-width: 1320px;
}

.route-gap-badge small {
  margin-left: 3px;
  padding-left: 6px;
  border-left: 1px solid currentColor;
  opacity: .72;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.route-stops-table td .cell-note + .cell-note {
  margin-top: 2px;
}

.route-stops-note {
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}

/* --------------------------------------------------------------------------
   IA de campo: configuración centralizada de IA + Google
   -------------------------------------------------------------------------- */
.ai-centralized-hero .ai-security-card strong {
  color: var(--primary);
}

.ai-central-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
  align-items: start;
}

.ai-section-divider {
  margin: 22px 0 15px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37,99,235,.07), rgba(255,255,255,.96));
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.ai-section-divider h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 850;
  display: flex;
  align-items: center;
  gap: 9px;
}

.ai-section-divider h3 i {
  color: var(--primary);
}

.ai-section-divider p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ai-config-form .field small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  margin-top: 6px;
}

.ai-status-list strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-env-note {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(37,99,235,.24);
  background: #f8fbff;
  display: grid;
  gap: 8px;
}

.ai-env-note strong {
  color: #0f172a;
  font-size: 13px;
}

.ai-env-note code {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 9px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .ai-central-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ai-section-divider {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* --------------------------------------------------------------------------
   Sidebar PRO: botón hamburguesa como marca del menú
   -------------------------------------------------------------------------- */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  margin-bottom: 16px;
  padding: 10px 6px 12px;
}

.brand-menu-button,
.sidebar-toggle-button.brand-menu-button {
  position: static;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.brand-menu-button i,
.sidebar-toggle-button.brand-menu-button i {
  font-size: 22px;
  line-height: 1;
}

.brand-menu-button:hover,
.sidebar-toggle-button.brand-menu-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(37, 99, 235, .24);
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.brand-copy .brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell.sidebar-collapsed .brand-row {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 14px;
}

.app-shell.sidebar-collapsed .brand-copy {
  display: none;
}

.app-shell.sidebar-collapsed .brand-menu-button,
.app-shell.sidebar-collapsed .sidebar-toggle-button.brand-menu-button {
  flex-basis: 52px;
  margin: 0 auto;
}

@media (max-width: 960px) {
  .brand-row {
    padding-right: 0;
    padding-left: 0;
  }
}


/* --------------------------------------------------------------------------
   Sidebar: firma discreta PowerSellApp con link a página principal
   -------------------------------------------------------------------------- */
.sidebar-powered-link {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 118px;
  min-height: 68px;
  border: 1px solid rgba(37, 99, 235, .12);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.sidebar-powered-link:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .25);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .075);
}

.sidebar-powered-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, .18);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

.sidebar-powered-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 5px;
}

.sidebar-powered-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-powered-copy strong {
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-powered-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell.sidebar-collapsed .sidebar-powered-link {
  left: 12px;
  right: 12px;
  bottom: 116px;
  min-height: 58px;
  padding: 6px;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.app-shell.sidebar-collapsed .sidebar-powered-link:hover {
  background: #f8fbff;
  border-color: rgba(37, 99, 235, .16);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}

.app-shell.sidebar-collapsed .sidebar-powered-logo {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
}

.app-shell.sidebar-collapsed .sidebar-powered-copy {
  display: none;
}

@media (max-height: 760px) {
  .sidebar-powered-link {
    position: static;
    margin-top: 14px;
    margin-bottom: 92px;
  }

  .app-shell.sidebar-collapsed .sidebar-powered-link {
    margin-bottom: 86px;
  }
}


/* --------------------------------------------------------------------------
   Sidebar usuario: foto redonda + nombre capitalizado
   -------------------------------------------------------------------------- */
.sidebar-footer .user-avatar {
  border-radius: 999px;
  object-fit: cover;
}

#sidebarUserName {
  text-transform: capitalize;
}

/* --------------------------------------------------------------------------
   Clientes PRO: asesor por pointer + location picker elegante
   -------------------------------------------------------------------------- */
.client-form .field small,
.client-location-tools small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.client-form input[readonly] {
  background: #f8fbff;
  color: #334155;
  cursor: not-allowed;
  border-color: rgba(37, 99, 235, .18);
}

.coordinate-field input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: -.01em;
}

.client-location-tools {
  border: 1px dashed rgba(37, 99, 235, .24);
  border-radius: 16px;
  padding: 14px;
  background: #f8fbff;
  align-content: center;
}

.client-location-tools > span {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.client-location-picker-modal {
  width: min(980px, calc(100vw - 30px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto auto minmax(360px, 1fr) auto;
}

.client-location-picker-modal .report-modal-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.client-location-picker-toolbar,
.client-location-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.client-location-picker-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.client-picker-coords {
  padding: 10px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.client-location-picker-map {
  min-height: 420px;
  background: #eef3f8;
}

@media (max-width: 720px) {
  .client-location-picker-toolbar,
  .client-location-picker-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .client-picker-coords,
  .client-location-picker-toolbar .secondary-button,
  .client-location-picker-actions .secondary-button,
  .client-location-picker-actions .primary-button {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Cobertura · Reporte PRO de recorrido / combustible
   -------------------------------------------------------------------------- */
.route-fuel-panel {
  margin-bottom: 16px;
}

.route-fuel-config {
  display: grid;
  grid-template-columns: minmax(130px, .75fr) minmax(130px, .75fr) auto auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.route-fuel-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid rgba(37, 99, 235, .12);
  color: #334155;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.route-fuel-note i {
  color: #2563eb;
  margin-top: 2px;
}

.route-fuel-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.route-fuel-table th,
.route-fuel-table td {
  white-space: nowrap;
}

.route-fuel-table tfoot th {
  background: #f8fbff;
  color: #0f172a;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .route-fuel-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .route-fuel-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .route-fuel-config,
  .route-fuel-kpis {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Tour inicial PRO del dashboard
   -------------------------------------------------------------------------- */
.dashboard-tour-host {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.dashboard-tour-dim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(2px);
}

.dashboard-tour-spotlight {
  position: absolute;
  border: 2px solid rgba(96, 165, 250, .95);
  box-shadow: 0 0 0 9999px rgba(15,23,42,.52), 0 18px 44px rgba(37,99,235,.22);
  background: rgba(255,255,255,.08);
  transition: all .28s ease;
  pointer-events: none;
}

.dashboard-tour-target {
  position: relative;
  z-index: 10000;
}

.dashboard-tour-content {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dashboard-tour-card {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 32px);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  border: 1px solid rgba(148, 163, 184, .18);
  padding: 18px;
  pointer-events: auto;
  animation: tourCardIn .22s ease both;
}

.dashboard-tour-progress {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 10px;
}

.dashboard-tour-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.18;
}

.dashboard-tour-card p {
  margin: 0;
  color: #475569;
  font-size: 13.5px;
  line-height: 1.5;
}

.dashboard-tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

@keyframes tourCardIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 720px) {
  .dashboard-tour-card {
    left: 16px !important;
    right: 16px;
    top: auto !important;
    bottom: 16px;
    width: auto;
  }
}


/* --------------------------------------------------------------------------
   Reporte de recorrido visible como sección propia del menú
   -------------------------------------------------------------------------- */
.coverage-fuel-report-mode .coverage-tabbar {
  border-color: rgba(37, 99, 235, .16);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.coverage-fuel-report-mode .coverage-tab[data-tab="recorridos"] {
  background: #edf2f7;
  border-color: rgba(37, 99, 235, .20);
  color: #0f172a;
}

.route-report-guide {
  display: grid;
  gap: 10px;
}

.route-report-guide .route-fuel-note {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Reporte recorrido PRO · tarjetas uniformes y recálculo visual
   -------------------------------------------------------------------------- */
.route-fuel-panel {
  overflow: hidden;
}

.route-fuel-config {
  grid-template-columns: minmax(150px, .85fr) minmax(150px, .85fr) repeat(3, max-content);
  align-items: stretch;
}

.route-fuel-field {
  min-width: 0;
}

.route-fuel-field input {
  font-weight: 800;
  letter-spacing: .01em;
}

.route-fuel-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.route-fuel-config .primary-button,
.route-fuel-config .secondary-button {
  min-height: 48px;
  align-self: end;
  white-space: nowrap;
}

.route-fuel-kpis-pro {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-top: 2px;
}

.route-fuel-kpi {
  position: relative;
  min-width: 0;
  min-height: 114px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
  overflow: hidden;
}

.route-fuel-kpi::after {
  content: '';
  position: absolute;
  right: -22px;
  top: -28px;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .055);
}

.route-fuel-kpi-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #2563eb;
  background: #edf5ff;
  border: 1px solid rgba(37, 99, 235, .12);
  z-index: 1;
}

.route-fuel-kpi-body {
  min-width: 0;
  display: grid;
  gap: 6px;
  z-index: 1;
}

.route-fuel-kpi-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .045em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-fuel-kpi strong {
  display: block;
  color: #0f172a;
  font-size: clamp(23px, 1.45vw, 31px);
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-fuel-kpi small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-fuel-kpi.is-money {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-color: rgba(22, 163, 74, .16);
}

.route-fuel-kpi.is-money::after {
  background: rgba(22, 163, 74, .07);
}

.route-fuel-kpi.is-money .route-fuel-kpi-icon {
  color: #16a34a;
  background: #ecfdf5;
  border-color: rgba(22, 163, 74, .14);
}

.route-fuel-table-wrap {
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 18px;
  overflow: auto;
  background: #ffffff;
}

.route-fuel-table {
  min-width: 720px;
}

.route-fuel-table th,
.route-fuel-table td {
  padding: 13px 14px;
  vertical-align: middle;
}

.route-fuel-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.route-fuel-table tfoot th {
  position: sticky;
  bottom: 0;
  z-index: 1;
  border-top: 1px solid rgba(148, 163, 184, .20);
}

.coverage-kpis {
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.coverage-stat-card {
  min-height: 128px;
  height: 100%;
  padding: 16px;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: stretch;
}

.coverage-stat-card > span {
  min-height: 29px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .035em;
  line-height: 1.2;
  text-transform: none;
}

.coverage-stat-card strong {
  align-self: end;
  display: block;
  color: #0f172a;
  font-size: clamp(24px, 1.55vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.coverage-stat-card small {
  align-self: start;
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.25;
  margin-top: 2px;
}

@media (max-width: 1380px) {
  .route-fuel-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .route-fuel-config .primary-button,
  .route-fuel-config .secondary-button {
    justify-content: center;
  }
}

@media (max-width: 1180px) {
  .route-fuel-kpis-pro {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .route-fuel-config,
  .route-fuel-kpis-pro {
    grid-template-columns: 1fr;
  }
  .route-fuel-kpi {
    min-height: 104px;
  }
}


/* --------------------------------------------------------------------------
   Recorridos PRO · tarjetas informativas uniformes
   -------------------------------------------------------------------------- */
.coverage-kpis-pro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.coverage-stat-card-pro {
  position: relative;
  min-height: 116px;
  height: 100%;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  overflow: hidden;
}

.coverage-stat-card-pro::after {
  content: '';
  position: absolute;
  right: -24px;
  top: -30px;
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .055);
}

.coverage-stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #2563eb;
  background: #edf5ff;
  border: 1px solid rgba(37, 99, 235, .12);
  z-index: 1;
}

.coverage-stat-body {
  min-width: 0;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.coverage-stat-label,
.coverage-stat-card-pro > .coverage-stat-body > .coverage-stat-label {
  min-height: auto;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .045em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coverage-stat-card-pro strong {
  align-self: auto;
  display: block;
  color: #0f172a;
  font-size: clamp(24px, 1.45vw, 31px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

.coverage-stat-card-pro small {
  align-self: auto;
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0;
  overflow-wrap: anywhere;
}

.coverage-stat-card-pro.is-success {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-color: rgba(22, 163, 74, .16);
}

.coverage-stat-card-pro.is-success::after {
  background: rgba(22, 163, 74, .07);
}

.coverage-stat-card-pro.is-success .coverage-stat-icon {
  color: #16a34a;
  background: #ecfdf5;
  border-color: rgba(22, 163, 74, .14);
}

.coverage-stat-card-pro.is-warning {
  background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
  border-color: rgba(245, 158, 11, .18);
}

.coverage-stat-card-pro.is-warning::after {
  background: rgba(245, 158, 11, .08);
}

.coverage-stat-card-pro.is-warning .coverage-stat-icon {
  color: #d97706;
  background: #fff7ed;
  border-color: rgba(245, 158, 11, .16);
}

.coverage-stat-card-pro.is-purple {
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
  border-color: rgba(124, 58, 237, .14);
}

.coverage-stat-card-pro.is-purple::after {
  background: rgba(124, 58, 237, .065);
}

.coverage-stat-card-pro.is-purple .coverage-stat-icon {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: rgba(124, 58, 237, .14);
}

.coverage-fuel-report-mode .coverage-detail-grid {
  grid-template-columns: 1fr;
}

.coverage-fuel-report-mode .coverage-detail-grid .coverage-kpis-pro {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
}

.coverage-fuel-report-mode .coverage-detail-grid .coverage-stat-card-pro {
  min-height: 118px;
}

.coverage-subpanel--journey {
  overflow: hidden;
  border-color: rgba(37, 99, 235, .12);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .045);
}

.coverage-subpanel--journey .panel-title::before {
  content: '\f017';
  font-family: FontAwesome;
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-right: 9px;
  border-radius: 12px;
  color: #2563eb;
  background: #edf5ff;
  border: 1px solid rgba(37, 99, 235, .12);
  font-size: 14px;
  vertical-align: middle;
}

.coverage-subpanel--journey .coverage-mini-table th {
  background: #f8fbff;
  color: #475569;
  font-size: 11px;
  letter-spacing: .055em;
}

.coverage-subpanel--journey .coverage-mini-table td {
  background: rgba(255, 255, 255, .72);
  vertical-align: middle;
}

.coverage-subpanel--journey .coverage-mini-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.coverage-subpanel--journey .coverage-mini-table td:nth-child(2),
.coverage-subpanel--journey .coverage-mini-table td:nth-child(3) {
  font-weight: 850;
  color: #0f172a;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .coverage-kpis-pro {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .coverage-kpis-pro {
    grid-template-columns: 1fr;
  }

  .coverage-stat-card-pro {
    min-height: 104px;
  }
}


/* --------------------------------------------------------------------------
   Fix visual: Distancia del recorrido con el mismo peso que las demás tarjetas
   -------------------------------------------------------------------------- */
.coverage-stat-card-pro strong .route-km-value,
.coverage-stat-card-pro .route-km-value {
  display: inline-block;
  font-size: clamp(24px, 1.45vw, 31px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.045em !important;
  font-weight: 900 !important;
  white-space: nowrap;
}

.coverage-stat-card-pro strong:has(.route-km-value) {
  font-size: clamp(24px, 1.45vw, 31px) !important;
  line-height: 1.02 !important;
}


/* --------------------------------------------------------------------------
   LubChile: Reporte único, sin pestañas duplicadas de Cobertura
   -------------------------------------------------------------------------- */
.coverage-fuel-report-mode .coverage-tabbar {
  display: none !important;
}

.coverage-fuel-report-mode .filter-panel {
  margin-bottom: 18px;
}
