:root {
  color-scheme: light;
  --bg: #e5e7e8;
  --panel: #ffffff;
  --text: #1d2525;
  --muted: #657172;
  --line: #d9dfdd;
  --accent: #1167a8;
  --accent-dark: #0d4f82;
  --danger: #b42318;
  --shadow: 0 12px 30px rgba(28, 42, 41, 0.08);
  --shift-group-col: 300px;
  --shift-person-col: 300px;
  --shift-row-height: 39px;
  --shift-gap-height: 10px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.auth-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 28px 18px;
  background:
    linear-gradient(135deg, rgba(17, 103, 168, 0.2), rgba(16, 24, 32, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 72px),
    #101820;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(17, 103, 168, 0.26) 38% 44%, transparent 44% 100%),
    linear-gradient(115deg, transparent 0 56%, rgba(255, 255, 255, 0.1) 56% 58%, transparent 58% 100%);
  transform: translateX(-8%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  text-align: left;
}

.brand-shield {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 112px;
  height: 96px;
  clip-path: polygon(10% 0, 90% 0, 100% 18%, 100% 72%, 50% 100%, 0 72%, 0 18%);
  background: linear-gradient(145deg, #101820 0%, #1c313f 58%, #1167a8 100%);
  box-shadow: inset 0 0 0 3px #ffffff, 0 10px 22px rgba(16, 24, 32, 0.18);
}

.brand-shield::after {
  content: "";
  position: absolute;
  right: 11px;
  bottom: 11px;
  left: 11px;
  height: 5px;
  border-radius: 999px;
  background: #c8d3da;
}

.brand-shield::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  left: 13px;
  height: 4px;
  border-radius: 999px;
  background: #c8d3da;
  opacity: 0.9;
}

.brand-shield strong {
  color: #ffffff;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.brand-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-tabs {
  display: inline-flex;
  gap: 6px;
  margin: 24px 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(28, 42, 41, 0.08);
}

.auth-form {
  display: none;
  gap: 16px;
  text-align: left;
}

.auth-form.is-active {
  display: grid;
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
}

.register-section {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.register-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.register-section h2 {
  margin: 0;
  color: #24302f;
  font-size: 16px;
}

.form-message {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.form-message[data-type="error"] {
  color: var(--danger);
}

.form-message[data-type="success"] {
  color: #0f766e;
}

.required-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 34px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.password-toggle::before {
  content: "";
  width: 18px;
  height: 11px;
  border: 2px solid var(--muted);
  border-radius: 999px 999px 8px 8px;
  transform: translateY(-50%) rotate(-8deg);
}

.password-toggle::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  transform: translateY(-50%);
}

.password-toggle.is-visible::before {
  border-color: var(--accent);
}

.password-toggle.is-visible::after {
  background: var(--accent);
}

.caps-warning {
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 22px 32px 20px;
  background: #51585b;
  color: #ffffff;
}

.user-area {
  position: absolute;
  top: 50%;
  right: 32px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: #dce7e4;
  font-size: 14px;
  font-weight: 700;
}

.app-brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.app-logo {
  width: 66px;
  height: 58px;
  box-shadow: inset 0 0 0 2px #ffffff, 0 8px 18px rgba(16, 24, 32, 0.16);
}

.app-logo::before {
  top: 8px;
  right: 9px;
  left: 9px;
  height: 3px;
}

.app-logo::after {
  right: 9px;
  bottom: 8px;
  left: 9px;
  height: 4px;
}

.app-logo strong {
  font-size: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 32, 0.58);
}

.modal-panel {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(16, 24, 32, 0.26);
  padding: 22px;
}

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

.modal-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.profile-form {
  display: grid;
  gap: 16px;
}

.admin-panel {
  width: min(1120px, 100%);
}

.admin-gate-panel {
  width: min(420px, 100%);
}

.pin-inputs {
  display: grid;
  grid-template-columns: repeat(4, 54px);
  gap: 10px;
  justify-content: center;
}

.pin-inputs input {
  height: 58px;
  padding: 0;
  text-align: center;
  font-size: 26px;
  font-weight: 900;
}

.admin-table-wrap {
  box-shadow: none;
}

.admin-table {
  min-width: 1180px;
}

.admin-table select {
  min-width: 110px;
}

.admin-work-field-control {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 24px;
  align-items: center;
  gap: 8px;
  min-width: 230px;
}

.admin-work-field-control select {
  width: 100%;
  min-width: 190px;
}

.work-role-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 0;
  border: 1px solid #8fc5ec;
  border-radius: 50%;
  background: #e8f4ff;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
}

.work-role-hint.can-manage {
  border-color: #8fc5ec;
  background: #e8f4ff;
  color: var(--accent);
}

.work-role-hint.is-empty {
  border-color: #ffd1cb;
  background: #fff3f1;
  color: var(--danger);
}

.readonly-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.admin-mode-tab {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: #344241;
  font-weight: 900;
}

.admin-mode-tab.is-active {
  border-color: #aacdc7;
  background: #e8f3f1;
  color: #0f5e57;
}

.admin-mode-panel {
  display: none;
}

.admin-mode-panel.is-active {
  display: block;
}

.admin-audit-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.admin-mode-panel.admin-backup-panel {
  display: none;
}

.admin-mode-panel.admin-backup-panel.is-active {
  display: grid;
  gap: 16px;
  max-width: 720px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.admin-deployment-panel.is-active {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.admin-deployment-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.admin-deployment-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.admin-deployment-grid article {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid #d7e4e1;
  border-radius: 8px;
  background: #fff;
}

.admin-deployment-grid strong,
.admin-deployment-entry strong {
  color: #172026;
}

.admin-deployment-grid span,
.admin-deployment-entry small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-deployment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  align-items: end;
  gap: 10px;
}

.admin-deployment-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-deployment-form textarea,
.admin-deployment-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.admin-deployment-form textarea {
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
}

.admin-deployment-form select {
  min-height: 42px;
  padding: 0 10px;
}

.admin-deployment-actions,
.admin-deployment-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-deployment-list {
  display: grid;
  gap: 10px;
}

.admin-deployment-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d7e4e1;
  border-radius: 8px;
  background: #fff;
}

.admin-deployment-entry > div:first-child {
  display: grid;
  gap: 5px;
}

.admin-deployment-status {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf3f5;
  color: #344241;
  font-size: 11px;
  font-weight: 900;
}

.admin-deployment-status.is-approved,
.admin-deployment-status.is-live-ready {
  background: #e7f7f3;
  color: #0f5e57;
}

.admin-deployment-status.is-review {
  background: #fff7e8;
  color: #9a5b13;
}

.admin-backup-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.admin-backup-head p,
.backup-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.backup-status[data-type="success"] {
  color: #0f766e;
}

.backup-status[data-type="error"] {
  color: var(--danger);
}

.admin-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.backup-import-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.backup-import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.admin-audit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-audit-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-audit-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.admin-audit-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-audit-filters {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(170px, 1.2fr) minmax(150px, 0.8fr) minmax(170px, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.admin-audit-filters label {
  display: grid;
  gap: 6px;
  color: #31413f;
  font-size: 12px;
  font-weight: 900;
}

.admin-audit-filters select,
.admin-audit-filters input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.admin-audit-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.admin-audit-entry {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(220px, 1.2fr) minmax(170px, 0.9fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d8e2e8;
  border-radius: 7px;
  background: #fff;
}

.admin-audit-entry strong,
.admin-audit-entry b {
  display: block;
  color: #172026;
  font-size: 13px;
}

.admin-audit-entry span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-audit-entry p {
  margin: 3px 0 0;
  color: #24302f;
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.admin-audit-entry p span {
  display: inline;
  color: #172026;
  font-size: inherit;
}

.table-action-button {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.admin-check-cell {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.admin-check-cell input {
  width: 18px;
  height: 18px;
}

.delete-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.eyebrow,
.subtitle,
.creator,
.section-heading p,
.empty-state {
  color: var(--muted);
}

.app-header .eyebrow,
.app-header .subtitle,
.app-header .creator {
  color: #c7d3d0;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.subtitle,
.creator,
.section-heading p {
  margin-bottom: 0;
}

.creator {
  position: fixed;
  right: 15px;
  bottom: 10px;
  z-index: 2;
  color: #777777;
  flex: 0 0 auto;
  font-size: 13px;
  text-align: right;
}

.app-header .creator {
  color: #777777;
}

.app-clock {
  position: fixed;
  bottom: 14px;
  left: 18px;
  z-index: 6;
  min-width: 190px;
  padding: 7px 10px;
  border: 1px solid #cad7d4;
  border-radius: 8px;
  background: rgba(248, 250, 249, 0.96);
  color: #24302f;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  box-shadow: var(--shadow);
}

.global-vehicle-search {
  position: absolute;
  top: 12px;
  left: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(260px, 420px);
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border: 1px solid #cad7d4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(31, 46, 43, 0.08);
}

.global-vehicle-search span {
  color: #344241;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.global-vehicle-search input {
  min-height: 32px;
  padding: 7px 10px;
  border-color: #b8c9c5;
  background: #f8faf9;
  font-size: 13px;
  font-weight: 800;
}

.global-vehicle-search small {
  grid-column: 2;
  min-height: 14px;
  margin-top: -5px;
  color: #0f5e57;
  font-size: 11px;
  font-weight: 900;
}

.global-vehicle-search small.is-error {
  color: var(--danger);
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 14px 32px 0;
}

.online-panel {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 300px;
  max-height: none;
  overflow: visible;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.online-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 0;
}

.online-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 12px;
}

.online-header span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #e8f3f1;
  color: #0f5e57;
  font-size: 12px;
  font-weight: 900;
}

.online-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.online-avatar,
.online-empty-compact {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: #e8f3f1;
  color: #0f5e57;
  font-size: 12px;
  font-weight: 900;
  cursor: default;
}

.online-avatar.is-current {
  border-color: #ffffff;
  background: #17a36b;
  color: #ffffff;
}

.online-empty-compact {
  opacity: 0.72;
}

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

.online-section + .online-section {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.online-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.online-section-title strong {
  color: #172026;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.online-section-title span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #edf3f5;
  color: #344241;
  font-size: 12px;
  font-weight: 900;
}

.online-work-group {
  display: grid;
  gap: 6px;
}

.online-work-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.online-work-list {
  display: grid;
  gap: 6px;
}

.online-user {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.online-user.is-current {
  border-color: #b8d8d2;
  background: #eef8f5;
}

.online-user.is-upcoming {
  border-color: #e7c35f;
  background: #fff9e8;
}

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #2f8f45;
  box-shadow: 0 0 0 4px rgba(47, 143, 69, 0.14);
}

.online-user.is-upcoming .online-dot {
  background: #d69200;
  box-shadow: 0 0 0 4px rgba(214, 146, 0, 0.16);
}

.online-user strong,
.online-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-user strong {
  color: var(--text);
  font-size: 13px;
}

.online-user small,
.online-empty {
  color: var(--muted);
  font-size: 12px;
}

.online-user small {
  line-height: 1.35;
  white-space: normal;
}

.online-empty {
  margin: 0;
}

.tab-button,
.primary-button,
.secondary-button,
.delete-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tab-button {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.tab-button.is-active {
  background: var(--panel);
  color: var(--text);
  border-color: var(--panel);
  box-shadow: var(--shadow);
}

.tab-button.has-alert {
  border-color: #e6a23c;
  background: #fff3d9;
  color: #7a4500;
}

.secondary-button.has-alert {
  border-color: #e6a23c;
  background: #fff3d9;
  color: #7a4500;
  box-shadow: 0 0 0 3px rgba(230, 162, 60, 0.22);
}

.tab-button.has-alert.is-active {
  background: #ffe5b3;
  border-color: #e6a23c;
  color: #5f3400;
}

.tab-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid #cfd8df;
  background: #eef2f1;
  color: #42504f;
  font-size: 12px;
  font-weight: 900;
}

.tab-button.has-alert .tab-count {
  border-color: #e6a23c;
  background: #e6a23c;
  color: #ffffff;
}

main {
  padding: 24px 32px 40px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

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

#shift-title {
  font-size: 32px;
}

#overview-title {
  text-align: center;
}

.form-panel,
.table-wrap,
.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.form-required-note {
  justify-self: end;
  margin: -4px 0 -8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
}

.entry-block {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.entry-block h3 {
  margin: 0;
  color: #24302f;
  font-size: 16px;
}

.schedule-grid {
  grid-template-columns: minmax(190px, 240px) 1fr;
  align-items: end;
}

.appointment-estimated-check {
  align-self: end;
  white-space: nowrap;
}

.appointment-estimated-check,
.inline-checks .compact-check {
  justify-content: center;
  width: 168px;
  min-height: 34px;
  padding: 0 12px;
  background: #ffffff;
  color: #172026;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.vehicle-grid {
  grid-template-columns: 105px 105px 170px 390px 105px 180px;
  justify-content: start;
  align-items: start;
}

#chassis-number-wrap {
  grid-column: 3 / span 2;
  max-width: 360px;
}

.vehicle-grid .customer-field {
  grid-column: 4;
  min-width: 360px;
}

.vehicle-grid .contact-phone-field {
  grid-column: 4;
  grid-row: 2;
  min-width: 180px;
}

.vehicle-grid .contact-email-field {
  grid-column: 4;
  grid-row: 3;
  min-width: 260px;
}

.vehicle-grid .key-number-field {
  grid-column: 5;
}

.vehicle-grid .payment-box {
  grid-column: 6;
}

.vehicle-grid:has(#chassis-number-wrap:not([hidden])) .customer-field {
  grid-column: 3 / span 2;
  min-width: 360px;
}

.vehicle-grid:has(#chassis-number-wrap:not([hidden])) .contact-phone-field,
.vehicle-grid:has(#chassis-number-wrap:not([hidden])) .contact-email-field {
  grid-column: 3 / span 2;
}

.inline-checks {
  display: grid;
  grid-template-columns: repeat(4, 178px);
  align-items: flex-end;
  gap: 10px;
  min-height: 34px;
}

label {
  display: grid;
  gap: 7px;
  color: #344241;
  font-size: 14px;
  font-weight: 700;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd4d1;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  font: inherit;
  font-weight: 400;
  background: #ffffff;
}

[data-uppercase-license] {
  text-transform: uppercase;
}

.short-input {
  max-width: 88px;
}

.money-field {
  position: relative;
  display: block;
}

.money-field input {
  padding-right: 34px;
}

.money-field span {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted);
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.payment-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.payment-box h4 {
  margin: 0;
  color: #24302f;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f8faf9;
}

legend {
  padding: 0 6px;
  font-weight: 700;
}

.check-option {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.check-option input {
  width: auto;
}

.compact-check {
  min-height: 30px;
  width: fit-content;
  padding: 0 9px;
  font-size: 13px;
}

.inline-checks .compact-check {
  color: #344241;
  font-weight: 900;
}

.schedule-grid .check-option.compact-check {
  justify-content: flex-start;
  box-sizing: border-box;
  width: 178px !important;
  min-width: 178px !important;
  max-width: 178px !important;
}

.schedule-grid .inline-checks .check-option.compact-check {
  width: 178px !important;
  min-width: 178px !important;
  max-width: 178px !important;
}

input.is-disabled,
input:disabled {
  color: #8b9495;
  background: #e4e7e8;
  cursor: not-allowed;
}

label.is-disabled,
.payment-box:has(input:disabled) {
  opacity: 0.62;
}

fieldset.is-disabled {
  opacity: 0.55;
  background: #e4e7e8;
}

fieldset:disabled .check-option,
fieldset:disabled input {
  cursor: not-allowed;
}

.order-type-option {
  align-items: center;
  justify-content: space-between;
  min-width: 250px;
}

.order-type-option span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.order-type-option .job-count {
  width: 82px;
  min-height: 32px;
  padding: 6px 8px;
}

.work-builder {
  display: grid;
  gap: 14px;
}

.work-builder h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.work-builder p,
.empty-work-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

#work-sections {
  display: grid;
  gap: 14px;
}

.work-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.work-group h3 {
  margin: 0;
  font-size: 15px;
}

.work-job-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 240px);
  gap: 12px;
  align-items: start;
}

.inline-work-job-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 220px) minmax(180px, 240px) auto;
  gap: 12px;
  align-items: start;
}

.inline-job-done {
  align-self: end;
}

.work-summary {
  display: grid;
  gap: 4px;
}

.work-summary + .work-summary {
  margin-top: 10px;
}

.work-summary ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-summary > strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.job-group-badge {
  display: inline-flex;
  margin-right: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8f3f1;
  color: #0f5e57;
  font-size: 12px;
  font-weight: 900;
}

.work-open-count {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: #fff5df;
  color: #7a4500;
  font-size: 12px;
  font-weight: 900;
}

.work-job-item {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.35fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #d8e2e8;
  border-radius: 7px;
  background: #ffffff;
}

.work-job-item.is-done {
  background: #f3f6f5;
  color: #6f7f7c;
}

.work-job-item.is-done .work-job-main {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #9fb4ad;
}

.work-job-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.job-done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #cfdcda;
  border-radius: 999px;
  background: #f8faf9;
  color: #24302f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.job-done-toggle input {
  width: auto;
}

.job-done-toggle input:disabled {
  cursor: default;
}

.job-note-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.job-note-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.job-note-field textarea {
  min-height: 64px;
  padding: 8px 9px;
  font-size: 13px;
  resize: vertical;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.auth-submit {
  width: 100%;
}

.secondary-button {
  background: #eef2f1;
  color: var(--text);
  border-color: var(--line);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(135px, 170px));
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #42504f;
  background: #f8faf9;
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e8f3f1;
  color: #0f5e57;
  font-weight: 700;
  white-space: nowrap;
}

.delete-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--danger);
  background: #fff3f1;
  border-color: #ffd1cb;
}

