* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-tap-highlight-color: transparent;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

:root {
  --font-ui: "Inter", "SF Pro Text", "SF Pro Display", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

html,
body {
  font-family: var(--font-ui);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
textarea,
select,
button {
  font: inherit;
  letter-spacing: inherit;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

button {
  cursor: pointer;
}

.login-screen {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  background: linear-gradient(135deg, #54a9eb 0%, #3d8fd9 100%);
}

body.pre-auth-login .login-screen {
  display: flex;
}

body.authenticated .login-screen {
  display: none !important;
}

.login-back-public {
  width: 100%;
  margin-bottom: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #ea580c;
  background: rgba(255, 247, 237, 0.95);
  border: 1px solid #fed7aa;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-back-public:hover {
  background: #fff7ed;
}

.login-sub {
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
  margin: -12px 0 18px;
}

/* Публичная витрина — ориентиры бесплатной лицензии API Яндекс.Карт */
.public-landing,
.register-screen {
  display: none;
}

body.pre-auth-landing .public-landing {
  display: block;
}

body.pre-auth-register .register-screen {
  display: flex;
}

body.pre-auth-landing .register-screen,
body.pre-auth-register .public-landing {
  display: none !important;
}

body.authenticated .public-landing,
body.authenticated .register-screen {
  display: none !important;
}

.public-landing {
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(16px + env(safe-area-inset-top, 0)) 16px calc(24px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, #fff7ed 0%, #f8fafc 40%, #f1f5f9 100%);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.public-landing-inner {
  max-width: 520px;
  margin: 0 auto;
}

.public-landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.public-landing-brand {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.public-landing-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c2410c;
  background: #ffedd5;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #fdba74;
}

.public-landing-lead {
  font-size: 14px;
  line-height: 1.5;
  color: #475569;
  margin-bottom: 16px;
}

.public-landing-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.public-landing-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.public-landing-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.public-landing-input:focus {
  outline: none;
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.22);
}

.public-landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.public-landing-btn:active {
  transform: translateY(1px);
}

.public-landing-btn--primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.public-landing-btn--primary:hover {
  filter: brightness(1.04);
}

.public-landing-btn--secondary {
  flex: 1;
  color: #fff;
  background: #54a9eb;
  box-shadow: 0 2px 10px rgba(84, 169, 235, 0.35);
}

.public-landing-btn--secondary:hover {
  filter: brightness(1.05);
}

.public-landing-btn--ghost {
  flex: 1;
  color: #c2410c;
  background: #fff;
  border: 1px solid #fdba74;
}

.public-landing-btn--ghost:hover {
  background: #fff7ed;
}

.public-landing-hint {
  font-size: 13px;
  color: #b45309;
  margin-bottom: 8px;
  line-height: 1.4;
}

.public-landing-map-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  margin-bottom: 12px;
  background: #e2e8f0;
}

.public-landing-map {
  width: 100%;
  height: min(42vh, 320px);
  min-height: 200px;
}

.public-landing-price {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  padding: 14px 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-landing-legal {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.public-landing-legal-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.public-landing-legal-list {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.public-landing-legal-list li {
  margin-bottom: 6px;
}

.public-landing-legal-links {
  font-size: 12px;
  line-height: 1.5;
}

.public-landing-legal-links a {
  color: #ea580c;
  text-decoration: none;
  font-weight: 600;
}

.public-landing-legal-links a:hover {
  text-decoration: underline;
}

.public-landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.public-landing-actions .public-landing-btn {
  flex: 1 1 calc(50% - 5px);
  min-width: 140px;
}

.register-screen {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 20px 16px;
  background: linear-gradient(135deg, #54a9eb 0%, #3d8fd9 100%);
}

.register-screen-inner {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.register-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: #0f172a;
}

.register-lead {
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
  margin-bottom: 18px;
}

.register-form .login-input {
  margin-bottom: 10px;
}

.register-msg {
  font-size: 13px;
  color: #b45309;
  min-height: 1.2em;
  margin-bottom: 8px;
  text-align: center;
}

.register-back,
.register-to-login {
  width: 100%;
  margin-top: 10px;
}

.register-to-login {
  margin-top: 8px;
}

.app {
  display: none;
}

.login-box {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  width: 100%;
  max-width: 320px;
  margin: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.login-title {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  color: #000;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 12px;
}

.login-input:focus {
  outline: none;
  border-color: #54a9eb;
}

.login-error {
  font-size: 13px;
  color: #d32f2f;
  margin-bottom: 8px;
  min-height: 18px;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: #54a9eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.login-btn:hover {
  background: #4a9ad8;
}

body {
  background: #f4f4f5;
  color: #000;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: 60px;
  touch-action: manipulation;
}

body.pre-auth-landing,
body.pre-auth-register,
body.pre-auth-login {
  padding-bottom: 0;
}

/* Прокрутка документа; pull-to-refresh — см. initPullToRefresh() в script.js */
body.authenticated {
  min-height: 100vh;
  min-height: 100svh;
  height: auto;
  max-height: none;
  padding-bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
}

/* Индикатор pull-to-refresh (iOS / PWA).
   У родителя pointer-events: none дочерние по умолчанию всё равно ловят клики —
   без явного none на потомках зона индикатора перекрывает верх приложения. */
.ptr-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: 0;
  overflow: visible;
  z-index: 100;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: 4px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(84, 169, 235, 0.14) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ptr-bar * {
  pointer-events: none;
}

.ptr-bar.ptr-visible {
  opacity: 1;
}

.ptr-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
}

.ptr-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #54a9eb;
  box-shadow: 0 0 0 3px rgba(84, 169, 235, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ptr-bar.ptr-ready .ptr-dot {
  transform: scale(1.35);
  box-shadow: 0 0 0 4px rgba(84, 169, 235, 0.35);
}

.ptr-bar.ptr-loading .ptr-dot {
  animation: ptr-pulse 0.55s ease-in-out infinite;
}

@keyframes ptr-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.88); }
}

/* Блокировка скролла при открытых оверлеях (iOS fix) */
body.scroll-lock {
  position: fixed;
  width: 100%;
  overflow-y: scroll;
}

.app {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  background: #fff;
  box-shadow: 0 0 20px rgba(0,0,0,0.08);
}

body.authenticated .app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  height: auto;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.header {
  position: sticky;
  top: 0;
  background: #54a9eb;
  color: #fff;
  padding: 8px 12px 10px;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.header-user {
  font-size: 12px;
  opacity: 0.9;
  flex-shrink: 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.search-box {
  flex: 1;
  min-width: 0;
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 18px;
  font-size: 16px;
  background: rgba(255,255,255,0.92);
}

.search-box input::placeholder {
  color: #999;
}

.filter-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-btn:hover {
  background: rgba(255,255,255,0.4);
}

.filter-btn svg {
  width: 20px;
  height: 20px;
}

.header-refresh-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.12s ease, border-color 0.14s ease;
}

.header-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
}

.header-refresh-btn:active {
  transform: translateY(1px);
}

.header-refresh-btn svg {
  width: 18px;
  height: 18px;
}

.orders-list {
  flex: none;
  overflow: visible;
  padding: 10px 14px calc(92px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  background: #ebedf0;
  min-height: 200px;
  width: 100%;
}

.orders-list .sch-group-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0;
}

body.page-orders,
body.page-orders .app {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.page-orders::-webkit-scrollbar,
body.page-orders .app::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.page-orders {
  padding-bottom: 0;
}

body.page-orders .header {
  flex-shrink: 0;
}

.page-orders {
  display: none !important;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.order-choice-row--status {
  flex-wrap: wrap;
}

body.page-orders .tasks-page,
body.page-orders .money-page {
  display: none !important;
}

.order-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  align-self: stretch;
  width: auto;
  max-width: 100%;
  margin-inline: 2px;
  padding: 10px 12px;
  text-align: left;
  background: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.06);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.order-item * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.order-item.order-item-pinned {
  border: 1px solid rgba(84, 169, 235, 0.35);
  box-shadow: 0 0.5px 0 rgba(84, 169, 235, 0.2), 0 4px 16px rgba(84, 169, 235, 0.16);
  /* Желтоватый фон для закрепленных заказов (поверх цвета статуса) */
  background: #fffbeb !important;
}

.order-item:hover {
  background: #f8f9fa;
  box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.07);
}

.order-item.order-item-pinned:hover {
  background: #fff3bf !important;
}

.order-item.order-item-status-Новый {
  background: #eaf4ff;
}

.order-item.order-item-status-закрыт {
  background: #ecf8ee;
}

.order-item.order-item-status-Удалён {
  background: #fff1f1;
}

.order-item.order-item-status-Новый:hover {
  background: #ddeeff;
}

.order-item.order-item-status-закрыт:hover {
  background: #dff1e2;
}

.order-item.order-item-status-Удалён:hover {
  background: #ffe4e4;
}

.order-item.order-item-status-Замер {
  background: #e3f2fd;
}

.order-item.order-item-status-Монтаж {
  background: #e8f5e9;
}

.order-item.order-item-status-Не-отвечает {
  background: #f3f4f6;
}

.order-item.order-item-status-Рекламация {
  background: #fff3e0;
}

.order-item.order-item-status-Самовывоз {
  background: #fff8e1;
}

.order-item.order-item-status-Делаем {
  background: #ede7f6;
}

.order-item.order-item-status-Замер:hover {
  background: #bbdefb;
}

.order-item.order-item-status-Монтаж:hover {
  background: #c8e6c9;
}

.order-item.order-item-status-Не-отвечает:hover {
  background: #e5e7eb;
}

.order-item.order-item-status-Рекламация:hover {
  background: #ffe0b2;
}

.order-item.order-item-status-Самовывоз:hover {
  background: #ffecb3;
}

.order-item.order-item-status-Делаем:hover {
  background: #d1c4e9;
}

.order-item.order-item-status-Рассчитать {
  background: #e1f5fe;
}

.order-item.order-item-status-Рассчитать:hover {
  background: #b3e5fc;
}

.order-item:active {
  transform: scale(0.99);
}

.order-item-body {
  flex: 1;
  min-width: 0;
}

.order-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.order-contact-icons-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.order-contact-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.order-number {
  font-size: 16px;
  font-weight: 700;
  color: #1565c0;
  flex-shrink: 0;
}

.order-artur-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: linear-gradient(145deg, #f97316, #ea580c);
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.35);
}

.order-coords-missing-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 5px;
  background: linear-gradient(145deg, #fecaca, #f87171);
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.22);
  filter: saturate(1.1);
}

.order-name {
  font-weight: 600;
  font-size: 14px;
  color: #000;
  line-height: 1.3;
}

.order-item-meta {
  font-size: 12px;
  color: #707579;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-telegram-link {
  color: #54a9eb;
  text-decoration: none;
}

.order-telegram-link:hover {
  text-decoration: underline;
}

.order-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.order-employee-avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #d9eafd;
  background: #eef6ff;
  box-shadow: 0 2px 8px rgba(84, 169, 235, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 2px;
}

.order-employee-avatar,
.order-employee-initial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.order-employee-avatar {
  object-fit: cover;
  display: block;
  background: #e7edf7;
}

.order-employee-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4ea5e9, #70cbff);
}

.order-employee-fallback {
  position: absolute;
  inset: 0;
}

.order-badge {
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.order-badge.order-status.Новый {
  background: #e3f2fd;
  color: #1976d2;
}

.order-badge.order-status.закрыт {
  background: #e8f5e9;
  color: #388e3c;
}

.order-badge.order-status.Удалён {
  background: #ffebee;
  color: #c62828;
}

.order-badge.order-status.Рассчитать {
  background: #e1f5fe;
  color: #0277bd;
}

.order-badge.order-install {
  background: #e0f2fe;
  color: #075985;
}

.order-badge.order-deadline {
  background: #f3f4f6;
  color: #111;
}

.order-badge.order-deadline.order-deadline--urgent {
  background: #ffebee;
  color: #c62828;
  font-weight: 600;
}

.order-badge.order-source {
  background: #e8f4fd;
  color: #1976d2;
}

.order-badge.order-amount {
  background: #fff3e0;
  color: #e65100;
}

.order-badge.order-income {
  background: #e8f5e9;
  color: #2e7d32;
}

.order-badge.order-expense {
  background: #ffebee;
  color: #c62828;
}

.order-badge.order-review {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.order-badge.order-review-requested {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid rgba(194, 65, 12, 0.25);
}

.order-badge.order-review-left {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.25);
}

.order-badge.order-production {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.order-badge.order-production-doing {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid rgba(194, 65, 12, 0.25);
}

.order-badge.order-production-ready {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.25);
}

.order-badge.order-work-type {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.order-badge.order-work-type-замер {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid rgba(21, 101, 192, 0.25);
}

.order-badge.order-work-type-монтаж {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid rgba(46, 125, 50, 0.3);
}

.order-badge.order-work-type-рекламация {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid rgba(230, 81, 0, 0.3);
}

.order-badge.order-work-type-плиссе {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid rgba(123, 31, 162, 0.3);
}

.order-badge.order-work-type-ремонт {
  background: #eceff1;
  color: #455a64;
  border: 1px solid rgba(69, 90, 100, 0.3);
}

.order-badge.order-work-type-раздвижка {
  background: #e8eaf6;
  color: #3949ab;
  border: 1px solid rgba(57, 73, 171, 0.3);
}

.order-badge.order-work-type-доставка {
  background: #e0f7fa;
  color: #00838f;
  border: 1px solid rgba(0, 131, 143, 0.3);
}

.order-badge.order-work-type-самовывоз {
  background: #fff8e1;
  color: #f57f17;
  border: 1px solid rgba(245, 127, 23, 0.3);
}

.order-badge.order-work-type-шторы {
  background: #f3f4ff;
  color: #3f2cff;
  border: 1px solid rgba(63, 44, 255, 0.25);
}

.order-item-work-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.order-comments-preview {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.order-comment-preview {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.order-comment-preview:last-of-type {
  margin-bottom: 0;
}

.order-comment-avatar-wrap {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  position: relative;
}

.order-comment-avatar-wrap .order-comment-avatar,
.order-comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8e8e8;
  display: block;
}

.order-comment-avatar-wrap .order-comment-fallback {
  position: absolute;
  top: 0;
  left: 0;
}

.order-comment-initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}

.order-comment-preview-body {
  flex: 1;
  min-width: 0;
}

.order-comment-preview-author {
  font-weight: 600;
  font-size: 11px;
  color: #000;
  margin-right: 6px;
}

.order-comment-preview-time {
  font-size: 10px;
  color: #999;
}

.order-comment-preview-text {
  font-size: 11px;
  color: #707579;
  margin-top: 1px;
  line-height: 1.3;
}

.order-comments-more {
  font-size: 12px;
  color: #54a9eb;
  margin-top: 6px;
}

.order-overlay,
.task-overlay,
.money-overlay,
.profile-overlay,
.filters-overlay {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  background: #fff;
  z-index: 100;
  flex-direction: column;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.order-overlay.active,
.task-overlay.active,
.money-overlay.active,
.profile-overlay.active,
.filters-overlay.active {
  display: flex;
}

.profile-overlay {
  z-index: 45;
  bottom: calc(60px + env(safe-area-inset-bottom));
}

.photo-gallery-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.photo-gallery-overlay.active {
  display: flex;
}

.gallery-track {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.gallery-img {
  max-width: 100%;
  max-height: 100vh;
  object-fit: contain;
}

.gallery-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 28px;
  cursor: pointer;
  z-index: 10;
}

.gallery-prev,
.gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 32px;
  cursor: pointer;
  z-index: 10;
}

.gallery-prev { left: 0; }
.gallery-next { right: 0; }

.gallery-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.gallery-counter {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  background: linear-gradient(rgba(0,0,0,0.5), transparent);
}

.filters-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px 16px;
  background: #f7f8fa;
}

.filters-section {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.filters-section-title {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #707579;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filters-hint {
  padding: 4px 16px 10px;
  font-size: 12px;
  color: #999;
}

.filters-options {
  padding: 4px 0;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 15px;
  color: #000;
  cursor: pointer;
}

.filter-option:hover {
  background: #f8f9fa;
}

/* Глобальный input { appearance: none } скрывает галочки/точки — в фильтрах нужны нативные контролы */
.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #54a9eb;
  cursor: pointer;
}

.filter-option:has(input:checked) {
  background: #eef6fc;
}

.filter-option:has(input:checked):hover {
  background: #e4f0fb;
}

.filter-option:has(input[type="radio"]:checked) {
  font-weight: 600;
  color: #174a6e;
}

.overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 8px;
  min-height: 44px;
  background: #54a9eb;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.back-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.order-overlay .back-btn--order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-size: 0;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.order-overlay .back-btn--order svg {
  display: block;
  opacity: 0.98;
}

.order-overlay .back-btn--order:hover {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.order-overlay .back-btn--order:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.34);
}

.overlay-header .back-btn:hover {
  opacity: 0.9;
}

.overlay-header .back-btn--order:hover {
  opacity: 1;
}

.overlay-header > span {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-header-actions {
  position: relative;
  margin-left: auto;
}

.order-actions-btn {
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.order-actions-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.62);
}

.order-actions-btn:active {
  transform: translateY(1px);
}

.order-actions-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid #dce8f7;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  display: none;
  z-index: 30;
}

