:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --muted: #edf3f1;
  --line: #d6e0dd;
  --text: #17211f;
  --soft-text: #60706b;
  --brand: #1f6f64;
  --brand-dark: #164f48;
  --brand-soft: #dff0ed;
  --amber: #b86b12;
  --amber-soft: #fff2d8;
  --danger: #b83a3a;
  --danger-soft: #ffe6e6;
  --ok: #2f7a48;
  --shadow: 0 18px 45px rgba(30, 46, 42, 0.12);
}

/* Финальный слой интерфейса — держим после прежних правил для предсказуемого каскада. */
body {
  background:
    radial-gradient(circle at 8% 0%, rgba(23, 111, 99, 0.07), transparent 28rem),
    linear-gradient(180deg, #f8faf9 0, var(--bg) 26rem);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

.screen {
  padding: 22px clamp(16px, 3vw, 40px) 48px;
}

.topbar,
.status,
.tabs,
main {
  max-width: 1240px;
}

.topbar {
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.12;
}

.tabs {
  top: 12px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 15px;
  background: rgba(248, 250, 249, 0.9);
  box-shadow: 0 6px 22px rgba(25, 55, 48, 0.05);
}

.tab {
  min-height: 48px;
  border-radius: 11px;
}

.tab.active {
  box-shadow: 0 7px 18px rgba(23, 111, 99, 0.2);
}

.panel,
.login-card {
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(16px, 2.3vw, 28px);
}

input,
select,
textarea {
  min-height: 52px;
  border-color: #b9ccc7;
  border-radius: 11px;
  padding: 13px 14px;
}

.primary,
.secondary,
.ghost {
  min-height: 50px;
  border-radius: 11px;
  padding: 0 18px;
  font-weight: 850;
}

.primary {
  box-shadow: 0 8px 20px rgba(23, 111, 99, 0.18);
}

.secondary {
  border: 1px solid rgba(23, 111, 99, 0.25);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.ghost {
  border: 1px solid var(--line);
  background: #f7faf9;
}

.entry-snapshot,
.info-card,
.source-note,
.form-section,
.reservations-panel {
  border-radius: 14px;
}

.entry-snapshot {
  padding: 10px;
}

.entry-snapshot article {
  border-radius: 10px;
}

.entry-batch-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(25, 55, 48, 0.04);
}

@media (max-width: 540px) {
  .screen {
    padding: 12px 10px 88px;
  }

  .tabs {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    margin: 0;
    border-radius: 15px 15px 0 0;
  }

  .tab {
    min-height: 48px;
  }

  input,
  select,
  textarea,
  .primary,
  .ghost {
    min-height: 52px;
  }

  #entryForm > .primary {
    position: sticky;
    bottom: 72px;
  }

  .panel {
    border-radius: 16px;
  }
}

/* Рабочая дизайн-система: спокойный производственный интерфейс */
:root {
  --bg: #f2f6f4;
  --surface: #ffffff;
  --muted: #eef4f2;
  --line: #d5e1de;
  --text: #10211e;
  --soft-text: #60736e;
  --brand: #176f63;
  --brand-dark: #0f5149;
  --brand-soft: #e4f2ef;
  --accent: #176f63;
  --amber: #a85d08;
  --amber-soft: #fff2d8;
  --danger: #b73535;
  --danger-soft: #ffebea;
  --ok: #257348;
  --shadow: 0 18px 50px rgba(25, 55, 48, 0.08);
  --shadow-soft: 0 8px 24px rgba(25, 55, 48, 0.07);
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(23, 111, 99, 0.07), transparent 28rem),
    linear-gradient(180deg, #f8faf9 0, var(--bg) 26rem);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 120ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 111, 99, 0.2);
  outline-offset: 2px;
}

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

.screen {
  padding: 22px clamp(16px, 3vw, 40px) 48px;
}

.topbar,
.status,
.tabs,
main {
  max-width: 1240px;
}

.topbar {
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar__identity {
  min-width: 0;
}

.topbar h1 {
  max-width: 850px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.topbar__note {
  margin: 7px 0 0;
  color: var(--soft-text);
  font-size: 14px;
}

.eyebrow {
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.tabs {
  top: 12px;
  gap: 4px;
  margin-bottom: 18px;
  padding: 5px;
  border-color: rgba(184, 204, 198, 0.72);
  border-radius: 15px;
  background: rgba(248, 250, 249, 0.88);
  box-shadow: 0 6px 20px rgba(25, 55, 48, 0.05);
}

.tab {
  min-height: 48px;
  border-radius: 11px;
  color: var(--soft-text);
  font-weight: 750;
}

.tab:hover {
  background: rgba(23, 111, 99, 0.06);
  color: var(--brand-dark);
}

.tab.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 16px rgba(23, 111, 99, 0.2);
}

.login-card,
.panel {
  border-color: rgba(191, 208, 203, 0.82);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(18px, 2.4vw, 28px);
}

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

.panel h2 {
  font-size: clamp(23px, 2.5vw, 30px);
  letter-spacing: -0.035em;
}

.panel h3 {
  letter-spacing: -0.02em;
}

.primary,
.secondary,
.ghost,
.filter-toggle,
.button-link {
  min-height: 48px;
  border-radius: 11px;
  padding: 0 18px;
  font-weight: 800;
}

.primary {
  background: linear-gradient(135deg, #19796c, var(--brand-dark));
  box-shadow: 0 9px 20px rgba(23, 111, 99, 0.2);
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(23, 111, 99, 0.26);
}

.secondary {
  border: 1px solid #a8c8c1;
  background: #f7fbfa;
  color: var(--brand-dark);
}

.secondary:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.ghost {
  border: 1px solid transparent;
  background: var(--muted);
}

input,
select,
textarea {
  min-height: 52px;
  border-color: #b8cac5;
  border-radius: 11px;
  padding: 14px;
  background-color: #fff;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #8caaa3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 111, 99, 0.11);
}

.entry-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

#entryForm {
  gap: 20px;
  max-width: none;
}

.entry-snapshot {
  gap: 8px;
  padding: 8px;
  border: 1px solid #d2e2de;
  border-radius: 15px;
  background: #edf5f3;
}

.entry-snapshot article {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.entry-snapshot strong {
  margin-top: 3px;
  font-size: 20px;
}

.entry-snapshot__warn {
  background: var(--amber-soft) !important;
}

.form-section {
  display: grid;
  gap: 15px;
  padding: 18px;
  border: 1px solid #dbe6e3;
  border-radius: 16px;
  background: #fbfdfc;
}

.form-section__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 2px;
}

.form-section__head h3,
.form-section__head p {
  margin: 0;
}

.form-section__head h3 {
  font-size: 17px;
}

.form-section__head p {
  margin-top: 3px;
  color: var(--soft-text);
  font-size: 13px;
}

.step-number {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 900;
}

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

.info-card {
  border-radius: 14px;
  background: linear-gradient(135deg, #e8f2ef, #f3f8f6);
}

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

.entry-batch-list {
  gap: 9px;
  padding: 10px;
  border-radius: 14px;
}

.entry-batch-row {
  gap: 12px;
  padding: 12px;
  border: 1px solid #dfebe8;
  border-radius: 11px;
}

.entry-actions {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.entry-actions__add {
  border-style: dashed;
  background: #fff;
}

.entry-actions__commit {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(220px, 1.2fr);
  gap: 10px;
}

.reserve-action,
.save-action {
  min-height: 56px;
}

.reserve-action {
  border-color: #6ea99d;
  background: var(--brand-soft);
}

.reservations-panel {
  gap: 20px;
  overflow: hidden;
}

.reservations-panel__head {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.reservations-panel__head h3,
.reservations-panel__head p {
  margin: 0;
}

.reservations-panel__head p:last-child {
  margin-top: 5px;
  color: var(--soft-text);
  font-size: 13px;
  line-height: 1.45;
}

.reservations-panel__icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}

.reservation-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 22px;
  border: 1px dashed #b7cbc6;
  border-radius: 14px;
  background: #f8fbfa;
  color: var(--soft-text);
  text-align: center;
}

.reservation-empty b {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

.source-note,
.status {
  border: 1px solid #d1e1dd;
  border-radius: 13px;
}

.metrics article,
.finished-order,
.order,
.list-row,
.quarantine-card {
  border-radius: 14px;
}

.filter-toggle.active {
  background: var(--brand);
  color: #fff;
}

@media (min-width: 720px) {
  .form-grid--date-stage {
    grid-template-columns: minmax(190px, 0.7fr) minmax(260px, 1.3fr);
  }
}

@media (min-width: 1040px) {
  .entry-layout {
    grid-template-columns: minmax(0, 1.58fr) minmax(300px, 0.72fr);
  }

  .reservations-panel {
    position: sticky;
    top: 88px;
  }
}

@media (max-width: 719px) {
  .topbar__note {
    display: none;
  }

  .form-section {
    padding: 14px;
  }

  .entry-actions__commit {
    grid-template-columns: 1fr;
  }

  .save-action {
    grid-row: 1;
  }
}

@media (max-width: 540px) {
  .screen {
    padding: 12px 10px 88px;
  }

  .tabs {
    position: fixed;
    inset: auto 0 0 0;
  }

  .tab {
    min-height: 48px;
  }

  input,
  select,
  textarea,
  .primary,
  .ghost {
    min-height: 52px;
  }

  #entryForm > .primary {
    position: sticky;
    bottom: 72px;
  }

  .panel {
    border-radius: 16px;
  }

  .form-section {
    margin-right: -4px;
    margin-left: -4px;
  }

  .entry-snapshot article {
    padding: 9px;
  }

  .entry-snapshot strong {
    font-size: 18px;
  }

  .entry-batch-row {
    display: grid;
  }

  .entry-batch-row > span:last-child {
    grid-template-columns: 1fr 1fr;
  }
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  cursor: pointer;
}

.entry-batch-list { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--muted); }
.entry-batch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--surface); border-radius: 8px; }
.entry-batch-row span { display: grid; gap: 3px; min-width: 0; }
.entry-batch-row small { color: var(--soft-text); }

.app {
  min-height: 100vh;
}

.screen {
  width: 100%;
  min-height: 100vh;
  padding: 16px;
}

.screen--center {
  display: grid;
  place-items: center;
}

.hidden {
  display: none !important;
}

.login-card,
.panel {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  max-width: 420px;
  padding: 24px;
}

.login-card h1,
.topbar h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.login-card h1 {
  font-size: 30px;
  line-height: 1.1;
}

.setup-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-soft);
}