.overview-cards {
  display: grid;
  gap: 14px;
}

.phonebook-toolbar {
  margin-bottom: 14px;
}

.phonebook-toolbar label {
  max-width: 460px;
}

.phonebook-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.phonebook-create-form[hidden] {
  display: none;
}

.phonebook-create-form .phonebook-note-field {
  grid-column: span 4;
}

.phonebook-create-form textarea,
.phonebook-edit-form textarea {
  min-height: 58px;
  resize: vertical;
}

.phonebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.phonebook-card {
  display: grid;
  gap: 14px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.phonebook-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.phonebook-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e8f3f1;
  color: #0f5e57;
  font-weight: 900;
}

.phonebook-card h3 {
  margin: 0;
  color: #172026;
  font-size: 18px;
}

.phonebook-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.phonebook-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid #b8d9d3;
  border-radius: 999px;
  background: #eef8f6;
  color: #0f5e57;
  font-size: 11px;
  font-weight: 900;
}

.phonebook-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.phonebook-note {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: #24302f;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.phonebook-contact-list a,
.phonebook-contact-list span {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.phonebook-card small {
  align-self: end;
  color: var(--muted);
  font-weight: 700;
}

.phonebook-card.is-editing {
  border-color: var(--accent);
}

.phonebook-edit-form {
  display: grid;
  gap: 12px;
}

.phonebook-actions {
  justify-content: flex-end;
}

.overview-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.overview-summary:empty {
  display: none;
}

.overview-mini-timeline {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.overview-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.overview-mini-head strong {
  color: #172026;
  font-size: 14px;
}

.overview-mini-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.overview-mini-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.overview-mini-order {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 7px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 7px;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
  background: #f8faf9;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.overview-mini-order:hover {
  border-color: #8fb8b0;
  background: #eef8f5;
}

.overview-mini-order.is-overdue {
  border-color: #f0b5af;
  background: #fff8f7;
}

.overview-mini-order.is-empty {
  border-style: dashed;
  background: #f5f8f9;
  color: var(--muted);
  cursor: default;
}

.overview-mini-order > span {
  grid-row: span 2;
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #edf3f5;
  color: #344241;
  font-size: 11px;
  font-weight: 900;
}

.overview-mini-order strong {
  color: #172026;
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-mini-order small {
  color: var(--muted);
  min-width: 0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-dashboard {
  display: grid;
  gap: 16px;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.home-stat {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 8px solid #9fb4ad;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.home-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-stat strong {
  color: #172026;
  font-size: 30px;
  line-height: 1;
}

.home-stat.blue {
  border-left-color: #1f6fc7;
  background: #edf6ff;
}

.home-stat.red {
  border-left-color: #c62828;
  background: #fff1ef;
}

.home-stat.yellow {
  border-left-color: #d69200;
  background: #fff4cf;
}

.home-stat.green {
  border-left-color: #2f8f45;
  background: #e8f8ec;
}

.home-stat.violet {
  border-left-color: #7b4bb3;
  background: #f7f1ff;
}

.home-stat.orange {
  border-left-color: #e6a23c;
  background: #fff7e8;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
}

.home-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.home-panel-head,
.home-today-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-panel-head h3 {
  margin: 0;
  color: #172026;
  font-size: 17px;
}

.home-panel-head span,
.home-today-title span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #edf3f5;
  color: #344241;
  font-size: 12px;
  font-weight: 900;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}

.home-action {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.home-action:hover {
  border-color: #8fb8b0;
  background: #eef8f5;
}

.home-action strong {
  font-size: 14px;
}

.home-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.home-lead-shift {
  display: grid;
  justify-items: center;
}

.home-lead-shift .home-today-block {
  width: min(560px, 100%);
  text-align: center;
  background: #eef8f5;
}

.home-lead-shift .home-person {
  text-align: left;
}

.home-today-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.home-today-title strong {
  font-size: 13px;
}

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

.home-person {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
  background: #ffffff;
}

.home-person strong {
  color: #172026;
  font-size: 13px;
}

.home-person span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-priority-list {
  display: grid;
  gap: 10px;
}

.home-priority-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.home-priority-order h4 {
  margin: 8px 0 3px;
  color: #172026;
  font-size: 15px;
}

.home-priority-order p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-handover-wrap,
.home-handover-chat {
  display: grid;
  gap: 10px;
}

.home-handover-list {
  display: grid;
  gap: 12px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.home-handover-group {
  display: grid;
  gap: 7px;
}

.home-handover-group h4 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-handover-group > div {
  display: grid;
  gap: 8px;
}

.home-handover-entry {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
  background: #f8faf9;
}

.home-handover-entry.is-pinned {
  border-color: #e6a23c;
  background: #fff8ea;
}

.home-handover-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.home-handover-entry-head > div:first-child {
  display: grid;
  gap: 2px;
}

.home-handover-entry strong {
  color: #172026;
  font-size: 13px;
}

.home-handover-entry span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.home-handover-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.home-handover-entry-actions button {
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #cfd8df;
  border-radius: 6px;
  background: #ffffff;
  color: #344241;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.home-handover-entry-actions select {
  min-height: 26px;
  padding: 4px 7px;
  border: 1px solid #cfd8df;
  border-radius: 6px;
  background: #ffffff;
  color: #344241;
  font-size: 11px;
  font-weight: 900;
}

.home-handover-entry-actions button:hover {
  border-color: #8fb8b0;
  background: #eef8f5;
}

.home-handover-entry p {
  margin: 0;
  color: #273536;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-wrap;
}

.home-handover-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
}

.home-handover-form textarea {
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
}

.overview-summary-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.overview-summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.overview-summary-item strong {
  color: #172026;
  font-size: 24px;
  line-height: 1;
}

.overview-workload {
  margin-bottom: 14px;
}

.overview-workload:empty {
  display: none;
}

.overview-workload-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.overview-workload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.overview-workload-head h3 {
  margin: 0;
  color: #172026;
  font-size: 18px;
}

.overview-workload-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.overview-workload-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f3f1;
  color: #0f5e57;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.overview-quick-search {
  display: inline-flex;
  align-items: center;
  width: min(150px, 100%);
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid #cfd8df;
  border-radius: 999px;
  background: #ffffff;
  color: #526160;
}

.overview-quick-search input {
  width: 100%;
  min-width: 0;
  min-height: 20px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172026;
  font-size: 12px;
  font-weight: 800;
}

.overview-quick-search input::placeholder {
  color: #7b8794;
}

.overview-workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.overview-workload-groups {
  display: grid;
  gap: 16px;
}

.overview-workload-group {
  display: grid;
  gap: 10px;
}

.overview-workload-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
  background: #edf3f5;
}

.overview-workload-group-head h4 {
  margin: 0;
  color: #172026;
  font-size: 14px;
}

.overview-workload-group-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.overview-workload-group-head span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: #344241;
  font-size: 12px;
  font-weight: 900;
}

.overview-workload-person {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
  background: #f8faf9;
}

.overview-workload-person.is-now {
  border-color: #8acb92;
  background: #effaf1;
}

.overview-workload-person.is-upcoming {
  border-color: #e7c35f;
  background: #fff9e8;
}

.overview-workload-person.is-done,
.overview-workload-person.is-away {
  opacity: 0.78;
  background: #f1f4f6;
}

.overview-workload-person-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.overview-workload-person-head strong,
.overview-workload-person-head span {
  display: block;
}

.overview-workload-person-head strong {
  color: #172026;
  font-size: 14px;
}

.overview-workload-person-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.overview-workload-person-head b {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: #edf3f5;
  color: #344241;
  font-size: 12px;
}

.overview-workload-status {
  margin: -2px 0 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: #ffffff;
  color: #344241;
  font-size: 12px;
  font-weight: 900;
}

.overview-workload-person.is-now .overview-workload-status {
  background: #dff5df;
  color: #1d6730;
}

.overview-workload-person.is-upcoming .overview-workload-status {
  background: #fff0b8;
  color: #6d4700;
}

.overview-workload-orders {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.overview-workload-orders li.is-empty {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px dashed #cfd8df;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.overview-workload-orders li.is-empty span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #e9eef2;
  color: #526160;
  font-size: 12px;
}

.overview-workload-orders li.is-empty strong {
  color: var(--muted);
  font-size: 13px;
}

.overview-workload-orders li.is-empty.is-drag-over,
.overview-workload-orders button.is-drag-over {
  border-color: #2f8f83;
  background: #e7f7f3;
  box-shadow: inset 0 0 0 1px #2f8f83;
}

.overview-workload-orders button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.overview-workload-orders button:hover {
  border-color: #8fb8b0;
  background: #eef8f5;
}

.overview-workload-orders button[draggable="true"] {
  cursor: grab;
}

.overview-workload-orders button.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.overview-workload-orders button.is-shifted-conflict {
  border-color: #e6a23c;
  background: #fff7e8;
  box-shadow: 0 0 0 2px rgba(230, 162, 60, 0.18);
  animation: shiftedConflictPulse 1.1s ease-in-out 2;
}

.overview-workload-orders button.is-search-hit {
  border-color: #0f5e57;
  background: #e7f7f3;
  box-shadow: 0 0 0 4px rgba(15, 94, 87, 0.2);
  animation: search-hit-pulse 1.35s ease-out;
}

@keyframes shiftedConflictPulse {
  0% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(2px);
  }
  100% {
    transform: translateY(0);
  }
}

.overview-workload-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  width: 100%;
  padding: 6px 10px;
  border: 1px dashed #9fb0b6;
  border-radius: 8px;
  background: #f5f8f9;
  color: #344241;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.overview-workload-toggle button:hover {
  border-color: #7fa9a2;
  background: #eef8f5;
}

.overview-workload-orders button > span {
  grid-row: span 2;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #edf3f5;
  color: #344241;
  font-size: 12px;
  font-weight: 900;
}

.overview-workload-orders strong {
  color: #172026;
  font-size: 13px;
}

.overview-workload-orders small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.order-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.order-card.is-search-hit {
  animation: search-hit-pulse 1.35s ease-out;
  box-shadow: 0 0 0 4px rgba(15, 94, 87, 0.2), var(--shadow);
}

@keyframes search-hit-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 94, 87, 0.45), var(--shadow);
  }

  55% {
    box-shadow: 0 0 0 8px rgba(15, 94, 87, 0.18), var(--shadow);
  }

  100% {
    box-shadow: 0 0 0 4px rgba(15, 94, 87, 0.2), var(--shadow);
  }
}

