:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --bg-elevated: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #f1f6ff;
  --ink: #172033;
  --ink-strong: #0e1726;
  --muted: #68758a;
  --muted-strong: #4b5a70;
  --line: #dbe2ea;
  --line-strong: #c8d2dd;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #e9f1ff;
  --success: #0f9f77;
  --danger: #dc2626;
  --danger-soft: #fff1f1;
  --rail: #101722;
  --rail-soft: #152033;
  --rail-line: rgba(255, 255, 255, 0.12);
  --rail-muted: #a6b4c8;
  --shadow: 0 20px 52px rgba(22, 32, 51, 0.12);
  --shadow-soft: 0 12px 28px rgba(22, 32, 51, 0.09);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.18);
  --radius: 8px;
  --hour-height: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(180deg, #f8fafc 0, var(--bg) 320px);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  text-rendering: geometricPrecision;
}

body.is-dragging-shift {
  cursor: grabbing;
  user-select: none;
}

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

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.28), transparent 26%),
    linear-gradient(180deg, var(--rail) 0%, #0b111b 100%);
  border-right: 1px solid rgba(12, 18, 28, 0.95);
  color: white;
  padding: 22px 14px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 0 4px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #1d4ed8, #0f9f77);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  color: white;
  font-size: 14px;
  font-weight: 850;
}

h1 {
  color: white;
  font-size: 17px;
  font-weight: 820;
  line-height: 1.15;
}

.brand-row p {
  margin-top: 4px;
  color: var(--rail-muted);
  font-size: 12px;
  font-weight: 650;
}

.side-section {
  padding: 0 4px;
}

.side-section + .side-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rail-line);
}

.side-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.side-section h2 {
  color: #eef5ff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.count-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.sidebar .count-label {
  color: var(--rail-muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input,
select {
  height: 38px;
  padding: 0 10px;
}

input[type="color"] {
  overflow: hidden;
  padding: 3px;
}

textarea {
  resize: vertical;
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

button,
.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 13px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
  line-height: 1;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:disabled,
.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.primary,
#employee-submit {
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
  color: white;
}

.button.primary:hover,
#employee-submit:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.button.secondary,
.icon-button {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button.secondary:hover,
.icon-button:hover {
  border-color: #aebccc;
  background: var(--surface-soft);
}

.sidebar .button.secondary,
.sidebar .icon-button {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e8f1ff;
}

.sidebar .button.secondary:hover,
.sidebar .icon-button:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.5);
}

.full-width-button {
  width: 100%;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

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

.ghost-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.danger-button {
  min-height: 38px;
  border: 1px solid #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-button:hover {
  border-color: #fca5a5;
  background: #ffe7e7;
}

.danger-button.is-armed {
  border-color: #dc2626;
  background: #dc2626;
  color: white;
}

.employee-list {
  display: grid;
  gap: 3px;
  margin-top: 12px;
}

.employee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 5px 6px;
}

.employee-row:hover,
.employee-row:focus-within {
  background: rgba(255, 255, 255, 0.08);
}

.employee-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #f8fbff;
  font-size: 14px;
  font-weight: 730;
}

.employee-pill span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-swatch {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.employee-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.employee-row:hover .employee-actions,
.employee-row:focus-within .employee-actions {
  opacity: 1;
}

.mini-button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 6px;
  font-size: 12px;
  font-weight: 820;
}

.mini-button:hover {
  background: var(--surface);
  color: var(--ink);
}

.mini-button.danger {
  background: transparent;
  color: var(--danger);
}

.summary-panel dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.summary-panel dl > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.sidebar .summary-panel dl > div {
  border-color: var(--rail-line);
  background: rgba(255, 255, 255, 0.06);
}

.summary-panel dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.sidebar .summary-panel dt {
  color: var(--rail-muted);
}

.summary-panel dd {
  margin: 0;
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: 850;
}

.sidebar .summary-panel dd {
  color: white;
}

