:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d8e0ec;
  --primary: #5e7198;
  --primary-strong: #465a80;
  --primary-soft: #e7edf7;
  --accent: #ef1111;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --shadow: 0 18px 44px rgba(31, 41, 55, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 24px 16px;
}

.brand-block {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.brand-mark {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
}

.brand-block h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.25;
}

.brand-block p {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(94, 113, 152, 0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 16px;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.check-line input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.saved-login-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.saved-login-box > span {
  color: var(--primary-strong);
  font-weight: 700;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px 10px;
  background: rgba(244, 247, 251, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-title img {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.header-title h1 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.25;
}

.header-title span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.logout-button {
  min-height: 44px;
  padding-inline: 12px;
  white-space: nowrap;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.confirm-card {
  width: min(100%, 390px);
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  text-align: center;
}

.confirm-card h2,
.confirm-card p {
  margin: 0;
}

.confirm-card p {
  color: var(--muted);
  line-height: 1.7;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 16px;
  background: #fee2e2;
  color: #b91c1c;
}

.confirm-icon svg {
  width: 26px;
  height: 26px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 420px) {
  .confirm-actions {
    grid-template-columns: 1fr;
  }
}

.content {
  display: grid;
  gap: 14px;
  padding: 14px;
  padding-bottom: 32px;
}

.content > * {
  min-width: 0;
  max-width: 100%;
}

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

.stat {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat b {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 14px 10px;
  background: rgba(244, 247, 251, 0.94);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-button,
.segmented button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  padding: 0 12px;
}

.tab-button.active,
.segmented button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

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

.order-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.order-menu-button {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  text-align: right;
}

.order-menu-button svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.order-menu-button b,
.order-menu-button small {
  display: block;
}

.order-menu-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.order-menu-button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.order-menu-button.active svg,
.order-menu-button.active small {
  color: #fff;
}

.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 12px;
}

.section > * {
  min-width: 0;
  max-width: 100%;
}

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

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

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

.order-edit-form {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.compact-head {
  align-items: flex-start;
}

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

.field span {
  color: var(--muted);
  font-size: 0.84rem;
}

.field small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

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

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

.order-sequence {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.sequence-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--primary-strong);
}

.sequence-step b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}

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

.type-choice-group > div {
  display: grid;
  gap: 8px;
  align-content: start;
}

.type-choice-group strong {
  color: var(--ink);
}

.type-choice-group label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.9rem;
}

.type-choice-group input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.phone-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.phone-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.phone-field b {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 58px;
  padding: 0 10px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-left: 1px solid var(--line);
}

.phone-field input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.phone-field input:focus {
  box-shadow: none;
}

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

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 13px;
  color: #fff;
  background: var(--primary);
  font-weight: 650;
  text-decoration: none;
}

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

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

.button.secondary:hover {
  background: var(--surface-soft);
}

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

.button.danger:hover {
  background: #b91c1c;
}

.button.good {
  background: var(--ok);
}

.button.info {
  background: var(--info);
}

.money-badge {
  color: #465a80;
  background: var(--primary-soft);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
}

.button svg,
.tab-button svg,
.segmented svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.subtle {
  color: var(--muted);
  font-size: 0.86rem;
}

.list {
  display: grid;
  gap: 10px;
}

.order-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 12px;
  align-items: start;
}

.card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(31, 41, 55, 0.05);
}

.card > .worker-color-bar {
  margin: -12px -12px 2px;
}

.order-detail-card.is-return {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fffafa;
}

.worker-game-card {
  overflow: hidden;
  border-color: rgba(94, 113, 152, 0.28);
}

.worker-game-card.locked {
  background: linear-gradient(135deg, #ffffff 0%, #eef3f9 100%);
}

.worker-game-card.compact-finished {
  border-color: rgba(22, 163, 74, 0.22);
  background: #fff;
}

.worker-game-card.compact-finished .expense-box {
  margin-top: 2px;
}

.game-order-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.order-rank {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
  font-size: 1.35rem;
  font-weight: 900;
}

.game-order-head b,
.game-order-head span {
  display: block;
}

.game-order-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.start-order-button {
  width: 100%;
  min-height: 54px;
  font-size: 1rem;
}

.game-locked,
.game-timer,
.order-data-panel,
.delivery-panel,
.assistant-control {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.game-locked {
  display: grid;
  gap: 4px;
  color: var(--primary-strong);
}

.game-locked span {
  color: var(--muted);
  font-size: 0.86rem;
}

.game-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--primary-soft);
}

.game-timer span {
  color: var(--muted);
}

.game-timer b {
  color: var(--primary-strong);
}

.order-data-panel,
.delivery-panel {
  display: grid;
  gap: 10px;
}

.order-data-panel > b,
.delivery-panel > b {
  color: var(--primary-strong);
}

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

.delivery-panel-head b,
.delivery-panel-head span {
  display: block;
}

.delivery-panel-head b {
  color: var(--primary-strong);
}

.delivery-panel-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.delivery-fields {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.delivery-fields[hidden] {
  display: none;
}

.delivery-fields > b {
  color: var(--primary-strong);
  font-size: 0.95rem;
}

.delivery-extra {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.delivery-extra summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 800;
}

.delivery-extra[open] summary {
  margin-bottom: 8px;
}

.done-fields {
  border-color: rgba(22, 163, 74, 0.24);
  background: #f0fdf4;
}

.postponed-fields {
  border-color: rgba(239, 17, 17, 0.18);
  background: #fff7f7;
}

.canceled-fields {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fef2f2;
}

.canceled-fields span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.visit-fee-fields {
  border-color: rgba(8, 145, 178, 0.24);
  background: #ecfeff;
}

.delivery-submit {
  width: 100%;
}

.assistant-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assistant-control span {
  color: var(--muted);
  font-weight: 700;
}

.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: 750;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Keep long management lists cheap to render until a card approaches the viewport. */
.list > .card,
.order-card-grid > .card,
.customer-history-list > .card,
.assignment-worker-lane,
.worker-game-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 240px;
}

.inventory-segmented {
  max-width: 560px;
  margin-top: 14px;
}

.inventory-kit-grid,
.inventory-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 14px;
}

.inventory-admin-grid > *,
.inventory-admin-grid form,
.inventory-admin-grid .fault-stock-priority,
.inventory-admin-grid .spare-catalog-picker {
  min-width: 0;
  max-width: 100%;
}

.inventory-kit-card {
  align-self: start;
}

.inventory-kit-card > summary,
.inventory-category-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.inventory-kit-card > summary::-webkit-details-marker,
.inventory-category-card > summary::-webkit-details-marker {
  display: none;
}

.inventory-kit-card summary span:first-child {
  display: grid;
  gap: 4px;
}

.inventory-kit-card summary small {
  color: var(--muted);
  font-weight: 500;
}

.inventory-item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}

.inventory-item-chips span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 0.84rem;
}

.inventory-hero {
  margin-bottom: 16px;
}

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

