:root {
  color-scheme: dark;
  --bg: #0c1f35;
  --surface: #17385c;
  --surface-alt: #1d416a;
  --surface-muted: #1a3d64;
  --surface-soft: #25507f;
  --line: #5a7ca2;
  --line-strong: #7d9fc3;
  --text: #eef4fb;
  --muted: #b5c6d8;
  --blue-soft: #78bbff;
  --green: #7cff00;
  --green-dark: #63cf00;
  --field-bg: #dde6ef;
  --field-bg-soft: #d5e0eb;
  --field-text: #1f3144;
  --warning: #ffd972;
  --danger: #f1a1a1;
}

* { box-sizing: border-box; }
html { background: var(--bg); }

body {
  margin: 0;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

a { color: #d7e6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { min-height: 100vh; background: var(--bg); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 210px;
  padding: 0.85rem 0.7rem;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 40;
}

.brand {
  padding: 0.35rem 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line);
}

.brand__logo {
  display: block;
  width: fit-content;
  margin-bottom: 0.55rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line-strong);
  background: #ffffff;
}

.brand__logo img {
  display: block;
  height: 22px;
  width: auto;
}

.brand__name {
  display: block;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
}

.brand__sub {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-group {
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.sidebar-group__title {
  padding: 0.15rem 0.5rem 0.35rem;
  color: #bfd1e3;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.sidebar-link {
  display: block;
  padding: 0.55rem 0.6rem;
  color: #dce8f6;
  border: 1px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  text-decoration: none;
}

.sidebar-link.is-active {
  color: #ffffff;
  font-weight: 700;
  border-left: 4px solid var(--green);
  padding-left: 0.45rem;
}

.sidebar-meta {
  margin-top: auto;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.shell-main {
  position: relative;
  margin-left: 210px;
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  padding: 3.1rem 1.3rem 1.3rem 1.25rem;
}

/* Plain text in the normal document flow: scrolls with the page, no frame. */
.app-clock {
  padding: 0.85rem 1.3rem 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  text-align: right;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: #9db4cf;
  font-size: 0.75rem;
  text-transform: uppercase;
}

h1, h2 { margin: 0; color: #ffffff; }
.section-header h1 { font-size: 1.95rem; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.stat-box,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
}

.stat-box {
  padding: 0.75rem 0.85rem;
  border-top: 3px solid var(--green);
}

.stat-box span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-box strong {
  color: var(--blue-soft);
  font-size: 1.7rem;
}

.panel { margin-bottom: 1rem; }

.panel-heading {
  padding: 0.62rem 0.8rem;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid var(--green);
  background: var(--surface-muted);
}

.panel-heading h2 { font-size: 1rem; }
.panel-body { padding: 0.85rem 0.95rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem 1.05rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.board-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.board-controls select {
  width: 170px;
}

.sort-link {
  color: #d0deec;
  text-decoration: none;
}

.sort-link:hover,
.sort-link.is-active {
  color: #ffffff;
  text-decoration: underline;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

th,
td {
  padding: 0.56rem 0.62rem;
  border-bottom: 1px solid #44698f;
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--surface-alt);
  color: #d0deec;
  font-size: 0.75rem;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:nth-child(even) { background: var(--surface-alt); }
tbody tr:hover { background: var(--surface-soft); }
tbody tr.is-urgent {
  background: #5b1f2d;
}
tbody tr.is-urgent:hover {
  background: #70303e;
}
tbody tr.is-urgent td:first-child {
  border-left: 4px solid var(--danger);
}

.cell-primary {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

/* Whole-row click target ("stretched link" pattern): the job-id cell holds
   a real <a> whose ::after is absolutely positioned against the row (the
   nearest `position` ancestor) and stretched to cover it — no JS needed.
   Note .row-link itself must stay position:static so its ::after's
   containing block is the *row*, not just the link text. Other in-row
   links (interpreter name, etc.) get position:relative + z-index so they
   stay independently clickable above the stretched overlay. */
tr.job-row { position: relative; cursor: pointer; }

tr.job-row .row-link {
  color: inherit;
  font-weight: 700;
}

tr.job-row .row-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

tr.job-row a:not(.row-link) {
  position: relative;
  z-index: 1;
}

.status-label,
.tag {
  display: inline-block;
  min-width: 78px;
  padding: 0.18rem 0.35rem;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--text);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-label.assigned {
  border-color: #79b55a;
  color: #ddffd0;
}

.status-label.unassigned,
.result-box.rejected .result-state {
  border-color: #c97b7b;
  color: var(--danger);
}

.tag.sworn {
  min-width: 0;
  margin-left: 0.35rem;
  border-color: #6a99ce;
  color: #d7e6ff;
}

.tag.onsite,
.tag.remote { min-width: 66px; }

.coverage-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: default;
}

/* Signal-strength / battery style gauge: N bars of increasing height,
   "lit" up to the coverage count. Reads at a glance like a phone signal
   icon, which is the point — the exact number is in .coverage-count next
   to it for anyone who wants precision. */
.coverage-gauge {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 15px;
}

.coverage-gauge__bar {
  display: inline-block;
  width: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface-muted);
}

.coverage-gauge__bar:nth-child(1) { height: 6px; }
.coverage-gauge__bar:nth-child(2) { height: 10px; }
.coverage-gauge__bar:nth-child(3) { height: 15px; }
.coverage-gauge__bar:nth-child(n+4) { height: 15px; }

.coverage-gauge.level-low .coverage-gauge__bar.is-lit {
  background: var(--danger);
  border-color: var(--danger);
}

.coverage-gauge.level-mid .coverage-gauge__bar.is-lit {
  background: var(--warning);
  border-color: #c59b29;
}

.coverage-gauge.level-good .coverage-gauge__bar.is-lit {
  background: var(--green);
  border-color: #4da400;
}

.coverage-gauge.level-empty .coverage-gauge__bar,
.coverage-gauge.level-none .coverage-gauge__bar {
  background: repeating-linear-gradient(45deg, var(--surface-muted), var(--surface-muted) 3px, var(--surface-alt) 3px, var(--surface-alt) 6px);
}

.coverage-count {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.reasons {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.detail-list div {
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--surface-muted);
}

.detail-list dt {
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-list dd {
  margin: 0;
  color: var(--text);
}

.result-box {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.result-box .result-state {
  display: block;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--blue-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.result-box.accepted .result-state { color: #ddffd0; }
.result-box.warning .result-state { color: var(--warning); }

.result-box ul,
.result-box p {
  margin: 0;
  padding: 0.7rem 0.9rem 0.75rem 1.6rem;
}

.planner-questions {
  margin-top: 0.8rem;
  border: 1px solid #c59b29;
  background: #2b3b4f;
}

.planner-questions__title {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #c59b29;
  color: var(--warning);
  font-weight: 700;
}

.planner-questions ul {
  margin: 0;
  padding: 0.7rem 0.9rem 0.75rem 1.6rem;
  color: var(--text);
}

.blacklist-form {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(220px, 1fr);
  gap: 12px;
  margin-top: 14px;
  align-items: end;
}

.blacklist-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blacklist-form .field-wide {
  grid-column: 1 / -1;
}

.blacklist-form button {
  justify-self: start;
}

form.inline { display: inline-block; }

.admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.import-form {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
}

.import-form button {
  white-space: nowrap;
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  width: 300px;
  height: 34px;
  min-width: 300px;
  border: 1px solid #637d9b;
  background: var(--field-bg);
  color: var(--field-text);
  overflow: hidden;
}

.file-trigger {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  flex: 0 0 auto;
  padding: 0 0.55rem;
  border-right: 1px solid #8fa0b0;
  background: #6f7479;
  color: #ffffff;
  cursor: pointer;
  white-space: nowrap;
}

.file-name {
  display: block;
  min-width: 0;
  padding: 0 0.45rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
}

/* Settings tab / admin create-edit forms: a simple responsive field grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.6rem;
}

.settings-field label {
  display: block;
  margin-bottom: 0.22rem;
  color: #dbe8f5;
  font-size: 0.77rem;
  font-weight: 700;
}

.settings-field input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.settings-field input[readonly] {
  background: var(--surface-alt);
  color: var(--muted);
}

.availability-heading {
  margin: 1rem -1.1rem 0.9rem;
}

label span {
  display: block;
  margin-bottom: 0.22rem;
  color: #dbe8f5;
  font-size: 0.77rem;
  font-weight: 700;
}

input, select, button { font: inherit; }

input:not([type="hidden"]),
select,
button {
  border: 1px solid #637d9b;
  border-radius: 0;
  min-height: 34px;
  padding: 0.46rem 0.58rem;
}

input:not([type="hidden"]),
select {
  width: 100%;
  background: var(--field-bg);
  color: var(--field-text);
}

input:not([type="hidden"]):hover,
select:hover {
  border-color: var(--blue-soft);
  background: var(--field-bg-soft);
}

input:not([type="hidden"]):focus,
select:focus,
button:focus-visible {
  outline: none;
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(124, 255, 0, 0.22);
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 34px;
  border: 1px solid #4da400;
  border-radius: 0;
  padding: 0.46rem 0.8rem;
  background: var(--green);
  color: #102600;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: var(--green-dark);
  color: #091500;
  text-decoration: none;
}

button.secondary,
.button-link.secondary {
  border-color: var(--line-strong);
  background: var(--surface-alt);
  color: var(--text);
}

button.secondary:hover,
.button-link.secondary:hover {
  background: var(--surface-soft);
  color: #ffffff;
}

button.warn-confirm {
  border-color: #c59b29;
  background: var(--warning);
  color: #342500;
}

button.danger-button,
.button-link.danger-button {
  border-color: #a94444;
  background: #8f3030;
  color: #ffffff;
}

button.danger-button:hover,
.button-link.danger-button:hover {
  background: #a94444;
  color: #ffffff;
  text-decoration: none;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: #d7e6ff;
}

.tag.source-auto {
  min-width: 0;
  margin-left: 0.35rem;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-weight: 400;
}

.tag.source-manual {
  min-width: 0;
  margin-left: 0.35rem;
  border-color: #6a99ce;
  color: #d7e6ff;
}

.tag.source-auto_confirmed {
  min-width: 0;
  margin-left: 0.35rem;
  border-color: #79b55a;
  color: #ddffd0;
}

/* Status column: interpreter name on the left, status tag flush right —
   one row, no wrapping between them. */
.status-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 345px;
}

.status-cell .status-label {
  flex: 0 0 190px;
  max-width: 190px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-cell .tag {
  flex: 0 0 145px;
  min-width: 145px;
  margin-left: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* "What do we have here" summary at the top of the job-detail page */
.situation {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  background: var(--surface);
  padding: 0.75rem 0.95rem;
  margin-bottom: 1rem;
}

.situation.is-ok { border-left-color: #79b55a; }
.situation.is-open { border-left-color: var(--warning); }

.situation__status { font-weight: 700; color: #ffffff; }

.situation__reasons {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.situation__suggestion {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
}

.tag.result-ok { border-color: #79b55a; color: #ddffd0; }
.tag.result-warning { border-color: #c59b29; color: var(--warning); }

/* Qualified-candidate table on the job-detail page */
.candidate-table td { vertical-align: middle; }

.candidate-name { font-weight: 700; }

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 0.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--blue-soft);
  font-size: 0.7rem;
  font-style: italic;
  font-weight: 700;
  cursor: help;
}

tr.is-checked { background: var(--surface-soft); }

.tag.rel-good { border-color: #79b55a; color: #ddffd0; }
.tag.rel-bad { border-color: #c97b7b; color: var(--danger); }
.status-label.urgent,
.tag.urgent-tag {
  border-color: #ffb2b2;
  color: #ffd6d6;
  font-weight: 700;
}

.outcome-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .stats-row,
  .detail-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .shell-main { margin-left: 0; }
  .page { padding: 1rem; }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .blacklist-form,
  .field-row { grid-template-columns: 1fr; }
}