@media (hover: none) {
  .employee-actions {
    opacity: 1;
  }
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar h2 {
  color: var(--ink-strong);
  font-size: 28px;
  font-weight: 840;
  line-height: 1.1;
}

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

.today-link {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 820;
  text-decoration: none;
}

.today-link:hover {
  color: var(--accent-dark);
}

.week-range-nav,
.week-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.week-range-nav h2 {
  min-width: 0;
}

.week-picker-shell {
  position: relative;
  min-width: 0;
}

.week-range-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  padding: 1px 4px 3px;
  font: inherit;
  line-height: inherit;
  text-align: left;
}

.week-range-button span {
  min-width: 0;
}

.week-range-button:hover,
.week-range-button[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--ink-strong);
}

.week-range-caret {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.week-picker {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 30;
  width: 316px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

.week-picker[hidden] {
  display: none;
}

.week-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.week-picker-header strong {
  min-width: 0;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 840;
  text-align: center;
}

.picker-month-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.picker-month-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.week-picker-weekdays,
.week-picker-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.week-picker-weekdays {
  margin-bottom: 5px;
}

.week-picker-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.week-picker-day {
  width: 100%;
  height: 34px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 13px;
  font-weight: 760;
}

.week-picker-day:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.week-picker-day.is-muted {
  color: #9aa7bb;
}

.week-picker-day.is-this-week {
  border-color: #bfdbfe;
}

.week-picker-day.is-selected-week {
  border-color: #bfdbfe;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.week-picker-day.is-today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.copy-last-week-select {
  width: 190px;
  min-width: 170px;
  background: var(--surface);
}

.publish-status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted-strong);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.publish-status.is-published {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #047857;
}

.publish-status.has-issues {
  border-color: #facc15;
  background: #fefce8;
  color: #854d0e;
}

.week-arrow {
  width: 38px;
  padding: 0;
}

.week-arrow svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.calendar-wrap {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calendar-wrap.is-dragging .hour-cell:hover {
  background:
    linear-gradient(to bottom, transparent 0 49%, rgba(203, 213, 225, 0.5) 50%, transparent 51%),
    var(--surface);
}

.calendar-grid {
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(138px, 1fr));
  min-width: 1040px;
}

.time-header,
.day-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  border-left: 1px solid var(--line);
  padding: 0 14px;
}

.day-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-header strong {
  color: var(--ink-strong);
  font-size: 26px;
  font-weight: 860;
}

.time-column {
  grid-column: 1;
  grid-row: 2;
  background: var(--surface-soft);
}

.time-slot-label {
  display: flex;
  justify-content: flex-end;
  height: var(--hour-height);
  border-bottom: 1px solid var(--line);
  padding: 9px 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.day-column {
  position: relative;
  display: grid;
  grid-template-rows: repeat(17, var(--hour-height));
  min-height: calc(17 * var(--hour-height));
  border-left: 1px solid var(--line);
  grid-row: 2;
}

.hour-cell {
  width: 100%;
  height: var(--hour-height);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(to bottom, transparent 0 49%, rgba(203, 213, 225, 0.45) 50%, transparent 51%),
    var(--surface);
  padding: 0;
}

.hour-cell:hover {
  background: var(--accent-soft);
}

.shift-card {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--employee-color) 22%, var(--line));
  border-left: 5px solid var(--employee-color);
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--employee-color) 12%, white), #ffffff 76%);
  box-shadow: 0 11px 22px rgba(22, 32, 51, 0.09);
  cursor: grab;
  padding: 8px 9px;
  text-align: left;
  touch-action: none;
  user-select: none;
}

.shift-card:hover {
  box-shadow: 0 16px 30px rgba(22, 32, 51, 0.16);
  transform: translateY(-1px);
}

.shift-card:active {
  cursor: grabbing;
}

.shift-card.is-source-hidden {
  visibility: hidden;
}

.drag-ghost {
  position: fixed;
  z-index: 1000;
  left: auto;
  right: auto;
  margin: 0;
  opacity: 0.88;
  pointer-events: none;
  transform: rotate(-1deg);
}

.drag-placeholder {
  position: absolute;
  z-index: 1;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.08);
  pointer-events: none;
}

