:root {
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --bg: #f4f6f7;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-muted: rgba(17, 33, 44, 0.03);
  --line: rgba(17, 33, 44, 0.09);
  --line-strong: rgba(17, 33, 44, 0.16);
  --text: #12202a;
  --muted: #64707a;
  --danger: #b42318;
  --success: #0f766e;
  --shadow: 0 8px 24px rgba(17, 33, 44, 0.04);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
    linear-gradient(180deg, #f4f6f7 0%, #eef1f2 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(18, 32, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 32, 42, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
  pointer-events: none;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.button-label,
.nav-link-content,
.panel-title-row,
.section-title-row,
.workspace-title-row,
.sidebar-company,
.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-shell,
.auth-shell,
.loading-screen {
  position: relative;
  z-index: 1;
}

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

.sidebar {
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-block,
.section-header,
.panel-header,
.panel-body,
.workspace,
.auth-cards,
.auth-hero {
  position: relative;
}

.brand-block h1,
.section-header h2,
.panel-header h3,
.workspace-title {
  margin: 0;
  letter-spacing: -0.03em;
}

.brand-block h1 {
  font-size: 1.05rem;
  font-weight: 650;
}

.workspace-title {
  font-size: 1.08rem;
  font-weight: 620;
}

.section-header h2 {
  font-size: 1.05rem;
  font-weight: 650;
}

.panel-header h3 {
  font-size: 0.82rem;
  font-weight: 600;
}

.brand-mark,
.workspace-icon,
.section-icon,
.panel-icon,
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-strong);
}

.brand-mark {
  width: 30px;
  height: 30px;
}

.auth-brand-mark {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f5fbff;
}

.brand-meta {
  display: grid;
  gap: 2px;
}

.brand-block p,
.workspace-subtitle,
.section-header p,
.panel-copy,
.sidebar-user span,
.list-row p,
.record-title p,
.field small,
.hero-note p,
.empty-state {
  margin: 0;
  color: var(--muted);
}

.brand-block p {
  margin-top: 8px;
  max-width: 24ch;
  line-height: 1.5;
  font-size: 0.92rem;
}

.panel-copy,
.list-row p,
.record-title p,
.field small {
  font-size: 0.76rem;
  line-height: 1.5;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.66rem;
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 6px;
  min-height: 0;
}

.nav-link,
.run-link,
.ghost-button,
.primary-button {
  border: 1px solid transparent;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.nav-link {
  min-height: 40px;
  padding: 0 12px 0 10px;
  border-left-width: 2px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-link {
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.nav-link:hover {
  background: rgba(17, 33, 44, 0.03);
  color: var(--text);
}

.run-link:hover,
.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.nav-link.active {
  background: transparent;
  color: var(--text);
  border-color: transparent;
  border-left-color: var(--accent-strong);
}

.nav-link.active .icon,
.sidebar-company .icon,
.workspace-icon .icon,
.section-icon .icon,
.panel-icon .icon,
.stat-icon .icon {
  color: var(--accent-strong);
}

.nav-link-text {
  font-size: 0.92rem;
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.74);
  position: sticky;
  bottom: 0;
}

.sidebar-company {
  font-size: 0.9rem;
  font-weight: 600;
}

.sidebar-user {
  display: grid;
  gap: 2px;
  font-size: 0.92rem;
}

.sidebar-user span {
  font-size: 0.84rem;
}

.workspace {
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.workspace-heading,
.workspace-title-copy {
  display: grid;
  gap: 2px;
}

.workspace-title-row {
  align-items: flex-start;
}

.workspace-subtitle {
  max-width: 62ch;
  font-size: 0.82rem;
  line-height: 1.5;
}

.topbar-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.72rem;
}

.status-pill.loading {
  color: var(--accent-strong);
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.11);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.06);
}

.status-pill.success {
  color: var(--success);
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.06);
}

.status-pill.danger,
.ghost-button.danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.16);
  background: rgba(180, 35, 24, 0.05);
}

.page-grid {
  display: grid;
  gap: 14px;
  align-content: start;
  align-items: start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  align-items: start;
}

.stats-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.panel,
.hero-note,
.demo-card,
.loading-card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 12px;
  border-radius: 16px;
  display: grid;
  gap: 6px;
  align-content: start;
  align-self: start;
}

.stat-top {
  display: flex;
  justify-content: flex-start;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.stat-card strong {
  font-size: 1.14rem;
  line-height: 1;
}

.content-grid {
  display: grid;
  gap: 14px;
  align-content: start;
  align-items: start;
}

.content-grid.two-column {
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.08fr);
}

.content-grid.dashboard-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: start;
}

.content-grid.employees-layout {
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  align-items: start;
}

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

.employee-workspace.is-editor-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
}

.content-grid.activities-layout {
  grid-template-columns: minmax(420px, 1.15fr) minmax(320px, 0.95fr);
  align-items: start;
}