.overview-order-card {
  position: relative;
  overflow: hidden;
}

.overview-order-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: #9fb4ad;
}

.overview-order-card.is-cash-payer::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 8px;
  width: 5px;
  background: var(--danger);
}

.overview-order-card.is-shuttle-risk {
  box-shadow: inset 0 0 0 2px #c93b3b, var(--shadow);
}

.overview-order-card.is-priority::before {
  background: #e6a23c;
}

.overview-order-card.is-overdue::before {
  background: #c93b3b;
}

.overview-order-card.is-in-progress {
  border-color: #8bb9ee;
  background: #edf6ff;
  box-shadow: inset 0 0 0 1px #c8dff8, var(--shadow);
}

.overview-order-card.is-in-progress::before {
  background: #1f6fc7;
}

.overview-order-card.is-in-progress .order-priority-item,
.overview-order-card.is-in-progress .order-work,
.overview-order-card.is-in-progress .order-field {
  border-color: #c8dff8;
  background: #f8fbff;
}

.overview-order-card.is-waiting-parts {
  border-color: #e5b42f;
  background: #fff4cf;
  box-shadow: inset 0 0 0 1px #f3d47a, var(--shadow);
}

.overview-order-card.is-waiting-parts::before {
  background: #d69200;
}

.overview-order-card.is-waiting-parts .order-priority-item,
.overview-order-card.is-waiting-parts .order-work,
.overview-order-card.is-waiting-parts .order-field {
  border-color: #f0ce66;
  background: #fffaf0;
}