.setup-panel p {
  margin: 0;
  line-height: 1.45;
}

.stack {
  display: grid;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft-text);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b9c8c4;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 13px 12px;
  min-height: 48px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.primary,
.ghost {
  min-height: 48px;
  border-radius: 7px;
  padding: 0 18px;
  font-weight: 800;
}

.primary {
  background: var(--brand);
  color: white;
}

.primary:active {
  background: var(--brand-dark);
}

.ghost {
  background: var(--muted);
  color: var(--brand-dark);
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--soft-text);
  font-size: 14px;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--ok);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto 12px;
}

.topbar h1 {
  font-size: 22px;
}

.status {
  max-width: 1180px;
  margin: 0 auto 12px;
  padding: 12px;
  border-radius: 7px;
  background: var(--amber-soft);
  color: #6d420e;
  font-weight: 700;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 1180px;
  margin: 0 auto 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 247, 246, 0.96);
  backdrop-filter: blur(8px);
}

.tabs.tabs--manager {
  grid-template-columns: repeat(4, 1fr);
}

.manager-hint {
  margin: 0;
  color: var(--soft-text);
  line-height: 1.45;
}

.mapping-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(240px, 1fr) 150px auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.mapping-form > div,
.mapping-form label {
  display: grid;
  gap: 5px;
}

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