.content-grid.schedule-layout {
  grid-template-columns: 320px minmax(0, 1fr);
}

.panel {
  border-radius: 16px;
  overflow: hidden;
  align-self: start;
}

.panel.flat {
  box-shadow: none;
}

.panel-header {
  padding: 12px 14px 0;
}

.panel-body {
  padding: 12px 14px 14px;
  font-size: 0.82rem;
}

.panel.no-header .panel-body {
  padding-top: 14px;
}

.dashboard-overview,
.dashboard-side-stack,
.dashboard-list,
.dashboard-empty-copy {
  display: grid;
  gap: 12px;
}

.dashboard-overview-head,
.dashboard-overview-status,
.dashboard-action-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-overview-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dashboard-overview-copy strong,
.dashboard-empty-copy strong {
  font-size: 0.96rem;
  line-height: 1.2;
}

.dashboard-overview-copy p,
.dashboard-empty-copy p,
.dashboard-row-main span {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.dashboard-day-strip,
.dashboard-action-grid {
  display: grid;
  gap: 8px;
}

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

.dashboard-action-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-day-button,
.dashboard-link-card,
.dashboard-shortage-row,
.dashboard-person-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
}

.dashboard-day-button,
.dashboard-link-card,
.dashboard-shortage-row {
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.dashboard-day-button:hover,
.dashboard-link-card:hover,
.dashboard-shortage-row:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.22);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
}

.dashboard-day-button,
.dashboard-link-card {
  padding: 10px 12px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.dashboard-day-button strong,
.dashboard-link-card strong,
.dashboard-row-main strong {
  font-size: 0.81rem;
  line-height: 1.25;
}

.dashboard-day-button span,
.dashboard-link-card span {
  font-size: 0.72rem;
}

.dashboard-day-label {
  color: var(--text);
  text-transform: capitalize;
}

.dashboard-day-button.covered {
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.045);
}

.dashboard-day-button.missing {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.04);
}

.dashboard-run-warning {
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.16);
  border-radius: 12px;
  background: rgba(180, 35, 24, 0.05);
  color: var(--danger);
  font-size: 0.74rem;
  line-height: 1.45;
}

.dashboard-shortage-row,
.dashboard-person-row {
  width: 100%;
  padding: 10px 12px;
}

.dashboard-shortage-row,
.dashboard-person-row,
.dashboard-row-trailing {
  display: flex;
  gap: 10px;
}

.dashboard-shortage-row,
.dashboard-person-row {
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.dashboard-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-row-note {
  font-size: 0.7rem;
}

.dashboard-row-trailing {
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  flex-shrink: 0;
}

.dashboard-row-trailing.text {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.dashboard-row-trailing strong {
  color: var(--text);
  font-size: 0.81rem;
}

.dashboard-link-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.employee-form-panel {
  position: sticky;
  top: 18px;
  align-self: start;
}

.activity-form-panel {
  overflow: visible;
  align-self: start;
}

.activity-editor-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.activity-form-panel .panel-body,
.activity-list-panel .panel-body {
  padding-top: 10px;
}

.employee-form-panel .panel-body,
.employee-list-panel .panel-body {
  padding-top: 8px;
}

.employee-editor-form {
  gap: 8px;
}

.employee-editor-meta,
.employee-sheet-summary,
.employee-editor-label,
.table-heading,
.employee-name-row,
.employee-hours-cell,
.employee-rule-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.employee-editor-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.72rem;
}

.employee-editor-meta.compact {
  align-items: center;
  gap: 8px;
  margin-bottom: -2px;
}

.employee-editor-meta.only-action {
  justify-content: flex-end;
}

.employee-editor-copy,
.employee-sheet-copy {
  display: grid;
  gap: 4px;
}

.employee-editor-spacer {
  width: 1px;
  height: 1px;
}

.employee-editor-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
}

.employee-editor-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.employee-editor-label .icon,
.employee-sheet-summary .icon,
.table-heading .icon,
.employee-rule-item .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.employee-form-panel .field span,
.employee-form-panel .toggle span {
  font-size: 0.76rem;
}

.inline-help-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.inline-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--muted);
  cursor: help;
  flex: 0 0 16px;
}

.inline-help .icon {
  width: 13px;
  height: 13px;
}

.inline-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translate(-50%, -3px);
  min-width: 140px;
  max-width: 220px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(123, 139, 150, 0.16);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(17, 33, 44, 0.1);
  font-size: 0.67rem;
  line-height: 1.45;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 6;
}

.inline-help:hover::after,
.inline-help:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.employee-profile-grid {
  align-items: start;
}

.employee-profile-field {
  gap: 6px;
}

.employee-profile-title {
  min-height: 22px;
}

.employee-profile-subrow {
  min-height: 18px;
}

.weekly-capacity-headings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 88px));
  gap: 8px;
  align-items: end;
  max-width: 192px;
}

.employee-form-panel .employee-profile-field input {
  min-height: 34px;
  padding: 8px 10px;
}

