body {
  margin: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  background-color: #282c34;
  color: white;
}

a {
  color: white;
}

h1 {
  font-size: 3rem;
}

.App {
  display: flex;
  flex-direction: column;
  row-gap: 1rem;
  justify-content: start;
  align-items: center;
}

.App > * {
  max-width: calc(100% - 4rem);
}

/* ---- Shell ---- */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.55rem 1.5rem;
  background: #1a1e25;
  border-bottom: 1px solid #3c4250;
}

.brand {
  color: white;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.brand span {
  color: #9aa0a6;
  font-weight: 400;
}

.shell-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.shell-nav a {
  color: #9aa0a6;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.shell-nav a:hover {
  color: white;
}

.shell-nav a.active {
  color: #7ab8ff;
  border-bottom-color: #7ab8ff;
}

.shell-settings {
  color: #9aa0a6;
  text-decoration: none;
  font-size: 1.05rem;
}

.shell-settings:hover {
  color: white;
}

.shell-body {
  flex: 1;
}

.actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  column-gap: 1rem;
}

.result {
  color: white;
  background-color: black;
  padding: 0 1rem;
  overflow: auto;
}

/* ---- Enquiries spike ---- */

.App.page {
  align-items: stretch;
  padding: 0 1.5rem 2rem;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.6rem;
}

.nav-link {
  color: #7ab8ff;
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
}