.overview-order-card.is-waiting-approval {
  border-color: #e5b42f;
  background: #fff4cf;
  box-shadow: inset 0 0 0 1px #f3d47a, var(--shadow);
}

.overview-order-card.is-waiting-approval::before {
  background: #d69200;
}

.overview-order-card.is-waiting-approval .order-priority-item,
.overview-order-card.is-waiting-approval .order-work,
.overview-order-card.is-waiting-approval .order-field {
  border-color: #f0ce66;
  background: #fffaf0;
}

.overview-order-card.is-returning {
  border-color: #c9b1e4;
  background: #f7f1ff;
}

.overview-order-card.is-returning::before {
  background: #7b4bb3;
}

.overview-order-card.is-returning .order-priority-item,
.overview-order-card.is-returning .order-work,
.overview-order-card.is-returning .order-field {
  background: #fbf8ff;
}

.overview-order-card.is-finished {
  border-color: #76bd7f;
  background: #e8f8ec;
  box-shadow: inset 0 0 0 1px #b8dfbe, var(--shadow);
}

.overview-order-card.is-finished::before {
  background: #2f8f45;
}

.overview-order-card.is-finished .order-priority-item,
.overview-order-card.is-finished .order-work,
.overview-order-card.is-finished .order-field {
  border-color: #b9dfbd;
  background: #f6fff7;
}

