:root {
  color-scheme: light;
  --canvas-rgb: 243 244 241;
  --mist-rgb: 238 245 233;
  --ink-rgb: 17 19 15;
  --muted-rgb: 119 124 112;
  --line-rgb: 225 231 218;
  --accent-rgb: 156 255 47;
  --accent-shadow: rgba(156, 255, 47, 0.24);
  --blue-rgb: 68 194 253;
  --violet-rgb: 199 179 255;
  --radius-lg: 28px;
  --radius-md: 18px;
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(38rem 34rem at -8rem -7rem, rgb(var(--accent-rgb) / 0.14) 0%, rgb(var(--accent-rgb) / 0.08) 44%, transparent 74%),
    radial-gradient(32rem 28rem at 12rem 4rem, rgb(var(--blue-rgb) / 0.08) 0%, transparent 68%),
    linear-gradient(135deg, rgb(var(--canvas-rgb)) 0%, rgb(var(--mist-rgb) / 0.56) 18rem, rgb(var(--canvas-rgb)) 42rem);
  color: rgb(var(--ink-rgb));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 460px);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.78));
  box-shadow: 0 24px 80px rgba(42, 59, 31, 0.11);
  padding: 28px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 20px;
  padding: 22px;
}

.sidebar {
  position: sticky;
  top: 22px;
  height: calc(100vh - 44px);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 32px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 18px 60px rgba(42, 59, 31, 0.08), inset 0 1px 0 rgba(255,255,255,0.9);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgb(var(--accent-rgb));
  color: rgb(var(--ink-rgb));
  font-weight: 900;
  letter-spacing: 0;
}