.order-actions-menu.active {
  display: block;
}

.order-actions-item {
  width: 100%;
  border: none;
  background: #fff;
  color: #11253f;
  text-align: left;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.order-actions-item + .order-actions-item {
  border-top: 1px solid #edf3fb;
}

.order-actions-item:hover {
  background: #f2f8ff;
  color: #0e64af;
}

.overlay-content {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #f7f8fa;
}

.order-overlay .overlay-content {
  min-height: 0;
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

.order-overlay-footer {
  flex-shrink: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 -6px 28px rgba(15, 23, 42, 0.08);
}

.order-detail-section {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.order-detail-row {
  display: flex;
  align-items: center;
  padding: 5px 5px;
}

.order-contacts-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: #ffffff;
}

.order-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 5px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
}

.order-contact-fields {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.order-contact-phone-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.order-contact-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.order-contact-action {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid #e6edf6;
  background: #fff;
  color: #0b1f36;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  user-select: none;
}

.order-contact-action:hover {
  background: #f8fbff;
  border-color: #cfe3fb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.10);
}

.order-contact-action.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

.order-contact-action:active {
  transform: translateY(1px);
}

.order-contact-action-call {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border-color: rgba(22, 163, 74, 0.55);
  color: #fff;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.22);
}

.order-contact-action-call:hover {
  background: linear-gradient(180deg, #27d565 0%, #129243 100%);
  border-color: rgba(18, 146, 67, 0.65);
  box-shadow: 0 12px 24px rgba(34, 197, 94, 0.28);
}

.order-contact-action-tg {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.order-contact-action-wa {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.order-contact-row .order-contact-actions .order-contact-remove {
  margin-left: 4px;
}

.order-contact-input {
  border: none;
  background: transparent;
  font-size: 13px;
  color: #0b1f36;
  padding: 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-contact-input::placeholder {
  color: #98a2b3;
}

.order-contact-input:focus {
  outline: none;
}

.order-contact-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.order-contact-action-call,
.order-contact-action-comm {
  min-width: 34px;
  padding: 0;
}

.order-contact-action-comm {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.order-contact-choose {
  position: relative;
  display: inline-flex;
}

.order-contact-choose-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #ffffff;
  border: 1px solid #dce8f7;
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  padding: 6px;
  display: none;
  z-index: 20;
  min-width: 140px;
}

.order-contact-choose-menu.open {
  display: block;
}

.order-contact-choose-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid #e6edf6;
  background: #fff;
}

.order-contact-choose-item.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.order-contact-choose-item:hover {
  background: #f2f8ff;
}

.order-contact-choose-tg {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.order-contact-choose-wa {
  color: #047857;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.order-contact-remove {
  width: 32px;
  height: 32px;
  border: 1px solid #e6edf6;
  background: #fff;
  color: #64748b;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.order-contact-remove:hover {
  background: #fff5f5;
  border-color: #fecaca;
  color: #dc2626;
}

.order-contacts-add {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #54a9eb;
  background: #54a9eb;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.order-contacts-add:hover {
  background: #54a9eb;
  border-color: #54a9eb;
}

.order-detail-row:last-child {
  border-bottom: none;
}

.order-choice-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-time-range-wrap {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-time-reset-btn {
  min-width: auto;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.choice-time-reset-btn:hover {
  background: #e2e8f0;
  color: #475569;
}

/* Keep in layout box: off-screen (-9999px) + overflow:hidden on .order-detail-section
   clips the control, so showPicker()/click() often fails to open native UI. */
.order-choice-hidden {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: auto;
}

.choice-time-btn {
  min-width: 120px;
  justify-content: center;
}

.order-detail-label {
  display: none;
}

.order-detail-row-with-label .order-detail-label {
  display: block;
  width: 104px;
  flex-shrink: 0;
  font-size: 13px;
  color: #707579;
  margin-right: 8px;
}

.order-detail-value {
  font-size: 14px;
  color: #000;
  flex: 1;
}

.order-detail-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: #000;
  padding: 0;
  min-width: 0;
}

.order-detail-input::placeholder {
  color: #999;
}

.order-detail-input:focus {
  outline: none;
}

.order-detail-row-address {
  align-items: flex-start;
}

.order-detail-row-address .order-detail-label {
  padding-top: 10px;
}

.order-address-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.order-address-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-address-autocomplete-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
}

.order-address-suggest {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 60;
  -webkit-overflow-scrolling: touch;
}

.order-address-suggest.order-address-suggest--open {
  display: block;
}

.order-address-suggest[hidden] {
  display: none !important;
}

.order-address-suggest li {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  line-height: 1.35;
  color: #1a1a1a;
  transition: background 0.15s ease;
}

.order-address-suggest li:last-child {
  border-bottom: 0;
}

.order-address-suggest li:hover,
.order-address-suggest li.order-address-suggest-active {
  background: #fff5ef;
}

.order-address-suggest-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}

.order-detail-textarea {
  resize: vertical;
  min-height: calc(1.4em * 3 + 16px);
  line-height: 1.4;
  padding: 8px 4px;
  font-family: inherit;
  box-sizing: border-box;
}

.order-detail-row-address .order-address-stack .order-detail-input {
  flex: 0 0 auto;
  width: 100%;
}

.order-route-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.order-route-btns .order-route-btn {
  flex: 1 1 auto;
  min-width: 0;
}

.order-route-btn {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.28);
  transition: transform 0.12s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.order-route-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

.order-route-btn:active {
  transform: translateY(1px);
}

.order-route-btn-secondary {
  background: #fff;
  color: #c2410c;
  border: 2px solid #fb923c;
  box-shadow: 0 1px 4px rgba(234, 88, 12, 0.12);
}

.order-route-btn-secondary:hover {
  filter: none;
  background: #fff7ed;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.2);
}

.order-route-btn-secondary:active {
  transform: translateY(1px);
}

.order-detail-row-coords .order-coords-row {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
}

.order-coord-input {
  flex: 1;
  min-width: 0;
}

.order-detail-hint {
  font-size: 12px;
  line-height: 1.35;
  color: #909499;
  padding: 0 5px 8px 5px;
  margin-top: -2px;
}

.order-detail-input[type="date"],
.order-detail-input select {
  cursor: pointer;
}

.order-detail-row-contact {
  align-items: center;
}

.order-contact-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.order-contact-empty {
  font-size: 13px;
  color: #8a94a3;
}

.contact-btn {
  padding: 8px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background: #fff;
  font-size: 14px;
  color: #707579;
  cursor: pointer;
  transition: all 0.15s;
}

.contact-btn:hover {
  border-color: #54a9eb;
  color: #54a9eb;
}

.contact-btn.selected {
  background: #54a9eb;
  border-color: #54a9eb;
  color: #fff;
}

.order-phone-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.order-phone-wrap .order-detail-input {
  flex: 1;
  min-width: 0;
}

.order-call-novofon-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  transition: background 0.15s;
}

.order-call-novofon-btn:hover {
  background: #15803d;
}

.order-detail-row select.order-detail-input {
  appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right center;
  padding-right: 20px;
}

.order-save-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

.order-overlay-footer .order-detail-save {
  flex: 1;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(84, 169, 235, 0.28);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.15s ease;
}

.order-overlay-footer .order-detail-save:active {
  transform: scale(0.98);
}

.order-overlay-footer .order-detail-save-outline {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.order-detail-save {
  flex: 1;
  padding: 12px;
  background: #54a9eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.order-detail-save:hover {
  background: #4a9ad8;
}

.order-detail-save-outline {
  background: #fff;
  color: #54a9eb;
  border: 2px solid #54a9eb;
}

.order-detail-save-outline:hover {
  background: #f0f7ff;
}

.task-detail {
  padding: 0 12px 12px;
}

.task-detail-section {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.task-detail-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.task-detail-row-text {
  align-items: flex-start;
}

.task-detail-row:last-child {
  border-bottom: none;
}

.task-detail-label {
  font-size: 14px;
  color: #707579;
  width: 110px;
  flex-shrink: 0;
}

.task-detail-value {
  font-size: 14px;
  color: #000;
  flex: 1;
}

.task-detail-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  padding: 4px 0;
}

.task-detail-textarea {
  resize: none;
  overflow: hidden;
  min-height: 48px;
  line-height: 1.35;
}

.task-detail-input:focus {
  outline: none;
}

.task-detail-input[type="date"],
.task-detail-input select {
  cursor: pointer;
}

.task-detail-save {
  width: 100%;
  padding: 12px;
  background: #54a9eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.task-detail-save:hover {
  background: #4a9ad8;
}

.order-calls-section {
  padding: 0 12px 12px;
  border-top: 1px solid #eee;
}

.order-calls-header {
  font-size: 12px;
  font-weight: 600;
  color: #707579;
  margin: 12px 0 8px;
}

.order-calls-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-calls-empty {
  font-size: 13px;
  color: #999;
  padding: 12px 0;
}

.order-call-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8f9fb;
  border: 1px solid #e8ecf1;
}

.order-call-avatar-wrap {
  flex-shrink: 0;
  position: relative;
  width: 36px;
  height: 36px;
}

.order-call-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.order-call-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.order-call-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-call-employee {
  font-size: 12px;
  font-weight: 600;
  color: #1f2a37;
}

.order-call-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-call-type {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e8ecf1;
  color: #475569;
}

.order-call-dir {
  font-size: 10px;
  color: #64748b;
}

.order-call-time {
  font-size: 11px;
  color: #94a3b8;
  margin-left: auto;
}

.order-call-virtual {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.order-call-meta {
  font-size: 11px;
  color: #64748b;
}

.order-call-missed {
  border-left: 3px solid #ef4444;
  background: #fff7f7;
}

.order-call-answered {
  border-left: 3px solid #22c55e;
  background: #f6fff8;
}

.order-call-outgoing {
  border-left: 3px solid #3b82f6;
  background: #f5f9ff;
}

.order-call-item .calls-voice {
  margin-top: 4px;
}

.order-attachments-section {
  padding: 0 12px 12px;
}

.order-attachments-header {
  font-size: 12px;
  font-weight: 600;
  color: #707579;
  margin-bottom: 8px;
}

.order-attachments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.attachments-empty {
  font-size: 13px;
  color: #999;
  padding: 12px 0;
}

.attachment-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.attachment-photo {
  cursor: pointer;
  transition: transform 0.15s;
}

.attachment-photo:hover {
  transform: scale(1.02);
}

.attachment-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.attachment-item-inner {
  position: relative;
}

.attachment-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.58);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.14s ease, transform 0.14s ease, background 0.12s ease;
}

.attachment-item:hover .attachment-delete-btn {
  opacity: 1;
  transform: translateY(0);
}

.attachment-delete-btn:hover {
  background: rgba(15, 23, 42, 0.85);
}

.attachment-meta {
  padding: 6px 8px;
  font-size: 10px;
  color: #707579;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.attachment-author {
  font-weight: 600;
  color: #000;
}

.attachment-file {
  padding: 10px 12px;
}

.attachment-file-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #54a9eb;
  text-decoration: none;
  font-size: 13px;
}

.attachment-file-link:hover {
  text-decoration: underline;
}

.attachment-file-icon {
  font-size: 18px;
}

.attachment-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-attachments-upload {
  position: relative;
  margin-top: 4px;
}

.order-attach-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.order-attach-btn--file {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px dashed #9ca3af;
}

.order-attach-btn--file:hover {
  background: #e5e7eb;
}

.order-attachment-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.order-attach-btn {
  display: inline-block;
  padding: 8px 14px;
  background: #e8f4fd;
  color: #54a9eb;
  border: 1px dashed #54a9eb;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.order-attach-btn:hover {
  background: #d4ebfc;
}

.order-comments-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
}

.order-comments-header {
  font-size: 12px;
  font-weight: 600;
  color: #707579;
  margin-bottom: 8px;
}

.order-comments-section .comments-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: 200px;
  margin-bottom: 8px;
}