@media (max-width: 900px) {
  .mapping-form { grid-template-columns: 1fr; }
}

.sync-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--muted);
}

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

.readiness-summary {
  padding: 11px 12px;
  border-radius: 7px;
  font-weight: 800;
}

.readiness-summary--pass {
  color: var(--ok);
  background: #e8f5ee;
}

.readiness-summary--blocker {
  color: var(--danger);
  background: #fceaea;
}

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

.readiness-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--muted);
}

.readiness-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.readiness-item small {
  color: var(--soft-text);
  line-height: 1.35;
}

.readiness-icon {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-weight: 900;
}

.readiness-item--pass .readiness-icon { background: var(--ok); }
.readiness-item--warning .readiness-icon { background: var(--amber); }

.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

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

.sync-details div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 7px;
  background: #fff;
}

.sync-details span {
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 800;
}

.sync-details p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--amber);
}

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

.flow-metrics article {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.flow-metrics span,
.flow-metrics small {
  color: var(--soft-text);
  font-size: 11px;
}

.flow-metrics strong {
  font-size: 21px;
}

.flow-required {
  background: var(--brand-soft) !important;
}

.flow-quarantine {
  background: var(--amber-soft) !important;
}

.backup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.backup-bar > div {
  display: grid;
  gap: 3px;
}

.backup-bar span {
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 800;
}

.danger-text {
  color: var(--danger);
}

.source-note,
.section-note {
  margin: 0;
  color: var(--soft-text);
  font-size: 13px;
  line-height: 1.45;
}

.source-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--muted);
}

.plan-section {
  display: grid;
  gap: 10px;
}

.plan-completion-toggle {
  display: flex;
  align-items: end;
  gap: 6px;
  padding-bottom: 1px;
}