.inventory-management-option {
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  text-align: right;
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.inventory-management-option:hover,
.inventory-management-option:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 9px 24px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.inventory-management-option.active {
  border-color: var(--primary);
  background: linear-gradient(145deg, #eff6ff, #fff);
  box-shadow: inset 0 0 0 1px var(--primary), 0 10px 24px rgba(37, 99, 235, 0.11);
}

.inventory-management-option-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.inventory-management-option.active .inventory-management-option-icon {
  background: var(--primary);
  color: #fff;
}

.inventory-management-option-icon svg {
  width: 20px;
  height: 20px;
}

.inventory-management-option > span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.inventory-management-option b,
.inventory-management-option small {
  overflow-wrap: anywhere;
}

.inventory-management-option small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.fault-stock-control {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 20px;
  background: linear-gradient(145deg, #f8fbff, #eef5ff);
}

.fault-stock-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.fault-stock-control-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #fff;
}

.fault-stock-control-card.low {
  border-color: rgba(220, 38, 38, 0.34);
  box-shadow: inset 4px 0 0 #dc2626;
}

.fault-stock-control-card > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.fault-stock-control-card > header > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
}

.fault-stock-control-card > header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.fault-stock-control-card > header small {
  color: var(--muted);
  font-size: 0.74rem;
}

.fault-stock-control-card > header strong {
  color: var(--primary-strong);
  white-space: nowrap;
}

.fault-stock-stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: stretch;
  gap: 8px;
}

.fault-stock-stepper .button {
  min-height: 48px;
  padding: 6px;
  font-size: 1.35rem;
}

.fault-stock-stepper > span {
  display: grid;
  place-items: center;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.fault-stock-stepper small {
  color: var(--muted);
  font-size: 0.68rem;
}

.fault-stock-exact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px;
}

.fault-stock-exact-form label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.fault-stock-exact-form label span {
  color: var(--muted);
  font-size: 0.72rem;
}

.fault-stock-exact-form input {
  width: 100%;
  min-width: 0;
}

.inventory-category-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 12px;
}

.inventory-category-list > *,
.inventory-parts-grid > * {
  min-width: 0;
  max-width: 100%;
}

.inventory-category-tabs {
  display: flex;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 14px;
  padding-bottom: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  contain: inline-size;
  direction: ltr;
  scrollbar-width: thin;
}

.inventory-category-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  direction: rtl;
  cursor: pointer;
}

.inventory-category-tabs button b {
  min-width: 25px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 0.76rem;
}

.inventory-category-tabs button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.inventory-category-tabs button.active b {
  background: rgb(255 255 255 / 18%);
}

.inventory-category-card.open-category {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

.inventory-category-card[open] > summary {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.inventory-parts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 10px;
  margin-top: 12px;
}

.inventory-part-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.6fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) auto;
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.inventory-part-row > div,
.inventory-part-row label {
  display: grid;
  gap: 4px;
}

.inventory-part-row small,
.inventory-part-row label span {
  color: var(--muted);
  font-size: 0.76rem;
}

.inventory-part-row input {
  width: 100%;
}

.inventory-holding-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-holding-card.exhausted {
  opacity: 0.72;
  border-style: dashed;
  background: var(--surface-soft);
}

.inventory-holding-card.negative {
  border-color: rgba(220, 38, 38, 0.34);
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 247, 237, 0.96));
  box-shadow: inset 4px 0 0 #dc2626;
}

.inventory-holding-card.negative > span {
  color: #b91c1c;
  font-weight: 900;
}

.inventory-holding-card small,
.spare-part-use-panel p {
  color: var(--muted);
}

.spare-request-picker {
  display: grid;
  gap: 11px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
}

.spare-request-picker-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.spare-request-picker-title > div {
  display: grid;
  gap: 4px;
}

.spare-request-picker-title b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.spare-request-picker-title b svg {
  width: 18px;
  height: 18px;
}

.spare-request-picker-title span,
.spare-request-selected span,
.spare-request-selected small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.spare-request-search-field {
  position: relative;
}

.spare-request-search-field input {
  min-height: 50px;
  padding-inline-start: 14px;
  border-width: 2px;
  background: #fff;
}

.spare-request-search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.spare-request-selected {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: 11px;
  background: rgba(22, 163, 74, 0.06);
}

.spare-request-selected b {
  color: #0f766e;
}

.spare-request-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 320px;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.spare-request-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  text-align: right;
  cursor: pointer;
}

.spare-request-result > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.spare-request-result b,
.spare-request-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spare-request-result small {
  color: var(--muted);
  font-size: 0.73rem;
}

.spare-request-result strong {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.spare-request-result strong.enough {
  color: #0f766e;
  background: rgba(22, 163, 74, 0.1);
}

.spare-request-result strong.short {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

.spare-request-result.active {
  border-color: #16a34a;
  box-shadow: inset 0 0 0 1px #16a34a;
  background: #f2fbf5;
}

.spare-request-result:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.spare-request-search-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 11px;
  background: #fff;
  text-align: center;
}

.spare-catalog-picker {
  position: relative;
  display: grid;
  gap: 8px;
}

.spare-catalog-search-field input {
  min-height: 52px;
  padding-inline-start: 16px;
  border: 2px solid rgba(37, 99, 235, 0.28);
  background: #fff;
}

.spare-catalog-search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.spare-catalog-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 370px;
  padding: 9px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 13px;
  background: #f8fbff;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
}

.spare-catalog-results[hidden] {
  display: none;
}

.spare-catalog-results-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 3px 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.spare-catalog-results-head b {
  color: var(--primary);
}

.spare-catalog-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  text-align: right;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.spare-catalog-result:hover,
.spare-catalog-result:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.spare-catalog-result > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.spare-catalog-result b,
.spare-catalog-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spare-catalog-result small,
.spare-catalog-selection {
  color: var(--muted);
  font-size: 0.75rem;
}

.spare-catalog-result strong {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #0f766e;
  background: rgba(22, 163, 74, 0.1);
  font-size: 0.72rem;
}

.spare-catalog-selection {
  min-height: 20px;
  line-height: 1.6;
}

.spare-catalog-selection.selected {
  color: #0f766e;
  font-weight: 700;
}