.weekly-capacity-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 88px));
  gap: 8px;
  align-items: start;
  max-width: 192px;
}

.weekly-capacity-part {
  display: grid;
  gap: 4px;
}

.employee-form-panel .weekly-capacity-part input {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
}

.employee-form-panel .weekly-capacity-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}

.employee-form-panel .field input,
.employee-form-panel .field textarea {
  min-height: 38px;
  padding: 9px 10px;
}

.employee-form-panel .field textarea {
  min-height: 84px;
}

.employee-form-panel small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.employee-editor-actions {
  justify-content: flex-end;
}

.stack,
.narrow,
.slot-stack {
  display: grid;
  gap: 12px;
}

.compact-stack {
  gap: 10px;
}

.narrow {
  max-width: 420px;
}

.field,
.toggle {
  display: grid;
  gap: 6px;
}

.field-grid,
.toggle-grid {
  display: grid;
  gap: 10px;
}

.field-grid.two,
.toggle-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row,
.button-row,
.record-header,
.summary-line,
.list-row,
.inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field span,
.toggle span {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
}

.field input,
.field textarea,
.field select,
input[type='file'] {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
  font-size: 0.83rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field.compact input {
  min-height: 38px;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
input[type='file']:focus {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.toggle {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.toggle input {
  width: 16px;
  height: 16px;
}

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

.qualifications-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 172px;
  padding: 2px;
  overflow: auto;
}

.employee-activity-limits,
.employee-rest-rule-card {
  display: grid;
  gap: 8px;
}

.employee-activity-limits {
  margin-top: 4px;
}

.employee-activity-limits-head {
  display: grid;
  gap: 3px;
}

.employee-activity-limits-head > .inline-help-row > span {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 500;
}

.employee-activity-limit-list {
  display: grid;
  gap: 6px;
}

.employee-activity-limit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 154px);
  gap: 10px;
  align-items: center;
}

.employee-activity-limit-row span {
  min-width: 0;
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.35;
}

.employee-activity-limit-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  justify-items: stretch;
}

.employee-activity-limit-row input {
  min-height: 34px;
}

.employee-activity-limit-control .ghost-button.small {
  min-height: 28px;
  padding: 0 9px;
  justify-self: end;
}

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

.employee-rule-card {
  display: grid;
  gap: 8px;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.employee-rule-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.employee-rule-toggle input {
  margin: 0;
}

.employee-rule-toggle span {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.employee-rule-toggle-card {
  align-content: center;
}

.employee-rest-rule-card {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 138px;
  align-items: end;
}

.employee-rest-rule-card .employee-rule-toggle {
  align-self: center;
}

.employee-rest-hours-field {
  max-width: 138px;
  gap: 4px;
}

.employee-rest-hours-field input {
  min-height: 36px;
}

.employee-rest-rule-card small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.4;
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  font-size: 0.8rem;
}

.qualifications-chip {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 10px;
  gap: 6px;
  font-size: 0.72rem;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.78);
}

.qualifications-chip input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.primary-button,
.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 520;
}

.primary-button {
  color: #f7fbfc;
  background: var(--accent-strong);
  border-color: rgba(17, 32, 42, 0.12);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--line);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.ghost-button.small,
.primary-button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.employee-table-scroll {
  max-height: calc(100vh - 214px);
}

.employee-table-scroll .data-table {
  min-width: 920px;
}

.employee-sheet-toolbar {
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.employee-data-table th:nth-child(1),
.employee-data-table td:nth-child(1) {
  width: 24%;
}

.employee-data-table th:nth-child(2),
.employee-data-table td:nth-child(2) {
  width: 12%;
}

.employee-data-table th:nth-child(3),
.employee-data-table td:nth-child(3) {
  width: 28%;
}

.employee-data-table th:nth-child(4),
.employee-data-table td:nth-child(4) {
  width: 26%;
}

.employee-data-table th:nth-child(5),
.employee-data-table td:nth-child(5) {
  width: 10%;
}

.employee-data-table th,
.employee-data-table td {
  padding: 9px 8px;
}

.employee-data-table tbody tr td {
  transition: background 140ms ease;
}

.employee-data-table tbody tr:hover td {
  background: rgba(17, 33, 44, 0.025);
}

.employee-data-table tbody tr.active td {
  background: rgba(15, 118, 110, 0.05);
}

.employee-data-table tbody tr.dirty td {
  background: rgba(15, 118, 110, 0.025);
}

.table-heading {
  color: var(--muted);
  white-space: nowrap;
}

.table-heading-actions {
  justify-content: flex-end;
}

.employee-name-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.employee-name-cell strong {
  font-size: 0.77rem;
}

.employee-inline-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.employee-name-row {
  flex-wrap: wrap;
}

.employee-note-preview {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.employee-note-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.employee-capacity-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.employee-capacity-inline .inline-cell-input {
  width: auto;
  min-width: 0;
}

.inline-cell-input {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.76rem;
  outline: none;
}

.inline-cell-input:hover {
  background: rgba(17, 33, 44, 0.03);
  border-color: rgba(17, 33, 44, 0.05);
}

.inline-cell-input:focus {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 118, 110, 0.26);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.inline-cell-input:disabled {
  opacity: 0.7;
}

.employee-name-input {
  font-weight: 600;
}

.employee-hours-input {
  width: 60px;
  max-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.employee-capacity-unit {
  color: var(--muted);
  font-size: 0.68rem;
}

.employee-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.employee-mini-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 0.69rem;
}

.employee-mini-tag.muted {
  color: var(--muted);
  background: rgba(17, 33, 44, 0.04);
}

.employee-rule-list {
  display: grid;
  gap: 5px;
}

.employee-rule-list.compact {
  gap: 4px;
}

.employee-rule-item {
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.employee-toggle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.employee-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.69rem;
}

.employee-inline-toggle.active {
  color: var(--text);
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
}

.employee-inline-toggle:disabled {
  opacity: 0.64;
}

.employee-inline-toggle .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.employee-actions {
  justify-content: flex-end;
  gap: 6px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  padding: 0;
}

.employee-empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.8rem;
}

.data-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.table-scroll .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafb;
}