.filter-toggle {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.filter-toggle.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.finished-order-list,
.finished-items {
  display: grid;
  gap: 8px;
}

.finished-order {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.order--overdue {
  border-color: #d98b25 !important;
  box-shadow: inset 4px 0 0 #d98b25;
}

.order-title small {
  color: var(--soft-text);
  font-size: 11px;
}

.finished-order summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  cursor: pointer;
}

.finished-order summary > span:first-child,
.finished-item > div:first-child {
  display: grid;
  gap: 3px;
}

.finished-order small,
.finished-item small {
  color: var(--soft-text);
}

.finished-items {
  padding: 0 12px 12px;
}

.finished-item {
  display: grid;
  gap: 8px;
  padding: 11px;
  border-radius: 7px;
  background: var(--muted);
}

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

.finished-numbers span {
  display: grid;
  gap: 2px;
  padding: 7px;
  border-radius: 5px;
  background: #fff;
  color: var(--soft-text);
  font-size: 11px;
}

.finished-numbers .required {
  background: var(--amber-soft);
  color: #71420b;
}

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

.order-flow h4,
.order-comment {
  margin: 0 12px;
}

.order-comment {
  color: var(--soft-text);
  font-size: 13px;
}

.order-flow__section,
.production-progress {
  display: grid;
  gap: 8px;
}

.order-section-note {
  margin: 0 12px;
}

.order-flow__totals {
  padding: 0 12px;
}

.quarantine-list {
  display: grid;
  gap: 12px;
}

.manager-overview,
.manager-audit,
.manager-people {
  display: grid;
  gap: 12px;
}

.employee-form {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

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

.person-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.person-row span {
  color: var(--soft-text);
  font-size: 11px;
}

.pin-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
}

.pin-form input,
.pin-form button {
  min-height: 42px;
}

@media (max-width: 759px) {
  .employee-form,
  .person-row,
  .pin-form {
    grid-template-columns: 1fr;
  }
}

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

.employee-summary {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(90px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-summary > div {
  display: grid;
  gap: 3px;
}

.employee-summary span {
  color: var(--soft-text);
  font-size: 11px;
}

@media (max-width: 759px) {
  .employee-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-summary > div:first-child {
    grid-column: 1 / -1;
  }
}

.quarantine-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid #edc988;
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: var(--amber-soft);
}

.quarantine-card p,
.quarantine-card small {
  margin: 0;
}

.quarantine-card__head,
.review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quarantine-card__head div {
  display: grid;
  gap: 3px;
}

.quarantine-card__head span,
.quarantine-card small {
  color: var(--soft-text);
}

.review-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.review-comment {
  margin-top: 2px;
}

.review-comment textarea {
  min-height: 78px;
  background: #fffdf8;
}

.review-actions .reject {
  color: var(--danger);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.tab {
  min-height: 44px;
  border-radius: 6px;
  background: transparent;
  color: var(--soft-text);
  font-weight: 800;
}

.tab.active {
  background: var(--brand);
  color: #fff;
}

main {
  max-width: 1180px;
  margin: 0 auto;
}

.panel {
  padding: 16px;
}

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

.panel h2 {
  font-size: 22px;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.tag.warn,
.pill.warn {
  background: var(--amber-soft);
  color: #7b4707;
}

.tag.danger,
.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--muted);
  padding: 12px;
}

.info-card strong {
  display: block;
  margin-bottom: 4px;
}

.entry-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--muted));
}

.entry-snapshot article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border-radius: 7px;
  background: #fff;
}

.entry-snapshot span {
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 800;
}

.entry-snapshot strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.entry-snapshot__warn {
  background: var(--amber-soft) !important;
}

.entry-snapshot--warn {
  border-color: #edc988;
}

.entry-preview {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--ok);
  border-radius: 8px;
  background: #eef8f2;
  line-height: 1.35;
}

.entry-preview.warn {
  border-color: #edc988;
  border-left-color: var(--amber);
  background: var(--amber-soft);
  color: #6d420e;
}

.unplanned-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #edc988;
  border-radius: 8px;
  background: var(--amber-soft);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.mini-grid span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--soft-text);
  font-size: 12px;
}

.mini-grid b {
  color: var(--text);
  font-size: 16px;
}

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

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

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

.order summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px;
  cursor: pointer;
  list-style: none;
}

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

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

.order-title b {
  font-size: 15px;
}

.order-title span {
  color: var(--soft-text);
  font-size: 13px;
}

.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e9e6;
}

.progress i {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  max-width: 100%;
  background: var(--brand);
}

.stage-list {
  display: grid;
  gap: 8px;
  padding: 0 13px 13px;
}

.stage {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 7px;
  background: var(--muted);
}

.stage-row,
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.stage-row b {
  display: grid;
  gap: 2px;
}

.list-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
}

.list-row div {
  display: grid;
  gap: 3px;
}

.list-row span,
.stage small {
  color: var(--soft-text);
  font-size: 12px;
}

.day-production {
  display: grid;
  gap: 8px;
}

.day-production > summary {
  cursor: pointer;
  list-style: none;
}

.day-production > summary::-webkit-details-marker {
  display: none;
}

.day-production > summary::before {
  content: "▸";
  color: var(--brand);
  margin-right: 7px;
}

.day-production[open] > summary::before {
  content: "▾";
}

.day-production__details {
  display: grid;
  gap: 6px;
  margin-left: 14px;
}

.day-production__entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--muted);
}

.day-production__entry > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.day-production__entry span {
  color: var(--soft-text);
  font-size: 12px;
}

.stage-operation {
  font-weight: 700;
}

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

.metrics article {
  display: grid;
  gap: 5px;
  min-height: 92px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--muted);
  padding: 12px;
}

.metrics span {
  color: var(--soft-text);
  font-size: 12px;
  font-weight: 800;
}

.metrics strong {
  font-size: 23px;
}

.warn-card {
  background: var(--amber-soft) !important;
}

.split {
  display: grid;
  gap: 16px;
}