.spare-catalog-empty {
  grid-column: 1 / -1;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.spare-assignment-picker {
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #f8fbff, #f1f6ff);
}

.spare-assignment-results {
  position: static;
  max-height: 390px;
  padding: 8px;
  box-shadow: none;
}

.spare-assignment-selected {
  border-color: rgba(37, 99, 235, 0.2);
  background: #fff;
}

.spare-assignment-result.active {
  border-color: #16a34a;
  box-shadow: inset 0 0 0 1px #16a34a;
  background: #f2fbf5;
}

.spare-assignment-result.unavailable {
  opacity: 0.58;
}

.spare-assignment-result.unavailable strong {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

.spare-assignment-result:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.worker-spare-request-stack {
  display: grid;
  gap: 14px;
}

.worker-spare-request-primary {
  border-color: rgba(37, 99, 235, 0.2);
  background: linear-gradient(145deg, #fff, #f8fbff);
}

.worker-spare-request-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.worker-spare-request-heading > div,
.worker-custom-spare-request summary > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.worker-spare-request-heading small,
.worker-custom-spare-request summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.worker-spare-request-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.2);
}

.worker-spare-request-icon svg {
  width: 20px;
  height: 20px;
}

.worker-custom-spare-request {
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #fffdf8, #fff8e8);
  overflow: hidden;
}

.worker-custom-spare-request > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.worker-custom-spare-request > summary::-webkit-details-marker {
  display: none;
}

.worker-custom-spare-request > summary .worker-spare-request-icon {
  background: linear-gradient(145deg, #f59e0b, #d97706);
  box-shadow: 0 7px 16px rgba(217, 119, 6, 0.18);
}

.worker-custom-spare-request > summary strong {
  padding: 6px 9px;
  border-radius: 999px;
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  font-size: 0.76rem;
}

.worker-custom-spare-request[open] > summary {
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
}

.worker-custom-spare-request[open] > summary strong {
  color: #fff;
  background: #d97706;
}

.worker-custom-spare-request-form {
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 680px) {
  .spare-request-picker-title {
    flex-direction: column;
  }

  .spare-request-results,
  .spare-catalog-results {
    grid-template-columns: 1fr;
  }

  .worker-spare-request-heading,
  .worker-custom-spare-request > summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .worker-spare-request-heading > .pill,
  .worker-custom-spare-request > summary strong {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
  }

  .spare-catalog-results-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.spare-usage-list {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: var(--radius);
  background: rgba(22, 163, 74, 0.06);
}

.spare-usage-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding-top: 7px;
  border-top: 1px solid rgba(22, 163, 74, 0.14);
}

.spare-usage-list small,
.inventory-shortage-summary span,
.inventory-shortage-summary small,
.inventory-shortage-row small {
  color: var(--muted);
}

.inventory-shortage-report,
.inventory-critical-block,
.inventory-all-shortages,
.inventory-shortage-selected,
.inventory-shortage-departments {
  display: grid;
  gap: 12px;
}

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

.inventory-shortage-summary > div {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: var(--radius);
  background: #fffafa;
}

.inventory-shortage-summary b {
  color: #b91c1c;
  font-size: 1.25rem;
}

.inventory-critical-block,
.inventory-shortage-selected {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.inventory-shortage-rows {
  display: grid;
  gap: 7px;
}

.inventory-shortage-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(110px, auto));
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.inventory-shortage-row > div {
  display: grid;
  gap: 3px;
}

.inventory-shortage-row.critical {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fff6f6;
}

.inventory-shortage-row > strong {
  color: #b91c1c;
}

.inventory-shortage-departments > div {
  display: grid;
  gap: 7px;
}

.inventory-shortage-departments h4 {
  margin: 0;
  color: var(--primary-strong);
}

@media (max-width: 700px) {
  .inventory-part-row {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-part-row > div,
  .inventory-part-row .button {
    grid-column: 1 / -1;
  }

  .inventory-shortage-summary {
    grid-template-columns: 1fr;
  }

  .inventory-shortage-row {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-shortage-row > div,
  .inventory-shortage-row > strong {
    grid-column: 1 / -1;
  }

  .spare-usage-list > div {
    grid-template-columns: 1fr auto;
  }

  .spare-usage-list small {
    grid-column: 1 / -1;
  }
}

.identity b,
.card-title {
  display: block;
  margin: 0;
  font-size: 0.98rem;
}

.identity span {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
}

.identity b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.worker-swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 50%;
  background: var(--worker-color, var(--primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--worker-color, var(--primary)) 16%, transparent);
}

.worker-color-bar {
  height: 7px;
  margin: -10px -10px 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--worker-color, var(--primary));
}

.badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.admin {
  color: #155e75;
  background: #cffafe;
}

.badge.root {
  color: #92400e;
  background: #fef3c7;
}

.badge.worker {
  color: #166534;
  background: var(--ok-soft);
}

.badge.pending,
.badge.postponed {
  color: #92400e;
  background: #fef3c7;
}

.badge.no_answer {
  color: #334155;
  background: #e2e8f0;
}

.badge.done {
  color: #166534;
  background: var(--ok-soft);
}

.badge.visit_fee {
  color: #155e75;
  background: #cffafe;
}

.badge.incentive {
  color: #166534;
  background: var(--ok-soft);
}

.badge.deduction {
  color: #991b1b;
  background: var(--danger-soft);
}

.badge.money-badge {
  border-color: rgba(94, 113, 152, 0.18);
}

.badge.canceled {
  color: #991b1b;
  background: var(--danger-soft);
}

.badge.approved {
  color: #166534;
  background: var(--ok-soft);
}

.badge.none {
  color: #3f3f46;
  background: #f4f4f5;
}

.info-grid {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

.info-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.info-line svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--primary);
  margin-top: 2px;
}

.invoice-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.invoice-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invoice-actions .button {
  min-height: 38px;
}

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

.invoice-upload-actions .button {
  min-width: 0;
}

.invoice-upload-preview {
  display: none;
  overflow: hidden;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.invoice-upload-preview.visible {
  display: grid;
  place-items: center;
}

.invoice-upload-preview.uploading {
  opacity: 0.65;
}

.invoice-upload-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.small-empty {
  min-height: 44px;
  padding: 8px;
  font-size: 0.78rem;
}

.customer-result,
.admin-disposition-box,
.rollover-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.admin-disposition-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.admin-disposition-box > b {
  font-size: 0.92rem;
}

.order-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(94, 113, 152, 0.18);
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.order-quick-actions .button {
  width: fit-content;
  min-height: 40px;
}

.assignment-grace-note {
  grid-column: 1 / -1;
  color: var(--primary-strong);
  font-size: 0.75rem;
  line-height: 1.4;
}

.finance-transaction-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.finance-transaction-filters > .button {
  width: fit-content;
}

.customer-profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.customer-profile b,
.customer-profile span {
  display: block;
}

.customer-profile span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.customer-lookup-panel {
  border-style: dashed;
}

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

.customer-suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.customer-suggestion b,
.customer-suggestion span,
.customer-suggestion small {
  display: block;
}

.customer-suggestion span,
.customer-suggestion small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.compact-list {
  gap: 8px;
}

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

.mini-order.is-return {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff7f7;
}

.mini-order b,
.mini-order span,
.mini-order small {
  display: block;
}

.mini-order span,
.mini-order small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.customer-create-panel {
  display: grid;
  gap: 10px;
}

.customer-create-panel summary {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 800;
}

.customer-create-panel summary svg {
  width: 18px;
  height: 18px;
}

.account-edit-panel {
  margin-top: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.account-edit-panel[open] summary {
  margin-bottom: 10px;
}

.location-recovery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid #f3b5b5;
  border-radius: var(--radius);
  background: #fff5f5;
}

.location-recovery > div,
.location-recovery span,
.location-recovery small {
  display: grid;
  gap: 5px;
}

.location-recovery b {
  display: flex;
  align-items: center;
  gap: 7px;
}

.location-recovery b svg {
  width: 18px;
  height: 18px;
}

.location-recovery span,
.location-recovery small {
  color: var(--muted);
  line-height: 1.55;
}

.location-recovery.ready {
  border-color: #9dd7ae;
  background: #f1fbf4;
}

.location-recovery.checking {
  border-color: #a9c8ea;
  background: #f3f8fe;
}

.location-permission-tool {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cbd9ee;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f5f9ff, #eef5ff);
}

.location-permission-tool.granted {
  border-color: #9dd7ae;
  background: linear-gradient(135deg, #f3fbf5, #ebf8ef);
}

.location-permission-tool.denied,
.location-permission-tool.unavailable {
  border-color: #f0b3b3;
  background: linear-gradient(135deg, #fff7f7, #fff0f0);
}

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

.location-permission-head > div {
  display: grid;
  gap: 5px;
}

.location-permission-head b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.location-permission-head b svg {
  width: 19px;
  height: 19px;
}

.location-permission-head span {
  color: var(--muted);
  line-height: 1.55;
}

.location-permission-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-strong) !important;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(94, 113, 152, 0.16);
}

.location-settings-guide {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

@media (max-width: 620px) {
  .location-recovery {
    grid-template-columns: 1fr;
  }

  .location-recovery .button {
    width: 100%;
  }

  .location-permission-head {
    align-items: stretch;
    flex-direction: column;
  }

  .location-permission-status {
    align-self: flex-start;
  }
}

.customer-history-list,
.timeline-list {
  display: grid;
  gap: 8px;
}

.customer-history-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.customer-history-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  cursor: pointer;
}

.customer-history-card summary b,
.customer-history-card summary small {
  display: block;
}

.customer-history-card summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.customer-history-card[open] {
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.06);
}

.customer-history-card > .info-grid,
.customer-history-card > .invoice-preview,
.customer-history-card > .expense-list,
.customer-history-card > .timeline-list {
  margin: 0 12px 12px;
}

.timeline-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(94, 113, 152, 0.14);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.timeline-item b {
  font-size: 0.86rem;
}

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

.report-order-list {
  display: grid;
  gap: 10px;
}

.report-mode-section {
  padding-bottom: 0;
}

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

.report-mode-card {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: right;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.06);
  transition: 160ms ease;
}

