:root {
  box-sizing: border-box;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  --navy: #102a43;
  --blue: #1261a0;
  --blue-dark: #0b4778;
  --blue-soft: #eaf4fc;
  --sky: #67b7e1;
  --ink: #243b53;
  --muted: #627d98;
  --line: #d9e2ec;
  --surface: #ffffff;
  --canvas: #f4f8fb;
  --warning: #8a5700;
  --warning-bg: #fff8e7;
  --danger: #a23b3b;
  --shadow: 0 12px 34px rgba(16, 42, 67, 0.09);
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -10%, rgba(103, 183, 225, 0.18), transparent 32rem),
    var(--canvas);
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(18, 97, 160, 0.35);
  outline-offset: 3px;
}

.site-header {
  border-bottom: 1px solid rgba(217, 226, 236, 0.85);
  background: rgba(255, 255, 255, 0.94);
}

.header-inner,
.page-shell,
.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), var(--sky));
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.environment-badge {
  padding: 5px 10px;
  border: 1px solid #b8d8eb;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 700;
}

.page-shell {
  min-height: calc(100vh - 140px);
  padding-block: 42px 56px;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-actions form {
  margin: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.intro-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.primary-button,
.secondary-button,
.details-button {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 9px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
}

.secondary-button,
.details-button {
  border: 1px solid #b8cfdf;
  color: var(--blue-dark);
  background: var(--surface);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--blue-dark);
}

.secondary-button:hover,
.details-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.status-panel {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.status-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6fb98f;
  box-shadow: 0 0 0 4px rgba(111, 185, 143, 0.15);
}

.status-panel.is-loading .status-indicator {
  border: 2px solid #b8d8eb;
  border-top-color: var(--blue);
  background: transparent;
  box-shadow: none;
  animation: spin 0.8s linear infinite;
}

.status-panel.is-error .status-indicator {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(162, 59, 59, 0.12);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.notice-panel {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #ecd39e;
  border-radius: 10px;
  color: var(--warning);
  background: var(--warning-bg);
}

.notice-panel h2 {
  margin: 0 0 5px;
  font-size: 14px;
}

.notice-panel ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
}

.state-card {
  padding: 44px 24px;
  border: 1px dashed #b8cfdf;
  border-radius: 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
}

.state-card h2 {
  margin: 13px 0 6px;
  color: var(--navy);
  font-size: 20px;
}

.state-card p {
  max-width: 520px;
  margin: 0 auto 18px;
  color: var(--muted);
}

.state-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: auto;
  place-items: center;
  border-radius: 50%;
  color: var(--danger);
  background: #fdecec;
  font-size: 20px;
  font-weight: 800;
}

.state-icon-empty {
  color: #277252;
  background: #e7f6ee;
}

.job-list {
  display: grid;
  gap: 16px;
}

.job-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--sky);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.job-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px 22px;
}

.job-heading {
  min-width: 0;
}

.job-number {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.job-title {
  margin: 0;
  color: var(--navy);
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.job-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 24px;
  margin-top: 17px;
}

.meta-item {
  min-width: 0;
}

.meta-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.meta-value {
  display: block;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.status-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 15px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 750;
}

.details-button {
  align-self: start;
  min-width: 112px;
}

.details-button[aria-expanded="true"] {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.job-details {
  padding: 20px 22px 24px;
  border-top: 1px solid var(--line);
  background: #f9fbfd;
}

.job-details[hidden] {
  display: none;
}

.detail-loading,
.detail-error,
.detail-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.detail-error {
  color: var(--danger);
}

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

.detail-block {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.detail-block.is-wide {
  grid-column: 1 / -1;
}

.detail-block h3 {
  margin: 0 0 7px;
  color: var(--navy);
  font-size: 13px;
}

.detail-text,
.technician-list,
.detail-notices {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-text.is-empty {
  color: var(--muted);
  font-style: italic;
}

.technician-list,
.detail-notices {
  padding-left: 19px;
}

.brief-unavailable {
  margin: 16px 0 0;
  padding: 11px 13px;
  border-radius: 8px;
  color: var(--warning);
  background: var(--warning-bg);
  font-size: 13px;
}

.site-footer {
  padding-block: 20px 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 440px);
}

.login-card {
  padding: clamp(28px, 7vw, 42px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 28px;
}

.login-card h1 {
  font-size: clamp(28px, 7vw, 36px);
}

.login-copy {
  margin: 12px 0 24px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 750;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #9fb8cc;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.login-form input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(18, 97, 160, 0.18);
}

.login-form .primary-button {
  margin-top: 8px;
}

.login-error {
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid #efc6c6;
  border-radius: 8px;
  color: var(--danger);
  background: #fff3f3;
  font-size: 13px;
}

.login-footnote {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .header-inner,
  .page-shell,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .page-shell {
    padding-block: 28px 40px;
  }

  .page-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .secondary-button {
    width: 100%;
  }

  .page-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions form,
  .page-actions form .secondary-button {
    width: 100%;
  }

  .job-summary {
    grid-template-columns: 1fr;
    padding: 17px;
  }

  .job-meta,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .details-button {
    width: 100%;
  }

  .job-details {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