.drag-placeholder.is-duplicate {
  border-color: var(--success);
  background: rgba(15, 159, 119, 0.1);
}

.drag-placeholder::after {
  content: attr(data-time);
  margin: 6px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 820;
}

.drag-placeholder.is-duplicate::after {
  background: var(--success);
}

.staff-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 840;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-meta {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-dialog {
  width: min(540px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
  padding: 0;
}

.shift-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.shift-dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 760;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 760;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.employee-workspace {
  background: transparent;
}

.employee-toolbar {
  align-items: flex-end;
}

.employee-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.employee-directory-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-header h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 21px;
  font-weight: 840;
  line-height: 1.2;
}

.employee-form {
  display: grid;
  gap: 14px;
}

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

.employee-form-grid.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.employee-directory {
  display: grid;
  gap: 10px;
}

.employee-detail-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.35fr) minmax(260px, 1fr) auto;
  align-items: start;
  gap: 18px;
  min-height: 102px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  padding: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.employee-detail-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.employee-card-main {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.employee-large-swatch {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line-strong), 0 10px 18px rgba(22, 32, 51, 0.1);
}

.employee-card-main h4 {
  margin: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 840;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-card-main p {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-profile-details,
.employee-metrics {
  margin: 0;
}

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

.employee-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.employee-metrics div {
  min-width: 64px;
}

.employee-profile-details dt,
.employee-metrics dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.employee-profile-details dd,
.employee-metrics dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-metrics dd {
  font-size: 18px;
  font-weight: 850;
}

.employee-metrics .wide-metric {
  grid-column: 1 / -1;
}

.onboarding-link-box {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.onboarding-link-box span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-link-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.employee-metrics .wide-metric dd {
  font-size: 13px;
  font-weight: 760;
}

.muted-value {
  color: var(--muted);
}

.employee-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.locked-admin-note {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0 10px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.employee-inline-editor {
  display: block;
  border-color: rgba(37, 99, 235, 0.5);
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.employee-inline-editor:hover {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  transform: none;
}

.inline-employee-form {
  display: grid;
  gap: 14px;
}

.inline-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.inline-form-header h4 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
  font-weight: 840;
  line-height: 1.2;
}

.inline-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 30px;
  text-align: center;
}

.empty-state h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
}

.empty-state p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

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

.auth-panel {
  width: min(480px, 100%);
}

.auth-brand {
  margin-bottom: 16px;
}

.auth-brand h1 {
  color: var(--ink-strong);
}

.auth-card,
.request-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}

.compact-header {
  margin-bottom: 16px;
}

.compact-header h2 {
  color: var(--ink-strong);
  font-size: 26px;
  font-weight: 840;
}

.auth-form,
.request-form {
  display: grid;
  gap: 14px;
}

.onboarding-shell {
  min-height: 100vh;
  padding: 28px;
  background: var(--background);
}

.onboarding-panel {
  width: min(980px, 100%);
  margin: 0 auto;
}

.onboarding-form,
.onboarding-form fieldset {
  display: grid;
  gap: 14px;
}

.onboarding-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.onboarding-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.onboarding-form legend {
  margin-bottom: 8px;
  color: var(--ink-strong);
  font-size: 17px;
  font-weight: 840;
}

.onboarding-form legend span {
  color: var(--danger);
}

.success-panel {
  border: 1px solid color-mix(in srgb, var(--success) 28%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--success) 9%, white);
  padding: 24px;
}

.success-panel h2 {
  margin: 0 0 8px;
  color: var(--ink-strong);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-error {
  margin-bottom: 10px;
}

.login-code-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.login-code-panel span {
  color: var(--muted-strong);
  font-weight: 760;
}

.login-code-panel strong {
  color: var(--ink-strong);
  font-size: 24px;
  letter-spacing: 0.08em;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

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

.compact-list,
.request-list {
  display: grid;
  gap: 10px;
}

.compact-list-row,
.request-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  padding: 14px;
}

.compact-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compact-list-row h4,
.request-card h4 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 840;
}

.compact-list-row p,
.request-card p {
  margin-top: 4px;
  color: var(--muted-strong);
  font-weight: 700;
}