.record-card,
.slot-card,
.run-link,
.hero-note,
.demo-card,
.empty-state,
.error-box {
  border-radius: 14px;
}

.record-card,
.slot-card,
.run-link,
.empty-state {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  padding: 11px;
}

.run-link {
  display: grid;
  gap: 3px;
  text-align: left;
  font-size: 0.8rem;
}

.run-link.active {
  background: rgba(15, 118, 110, 0.06);
  border-color: rgba(15, 118, 110, 0.18);
}

.slot-card {
  display: grid;
  gap: 10px;
}

.template-slot-card {
  padding: 12px;
}

.template-slot-header {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(88px, 1fr));
  gap: 10px;
  align-items: end;
}

.template-slot-header > .ghost-button {
  grid-column: 1 / -1;
  justify-self: start;
}

.template-slot-detail {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(17, 33, 44, 0.08);
}

.template-slot-summary {
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.template-range-grid,
.template-exclusion-row {
  display: grid;
  gap: 10px;
}

.template-range-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weekday-toggle-row,
.template-exclusion-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-toggle-row {
  margin-top: 6px;
}

.weekday-toggle {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.72rem;
}

.weekday-toggle.active {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.2);
  background: rgba(15, 118, 110, 0.08);
}

.employee-rest-weekday-row {
  margin-top: 0;
}

.employee-rest-weekday-row .weekday-toggle {
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.7rem;
}

.employee-availability-stack {
  display: grid;
  gap: 8px;
}

.employee-availability-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.72rem;
}

.employee-availability-toolbar > .inline-help-row > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.availability-rule-card {
  padding: 12px;
}

.availability-rule-header {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.availability-rule-header > .ghost-button {
  grid-column: auto;
  justify-self: end;
  align-self: end;
}

.template-exclusion-panel {
  display: grid;
  gap: 8px;
}

.template-exclusion-stack {
  flex-direction: column;
}

.template-exclusion-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

.template-empty-note {
  color: var(--muted);
  font-size: 0.71rem;
}

.slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.activity-record-card {
  border-color: var(--line);
  background: var(--surface-muted);
}

.activity-record-card.active {
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.055);
}

.activity-record-card.active .record-title strong {
  color: var(--accent-strong);
}

.activity-list-toolbar {
  flex-wrap: wrap;
}

.activity-editing-badge {
  color: var(--accent-strong);
  border-color: rgba(15, 118, 110, 0.16);
  background: rgba(15, 118, 110, 0.08);
}

.activity-slot-badge,
.activity-qualification-chip {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.record-title {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
  border: 0;
  background: var(--activity-accent, var(--accent));
  box-shadow: none;
}

.summary-line {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}

.summary-line:last-child {
  border-bottom: 0;
}

.report-box {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #101b24;
  color: #ebf4f7;
  overflow: auto;
  font-size: 0.76rem;
  line-height: 1.55;
  font-family: 'IBM Plex Mono', 'SFMono-Regular', monospace;
  white-space: pre-wrap;
}

.schedule-plan-panel .panel-body,
.schedule-explorer-panel .panel-body,
.schedule-workspace-panel .panel-body {
  padding-top: 10px;
}

.schedule-page-grid,
.schedule-plan-stack,
.schedule-summary-grid {
  display: grid;
}

.schedule-page-grid {
  gap: 12px;
}

.mini-heading {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.schedule-inline-tools,
.schedule-context-actions,
.schedule-control-bar,
.schedule-toolbar,
.schedule-toolbar-actions,
.schedule-nav,
.schedule-nav-center,
.day-activity-header,
.day-slot-meta,
.day-slot-actions,
.month-cell-head,
.month-preview-item,
.slot-inspector-header,
.slot-inspector-summary,
.candidate-reason-row,
.report-disclosure {
  display: flex;
}

.schedule-plan-stack {
  gap: 10px;
}

.schedule-plan-bar {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.schedule-plan-bar > * {
  min-width: 0;
}

.schedule-plan-bar .schedule-run-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: 0;
  padding: 0;
  border: none;
  background: none;
}

.schedule-plan-bar .schedule-run-field > span {
  color: var(--muted);
  font-size: 0.7rem;
}

.schedule-plan-bar .schedule-run-field select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
}

.schedule-plan-bar .schedule-run-field select:focus {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}

.schedule-control-bar {
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 0 0 12px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
}

.schedule-generate-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(148px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
}

.schedule-inline-tools {
  align-items: end;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1 1 520px;
}

.schedule-control-bar .segmented-control {
  min-height: 42px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  align-self: end;
}

.schedule-control-bar .segment-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
}

