:root {
  --ink: #172026;
  --muted: #65727c;
  --line: #d8e0e4;
  --paper: #fbfcfb;
  --panel: #ffffff;
  --mint: #d7f0df;
  --mint-strong: #23704b;
  --coral: #e86d57;
  --amber: #f5c456;
  --blue: #326f9e;
  --shadow: 0 10px 26px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  display: grid;
  min-height: 230px;
  overflow: hidden;
  background: #10181d;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 24, 29, 0.9), rgba(16, 24, 29, 0.7)),
    url("assets/shift-hero.png");
  background-position: center;
  background-size: cover;
  filter: saturate(0.72);
}

.hero-content {
  position: relative;
  width: min(1080px, calc(100% - 32px));
  margin: auto;
  padding: 42px 0;
  color: #fff;
}

.eyebrow,
.kicker {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker {
  color: var(--mint-strong);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.1rem;
  line-height: 1.6;
}

.workspace {
  width: min(1080px, calc(100% - 32px));
  margin: 24px auto 64px;
  position: relative;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.tab {
  min-width: 92px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.active {
  color: #fff;
  background: var(--ink);
}

.view {
  display: none;
  padding-top: 28px;
}

.view.active {
  display: block;
}

[hidden] {
  display: none !important;
}

.bidder-mode .tabs {
  display: none;
}

.section-heading,
.panel-title-row,
.actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

h2 {
  margin-bottom: 0;
  font-size: 1.8rem;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.week-label,
.message,
.team-note,
.panel-note {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
  overflow-wrap: anywhere;
}

.week-label,
.message {
  text-align: right;
}

.team-note {
  margin-top: 10px;
  line-height: 1.5;
  text-align: left;
}

.panel-note {
  margin: 10px 0 14px;
  line-height: 1.45;
  text-align: left;
}

.panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.compact {
  max-width: 760px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(50, 111, 158, 0.18);
  border-color: var(--blue);
}

.primary,
.secondary,
.ghost {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 900;
}

.primary {
  color: #fff;
  background: var(--mint-strong);
}

.secondary {
  color: #fff;
  background: var(--blue);
}

.ghost {
  color: var(--ink);
  background: var(--mint);
}

.full {
  width: 100%;
  margin-top: 12px;
}

.shift-list,
.bid-grid,
.admin-list,
.results-list,
.missing-list,
.scheduler-results {
  display: grid;
  gap: 10px;
}

.shift-list,
.bid-grid {
  margin: 20px 0;
}

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

.day-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.day-head,
.preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.day-head h3 {
  font-size: 1.1rem;
}

.not-available {
  display: flex;
  align-items: center;
  grid-template-columns: none;
  width: max-content;
  color: var(--ink);
}

.not-available input {
  width: 18px;
  min-height: 18px;
}

.preference-list {
  display: grid;
  gap: 8px;
}

.preference-row {
  padding: 10px;
  border-radius: 8px;
  background: #f6f8f7;
}

.rank-label {
  min-width: 112px;
}

.shift-card,
.admin-item,
.result-item,
.missing-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.subhead {
  margin-top: 16px;
}

.shift-card {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.shift-card.full {
  opacity: 0.62;
}

.shift-card input {
  width: 20px;
  min-height: 20px;
}

.shift-title {
  margin: 0;
  font-weight: 900;
}

.shift-meta,
.result-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.capacity {
  min-width: 74px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--mint-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.capacity.full {
  background: #ffe1dc;
  color: #a23c2b;
}

.count-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf3f6;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.template-sections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.template-section {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f7;
}

.template-chip {
  display: block;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
  text-align: center;
}

.template-chip:hover,
.template-chip:focus {
  color: #fff;
  background: var(--ink);
}

.shift-adjust {
  display: grid;
  grid-template-columns: 38px 42px 38px;
  align-items: center;
  gap: 6px;
}

.shift-adjust span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.adjust-shift {
  min-width: 38px;
  min-height: 38px;
  border-radius: 6px;
  color: var(--ink);
  background: var(--mint);
  font-size: 1.1rem;
  font-weight: 900;
}

.adjust-shift[data-adjust="-1"] {
  color: #a23c2b;
  background: #ffe1dc;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.submission-preview {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--muted);
  font: 0.86rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background: #f6f8f7;
  border-radius: 8px;
  padding: 12px;
}

.scheduler-panel {
  grid-column: 1 / -1;
}

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

.message-box {
  min-height: 132px;
  color: var(--ink);
  background: #f6f8f7;
}

.results-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.results-details summary {
  min-height: 48px;
  padding: 14px;
  cursor: pointer;
  font-weight: 900;
}

.details-content {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.day-warning {
  min-height: 1.2em;
  margin: -4px 0 0;
  color: #a23c2b;
  font-size: 0.86rem;
  font-weight: 800;
}

.empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero {
    min-height: 220px;
  }

  .hero-content {
    padding: 32px 0;
  }

  .workspace {
    width: min(100% - 20px, 1080px);
  }

  .section-heading,
  .actions,
  .admin-item,
  .shift-card {
    align-items: stretch;
  }

  .section-heading,
  .actions,
  .admin-item {
    flex-direction: column;
  }

  .form-grid,
  .results-layout,
  .bid-grid,
  .shift-card,
  .template-sections {
    grid-template-columns: 1fr;
  }

  .day-head,
  .preference-row {
    align-items: stretch;
    flex-direction: column;
  }

  .not-available {
    width: 100%;
  }

  .capacity {
    width: max-content;
  }

  .week-label,
  .message,
  .team-note {
    max-width: 100%;
    text-align: left;
  }
}
