:root {
  --ink: #152434;
  --muted: #627381;
  --line: #d8e0e6;
  --panel: #ffffff;
  --page: #f3f6f8;
  --navy: #102536;
  --navy-2: #183c55;
  --gold: #d7a33e;
  --gold-dark: #a96910;
  --blue: #24617e;
  --blue-dark: #183f58;
  --green: #237a57;
  --red: #b4443f;
  --shadow: 0 18px 42px rgba(23, 33, 43, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(16, 37, 54, 0.05), rgba(16, 37, 54, 0) 240px),
    var(--page);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--gold);
  color: var(--navy);
}

.brand span {
  display: block;
  color: #b9c8d3;
  margin-top: 3px;
  font-size: 13px;
}

.office-card {
  border: 1px solid rgba(215, 163, 62, 0.45);
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.office-card span {
  display: block;
  color: #c6d4dd;
  font-size: 12px;
  text-transform: uppercase;
}

.office-card strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  line-height: 1.35;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  text-align: left;
  color: #d9e6ee;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--navy-2);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}

.main {
  padding: 28px;
  overflow: hidden;
}

.topbar,
.section-heading,
.status-strip,
.filter-row,
.call-controls {
  display: flex;
  align-items: center;
}

.topbar,
.section-heading {
  justify-content: space-between;
  gap: 18px;
}

.topbar h1,
.section-heading h2,
.panel h3 {
  margin: 0;
}

.topbar h1 {
  font-size: 32px;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-copy {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.topbar-actions,
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
}

.icon-button {
  width: 42px;
  height: 42px;
  background: #e7eef3;
  color: var(--blue-dark);
}

.primary-button {
  min-height: 42px;
  padding: 0 16px;
  background: var(--navy-2);
  color: #fff;
}

.primary-button:hover {
  background: var(--navy);
}

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  background: #e7eef3;
  color: var(--navy);
}

.secondary-button:hover {
  background: #d8e5ec;
}

.status-strip {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.status-strip > div,
.analytics-card,
.panel,
.table-wrap,
.search-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-strip > div {
  padding: 16px;
  border-top: 4px solid var(--gold);
}

.metric {
  display: block;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--navy);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-card {
  padding: 16px;
  border-top: 4px solid var(--gold);
}

.analytics-card span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.analytics-table {
  margin-top: 16px;
}

.momentum-bar {
  height: 9px;
  min-width: 100px;
  border-radius: 999px;
  background: #e7eef3;
  overflow: hidden;
}

.momentum-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  background: #f7fafb;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.high {
  background: #f9dddd;
  color: var(--red);
}

.badge.medium {
  background: #fff0d2;
  color: var(--gold);
}

.badge.good {
  background: #dff2ea;
  color: var(--green);
}

.badge.review {
  background: #e7eef3;
  color: var(--blue-dark);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 16px;
}

.two-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.panel,
.search-panel {
  padding: 18px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

.result-panel {
  min-height: 220px;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
}

.kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 14px;
  margin: 16px 0;
}

.kv strong {
  color: var(--muted);
}

.kv span {
  white-space: pre-line;
}

.notice {
  border-left: 4px solid var(--gold);
  background: #fff8e8;
  padding: 12px;
  margin-top: 12px;
}

.queue-notice {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.call-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.voice-setup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.compact-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.mono {
  font-family: Consolas, Monaco, monospace;
  word-break: break-all;
  color: var(--navy);
  background: #f7fafb;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 7px;
}

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

.voice-table {
  margin-top: 14px;
  box-shadow: none;
}

.voice-status {
  min-height: 0;
  margin-top: 14px;
  box-shadow: none;
}

.call-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.call-item h3 {
  margin: 0 0 6px;
}

.call-item p {
  margin: 0;
  color: var(--muted);
}

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

  .sidebar {
    position: static;
  }

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

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip,
  .analytics-grid,
  .voice-setup,
  .two-column,
  .two-field-row,
  .search-panel {
    grid-template-columns: 1fr;
  }
}