.schedule-run-field {
  min-width: 250px;
}

.schedule-run-alert {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(180, 35, 24, 0.16);
  background: rgba(180, 35, 24, 0.05);
}

.schedule-run-alert strong {
  color: var(--danger);
  font-size: 0.74rem;
}

.schedule-run-alert span {
  color: rgba(108, 40, 32, 0.92);
  font-size: 0.72rem;
  line-height: 1.45;
}

.schedule-run-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: none;
  background: none;
}

.schedule-run-strip-empty {
  justify-content: flex-start;
}

.schedule-run-title-group {
  display: grid;
  gap: 2px;
}

.schedule-run-title-group strong {
  font-size: 0.98rem;
}

.schedule-run-title-group span,
.schedule-run-hint {
  color: var(--muted);
  font-size: 0.73rem;
}

.schedule-context-actions {
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  align-self: end;
}

.schedule-context-actions .ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
}

.schedule-generation-hint {
  flex-wrap: wrap;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.schedule-control-bar .schedule-filter-field,
.schedule-generate-inline .field.compact {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: 0;
  padding: 0;
  border: none;
  background: none;
}

.schedule-control-bar .schedule-filter-field > span,
.schedule-generate-inline .field.compact > span {
  color: var(--muted);
  font-size: 0.7rem;
}

.schedule-control-bar .schedule-filter-field select,
.schedule-generate-inline .field.compact input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
}

.schedule-control-bar .schedule-filter-field select:focus,
.schedule-generate-inline .field.compact input:focus {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}

.schedule-generate-inline .ghost-button.small {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
}

.schedule-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.schedule-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  white-space: nowrap;
}

.schedule-summary-card strong {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1;
  flex: 0 0 auto;
}

.schedule-summary-card:not(:last-child) {
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.schedule-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-summary-label .icon {
  color: var(--accent-strong);
}

.schedule-summary-card.warning {
  color: var(--danger);
}

.schedule-summary-card.warning strong,
.schedule-summary-card.warning .schedule-summary-label,
.schedule-summary-card.warning .schedule-summary-label .icon {
  color: var(--danger);
}

.schedule-toolbar,
.schedule-nav {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.schedule-toolbar-actions {
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.segment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
}

.segment-button.active {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(17, 33, 44, 0.05);
}

.schedule-filter-field {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.schedule-filter-field.activities {
  min-width: min(420px, 100%);
  flex: 1 1 320px;
}

.schedule-filter-field > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.schedule-filter-field select {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.78rem;
}

.schedule-filter-field select:focus {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}

.schedule-activity-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.schedule-activity-chip-row::-webkit-scrollbar {
  display: none;
}

.schedule-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 520;
  white-space: nowrap;
  flex: 0 0 auto;
}

.schedule-filter-chip.active {
  color: var(--text);
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
}

.schedule-filter-chip:disabled {
  opacity: 0.56;
}

.schedule-stats-grid .stat-card {
  padding: 12px;
  gap: 6px;
}

.schedule-stats-grid .stat-card span {
  font-size: 0.74rem;
}

.schedule-stats-grid .stat-card strong {
  font-size: 1.08rem;
}

.schedule-nav {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.schedule-nav-center {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.schedule-nav-label {
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-transform: capitalize;
}

.schedule-nav-label.compact {
  font-size: 0.84rem;
}

.schedule-nav-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

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

.day-activity-card,
.month-preview-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.day-activity-card.activity-themed-card {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.day-activity-header,
.day-slot-meta,
.month-preview-item {
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.day-activity-header strong,
.month-preview-item strong {
  font-size: 0.8rem;
}

.day-activity-card.activity-themed-card .day-activity-header strong,
.week-day-group-item.activity-themed-inline strong,
.week-assignment-chip.activity-themed-chip strong,
.month-preview-item.activity-themed-inline strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.day-activity-card.activity-themed-card .day-activity-header strong::before,
.week-day-group-item.activity-themed-inline strong::before,
.week-assignment-chip.activity-themed-chip strong::before,
.month-preview-item.activity-themed-inline strong::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 7px;
  background: var(--activity-accent, var(--accent));
}

.day-activity-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.71rem;
}

.day-slot-stack,
.month-grid-shell,
.month-preview-list,
.schedule-details-grid {
  display: grid;
  gap: 10px;
}

.day-slot-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--surface-muted);
}

.day-slot-row.missing {
  border-color: rgba(180, 35, 24, 0.14);
  background: rgba(180, 35, 24, 0.03);
}

.day-slot-meta {
  align-items: center;
  font-size: 0.74rem;
  color: var(--muted);
}

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

.day-slot-meta strong {
  font-size: 0.76rem;
  color: var(--text);
}

.shortage-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(180, 35, 24, 0.16);
  background: rgba(180, 35, 24, 0.05);
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 600;
}

.slot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  color: var(--text);
}