.report-mode-card:hover,
.report-mode-card:focus-visible {
  border-color: rgba(94, 113, 152, 0.5);
  transform: translateY(-1px);
}

.report-mode-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(94, 113, 152, 0.12), rgba(94, 113, 152, 0.04));
  box-shadow: 0 10px 28px rgba(94, 113, 152, 0.14);
}

.report-mode-card > svg {
  width: 28px;
  height: 28px;
  color: var(--primary-strong);
}

.report-mode-card span {
  display: grid;
  gap: 4px;
}

.report-mode-card b {
  font-size: 1rem;
}

.report-mode-card small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 620px) {
  .report-mode-switch {
    grid-template-columns: 1fr;
  }

  .report-mode-card {
    min-height: 78px;
  }
}

.report-sheet {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.07);
}

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

.report-totals > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(94, 113, 152, 0.18);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.report-totals span {
  color: var(--muted);
  font-size: 0.82rem;
}

.report-totals b {
  color: var(--primary-strong);
  font-size: 1.05rem;
}

.report-order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.report-order-item.is-return {
  border-color: rgba(220, 38, 38, 0.28);
}

.report-order-item b,
.report-order-item span,
.report-order-item small {
  display: block;
}

.report-order-item span,
.report-order-item small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pro-report-order {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
}

.report-order-head,
.report-order-times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.report-order-head > b {
  color: var(--ink);
  font-size: 1rem;
}

.report-order-times {
  padding: 9px 10px;
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.report-order-times span {
  color: var(--primary-strong);
}

.report-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-order-actions .button {
  width: fit-content;
}

.report-order-media .invoice-preview {
  padding: 8px;
}

.report-order-media .invoice-preview img {
  max-height: 120px;
}

.payroll-report {
  gap: 20px;
  border-color: rgba(36, 59, 105, 0.16);
  background: #f7f9fc;
  overflow: hidden;
}

.payroll-report-header {
  display: grid;
  padding: 0;
  margin: -14px -14px 0;
  color: #fff;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.13), transparent 30%),
    linear-gradient(135deg, #172b52, #344f82 55%, #5e7198);
}

.payroll-brand-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.2fr) minmax(190px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
}

.payroll-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.payroll-brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: #fff;
}

.payroll-brand > div {
  display: grid;
  gap: 2px;
}

.payroll-brand b {
  font-size: 1.15rem;
}

.payroll-brand span,
.payroll-period small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.75rem;
}

.payroll-worker-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.7fr);
  gap: 18px;
  align-items: center;
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(0, 0, 0, 0.12);
}

.payroll-report-header .identity {
  align-items: center;
}

.payroll-report-header .avatar {
  width: 68px;
  height: 68px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  font-size: 1.55rem;
}

.payroll-report-header .identity b {
  font-size: 1.25rem;
}

.payroll-report-header .identity span,
.payroll-report-header .identity small {
  display: block;
  color: rgba(255, 255, 255, 0.82);
}

.payroll-worker-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.payroll-worker-meta > div {
  display: grid;
  gap: 3px;
  min-height: 58px;
  align-content: center;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
}

.payroll-worker-meta span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
}

.payroll-worker-meta b {
  color: #fff;
  font-size: 0.84rem;
}

.payroll-equity-verse {
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-align: center;
}

.payroll-period {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.payroll-period > b {
  font-size: 1.05rem;
}

.payroll-net-overview {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 2fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.07);
}

.payroll-net-card {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 126px;
  padding: 18px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #0b665f, #16a34a);
}

.payroll-net-overview.is-negative .payroll-net-card {
  background: linear-gradient(135deg, #991b1b, #dc2626);
}

.payroll-net-card span,
.payroll-net-card small {
  color: rgba(255, 255, 255, 0.8);
}

.payroll-net-card span {
  font-size: 0.8rem;
  font-weight: 750;
}

.payroll-net-card b {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.1;
}

.payroll-net-card small {
  line-height: 1.5;
}

.payroll-equation {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: stretch;
  justify-content: space-between;
  gap: 7px;
}

.payroll-equation > div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.payroll-equation > div span {
  color: var(--muted);
  font-size: 0.7rem;
}

.payroll-equation > div b {
  color: var(--primary-strong);
  font-size: 0.9rem;
}

.payroll-equation > div.positive {
  border-color: rgba(22, 163, 74, 0.23);
  background: rgba(22, 163, 74, 0.06);
}

.payroll-equation > div.negative {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.05);
}

.payroll-equation > div.result {
  border-color: rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.08);
}

.payroll-equation > i {
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 1.15rem;
  font-style: normal;
  font-weight: 900;
}

.payroll-summary-cluster {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(94, 113, 152, 0.16);
  border-radius: 16px;
  background: #fff;
}

.payroll-block-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.payroll-block-heading > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #fff;
  border-radius: 11px;
  background: linear-gradient(135deg, #344f82, #5e7198);
  font-size: 0.78rem;
  font-weight: 900;
}

.payroll-block-heading h2 {
  margin: 0;
  color: #243b69;
  font-size: 1rem;
}

.payroll-block-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

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

.payroll-summary-grid.operations {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.payroll-summary-item {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 96px;
  padding: 13px;
  border: 1px solid rgba(94, 113, 152, 0.18);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.payroll-summary-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: rgba(94, 113, 152, 0.38);
}

.payroll-summary-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.payroll-summary-item b {
  color: var(--primary-strong);
  font-size: 1.05rem;
}

.payroll-summary-item small {
  color: var(--muted);
  line-height: 1.5;
}

.payroll-summary-item.positive {
  border-color: rgba(22, 163, 74, 0.25);
  background: rgba(22, 163, 74, 0.07);
}

.payroll-summary-item.positive::before,
.payroll-summary-item.attendance-count::before {
  background: #16a34a;
}

.payroll-summary-item.final-total {
  border-width: 2px;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.07);
}

.payroll-summary-item.negative {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.05);
}

.payroll-summary-item.negative::before,
.payroll-summary-item.returned-orders-summary::before {
  background: #dc2626;
}

.payroll-summary-item.salary::before,
.payroll-summary-item.orders-summary::before {
  background: #2563eb;
}

.payroll-summary-item.advance::before,
.payroll-summary-item.absence-count::before {
  background: #ca8a04;
}

.payroll-summary-item.attendance-count {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.06);
}

.payroll-summary-item.absence-count {
  border-color: rgba(202, 138, 4, 0.3);
  background: rgba(202, 138, 4, 0.07);
}

.payroll-summary-item.returned-orders-summary {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff7f7;
}

.returned-orders-ledger {
  padding: 16px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: var(--radius);
  background: #fffafa;
}

.returned-orders-ledger .payroll-section-title > span {
  background: #dc2626;
}

.payroll-summary-item.performance.good {
  border-color: rgba(22, 163, 74, 0.28);
}

.payroll-summary-item.performance.warning {
  border-color: rgba(202, 138, 4, 0.35);
}

.payroll-summary-item.performance.danger {
  border-color: rgba(220, 38, 38, 0.28);
}