.comment-item {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8e8e8;
  flex-shrink: 0;
}

.comment-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
  color: #000;
}

.comment-time {
  font-size: 11px;
  color: #707579;
}

.comment-edit-btn {
  margin-left: auto;
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ea580c;
  background: rgba(251, 146, 60, 0.14);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.comment-edit-btn:hover {
  background: rgba(251, 146, 60, 0.24);
}

.comment-edit-textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  box-sizing: border-box;
}

.comment-edit-textarea:focus {
  outline: none;
  border-color: #54a9eb;
}

.comment-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.comment-save-btn,
.comment-cancel-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.comment-save-btn {
  background: #54a9eb;
  color: #fff;
}

.comment-save-btn:hover {
  background: #4a9ad8;
}

.comment-cancel-outline {
  background: #f0f1f3;
  color: #333;
}

.comment-cancel-outline:hover {
  background: #e4e6ea;
}

.comment-focused {
  outline: 2px solid #54a9eb;
  outline-offset: 3px;
  border-radius: 10px;
  background: #eef7ff;
  padding: 4px 6px;
}

.comment-text {
  font-size: 13px;
  line-height: 1.4;
  color: #000;
  background: #e8f4fd;
  padding: 6px 10px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  white-space: pre-wrap;
}

.comment-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
}