.overview-order-card.is-overdue {
  border-color: #d8463d;
  background: #fff1ef;
  box-shadow: inset 0 0 0 2px #e06a62, var(--shadow);
}

.overview-order-card.is-overdue::before {
  background: #c62828;
}

.overview-order-card.is-overdue .order-priority-item,
.overview-order-card.is-overdue .order-work,
.overview-order-card.is-overdue .order-field {
  border-color: #f0b5af;
  background: #fff8f7;
}

.assignment-card {
  position: relative;
  border-color: #e6a23c;
  background: #fffaf0;
}

.assignment-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  border-radius: 8px 0 0 8px;
  background: #e6a23c;
}

.assignment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 8px;
  border-radius: 999px;
  padding: 0 10px;
  background: #ffe5b3;
  color: #7a4500;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.order-card h3 {
  margin: 0;
  font-size: 22px;
}

.order-title-block {
  display: grid;
  gap: 5px;
}

.order-customer {
  margin: 0;
  color: #344241;
  font-size: 14px;
  font-weight: 800;
}

.order-priority-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-license {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #0f5e57;
  font-size: 18px;
  font-weight: 900;
}

.order-license small {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2f1;
  color: #42504f;
  font-size: 12px;
  font-weight: 900;
}

.order-age {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.order-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #d8e2e8;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f1;
  color: #24302f;
  font-size: 12px;
  font-weight: 900;
}

.order-badge.status-in-arbeit {
  border-color: #1f6fc7;
  background: #1f6fc7;
  color: #ffffff;
}

.order-badge.status-warten-auf-ersatzteile {
  border-color: #d69200;
  background: #ffd866;
  color: #3f2d00;
}