.muted {
  color: #9aa0a6;
  font-size: 0.85rem;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.source-chip {
  border-radius: 1rem;
  padding: 0.2rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.source-chip.ok {
  background: #12351c;
  border-color: #2e7d32;
}

.source-chip.fixture {
  background: #33301a;
  border-color: #b08a00;
}

.source-chip.failed {
  background: #3a1d1d;
  border-color: #b3423a;
}

/* KPI strip */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.kpi {
  background: #1f232b;
  border: 1px solid #3c4250;
  border-radius: 0.5rem;
  padding: 0.6rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kpi-label {
  color: #9aa0a6;
  font-size: 0.8rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.kpi-value.unavailable {
  color: #6b7385;
}

/* Four-card cockpit */

.cockpit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.section-card {
  background: #1f232b;
  border: 1px solid #3c4250;
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.section-head p {
  margin: 0.15rem 0 0;
}

.section-count {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}

.section-count.unavailable {
  color: #6b7385;
}

.section-more {
  font: inherit;
  color: #7ab8ff;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
}

.section-more:hover {
  text-decoration: underline;
}

/* Rows inside a card */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.rows > li + li {
  border-top: 1px solid #2b303a;
}

.row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.row.drillable {
  cursor: pointer;
  border-radius: 0.35rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.row.drillable:hover {
  background: #262b35;
}

.row.drillable:focus-visible {
  outline: 2px solid #7ab8ff;
  outline-offset: -2px;
}

.row.drillable.selected {
  background: #2a3342;
  box-shadow: inset 2px 0 0 #7ab8ff;
}

.row-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.row-main strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.row-main .muted {
  overflow-wrap: anywhere;
}

.row .age {
  white-space: nowrap;
}

.new-badge {
  background: #12351c;
  border: 1px solid #2e7d32;
  border-radius: 1rem;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.new-dot {
  background: #12351c;
  border: 1px solid #2e7d32;
  border-radius: 1rem;
  padding: 0 0.5rem;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ---- Cockpit home ---- */

.cockpit-page {
  gap: 1rem;
}

.kpi-link {
  color: inherit;
  text-decoration: none;
  min-height: 4.6rem;
}

.kpi-link:hover {
  border-color: #7ab8ff;
}

.kpi-link:focus-visible {
  outline: 2px solid #7ab8ff;
  outline-offset: -2px;
}

.kpi-detail {
  font-size: 0.75rem;
}

.kpi-ok {
  border-color: #2e7d32;
}

.kpi-warning {
  border-color: #b08a00;
}

.kpi-critical {
  border-color: #b3423a;
}

.attention-panel .section-head h2,
.pulse-panel .section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.all-clear {
  margin: 0;
  color: #62c37e;
  font-weight: 600;
}

.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.alert-list > li + li {
  border-top: 1px solid #2b303a;
}

.alert-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0.4rem;
  color: inherit;
  text-decoration: none;
  border-radius: 0.35rem;
}

a.alert-row:hover {
  background: #262b35;
}

a.alert-row:focus-visible {
  outline: 2px solid #7ab8ff;
  outline-offset: -2px;
}

.alert-title {
  overflow-wrap: anywhere;
}

.sev-chip {
  border-radius: 1rem;
  padding: 0.05rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.sev-critical {
  background: #3a1d1d;
  border-color: #b3423a;
}

.sev-warning {
  background: #33301a;
  border-color: #b08a00;
}

.sev-info {
  background: #1f232b;
  border-color: #3c4250;
}

.card-lines {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.9rem;
}

.card-lines dt {
  color: #9aa0a6;
}

.card-lines dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.card-lines dd.unavailable {
  color: #6b7385;
}

.diag-meta {
  font-size: 0.95rem;
}

.sev-ok {
  background: #12351c;
  border-color: #2e7d32;
}

/* ---- Resource tables (Applications / Websites) ---- */

.table-scroll {
  overflow-x: auto;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  color: #9aa0a6;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #3c4250;
  white-space: nowrap;
}

.data-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #2b303a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table tr.drillable {
  cursor: pointer;
}

.data-table tr.drillable:hover td {
  background: #262b35;
}

.data-table tr.drillable.selected td {
  background: #2a3342;
}

.ssl-warning {
  color: #e0b74f;
}

.ssl-critical {
  color: #e2837c;
}

.drawer-section {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9aa0a6;
}

/* Slide-over detail */

/*
 * Wide: the board reflows out from under the drawer, so both stay usable and a
 * card click switches the drawer straight to that enquiry (no scrim in the way).
 * Narrow: the drawer is a true overlay with a dimming, click-to-close scrim.
 */
.drawer-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.App.page.drawer-open {
  padding-right: calc(22rem + 1.5rem);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22rem, 90vw);
  box-sizing: border-box;
  background: #22262e;
  border-left: 1px solid #3c4250;
  color: white;
  padding: 1.25rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.drawer-head p {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.drawer-close {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid #3c4250;
  border-radius: 0.35rem;
  padding: 0.1rem 0.5rem;
  cursor: pointer;
  line-height: 1.4;
}

.drawer-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.85rem;
}

.drawer-meta dt {
  color: #9aa0a6;
}

.drawer-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.drawer-message {
  margin: 0;
  background: #1a1e25;
  border: 1px solid #3c4250;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: #d7dae0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.drawer-action {
  color: #7ab8ff;
  text-decoration: none;
  font-size: 0.9rem;
}

.drawer-action:hover {
  text-decoration: underline;
}

.footer {
  margin-top: 1rem;
}

/* Teams mobile / narrow tab */

@media (max-width: 1100px) {
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cockpit {
    grid-template-columns: minmax(0, 1fr);
  }

  /* On a phone you want the exceptions first, not the tiles. */
  .cockpit-page .attention-panel {
    order: -1;
  }

  .drawer-scrim {
    display: block;
  }

  .App.page.drawer-open {
    padding-right: 1.5rem;
  }
}


/* ---- Leads (Project Acquisition) ---- */

/* Card-local pager: keeps a busy pipeline the same height as its neighbours. */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.45rem;
  border-top: 1px solid #2b303a;
  font-size: 0.85rem;
}

.pager-btn {
  font: inherit;
  font-size: 0.85rem;
  color: #7ab8ff;
  background: transparent;
  border: 1px solid #3c4250;
  border-radius: 0.35rem;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}

.pager-btn:hover:not(:disabled) {
  background: #262b35;
}

.pager-btn:disabled {
  color: #6b7385;
  cursor: default;
}

.lead-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  border-radius: 1rem;
  padding: 0.2rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  color: #c9ced6;
  background: #22262e;
  border: 1px solid #3c4250;
  cursor: pointer;
}

.filter-chip:hover {
  background: #262b35;
}

.filter-chip:focus-visible {
  outline: 2px solid #7ab8ff;
  outline-offset: 1px;
}

.filter-chip.active {
  background: #2a3342;
  border-color: #7ab8ff;
  color: white;
}

.filter-search {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-size: 0.85rem;
  color: white;
  background: #22262e;
  border: 1px solid #3c4250;
  border-radius: 0.35rem;
}

.filter-search:focus-visible {
  outline: 2px solid #7ab8ff;
  outline-offset: -1px;
}

.lead-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.tag-chip {
  border-radius: 0.75rem;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
  color: #9aa0a6;
  background: #262b35;
  border: 1px solid #343a45;
}

.drawer .lead-tags {
  margin-top: 0;
}

.drawer h3 {
  margin: 1.25rem 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.reason-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.reason-list li + li {
  margin-top: 0.2rem;
}