.request-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.request-workflow-group {
  display: grid;
  gap: 10px;
}

.request-workflow-group + .request-workflow-group {
  margin-top: 18px;
}

.request-workflow-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.request-workflow-heading h4 {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 840;
  text-transform: uppercase;
}

.timesheet-panel {
  overflow: hidden;
}

.timesheet-list {
  display: grid;
  gap: 14px;
}

.timesheet-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  padding: 14px;
}

.timesheet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.timesheet-shifts {
  display: grid;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.timesheet-shift-header,
.timesheet-shift-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(100px, 0.75fr) minmax(130px, 0.9fr) minmax(80px, 0.55fr) minmax(78px, 0.45fr);
  align-items: center;
  gap: 12px;
  min-width: 690px;
}

.timesheet-shifts.is-read-only .timesheet-shift-header,
.timesheet-shifts.is-read-only .timesheet-shift-row {
  grid-template-columns: minmax(160px, 1.2fr) minmax(100px, 0.75fr) minmax(130px, 0.9fr) minmax(80px, 0.55fr);
  min-width: 570px;
}

.timesheet-shift-header {
  padding: 0 12px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 840;
  text-transform: uppercase;
}

.timesheet-shift-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px 12px;
}

.timesheet-shift-row span,
.timesheet-shift-row strong,
.timesheet-shift-row b {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 800;
}

.timesheet-shift-row span {
  color: var(--muted-strong);
}

.timesheet-shift-row b {
  color: var(--accent);
  font-weight: 850;
  white-space: nowrap;
}

.timesheet-open-shift {
  color: var(--warning, #b45309) !important;
}

.timesheet-edit-button {
  min-height: 32px;
  justify-self: end;
  padding: 0 10px;
}

.field-hint {
  color: var(--muted);
  font-weight: 650;
}

.shortcut-token-help {
  margin: 8px 0 0;
  color: rgba(232, 241, 255, 0.72);
  font-size: 12px;
  line-height: 1.4;
}

.shortcut-token-output {
  width: 100%;
  margin-top: 10px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.archived-request {
  background: linear-gradient(180deg, #ffffff, var(--surface-soft));
}

.status-stack {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.status {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 820;
}

.status.pending {
  border-color: #facc15;
  background: #fef9c3;
  color: #854d0e;
}

.status.approved {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
}

.status.denied {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

.status.archived {
  border-color: #cbd5e1;
  background: #eef2f6;
  color: #475569;
}

.muted-copy {
  color: var(--muted);
}

.archive-details {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.decision-controls {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.reassign-control {
  display: grid;
  gap: 6px;
}

.decision-controls > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.request-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.request-facts dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 760;
}

.compact-empty {
  box-shadow: none;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(12, 18, 28, 0.95);
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .week-actions {
    flex-wrap: wrap;
  }

  .employee-page-grid {
    grid-template-columns: 1fr;
  }

  .employee-detail-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .employee-card-actions {
    justify-content: flex-start;
  }

  .employee-profile-details,
  .employee-metrics {
    grid-column: auto;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .sidebar,
  .workspace {
    padding: 16px;
  }

  .toolbar h2 {
    font-size: 23px;
  }

  .week-range-nav {
    align-items: flex-start;
    position: relative;
  }

  .week-actions,
  .week-range-nav {
    flex-wrap: wrap;
  }

  .week-picker-shell {
    position: static;
  }

  .week-picker {
    width: min(316px, 100%);
  }

  .publish-status {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .copy-last-week-select {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .employee-toolbar {
    align-items: stretch;
  }

  .employee-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .employee-form-grid,
  .employee-form-grid.three-column,
  .employee-profile-details {
    grid-template-columns: 1fr;
  }

  .employee-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .employee-metrics .wide-metric {
    grid-column: 1 / -1;
  }

  .employee-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .onboarding-link-box {
    align-items: stretch;
    flex-direction: column;
  }

  .onboarding-link-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .inline-form-header,
  .inline-form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-actions,
  .request-facts {
    grid-template-columns: 1fr;
  }

  .request-card-header {
    display: grid;
  }
}