.order-badge.status-warten-auf-freigabe {
  border-color: #d69200;
  background: #ffd866;
  color: #3f2d00;
}

.order-badge.status-fahrzeug-kommt-wieder {
  border-color: #c9b1e4;
  background: #f1e8ff;
  color: #5d2f91;
}

.order-badge.status-fertig {
  border-color: #2f8f45;
  background: #2f8f45;
  color: #ffffff;
}

.order-badge.danger {
  border-color: #c62828;
  background: #c62828;
  color: #ffffff;
}

.order-badge.appointment {
  border-color: #f1c77c;
  background: #fff5df;
  color: #7a4500;
}

.order-badge.shuttle {
  border-color: #b7d3ee;
  background: #edf6ff;
  color: #285d88;
}

.order-badge.shuttle-risk {
  border-color: #ffc3bd;
  background: #fff3f1;
  color: var(--danger);
}

.order-badge.cash {
  border-color: #ffc3bd;
  background: #fff3f1;
  color: var(--danger);
}

.status-control {
  width: min(180px, 100%);
}

.priority-control {
  width: min(105px, 100%);
}

.status-select {
  min-height: 36px;
  padding: 7px 10px;
}

.overview-order-card.is-in-progress .status-select {
  border-color: #1f6fc7;
  background: #e3f1ff;
}

.overview-order-card.is-waiting-parts .status-select,
.overview-order-card.is-waiting-approval .status-select {
  border-color: #d69200;
  background: #fff0b8;
}

.overview-order-card.is-finished .status-select {
  border-color: #2f8f45;
  background: #e3f7e7;
}

.overview-order-card.is-overdue .status-select {
  border-color: #c62828;
  background: #ffe4e1;
}

.priority-select {
  min-height: 36px;
  padding: 7px 10px;
  font-weight: 900;
}

.order-quickline {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.order-quick-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #d8e2e8;
  border-radius: 7px;
  background: #ffffff;
}

.order-quick-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.order-quick-item strong {
  color: #172026;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.overview-priority-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 10px;
}

.order-priority-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #cfdcda;
  border-radius: 7px;
  background: #ffffff;
}

.order-priority-item.is-waiting-customer {
  border-color: #ffc3bd;
  background: #fff3f1;
}

.order-priority-item.is-waiting-customer span,
.order-priority-item.is-waiting-customer strong {
  color: var(--danger);
  font-weight: 900;
}

.order-priority-item span,
.order-work-priority > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-priority-item strong {
  color: #172026;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.monteur-priority-item {
  gap: 8px;
}

.monteur-select-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.monteur-select-grid.has-add-button {
  grid-template-columns: minmax(0, 1fr) auto;
}