.report-type-chip {
  display: inline-flex;
  gap: 3px;
  margin: 2px 0 2px 4px;
}

.payroll-detail-section {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(94, 113, 152, 0.16);
  border-radius: 16px;
  background: #fff;
  break-inside: avoid-page;
}

.payroll-detail-section + .payroll-detail-section {
  padding-top: 15px;
}

.attendance-ledger {
  break-inside: auto;
}

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

.payroll-section-title > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(135deg, #344f82, #5e7198);
  font-weight: 800;
}

.payroll-section-title h3,
.payroll-detail-section h4 {
  margin: 0;
}

.payroll-section-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.payroll-detail-section h4 {
  padding: 9px 11px;
  border-right: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 0.88rem;
}

.payroll-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.payroll-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.payroll-table th,
.payroll-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 0.82rem;
}

.payroll-table th {
  color: var(--primary-strong);
  background: #eaf0f9;
}

.payroll-table tbody tr:nth-child(even) {
  background: #fafbfd;
}

.payroll-table tr:last-child td {
  border-bottom: 0;
}

.payroll-ledger {
  display: grid;
  gap: 7px;
}

.payroll-ledger article {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-right: 3px solid rgba(94, 113, 152, 0.5);
  border-radius: 10px;
  background: #fff;
}

.payroll-ledger time,
.payroll-ledger span,
.payroll-ledger small {
  color: var(--muted);
  font-size: 0.78rem;
}

.payroll-ledger b,
.payroll-ledger span {
  display: block;
}

.payroll-ledger strong {
  color: var(--primary-strong);
  white-space: nowrap;
}

.payroll-cancel-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.76rem;
}

.payroll-cancel-button svg {
  width: 15px;
  height: 15px;
}

.payroll-empty {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.daily-assistant-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.8fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
}

.daily-assistant-panel > div {
  display: grid;
  gap: 5px;
}

.daily-assistant-panel > div b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-strong);
}

.daily-assistant-panel > div svg {
  width: 18px;
  height: 18px;
}

.daily-assistant-panel > div span,
.daily-assistant-panel > small {
  color: var(--muted);
  line-height: 1.6;
}

.daily-assistant-panel > small {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.07);
}

.worker-month-calendar-section {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.worker-month-calendar-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.worker-month-weekdays,
.worker-month-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(125px, 1fr));
  min-width: 875px;
}

.worker-month-weekdays span {
  padding: 9px 6px;
  color: #fff;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background: #344f82;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.worker-month-weekdays span:first-child {
  border-radius: 0 10px 0 0;
}

.worker-month-weekdays span:last-child {
  border-radius: 10px 0 0 0;
}

.worker-month-day {
  min-height: 118px;
  padding: 7px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.worker-month-day.empty {
  background: #f3f5f8;
}

.worker-month-day.has-orders {
  background: #fbfdff;
}

.worker-month-day-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: var(--primary-strong);
  background: #eaf0f9;
  font-size: 0.78rem;
}

.worker-month-orders {
  display: grid;
  gap: 5px;
}

.worker-month-order {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 7px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  background: #eef5ff;
  color: var(--text);
  text-align: right;
  cursor: pointer;
}

.worker-month-order b,
.worker-month-order span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-month-order b {
  font-size: 0.72rem;
}

.worker-month-order span {
  color: var(--muted);
  font-size: 0.66rem;
}

.worker-month-order:hover,
.worker-month-order.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.worker-month-order.is-return {
  border-color: rgba(220, 38, 38, 0.34);
  background: #fff1f2;
}

.worker-calendar-order-details {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 15px;
  background: linear-gradient(145deg, #fff, #f4f8ff);
  box-shadow: 0 9px 24px rgba(37, 99, 235, 0.08);
  break-inside: avoid;
}

.worker-calendar-order-details.is-return {
  border-color: rgba(220, 38, 38, 0.28);
  background: linear-gradient(145deg, #fff, #fff5f5);
}

.worker-calendar-order-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(94, 113, 152, 0.16);
}

.worker-calendar-order-details-head > div {
  display: grid;
  gap: 3px;
}

.worker-calendar-order-details-head > div > span,
.worker-calendar-order-details-head small {
  color: var(--muted);
  font-size: 0.76rem;
}

.worker-calendar-order-details-head b {
  font-size: 1rem;
}

.worker-calendar-order-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.worker-calendar-order-facts > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 88px;
  padding: 11px;
  border: 1px solid rgba(94, 113, 152, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.86);
}

.worker-calendar-order-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.worker-calendar-order-facts span svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.worker-calendar-order-facts b {
  line-height: 1.55;
  font-size: 0.88rem;
}

.worker-calendar-order-facts small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.worker-calendar-order-facts .money b {
  color: #0f766e;
  font-size: 1rem;
}

