:root {
  color-scheme: light;
  --ink: #201b1d;
  --muted: #6c6363;
  --line: #e5dedb;
  --paper: #fffdf9;
  --panel: #ffffff;
  --soft: #f6f1ec;
  --wine: #78213f;
  --wine-deep: #451325;
  --teal: #2f766d;
  --teal-soft: #dcebe7;
  --gold: #d8a012;
  --shadow: 0 18px 60px rgba(32, 27, 29, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  background:
    linear-gradient(120deg, rgba(47, 118, 109, 0.08), transparent 34%),
    linear-gradient(180deg, #fffdf9 0%, #f5eee8 100%);
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.auth-shell {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.auth-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(120, 33, 63, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 28px;
  margin: 0 auto;
  max-width: 620px;
  padding: clamp(24px, 7vw, 54px);
  width: min(100%, 620px);
}

.brand-row {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  align-items: center;
  background: var(--wine);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 42px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand-row strong,
.brand-row small {
  display: block;
  line-height: 1.1;
}

.brand-row small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.auth-copy {
  display: grid;
  gap: 10px;
}

.eyebrow {
  color: var(--teal);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 8vw, 58px);
  font-weight: 780;
  line-height: 0.97;
}

h2 {
  font-size: 20px;
  font-weight: 780;
  line-height: 1.15;
}

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

.auth-tabs {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 6px;
}

.auth-tabs button {
  background: transparent;
  color: var(--muted);
  min-height: 42px;
}

.auth-tabs button.active {
  background: var(--ink);
  color: #fff;
}

.auth-mode {
  display: none;
}

.auth-mode.active {
  display: grid;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.input-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 118, 109, 0.15);
  outline: none;
}

button,
.icon-link {
  align-items: center;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  text-decoration: none;
}

.auth-form button,
.primary-action {
  background: var(--wine);
  color: #fff;
  padding: 0 18px;
}

.auth-form button:hover,
.primary-action:hover {
  background: var(--wine-deep);
}

.status-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  min-height: 18px;
}

.registration-success {
  background: #f3faf7;
  border: 1px solid rgba(47, 118, 109, 0.24);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 14px;
}

.registration-success strong {
  color: #18534d;
  font-size: 16px;
}

.registration-success p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.success-actions a,
.success-actions button {
  background: #fff;
  border: 1px solid rgba(47, 118, 109, 0.24);
  color: #18534d;
  min-height: 38px;
  padding: 0 12px;
  text-decoration: none;
}

.portal-shell {
  display: grid;
  min-height: 100vh;
}

.portal-header {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(255, 253, 249, 0.88);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 36px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.icon-btn,
.icon-link {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  height: 42px;
  min-width: 42px;
  padding: 0 10px;
}

.text-btn {
  background: var(--ink);
  color: #fff;
  padding: 0 13px;
}

.portal-main {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1220px;
  padding: clamp(16px, 3vw, 34px);
  width: 100%;
}

.overview-band {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.welcome-copy {
  align-content: end;
  background:
    linear-gradient(135deg, rgba(120, 33, 63, 0.96), rgba(69, 19, 37, 0.96)),
    var(--wine);
  border-radius: var(--radius);
  color: #fff;
  display: grid;
  min-height: 260px;
  overflow: hidden;
  padding: clamp(24px, 5vw, 48px);
  position: relative;
}

.welcome-copy::after {
  background: url("../assets/clinical-pattern.svg") right bottom / 380px no-repeat;
  content: "";
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  position: absolute;
}

.welcome-copy > * {
  position: relative;
}

.welcome-copy .eyebrow {
  color: #f2c747;
}

.welcome-copy p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.55;
  margin-top: 14px;
  max-width: 680px;
}

.next-shift,
.panel,
.metric-card,
.date-card,
.booking-card,
.finance-card,
.availability-card,
.compliance-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.next-shift {
  display: grid;
  gap: 16px;
  min-height: 260px;
  padding: 22px;
}

.next-shift strong {
  display: block;
  font-size: clamp(24px, 5vw, 36px);
  line-height: 1.05;
}

.next-shift p {
  color: var(--muted);
  line-height: 1.5;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  padding: 9px 11px;
}

.pill.teal {
  background: var(--teal-soft);
  border-color: rgba(47, 118, 109, 0.22);
  color: #18534d;
}

.pill.gold {
  background: #fff6d8;
  border-color: rgba(216, 160, 18, 0.28);
  color: #6e4f00;
}

.tabbar {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px;
}

.tabbar button {
  background: transparent;
  color: var(--muted);
  min-height: 42px;
}

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

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

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

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.metric-card strong {
  font-size: 30px;
}

.onboarding-panel {
  background:
    linear-gradient(135deg, rgba(47, 118, 109, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.92);
}

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

.checklist-item {
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px;
}

.checklist-item .checkmark {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  padding: 7px 9px;
}

.checklist-item.is-done .checkmark {
  background: var(--teal-soft);
  color: #18534d;
}

.checklist-item.is-open .checkmark {
  background: #fff6d8;
  color: #6e4f00;
}

.checklist-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.checklist-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mini-action {
  align-items: center;
  align-self: center;
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  text-decoration: none;
  white-space: nowrap;
}

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

.panel {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 3vw, 22px);
}

.panel-head {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.date-strip,
.booking-list,
.availability-list,
.finance-stack,
.compliance-list {
  display: grid;
  gap: 10px;
}

.date-strip {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.date-card,
.booking-card,
.availability-card,
.finance-card,
.compliance-item {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.date-card time,
.booking-card time {
  color: var(--wine);
  font-weight: 850;
}

.date-card span,
.booking-card span,
.finance-card span,
.availability-card span,
.compliance-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.booking-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.booking-card .booking-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.link-btn {
  background: var(--teal);
  color: #fff;
  min-height: 38px;
  padding: 0 12px;
  text-decoration: none;
}

.readiness-meter {
  background: var(--soft);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.readiness-meter span {
  background: linear-gradient(90deg, var(--teal), var(--gold));
  display: block;
  height: 100%;
  width: 0%;
}

.compliance-item {
  grid-template-columns: 1fr auto;
}

.status-dot {
  align-self: start;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  padding: 7px 9px;
  text-transform: capitalize;
}

.status-dot.good {
  background: var(--teal);
}

.status-dot.warn {
  background: var(--gold);
  color: #332600;
}

.status-dot.bad {
  background: var(--wine);
}

.form-panel {
  align-content: start;
}

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

.form-grid.compact {
  gap: 10px;
}

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

.primary-action {
  justify-self: start;
  min-height: 44px;
  padding: 0 18px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  line-height: 1.5;
  padding: 18px;
}

@media (max-width: 920px) {
  .overview-band,
  .split-layout,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .next-shift,
  .welcome-copy {
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    padding: 14px;
  }

  .auth-panel {
    min-height: calc(100vh - 28px);
    padding: 22px;
  }

  .input-row,
  .form-grid,
  .booking-card {
    grid-template-columns: 1fr;
  }

  .portal-header {
    align-items: flex-start;
    display: grid;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .portal-main {
    padding: 14px;
    padding-bottom: 92px;
  }

  .tabbar {
    bottom: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: sticky;
    z-index: 8;
  }

  .welcome-copy {
    min-height: 260px;
  }

  .metric-card {
    min-height: 112px;
  }

  .onboarding-checklist,
  .checklist-item {
    grid-template-columns: 1fr;
  }

  .mini-action {
    justify-self: start;
  }
}