.monteur-select-grid label {
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.monteur-select-grid select {
  min-height: 34px;
  padding: 6px 8px;
  color: #172026;
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.assignee-workload {
  color: #42504f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: none;
}

.monteur-add-button,
.monteur-remove-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-color: #cfd8df;
  border-radius: 999px;
  background: #ffffff;
  color: #172026;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.monteur-add-button:hover,
.monteur-remove-button:hover {
  border-color: #7b8794;
  background: #f1f4f6;
}

.monteur-remove-button {
  border-color: #ffc3bd;
  background: #fff3f1;
  color: var(--danger);
}

.order-work-priority {
  border-color: #cfdcda;
  background: #ffffff;
}

.order-work-priority .work-summary > strong {
  font-size: 14px;
}

.order-work-priority li {
  margin: 4px 0;
}

.order-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.overview-meta {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.order-field,
.order-work {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.order-field.is-cash-payer {
  border-color: #ffc3bd;
  background: #fff3f1;
}

.order-field.is-cash-payer span,
.order-field.is-cash-payer .order-value {
  color: var(--danger);
  font-weight: 900;
}

.order-field.is-shuttle-risk {
  border-color: #ffc3bd;
  background: #fff3f1;
}

.order-field.is-shuttle-risk span,
.order-field.is-shuttle-risk .order-value {
  color: var(--danger);
  font-weight: 900;
}

.order-field span,
.order-work > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-value,
.order-work div {
  overflow-wrap: anywhere;
  color: #24302f;
  font-size: 14px;
}

.order-work {
  background: #ffffff;
}

.card-actions {
  justify-content: flex-end;
}

.order-created-note {
  align-self: center;
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.assignment-actions {
  display: grid;
  grid-template-columns: minmax(220px, 340px) auto;
  align-items: end;
  justify-content: end;
  gap: 10px;
}

.month-jump {
  display: grid;
  grid-template-columns: auto auto minmax(240px, 1fr) minmax(110px, 140px);
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.month-jump-info {
  display: grid;
  gap: 2px;
  min-width: 128px;
  padding-right: 6px;
}

.month-jump-info span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.month-jump-info strong {
  color: var(--text);
  font-size: 15px;
}

.month-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.month-jump-button {
  min-height: 32px;
  min-width: 44px;
  padding: 0 9px;
}

.month-jump-button.is-active {
  border-color: #0f5e57;
  background: #e8f3f1;
  color: #0f5e57;
}

.month-jump-button.is-current-month {
  box-shadow: inset 0 0 0 2px #4b5563;
}

.month-all-button {
  min-width: 58px;
}

.shift-year-picker {
  justify-self: end;
  min-width: 110px;
}

.shift-year-picker select {
  min-height: 32px;
  padding: 5px 8px;
}

.shift-management {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.shift-add-person {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(190px, 240px) auto;
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.shift-add-person input,
.shift-add-person select {
  min-height: 34px;
  padding: 7px 9px;
}

.shift-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.shift-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shift-help {
  margin: -6px 0 14px;
  max-width: 920px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 800;
}

.shift-board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.shift-times-panel {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.shift-times-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.shift-times-head h3 {
  margin: 0;
  color: #172026;
  font-size: 16px;
}

.shift-times-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.shift-times-panel form {
  display: grid;
  gap: 10px;
}

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

.shift-time-row {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 70px 70px;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.shift-time-row span {
  display: grid;
  gap: 2px;
}

.shift-time-row strong {
  color: #172026;
  font-size: 13px;
}

.shift-time-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.shift-time-row input {
  min-width: 0;
  height: 32px;
  padding: 0 4px;
  font-size: 12px;
}

.shift-times-panel.is-readonly button[type="submit"] {
  display: none;
}

#admin-shift-times-panel .shift-times-panel {
  position: static;
  max-width: 520px;
  box-shadow: none;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 2px solid transparent;
}

.legend-dot.today {
  background: #ffffff;
  border-color: #4b5563;
}

.legend-dot.holiday {
  background: #f7e7a6;
  border-color: #b88700;
}

.legend-dot.vacation {
  background: #dff5df;
  border-color: #2f8f45;
}

.legend-dot.training {
  background: #dcecff;
  border-color: #2f6fb5;
}

.legend-dot.early {
  background: #ffffff;
  border-color: #9ca3af;
}

.legend-dot.saturday-early {
  background: #fff0df;
  border-color: #f08a24;
}

.legend-dot.middle {
  background: #e3f7f5;
  border-color: #159e97;
}

.legend-dot.late {
  background: #fff8d9;
  border-color: #d6a900;
}

.legend-dot.worktime {
  background: #cff7d3;
  border-color: #1f9d45;
}

.legend-dot.absent {
  background: #ffe1e1;
  border-color: #c93b3b;
}

.shift-plan-wrap {
  border: 1px solid #9fb4c7;
  background: #eef5f8;
  box-shadow: 0 16px 36px rgba(16, 24, 32, 0.12);
}

.shift-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.shift-table th,
.shift-table td {
  min-width: 38px;
  padding: 5px 4px;
  border: 1.5px solid #000000;
  text-align: center;
}

.shift-table tbody tr:not(.shift-group-separator) {
  height: var(--shift-row-height);
}

.shift-table tbody tr:not(.shift-group-separator) > .shift-person,
.shift-table tbody tr:not(.shift-group-separator) > .shift-day-cell {
  height: var(--shift-row-height);
}

.shift-group,
.shift-person,
.shift-month-title,
.shift-name-title {
  position: sticky;
  z-index: 2;
  text-align: left;
  background: #9cc9f2;
  color: #000000;
}

.shift-group,
.shift-month-title {
  left: 0;
  min-width: var(--shift-group-col);
  width: var(--shift-group-col);
  max-width: var(--shift-group-col);
  font-weight: 900;
}

.shift-person {
  left: var(--shift-group-col);
  min-width: var(--shift-person-col);
  width: var(--shift-person-col);
  max-width: var(--shift-person-col);
}

.shift-person[data-shift-person] {
  cursor: context-menu;
}

.shift-group[data-shift-group] {
  cursor: context-menu;
}

.shift-month-title {
  z-index: 5;
  min-width: var(--shift-group-col);
  width: var(--shift-group-col);
  max-width: var(--shift-group-col);
  text-align: center;
  font-size: 16px;
}

.shift-name-title {
  left: var(--shift-group-col);
  z-index: 5;
  min-width: var(--shift-person-col);
  width: var(--shift-person-col);
  max-width: var(--shift-person-col);
}

.shift-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.shift-table thead .shift-month-title {
  z-index: 4;
}

.shift-month-head {
  background: #ffe900;
  color: #000000;
  font-size: 15px;
  font-weight: 900;
}

.shift-day-head {
  background: #eef5f8;
  color: #000000;
  font-weight: 900;
  vertical-align: top;
}

.shift-day-cell {
  background: #eef5f8;
}

.shift-table tbody tr:nth-child(even) .shift-day-cell:not(.is-weekend):not(.is-holiday):not(.is-vacation):not(.is-training):not(.is-absent):not(.is-worktime):not(.is-late):not(.is-middle):not(.is-saturday-early) {
  background: #f8fbfc;
}

.shift-day-head span,
.shift-day-head small {
  display: block;
}

.shift-day-head small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.shift-day-head.is-weekend,
.shift-day-cell.is-weekend {
  background: #f28a35;
  color: #000000;
}

.shift-day-head.is-sunday,
.shift-day-cell.is-sunday,
.shift-day-head.is-holiday,
.shift-day-cell.is-holiday {
  background: #f28a35;
  color: #000000;
}

.shift-day-head.is-holiday,
.shift-day-cell.is-holiday {
  box-shadow: inset 0 0 0 2px #000000;
}

.shift-day-head.is-holiday span,
.shift-day-head.is-holiday small {
  color: #000000;
  font-weight: 900;
}

.shift-day-cell.is-holiday .shift-cell-input,
.shift-day-cell.is-holiday .shift-cell-view {
  border-color: #000000;
  background: transparent;
  color: #000000;
}

.shift-day-head.is-today,
.shift-day-cell.is-today {
  box-shadow: inset 0 0 0 3px #4b5563;
}

.shift-day-head.is-today span {
  color: #111827;
  font-weight: 900;
}

.shift-day-cell.is-today .shift-cell-input,
.shift-day-cell.is-today .shift-cell-view {
  border-color: #4b5563;
}

.shift-day-cell.is-range-start {
  outline: 3px solid #7c3aed;
  outline-offset: -3px;
}

.shift-table tbody tr:nth-child(even) .shift-person,
.shift-table tbody tr:nth-child(even) .shift-group {
  background: #8fc0ec;
}

.shift-table tbody tr:hover .shift-day-cell {
  filter: brightness(0.96);
}

.shift-table tbody tr:hover .shift-person,
.shift-table tbody tr:hover .shift-group {
  background: #7eb5e8;
}

.shift-group-separator td {
  height: var(--shift-gap-height);
  min-height: var(--shift-gap-height);
  padding: 0;
  border: 0;
  background: #eef5f8;
}

.shift-day-cell.is-vacation,
.shift-day-cell.is-vacation .shift-cell-input,
.shift-day-cell.is-vacation .shift-cell-view {
  background: #dff5df;
  border-color: #2f8f45;
  color: #1d6730;
}

.shift-day-cell.is-worktime,
.shift-day-cell.is-worktime .shift-cell-input,
.shift-day-cell.is-worktime .shift-cell-view {
  background: #cff7d3;
  border-color: #1f9d45;
  color: #007a2f;
}

.shift-day-cell.is-early,
.shift-day-cell.is-early .shift-cell-input,
.shift-day-cell.is-early .shift-cell-view {
  background: #eef5f8;
  border-color: #9ca3af;
  color: #000000;
}

.shift-day-cell.is-saturday-early,
.shift-day-cell.is-saturday-early .shift-cell-input,
.shift-day-cell.is-saturday-early .shift-cell-view {
  background: #fff0df;
  border-color: #f08a24;
  color: #7c3f00;
}

.shift-day-cell.is-middle,
.shift-day-cell.is-middle .shift-cell-input,
.shift-day-cell.is-middle .shift-cell-view {
  background: #e3f7f5;
  border-color: #159e97;
  color: #0f5f5a;
}

.shift-day-cell.is-late,
.shift-day-cell.is-late .shift-cell-input,
.shift-day-cell.is-late .shift-cell-view {
  background: #fff8d9;
  border-color: #d6a900;
  color: #000000;
}

.shift-day-cell.is-training,
.shift-day-cell.is-training .shift-cell-input,
.shift-day-cell.is-training .shift-cell-view {
  background: #dcecff;
  border-color: #2f6fb5;
  color: #174f8f;
}

.shift-day-cell.is-absent,
.shift-day-cell.is-absent .shift-cell-input,
.shift-day-cell.is-absent .shift-cell-view {
  background: #ffe1e1;
  border-color: #c93b3b;
  color: #8f1f1f;
}

.shift-person {
  display: grid;
  gap: 0;
  align-items: center;
  border-right: 2px solid #6e9bc5;
  font-size: 15px;
}

.shift-group {
  vertical-align: middle;
  font-size: 13px;
}

.shift-person strong {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  background: transparent;
}

.shift-person strong > :first-child {
  min-width: 0;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.absence-count {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: #ffe1e1;
  color: #8f1f1f;
  font-size: 12px;
  font-weight: 900;
}

.vacation-count {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: #dff5df;
  color: #1d6730;
  font-size: 12px;
  font-weight: 900;
}

.shift-cell-input {
  width: 32px;
  min-height: 30px;
  padding: 3px;
  border-color: transparent;
  background: transparent;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 2px;
}

.shift-day-cell {
  position: relative;
}

.shift-day-cell.has-comment {
  box-shadow: inset 0 -3px 0 #7c3aed;
}

.shift-cell-comment-view {
  position: absolute;
  top: 1px;
  right: 1px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid #5b21b6;
  border-radius: 999px;
  padding: 0;
  background: #7c3aed;
  color: #ffffff;
  cursor: help;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.shift-cell-comment-view:hover::after,
.shift-cell-comment-view:focus-visible::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 120;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid #1b252b;
  border-radius: 6px;
  background: #172026;
  color: #ffffff;
  content: attr(data-comment-tooltip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  transform: translateX(-50%);
  white-space: normal;
  pointer-events: none;
}

.shift-cell-comment-view:hover::before,
.shift-cell-comment-view:focus-visible::before {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  z-index: 121;
  width: 10px;
  height: 10px;
  background: #172026;
  content: "";
  transform: translateX(-50%) rotate(45deg);
  pointer-events: none;
}

.shift-day-cell[data-shift-cell] {
  cursor: pointer;
}

.context-menu {
  position: fixed;
  z-index: 80;
  min-width: 190px;
  padding: 6px;
  border: 1px solid #1b252b;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(13, 24, 34, 0.22);
}

.context-menu button {
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 9px 10px;
  background: transparent;
  color: #172026;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.context-menu button:hover,
.context-menu button:focus-visible {
  background: #eef5f8;
  outline: none;
}

.shift-info-popup {
  position: fixed;
  z-index: 100;
  width: min(380px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid #1b252b;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(13, 24, 34, 0.24);
}

.shift-info-title {
  margin-bottom: 8px;
  color: #172026;
  font-size: 13px;
  font-weight: 900;
}

.shift-info-body,
.shift-info-body p {
  margin: 0;
  color: #24302f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.shift-info-empty {
  color: var(--muted);
}

.shift-move-field {
  display: grid;
  gap: 8px;
}

.shift-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

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

.shift-history-entry {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #d4dee6;
  border-radius: 6px;
  background: #f6fafc;
}

.shift-history-entry strong {
  color: #172026;
  font-size: 13px;
}

.shift-history-entry p {
  margin: 0;
  color: #24302f;
  font-size: 12px;
  font-weight: 700;
}

.shift-history-entry b {
  color: #172026;
}

.shift-history-entry span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shift-cell-view {
  min-height: 26px;
  min-width: 32px;
  display: grid;
  place-items: center;
  overflow-wrap: anywhere;
  background: transparent;
  color: #24302f;
  font-size: 12px;
  font-weight: 700;
}

.shift-audit-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.shift-audit-panel .section-heading {
  margin-bottom: 12px;
}

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

.shift-audit-entry {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.shift-audit-entry div,
.shift-audit-entry p,
.shift-audit-entry small {
  margin: 0;
}

.shift-audit-entry span,
.shift-audit-entry small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.order-card.is-editing {
  border-color: #b8d8d2;
  background: #fbfdfc;
}

.inline-edit-form {
  display: grid;
  gap: 16px;
}

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

.inline-edit-grid .wide-field {
  grid-column: span 2;
}

.inline-check-group {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.inline-check-group > span {
  flex-basis: 100%;
  color: #344241;
  font-size: 14px;
  font-weight: 700;
}

.inline-fieldset {
  background: #ffffff;
}

.inline-order-type {
  display: grid;
  gap: 10px;
  width: 100%;
}

.inline-work-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.inline-work-list label:first-child {
  grid-column: 1 / -1;
}

.empty-state {
  margin: 18px 0 0;
  text-align: center;
}

@media (max-width: 900px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .global-vehicle-search {
    position: static;
  }

  .app-clock {
    left: 18px;
    bottom: 12px;
  }

  .global-vehicle-search {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .global-vehicle-search small {
    grid-column: auto;
  }

  .app-brand-center {
    justify-content: flex-start;
    text-align: left;
  }

  .user-area {
    position: static;
    transform: none;
  }

  .creator {
    text-align: left;
  }

  .online-panel {
    position: static;
    width: auto;
    max-height: none;
    transform: none;
    margin: 0;
  }

  main {
    padding-right: 32px;
  }

  .form-grid,
  .toolbar,
  .phonebook-create-form,
  .home-layout,
  .home-today-grid,
  .month-jump,
  .shift-add-person,
  .admin-audit-filters,
  .admin-audit-entry,
  .admin-deployment-grid,
  .admin-deployment-form,
  .admin-deployment-entry,
  .shift-audit-entry,
  .overview-summary,
  .overview-workload-head,
  .overview-priority-grid,
  .monteur-select-grid,
  .order-quickline,
  .order-meta,
  .inline-edit-grid,
  .inline-work-list,
  .inline-work-job-row,
  .work-job-item,
  .work-job-row,
  .schedule-grid,
  .vehicle-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .home-stats,
  .home-actions {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .inline-edit-grid .wide-field {
    grid-column: auto;
  }

  .phonebook-create-form .phonebook-note-field {
    grid-column: auto;
  }

  .order-card-header,
  .card-actions,
  .assignment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-actions {
    display: flex;
  }

  .status-control {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .app-header,
  main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .tabs {
    flex-wrap: wrap;
    padding-left: 18px;
    padding-right: 18px;
  }

  h1 {
    font-size: 28px;
  }

  .form-panel {
    padding: 16px;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .home-stats,
  .home-actions {
    grid-template-columns: 1fr;
  }

  .home-priority-order {
    align-items: stretch;
    flex-direction: column;
  }

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