.worker-calendar-order-report {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.worker-calendar-order-report > div {
  padding: 11px 12px;
  border-right: 3px solid var(--primary);
  border-radius: 10px;
  background: #fff;
}

.worker-calendar-order-report span {
  color: var(--primary-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.worker-calendar-order-report p {
  margin: 5px 0 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.worker-order-adjustment {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 13px;
  background: #f2fbf5;
}

.worker-order-adjustment > div:first-child {
  display: grid;
  gap: 3px;
}

.worker-order-adjustment > div:first-child span,
.worker-calendar-hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.worker-calendar-hint {
  padding: 13px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
}

.worker-calendar-hint.locked {
  border-color: rgba(202, 138, 4, 0.34);
  background: rgba(254, 252, 232, 0.9);
  color: #854d0e;
  font-weight: 800;
}

.print-only {
  display: none;
}

@media (max-width: 900px) {
  .payroll-brand-row {
    grid-template-columns: 1fr auto;
  }

  .payroll-equity-verse {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .payroll-worker-row,
  .payroll-net-overview {
    grid-template-columns: 1fr;
  }

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

  .payroll-equation {
    grid-template-columns: 1fr;
  }

  .payroll-equation > div.result {
    grid-column: auto;
  }

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

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

  .payroll-ledger article {
    grid-template-columns: 1fr auto;
  }

  .payroll-ledger article > div {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .payroll-cancel-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 620px) {
  .payroll-report {
    gap: 14px;
  }

  .payroll-brand-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .payroll-equity-verse {
    grid-column: auto;
    grid-row: auto;
    padding: 10px 0;
    border-block: 1px solid rgba(255, 255, 255, 0.13);
  }

  .payroll-period {
    justify-items: start;
  }

  .payroll-worker-row {
    padding: 14px 16px;
  }

  .payroll-worker-meta {
    grid-template-columns: 1fr;
  }

  .payroll-equation {
    grid-template-columns: 1fr;
  }

  .payroll-equation > i {
    min-height: 18px;
  }

  .payroll-summary-grid,
  .payroll-summary-grid.operations {
    grid-template-columns: 1fr;
  }

  .payroll-summary-cluster,
  .payroll-detail-section {
    padding: 12px;
  }

  .daily-assistant-panel {
    grid-template-columns: 1fr;
  }
}

@media print {
  html,
  body {
    height: auto !important;
    overflow: visible !important;
  }

  body {
    background: #fff !important;
  }

  body * {
    visibility: hidden;
  }

  #worker-payroll-report,
  #worker-payroll-report * {
    visibility: visible;
  }

  #worker-payroll-report {
    position: static !important;
    inset: auto !important;
    width: 100%;
    height: auto !important;
    padding: 0;
    overflow: visible !important;
    border: 0;
    box-shadow: none;
  }

  .payroll-report {
    display: block;
    overflow: visible !important;
  }

  .payroll-report > * {
    margin-bottom: 5mm;
  }

  .payroll-brand-row {
    grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.2fr) minmax(150px, 1fr);
  }

  .payroll-equity-verse {
    grid-column: auto;
    grid-row: auto;
    padding: 0;
    border: 0;
  }

  .payroll-worker-row {
    grid-template-columns: minmax(230px, 0.9fr) minmax(0, 1.7fr);
  }

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

  .payroll-net-overview {
    grid-template-columns: minmax(210px, 0.75fr) minmax(0, 2fr);
  }

  .payroll-equation {
    grid-template-columns: repeat(7, auto);
  }

  .payroll-equation > div.result {
    grid-column: auto;
  }

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

  .payroll-summary-grid.operations {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .payroll-report-header,
  .payroll-net-card,
  .payroll-equation > div,
  .payroll-summary-cluster,
  .payroll-detail-section,
  .payroll-summary-item {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .payroll-table-wrap {
    overflow: visible;
  }

  .payroll-table thead {
    display: table-header-group;
  }

  .payroll-table tr {
    break-inside: avoid;
  }

  .payroll-detail-section {
    break-inside: auto;
    page-break-inside: auto;
  }

  .payroll-section-title,
  .payroll-report-header,
  .payroll-net-overview,
  .payroll-summary-cluster,
  .payroll-ledger article,
  .payroll-summary-item,
  .returned-order-row {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .no-print {
    display: none !important;
  }

  .print-only {
    display: grid !important;
  }

  .worker-month-calendar-scroll {
    overflow: visible;
  }

  .worker-month-weekdays,
  .worker-month-calendar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    min-width: 0;
  }

  .worker-month-day {
    min-height: 24mm;
    padding: 1.5mm;
  }

  .worker-month-order {
    padding: 1.5mm;
  }

  body.printing-worker-report *:not(:has(#worker-payroll-report)):not(#worker-payroll-report):not(#worker-payroll-report *) {
    display: none !important;
  }
}

.calendar-summary {
  display: grid;
  gap: 8px;
}

.summary-order {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(160px, 1.4fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(94, 113, 152, 0.18);
  border-radius: var(--radius);
  background: #fff;
}

.summary-order b,
.summary-order span {
  display: block;
}

.summary-order span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.distribution-launcher {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(94, 113, 152, 0.24);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: right;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.07);
}

.distribution-launcher.open {
  border-color: var(--primary);
  background: linear-gradient(90deg, #ffffff, #f7faff);
}

.distribution-launcher .launcher-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
}

.distribution-launcher svg {
  width: 20px;
  height: 20px;
}

.distribution-launcher b,
.distribution-launcher small {
  display: block;
}

.distribution-launcher small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.distribution-launcher strong {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

.distribution-controls {
  display: flex;
  justify-content: flex-end;
}

.distribution-controls .field {
  width: min(220px, 100%);
}

.distribution-shell {
  display: grid;
  gap: 8px;
  max-height: 76vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgba(94, 113, 152, 0.24);
  border-radius: var(--radius);
  background: #060b10;
}

.assignment-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 10px;
}

.assignment-tile {
  min-height: 188px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: #141414;
  color: #f8fafc;
  overflow: hidden;
}

.assignment-tile.assigned {
  background: linear-gradient(180deg, color-mix(in srgb, var(--worker-color, #16a34a) 28%, #101418), #111816 58%, #141414);
  border-color: color-mix(in srgb, var(--worker-color, #16a34a) 55%, transparent);
}

.assignment-tile.unassigned {
  border-color: rgba(239, 68, 68, 0.28);
}

.assignment-tile.selected,
.order-detail-card.selected {
  outline: 3px solid color-mix(in srgb, var(--worker-color, var(--primary)) 42%, transparent);
  outline-offset: 2px;
}

.tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tile-priority input,
.tile-priority b {
  width: 54px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 900;
  text-align: center;
}

.tile-priority input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.tile-main {
  min-width: 0;
}

.tile-main b,
.tile-main span,
.tile-main small,
.tile-address {
  display: block;
}

.tile-main b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
}

.tile-main span,
.tile-main small,
.tile-address {
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.78rem;
  line-height: 1.45;
}

.tile-address {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tile-address span,
.tile-address strong,
.tile-address b {
  display: block;
}

.tile-address strong {
  color: #fff;
  font-weight: 800;
}

.first-order-flag {
  width: fit-content;
  margin-bottom: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.18);
  color: #bbf7d0;
  font-size: 0.68rem;
}

.tile-bars {
  display: grid;
  gap: 6px;
}

.tile-bars span {
  height: 8px;
  border-radius: 999px;
  background: var(--worker-color, #16a34a);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.tile-controls {
  display: grid;
  gap: 6px;
}

.tile-control-label {
  display: grid;
  gap: 4px;
}

.tile-controls span,
.tile-control-label span {
  display: block;
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.78rem;
}

.tile-controls select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 6px 7px;
  font-size: 0.82rem;
}

.tile-controls option {
  color: var(--ink);
}

.tile-detail-button {
  min-height: 34px;
}

.helper-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.helper-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.tile-controls .helper-chip {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.helper-chip input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--worker-color, var(--primary));
}

.assignment-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(278px, 84vw);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x mandatory;
}

.assignment-column {
  min-height: 280px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-snap-align: start;
}

.assignment-column.unassigned {
  border-color: #fca5a5;
  background: #fff7f7;
}

.assignment-column-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.assignment-column-head b,
.assignment-column-head strong {
  display: block;
  font-size: 0.98rem;
}

.assignment-column-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.assignment-column-head > div:last-child {
  text-align: left;
}

.assignment-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.assignment-order {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.assignment-order-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
}

.assignment-order-top b,
.assignment-order-top span {
  display: block;
}

.assignment-order-top span {
  color: var(--muted);
  font-size: 0.78rem;
}

.assignment-time {
  min-width: 52px;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--primary);
  text-align: center;
}

.assignment-time b {
  font-size: 0.92rem;
}

.assignment-order p {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.55;
}

.assignment-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.assignment-meta span {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.assignment-meta svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--primary);
  margin-top: 2px;
}

.assignment-meta b {
  color: var(--primary);
}

.incentive-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.incentive-hero > div {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(94, 113, 152, 0.18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 41, 55, 0.05);
}

.incentive-hero span {
  color: var(--muted);
  font-size: 0.82rem;
}

.incentive-hero b {
  color: var(--primary-strong);
  font-size: 1.15rem;
}

.notice-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(22, 163, 74, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(90deg, #f0fdf4, #ffffff);
}

.notice-card.deduction {
  border-color: rgba(220, 38, 38, 0.24);
  background: linear-gradient(90deg, #fef2f2, #ffffff);
}

.finance-hero > div:nth-child(2) b,
.transaction-card.deduction .amount {
  color: var(--danger);
}

.transaction-card.is-canceled {
  opacity: 0.68;
}

.notice-card b,
.notice-card span {
  display: block;
}

.notice-card > div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.expense-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: var(--radius);
  background: #f8fbff;
}

.expense-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.expense-line b {
  color: var(--primary-strong);
}

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

.remittance-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: var(--radius);
  background: #f0fdf4;
}

.remittance-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.remittance-item b {
  color: var(--ok);
}

.expense-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.expense-box > b {
  font-size: 0.95rem;
}

.review-box summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 800;
}

.review-box summary::marker {
  color: var(--primary);
}

.finance-section[hidden],
.finance-adjustments[hidden] {
  display: none !important;
}

.finance-shortcuts {
  margin-top: 14px;
}

.finance-adjustments:not([hidden]) {
  display: contents;
}

.incentive-request-box {
  display: block;
  overflow: hidden;
  padding: 0;
  border-color: rgba(15, 118, 110, 0.25);
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: var(--radius);
  background: #f0fdfa;
}

.incentive-request-box > summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
  color: var(--primary-strong);
  font-weight: 850;
}

.incentive-request-box > summary::-webkit-details-marker {
  display: none;
}

.incentive-request-box > summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.incentive-request-box > summary svg {
  width: 18px;
  height: 18px;
}

.incentive-request-box > summary small {
  color: var(--muted);
  font-size: 0.76rem;
}

.incentive-request-box[open] > summary {
  border-bottom: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(255, 255, 255, 0.55);
}

.incentive-request-content {
  display: grid;
  gap: 11px;
  padding: 14px;
}

.monthly-changes-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 20px;
  background: linear-gradient(145deg, #f8fbff, #fff);
  box-shadow: var(--shadow);
}

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

.monthly-changes-head > div {
  display: grid;
  gap: 4px;
}

.monthly-changes-head > div > span {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 900;
}

.monthly-changes-head h3,
.monthly-changes-head p {
  margin: 0;
}

.monthly-changes-head p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.monthly-changes-head > strong {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
}

.monthly-change-list {
  display: grid;
  gap: 9px;
}

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

.monthly-change-item.increase {
  border-color: rgba(22, 163, 74, 0.28);
}

.monthly-change-item.decrease,
.monthly-change-item.canceled {
  border-color: rgba(220, 38, 38, 0.22);
}

.monthly-change-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.monthly-change-item.increase .monthly-change-icon {
  background: rgba(22, 163, 74, 0.11);
  color: #15803d;
}

.monthly-change-item.decrease .monthly-change-icon,
.monthly-change-item.canceled .monthly-change-icon {
  background: rgba(220, 38, 38, 0.09);
  color: #b91c1c;
}

.monthly-change-icon svg {
  width: 18px;
  height: 18px;
}

.monthly-change-item > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.monthly-change-item span,
.monthly-change-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.monthly-change-item span {
  font-size: 0.82rem;
}

.monthly-change-item small {
  font-size: 0.72rem;
}

.monthly-change-item > strong {
  color: var(--primary-strong);
  white-space: nowrap;
}

.assignment-empty {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.field.compact {
  gap: 4px;
}

.field.compact select {
  min-height: 38px;
  padding: 7px 9px;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--ink);
  color: #fff;
}

.toast.error {
  background: #991b1b;
}

.toast.good {
  background: #166534;
}

.order-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.status-choice {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
  overflow: hidden;
}

.status-choice input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.status-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  pointer-events: none;
}

.status-choice svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.status-choice:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(94, 113, 152, 0.16);
}

.status-choice.active.done,
.status-choice:has(input:checked).done,
.delivery-panel[data-selected-status="done"] .status-choice.done {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.status-choice.active.postponed,
.status-choice:has(input:checked).postponed,
.delivery-panel[data-selected-status="postponed"] .status-choice.postponed {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.status-choice.active.canceled,
.status-choice:has(input:checked).canceled,
.delivery-panel[data-selected-status="canceled"] .status-choice.canceled {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.status-choice.active.visit-fee,
.status-choice:has(input:checked).visit-fee,
.delivery-panel[data-selected-status="visit_fee"] .status-choice.visit-fee {
  border-color: #0891b2;
  background: #0891b2;
  color: #fff;
}

.table-like {
  display: grid;
  gap: 8px;
}

.table-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.amount {
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}

.photo-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  overflow: hidden;
  display: none;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview.visible {
  display: block;
}

@media (min-width: 720px) {
  .login-screen {
    width: min(100%, 440px);
    margin: 0 auto;
  }

  .content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .section.wide,
  .top-stats {
    grid-column: 1 / -1;
  }

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

  .assignment-board {
    grid-auto-columns: minmax(280px, 1fr);
    grid-auto-flow: column;
  }
}

@media (max-width: 430px) {
  .type-choice-group {
    grid-template-columns: 1fr;
  }

  .customer-suggestion {
    grid-template-columns: 1fr;
  }

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

  .incentive-hero {
    grid-template-columns: 1fr;
  }

  .summary-order {
    grid-template-columns: 1fr;
  }

  .report-order-item {
    grid-template-columns: 1fr;
  }

  .report-totals {
    grid-template-columns: 1fr;
  }

  .distribution-launcher {
    grid-template-columns: auto 1fr;
  }

  .distribution-launcher strong {
    grid-column: 1 / -1;
  }

  .distribution-shell {
    max-height: calc(100vh - 168px);
    padding: 6px;
    overflow-y: auto;
  }

  .assignment-tile-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .assignment-tile {
    min-height: 74px;
    height: 74px;
    gap: 2px;
    padding: 4px;
    overflow: hidden;
    grid-template-rows: auto 1fr auto;
  }

  .tile-priority input,
  .tile-priority b {
    width: 26px;
    height: 22px;
    font-size: 0.92rem;
    padding: 0;
  }

  .assignment-tile .badge {
    min-height: 16px;
    padding: 1px 4px;
    font-size: 0;
  }

  .assignment-tile .badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
  }

  .tile-main b {
    font-size: 0.58rem;
    line-height: 1.2;
  }

  .tile-main span {
    font-size: 0.54rem;
    line-height: 1.2;
  }

  .tile-main small,
  .tile-address,
  .tile-controls {
    display: none;
  }

  .tile-bars {
    gap: 3px;
  }

  .tile-bars span {
    height: 4px;
  }

  .assignment-tile:focus,
  .assignment-tile:focus-within {
    grid-column: span 3;
    height: auto;
    min-height: 178px;
    z-index: 3;
    outline: 2px solid rgba(255, 255, 255, 0.62);
  }

  .assignment-tile:focus .tile-main small,
  .assignment-tile:focus-within .tile-main small,
  .assignment-tile:focus .tile-address,
  .assignment-tile:focus-within .tile-address,
  .assignment-tile:focus .tile-controls,
  .assignment-tile:focus-within .tile-controls {
    display: grid;
  }

  .assignment-tile:focus .tile-main b,
  .assignment-tile:focus-within .tile-main b {
    font-size: 0.86rem;
  }

  .assignment-tile:focus .tile-main span,
  .assignment-tile:focus-within .tile-main span,
  .assignment-tile:focus .tile-main small,
  .assignment-tile:focus-within .tile-main small,
  .assignment-tile:focus .tile-address,
  .assignment-tile:focus-within .tile-address {
    font-size: 0.72rem;
  }

  .assignment-tile:focus .badge,
  .assignment-tile:focus-within .badge {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 0.68rem;
  }

  .assignment-tile:focus .badge::before,
  .assignment-tile:focus-within .badge::before {
    content: none;
  }

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

  .game-order-head {
    grid-template-columns: auto 1fr;
  }

  .game-order-head .badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .assistant-control,
  .game-timer {
    align-items: stretch;
    flex-direction: column;
  }

  .actions .button {
    flex: 1 1 auto;
  }
}

@supports (content-visibility: auto) {
  .order-card-grid > .card,
  .list > .card,
  .list > .notice-card,
  .report-order-list > .report-order-item,
  .assignment-board > .assignment-tile {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
  }
}

/* Fault-service picker and worker no-answer workflow */
.prestart-order-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.worker-game-card.no_answer {
  border-color: rgba(71, 85, 105, 0.3);
  background: linear-gradient(145deg, #fff, #f8fafc);
}

.worker-game-card.no_answer .order-rank {
  background: #475569;
}

.no-answer-reopen-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(71, 85, 105, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
}

.no-answer-reopen-card > div:first-child {
  display: grid;
  gap: 5px;
}

.no-answer-reopen-card span,
.no-answer-reopen-card small {
  color: var(--muted);
  line-height: 1.55;
}

.no-answer-reopen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.worker-no-answer-section {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(71, 85, 105, 0.2);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(145deg, rgba(248, 250, 252, 0.96), rgba(226, 232, 240, 0.72));
}

.worker-no-answer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.worker-no-answer-head > div {
  display: grid;
  gap: 4px;
}

.worker-no-answer-head b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
}

.worker-no-answer-head b svg {
  width: 18px;
  height: 18px;
}

.worker-no-answer-head span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.worker-no-answer-head > strong {
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #475569;
  color: #fff;
}

.status-choice.active.no-answer,
.status-choice:has(input:checked).no-answer,
.delivery-panel[data-selected-status="no_answer"] .status-choice.no-answer {
  border-color: #475569;
  background: #475569;
  color: #fff;
}

.no-answer-fields {
  border-color: rgba(71, 85, 105, 0.24);
  background: #f8fafc;
}

.no-answer-fields span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.fault-service-details {
  padding: 0;
  overflow: hidden;
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(145deg, #fff, #f8fbff);
}

.fault-service-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  list-style-position: inside;
}

.fault-service-details > summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fault-service-details > summary svg {
  width: 18px;
  height: 18px;
}

.fault-service-details > summary small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.delivery-extra.fault-service-details[open] > summary {
  margin-bottom: 0;
  border-bottom: 1px solid rgba(37, 99, 235, 0.14);
  background: rgba(37, 99, 235, 0.05);
}

.fault-service-picker {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.fault-service-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.fault-service-picker-head > div {
  display: grid;
  gap: 4px;
}

.fault-service-picker-head b {
  color: var(--primary-strong);
  font-size: 1rem;
}

.fault-service-picker-head span:not(.fault-service-count) {
  color: var(--muted);
  font-size: 0.8rem;
}

.fault-service-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.74rem;
  font-weight: 800;
}

.fault-service-search input {
  min-height: 48px;
  border-width: 2px;
  background: #fff;
}

.fault-service-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.fault-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 380px;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.fault-service-grid[hidden] {
  display: none;
}

.fault-service-card {
  position: relative;
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 7px 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.fault-service-card:hover,
.fault-service-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.09);
}

.fault-service-card.active {
  border-color: var(--primary);
  background: linear-gradient(145deg, #eff6ff, #fff);
  box-shadow: inset 0 0 0 1px var(--primary), 0 8px 18px rgba(37, 99, 235, 0.1);
}

.fault-service-order {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  grid-row: 1 / -1;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 900;
}

.fault-service-card.active .fault-service-order {
  background: var(--primary);
  color: #fff;
}

.fault-service-card-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.fault-service-card-copy b,
.fault-service-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fault-service-card-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.fault-service-card > strong {
  color: #0f766e;
  font-size: 0.75rem;
}

.fault-service-config {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, #f0fdf4, #fff);
}

.fault-service-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fault-service-selected-head > span {
  color: #166534;
  font-weight: 900;
}

.fault-service-selected-head > strong {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
  font-size: 0.72rem;
}

.fault-service-preview {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px dashed rgba(22, 163, 74, 0.34);
  border-radius: 12px;
  background: #fff;
}

.fault-service-preview > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fault-service-preview b {
  color: #166534;
  font-size: 1.08rem;
}

.fault-service-preview > small,
.fault-service-preview > span,
.fault-service-guide,
.fault-service-empty {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.fault-service-guide,
.fault-service-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.fault-service-submit {
  width: 100%;
  min-height: 50px;
}

.spare-usage-list > .spare-usage-title {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  padding: 0 0 3px;
  border-top: 0;
}

.spare-usage-title svg {
  width: 18px;
  height: 18px;
  color: #16a34a;
}

.spare-usage-list > .spare-usage-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  padding: 11px 0 0;
}

.spare-usage-main,
.spare-usage-inventory {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.spare-usage-main > span {
  font-weight: 900;
}

.spare-usage-incentive {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.11);
  color: #166534;
  font-size: 0.76rem;
  white-space: nowrap;
}

.spare-usage-inventory {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.78rem;
}

.spare-usage-inventory em {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
  font-style: normal;
  font-weight: 800;
}

.spare-usage-inventory em.negative {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.spare-usage-inventory .labor-only {
  color: #0f766e;
  font-weight: 800;
}

.spare-usage-time {
  grid-column: 1 / -1;
}

.spare-usage-item.negative-balance {
  border-top-color: rgba(220, 38, 38, 0.24);
}

@media (max-width: 640px) {
  .prestart-order-actions,
  .fault-service-grid {
    grid-template-columns: 1fr;
  }

  .worker-no-answer-head,
  .fault-service-picker-head,
  .fault-service-selected-head,
  .fault-service-details > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .fault-service-details > summary small {
    padding-inline-start: 26px;
  }

  .fault-service-count,
  .worker-no-answer-head > strong {
    align-self: flex-start;
  }

  .fault-service-card-copy b,
  .fault-service-card-copy small {
    white-space: normal;
  }

  .spare-usage-list > .spare-usage-item {
    grid-template-columns: 1fr;
  }

  .spare-usage-incentive {
    justify-self: start;
  }
}

.fault-stock-priority {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 14px;
  border: 1px solid #c7d2fe;
  border-radius: 18px;
  background: linear-gradient(145deg, #eef2ff 0%, #f8fafc 55%, #ecfeff 100%);
}

.fault-stock-priority-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fault-stock-priority-head > div {
  display: grid;
  gap: 3px;
}

.fault-stock-priority-head b {
  color: #1e3a8a;
  font-size: 0.98rem;
}

.fault-stock-priority-head small {
  color: #64748b;
}

.fault-stock-priority-head > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #3730a3;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
}

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

.fault-stock-priority-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 3px 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
  color: #172554;
  text-align: right;
  cursor: pointer;
}

.fault-stock-priority-item:hover,
.fault-stock-priority-item:focus-visible {
  border-color: #4f46e5;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.13);
  transform: translateY(-1px);
}

.fault-stock-priority-item > span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.76rem;
  font-weight: 900;
}

.fault-stock-priority-item b,
.fault-stock-priority-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fault-stock-priority-item small {
  color: #64748b;
  font-size: 0.75rem;
}

@media (min-width: 760px) {
  .fault-stock-priority-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .inventory-management-options,
  .fault-stock-control-grid {
    grid-template-columns: 1fr;
  }

  .inventory-management-option {
    min-height: 74px;
  }

  .fault-stock-control {
    padding: 12px;
  }

  .fault-stock-control-card > header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fault-stock-control-card > header > strong {
    grid-column: 1 / -1;
    padding-inline-start: 39px;
  }

  .fault-stock-exact-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fault-stock-exact-form .button {
    grid-column: 1 / -1;
  }

  .monthly-changes-head,
  .incentive-request-box > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .monthly-changes-head > strong {
    align-self: flex-start;
  }

  .monthly-change-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .monthly-change-item > strong {
    grid-column: 2;
    justify-self: start;
  }

  .inventory-admin-grid .card-row,
  .fault-stock-priority-head {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-admin-grid .card-row > .button,
  .fault-stock-priority-head > span {
    width: 100%;
    align-self: stretch;
    justify-content: center;
    text-align: center;
  }

  .inventory-admin-grid .login-panel {
    padding: 12px;
    overflow: hidden;
  }

  .fault-stock-priority-grid {
    grid-template-columns: 1fr;
  }
}
