* {
  box-sizing: border-box;
}

:root {
  --green-dark: #0f6b4d;
  --green-mid: #2d8c65;
  --green-soft: #e9f6ef;
  --green-soft-strong: #d6f0e2;
  --text-ink: #12345a;
  --card-border: #d9e4f2;
  --surface: #fff;
  color: var(--text-ink);
  background: var(--surface);
  font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--surface);
}

.page-header {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 110px;
  padding: 18px max(24px, calc((100vw - 1424px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 4px 16px rgba(18, 52, 90, 0.06);
}

.page-logo {
  width: 150px;
  height: auto;
  object-fit: contain;
}

.page-header h1,
.page-header p,
.section-heading h2,
.section-heading p {
  margin: 0;
}

.page-header h1 {
  color: var(--green-dark);
  font-size: clamp(22px, 3vw, 32px);
}

.page-header p,
.section-heading p {
  margin-top: 5px;
  color: #58708d;
  font-size: 14px;
}

#connectionStatus {
  margin-top: 4px;
  color: #58708d;
  font-size: 12px;
}

#connectionStatus.error {
  color: #b42318;
}

.location-picker {
  display: grid;
  gap: 6px;
  min-width: 190px;
  margin-left: auto;
  color: var(--text-ink);
  font-size: 13px;
  font-weight: 700;
}

.location-picker select {
  min-height: 42px;
  padding: 8px 34px 8px 12px;
  border: 1px solid #c8d8eb;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-ink);
  font: inherit;
}

.location-picker select:focus,
.seat-card input:focus {
  outline: 2px solid rgba(89, 184, 129, 0.5);
  outline-offset: 1px;
}

main {
  padding: 28px 24px 48px;
}

.seat-manager-card {
  width: 100%;
  max-width: 1424px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid #d9e4f2;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(18, 52, 90, 0.07);
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  color: var(--green-dark);
  font-size: 21px;
}

.seat-manager-inputs-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  align-items: start;
  gap: 20px;
}

.seat-manager-extra-field {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.seat-manager-extra-field textarea {
  width: 100%;
  min-height: 96px;
  padding: 8px 10px;
  border: 1px solid #c5d1df;
  border-radius: 6px;
  color: #12345a;
  font: inherit;
  resize: vertical;
}

.seat-manager-parser-status {
  min-height: 1em;
  margin: 0;
  color: #0f6b4d;
  font-size: 12px;
  font-weight: 600;
}

.seat-manager-run {
  justify-self: start;
  background: var(--green-dark);
}

.seat-manager-bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.seat-manager-bulk-actions button {
  min-width: 150px;
}

.seat-manager-bulk-actions .seat-manager-run {
  min-width: 0;
}

.seat-manager-parser-status.error {
  color: #a52e34;
}

.seat-table-scroll {
  width: 100%;
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid #d9e4f2;
  border-radius: 10px;
}

.seat-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.seat-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.seat-table thead th {
  padding: 12px 10px;
  border-bottom: 2px solid var(--green-dark);
  background: #e9f6ef;
  color: var(--green-dark);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.seat-table tbody th,
.seat-table tbody td {
  padding: 8px;
  border-bottom: 1px solid #d9e4f2;
  text-align: left;
  vertical-align: middle;
}

.seat-table tbody tr:last-child th,
.seat-table tbody tr:last-child td {
  border-bottom: 0;
}

.seat-table tbody tr:nth-child(even) {
  background: #f8fbfd;
}

.seat-table .seat-card h3 {
  white-space: nowrap;
}

.seat-table .seat-card input,
.seat-table .seat-assessment-select,
.seat-table .seat-card button {
  width: 100%;
  min-width: 112px;
}

.seat-table .seat-card .seat-id-input {
  min-width: 220px;
  text-align: left;
}

.seat-table .seat-testing-cell,
.seat-table .seat-result-cell,
.seat-table .seat-clear-cell {
  min-width: 130px;
}

.seat-card h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 14px;
  text-align: center;
}

.seat-card input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px;
  border: 1px solid #c5d1df;
  border-radius: 6px;
  background: #fff;
  color: #12345a;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.seat-card input::placeholder {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  opacity: 1;
}

.seat-assessment-select {
  width: 100%;
  min-height: 38px;
  padding: 8px;
  border: 1px solid #c5d1df;
  border-radius: 6px;
  background: #fff;
  color: #12345a;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.seat-assessment-select.passed {
  border-color: #9bcfb2;
  background: #dff3e7;
  color: #0f6b4d;
}

.seat-assessment-select.failed {
  border-color: #e4a0a0;
  background: #fde4e4;
  color: #a52e34;
}

.seat-call-button,
.seat-testing-call-button,
.seat-clear-button,
.seat-manager-action {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.seat-call-button {
  border: 1px solid #e8cf76;
  background: #fff4c2;
  color: #6b5600;
}

.seat-testing-call-button {
  border: 1px solid #9cc9ed;
  background: #dceeff;
  color: #12558b;
}

.seat-testing-call-button:hover:not(:disabled) {
  background: #c9e4fa;
}

.seat-testing-call-button.called {
  border-color: #12558b;
  background: #e8f3fb;
  color: #12558b;
}

.seat-testing-call-button:disabled {
  cursor: wait;
  opacity: .65;
}

.seat-clear-button {
  border: 1px solid #c83d42;
  background: #fff;
  color: #a52e34;
}

.seat-clear-button:hover:not(:disabled) {
  background: #fff0f0;
}

.seat-clear-button:disabled {
  cursor: wait;
  opacity: .65;
}

.seat-call-button:hover {
  background: #ffec9e;
}

.seat-call-button.called {
  border-color: #c8a83a;
  background: #ffe58a;
  color: #5c4900;
}

.seat-manager-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.seat-manager-action {
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 11px;
}

.clear-data-action {
  background: #c83d42;
}

.view-display-action {
  background: var(--green-mid);
}

.view-seat-call-display-action {
  background: #3f4348;
}

.assessment-level-action {
  background: var(--green-dark);
}

.sourcing-announcement-action {
  background: #1769aa;
}

.custom-announcement-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.custom-announcement-form label {
  color: var(--text-ink);
  font-size: 13px;
  font-weight: 700;
}

.custom-announcement-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: 8px 10px;
  border: 1px solid #c8d8eb;
  border-radius: 7px;
  color: var(--text-ink);
  font: inherit;
  font-size: 13px;
  resize: vertical;
}

.custom-announcement-form textarea:focus {
  outline: 2px solid rgba(89, 184, 129, 0.5);
  outline-offset: 1px;
}

.custom-announcement-action {
  background: var(--green-mid);
  justify-self: start;
}

.seat-manager-action:hover {
  filter: brightness(0.92);
}

@media (max-width: 720px) {
  .page-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
  }

  .page-logo {
    width: 110px;
  }

  .location-picker {
    flex: 1 1 100%;
    margin-left: 0;
  }

  main {
    padding: 20px 14px 32px;
  }

  .seat-manager-inputs-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