.comment-input-wrap textarea {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  background: #fff;
  resize: none;
  overflow: hidden;
  min-height: 40px;
  max-height: 140px;
  line-height: 1.35;
  font-family: inherit;
}

.comment-input-wrap textarea:focus {
  outline: none;
}

.btn-send {
  width: 40px;
  height: 40px;
  padding: 0;
  background: #54a9eb;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-send:hover {
  background: #4a9ad8;
}

.comments-empty {
  font-size: 14px;
  color: #999;
  padding: 16px 0;
  text-align: center;
}

.btn-save {
  width: 100%;
  padding: 14px;
  background: #54a9eb;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 24px;
}

.btn-save:hover {
  background: #4a9ad8;
}

.profile-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 24px 16px;
  background: #f7f8fa;
}

.profile-photo-section {
  text-align: center;
  padding: 24px 0 20px;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 12px;
}

.profile-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
}

.profile-avatar-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8e8e8;
  display: none;
}

.profile-avatar-wrap.has-photo img {
  display: block;
}

.profile-avatar-wrap.has-photo .profile-avatar-placeholder {
  display: none;
}

.profile-avatar-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 600;
}

.profile-change-photo {
  background: none;
  border: none;
  color: #54a9eb;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
}

.profile-change-photo:hover {
  text-decoration: underline;
}

.profile-section {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.profile-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-label {
  font-size: 15px;
  color: #000;
  width: 80px;
  flex-shrink: 0;
}

.profile-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  color: #000;
  text-align: right;
}

.profile-input::placeholder {
  color: #999;
}

.profile-input:focus {
  outline: none;
}

.profile-save {
  width: 100%;
  padding: 14px;
  background: #54a9eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.profile-save:hover {
  background: #4a9ad8;
}

.profile-logout {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  background: #fff;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.profile-logout:hover {
  background: #fef2f2;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 500px;
  width: 100%;
  display: flex;
  background: #fff;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid #e8e8e8;
  z-index: 50;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: #707579;
  font-size: 11px;
  cursor: pointer;
  padding: 6px 4px;
  min-width: 0;
}

.nav-item:hover,
.nav-item.active {
  color: #54a9eb;
}

.nav-item svg {
  width: 28px;
  height: 28px;
}

.bottom-nav .nav-item span {
  display: none;
}

.bottom-nav .nav-item {
  padding: 7px 4px;
  gap: 0;
}

.fab {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 50%;
  margin-left: 174px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(84, 169, 235, 0.4);
  z-index: 40;
}

@media (max-width: 520px) {
  .fab {
    left: auto;
    right: 20px;
    margin-left: 0;
  }
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: #999;
  font-size: 15px;
  background: #fff;
  border-radius: 12px;
  margin: 0 4px;
}

/* Page switching */
.tasks-page,
.money-page,
.calls-page,
.people-page,
.schedule-page,
.map-page {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  background: #f7f8fa;
  overflow: hidden;
}

body.page-tasks .page-orders,
body.page-money .page-orders,
body.page-calls .page-orders,
body.page-people .page-orders,
body.page-schedule .page-orders,
body.page-map .page-orders,
body.page-tasks .header,
body.page-money .header,
body.page-calls .header,
body.page-people .header,
body.page-schedule .header,
body.page-map .header {
  display: none !important;
}

body.page-profile .fab {
  display: none !important;
}

body.page-calls .fab {
  display: none !important;
}

body.page-people .fab {
  display: none !important;
}

body.page-map .fab {
  display: none !important;
}

body.page-tasks,
body.page-money,
body.page-calls,
body.page-people,
body.page-schedule,
body.page-map {
  padding-bottom: 0;
}

/* График: скролл страницы как у заказов — шапка sticky, pull-to-refresh по списку */
body.page-schedule .app {
  height: auto;
  max-height: none;
  min-height: 100vh;
  min-height: 100svh;
  overflow: visible;
}

.tasks-header-bar {
  position: sticky;
  top: 0;
  z-index: 9;
  background: #54a9eb;
  color: #fff;
  padding: 10px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.tasks-header-title,
.money-header-title {
  flex: 1;
  min-width: 0;
}

.tasks-links-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #f8fcff 0%, #f0f7fc 100%);
  border-bottom: 1px solid #e6edf6;
}

.tasks-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.tasks-link-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.15);
}

body.page-tasks .tasks-page {
  display: flex;
}

body.page-money .money-page {
  display: flex;
}

body.page-calls .calls-page {
  display: flex;
}

body.page-people .people-page {
  display: flex;
}

body.page-schedule .schedule-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

body.page-map .app {
  height: 100vh;
  height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  min-height: 0;
  overflow: hidden;
}

body.page-map .map-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  background: #e8ecf0;
}