.month-input {
  max-width: 170px;
}

.localized-date-control {
  display: block;
  position: relative;
}

.localized-date-control > input {
  position: relative;
  z-index: 1;
}

.localized-date-display {
  align-items: center;
  background: var(--panel, #fff);
  display: flex;
  inset: 1px 34px 1px 1px;
  padding: 0 12px;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.localized-month-control {
  max-width: 170px;
}

.localized-month-control .localized-date-display {
  right: 34px;
}

.empty {
  border: 1px dashed #b9c8c4;
  border-radius: 8px;
  color: var(--soft-text);
  padding: 18px;
  text-align: center;
}

@media (min-width: 760px) {
  .screen {
    padding: 24px;
  }

  .panel {
    padding: 22px;
  }

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

  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }

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

@media (min-width: 980px) {
  #entryForm {
    max-width: 640px;
  }
}
.import-export-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  padding: 0.9rem 1rem;
}

.import-export-card summary { cursor: pointer; font-weight: 800; color: var(--ink); }

.export-upload-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}

.export-upload-form label { display: grid; gap: 0.35rem; font-size: 0.82rem; font-weight: 700; }
.export-upload-form input[type="file"] { width: 100%; font-size: 0.8rem; }

@media (max-width: 900px) {
  .export-upload-form { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  body {
    overflow-x: hidden;
  }

  .screen {
    padding: 12px 10px 88px;
    min-width: 0;
  }

  .screen--center {
    padding-bottom: 12px;
  }

  .login-card,
  .panel,
  .topbar,
  .status,
  .tabs,
  main,
  .tab-panel,
  .order,
  .finished-order,
  .info-card {
    max-width: 100%;
    min-width: 0;
  }

  .login-card,
  .panel {
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(30, 46, 42, 0.1);
  }

  .login-card h1 {
    font-size: 26px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .topbar h1 {
    font-size: 20px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .topbar .ghost {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 14px;
  }

  .status {
    margin-bottom: 10px;
    line-height: 1.35;
  }

  .tabs {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    z-index: 30;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
    margin: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -12px 28px rgba(30, 46, 42, 0.16);
  }

  .tabs.tabs--manager {
    grid-template-columns: repeat(4, minmax(104px, 1fr));
  }

  .tab {
    min-height: 48px;
    padding: 0 6px;
    font-size: 13px;
    white-space: nowrap;
  }

  .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .panel-head > .button-group,
  .panel-head > .month-input,
  .panel-head > .localized-month-control,
  .panel-head > .pill,
  .panel-head > .ghost {
    justify-self: start;
  }

  .panel h2 {
    font-size: 20px;
    line-height: 1.2;
  }

  label {
    gap: 8px;
    font-size: 14px;
  }

  input,
  select,
  textarea,
  .primary,
  .ghost {
    min-height: 52px;
    font-size: 16px;
  }

  textarea {
    min-height: 96px;
  }

  #entryForm {
    gap: 14px;
  }

  .entry-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
  }

  .entry-snapshot article {
    padding: 8px;
  }

  .entry-snapshot strong {
    font-size: 17px;
  }

  .entry-preview {
    font-size: 14px;
  }

  .unplanned-fields {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  #entryForm > .primary {
    position: sticky;
    bottom: 72px;
    z-index: 20;
    width: 100%;
    box-shadow: 0 10px 24px rgba(22, 79, 72, 0.28);
  }

  .mini-grid,
  .sync-details,
  .readiness-list,
  .flow-metrics,
  .employee-summary,
  .metrics,
  .finished-numbers {
    grid-template-columns: 1fr;
  }

  .metrics {
    gap: 8px;
  }

  .metrics article {
    min-height: 78px;
    padding: 11px;
  }

  .metrics strong {
    font-size: 21px;
  }

  .finished-order summary,
  .order summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .finished-order summary {
    display: grid;
  }

  .finished-order summary .tag,
  .order summary .tag,
  .list-row .tag {
    justify-self: start;
  }

  .finished-items,
  .stage-list {
    padding-right: 10px;
    padding-left: 10px;
  }

  .finished-numbers {
    gap: 6px;
  }

  .stage-row,
  .list-row,
  .day-production__entry,
  .quarantine-card__head,
  .review-actions,
  .backup-bar,
  .button-group {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .stage-row > *,
  .list-row > *,
  .day-production__entry > *,
  .order-title,
  .finished-order summary > span,
  .finished-item > div,
  .quarantine-card__head > *,
  .sync-details b,
  .flow-metrics strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .list-row button,
  .review-actions button,
  .button-group button,
  .button-group .button-link,
  .backup-bar button {
    width: 100%;
    min-height: 48px;
  }

  .month-input {
    max-width: none;
  }

  .localized-month-control {
    max-width: none;
  }

  .source-note,
  .section-note,
  .order-comment,
  .message {
    font-size: 14px;
    line-height: 1.4;
  }

  .empty {
    padding: 14px;
  }
}

/* Последний слой темы намеренно расположен в конце файла. */
body {
  background:
    radial-gradient(circle at 8% 0%, rgba(23, 111, 99, 0.07), transparent 28rem),
    linear-gradient(180deg, #f8faf9 0, var(--bg) 26rem);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

.screen { padding: 22px clamp(16px, 3vw, 40px) 48px; }
.topbar, .status, .tabs, main { max-width: 1240px; }
.topbar { align-items: flex-start; margin-bottom: 18px; }
.topbar h1 { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.12; }

.tabs {
  top: 12px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 15px;
  background: rgba(248, 250, 249, 0.9);
  box-shadow: 0 6px 22px rgba(25, 55, 48, 0.05);
}

.tab { min-height: 48px; border-radius: 11px; }
.tab.active { box-shadow: 0 7px 18px rgba(23, 111, 99, 0.2); }
.panel, .login-card { border-radius: 20px; box-shadow: var(--shadow); }
.panel { padding: clamp(16px, 2.3vw, 28px); }

input, select, textarea {
  min-height: 52px;
  border-color: #b9ccc7;
  border-radius: 11px;
  padding: 13px 14px;
}

.primary, .secondary, .ghost {
  min-height: 50px;
  border-radius: 11px;
  padding: 0 18px;
  font-weight: 850;
}

.primary { box-shadow: 0 8px 20px rgba(23, 111, 99, 0.18); }
.secondary {
  border: 1px solid rgba(23, 111, 99, 0.25);
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.ghost { border: 1px solid var(--line); background: #f7faf9; }
.entry-snapshot, .info-card, .source-note, .form-section, .reservations-panel { border-radius: 14px; }
.entry-snapshot { padding: 10px; }
.entry-snapshot article { border-radius: 10px; }
.entry-batch-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(25, 55, 48, 0.04);
}

@media (max-width: 540px) {
  .screen { padding: 12px 10px 88px; }
  .tabs {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    margin: 0;
    border-radius: 15px 15px 0 0;
  }
  .tab { min-height: 48px; }
  input, select, textarea, .primary, .ghost { min-height: 52px; }
  #entryForm > .primary { position: sticky; bottom: 72px; }
  .panel { border-radius: 16px; }
}

/* Очередь ввода и резервы: отдельные рабочие карточки вместо технических строк. */
.entry-batch-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid #b8d6cf;
  border-radius: 14px;
  background: linear-gradient(145deg, #f2faf7, #edf6f3);
}

.entry-batch-list.hidden { display: none; }

.entry-batch-list__head,
.batch-item,
.reservation-card__head,
.reservation-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-batch-list__head {
  justify-content: space-between;
  padding: 2px 2px 8px;
}

.entry-batch-list__head span { display: grid; gap: 2px; }
.entry-batch-list__head b { color: var(--brand-dark); font-size: 15px; }
.entry-batch-list__head small { color: var(--muted); font-weight: 600; }
.entry-batch-list__head > strong {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbeee9;
  color: var(--brand-dark);
  font-size: 13px;
}

.batch-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(25, 55, 48, 0.04);
}

.batch-item__index {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.batch-item__body { display: grid; flex: 1; min-width: 0; gap: 9px; }
.batch-item__body > b { line-height: 1.35; overflow-wrap: anywhere; }
.batch-item__quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.batch-item__quantity input {
  width: 92px;
  min-height: 42px;
  padding: 8px 10px;
  background: #f8fbfa;
}
.batch-item__remove { flex: 0 0 auto; min-height: 42px; color: #8a3b33; }

#myReservationsList { display: grid; gap: 12px; }

.reservation-card {
  overflow: hidden;
  border: 1px solid #acd0c7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(25, 55, 48, 0.06);
}

.reservation-card__head {
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #dceae6;
  background: #eef8f5;
}

.reservation-card__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 850;
}
.reservation-card__status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2ca57f;
  box-shadow: 0 0 0 4px rgba(44, 165, 127, 0.14);
}
.reservation-card__release { min-height: 38px; padding: 0 12px; color: #8a3b33; }
.reservation-card__items { display: grid; }
.reservation-item { justify-content: space-between; padding: 14px; }
.reservation-item + .reservation-item { border-top: 1px solid var(--line); }
.reservation-item__body { display: grid; min-width: 0; gap: 3px; }
.reservation-item__body b { overflow-wrap: anywhere; }
.reservation-item__body > span { color: #405b55; line-height: 1.35; overflow-wrap: anywhere; }
.reservation-item__body small { margin-top: 4px; color: var(--muted); }
.reservation-item__body small strong { color: var(--text); font-size: 14px; }
.reservation-item__use { flex: 0 0 auto; min-height: 42px; box-shadow: none; }

.reservation-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed #b8ccc7;
  border-radius: 13px;
  background: #f9fbfa;
}
.reservation-empty > span {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e1f1ed;
  color: var(--brand);
  font-size: 20px;
  font-weight: 900;
}
.reservation-empty p { display: grid; gap: 3px; margin: 0; color: var(--muted); }
.reservation-empty b { color: var(--text); }

@media (max-width: 540px) {
  .entry-batch-list { padding: 9px; }
  .batch-item { align-items: flex-start; flex-wrap: wrap; }
  .batch-item__body { flex-basis: calc(100% - 44px); }
  .batch-item__quantity { justify-content: space-between; }
  .batch-item__remove { width: 100%; margin-left: 42px; }
  .reservation-item { align-items: stretch; flex-direction: column; }
  .reservation-item__use { width: 100%; }
}

/*
 * Цветовая система v4.
 * Нейтральный рабочий фон + синий акцент. Зелёный, жёлтый и красный
 * используются только как смысловые статусы, а не как общий декор.
 */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --muted: #f1f4f8;
  --line: #d8deea;
  --text: #172033;
  --soft-text: #667085;
  --brand: #3157d5;
  --brand-dark: #243f9b;
  --brand-soft: #e9edff;
  --accent: #3157d5;
  --amber: #b54708;
  --amber-soft: #fff4e5;
  --danger: #c4322b;
  --danger-soft: #ffedeb;
  --ok: #18795c;
  --shadow: 0 20px 48px rgba(30, 42, 75, 0.09);
  --shadow-soft: 0 8px 24px rgba(30, 42, 75, 0.07);
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(49, 87, 213, 0.09), transparent 30rem),
    radial-gradient(circle at 96% 22%, rgba(115, 94, 232, 0.055), transparent 24rem),
    linear-gradient(180deg, #f8f9fc 0, var(--bg) 28rem);
  color: var(--text);
}

.topbar__note,
.section-note,
.form-section__head p,
.entry-batch-list__head small,
.reservation-empty p,
.reservation-item__body small,
.order-title span,
.finished-order small {
  color: var(--soft-text);
}

.eyebrow {
  color: var(--brand);
}

.tabs {
  border-color: rgba(207, 214, 227, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 26px rgba(30, 42, 75, 0.06);
  backdrop-filter: blur(14px);
}

.tab:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.tab.active {
  background: linear-gradient(135deg, #3e66e5, #294cc2);
  color: #fff;
  box-shadow: 0 8px 18px rgba(49, 87, 213, 0.25);
}

.tab.active:hover {
  color: #fff;
}

.login-card,
.panel {
  border-color: #dfe4ee;
  background: rgba(255, 255, 255, 0.96);
}

.primary {
  background: linear-gradient(135deg, #3d66e4, #294cc1);
  box-shadow: 0 9px 22px rgba(49, 87, 213, 0.23);
}

.primary:hover:not(:disabled) {
  box-shadow: 0 12px 26px rgba(49, 87, 213, 0.3);
}

.secondary {
  border-color: #bac7f7;
  background: #f6f8ff;
  color: var(--brand-dark);
}

.secondary:hover:not(:disabled),
.reserve-action:hover:not(:disabled) {
  border-color: #8199ed;
  background: var(--brand-soft);
}

.ghost {
  border-color: #e0e5ee;
  background: #f6f7fa;
  color: #39445c;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: rgba(49, 87, 213, 0.23);
}

input,
select,
textarea {
  border-color: #c9d1df;
  color: var(--text);
  background-color: #fff;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9caac0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.12);
}

.entry-snapshot {
  border-color: #dce2ee;
  background: #f1f4fa;
}

.form-section {
  border-color: #e0e5ef;
  background: #fbfcfe;
}

.step-number,
.reservations-panel__icon,
.reservation-empty > span {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.info-card {
  border-color: #d9e0ef;
  background: linear-gradient(135deg, #eef2ff, #f8f9ff);
}

.entry-batch-list {
  border-color: #ccd5f3;
  background: linear-gradient(145deg, #f2f5ff, #eef1fb);
}

.entry-batch-list__head b,
.entry-batch-list__head > strong {
  color: var(--brand-dark);
}

.entry-batch-list__head > strong {
  background: #dfe5ff;
}

.batch-item,
.entry-batch-row {
  border-color: #dfe4ef;
  box-shadow: 0 5px 16px rgba(30, 42, 75, 0.05);
}

.batch-item__quantity input {
  background: #f7f8fc;
}

.reserve-action {
  border-color: #aebdf2;
  background: #eef2ff;
  color: var(--brand-dark);
}

.reservation-card {
  border-color: #cbd5f3;
  box-shadow: 0 9px 22px rgba(30, 42, 75, 0.07);
}

.reservation-card__head {
  border-bottom-color: #dce3f7;
  background: #f0f3ff;
}

.reservation-card__status {
  color: var(--brand-dark);
}

.reservation-card__status i {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(24, 121, 92, 0.14);
}

.reservation-item__body > span {
  color: #47536a;
}

.reservation-empty {
  border-color: #cbd3e1;
  background: #fafbfe;
}

.source-note,
.status {
  border-color: #d8dfeb;
  background: #f4f6fb;
}

.filter-toggle.active,
.plan-completion-toggle.active {
  background: var(--brand);
  color: #fff;
}

.order,
.finished-order,
.list-row,
.quarantine-card {
  border-color: #dce2ec;
  box-shadow: 0 3px 12px rgba(30, 42, 75, 0.035);
}

.order-progress,
.progress-track {
  background: #e6eaf1;
}

.order-progress > span,
.progress-track > span {
  background: linear-gradient(90deg, #3157d5, #6d7fe0);
}

.entry-snapshot__warn,
.order--overdue,
.warning,
.tag--warning {
  border-color: #f2cf9e;
}

.error,
.message.error,
.tag--danger {
  color: var(--danger);
}

/* App-owned choice controls prevent Android from replacing the interface with
   its oversized system select dialog. Desktop keeps the native select. */
.mobile-choice-trigger,
.mobile-choice-layer {
  display: none;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  body.mobile-choice-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .mobile-choice-field {
    position: relative;
  }

  select.mobile-choice-source {
    display: none !important;
  }

  .mobile-choice-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 14px 16px;
    border: 1px solid #cbd4e4;
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.35;
    text-align: left;
    box-shadow: 0 2px 8px rgba(30, 42, 75, 0.035);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-choice-trigger:active {
    background: #f5f7fc;
  }

  .mobile-choice-trigger[aria-expanded="true"] {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.13);
  }

  .mobile-choice-trigger:disabled {
    color: #8791a4;
    background: #f4f6f9;
    box-shadow: none;
  }

  .mobile-choice-trigger__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-choice-trigger svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    transition: transform 150ms ease;
  }

  .mobile-choice-trigger[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  .mobile-choice-field > #positionSearch {
    display: none;
  }

  .mobile-choice-layer {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    align-items: end;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: visibility 180ms ease, opacity 180ms ease;
  }

  .mobile-choice-layer.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-choice-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(17, 24, 39, 0.52);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .mobile-choice-sheet {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    width: 100%;
    max-height: min(82dvh, 720px);
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    background: #fff;
    box-shadow: 0 -16px 50px rgba(24, 34, 58, 0.22);
    transform: translateY(24px);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobile-choice-layer.is-open .mobile-choice-sheet {
    transform: translateY(0);
  }

  .mobile-choice-handle {
    width: 42px;
    height: 5px;
    margin: 10px auto 4px;
    border-radius: 999px;
    background: #d7deea;
  }

  .mobile-choice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px 14px;
  }

  .mobile-choice-header > div {
    min-width: 0;
  }

  .mobile-choice-header span {
    display: block;
    margin-bottom: 3px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .mobile-choice-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
    line-height: 1.2;
  }

  .mobile-choice-close {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 14px;
    background: #f0f3f9;
    color: #465168;
  }

  .mobile-choice-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
  }

  .mobile-choice-search {
    position: relative;
    display: block;
    padding: 0 16px 12px;
  }

  .mobile-choice-search[hidden] {
    display: none;
  }

  .mobile-choice-search > svg {
    position: absolute;
    top: 17px;
    left: 32px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #6c7689;
    stroke-linecap: round;
    stroke-width: 1.7;
    pointer-events: none;
  }

  .mobile-choice-search input {
    width: 100%;
    min-height: 54px;
    padding: 12px 14px 12px 46px;
    border: 1px solid #d9dfeb;
    border-radius: 16px;
    background: #f4f6fa;
    color: var(--text);
    font: inherit;
    font-size: 16px;
    outline: none;
  }

  .mobile-choice-search input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.11);
  }

  .mobile-choice-options {
    min-height: 0;
    padding: 0 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .mobile-choice-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 62px;
    padding: 12px 10px 12px 14px;
    border: 0;
    border-bottom: 1px solid #e7eaf1;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-choice-option:last-child {
    border-bottom: 0;
  }

  .mobile-choice-option:active {
    border-radius: 14px;
    background: #f2f5ff;
  }

  .mobile-choice-option.is-selected {
    border-radius: 16px;
    background: #eef2ff;
    color: #2445b5;
  }

  .mobile-choice-option__copy {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .mobile-choice-option__copy strong {
    font-size: 16px;
    font-weight: 750;
    line-height: 1.3;
  }

  .mobile-choice-option__copy small {
    color: #667085;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.35;
  }

  .mobile-choice-option__check {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid #ccd4e3;
    border-radius: 50%;
    color: transparent;
  }

  .mobile-choice-option.is-selected .mobile-choice-option__check {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
  }

  .mobile-choice-option__check svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
  }

  .mobile-choice-empty {
    margin: 8px 16px 16px;
    padding: 24px 18px;
    border: 1px dashed #cdd5e2;
    border-radius: 16px;
    color: #687386;
    text-align: center;
  }

  .mobile-choice-empty[hidden] {
    display: none;
  }
}
