:root {
  --bg-main: #f4f1e8;
  --bg-shell: #ffffff;
  --ink-main: #172119;
  --ink-soft: #41533f;
  --line: #d8d2bf;
  --accent: #1d6c43;
  --accent-2: #0b4b92;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink-main);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.card-shell {
  background: var(--bg-shell);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -2rem;
  top: -2rem;
  width: 10rem;
  height: 10rem;

  pointer-events: none;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: var(--accent-2);
  font-weight: 700;
}

.hero-title {
  font-weight: 700;
  line-height: 1.12;
}

.hero-subtitle {
  color: var(--ink-soft);
  max-width: 58ch;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.btn-accent:hover,
.btn-accent:focus {
  background: #155236;
  border-color: #155236;
  color: #fff;
}

.btn-quiet {
  border: 1px solid var(--line);
  background: #f8f8f6;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 14px;

  padding: 0.85rem 1rem;
  height: 100%;
}

.metric-label {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
}

.metric-value {
  margin: 0.3rem 0 0;
  font-size: 1.8rem;
  line-height: 1;
}

.metric-card-sm {
  padding: 0.6rem 0.8rem;
}

.metric-small-value {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
  line-height: 1.1;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.analytics-tabs .nav-link {
  color: var(--ink-soft);
  font-weight: 600;
}

.analytics-tabs .nav-link.active {
  color: var(--ink-main);
}

.chart-box {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.4rem;
  background: #fff;
}

.chart-box-small {
  min-height: 320px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

#leadMap {
  width: 100%;
  height: 62vh;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.visit-plan-accordion {
  --bs-accordion-border-color: var(--line);
  --bs-accordion-bg: #fdfcf8;
  --bs-accordion-btn-bg: #f7f4ea;
  --bs-accordion-active-bg: #eef5ea;
  --bs-accordion-btn-focus-box-shadow: none;
  --bs-accordion-btn-color: var(--ink-main);
  --bs-accordion-active-color: var(--ink-main);
}

.plan-card {
  margin-bottom: 0.45rem;
}

.visit-plan-accordion .accordion-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.visit-plan-accordion .accordion-body {
  padding-top: 0.55rem;
}

.plan-company {
  font-weight: 600;
}

.plan-meta {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.plan-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.18rem;
  margin-bottom: 0.4rem;
}

.plan-detail-line {
  font-size: 0.82rem;
}

.plan-label {
  font-weight: 600;
}

.plan-reviews-block {
  border-top: 1px dashed var(--line);
  margin-top: 0.45rem;
  padding-top: 0.4rem;
}

.plan-reviews-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.plan-review-item {
  margin-bottom: 0.28rem;
}

.plan-review-title {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.plan-review-text {
  font-size: 0.81rem;
}

.plan-reviews-empty {
  margin-top: 0.42rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.plan-notes {
  border-top: 1px dashed var(--line);
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  font-size: 0.8rem;
}

.plan-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
  font-size: 0.82rem;
}

.plan-raw {
  margin-top: 0.4rem;
}

.plan-raw summary {
  cursor: pointer;
  font-size: 0.8rem;
}

.plan-raw pre {
  margin-top: 0.35rem;
  max-height: 180px;
  overflow: auto;
  background: #f5f2e8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem;
  font-size: 0.72rem;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.5rem;

  font-size: 0.74rem;
  font-weight: 700;
}

.priority-high {
  background: #d9f6e6;
  color: #125a36;
}

.priority-visit {
  background: #e4eefb;
  color: #1a4e8a;
}

.priority-call {
  background: #fcefd8;
  color: #8a5100;
}

.priority-low {
  background: #f3dede;
  color: #7a2020;
}

.interest-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.06rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.interest-pill-interesting {
  background: #d9f6e6;
  color: #125a36;
}

.interest-pill-not {
  background: #e5e7eb;
  color: #374151;
}

.interest-pill-neutral {
  background: #f3f4f6;
  color: #6b7280;
}

.interest-controls {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.interest-btn {
  font-size: 0.72rem;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid #ced4da;
  padding: 0.2rem 0.45rem;
  background: #fff;
}

.interest-btn.active-interesting {
  border-color: #18824f;
  color: #125a36;
  background: #d9f6e6;
}

.interest-btn.active-not {
  border-color: #6b7280;
  color: #374151;
  background: #e5e7eb;
}

.interest-btn.active-neutral {
  border-color: #9ca3af;
  color: #6b7280;
  background: #f3f4f6;
}

.updated-at {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.status-ok {
  color: #155e3a;
}

.status-warn {
  color: #8a5100;
}

.status-err {
  color: #7a2020;
}

code {
  font-family: "IBM Plex Mono", monospace;
}

.dataTables_wrapper .dataTables_filter input {
  border-radius: 10px;
  border-color: var(--line);
}

@media (max-width: 767px) {
  .metric-value {
    font-size: 1.55rem;
  }

  .chart-box,
  .chart-box-small {
    min-height: 280px;
  }

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

  #leadMap {
    height: 54vh;
    min-height: 360px;
  }
}

@media (max-width: 1199px) and (min-width: 768px) {
  .filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
