﻿:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --text: #0f172a;
  --muted: #475569;
  --danger: #dc2626;
  --ok: #15803d;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Tahoma, sans-serif; background: radial-gradient(circle at top right, #e0f2fe, var(--bg)); color: var(--text); }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--surface); border-bottom: 1px solid #cbd5e1; position: static; top: auto; z-index: auto; }
.actions { display: flex; gap: 8px; }
.topbar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
}
.topbar-nav-btn.secondary {
  background: #9b8f83;
  color: #fff;
}
.topbar-nav-btn.secondary:hover {
  background: #8b7f74;
}
button { border: 0; border-radius: 10px; padding: 10px 12px; background: var(--accent); color: white; font-weight: 600; }
button.secondary { background: #64748b; }
button.danger { background: var(--danger); }
button.success { background: var(--ok); }
button:disabled { opacity: 0.45; }
.dashboard { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px; }
.dashboard article { background: var(--surface); border-radius: 12px; padding: 12px; }
.filters { padding: 10px; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.filters input, .filters select { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid #cbd5e1; }
.filters button { grid-column: span 2; }
.orders { padding: 10px; display: grid; gap: 10px; }
.order-card { background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid #dbe4ee; }
.order-card.removing { opacity: 0; transform: translateX(10px); transition: opacity 180ms ease, transform 180ms ease; }
.order-card.problem { border-color: #fca5a5; background: #fff1f2; }
.order-card.customer-group { border-color: #fcd34d; background: #fffef7; }
.order-head { width: 100%; background: transparent; color: inherit; text-align: left; padding: 12px; border-radius: 0; }
.order-head:hover,
.order-head:focus,
.order-head:active {
  background: transparent !important;
  box-shadow: none !important;
}
.order-head .meta { color: var(--muted); font-size: 12px; }
.customer-group-info {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7db;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 13px;
  line-height: 1.35;
}
.icon-box { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 4px; vertical-align: middle; border-radius: 0; background: transparent; padding: 0; overflow: visible; }
.meta-icon { width: 22px; height: 22px; object-fit: contain; background: transparent; }
.order-body { border-top: 1px solid #e2e8f0; padding: 12px; display: grid; gap: 10px; }
.hidden { display: none; }
.product { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 10px; }
.worker-panel .products-list {
  display: grid;
  gap: 10px;
}
.product-media {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.product-info { flex: 1; min-width: 0; }
.product-actions { flex: 0 0 auto; margin-left: auto; }
.product img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: #f1f5f9; display: block; }
.product.collected { opacity: 0.55; }
.warning { padding: 8px; border-radius: 8px; background: #fff7ed; border: 1px solid #fed7aa; display: flex; justify-content: space-between; gap: 10px; }
.error-box { padding: 10px; border-radius: 8px; background: #fff1f2; border: 1px solid #fda4af; color: #9f1239; }
.sync-status { margin: 0 10px; padding: 8px 10px; border-radius: 8px; background: #ecfeff; border: 1px solid #99f6e4; color: #0f766e; }
.stale-data-badge { margin: 0 10px; padding: 7px 10px; border-radius: 8px; background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; font-size: 13px; }
.product-image-btn { border: 0; padding: 0; background: transparent; border-radius: 8px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: repeating-linear-gradient(45deg, #e2e8f0, #e2e8f0 6px, #f1f5f9 6px, #f1f5f9 12px);
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px;
}
.image-inline-msg { color: #9f1239; font-size: 12px; }
.lightbox { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.8); display: grid; place-items: center; z-index: 50; gap: 10px; padding: 20px; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 12px; background: #fff; }
.lightbox button { align-self: start; justify-self: end; }
.lightbox.hidden { display: none; }
.login-body { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(420px, 92vw); background: var(--surface); padding: 20px; border-radius: 14px; border: 1px solid #cbd5e1; }
.login-card .stack { display: grid; gap: 10px; }
.login-card input { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; }
.error { color: var(--danger); min-height: 20px; display: block; }
.worker-panel { font-size: 18px; line-height: 1.5; }
.worker-panel .topbar h1 { font-size: 28px; margin: 0; line-height: 1.15; }
.worker-panel #whoami { font-size: 18px; margin: 4px 0 0; color: #334155; }
.worker-panel .topbar { padding: 12px 14px; }
.worker-panel button { padding: 12px 16px; min-height: 46px; font-size: 17px; }
.worker-panel .filters { gap: 10px; padding: 12px; }
.worker-panel .filters input,
.worker-panel .filters select {
  padding: 12px;
  min-height: 46px;
  font-size: 17px;
}
.worker-panel .dashboard { padding: 12px; gap: 12px; }
.worker-panel .dashboard article { padding: 14px; }
.worker-panel .dashboard h2 { font-size: 17px; margin: 0 0 8px; }
.worker-panel .dashboard strong { font-size: 24px; }
.worker-panel .dashboard #postponed-count .postponed-customers-line,
.worker-panel .dashboard #postponed-count .postponed-orders-line {
  display: block;
}
.worker-panel .dashboard #postponed-count .postponed-orders-line {
  font-size: 16px;
  color: var(--muted);
  margin-top: 3px;
}
.worker-panel .orders { padding: 12px; gap: 6px; }
.worker-panel .order-card.order-group-single {
  margin-bottom: 8px;
}
.worker-panel .order-card.order-group-first {
  border-top-width: 3px;
}
.worker-panel .order-card.order-group-last {
  margin-bottom: 18px;
}
.worker-panel .order-head { padding: 14px 16px; font-family: inherit; }
.worker-panel .order-head .order-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}
.worker-panel .order-head .order-title strong {
  font-size: inherit;
  font-weight: inherit;
}
.worker-panel .order-head .meta { font-size: 17px; line-height: 1.45; margin-top: 6px; font-weight: 600; }
.worker-panel .order-head .meta .order-meta-date {
  font-size: 17px;
  font-weight: 600;
}
.worker-panel .order-head .meta .order-meta-date,
.worker-panel .order-head .meta .order-meta-route {
  display: block;
}
.worker-panel .order-head .meta .order-meta-route {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-weight: 700;
}
.worker-panel .order-card-comment {
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
  color: inherit;
}
.worker-panel .order-card-comment strong { font-weight: 700; }
.worker-panel .order-answer-area:empty { display: none; }
.worker-panel .problem-answer-block {
  margin: 0 14px 12px;
  padding: 12px 14px;
  border: 1px solid #8fc7b6;
  border-radius: 10px;
  background: #edf8f3;
  color: #294f45;
  font-size: 17px;
  line-height: 1.45;
}
.worker-panel .problem-answer-block > strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}
.worker-panel .problem-answer-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.worker-panel .problem-answer-meta {
  margin-top: 5px;
  color: #55756c;
  font-size: 15px;
}
.worker-panel .order-card.problem-answer-received {
  border-color: #6f9a8d;
  background: #f3fbf7;
  box-shadow: 0 0 0 2px rgba(111, 154, 141, 0.18);
}
@keyframes problem-answer-soft-blink {
  0%, 100% { box-shadow: 0 0 0 2px rgba(111, 154, 141, 0.18); }
  50% { box-shadow: 0 0 0 7px rgba(111, 154, 141, 0.32); }
}
.worker-panel .order-card.problem-answer-blink {
  animation: problem-answer-soft-blink 1.15s ease-in-out 7;
}
.problem-answer-toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
}
.problem-answer-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #8fc7b6;
  border-radius: 12px;
  background: #edf8f3;
  color: #294f45;
  box-shadow: 0 5px 18px rgba(80, 60, 40, 0.16);
  font-size: 16px;
  font-weight: 700;
}
.problem-answer-toast button {
  flex: 0 0 auto;
  min-height: 42px;
}
@media (prefers-reduced-motion: reduce) {
  .worker-panel .order-card.problem-answer-blink { animation: none; }
}
.worker-panel .order-body { padding: 16px; gap: 14px; font-size: 17px; }
.worker-panel .order-details-grid { display: grid; gap: 8px; font-size: 17px; line-height: 1.5; }
.worker-panel .order-details-grid strong { font-size: 17px; }
.worker-panel #problem-note-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  resize: vertical;
}
.worker-panel .order-problem-note {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  font-weight: 600;
}
.worker-panel .order-problem-note strong { font-weight: 700; }
.worker-panel .order-comment {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef9c3;
  border: 1px solid #fde68a;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
}
.worker-panel .order-comment strong { font-weight: 700; }
.worker-panel .product-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  display: block;
  overflow: visible;
  white-space: normal;
}
.worker-panel .product-meta { font-size: 16px; line-height: 1.5; color: #334155; margin-top: 3px; }
.worker-panel .product-actions { gap: 10px; }
.worker-panel .product-actions button { min-width: 46px; min-height: 46px; font-size: 20px; padding: 8px 11px; }
.worker-panel .order-actions button { min-height: 46px; font-size: 16px; padding: 12px 16px; }
.worker-panel .order-action-hint {
  margin: 2px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-size: 14px;
  line-height: 1.35;
}
.worker-panel .postponed-customer-info {
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c4b5fd;
  background: #f5f3ff;
  display: grid;
  gap: 4px;
}
.worker-panel .postponed-customer-total {
  font-size: 17px;
  font-weight: 700;
  color: #3730a3;
}
.worker-panel .postponed-customer-sub {
  font-size: 15px;
  color: #4338ca;
}
.worker-panel .postponed-customer-actions {
  margin-top: 4px;
}
.worker-panel .postponed-customer-actions button {
  min-height: 40px;
}
.worker-panel .postponed-customer-confirmed {
  font-size: 13px;
  color: #1e3a8a;
  font-weight: 600;
}
.worker-panel .order-auto-received-msg {
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
}
.worker-panel .order-auto-received-msg.is-warning {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}
.worker-panel .product-placeholder { font-size: 13px; font-weight: 600; text-align: center; padding: 4px; }
.worker-panel .product-image-btn img,
.worker-panel .product img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.worker-panel .product-media {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  border-radius: 12px;
  overflow: hidden;
  background: #f6efe6;
}
.worker-panel .product-image-btn {
  width: 84px;
  height: 84px;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
}
.worker-panel .product-image-btn img,
.worker-panel .product img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  background: #f6efe6;
}
.worker-panel .product-placeholder {
  width: 84px;
  height: 84px;
  border-radius: 12px;
}
.worker-panel .filters { grid-template-columns: 1fr 1fr !important; }
.worker-panel .filters button { grid-column: span 2 !important; }
.admin-grid { padding: 12px; display: grid; gap: 12px; }
.admin-grid section { background: var(--surface); border-radius: 12px; border: 1px solid #dbe4ee; overflow: hidden; min-width: 0; }
.admin-section[data-section-key="analytics"] { overflow: visible; }
.section-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; background: #f8fafc; color: var(--text); border-radius: 0; padding: 12px; border-bottom: 1px solid #e2e8f0; transition: background 0.18s ease; }
.section-toggle:hover { background: #f1f5f9; }
.section-toggle h2 { margin: 0; font-size: 19px; font-weight: 700; }
.section-toggle::after { content: "▾"; font-size: 14px; color: #64748b; transition: transform 0.18s ease; }
.admin-section.collapsed .section-toggle::after { transform: rotate(-90deg); }
.section-body { padding: 12px; display: grid; gap: 10px; color: #334155; max-height: 1800px; opacity: 1; overflow: visible; min-width: 0; transition: max-height 0.22s ease, opacity 0.18s ease, padding 0.18s ease; }
.admin-section.collapsed .section-body { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; pointer-events: none; }
.admin-section.collapsed .section-body { overflow: hidden; }
.section-body > * { min-width: 0; }
.admin-grid form { display: grid; gap: 8px; margin-bottom: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.admin-grid input, .admin-grid select { width: 100%; padding: 9px; border-radius: 8px; border: 1px solid #cbd5e1; }
.row-actions { display: flex; gap: 8px; }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 8px; border-bottom: 1px solid #e2e8f0; border-radius: 8px; transition: background 0.18s ease; }
.user-row:hover { background: #f8fafc; }
.user-row.is-editing { background: #ecfeff; border: 1px solid #99f6e4; }
.user-row:last-child { border-bottom: 0; }
.user-meta { color: #475569; font-size: 13px; }
.user-actions { display: flex; gap: 6px; justify-content: flex-end; }
.archived-title { padding-top: 8px; margin-top: 8px; border-top: 1px dashed #cbd5e1; color: #64748b; }
.archived-wrap .user-row { opacity: 0.82; }
.mapping-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; padding: 10px 8px; border-bottom: 1px solid #e2e8f0; border-radius: 8px; transition: background 0.18s ease; }
.mapping-row:hover { background: #f8fafc; }
.mapping-row.is-editing { background: #ecfeff; border: 1px solid #99f6e4; }
.mapping-row:last-child { border-bottom: 0; }
.mapping-col.source { display: flex; align-items: center; gap: 6px; }
.mapping-col.mapped { color: #0f172a; }
.mapping-main { font-weight: 600; }
.mapping-sub { color: #64748b; font-size: 12px; margin-top: 2px; }
.source-sub { color: #64748b; font-size: 12px; }
.mapping-col.actions { display: flex; gap: 6px; justify-content: flex-end; }
.mapping-col.actions button { padding: 7px 10px; border-radius: 8px; }
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.analytics-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; background: #f8fafc; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 150px; }
.analytics-card h4 { margin: 0; font-size: 15px; line-height: 1.3; }
.analytics-card .metric { font-size: 18px; color: #0f172a; margin: 0; line-height: 1.25; }
.analytics-card .metric-sub { font-size: 12px; color: #64748b; margin: 0; line-height: 1.35; }
.metric-with-info { position: relative; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-info-btn {
  padding: 0;
  width: 16px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kpi-info-btn:hover { background: #eef2f7; color: #334155; }
.kpi-info-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: min(300px, 80vw);
  max-width: 300px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  padding: 9px 10px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}
.kpi-info-title { font-size: 13px; font-weight: 700; margin: 0 0 6px; }
.kpi-info-line { font-size: 12px; line-height: 1.35; color: #334155; margin: 0 0 2px; }
.analytics-filters { display: grid; gap: 8px; margin-bottom: 8px; }
.analytics-filters .row-actions { flex-wrap: wrap; }
.analytics-filters .row-actions > * { min-width: 0; }
.audit-filters { gap: 6px; margin-bottom: 6px; }
.audit-row-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.audit-row-grid-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.audit-row-grid select,
.audit-row-grid input {
  height: 32px;
  padding: 5px 8px;
  font-size: 12px;
  width: 100%;
  min-width: 0;
}
.audit-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
  min-width: 0;
  width: 100%;
}
.audit-btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  width: 100%;
  min-width: 0;
}
.audit-table-wrap {
  border-radius: 8px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.audit-table th,
.audit-table td {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.3;
}
.audit-table th {
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
}
.audit-details {
  display: inline-block;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.audit-filters,
.audit-filters .row-actions,
.audit-filters .row-actions > * {
  min-width: 0;
}
.table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.analytics-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.analytics-table th, .analytics-table td { padding: 8px; border-bottom: 1px solid #e2e8f0; font-size: 13px; text-align: left; }
.analytics-table th { background: #f8fafc; font-weight: 700; }
.analytics-table tbody tr:hover { background: #f8fafc; }
.analytics-table-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; width: 100%; max-width: 100%; min-width: 0; }
.analytics-table-wrap .analytics-table { width: max-content; min-width: 100%; }
.analytics-table-wrap.audit-table-wrap {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
}
.analytics-users-table { min-width: 1280px; }
.analytics-days-table { min-width: 980px; }
.analytics-users-table th:first-child,
.analytics-users-table td:first-child,
.analytics-days-table th:first-child,
.analytics-days-table td:first-child { min-width: 170px; }
.analytics-table th { white-space: nowrap; }
.analytics-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 8px;
}
.analytics-summary-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 130px;
}
.analytics-summary-label {
  font-size: 13px;
  color: #475569;
  line-height: 1.35;
}
.analytics-summary-sub {
  display: block;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}
.analytics-summary-item strong {
  color: #0f172a;
  white-space: normal;
  line-height: 1.25;
}
.kpi-level { font-size: 12px; color: #475569; font-weight: 600; }
.kpi-productivity.kpi-productivity-low { background: #fef2f2; border-color: #fecaca; }
.kpi-productivity.kpi-productivity-mid { background: #fffbeb; border-color: #fde68a; }
.kpi-productivity.kpi-productivity-good { background: #ecfdf5; border-color: #bbf7d0; }
.kpi-productivity.kpi-productivity-high { background: #dcfce7; border-color: #86efac; }
#analytics { min-width: 0; width: 100%; }
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.status-ok { background: #dcfce7; color: #166534; }
.status-error { background: #fee2e2; color: #991b1b; }
.status-rate_limited { background: #fef9c3; color: #854d0e; }
.status-unknown { background: #e2e8f0; color: #334155; }
.modal { position: fixed; inset: 0; z-index: 120; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.modal-card { position: relative; width: min(520px, 94vw); margin: 8vh auto 0; background: #fff; border-radius: 12px; border: 1px solid #cbd5e1; padding: 12px; box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2); animation: modalIn 0.16s ease; }
.modal-card h3 { margin: 0 0 10px; font-size: 18px; }
.modal-form { display: grid; gap: 8px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Warm pastel palette override (UI colors only; no layout changes) */
:root {
  --bg: #f7f4ef;
  --surface: #fffdfa;
  --accent: #6f9a8d;
  --accent-2: #5d8579;
  --text: #3d352f;
  --muted: #6f6258;
  --danger: #c97979;
  --ok: #6f9a8d;
}
body {
  background: var(--bg);
  color: var(--text);
}
.topbar {
  border-bottom-color: #eadfd3;
  box-shadow: 0 1px 4px rgba(80, 60, 40, 0.05);
}
button:hover { background: var(--accent-2); }
button.secondary { background: #9b8f83; }
button.secondary:hover { background: #8b7f74; }
button.danger { background: var(--danger); }
button.danger:hover { background: #b96767; }
.dashboard article,
.order-card,
.admin-grid section,
.login-card {
  background: #fffdfa;
  border-color: #eadfd3;
  box-shadow: 0 1px 4px rgba(80, 60, 40, 0.05);
}
.filters input, .filters select,
.login-card input,
.admin-grid input, .admin-grid select,
.worker-panel #problem-note-input {
  background: #fffdfa;
  border-color: #ddd2c6;
  color: var(--text);
}
.filters input:focus, .filters select:focus,
.login-card input:focus,
.admin-grid input:focus, .admin-grid select:focus,
.worker-panel #problem-note-input:focus {
  outline: none;
  border-color: #6f9a8d;
  box-shadow: 0 0 0 3px rgba(111, 154, 141, 0.12);
}
.order-card.customer-group,
.customer-group-info,
.warning,
.stale-data-badge,
.worker-panel .order-action-hint,
.worker-panel .order-auto-received-msg.is-warning,
.status-rate_limited {
  background: #fff3d9;
  border-color: #f0d9a7;
  color: #7a5a1d;
}
.sync-status {
  background: #f2f8f5;
  border-color: #c9ddd6;
  color: #4f7469;
}
.product,
.order-body,
.admin-grid form,
.table-wrap,
.analytics-card,
.analytics-summary-item,
.audit-table th,
.analytics-table th {
  border-color: #eadfd3;
}
.product,
.admin-grid form,
.analytics-card,
.analytics-summary-item,
.section-toggle,
.audit-table th,
.analytics-table th,
.mapping-row:hover,
.user-row:hover {
  background: #fbf7f2;
}
.section-toggle:hover,
.analytics-table tbody tr:hover {
  background: #f4ece2;
}
.section-body,
.worker-panel #whoami,
.worker-panel .product-meta,
.mapping-sub,
.source-sub,
.user-meta,
.analytics-summary-label,
.kpi-level {
  color: var(--muted);
}
.product-placeholder {
  background: repeating-linear-gradient(45deg, #efe3d6, #efe3d6 6px, #f8f0e8 6px, #f8f0e8 12px);
  color: #7e7064;
}
.worker-panel .order-comment {
  background: #fff3d9;
  border-color: #f0d9a7;
}
.worker-panel .order-problem-note {
  background: #fff4f3;
  border-color: #d9a3a3;
}
.worker-panel .postponed-customer-info,
.worker-panel .order-auto-received-msg {
  background: #f5f8fd;
  border-color: #d9e2ef;
}
.worker-panel .postponed-customer-total { color: #415f86; }
.worker-panel .postponed-customer-sub,
.worker-panel .postponed-customer-confirmed,
.worker-panel .order-auto-received-msg { color: #5a7393; }
@media (max-width: 900px) {
  .worker-panel {
    font-size: 18px;
  }
  .worker-panel .topbar {
    padding: 10px 12px;
    gap: 8px;
    align-items: center;
  }
  .worker-panel .topbar h1 {
    font-size: 24px;
  }
  .worker-panel #whoami {
    font-size: 16px;
    margin-top: 2px;
  }
  .worker-panel .topbar .actions {
    gap: 8px;
    flex-wrap: nowrap;
  }
  .worker-panel .topbar .actions > * {
    min-width: 0;
  }
  .worker-panel .topbar button,
  .worker-panel .topbar .topbar-nav-btn {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
  }
  .worker-panel .dashboard {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 12px;
  }
  .worker-panel .dashboard h2 {
    font-size: 18px;
  }
  .worker-panel .dashboard strong {
    font-size: 26px;
  }
  .worker-panel .filters {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
    padding: 10px 12px;
  }
  .worker-panel .filters input,
  .worker-panel .filters select {
    min-height: 48px;
    font-size: 17px;
  }
  .worker-panel .filters button {
    grid-column: span 2 !important;
    min-height: 48px;
  }
  .worker-panel .orders {
    padding: 12px;
    gap: 6px;
  }
  .worker-panel .order-card {
    border-radius: 14px;
  }
  .worker-panel .order-head {
    padding: 13px 14px;
  }
  .worker-panel .order-head .order-title {
    font-size: 22px;
  }
  .worker-panel .order-head .meta {
    font-size: 17px;
    line-height: 1.4;
  }
  .worker-panel .order-head .meta .order-meta-date {
    font-size: 17px;
  }
  .worker-panel .order-body {
    padding: 14px;
    gap: 12px;
  }
  .worker-panel .order-details-grid {
    font-size: 17px;
    line-height: 1.5;
  }
  .worker-panel .product {
    gap: 12px;
    padding: 8px 10px;
    min-height: 100px;
    align-items: center;
  }
  .worker-panel .product-media {
    width: 84px;
    height: 84px;
    flex: 0 0 84px;
  }
  .worker-panel .product-image-btn {
    width: 84px;
    height: 84px;
  }
  .worker-panel .product-placeholder {
    width: 84px;
    height: 84px;
  }
  .worker-panel .product-title {
    font-size: 20px;
    line-height: 1.3;
  }
  .worker-panel .product-meta {
    font-size: 16px;
    line-height: 1.35;
  }
  .worker-panel .product-actions {
    gap: 12px;
    padding-left: 8px;
    flex: 0 0 auto;
    align-self: center;
  }
  .worker-panel .product-actions button {
    min-width: 48px;
    min-height: 48px;
  }
  .worker-panel .order-actions {
    gap: 10px;
    flex-wrap: wrap;
  }
  .worker-panel .order-actions button {
    min-height: 48px;
    font-size: 16px;
  }
  .worker-panel .status-badge {
    font-size: 15px;
    font-weight: 700;
  }
}
@media (min-width: 900px) {
  .dashboard { grid-template-columns: repeat(4, 1fr); }
  .filters { grid-template-columns: 1fr 1fr 1fr auto; }
  .filters button { grid-column: auto; }
  .admin-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .mapping-row { grid-template-columns: 1fr; gap: 6px; }
  .mapping-col.actions { justify-content: flex-start; }
  .user-row { grid-template-columns: 1fr; }
  .user-actions { justify-content: flex-start; }
  .analytics-table th, .analytics-table td { font-size: 12px; padding: 7px; }
  .analytics-summary-list { grid-template-columns: 1fr; }
  .analytics-summary-item { align-items: center; }
  .audit-row-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-row-grid-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-details { max-width: 260px; }
}
@media (max-width: 980px) {
  .audit-row-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-row-grid-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .audit-row-grid { grid-template-columns: 1fr; }
  .audit-row-grid-actions { grid-template-columns: 1fr; }
}