.nav-link-crm {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  color: rgb(var(--muted-rgb));
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.nav-link-crm:hover,
.nav-link-crm.active {
  color: rgb(var(--ink-rgb));
  background: rgba(255,255,255,0.72);
}

.nav-link-crm.active .nav-icon {
  background: rgb(var(--accent-rgb));
}

.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.main-content {
  min-width: 0;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-title {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
}

.page-subtitle,
.muted-copy {
  color: rgb(var(--muted-rgb));
}

.surface-card {
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 18px 60px rgba(42, 59, 31, 0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

.surface-card.tight {
  border-radius: var(--radius-md);
}

.kpi-card {
  min-height: 132px;
  padding: 20px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0;
}

.btn {
  border-radius: 999px;
  font-weight: 750;
}

.btn-primary {
  --bs-btn-bg: rgb(var(--accent-rgb));
  --bs-btn-border-color: rgb(var(--accent-rgb));
  --bs-btn-color: rgb(var(--ink-rgb));
  --bs-btn-hover-bg: #b6ff5a;
  --bs-btn-hover-border-color: #b6ff5a;
  --bs-btn-hover-color: rgb(var(--ink-rgb));
  box-shadow: 0 12px 24px var(--accent-shadow);
}

.btn-dark {
  --bs-btn-bg: rgb(var(--ink-rgb));
  --bs-btn-border-color: rgb(var(--ink-rgb));
}

.form-control,
.form-select {
  min-height: 46px;
  border-radius: 999px;
  border-color: rgb(var(--line-rgb));
  font-size: 14px;
}

textarea.form-control {
  border-radius: 18px;
}

.form-control:focus,
.form-select:focus {
  border-color: rgb(var(--accent-rgb));
  box-shadow: 0 0 0 0.25rem rgb(var(--accent-rgb) / 0.18);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(238, 245, 233, 0.55);
}

.table thead th {
  color: rgb(var(--muted-rgb));
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  border-bottom-color: rgb(var(--line-rgb));
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge-soft.success { background: #ecfdf5; color: #047857; }
.badge-soft.warning { background: #fffbeb; color: #b45309; }
.badge-soft.danger { background: #fef2f2; color: #b91c1c; }
.badge-soft.info { background: #eff6ff; color: #1d4ed8; }
.badge-soft.lime { background: rgb(var(--accent-rgb) / 0.35); color: rgb(var(--ink-rgb)); }
.badge-soft.neutral { background: #f4f4f5; color: #52525b; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.dot.success { background: #10b981; }
.dot.warning { background: #f59e0b; }
.dot.danger { background: #ef4444; }

.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgb(var(--line-rgb));
}

.timeline-item {
  position: relative;
  padding-left: 52px;
  padding-bottom: 22px;
}

.timeline-dot {
  position: absolute;
  left: 7px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 5px solid white;
  background: rgb(var(--accent-rgb));
  box-shadow: 0 0 0 1px rgb(var(--line-rgb));
}

.chart-box {
  min-height: 0;
  padding: 22px;
}

.chart-card-header {
  min-height: 34px;
}

.chart-frame {
  position: relative;
  width: 100%;
  height: 240px;
}

.chart-frame.compact {
  height: 220px;
}

.chart-frame.donut {
  height: 238px;
  max-width: 360px;
  margin-inline: auto;
}

.chart-frame canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
}

.mobile-nav-toggle {
  display: none;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    position: fixed;
    inset: 12px auto 12px 12px;
    width: min(290px, calc(100vw - 24px));
    height: auto;
    z-index: 1050;
    transform: translateX(calc(-100% - 24px));
    transition: transform 220ms var(--ease-soft);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-toggle {
    display: inline-grid;
  }

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

  .chart-frame,
  .chart-frame.compact,
  .chart-frame.donut {
    height: 220px;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 20px;
  }

  .chart-box {
    padding: 18px;
  }

  .chart-frame,
  .chart-frame.compact,
  .chart-frame.donut {
    height: 200px;
  }
}

/* Excel digital mode */
:root {
  --canvas-rgb: 246 247 244;
  --mist-rgb: 246 247 244;
  --radius-lg: 8px;
  --radius-md: 6px;
}

body {
  background: #f6f7f4;
}

.app-shell {
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.sidebar {
  top: 14px;
  height: calc(100vh - 28px);
  border: 1px solid #dfe4d8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(29, 36, 23, 0.06);
  padding: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 14px;
}

.nav-link-crm {
  min-height: 38px;
  border-radius: 6px;
  gap: 9px;
  padding: 7px 9px;
  font-size: 13px;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.topbar {
  min-height: 54px;
  margin-bottom: 10px;
}

.page-title {
  font-size: 1.55rem;
}

.page-subtitle {
  font-size: 13px;
}

.surface-card,
.auth-card,
.excel-card,
.excel-form,
.sheet-toolbar {
  border: 1px solid #dfe4d8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(29, 36, 23, 0.05);
}

.excel-card {
  overflow: hidden;
}

.leads-card .table-responsive {
  max-height: calc(100vh - 218px);
  overflow: auto;
}

.excel-form,
.sheet-toolbar {
  padding: 14px;
}

.sheet-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.metric-strip span {
  border: 1px solid #dfe4d8;
  border-radius: 6px;
  background: #fff;
  padding: 7px 10px;
}

.btn {
  border-radius: 6px;
  font-size: 13px;
  padding: 7px 11px;
}

.btn-primary {
  box-shadow: none;
}

.form-control,
.form-select {
  min-height: 34px;
  border-radius: 6px;
  font-size: 12px;
}

textarea.form-control {
  border-radius: 6px;
}

.filter-grid {
  grid-template-columns: repeat(8, minmax(118px, 1fr));
  gap: 8px;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #1f231d;
}

.excel-table th,
.excel-table td {
  border: 1px solid #d9ded2;
  padding: 3px 5px;
  font-size: 12px;
  line-height: 1.2;
  vertical-align: middle;
  white-space: nowrap;
}

.excel-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111;
  color: #fff;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.leads-sheet {
  min-width: 2140px;
}

.summary-table {
  min-width: 980px;
}

.grand-total td {
  background: #111;
  color: #fff;
  font-weight: 800;
}

.excel-input,
.excel-select,
.excel-textarea {
  width: 100%;
  min-width: 96px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #1f231d;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px 5px;
}

.excel-input.date {
  min-width: 126px;
}

.excel-input.client {
  min-width: 180px;
  font-weight: 700;
}

.excel-input.money {
  min-width: 130px;
}

.excel-input.short,
.excel-select.tiny {
  min-width: 72px;
}

.excel-textarea {
  min-width: 220px;
  height: 28px;
  resize: vertical;
  overflow: hidden;
}

.excel-input:focus,
.excel-select:focus,
.excel-textarea:focus {
  outline: none;
  border-color: #6aa5ff;
  background: #f7fbff;
}

.cell-readonly {
  display: inline-block;
  min-width: 96px;
  padding: 4px 5px;
}

.cell-readonly.strong {
  min-width: 180px;
  font-weight: 700;
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dfe4d8;
  border-radius: 5px;
  background: #fff;
  color: #111;
}

.icon-btn:hover {
  background: #eef6e8;
}

.icon-btn.danger {
  color: #b91c1c;
}

.summary-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.summary-sheet {
  border: 1px solid #111;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.summary-title {
  background: #050505;
  color: #fff;
  text-align: center;
  font-weight: 900;
  padding: 5px;
}

.summary-line {
  display: grid;
  grid-template-columns: 1fr 72px 76px;
  min-height: 30px;
  border-top: 1px solid #d9ded2;
}

.summary-line span,
.summary-line strong,
.summary-line em {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-right: 1px solid #d9ded2;
  font-style: normal;
}

.summary-line span {
  font-weight: 800;
}

.summary-line strong,
.summary-line em {
  justify-content: center;
}

.total-line span {
  background: #fff;
}

.status-perdido { background: #ff1717 !important; color: #000 !important; font-weight: 800; }
.status-seguimiento { background: #ffe7a3 !important; color: #000 !important; font-weight: 800; }
.status-contactado { background: #ccfbf1 !important; color: #000 !important; font-weight: 800; }
.status-ultimo-intento { background: #f9c2c2 !important; color: #000 !important; font-weight: 800; }
.status-apartado { background: #c6e1bb !important; color: #000 !important; font-weight: 800; }
.status-recorrido { background: #4e86dc !important; color: #000 !important; font-weight: 800; }
.status-interesado { background: #4d8f9d !important; color: #000 !important; font-weight: 800; }
.status-vendido { background: #00f000 !important; color: #000 !important; font-weight: 800; }
.status-nuevo { background: #edf8e9 !important; color: #000 !important; font-weight: 800; }
.status-pausado { background: #e7ecdf !important; color: #000 !important; font-weight: 800; }

.status-select {
  border-color: transparent;
}

.compact-dl dt,
.compact-dl dd {
  border-bottom: 1px solid #e5e9df;
  padding: 7px 0;
  margin-bottom: 0;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .sidebar {
    inset: 10px auto 10px 10px;
    border-radius: 8px;
  }

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

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

  .sheet-actions {
    align-items: stretch;
  }

  .metric-strip,
  .sheet-actions > .d-flex {
    width: 100%;
  }
}

/* Balanced CRM + spreadsheet polish */
:root {
  --panel: #ffffff;
  --panel-soft: #fbfcf8;
  --ink: #171a14;
  --muted: #6f7568;
  --line: #dde4d6;
  --line-strong: #cbd6c3;
  --accent: #9cff2f;
  --accent-soft: #efffdb;
  --shadow-sm: 0 10px 26px rgba(33, 46, 26, 0.07);
  --shadow-md: 0 16px 44px rgba(33, 46, 26, 0.09);
}

body {
  background:
    linear-gradient(180deg, #f7f9f3 0%, #f2f5ee 100%);
  color: var(--ink);
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.sidebar {
  top: 18px;
  height: calc(100vh - 36px);
  border-color: rgba(203, 214, 195, 0.86);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  padding: 16px;
}

.brand-mark {
  border-radius: 10px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.nav-link-crm {
  min-height: 42px;
  border-radius: 9px;
  color: var(--muted);
}

.nav-link-crm:hover {
  background: #f4f8ef;
}

.nav-link-crm.active {
  background: #eefada;
  color: var(--ink);
}

.nav-link-crm.active .nav-icon {
  background: var(--accent);
}

.main-content {
  max-width: 100%;
}

.topbar {
  min-height: 64px;
  margin-bottom: 14px;
}

.page-title {
  font-size: 1.75rem;
}

.page-subtitle {
  color: var(--muted);
}

.surface-card,
.auth-card,
.excel-card,
.excel-form,
.sheet-toolbar {
  border-color: rgba(203, 214, 195, 0.88);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.sheet-toolbar {
  padding: 14px;
}

.filter-search-shell {
  padding: 12px;
}

.filter-search-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.filter-search-input {
  position: relative;
}

.filter-search-input .bi {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.filter-search-input .form-control {
  min-height: 44px;
  padding-left: 40px;
  padding-right: 104px;
  font-size: 14px;
}

.filter-submit-inline {
  position: absolute;
  right: 6px;
  top: 50%;
  min-height: 32px;
  padding: 5px 13px;
  transform: translateY(-50%);
  font-size: 12px;
}

.filter-open-btn {
  min-height: 44px;
  padding-inline: 18px;
}

.filter-modal .modal-content {
  border: 1px solid rgba(203, 214, 195, 0.92);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.filter-modal .modal-header,
.filter-modal .modal-footer {
  border-color: #edf1e8;
}

.filter-modal .modal-body {
  padding: 18px;
}

.filter-grid {
  grid-template-columns: repeat(8, minmax(126px, 1fr));
  gap: 10px;
}

.form-control,
.form-select {
  min-height: 38px;
  border-color: var(--line);
  border-radius: 9px;
  background-color: #fff;
  color: var(--ink);
  font-size: 12.5px;
}

.form-control:hover,
.form-select:hover {
  border-color: var(--line-strong);
}

.btn {
  min-height: 36px;
  border-radius: 9px;
  font-weight: 800;
}

.btn-primary {
  box-shadow: 0 10px 22px rgba(107, 168, 28, 0.16);
}

.btn-light {
  border-color: #e8eee2;
  background: #fff;
}

.sheet-actions {
  margin-top: 4px;
}

.metric-strip {
  gap: 10px;
}

.metric-strip span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(203, 214, 195, 0.86);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(33, 46, 26, 0.05);
  padding: 8px 12px;
  color: var(--muted);
}

.metric-strip strong {
  color: var(--ink);
  font-size: 18px;
}

.summary-board {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.summary-sheet {
  border: 1px solid rgba(203, 214, 195, 0.92);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.summary-title {
  display: flex;
  align-items: center;
  min-height: 42px;
  background: #171a14;
  color: #fff;
  text-align: left;
  padding: 9px 12px;
  font-size: 14px;
}

.summary-line {
  grid-template-columns: 1fr 64px 70px;
  min-height: 34px;
  border-top: 1px solid #edf1e8;
  padding: 0 8px;
}

.summary-line span,
.summary-line strong,
.summary-line em {
  border-right: 0;
  padding: 6px 4px;
}

.summary-line span {
  align-self: center;
  min-height: 24px;
  border-radius: 7px;
  padding-left: 8px;
}

.summary-line strong {
  font-size: 13px;
}

.summary-line em {
  color: var(--muted);
  font-size: 12px;
}

.total-line {
  background: #f9fbf6;
}

.total-line span {
  color: var(--ink);
}

.excel-card {
  border-radius: 12px;
}

.leads-card {
  box-shadow: var(--shadow-md);
}

.leads-card .table-responsive {
  max-height: calc(100vh - 232px);
}

.excel-table {
  background: #fff;
}

.excel-table th,
.excel-table td {
  border-color: #e1e7da;
  padding: 5px 7px;
  font-size: 12px;
}

.excel-table th {
  background: #f2f6ee;
  color: #394034;
  border-bottom: 1px solid #cbd6c3;
  font-weight: 900;
}

.excel-table tbody tr:nth-child(even) {
  background: #fcfdf9;
}

.excel-table tbody tr:hover {
  background: #f3f9ed;
}

.grand-total td {
  background: #171a14 !important;
  color: #fff !important;
}

.excel-input,
.excel-select,
.excel-textarea {
  border-radius: 7px;
  font-size: 12px;
  padding: 5px 7px;
}

.excel-input:hover,
.excel-select:hover,
.excel-textarea:hover {
  background: #f8faf5;
}

.excel-input:focus,
.excel-select:focus,
.excel-textarea:focus {
  border-color: #9bcf63;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(156, 255, 47, 0.16);
}

.excel-textarea {
  height: 31px;
}

.icon-btn {
  border-radius: 8px;
  border-color: #e1e7da;
}

.icon-btn:hover {
  background: var(--accent-soft);
  border-color: #c9dfaf;
}

.status-perdido { background: #fee2e2 !important; color: #991b1b !important; font-weight: 900; }
.status-seguimiento { background: #fef3c7 !important; color: #92400e !important; font-weight: 900; }
.status-contactado { background: #ccfbf1 !important; color: #0f766e !important; font-weight: 900; }
.status-ultimo-intento { background: #ffe4e6 !important; color: #9f1239 !important; font-weight: 900; }
.status-apartado { background: #dcfce7 !important; color: #166534 !important; font-weight: 900; }
.status-recorrido { background: #dbeafe !important; color: #1d4ed8 !important; font-weight: 900; }
.status-interesado { background: #ccfbf1 !important; color: #0f766e !important; font-weight: 900; }
.status-vendido { background: #bbf7d0 !important; color: #14532d !important; font-weight: 900; }
.status-nuevo { background: #eef2ff !important; color: #3730a3 !important; font-weight: 900; }
.status-pausado { background: #e7ecdf !important; color: #394034 !important; font-weight: 900; }

.summary-line .status-perdido { border-left: 4px solid #ef4444; }
.summary-line .status-seguimiento { border-left: 4px solid #f59e0b; }
.summary-line .status-ultimo-intento { border-left: 4px solid #fb7185; }
.summary-line .status-apartado { border-left: 4px solid #22c55e; }
.summary-line .status-recorrido { border-left: 4px solid #3b82f6; }
.summary-line .status-interesado { border-left: 4px solid #14b8a6; }
.summary-line .status-vendido { border-left: 4px solid #16a34a; }
.summary-line .status-nuevo { border-left: 4px solid #6366f1; }

.status-select {
  border: 1px solid #dfe7d6;
  border-radius: 8px;
  color: var(--ink) !important;
  font-weight: 900;
}

select.status-select option {
  background: #fff;
  color: #171a14;
  font-weight: 700;
}

.followup-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.followup-type-option {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #dfe7d6;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  transition: background 160ms var(--ease-soft), border-color 160ms var(--ease-soft), box-shadow 160ms var(--ease-soft), transform 160ms var(--ease-soft);
}

.followup-type-option i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #f3f9ed;
  color: #5b9f12;
  font-size: 17px;
}

.btn-check:checked + .followup-type-option {
  border-color: var(--accent);
  background: #f2ffe1;
  box-shadow: 0 0 0 2px rgba(156, 255, 47, 0.24);
}

.btn-check:checked + .followup-type-option i {
  background: var(--accent);
  color: var(--ink);
}

.followup-type-option:hover {
  border-color: #c9dfaf;
  background: #fbfff7;
  transform: translateY(-1px);
}

.lead-followup-modal .modal-content {
  border: 1px solid rgba(203, 214, 195, 0.92);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.lead-followup-modal .modal-header {
  border-color: #edf1e8;
}

.lead-followup-modal .modal-body {
  padding: 18px;
}

.lead-search-summary p {
  margin-bottom: 10px;
}

.lead-search-summary span {
  white-space: pre-line;
}

.crm-list-card {
  overflow: hidden;
}

.crm-list-card .table-responsive {
  max-height: calc(100vh - 236px);
  overflow: auto;
}

.crm-list-table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f3f9ed;
}

.crm-list-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2f6ee;
  color: #394034;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.crm-list-table td {
  border-color: #e1e7da;
  font-size: 13px;
  vertical-align: middle;
}

.lead-primary {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.lead-primary:hover {
  color: #5b9f12;
}

.lead-note {
  max-width: 360px;
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.2;
}

a.icon-btn {
  text-decoration: none;
  vertical-align: middle;
}

.pending-column {
  padding: 16px;
}

.status-board-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(282px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.status-board-column {
  min-height: calc(100vh - 290px);
  transition: border-color 160ms var(--ease-soft), background 160ms var(--ease-soft);
}

.status-board-column.drag-over {
  border-color: #9bcf63;
  background: #fbfff7;
}

.status-board-list {
  min-height: 120px;
}

.archive-column-footer {
  align-items: center;
  border-top: 1px solid #e7eddf;
  color: var(--muted);
  display: flex;
  font-size: 0.84rem;
  font-weight: 800;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
}

.archive-column-footer .btn {
  flex: 0 0 auto;
  padding: 7px 10px;
}

.pending-card {
  display: block;
  border: 1px solid #e1e7da;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  box-shadow: 0 6px 18px rgba(33, 46, 26, 0.04);
}

.pending-card-line {
  color: var(--ink);
  margin-top: 4px;
}

.pending-card-line strong {
  font-weight: 900;
}

.pending-card-note {
  color: var(--ink);
}

.pending-card[draggable="true"] {
  cursor: grab;
}

.pending-card:hover {
  border-color: #c9dfaf;
  background: #fbfff7;
  transform: translateY(-1px);
}

.pending-card.dragging {
  cursor: grabbing;
  opacity: 0.58;
}

.pending-card.is-saving {
  pointer-events: none;
  opacity: 0.72;
}

.dashboard-filter-card,
.dashboard-card,
.dashboard-kpi-card {
  border: 1px solid rgba(203, 214, 195, 0.92);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.dashboard-filter-card {
  padding: 12px;
}

.dashboard-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(138px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.dashboard-filter-grid .form-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.dashboard-filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

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

.dashboard-kpi-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 16px;
}

.dashboard-kpi-icon {
  grid-row: 1 / span 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: var(--ink);
  font-size: 18px;
}

.dashboard-kpi-icon.warn {
  background: #fef3c7;
  color: #92400e;
}

.dashboard-kpi-card strong {
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.dashboard-kpi-card > span:not(.dashboard-kpi-icon):not(.badge-soft) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-kpi-card .badge-soft {
  width: fit-content;
  margin-top: 4px;
}

.dashboard-layout-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-row-main {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
}

.dashboard-card {
  min-width: 0;
  padding: 16px;
}

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-card-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.dashboard-card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-funnel,
.dashboard-advisor-bars,
.attention-list {
  display: grid;
  gap: 10px;
}

.dashboard-bar-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
}

.dashboard-bar-label,
.dashboard-advisor-name {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-track {
  height: 26px;
  overflow: hidden;
  border: 1px solid #e5ebdf;
  border-radius: 8px;
  background: #f7faf3;
}

.dashboard-bar-fill {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: 7px;
}

.dashboard-status-nuevo { background: #eef2ff; }
.dashboard-status-contactado { background: #ccfbf1; }
.dashboard-status-en-seguimiento { background: #fef3c7; }
.dashboard-status-recorrido { background: #dbeafe; }
.dashboard-status-apartado { background: #dcfce7; }
.dashboard-status-vendido { background: #bbf7d0; }
.dashboard-status-perdido { background: #fee2e2; }

.dashboard-bar-row strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.dashboard-donut-wrap {
  display: grid;
  gap: 14px;
}

.dashboard-donut {
  width: 178px;
  height: 178px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #e1e7da;
}

.dashboard-donut > div {
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 20px rgba(33, 46, 26, 0.08);
}

.dashboard-donut strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.dashboard-donut span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-legend {
  display: grid;
  gap: 7px;
}

.dashboard-legend div,
.attention-list div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-legend span,
.attention-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dashboard-legend strong,
.attention-list strong {
  color: var(--ink);
  font-size: 13px;
}

.attention-list em {
  color: var(--muted);
  font-style: normal;
  min-width: 42px;
  text-align: right;
}

.dashboard-advisor-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 86px;
  gap: 10px;
  align-items: center;
}

.dashboard-series {
  display: grid;
  gap: 5px;
}

.dashboard-series span {
  display: block;
  height: 10px;
  min-width: 0;
  border-radius: 999px;
}

.series-total {
  background: #e7ecdf;
}

.series-sold {
  background: var(--accent);
}

.dashboard-advisor-values {
  text-align: right;
}

.dashboard-advisor-values strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.dashboard-advisor-values span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.attention-stack {
  height: 18px;
  display: flex;
  overflow: hidden;
  border: 1px solid #dfe7d6;
  border-radius: 999px;
  background: #f7faf3;
  margin-bottom: 14px;
}

.attention-stack span {
  min-width: 0;
}

.dashboard-alerts-card {
  padding: 0;
  overflow: hidden;
}

.dashboard-alerts-card .dashboard-card-head {
  margin: 0;
  padding: 16px;
}

.dashboard-alert-table thead th {
  background: #f2f6ee;
  color: #394034;
  border-color: #e1e7da;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-alert-table td {
  border-color: #e1e7da;
  font-size: 13px;
}

.module-subnav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid #dfe7d6;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.module-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.module-subnav a.active,
.module-subnav a:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.advisor-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.advisor-report-card {
  overflow: hidden;
  border: 1px solid #dfe7d6;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.advisor-report-card header {
  padding: 8px 12px;
  background: #11140f;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.advisor-report-body {
  padding: 12px;
  display: grid;
  gap: 7px;
}

.advisor-status-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 58px;
  min-height: 28px;
  align-items: center;
  border-bottom: 1px solid #edf1e8;
  font-size: 13px;
}

.advisor-status-line span {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 900;
}

.advisor-status-line strong,
.advisor-status-line em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.advisor-status-line em {
  color: var(--muted);
  font-size: 12px;
}

.advisor-status-line.total span {
  background: transparent;
  padding-left: 0;
}

.advisor-report-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.advisor-report-totals div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f2f6ee;
  font-size: 12px;
  font-weight: 900;
}

.advisor-report-totals strong {
  color: var(--ink);
}

.advisor-source-block {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #dfe7d6;
}

.advisor-source-block h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.advisor-source-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.advisor-source-line strong {
  color: var(--ink);
}

.status-color-input {
  width: 100%;
  min-height: 42px;
  padding: 6px;
}

.status-color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border: 1px solid #cfd8c8;
  border-radius: 6px;
  vertical-align: middle;
}

.sidebar {
  overflow-y: auto;
}

.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}

.report-table {
  min-width: 1160px;
}

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

.assignment-table {
  min-width: 860px;
}

.assignment-table .form-check-input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.permission-panel {
  border: 1px solid rgb(var(--line-rgb));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  padding: 14px;
}

.permission-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(var(--line-rgb), 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.permission-check .form-check-input {
  margin: 2px 0 0;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .sidebar {
    inset: 12px auto 12px 12px;
  }

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

  .dashboard-filter-grid,
  .dashboard-kpi-grid,
  .dashboard-layout-row,
  .dashboard-row-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 12px;
  }

  .filter-search-row {
    grid-template-columns: 1fr;
  }

  .filter-open-btn {
    width: 100%;
  }

  .summary-board {
    grid-template-columns: 1fr;
  }

  .metric-strip span {
    flex: 1 1 136px;
  }

  .dashboard-filter-grid,
  .dashboard-kpi-grid,
  .dashboard-layout-row,
  .dashboard-row-main {
    grid-template-columns: 1fr;
  }

  .dashboard-filter-actions {
    justify-content: stretch;
  }

  .dashboard-filter-actions .btn {
    flex: 1;
  }

  .dashboard-bar-row {
    grid-template-columns: 92px minmax(0, 1fr) 34px;
  }

  .dashboard-advisor-row {
    grid-template-columns: 1fr;
  }

  .dashboard-advisor-values {
    text-align: left;
  }
}