.map-header-bar {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 48px;
  background: #54a9eb;
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.map-header-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.map-filter-open-btn {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.map-filter-open-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.map-filter-open-btn.map-filter-active::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffb020;
  box-shadow: 0 0 0 2px #54a9eb;
}

.map-header-bar .header-refresh-btn {
  flex-shrink: 0;
}

.map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.map-view {
  flex: 1 1 auto;
  min-height: 180px;
  width: 100%;
  border-radius: 12px 12px 0 0;
  margin: 0;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.map-view-inner {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.map-view-inner.leaflet-container {
  font-family: var(--font-ui);
  background: #dfe6ed;
  -webkit-tap-highlight-color: transparent;
}

.map-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1e3a5f;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

.map-empty-hint {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 48px;
  z-index: 25;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.4;
  color: #5c6b7a;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.map-attribution-note {
  flex-shrink: 0;
  padding: 6px 14px 10px;
  font-size: 10px;
  color: #8b95a0;
  text-align: center;
  line-height: 1.35;
}

.map-date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-date-preset-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.map-date-preset-btn:hover {
  background: #eff6ff;
}

.map-date-preset-btn.selected {
  background: linear-gradient(180deg, #e0f0fe 0%, #cfe8fc 100%);
  border-color: #54a9eb;
  color: #0d5a9e;
  box-shadow: 0 0 0 2px rgba(84, 169, 235, 0.25);
}

.map-custom-date-wrap {
  margin-top: 12px;
}

.map-custom-date-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.map-filter-date-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
}

.map-filter-date-input:focus {
  outline: none;
  border-color: #54a9eb;
  box-shadow: 0 0 0 2px rgba(84, 169, 235, 0.2);
}

.map-filter-hide-other-wrap {
  margin-top: 14px;
}

.map-filter-hide-other-label {
  font-weight: 600;
}

.map-filter-hide-other-hint {
  margin: 8px 0 0;
  padding: 0;
}

.leaflet-popup-content-wrapper.map-order-popup {
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  padding: 0;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 10px 12px 12px;
  min-width: 200px;
}

.map-popup-id {
  font-size: 15px;
  font-weight: 700;
  color: #1565c0;
  margin-bottom: 4px;
}

.map-popup-addr {
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  margin-bottom: 6px;
}

.map-popup-status {
  font-size: 12px;
  color: #707579;
  margin-bottom: 10px;
}

.map-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-popup-open {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #54a9eb;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.map-popup-open:hover {
  background: #4399db;
}

.map-popup-route {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.28);
  transition: filter 0.15s, box-shadow 0.15s;
}

.map-popup-route:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

.map-marker-pin {
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(145deg, #5eb3f4 0%, #3d9be8 100%);
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(61, 155, 232, 0.4), 0 0 0 1px rgba(61, 155, 232, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-marker-pin--empty {
  width: 26px;
  height: 26px;
}

.map-marker-pin--date-only {
  width: 30px;
  height: 34px;
}

.map-marker-pin--with-time {
  width: 38px;
  height: 44px;
  border-width: 1px;
  padding: 0;
  box-sizing: border-box;
}

.map-marker-pin--today {
  background: linear-gradient(145deg, #6ee7a8 0%, #34c759 100%);
  box-shadow: 0 1px 6px rgba(52, 199, 89, 0.42), 0 0 0 1px rgba(52, 199, 89, 0.15);
}

.map-marker-pin--gold {
  background: linear-gradient(145deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: 0 1px 7px rgba(245, 158, 11, 0.45), 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.map-marker-pin-label {
  transform: rotate(45deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1;
  text-align: center;
}

.map-marker-pin-label--empty {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-marker-date {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  max-width: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.05;
}

.map-marker-pin--with-time .map-marker-pin-label {
  gap: 0;
  padding: 0;
  margin: 0;
}

.map-marker-pin--with-time .map-marker-date {
  font-size: 12px;
  font-weight: 800;
  max-width: 36px;
  line-height: 1;
}

.map-marker-time {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.02em;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.05;
}

.map-marker-pin--with-time .map-marker-time {
  font-size: 11px;
  font-weight: 700;
  max-width: 36px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.map-marker-icon-leaflet {
  background: transparent !important;
  border: none !important;
}

.map-marker-pin--foreign {
  width: 26px;
  height: 26px;
  background: linear-gradient(145deg, #d1d5dc 0%, #9ca3af 100%);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.map-marker-pin--foreign.map-marker-pin--date-only {
  width: 30px;
  height: 34px;
}

.map-marker-pin--foreign.map-marker-pin--with-time {
  width: 38px;
  height: 44px;
}

.map-marker-pin--foreign .map-marker-date,
.map-marker-pin--foreign .map-marker-time {
  color: #f1f5f9;
}

.map-marker-pin--dim {
  background: linear-gradient(145deg, #52525b 0%, #18181b 100%);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.map-marker-pin--dim.map-marker-pin--date-only {
  width: 30px;
  height: 34px;
}

.map-marker-pin--dim.map-marker-pin--with-time {
  width: 38px;
  height: 44px;
}

.map-marker-pin--dim .map-marker-date,
.map-marker-pin--dim .map-marker-time {
  color: #f4f4f5;
}

.map-marker-icon-leaflet--foreign {
  cursor: inherit;
}

.map-cluster-icon-wrap {
  background: transparent !important;
  border: none !important;
}

.map-cluster-marker {
  position: relative;
  width: 28px;
  height: 28px;
}

.map-cluster-fill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-sizing: border-box;
  box-shadow:
    0 0 0 2px rgba(220, 38, 38, 0.92),
    0 1px 8px rgba(185, 28, 28, 0.4);
}

.map-cluster-num {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.map-popup-cluster {
  text-align: left;
}

.map-popup-cluster-title {
  font-size: 14px;
  font-weight: 700;
  color: #1565c0;
  margin-bottom: 8px;
}

.map-popup-cluster-row {
  padding: 8px 0;
  border-top: 1px solid #eef2f7;
}

.map-popup-cluster-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.map-popup-cluster-line {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 2px;
}

.map-popup-cluster-id {
  font-weight: 800;
  color: #0f172a;
}

.map-popup-cluster-addr {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
  margin-bottom: 6px;
}

.map-popup-cluster-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.map-popup-open.map-popup-open--cluster {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
}

.map-popup-route.map-popup-route--cluster {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
}

.leaflet-popup-content-wrapper.map-order-popup--cluster .leaflet-popup-content {
  margin: 10px 12px 12px;
  max-height: min(55vh, 320px);
  overflow-y: auto;
}

/* Не ставить overflow-x: hidden здесь — иначе по спецификации overflow-y станет auto и список снова станет отдельным скроллом (PTR не сработает). */
body.page-schedule .sch-list {
  flex: none;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: auto;
}

body.page-schedule .bottom-nav {
  flex-shrink: 0;
}

/* FAB на графике: добавление заказа */

/* Tasks list - Telegram style */
.tasks-list {
  flex: none;
  overflow: visible;
  padding: 8px 12px calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  border: none;
  width: 100%;
}

.task-item-status-Важное { background: #ffe7e7; }
.task-item-status-Новая { background: #e3f2fd; }
.task-item-status-Не-срочно { background: #f2f4f7; }
.task-item-status-Готово { background: #e8f5e9; }

.task-item:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.task-item-status-Важное:hover { background: #ffd7d7; }
.task-item-status-Новая:hover { background: #d1e9fa; }
.task-item-status-Не-срочно:hover { background: #e7eaef; }
.task-item-status-Готово:hover { background: #c8e6c9; }

.task-item-avatar {
  flex-shrink: 0;
}

.task-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.task-author-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.task-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-item-text {
  font-size: 14px;
  color: #000;
  line-height: 1.35;
  white-space: pre-line;
}

.task-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #707579;
}

.task-item-author::before {
  content: '•';
  margin-right: 4px;
}

.task-item-status {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
}

.task-item-status[data-status="Важное"] {
  background: #ffe7e7;
  color: #c62828;
}

.task-item-status[data-status="Новая"] {
  background: #e3f2fd;
  color: #1976d2;
}

.task-item-status[data-status="Не срочно"] {
  background: #f2f4f7;
  color: #475569;
}

.task-item-status[data-status="Готово"] {
  background: #e8f5e9;
  color: #388e3c;
}

.task-status-menu {
  position: fixed;
  z-index: 300;
  display: none;
  min-width: 170px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border: 1px solid #eceff3;
  padding: 6px;
}

.task-status-menu.active {
  display: block;
}

.task-status-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #1f2a37;
  cursor: pointer;
}

.task-status-menu-item:hover {
  background: #f3f7ff;
}

.task-status-menu-item.active {
  background: #e8f1ff;
  color: #1d4ed8;
  font-weight: 600;
}

/* ─── Меню заказа ПКМ (Telegram-like) ─────────────────────── */
.order-status-menu {
  position: fixed;
  z-index: 300;
  display: none;
  min-width: 212px;
  max-width: min(320px, calc(100vw - 16px));
  max-height: min(90vh, calc(100vh - 24px));
  max-height: min(90vh, calc(100dvh - 24px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #f0f2f5;
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.14),
    0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 6px;
  padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.order-status-menu.active {
  display: block;
}

.order-status-menu-react-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-menu-panel {
  background: #fff;
  border-radius: 12px;
  padding: 8px 8px 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.order-menu-panel--flat {
  padding: 6px 8px 8px;
}

.order-menu-panel--actions {
  padding: 6px 4px 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.order-menu-panel--actions > .order-menu-kicker {
  margin: 2px 8px 4px;
}

.order-menu-kicker {
  font-size: 12px;
  font-weight: 600;
  color: #8d959e;
  letter-spacing: 0.02em;
  margin: 0 2px 6px;
  line-height: 1.2;
}

.order-menu-react-scroll {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  background: #f4f4f7;
  border-radius: 10px;
}

.order-menu-react-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 4px;
  padding: 3px 4px;
  min-height: 36px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.order-react-sticker-picker-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.order-react-quick-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.order-react-quick-btn:hover {
  background: #fafafa;
}

.order-react-quick-btn:active {
  transform: scale(0.94);
}

.order-react-quick-btn--active {
  background: #e3f2fd;
  box-shadow: 0 0 0 1.5px rgba(33, 150, 243, 0.4);
}

.order-artur-mark-toggle {
  font-size: 16px;
  font-weight: 800;
  color: #ea580c;
}

.order-react-quick-btn--active.order-artur-mark-toggle {
  background: #fff7ed;
  box-shadow: 0 0 0 1.5px rgba(234, 88, 12, 0.42);
  color: #c2410c;
}

.order-check-yellow-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  color: #ca8a04;
  text-shadow: 0 0 1px rgba(202, 138, 4, 0.35);
}

.order-react-quick-btn--active .order-check-yellow-tick {
  color: #a16207;
}

.order-react-artur-yellow-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1;
  color: #ca8a04;
}

.order-react-stickers-empty {
  font-size: 12px;
  color: #9aa3ad;
  padding: 4px 6px;
  line-height: 1.35;
  white-space: nowrap;
  flex: 0 0 auto;
}

.order-react-sticker-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.order-react-sticker-btn:hover {
  background: #fafafa;
}

.order-react-sticker-btn:active {
  transform: scale(0.94);
}

.order-react-sticker-btn video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.order-react-sticker-lottie-host {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.order-react-sticker-lottie-host svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
}

.order-react-sticker-btn--active {
  background: #e8f4fc;
  box-shadow: 0 0 0 1.5px rgba(84, 169, 235, 0.45);
}

.order-react-pill-sticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.order-react-pill-sticker video {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.order-react-pill-sticker .order-react-lottie-host {
  width: 18px;
  height: 18px;
  display: inline-flex;
  pointer-events: none;
}

.order-react-pill-sticker .order-react-lottie-host svg {
  width: 18px !important;
  height: 18px !important;
}

.order-react-group-sticker {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.order-react-group-sticker video {
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}

.order-react-group-sticker .order-react-lottie-host {
  width: 22px;
  height: 22px;
  display: inline-flex;
  pointer-events: none;
}

.order-react-group-sticker .order-react-lottie-host svg {
  width: 22px !important;
  height: 22px !important;
}

.order-react-merged-list {
  font-size: 11px;
  color: #6d7782;
  line-height: 1.35;
}

.order-react-empty {
  padding: 8px 6px;
  line-height: 1.4;
  color: #9aa3ad;
  text-align: center;
  font-size: 11px;
}

.order-react-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e8ecf0;
}

.order-react-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.order-react-group--mine .order-react-group-head {
  padding-left: 6px;
  margin-left: -2px;
  border-left: 2px solid rgba(0, 136, 204, 0.45);
  border-radius: 2px 0 0 2px;
}

.order-react-group-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  padding: 0 1px;
}

.order-react-group-emoji {
  font-size: 14px;
  line-height: 1;
}

.order-react-group--mine .order-react-group-count {
  background: rgba(0, 136, 204, 0.14);
  color: #2481cc;
}

.order-react-group-count {
  font-size: 10px;
  font-weight: 600;
  color: #8d959e;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: #e8ecf0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.order-react-group-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-react-line--mine {
  background: #e8f4fc;
  box-shadow: inset 0 0 0 1px rgba(0, 136, 204, 0.18);
}

.order-react-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 8px;
  background: #f0f2f5;
}

.order-react-line-name {
  font-weight: 500;
  font-size: 11px;
  color: #1a1a1a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-react-line--mine .order-react-line-name {
  color: #0d6ebd;
  font-weight: 600;
}

.order-react-line-time {
  flex-shrink: 0;
  font-size: 10px;
  color: #8d959e;
  font-variant-numeric: tabular-nums;
}

.order-status-menu-divider {
  height: 0;
  margin: 4px 0;
  border: none;
}

/* Плашки реакций в списке / графике — компактно, в духе Telegram */
.order-react-pills {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  vertical-align: middle;
}

.order-react-pills > .order-coords-missing-flag {
  flex-shrink: 0;
}

.order-react-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 1px 5px 1px 4px;
  min-height: 20px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #e8ecf0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Своя реакция — чуть заметнее, голубой тон как «мои» в TG */
.order-react-pill--mine {
  padding: 1px 5px 1px 4px;
  border-radius: 10px;
  background: #d8ecf8;
  box-shadow: inset 0 0 0 1px rgba(0, 136, 204, 0.22);
}

.order-react-pill--mine .order-react-pill-count {
  color: #2481cc;
}

.order-react-pill--mine .order-react-pill-sticker,
.order-react-pill--mine .order-react-pill-sticker video,
.order-react-pill--mine .order-react-pill-sticker .order-react-lottie-host {
  border-radius: 4px;
}

.order-react-pill-emoji {
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.order-react-pill-count {
  font-size: 10px;
  font-weight: 600;
  color: #707579;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Звезда как платная реакция в Telegram: контур Twemoji ⭐ + ореол как в клиенте */
.order-react-tg-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 0;
  flex-shrink: 0;
  filter:
    drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 3px rgba(255, 241, 118, 0.95))
    drop-shadow(0 0 8px rgba(255, 213, 79, 0.85))
    drop-shadow(0 0 14px rgba(255, 179, 0, 0.45));
  animation: order-react-tg-star-breathe 1.85s ease-in-out infinite;
}

.order-react-tg-star-svg {
  display: block;
  overflow: visible;
}

.order-react-tg-star--pill {
  width: 14px;
  height: 14px;
}

.order-react-tg-star--pill .order-react-tg-star-svg {
  width: 100%;
  height: 100%;
}

.order-react-tg-star--menu {
  width: 20px;
  height: 20px;
}

.order-react-tg-star--menu .order-react-tg-star-svg {
  width: 100%;
  height: 100%;
}

.order-react-tg-star--group {
  width: 22px;
  height: 22px;
}

.order-react-tg-star--group .order-react-tg-star-svg {
  width: 100%;
  height: 100%;
}

@keyframes order-react-tg-star-breathe {
  0%, 100% {
    filter:
      drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.95))
      drop-shadow(0 0 3px rgba(255, 241, 118, 0.88))
      drop-shadow(0 0 8px rgba(255, 213, 79, 0.72))
      drop-shadow(0 0 14px rgba(255, 179, 0, 0.38));
    transform: scale(1);
  }
  50% {
    filter:
      drop-shadow(0 0 1px #fff)
      drop-shadow(0 0 5px rgba(255, 249, 196, 0.98))
      drop-shadow(0 0 11px rgba(255, 224, 130, 0.92))
      drop-shadow(0 0 20px rgba(255, 171, 0, 0.52));
    transform: scale(1.035);
  }
}

@media (prefers-reduced-motion: reduce) {
  .order-react-tg-star {
    animation: none;
  }
}

.order-react-group-star-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.order-react-quick-btn--star {
  background: linear-gradient(180deg, #fffef8 0%, #fff8e1 100%);
  box-shadow:
    0 0 0 1px rgba(255, 193, 7, 0.28),
    0 0 14px rgba(255, 193, 7, 0.18);
}

.order-react-quick-btn--star:hover {
  background: linear-gradient(180deg, #fffdf5 0%, #ffecb3 100%);
}

.order-react-quick-btn--star.order-react-quick-btn--active {
  background: linear-gradient(180deg, #fff3c4 0%, #ffe082 100%);
  box-shadow:
    0 0 0 1.5px rgba(255, 152, 0, 0.5),
    0 0 16px rgba(255, 193, 7, 0.35);
}

.order-react-pill--tg-star {
  box-shadow:
    inset 0 0 0 1px rgba(255, 179, 0, 0.22),
    0 0 10px rgba(255, 200, 0, 0.12);
}

.order-react-pill--tg-star.order-react-pill--mine {
  background: linear-gradient(180deg, #e8f4fc 0%, #d4e9f8 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 179, 0, 0.32),
    0 0 12px rgba(255, 200, 0, 0.18);
}

.order-item-badges-split-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.order-item-badges-left {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.order-item-badges-right {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 1px;
}

.sch-badges-split-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.sch-badges-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  flex: 1;
}

.sch-badges-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.sch-artur-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: linear-gradient(145deg, #f97316, #ea580c);
  border-radius: 5px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.35);
}

.order-status-menu-item {
  width: calc(100% - 4px);
  margin: 0 2px;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.order-status-menu-item:hover {
  background: #f0f2f5;
}

.order-status-menu-item.active {
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 600;
}

.task-add-form {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 500px;
  width: calc(100% - 24px);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  z-index: 40;
}

.task-text-input {
  flex: 1;
  border: none;
  background: #f0f0f0;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  min-width: 0;
}

.task-text-input::placeholder {
  color: #999;
}

.task-text-input:focus {
  outline: none;
}

.task-deadline-input {
  border: none;
  background: #f0f0f0;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: #707579;
}

.task-status-input {
  border: none;
  background: #f0f0f0;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: #707579;
  cursor: pointer;
}

.task-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.task-add-btn:hover {
  background: #4a9ad8;
}

.tasks-empty {
  padding: 32px 16px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.money-header-bar {
  position: sticky;
  top: 0;
  z-index: 9;
  background: #54a9eb;
  color: #fff;
  padding: 10px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.money-list {
  flex: none;
  overflow: visible;
  padding: 6px 10px calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.money-day-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.money-day-header {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding: 4px 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 2px;
}

.money-day-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calls-list {
  flex: none;
  overflow: visible;
  padding: 8px 12px calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calls-day-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* День в списке звонков: заметный блок в духе Telegram (дата + чипы статистики) */
.calls-day-header {
  padding: 0;
  margin: 0;
  border: none;
}

.calls-day-header-inner {
  background: linear-gradient(165deg, #f3f8fe 0%, #e8f2fb 55%, #e3eef8 100%);
  border: 1px solid rgba(56, 136, 213, 0.22);
  border-radius: 12px;
  padding: 8px 10px 9px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 1px 3px rgba(15, 23, 42, 0.06);
}

.calls-day-header-title {
  font-size: 13px;
  font-weight: 600;
  color: #1c2733;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.calls-day-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.calls-day-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.calls-day-chip-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.calls-day-chip--in {
  background: rgba(51, 144, 236, 0.16);
  border-color: rgba(51, 144, 236, 0.22);
  color: #1a6ec4;
}

.calls-day-chip--out {
  background: rgba(78, 187, 116, 0.16);
  border-color: rgba(56, 163, 96, 0.2);
  color: #1d8a52;
}

.calls-day-chip--missed {
  background: rgba(229, 92, 88, 0.12);
  border-color: rgba(229, 92, 88, 0.22);
  color: #c43d3a;
}

.calls-day-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.people-list {
  flex: none;
  overflow: visible;
  padding: 10px 10px calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.people-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e6edf6;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 20px rgba(37, 99, 235, 0.06);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.people-item::after {
  content: '';
  position: absolute;
  left: 66px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.05));
  pointer-events: none;
}

.people-item:last-child::after {
  display: none;
}

.people-item:hover {
  transform: translateY(-1px);
  border-color: #d8e6f7;
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 12px 26px rgba(37, 99, 235, 0.1);
}

.people-avatar-wrap {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #dbe7f5;
  box-shadow: 0 2px 7px rgba(37, 99, 235, 0.12);
}

.people-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #e7edf7;
}

.people-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ea5e9, #70cbff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.people-main {
  flex: 1;
  min-width: 0;
}

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

.people-name {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: #0b1f36;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.people-last-seen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #5f7690;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f6fc;
  border: 1px solid #e2edf9;
}

.people-last-seen::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8fb8de;
  flex-shrink: 0;
}

.people-last-seen-fresh {
  color: #167a44;
  background: #e9fbf1;
  border-color: #c8f0d9;
}

.people-last-seen-fresh::before {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.16);
}

.people-last-seen-recent {
  color: #0f766e;
  background: #e8fbfa;
  border-color: #c8f0ec;
}

.people-last-seen-recent::before {
  background: #14b8a6;
}

.people-last-seen-today {
  color: #1d4ed8;
  background: #edf4ff;
  border-color: #d7e6ff;
}

.people-last-seen-today::before {
  background: #3b82f6;
}

.people-last-seen-yesterday {
  color: #7c3a04;
  background: #fff6e9;
  border-color: #ffe7c4;
}

.people-last-seen-yesterday::before {
  background: #f59e0b;
}

.people-last-seen-old {
  color: #6b7280;
  background: #f5f7fa;
  border-color: #e4e9f0;
}

.people-last-seen-old::before {
  background: #9ca3af;
}

.people-last-seen-never {
  color: #7f1d1d;
  background: #fff1f2;
  border-color: #ffd8de;
}

.people-last-seen-never::before {
  background: #f43f5e;
}

.people-phone {
  margin-top: 4px;
  font-size: 12px;
  color: #3a4b62;
  letter-spacing: 0.08px;
}

.people-position {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  width: fit-content;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #2d78b8;
  font-weight: 700;
  border: 1px solid #d8e9f8;
  background: linear-gradient(180deg, #f3f9ff 0%, #eef6ff 100%);
}

.calls-item {
  display: flex;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e9eef4;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.calls-item-missed {
  border-left: 3px solid #ef4444;
  background: #fff7f7;
}

.calls-item-answered {
  border-left: 3px solid #22c55e;
  background: #f6fff8;
}

.calls-item-outgoing {
  border-left: 3px solid #3b82f6;
  background: #f5f9ff;
}

.calls-item-avatar-wrap {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.calls-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.calls-item-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.calls-item-main {
  flex: 1;
  min-width: 0;
}

.calls-item-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.calls-type {
  font-size: 12px;
  font-weight: 700;
  color: #1f2a37;
}

.calls-time {
  font-size: 11px;
  color: #6b7280;
  margin-left: auto;
}

.calls-line {
  font-size: 12px;
  color: #334155;
  margin-top: 2px;
  word-break: break-word;
}

.calls-order-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #1565c0;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e3f2fd;
  border: 1px solid rgba(21, 101, 192, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.calls-direction {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.calls-direction-in {
  color: #0f766e;
  background: #dffaf6;
  border: 1px solid #a7f3d0;
}

.calls-direction-out {
  color: #1d4ed8;
  background: #e8f0ff;
  border: 1px solid #bfdbfe;
}

.calls-actions-row {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.calls-actions-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}

.calls-actions-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid #d7e5f8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: #3f5f83;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.calls-actions-toggle:hover {
  background: #eef5ff;
  color: #2f78bc;
  border-color: #c8dbf4;
}

.calls-actions-toggle svg {
  width: 16px;
  height: 16px;
}

.calls-actions-menu {
  margin-top: 7px;
  min-width: 210px;
  background: #fff;
  border: 1px solid #dfeaf9;
  border-radius: 13px;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.14);
  display: none;
  overflow: hidden;
  z-index: 3;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
}

.calls-actions-wrap.active .calls-actions-menu {
  display: block;
}

.calls-actions-item {
  width: 100%;
  border: none;
  background: #fff;
  color: #1e334d;
  text-align: left;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.calls-actions-item + .calls-actions-item {
  border-top: 1px solid #edf3fb;
}

.calls-actions-item:hover {
  background: #f1f7ff;
}

.calls-voice {
  margin-top: 8px;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, #edf5ff 0%, #e8f2ff 100%);
  border: 1px solid #d8e8ff;
}

.calls-voice--simple {
  flex-wrap: wrap;
}

.calls-voice-track {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.calls-voice-times {
  display: flex;
  align-items: baseline;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #64748b;
}

.calls-voice-cur {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.calls-voice-sep {
  margin: 0 3px;
  opacity: 0.45;
  font-weight: 500;
}

.calls-voice-dur {
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
}

.calls-voice-seek {
  width: 100%;
  height: 22px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  background: transparent;
  accent-color: #54a9eb;
}

.calls-voice-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.12);
}

.calls-voice-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #54a9eb;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}

.calls-voice-seek::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.12);
}

.calls-voice-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #54a9eb;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}

.calls-voice-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #54a9eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.1s ease;
}

.calls-voice-play:active {
  transform: scale(0.96);
}

.calls-voice-play.is-playing {
  background: #2e86d0;
}

.calls-voice-play-icon {
  display: block;
  line-height: 1;
  transform: translateX(1px);
}

.calls-voice-open {
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.22);
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.calls-voice-open:hover {
  background: rgba(59, 130, 246, 0.2);
}

.money-item {
  display: flex;
  align-items: stretch;
  padding: 6px 10px 6px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e8ecf1;
  transition: background 0.12s, border-color 0.12s;
  cursor: pointer;
}

.money-item-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  min-width: 0;
}

.money-item-bottom .money-item-meta {
  flex: 1;
  min-width: 0;
}

.money-item-employee-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.money-item:hover {
  border-color: #d1d9e3;
}

.money-item:active {
  background: #f4f6f8;
}

.money-item-income {
  background: #f8fdf9;
  border-color: #e2f0e6;
}

.money-item-expense {
  background: #fef9f9;
  border-color: #f5e4e4;
}

.money-item-pending {
  border-left: 3px solid #f59e0b;
  box-shadow: inset 6px 0 10px -6px rgba(245, 158, 11, 0.15);
}

.money-item-confirmed {
  border-left: 2px solid #16a34a;
}

.money-item-deleted {
  border-left: 2px solid #94a3b8;
  opacity: 0.7;
}

.money-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.money-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.money-item-amount {
  font-size: 14px;
  font-weight: 700;
  color: #1a1d21;
  letter-spacing: -0.02em;
}

.money-item-income .money-item-amount {
  color: #15803d;
}

.money-item-expense .money-item-amount {
  color: #be123c;
}

.money-item-meta {
  font-size: 10px;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-item-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.money-item-type,
.money-item-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.money-item-type {
  background: rgba(255,255,255,0.95);
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.money-item-status {
  color: #334155;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.money-item-pending .money-item-status {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.4);
  background: #fffbeb;
}

.money-item-confirmed .money-item-status {
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.35);
  background: #f0fdf4;
}

.money-item-deleted .money-item-status {
  color: #64748b;
  border-color: #e2e8f0;
  background: #f1f5f9;
}

.money-status-menu {
  position: fixed;
  z-index: 300;
  display: none;
  min-width: 170px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border: 1px solid #eceff3;
  padding: 6px;
}

.money-status-menu.active {
  display: block;
}

.money-status-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #1f2a37;
  cursor: pointer;
}

.money-status-menu-item:hover {
  background: #f3f7ff;
}

.money-status-menu-item.active {
  background: #e8f1ff;
  color: #1d4ed8;
  font-weight: 600;
}

.money-add-form {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: 500px;
  width: calc(100% - 24px);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  z-index: 40;
}

.money-amount-input,
.money-type-input,
.money-order-input {
  border: none;
  background: #f0f0f0;
  border-radius: 12px;
  font-size: 12px;
  color: #707579;
  padding: 8px 10px;
}

.money-amount-input {
  flex: 1;
  min-width: 120px;
}

.money-type-input,
.money-order-input {
  width: 120px;
}

.money-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #54a9eb;
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── Schedule page ─────────────────────────────────────── */

.sch-header-bar {
  position: sticky;
  top: 0;
  z-index: 9;
  background: #54a9eb;
  color: #fff;
  padding: 8px 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.sch-header-spacer {
  flex: 1;
  min-width: 0;
}

.sch-search-toggle-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.sch-search-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.sch-search-toggle-btn:active {
  background: rgba(255, 255, 255, 0.35);
}

.sch-search-toggle-btn--active {
  background: rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.sch-search-panel {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 6px 12px 8px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.sch-search-panel-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 40px;
  padding: 0 10px 0 12px;
  background: #f4f4f7;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.sch-search-panel-lens {
  flex-shrink: 0;
  color: #aeb7c2;
}

.sch-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.35;
  color: #111;
  outline: none;
  padding: 10px 0;
  -webkit-appearance: none;
  appearance: none;
}

.sch-search-input::placeholder {
  color: #8e959b;
}

.sch-search-clear-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: 0 2px 0 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #707579;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.sch-search-clear-btn:hover {
  background: rgba(0, 0, 0, 0.09);
}

.sch-search-clear-btn:active {
  background: rgba(0, 0, 0, 0.12);
}

.sch-filter-open-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.sch-filter-open-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.sch-filter-open-btn.sch-filter-active::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffb020;
  box-shadow: 0 0 0 2px #54a9eb;
}

.sch-logout-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.sch-logout-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}

body.role-employee .sch-logout-btn {
  display: inline-flex;
}

.schedule-filters-done {
  width: 100%;
  margin-top: 8px;
}

.schedule-filters-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: #9aa3ad;
  line-height: 1.4;
}

.sch-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.sch-empty {
  text-align: center;
  padding: 48px 16px;
  color: #9ca3af;
  font-size: 14px;
}

.sch-group {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

.sch-group-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 5px 8px 5px 10px;
  gap: 4px;
  min-height: 32px;
  box-sizing: border-box;
  background: #f4f4f7;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.sch-group-header:active {
  background: #ebecef;
}

.sch-group-today .sch-group-header {
  box-shadow: inset 3px 0 0 #3390ec;
}

.sch-group-nodate .sch-group-header {
  box-shadow: inset 3px 0 0 #f69a1a;
}

.sch-group-stuck .sch-group-header {
  box-shadow: inset 3px 0 0 #5c9ce6;
}

.sch-group:not(.sch-group-today):not(.sch-group-nodate):not(.sch-group-stuck) .sch-group-header {
  box-shadow: inset 3px 0 0 #aeb7c2;
}

.sch-group-label {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #707579;
  line-height: 1.25;
}

.sch-group-today .sch-group-label {
  color: #3390ec;
}

.sch-group-nodate .sch-group-label {
  color: #c27a12;
}

.sch-group-stuck .sch-group-label {
  color: #3a7fd5;
}

.sch-group-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #aeb7c2;
  transition: transform 0.2s ease;
}

.sch-group-header.collapsed .sch-group-arrow {
  transform: rotate(-90deg);
}

/* Schedule items */
.sch-group-items {
  background: #fff;
}

.sch-item {
  display: grid;
  grid-template-columns: minmax(48px, max-content) minmax(0, 1fr) 32px 46px;
  align-items: center;
  gap: 0 6px;
  width: 100%;
  padding: 2px;
  border: none;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.sch-item * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.sch-item:active {
  background: #f8fafc;
}

.sch-item:focus {
  outline: none;
}

.sch-item:focus-visible {
  outline: 2px solid rgba(84, 169, 235, 0.45);
  outline-offset: 1px;
}

.sch-item-closed {
  opacity: 0.55;
}

.sch-col-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.sch-num-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  text-align: center;
}

.sch-col-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

.sch-main-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.sch-ind-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.sch-col-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.sch-avatar-placeholder {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.sch-col-time {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  text-align: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 2px 1px;
}

.sch-col-time .sch-time {
  text-align: center;
  width: 100%;
  min-width: 0;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.sch-num {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.sch-deadline {
  font-size: 10px;
  font-weight: 500;
  color: #111;
  line-height: 1.2;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sch-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1.2;
  flex-shrink: 0;
}

.sch-status-новый {
  background: #e3f2fd;
  color: #1976d2;
}

.sch-status-закрыт {
  background: #e8f5e9;
  color: #388e3c;
}

.sch-status-удалён {
  background: #ffebee;
  color: #c62828;
}

.sch-status-замер {
  background: #e3f2fd;
  color: #1565c0;
}

.sch-status-монтаж {
  background: #e8f5e9;
  color: #2e7d32;
}

.sch-status-не-отвечает {
  background: #f3f4f6;
  color: #4b5563;
}

.sch-status-рекламация {
  background: #fff3e0;
  color: #e65100;
}

.sch-status-самовывоз {
  background: #fff8e1;
  color: #f57f17;
}

.sch-status-делаем {
  background: #ede7f6;
  color: #5e35b1;
}

.sch-status-рассчитать {
  background: #e1f5fe;
  color: #0277bd;
}

.sch-wt-badges {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}

.sch-wt-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  line-height: 1.3;
}

.sch-wt-замер {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid rgba(21, 101, 192, 0.25);
}

.sch-wt-монтаж {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid rgba(46, 125, 50, 0.3);
}

.sch-wt-рекламация {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid rgba(230, 81, 0, 0.3);
}

.sch-wt-плиссе {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid rgba(123, 31, 162, 0.3);
}

.sch-wt-шторы {
  background: #f3f4ff;
  color: #3f2cff;
  border: 1px solid rgba(63, 44, 255, 0.25);
}

.sch-wt-ремонт {
  background: #eceff1;
  color: #455a64;
  border: 1px solid rgba(69, 90, 100, 0.3);
}

.sch-wt-раздвижка {
  background: #e8eaf6;
  color: #3949ab;
  border: 1px solid rgba(57, 73, 171, 0.3);
}

.sch-wt-доставка {
  background: #e0f7fa;
  color: #00838f;
  border: 1px solid rgba(0, 131, 143, 0.3);
}

.sch-wt-самовывоз {
  background: #fff8e1;
  color: #f57f17;
  border: 1px solid rgba(245, 127, 23, 0.3);
}

.sch-ind {
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.sch-ind-alert {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
}

.sch-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sch-avatar-letter {
  background: linear-gradient(135deg, #4ea5e9, #70cbff);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sch-time {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  white-space: normal;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  line-height: 1.25;
  width: 100%;
  text-align: center;
  letter-spacing: -0.02em;
}

.sch-time-empty {
  color: #cbd5e1;
  font-weight: 500;
}

.sch-addr {
  font-size: 12px;
  color: #1f2937;
  line-height: 1.35;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sch-item-closed .sch-addr {
  text-decoration: line-through;
  color: #9ca3af;
}