.person-chip.empty {
  color: var(--muted);
  background: rgba(17, 33, 44, 0.03);
}

.person-chip.missing {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.16);
  background: rgba(180, 35, 24, 0.05);
}

.slot-inspector {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(180, 35, 24, 0.14);
  background: rgba(255, 249, 248, 0.88);
}

.slot-inspector-header,
.candidate-reason-row {
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.slot-inspector-header strong {
  font-size: 0.79rem;
}

.slot-inspector-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.slot-inspector-summary {
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.slot-inspector-section {
  display: grid;
  gap: 8px;
}

.candidate-reason-main,
.candidate-swap-list,
.candidate-swap-row,
.candidate-swap-replacements,
.week-day-card,
.week-day-group-list,
.week-employee-cell,
.week-cell-stack {
  display: grid;
}

.candidate-reason-list {
  display: grid;
  gap: 10px;
}

.candidate-reason-row {
  display: block;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(17, 33, 44, 0.08);
}

.candidate-reason-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.candidate-reason-row strong {
  font-size: 0.76rem;
}

.candidate-reason-main {
  gap: 8px;
}

.candidate-reason-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.candidate-reason-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.7rem;
  color: var(--text);
}

.candidate-swap-list {
  gap: 8px;
}

.candidate-swap-row {
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(17, 33, 44, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.candidate-swap-label,
.candidate-swap-hint,
.candidate-swap-empty {
  color: var(--muted);
  font-size: 0.72rem;
}

.candidate-swap-label {
  color: var(--text);
  font-weight: 550;
}

.candidate-swap-empty {
  color: var(--danger);
}

.candidate-swap-replacements {
  gap: 6px;
}

.week-shortage-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.week-shortage-link {
  display: grid;
  gap: 3px;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(180, 35, 24, 0.14);
  background: rgba(180, 35, 24, 0.05);
  color: var(--text);
  text-align: left;
}

.week-shortage-link strong {
  font-size: 0.76rem;
}

.week-shortage-link span {
  color: var(--danger);
  font-size: 0.71rem;
}

.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(172px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.week-day-card {
  grid-template-rows: auto auto 168px;
  gap: 10px;
  min-height: 268px;
  height: 268px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.week-day-card.missing {
  border-color: rgba(180, 35, 24, 0.14);
  background: rgba(255, 249, 248, 0.88);
}

.week-day-card-head {
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.week-day-card-head strong {
  font-size: 0.8rem;
  text-transform: capitalize;
}

.week-day-card-head span,
.week-employee-cell span,
.week-cell-empty {
  color: var(--muted);
  font-size: 0.71rem;
}

.week-day-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.week-day-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.7rem;
}

.week-day-group-shell {
  position: relative;
  min-height: 168px;
  max-height: 168px;
}

.week-day-group-list {
  gap: 8px;
  min-height: 168px;
  max-height: 168px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 2px;
}

.week-day-group-list::-webkit-scrollbar {
  display: none;
}

.week-scroll-hint {
  position: absolute;
  left: 0;
  right: 2px;
  z-index: 1;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.week-scroll-hint.top {
  top: 0;
  padding-top: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0));
}

.week-scroll-hint.bottom {
  bottom: 0;
  padding-bottom: 2px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0));
}

.week-scroll-hint span {
  width: 8px;
  height: 8px;
  opacity: 0.34;
  border-top: 1.4px solid rgba(18, 32, 42, 0.48);
  border-left: 1.4px solid rgba(18, 32, 42, 0.48);
}

.week-scroll-hint.top span {
  transform: rotate(45deg);
}

.week-scroll-hint.bottom span {
  transform: rotate(225deg);
}

.week-day-group-item {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(17, 33, 44, 0.08);
}

.week-day-group-item.activity-themed-inline {
  padding-top: 8px;
  border-top: 1px solid rgba(17, 33, 44, 0.08);
  border-radius: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: none;
}

.week-day-group-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.week-day-group-item.activity-themed-inline:first-child {
  padding-top: 0;
  border-top: 0;
}

.week-day-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.week-day-group-item strong {
  font-size: 0.73rem;
  font-weight: 600;
}

.week-day-group-missing {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
  font-size: 0.66rem;
  font-weight: 600;
}

.week-day-group-people {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.week-day-group-people.empty {
  color: var(--muted);
  opacity: 0.78;
}

.week-team-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.week-team-panel.expanded {
  position: fixed;
  inset: 18px 22px;
  z-index: 30;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(248, 250, 251, 0.97);
  box-shadow: 0 28px 56px rgba(17, 33, 44, 0.16);
  backdrop-filter: blur(12px);
  grid-template-rows: auto minmax(0, 1fr);
}

.schedule-workspace-panel:has(.week-team-panel.expanded) {
  overflow: visible;
  backdrop-filter: none;
}

.schedule-workspace-panel:has(.week-team-panel.expanded) .panel-body,
.schedule-workspace-panel:has(.week-team-panel.expanded) .schedule-stack {
  overflow: visible;
}

.week-team-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.week-team-panel.expanded .panel-toolbar {
  align-items: flex-start;
}

.week-team-remove-drop {
  border-style: dashed;
}

.week-team-remove-drop.is-over {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.06);
}

.week-team-table-shell {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.week-team-panel.expanded .week-team-table-shell {
  overflow: auto;
  min-height: 0;
  height: 100%;
}

.week-team-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.week-team-table th,
.week-team-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.week-team-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafb;
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.week-team-table th:first-child,
.week-team-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fbfcfc;
}

.week-team-table thead th:first-child {
  z-index: 2;
}

.week-team-drop-cell {
  background: rgba(15, 118, 110, 0.04);
}

.week-team-drop-cell.is-over {
  background: rgba(15, 118, 110, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.22);
}

.week-employee-cell {
  gap: 2px;
  min-width: 160px;
}

.week-employee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subtle-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(100, 112, 122, 0.8);
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.subtle-icon-button:hover {
  background: rgba(17, 33, 44, 0.05);
  color: var(--text);
  transform: translateY(-1px);
}

.subtle-icon-button .icon {
  width: 13px;
  height: 13px;
}

.week-employee-cell strong {
  font-size: 0.75rem;
}

.week-employee-detail {
  color: rgba(67, 82, 90, 0.8);
  font-size: 0.67rem;
}

.week-cell-stack {
  gap: 6px;
  min-width: 132px;
}

.week-assignment-head,
.week-assignment-icons {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.week-assignment-icons {
  color: rgba(100, 112, 122, 0.88);
  flex: 0 0 auto;
}

.week-assignment-warning {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.week-assignment-warning::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 140px;
  max-width: 220px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(180, 35, 24, 0.14);
  background: rgba(255, 251, 250, 0.98);
  color: #8b2e22;
  box-shadow: 0 12px 30px rgba(17, 33, 44, 0.12);
  font-size: 0.67rem;
  line-height: 1.45;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 6;
}

.week-assignment-warning:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.week-assignment-icons .icon {
  width: 13px;
  height: 13px;
}

.week-assignment-chip {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  text-align: left;
  cursor: grab;
}

.week-assignment-chip:active {
  cursor: grabbing;
}

.week-assignment-chip.activity-themed-chip {
  border-color: var(--activity-border, var(--line));
  background: var(--activity-surface, rgba(255, 255, 255, 0.94));
}

.week-assignment-chip.invalid {
  border-color: rgba(180, 35, 24, 0.2);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.08);
}

.week-assignment-chip.invalid .week-assignment-icons {
  color: var(--danger);
}

.week-assignment-chip.activity-themed-chip strong {
  gap: 0;
}

.week-assignment-chip.activity-themed-chip strong::before {
  content: none;
}

.week-assignment-chip strong {
  font-size: 0.72rem;
}

.week-assignment-chip span {
  color: var(--muted);
  font-size: 0.69rem;
}

.week-cell-empty {
  display: inline-block;
  padding-top: 6px;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.week-head {
  gap: 6px;
}

.month-weekday {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.month-cell {
  min-height: 122px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  display: grid;
  gap: 8px;
  text-align: left;
}

.month-cell.active {
  border-color: rgba(15, 118, 110, 0.22);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
  background: rgba(15, 118, 110, 0.05);
}

.month-cell.muted {
  color: var(--muted);
  background: rgba(17, 33, 44, 0.02);
}

.month-cell-head {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 650;
}

.month-cell-body {
  display: grid;
  gap: 6px;
  align-content: start;
}

.month-activity-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  min-height: 10px;
}

.month-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: var(--activity-accent, var(--accent));
}

.month-warning-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
}

.month-metric {
  color: var(--muted);
  font-size: 0.7rem;
}

.month-metric.warning {
  color: var(--danger);
}

.month-cell-activities {
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.month-cell.muted .month-cell-activities {
  color: var(--muted);
}

.month-preview-item {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--muted);
}

.month-preview-item.activity-themed-inline {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  border-left: 0;
  background: none;
}

.month-preview-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.month-preview-item.activity-themed-inline:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.report-disclosure {
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.report-disclosure summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text);
  list-style: none;
}

