:root {
  /* Company palette. Tints keep secondary surfaces and text readable. */
  --brand-cyan: #5ce1e6;
  --brand-blue: #004aad;
  --white: #ffffff;
  --bg: #f3f9ff;
  --ink: #12345b;
  --muted: #536e8b;
  --line: #d8e6f5;
  --accent-soft: #e6fafb;
  --font: Inter, Segoe UI, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px var(--font);
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
  outline-color: var(--brand-blue);
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
.sidebar {
  width: 228px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--brand-blue);
  color: var(--white);
  border-right: 1px solid var(--line);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  transition: width 180ms ease, padding 180ms ease;
  z-index: 5;
}
.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: -13px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--brand-cyan);
  border-radius: 50%;
  background: var(--white);
  color: var(--brand-blue);
  font-size: 21px;
  line-height: 1;
  padding: 0 0 2px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 29px;
  color: var(--brand-cyan);
  margin: 0 5px 55px;
}
.brand span {
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.7px;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.7px;
  color: var(--brand-cyan);
  margin-top: 7px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #c6ddfa;
  margin: 0 14px 16px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 8px;
  color: var(--white);
  margin-bottom: 6px;
  font-weight: 500;
}
.nav-icon {
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
}
.nav:hover {
  background: #ffffff1a;
}
.nav.active {
  background: var(--brand-cyan);
  color: var(--brand-blue);
  font-weight: 600;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #ffffff33;
  padding: 24px 4px 0;
  font-size: 11px;
}
.sidebar-bottom p {
  color: var(--white);
  margin: 10px 0;
}
.sidebar-bottom small {
  color: #c6ddfa;
}
main {
  margin-left: 228px;
  transition: margin-left 180ms ease;
}
body.sidebar-collapsed .sidebar {
  width: 72px;
  padding-left: 12px;
  padding-right: 12px;
}
body.sidebar-collapsed main {
  margin-left: 72px;
}
body.sidebar-collapsed .brand {
  justify-content: center;
  margin-left: 0;
  margin-right: 0;
}
body.sidebar-collapsed .brand span,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .sidebar-copy {
  display: none;
}
body.sidebar-collapsed .nav {
  justify-content: center;
  padding-left: 13px;
  padding-right: 13px;
}
body.sidebar-collapsed .sidebar-bottom {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}
header {
  height: 75px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  box-shadow: inset 0 3px var(--brand-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  font-size: 12px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-right form {
  margin: 0;
}
.text-button {
  border: 0;
  background: none;
  color: var(--muted);
}
.page {
  max-width: 1550px;
  margin: auto;
  padding: 32px 38px;
}
.muted,
p {
  color: var(--muted);
}
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 30px;
}
.eyebrow {
  color: var(--brand-blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
}
h1 {
  color: var(--brand-blue);
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 650;
  margin: 10px 0;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.35px;
  margin: 0;
}
p {
  line-height: 1.6;
  margin: 8px 0;
}
.live {
  font-size: 11px;
  color: var(--muted);
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--brand-cyan);
  box-shadow: 0 0 0 1px var(--brand-blue);
  border-radius: 50%;
  margin-right: 5px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin-bottom: 32px;
}
.metrics article {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-cyan);
  border-radius: 11px;
  padding: 21px;
}
.metrics article > span {
  font-size: 12px;
  color: var(--muted);
}
.metrics strong {
  color: var(--brand-blue);
  display: block;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 14px 0 8px;
}
.metrics small {
  font-size: 10px;
  color: var(--muted);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 17px;
}
.section-heading > .muted {
  font-size: 11px;
}
.section-heading p {
  font-size: 11px;
  margin-top: 6px;
}
.count {
  font-size: 10px;
  color: var(--brand-blue);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  vertical-align: middle;
  margin-left: 6px;
}
.workers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 17px;
  margin-bottom: 30px;
}
.worker {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.worker-status, .sim-name {
  display: flex;
  align-items: center;
  gap: 6px;
}
.worker-status { flex-shrink: 0; }
.sim-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.signal-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 17px;
  flex-shrink: 0;
}
.signal-bars i {
  display: block;
  width: 3px;
  background: #d2e1e8;
  border-radius: 1px;
}
.signal-bars i:nth-child(1) { height: 4px; }
.signal-bars i:nth-child(2) { height: 8px; }
.signal-bars i:nth-child(3) { height: 12px; }
.signal-bars i:nth-child(4) { height: 16px; }
.signal-bars i.filled { background: var(--brand-blue); }
.signal-bars:focus-visible { outline: 2px solid var(--brand-cyan); outline-offset: 3px; }
.worker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 11px;
  gap: 8px;
}
.worker-name {
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 650;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}
.worker-name:hover {
  color: var(--brand-blue);
  text-decoration: underline;
}
.worker-id {
  font: 10px monospace;
  color: var(--muted);
  margin: 0 18px 12px;
  overflow-wrap: anywhere;
}
.badge {
  display: inline-block;
  white-space: nowrap;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 5px;
  background: #edf3fa;
  color: var(--muted);
}
.badge.online,
.badge.completed {
  background: var(--brand-cyan);
  color: var(--brand-blue);
}
.badge.running,
.badge.queued {
  background: var(--brand-blue);
  color: var(--white);
}
.badge.error,
.badge.rejected,
.badge.timeout,
.badge.unknown {
  background: #fff1e8;
  color: #b56832;
}
.sim {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.worker-sims {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.worker-sims .sim:nth-child(even) {
  border-left: 1px solid var(--line);
}
.sim-name {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}
.sim > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.quick-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.sim-readings {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.sms-compose {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.sms-compose label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}
.sms-compose input,
.sms-compose textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 8px;
  font: 11px var(--font);
}
.sms-compose textarea {
  resize: vertical;
  min-height: 65px;
  line-height: 1.4;
}
.sms-compose input:focus,
.sms-compose textarea:focus {
  border-color: var(--brand-blue);
  outline: 2px solid var(--accent-soft);
}
.sms-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sms-compose-footer small {
  color: var(--muted);
  font-size: 9px;
}
.sim .sms-send {
  background: var(--brand-blue);
  color: var(--white);
  padding: 8px 12px;
}
.sim .sms-send:hover { background: #003b8a; }
.command-message {
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--brand-cyan);
  background: var(--bg);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sim-reading {
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow-wrap: anywhere;
  min-width: 0;
}
.reading-heading > span,
.sim-reading small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 6px;
}
.sim-reading strong {
  display: block;
  color: var(--brand-blue);
  font-size: 13px;
  margin-bottom: 8px;
}
.sim-reading details {
  font-size: 10px;
}
.reading-response {
  white-space: pre-wrap;
  line-height: 1.5;
  margin-top: 8px;
}
.quick-actions .control {
  flex: 1;
  background: var(--accent-soft);
}
.quick-actions .control:hover {
  background: var(--brand-cyan);
}
.sim-number {
  font-size: 13px;
  font-weight: 600;
}
.sim-details {
  font-size: 10px;
  color: var(--muted);
  margin-top: 7px;
}
.sim .control {
  align-self: center;
  border: 1px solid var(--brand-blue);
  border-radius: 6px;
  background: var(--white);
  font-size: 10px;
  padding: 7px 10px;
  color: var(--brand-blue);
}
.control:hover {
  background: var(--brand-cyan);
}
.reading-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 30px;
  margin-bottom: 6px;
}
.reading-heading > span { margin-bottom: 0; }
.sim .reading-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 30px;
  min-height: 30px;
  padding: 5px;
  background: var(--accent-soft);
}
.reading-timer { font-variant-numeric: tabular-nums; }
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.worker-foot {
  background: var(--bg);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.panel {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  padding: 23px;
  margin: 0 0 24px;
  scroll-margin-top: 20px;
}
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
input,
select {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  padding: 11px 12px;
  color: var(--ink);
  font-size: 12px;
  min-width: 0;
}
input::placeholder {
  color: var(--muted);
}
.filters input {
  flex: 1;
}
.filters select {
  max-width: 220px;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--brand-blue);
  text-align: left;
  font-weight: 500;
  background: var(--accent-soft);
  padding: 12px;
}
td {
  padding: 16px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
td:first-child {
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
}
.message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 160px;
  line-height: 1.6;
}
.multipart-note {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--brand-blue);
  font-size: 9px;
  font-weight: 600;
}
.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  grid-column: 1/-1;
}
.command {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.command-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.command-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 7px;
}
.command-response {
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  margin: 10px 0;
}
.command details {
  font-size: 10px;
  color: var(--muted);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  padding: 12px;
  border-radius: 6px;
}
footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  margin-top: 32px;
}
dialog {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 28px;
  width: min(480px, calc(100% - 30px));
  box-shadow: 0 25px 100px #004aad26;
}
dialog::backdrop {
  background: #004aad65;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-heading h2 {
  margin-top: 8px;
}
.icon-button {
  border: 0;
  background: none;
  font-size: 25px;
  color: var(--muted);
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 20px 0 0;
}
label input,
label select {
  display: block;
  width: 100%;
  margin-top: 8px;
  font-weight: 400;
}
.primary {
  background: var(--brand-blue);
  border: 0;
  border-radius: 7px;
  color: var(--white);
  padding: 12px 16px;
  font-weight: 600;
  width: 100%;
  margin-top: 17px;
  display: flex;
  justify-content: space-between;
}
.primary:hover {
  background: var(--brand-cyan);
  color: var(--brand-blue);
}
.help {
  font-size: 11px;
  margin-top: 17px;
}
#form-error,
.error {
  color: #b44935;
  font-size: 12px;
}
#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: var(--brand-blue);
  color: var(--white);
  border-left: 4px solid var(--brand-cyan);
  padding: 16px 22px;
  border-radius: 9px;
  box-shadow: 0 5px 25px #0002;
  max-width: 380px;
  font-size: 12px;
  z-index: 10;
}
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--brand-blue);
}
.login-card {
  width: min(420px, 90%);
  padding: 35px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 5px solid var(--brand-cyan);
  border-radius: 15px;
}
.login-card h1 {
  font-size: 28px;
}
.login-card p {
  font-size: 12px;
}
@media (max-width: 1150px) {
  .sidebar {
    width: 195px;
  }
  main {
    margin-left: 195px;
  }
  .page {
    padding: 25px;
  }
  .metrics {
    gap: 10px;
  }
  .metrics article {
    padding: 16px;
  }
}
@media (max-width: 780px) {
  .sidebar {
    display: none;
  }
  main {
    margin-left: 0;
  }
  header {
    padding: 0 20px;
    height: 60px;
  }
  .page {
    padding: 20px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-title {
    align-items: flex-start;
  }
  .live {
    display: none;
  }
  h1 {
    font-size: 25px;
  }
  .section-heading > .muted {
    display: none;
  }
  .filters {
    flex-wrap: wrap;
  }
  .filters input {
    flex-basis: 100%;
  }
  .filters select {
    flex: 1;
    max-width: none;
  }
  .panel {
    padding: 17px;
  }
  .worker-sims .sim {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    padding: 12px 10px;
  }
  .worker-sims .sim-readings {
    grid-template-columns: minmax(0, 1fr);
  }
  .worker-sims .sim-controls {
    justify-content: flex-start;
  }
  .worker-sims .sim .control {
    padding: 6px 7px;
  }
}
@media (max-width: 520px) {
  .page-title p {
    font-size: 12px;
  }
  .command-title {
    align-items: flex-start;
  }
  footer span {
    display: none;
  }
}
