/* Signal39 clarity theme
   Operational software inspired by the discipline of modern infrastructure products. */
:root {
  --paper: #f7f8fa;
  --paper-2: #f1f3f5;
  --card: #ffffff;
  --ink: #0b0c0e;
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d0d5dd;
  --green: #2563eb;
  --green-strong: #1d4ed8;
  --green-2: #eff4ff;
  --lime: #2563eb;
  --amber: #a15c07;
  --amber-bg: #fff7e8;
  --red: #b42318;
  --shadow: 0 20px 45px rgba(16, 24, 40, .08);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .035);
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --sidebar: 248px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

body {
  background: var(--paper);
  color: var(--ink);
  letter-spacing: -.008em;
}

.sidebar {
  background: #fff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.brand { color: var(--ink); font-weight: 760; }
.brand-mark {
  background: var(--ink);
  color: #fff;
  border-radius: 7px;
  box-shadow: none;
}
.nav-label { color: #98a2b3; }
.nav button { color: #667085; }
.nav button:hover { color: var(--ink); background: #f8f9fb; }
.nav button.active {
  color: var(--ink);
  background: #f1f3f6;
  box-shadow: none;
}
.nav button.active .nav-icon { color: var(--ink); }
.nav .badge { background: #e9efff; color: #1d4ed8; }
.account { border-color: var(--line); }
.account small { color: #98a2b3; }

.topbar {
  background: rgba(255,255,255,.91);
  border-color: var(--line);
  box-shadow: none;
}
.live-dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.content { max-width: 1460px; }
.page-head h1 {
  color: #08090a;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 730;
  letter-spacing: -.045em;
}
.page-head p { color: #667085; }
.eyebrow { color: #7f8797; letter-spacing: .11em; }

.btn {
  border-color: var(--line-strong);
  background: #fff;
  color: #1d2939;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.btn:hover { border-color: #98a2b3; box-shadow: 0 2px 5px rgba(16,24,40,.07); }
.btn.dark {
  color: #fff;
  background: #0b0c0e;
  border-color: #0b0c0e;
}
.btn.dark:hover { background: #24262b; border-color: #24262b; }
.btn.green { color: #fff; background: #2563eb; border-color: #2563eb; }
.btn.green:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn.ghost:hover { background: #f5f6f8; }
.btn:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline-color: #2563eb;
}

.card {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.card-head, .form-section + .form-section { border-color: var(--line); }
.card-head h2, .card-head h3 { color: #101828; }
.card-head p { color: #7d8797; }

.stat {
  border-top: 1px solid var(--line);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.stat:hover {
  transform: translateY(-1px);
  border-top-color: #b9c7e8;
  box-shadow: 0 8px 24px rgba(16,24,40,.06);
}
.stat::after {
  right: -34px;
  top: -34px;
  background: #2563eb;
  opacity: .055;
}
.stat-label { color: #667085; }
.stat-value { color: #0b0c0e; }
.delta { color: #177a48; }
.mini-icon { color: #2563eb; background: #eff4ff; }

.status { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }
.status.green { color: #157347; background: #ecfdf3; border-color: #d1fadf; }
.status.amber { color: #a15c07; background: #fffaeb; border-color: #fef0c7; }
.status.red { color: #b42318; background: #fef3f2; border-color: #fee4e2; }

.activity-row:hover, tbody tr:hover { background: #f9fafb; }
.avatar { color: #344054 !important; background: #eef2f6 !important; }

.bar { background: linear-gradient(180deg, #4d7df3, #2563eb); }
.bar:hover { background: #1d4ed8; }
.insight {
  color: #101828;
  background:
    radial-gradient(circle at 100% 0, rgba(37,99,235,.09), transparent 16rem),
    #fff;
  border-color: #dbe4f7;
}
.insight::after { color: #2563eb; opacity: .04; }
.insight .eyebrow { color: #2563eb; }
.insight h3 { color: #101828; }
.insight p { color: #667085; }
.insight .btn { color: #fff; background: #0b0c0e; border-color: #0b0c0e; }

.tabs { border-color: var(--line); }
.tab.active { color: #101828; border-bottom-color: #2563eb; }
.search input, .field input, .field textarea, .field select {
  background: #fff;
  border-color: var(--line-strong);
}
.search input:focus, input:focus, textarea:focus, select:focus {
  border-color: #84adff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.enquiry:hover { background: #f9fafb; }
.enquiry.selected { background: #f4f7ff; box-shadow: inset 3px 0 #2563eb; }
.note { background: #f8f9fb; border-color: var(--line); }
.timeline-dot { background: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
th { color: #667085; background: #f8f9fb; }

.bubble { background: #f2f4f7; }
.bubble.ai { color: #fff; background: #175cd3; }
.drawer { background: #fff; border-color: var(--line); }

.agent-hero {
  color: #101828;
  background:
    linear-gradient(90deg, rgba(37,99,235,.055), transparent 38%),
    #fff;
  border: 1px solid #dfe5f0;
}
.agent-orb {
  color: #fff;
  background: #2563eb;
  box-shadow: none;
}
.agent-hero h2 { color: #101828; }
.agent-hero p { color: #667085; }
.agent-hero > .btn { color: #fff; background: #0b0c0e; border-color: #0b0c0e; }
.subnav button.active { color: #175cd3; background: #eff4ff; }
.progress span, .usage-bar span { background: #2563eb; }
.choice.selected { border-color: #84adff; background: #f4f7ff; box-shadow: inset 0 0 0 1px #84adff; }
.switch.on { background: #2563eb; }
.website-review { border-color: var(--line); }
.review-item { border-color: var(--line); }
.playbook { border-color: var(--line); }
.test-phone { background: #0b0c0e; }
.test-screen { background: #16181d; }
.wave i { background: #6b9cff; }

.step::before { background: #0b0c0e; }
.app-logo { background: #f2f4f7; }
.apps-hero {
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #0b0c0e;
  background-size: 32px 32px;
}
.apps-hero p { color: #98a2b3; }

.price.featured { color: #fff; background: #0b0c0e; border-color: #0b0c0e; }
.price.featured p, .price.featured li { color: #98a2b3; }
.price li::before { color: #2563eb; }
.price.featured li::before { color: #84adff; }
.danger-zone { border-color: #fecdca; }
.danger-zone .card-head { border-color: #fecdca; }

.toast { background: #0b0c0e; border: 1px solid #24262b; }

@media (max-width: 820px) {
  .sidebar { box-shadow: 12px 0 40px rgba(16,24,40,.14); }
}

/* Typography correction
   Use real system-font weights only. Avoid synthetic intermediate weights. */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
body { letter-spacing: 0; }
button, input, textarea, select { letter-spacing: 0; }

.brand {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.025em;
}
.brand-mark { font-weight: 700; letter-spacing: -.04em; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .11em;
}
.nav button { font-size: 13px; font-weight: 500; }
.nav .badge { font-size: 10px; font-weight: 600; }
.account strong { font-size: 12px; font-weight: 600; }
.account small { font-size: 10px; }
.topbar-business { font-size: 13px; font-weight: 600; }

.page-head h1 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(32px, 3.2vw, 38px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -.03em;
}
.page-head p { font-size: 14px; line-height: 1.55; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .1em; }

.btn { font-size: 12px; font-weight: 600; }
.status { font-size: 10px; font-weight: 600; }
.card-head h2, .card-head h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card-head p { font-size: 12px; line-height: 1.45; }

.stat-label { font-size: 12px; font-weight: 500; }
.stat-value {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.stat-foot { font-size: 11px; }
.delta { font-weight: 600; }

.activity-row strong, .enquiry strong { font-size: 12px; font-weight: 600; }
.activity-row p, .enquiry p { font-size: 11px; }
.time { font-size: 10px; }
.bar-group span { font-size: 10px; font-weight: 500; }
.insight h3 { font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.insight p { font-size: 12px; line-height: 1.6; }

.tab { font-size: 12px; font-weight: 500; }
.tab.active { font-weight: 600; }
.search input { font-size: 12px; }
.detail-top h2 { font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.meta { font-size: 11px; }
.note { font-size: 12px; line-height: 1.55; }
.timeline-copy strong { font-size: 12px; font-weight: 600; }
.timeline-copy p { font-size: 11px; }

th { font-size: 10px; font-weight: 600; letter-spacing: .08em; }
td { font-size: 12px; }
.person strong { font-size: 12px; font-weight: 600; }
.person small { font-size: 10px; }
.bubble { font-size: 12px; }
.bubble small { font-size: 10px; }

.agent-hero h2 { font-size: 23px; font-weight: 600; letter-spacing: -.025em; }
.agent-hero p { font-size: 12px; }
.subnav button { font-size: 12px; font-weight: 500; }
.subnav button.active { font-weight: 600; }
.form-section h3 { font-size: 14px; font-weight: 600; }
.form-section > p { font-size: 12px; }
.field label { font-size: 11px; font-weight: 600; }
.field input, .field textarea, .field select { font-size: 12px; }
.field small { font-size: 10px; }
.choice strong, .switch-copy strong, .review-item strong { font-size: 12px; font-weight: 600; }
.choice span, .switch-copy span { font-size: 11px; }
.review-item p, .playbook p { font-size: 11px; }
.playbook h4 { font-size: 13px; font-weight: 600; }

.number { font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.step::before { font-size: 11px; }
.step strong { font-size: 12px; font-weight: 600; }
.step p, .app-card p, .price p, .price li { font-size: 11px; }
.app-card h3 { font-size: 13px; font-weight: 600; }
.apps-hero h2 { font-size: 29px; font-weight: 600; letter-spacing: -.03em; }
.apps-hero p { font-size: 13px; }
.price h3 { font-size: 20px; font-weight: 600; }
.price-amount { font-size: 31px; font-weight: 600; letter-spacing: -.03em; }
.bill-summary { font-size: 12px; }
.bill-summary.total { font-weight: 600; }

@media (max-width: 590px) {
  .page-head h1 { font-size: 32px; }
  .page-head p { font-size: 13px; }
}

/* Cleaner secondary navigation */
.agent-main,
.settings-layout {
  display: block;
}
.agent-main > .subnav,
.settings-layout > .subnav {
  position: static;
  display: flex;
  width: 100%;
  margin: 0 0 16px;
  padding: 6px;
  gap: 3px;
  overflow-x: auto;
}
.agent-main > .subnav button,
.settings-layout > .subnav button {
  flex: 1 0 auto;
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  justify-content: center;
  white-space: nowrap;
}
.agent-main > .subnav button.active,
.settings-layout > .subnav button.active {
  color: #0b0c0e;
  background: transparent;
  border-radius: 0;
  box-shadow: inset 0 -2px #0b0c0e;
}
.agent-main > .subnav button.active .nav-icon,
.settings-layout > .subnav button.active .nav-icon { color: #0b0c0e; }

/* Apps catalogue */
.apps-intro {
  min-height: 190px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background:
    radial-gradient(circle at 92% 20%, rgba(37,99,235,.1), transparent 15rem),
    #fff;
}
.apps-intro h2 {
  margin: 18px 0 8px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.03em;
}
.apps-intro p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.apps-orbit {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #cbd9fb;
  border-radius: 22px;
  background: #eff4ff;
  color: #2563eb;
  box-shadow: 0 0 0 10px rgba(239,244,255,.65);
}
.apps-orbit svg { width: 30px; height: 30px; }
.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.app-card {
  min-height: 112px;
  padding: 20px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) auto;
  align-items: center;
  gap: 16px;
  box-shadow: none;
}
.app-card:hover { border-color: #c7d2e5; background: #fcfdff; }
.app-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.app-logo img { width: 30px; height: 30px; object-fit: contain; }
.app-copy h3 { margin: 0 0 5px; font-size: 14px; font-weight: 600; }
.app-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.app-request { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.app-request strong { font-size: 13px; }
.app-request p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

/* Referral settings */
.referral-strip {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(100deg, #fff, #f5f8ff);
  border-color: #dce5f8;
}
.referral-strip h3 { margin: 12px 0 4px; font-size: 16px; font-weight: 600; }
.referral-strip p { margin: 0; color: var(--muted); font-size: 12px; }
.referral-card {
  display: grid;
  grid-template-columns: minmax(240px,.75fr) minmax(0,1.25fr);
  min-height: 450px;
  overflow: hidden;
}
.referral-visual {
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.18), transparent 15rem),
    #175cd3;
}
.referral-visual svg { width: 42px; height: 42px; }
.referral-visual span { max-width: 180px; font-size: 36px; font-weight: 600; line-height: 1.05; letter-spacing: -.04em; }
.referral-content { padding: 38px; }
.referral-content h2 { margin: 20px 0 10px; font-size: 27px; font-weight: 600; letter-spacing: -.03em; }
.referral-content > p { max-width: 570px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.referral-field { margin-top: 30px; }
.referral-link { display: flex; gap: 8px; }
.referral-link input { flex: 1; }
.referral-stats {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px;
}
.referral-stats strong { display: block; font-size: 22px; font-weight: 600; }
.referral-stats span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
  .agent-main > .subnav button,
  .settings-layout > .subnav button { flex: 0 0 auto; }
  .apps-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .apps-intro { min-height: 0; padding: 24px; }
  .apps-orbit { display: none; }
  .app-card { grid-template-columns: 48px minmax(0,1fr); }
  .app-card > .status { grid-column: 2; }
  .app-request, .referral-strip { align-items: stretch; flex-direction: column; }
  .referral-card { grid-template-columns: 1fr; }
  .referral-visual { min-height: 190px; }
  .referral-content { padding: 26px; }
  .referral-link { flex-direction: column; }
}