.report-disclosure summary::-webkit-details-marker {
  display: none;
}

.report-disclosure summary::after {
  content: '+';
  float: right;
  color: var(--muted);
}

.report-disclosure[open] summary::after {
  content: '−';
}

.schedule-details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty-state,
.error-box {
  color: var(--muted);
  font-size: 0.8rem;
}

.empty-state.minor {
  font-size: 0.74rem;
}

.error-box {
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.14);
  background: rgba(180, 35, 24, 0.05);
  color: var(--danger);
}

.list-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 440px;
}

.auth-hero {
  padding: 36px;
  background:
    linear-gradient(180deg, rgba(16, 27, 36, 0.98), rgba(16, 27, 36, 0.92)),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 40%);
  color: #f5fbff;
  display: grid;
  align-content: center;
  gap: 14px;
}

.auth-hero h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.auth-hero p {
  max-width: 54ch;
  font-size: 0.98rem;
  line-height: 1.65;
  color: rgba(245, 251, 255, 0.74);
}

.hero-note {
  margin-top: 8px;
  max-width: 520px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.demo-card {
  margin-top: 12px;
  padding: 14px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.demo-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: rgba(245, 251, 255, 0.62);
}

.auth-cards {
  padding: 24px;
  display: grid;
  gap: 12px;
  align-content: center;
  background: rgba(255, 255, 255, 0.58);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.loading-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  border-radius: 16px;
  font-size: 0.9rem;
}

.loader {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(15, 118, 110, 0.18);
  border-top-color: var(--accent-strong);
  animation: loader-spin 0.78s linear infinite;
}

.ghost-button.is-loading {
  border-color: rgba(15, 118, 110, 0.16);
  background: rgba(15, 118, 110, 0.06);
  color: var(--accent-strong);
}

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

@media (max-width: 1180px) {
  .app-shell,
  .auth-shell,
  .content-grid.two-column,
  .content-grid.dashboard-layout,
  .content-grid.schedule-layout,
  .content-grid.employees-layout,
  .employee-workspace,
  .employee-workspace.is-editor-open {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: static;
    height: auto;
    overflow: visible;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .auth-cards {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .employee-form-panel {
    position: static;
  }

  .day-groups-grid,
  .schedule-details-grid {
    grid-template-columns: 1fr;
  }

  .week-board {
    grid-template-columns: repeat(4, minmax(172px, 1fr));
  }

  .dashboard-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workspace,
  .auth-cards,
  .auth-hero,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .field-row,
  .button-row,
  .record-header,
  .summary-line,
  .dashboard-overview-head,
  .dashboard-shortage-row,
  .dashboard-person-row {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .stats-grid.compact,
  .checkbox-grid,
  .dashboard-day-strip,
  .dashboard-action-grid,
  .slot-card,
  .template-slot-header,
  .template-range-grid,
  .template-exclusion-row,
  .field-grid.two,
  .toggle-grid,
  .employee-rules-grid {
    grid-template-columns: 1fr;
  }

  .employee-rest-rule-card {
    grid-template-columns: 1fr;
  }

  .topbar-status {
    justify-content: flex-start;
  }

  .dashboard-row-trailing,
  .dashboard-row-trailing.text {
    justify-items: start;
    justify-content: flex-start;
  }

  .employee-table-scroll {
    max-height: none;
  }

  .schedule-toolbar,
  .schedule-nav,
  .schedule-toolbar-actions,
  .schedule-plan-bar,
  .schedule-control-bar,
  .schedule-inline-tools,
  .schedule-context-actions,
  .slot-inspector-header,
  .day-slot-meta {
    align-items: stretch;
  }

  .schedule-generate-inline {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .segmented-control {
    width: 100%;
    justify-content: stretch;
  }

  .segment-button {
    flex: 1 1 0;
    justify-content: center;
  }

  .schedule-filter-field {
    min-width: 0;
  }

  .schedule-run-field {
    width: 100%;
  }

  .schedule-run-strip,
  .slot-inspector-summary,
  .day-slot-actions {
    align-items: flex-start;
  }

  .schedule-summary-grid {
    gap: 10px;
  }

  .schedule-summary-card:not(:last-child) {
    padding-right: 0;
    border-right: 0;
  }

  .schedule-context-actions {
    justify-content: flex-start;
  }

  .schedule-plan-bar {
    grid-template-columns: 1fr;
  }

  .schedule-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-board {
    grid-template-columns: repeat(7, minmax(160px, 1fr));
  }

  .month-grid-shell {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .month-grid {
    min-width: 680px;
  }

  .month-cell {
    min-height: 0;
  }
}
