:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 320px 1fr;
}

body.mobile-sidebar-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: contents;
}

.mobile-sidebar-toggle,
.mobile-sidebar-backdrop {
  display: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(31, 79, 122, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.16), transparent 30%),
    linear-gradient(135deg, #eef3f8, #dce6ef);
  z-index: 2000;
}

.auth-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d7e1ea;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.18);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand h1 {
  font-size: 24px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-error {
  color: #b42318;
  background: #fee4e2;
  border: 1px solid #fecdca;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.auth-hint {
  font-size: 13px;
  color: #65758b;
  line-height: 1.5;
}

.user-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #dde3ea;
}

.user-label {
  font-size: 12px;
  color: #65758b;
}

.user-name {
  font-weight: 700;
  color: #17202a;
}

.user-role {
  font-size: 13px;
  color: #1f4f7a;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

button,
input,
select,
textarea {
  font: inherit;
}

input[type="search"]::-webkit-search-cancel-button {
  transform: scale(2);
  transform-origin: center;
  cursor: pointer;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #dde3ea;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  height: 100vh;
}

.mobile-sidebar-toggle {
  position: fixed;
  bottom: 72px;     /* выше строки поиска (56px) + отступ */
  right: 16px;
  z-index: 1400;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 6px 24px rgba(29, 78, 216, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-sidebar-toggle::before {
  content: '\2630'; /* ☰ */
  font-size: 22px;
}

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1190;
  background: rgba(15, 23, 42, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-stock-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #17b65a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
}

.brand-stock-btn svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-stock-btn:hover {
  background: transparent;
  color: #12a150;
}

.brand-stock-btn:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

button.brand-mark {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.sidebar.header-collapsed .brand-text,
.sidebar.header-collapsed .user-panel {
  display: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

.brand p,
.panel-head span,
.meta,
.file-meta,
.empty {
  color: #65758b;
}

.field {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: #39475a;
}

.field[hidden] {
  display: none;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  padding: 0 10px;
  background: #ffffff;
}

.field input,
.field select {
  height: 40px;
}

.field textarea {
  min-height: 92px;
  padding-top: 9px;
  resize: vertical;
}

.format-filter {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.format-filter-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.format-filter-btn:hover {
  filter: brightness(0.98);
}

.format-filter-btn.active {
  color: #ffffff;
  border-color: #111827;
  filter: brightness(0.72) saturate(1.1);
  box-shadow: inset 0 0 0 2px rgba(17, 24, 39, 0.5), 0 2px 8px rgba(17, 24, 39, 0.28);
  transform: translateY(-1px);
}

.year-filter {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.year-filter label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

.year-filter input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #2ba892;
}

.excel-note {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #ffffff;
}

.note-content {
  white-space: pre-wrap;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  color: #17202a;
  font-size: 13px;
}

.primary {
  height: 42px;
  border: 0;
  border-radius: 7px;
  background: #1f4f7a;
  color: #ffffff;
  cursor: pointer;
}

.primary:disabled,
.secondary:disabled {
  cursor: default;
  opacity: 0.65;
}

.compact {
  height: 38px;
  padding: 0 14px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.stats div {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
}

.stats dt {
  font-size: 12px;
  color: #65758b;
}

.stats dd {
  margin: 5px 0 0;
  font-size: 24px;
  font-weight: 700;
}

/* Мобильная панель статистики — скрыта на десктопе */
.mobile-stat-bar {
  display: none;
}

/* Мобильная строка поиска — скрыта на десктопе */
.mobile-search-bar {
  display: none;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 1px;
  background: #dde3ea;
  height: 100vh;
  overflow: hidden;
}

.list-panel {
  min-width: 0;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.map-wrapper {
  position: relative;
  min-width: 0;
  background: #f8fafc;
  height: 100vh;
}

/* Для казначея скрываем только контейнер карты, не весь map-wrapper */
#mapContainer.hidden {
  display: none !important;
}

.leaflet-map {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-x pan-y pinch-zoom;
}

.leaflet-map:active {
  cursor: grabbing;
}

.panel-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  border-bottom: 1px solid #dde3ea;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2 {
  font-size: 18px;
}

.request-list {
  display: grid;
  flex: 1;
  overflow-y: auto;
  align-content: start;
}

.request-row {
  border: 0;
  border-bottom: 1px solid #e3e8ef;
  background: #ffffff;
  text-align: left;
  padding: 8px 12px 9px;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: all 0.15s ease;
}

.request-row:hover {
  background: #eef7f6;
}

.request-row.active {
  background: #d4ede9;
  border-left-color: #2ba892;
  box-shadow: inset 0 0 0 1px #2ba892;
}

.request-row strong {
  display: block;
  font-size: 13px;
}

.meta {
  margin-top: 2px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.days-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  margin-right: 6px;
  white-space: nowrap;
  position: relative;
}

.days-badge small {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
}

.days-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.days-safe {
  background-color: #dcfce7;
  color: #15803d;
}

.request-meta-sum {
  margin-top: 4px;
  font-weight: 600;
  font-size: 12px;
  color: #374151;
}

.request-meta-sum.sum-spec-link {
  cursor: pointer;
  text-decoration: underline dotted;
}
.request-meta-sum.sum-spec-link:hover {
  opacity: 0.8;
}

.request-meta-sum.sum-confirmed {
  color: #15803d;
  background-color: #dcfce7;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

.detail-panel {
  position: absolute;
  inset: 0;
  background: #f8fafc;
  overflow: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.detail-panel.visible {
  transform: translateX(0);
  pointer-events: auto;
}

.detail-panel-head {
  flex-shrink: 0;
  background: #f8fafc;
  border-bottom: 1px solid #dde3ea;
  padding: 10px 18px;
  display: flex;
  align-items: center;
}

.detail-close-btn {
  font-size: 14px;
  color: #1f4f7a;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
}

.detail-close-btn:hover {
  background: #eef7f6;
}

.detail-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c4d2;
  border-radius: 8px;
  background: #ffffff;
}

.detail {
  display: grid;
  gap: 18px;
}

.detail-head {
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
}

.detail-head h2 {
  font-size: 12px;
  margin-bottom: 8px;
}

.detail-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.detail-header-top h2 {
  flex: 1;
  margin-bottom: 0;
}

.call-btn {
  padding: 8px 14px;
  background: #0f7676;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.call-btn:hover {
  background: #0a5454;
}

.detail-sum {
  margin-top: 8px;
  padding: 8px 12px;
  background-color: #f3f4f6;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}

.detail-sum-confirmed {
  background-color: #dcfce7;
  color: #15803d;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.excel-table th {
  text-align: left;
  padding: 4px 8px;
  font-weight: 600;
  color: #65758b;
  width: 40%;
  vertical-align: top;
}

.excel-table td {
  padding: 4px 8px;
  vertical-align: top;
  word-break: break-word;
}

.excel-table tr:nth-child(even) td,
.excel-table tr:nth-child(even) th {
  background: rgba(0, 0, 0, 0.03);
}

/* Выпадающий список выбора исполнителя в карточке (администратор) */
.executor-select {
  width: 100%;
  max-width: 260px;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}

.executor-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.executor-select:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Подсветка строк "Замечания к акту" и "Примечания" красным */
.excel-table tr.row-act-note th,
.excel-table tr.row-act-note td,
.excel-table tr.row-notes th,
.excel-table tr.row-notes td {
  background: #fdecec;
  color: #c0392b;
  font-weight: 600;
}

/* Подсветка строки "Неисправность" зелёным */
.excel-table tr.row-fault td {
  background: #e6f7ec;
  color: #1a7a3c;
  font-weight: 600;
  padding: 6px 8px;
}

.fault-label {
  display: block;
  font-size: 0.85em;
  font-weight: 700;
  color: #1a7a3c;
  margin-bottom: 4px;
  opacity: 0.75;
}

/* На мобильном: убираем block-костыли (colspan уже решает проблему) */
@media (max-width: 980px) {
  .excel-table tr.row-fault {
    display: table-row;
  }
  .excel-table tr.row-fault td {
    display: table-cell;
    width: auto !important;
  }
  /* Скрываем кнопку "Показать на карте" на мобильном */
  [data-show-on-map] {
    display: none !important;
  }
}

.file-ext-badge {
  display: inline-block;
  min-width: 36px;
  padding: 2px 5px;
  background: #e8eef6;
  color: #1f4f7a;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}

.file-item:hover {
  background: #f0f6ff;
  border-radius: 4px;
}

.file-act-amount {
  font-size: 12px;
  color: #166534;
  font-weight: 700;
  white-space: nowrap;
  background: #dcfce7;
  border-radius: 5px;
  padding: 1px 6px;
}

.payout-total-line {
  padding: 7px 6px 4px 6px;
  font-size: 13px;
  color: #166534;
  border-top: 1px solid #d1fae5;
  margin-top: 4px;
}

.payout-total-line strong {
  font-size: 14px;
}


  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.file-executor-comment {
  margin-top: 4px;
  margin-left: 2px;
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  border-radius: 5px;
  padding: 3px 8px;
  border: 1px solid #fde68a;
}

.file-executor-comment-label {
  font-weight: 700;
  color: #92400e;
}

.file-fixed-badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
}


  height: 24px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1f2937;
  font-size: 11px;
  padding: 0 8px;
  cursor: pointer;
}

.file-fixed-btn {
  border-color: #a7f3d0;
  color: #065f46;
  background: #ecfdf5;
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-editor {
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 12px;
}

.save-state,
.detail-status {
  align-self: center;
  color: #65758b;
  font-size: 13px;
}

.secondary {
  height: 38px;
  border: 1px solid #b8c4d2;
  border-radius: 7px;
  background: #ffffff;
  color: #17202a;
  padding: 0 12px;
  cursor: pointer;
}

.file-list {
  display: grid;
  gap: 8px;
}

.excel-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.excel-row {
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.badge {
  max-width: 100%;
  border: 1px solid #b8d7cf;
  border-radius: 999px;
  background: #eef7f3;
  color: #155b4f;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  font-size: 13px;
}

.kv span {
  color: #65758b;
}

.kv strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.file-row {
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
}

.file-row button,
.file-row {
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.file-row strong {
  overflow-wrap: anywhere;
}

.file-row.file-image {
  cursor: pointer;
}

.file-row.file-image:hover {
  background: #eef7f6;
}

.image-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1650;
}

.image-modal.hidden {
  display: none;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.55);
}

.image-modal-panel {
  position: relative;
  max-width: min(90vw, 960px);
  max-height: min(90vh, 760px);
  width: 100%;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-rows: auto 1fr;
}

.image-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #dde3ea;
}

.image-modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.image-modal-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.image-modal-controls .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #dde3ea;
  background: #ffffff;
  padding: 0;
  font-size: 18px;
}

.icon-button {
  border: none;
  background: transparent;
  color: #17202a;
  font-size: 18px;
  cursor: pointer;
}

.image-modal-body {
  padding: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111;
}

.image-modal-body img {
  width: auto;
  height: auto;
  max-width: calc(100vw - 88px);
  max-height: calc(100vh - 150px);
  border-radius: 8px;
  transform-origin: center center;
  transition: transform 0.2s ease;
  cursor: grab;
  touch-action: none; /* нужно для корректной работы pointer events при pinch */
  -webkit-user-drag: none;
  user-drag: none;
}

.image-modal-body img:active {
  cursor: grabbing;
}

.act-controls {
  padding: 12px 18px;
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  border-bottom: 1px solid #dde3ea;
  background: #f8fafc;
}

.act-amount-field {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.act-amount-field span {
  font-size: 12px;
  color: #475569;
}

.act-amount-field input {
  height: 34px;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  padding: 0 10px;
}

.act-controls.hidden {
  display: none;
}

.button-accept {
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: #0a7c59;
  color: #ffffff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 500;
}

.button-accept:hover {
  background: #065a43;
}

.button-remarks {
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: #d4610a;
  color: #ffffff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 500;
}

.button-remarks:hover {
  background: #a3470a;
}

.file-row {
  position: relative;
}

.file-row.status-accept {
  background: #d4edda;
  border-color: #0a7c59;
}

.file-row.status-remarks {
  background: #f8d7da;
  border-color: #d4610a;
}

.act-status {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 20px;
  font-weight: bold;
}

.file-row.status-accept .act-status {
  color: #0a7c59;
}

.file-row.status-remarks .act-status {
  color: #d4610a;
}

.act-remark {
  font-size: 12px;
  color: #d4610a;
  margin-top: 4px;
  font-style: italic;
}

.remarks-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1700;
}

.remarks-modal.hidden {
  display: none;
}

.remarks-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.55);
}

.remarks-modal-panel {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.remarks-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #dde3ea;
}

.remarks-modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.remarks-modal-body {
  padding: 18px;
  overflow-y: auto;
  max-height: 400px;
}

.remarks-modal-body textarea {
  width: 100%;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  padding: 10px;
  font-family: inherit;
  resize: vertical;
}

/* Колёсный (iOS-style) выбор даты */
.wheel-picker {
  position: relative;
  display: flex;
  gap: 4px;
  height: 180px;
  margin-top: 8px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}

.wheel-highlight {
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  height: 36px;
  border-top: 1px solid #d4dae2;
  border-bottom: 1px solid #d4dae2;
  background: rgba(31, 79, 122, 0.05);
  pointer-events: none;
  z-index: 1;
}

.wheel-col {
  flex: 1;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  text-align: center;
  cursor: grab;
  touch-action: pan-y;
}

.wheel-col.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.wheel-col::-webkit-scrollbar {
  display: none;
}

.wheel-col ul {
  list-style: none;
  margin: 0;
  padding: 72px 0;
}

.wheel-col li {
  height: 36px;
  line-height: 36px;
  scroll-snap-align: center;
  font-size: 18px;
  color: #b3bcc7;
  user-select: none;
  transition: color 0.12s, font-weight 0.12s;
}

.wheel-col li.selected {
  color: #16202a;
  font-weight: 700;
}

.remarks-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid #dde3ea;
}

.button-cancel {
  height: 38px;
  border: 1px solid #b8c4d2;
  border-radius: 7px;
  background: #ffffff;
  color: #17202a;
  padding: 0 16px;
  cursor: pointer;
}

.button-ok {
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: #1f4f7a;
  color: #ffffff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 500;
}

.button-ok:hover {
  background: #163a5a;
}

.file-meta {
  margin-top: 4px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.document-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1650;
}

.document-modal.hidden {
  display: none;
}

.document-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.55);
}

.document-modal-panel {
  position: relative;
  width: 95%;
  height: 90%;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.document-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #dde3ea;
}

.document-modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.document-modal-body {
  padding: 12px;
  overflow: hidden;
}

.document-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

.document-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
  text-align: center;
}

.document-options p {
  margin: 0;
  font-size: 16px;
  color: #17202a;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.button-primary,
.button-secondary {
  display: inline-block;
  padding: 12px 20px;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.button-primary {
  background-color: #1f4f7a;
  color: white;
}

.button-primary:hover {
  background-color: #163a5a;
}

.equipment-cabinet-body {
  max-height: 70vh;
}

#equipmentCabinetModal .remarks-modal-panel {
  width: 96vw;
  max-width: 96vw;
  height: 92vh;
  max-height: 92vh;
  border-radius: 10px;
}

#equipmentCabinetModal .remarks-modal-body {
  max-height: none;
  height: 100%;
}

#stockAdminModal .remarks-modal-panel {
  width: 98vw;
  max-width: 98vw;
  height: 96vh;
  max-height: 96vh;
  border-radius: 10px;
}

#stockAdminModal .remarks-modal-body {
  max-height: none;
  height: 100%;
}

#stockAdminModal #stockAdminPanel {
  margin-top: 0;
}

.equipment-cabinet-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.equipment-cabinet-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1f2937;
}

.equipment-cabinet-types,
.equipment-cabinet-requests {
  border: 1px solid #dde3ea;
  border-radius: 10px;
  background: #f9fafb;
  padding: 10px;
  max-height: 46vh;
  overflow: auto;
}

.equipment-type-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  padding: 9px 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.equipment-type-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.equipment-type-count {
  float: right;
  font-weight: 700;
}

.equipment-request-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.equipment-request-item strong {
  color: #111827;
}

.stock-admin-panel {
  margin-top: 0;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8fbff;
  padding: 6px;
}

.stock-admin-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr);
  margin-bottom: 6px;
}

.zip-issue-form {
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  background: #ffffff;
  padding: 6px 8px;
  max-width: none;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 6px 10px;
  align-items: end;
}

.zip-issue-form .field {
  margin-bottom: 0;
}

.zip-issue-form .field span {
  margin-bottom: 3px;
  font-size: 12px;
}

.zip-issue-form select,
.zip-issue-form input {
  height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

.zip-issue-form .button-ok {
  grid-column: 1 / -1;
  width: 240px;
  margin-top: 0;
  min-height: 34px;
  justify-self: start;
}

body.role-executor #zipIssueForm {
  display: none !important;
}

.stock-monitor-summary {
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.stock-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.stock-kpi {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.stock-kpi span {
  display: block;
  font-size: 12px;
  color: #4b5563;
}

.stock-kpi strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  color: #111827;
}

.stock-kpi.ok strong {
  color: #047857;
}

.stock-kpi.danger strong {
  color: #b91c1c;
}

.stock-balance-table {
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  background: #ffffff;
  max-height: none;
  overflow: visible;
  max-width: none;
  width: 100%;
}

.stock-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 13px;
}

.stock-table th,
.stock-table td {
  border-bottom: 1px solid #edf2f7;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.stock-table thead th {
  position: sticky;
  top: 0;
  background: #eef5ff;
  z-index: 1;
  font-size: 12px;
  color: #334155;
}

.stock-table td.neg {
  color: #b91c1c;
  font-weight: 700;
}

.stock-table td.pos {
  color: #047857;
  font-weight: 600;
}

.stock-table td.zero {
  color: #6b7280;
}

.stock-table-view th,
.stock-table-view td {
  padding: 6px 6px;
  font-size: 12px;
}

.stock-table-view .stock-head-cell {
  gap: 3px;
}

.stock-table-view .stock-filter-trigger {
  min-width: 92px;
}

.stock-empty-row {
  text-align: center;
  color: #64748b;
  font-size: 13px;
  padding: 14px 8px;
}

.stock-required-btn {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.stock-used-btn {
  border: 0;
  background: transparent;
  color: #0f766e;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.stock-used-zero {
  color: #6b7280;
}

.stock-required-zero {
  color: #6b7280;
}

.stock-view-only {
  color: #64748b;
  font-size: 12px;
}

.stock-required-panel {
  margin-top: 8px;
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.stock-head-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stock-head-filter {
  width: 100%;
  min-width: 130px;
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  padding: 0 6px;
}

.stock-multi-filter {
  position: relative;
}

.stock-filter-trigger {
  width: 100%;
  min-width: 130px;
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  padding: 0 8px;
  text-align: left;
  cursor: pointer;
}

.stock-filter-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: 220px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  padding: 6px;
  overscroll-behavior: contain;
}

.stock-filter-menu-floating {
  position: fixed;
  z-index: 2600;
}

.stock-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #1e293b;
  padding: 4px 2px;
}

.stock-filter-option input {
  margin: 0;
}

.stock-filter-option-all {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
  padding-bottom: 6px;
}

.stock-filter-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid #e2e8f0;
  margin-top: 6px;
  padding-top: 6px;
}

.stock-filter-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
}

.stock-filter-btn.ok {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.stock-filter-reset {
  height: 24px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  padding: 0 8px;
  cursor: pointer;
}

.stock-filter-reset:hover {
  background: #fee2e2;
}

.stock-required-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.stock-required-close {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  width: 26px;
  height: 26px;
}

.stock-required-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.stock-required-card {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  padding-right: 44px;
}

.stock-required-card-count {
  position: absolute;
  top: 6px;
  right: 8px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 800;
}

.stock-required-card-title {
  font-weight: 700;
  font-size: 13px;
  color: #111827;
  margin-bottom: 4px;
}

.stock-required-card-meta {
  font-size: 12px;
  color: #334155;
}

.stock-required-card-notes {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
}

.stock-actions-cell {
  white-space: nowrap;
}

.stock-row-btn {
  height: 26px;
  min-width: 26px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  font-weight: 700;
  margin-right: 4px;
}

.stock-row-btn.plus {
  color: #0f766e;
  border-color: #99f6e4;
  background: #f0fdfa;
}

.stock-row-btn.minus {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.stock-row-btn.apply {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.stock-row-btn.cancel {
  color: #374151;
}

.stock-cdek-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 46px;
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid #16a34a;
  border-radius: 999px;
  background: transparent;
  color: #16a34a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-decoration: none;
  line-height: 1;
}

.stock-cdek-link:hover {
  border-color: #15803d;
  color: #15803d;
  background: rgba(22, 163, 74, 0.08);
}

.stock-adjust-row td {
  background: #f8fafc;
}

.stock-adjust-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stock-adjust-title {
  font-size: 12px;
  color: #334155;
  margin-right: 6px;
}

.stock-adjust-qty {
  width: 90px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 8px;
}

.stock-adjust-comment {
  min-width: 240px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 8px;
}

.stock-recent-issues {
  margin-top: 8px;
  max-height: none;
  overflow: visible;
}

@media (max-width: 980px) {
  #equipmentCabinetModal .remarks-modal-panel {
    width: 95%;
    max-width: 600px;
    height: auto;
    max-height: calc(100vh - 24px);
    border-radius: 12px;
  }

  #equipmentCabinetModal .remarks-modal-body {
    height: auto;
    max-height: 70vh;
  }

  #stockAdminModal .remarks-modal-panel {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  #stockAdminModal .remarks-modal-body {
    height: auto;
    max-height: none;
  }

  .stock-admin-grid {
    grid-template-columns: 1fr;
  }

  .zip-issue-form {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .zip-issue-form .button-ok {
    grid-column: 1;
    width: 100%;
  }

  .stock-balance-table {
    width: 100%;
    max-width: 100%;
  }

  .stock-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .stock-table th,
  .stock-table td {
    padding: 4px 3px;
    font-size: 11px;
    line-height: 1.2;
  }

  .stock-table thead th {
    font-size: 10px;
  }

  .stock-head-cell {
    gap: 2px;
  }

  .stock-head-cell > span {
    font-size: 10px;
    line-height: 1.1;
  }

  .stock-filter-trigger {
    min-width: 0;
    height: 22px;
    font-size: 10px;
    padding: 0 4px;
  }

  .stock-filter-reset {
    height: 22px;
    font-size: 10px;
    padding: 0 5px;
  }

  .stock-filter-menu {
    width: 170px;
    max-height: 52vh;
  }

  .stock-filter-option {
    font-size: 11px;
  }

  .stock-row-btn {
    height: 22px;
    min-width: 22px;
    margin-right: 2px;
    padding: 0;
  }

  /* Админ-вид: 7 колонок должны вмещаться в экран. */
  .stock-table th:nth-child(1),
  .stock-table td:nth-child(1) { width: 21%; }
  .stock-table th:nth-child(2),
  .stock-table td:nth-child(2) { width: 21%; }
  .stock-table th:nth-child(3),
  .stock-table td:nth-child(3) { width: 10%; }
  .stock-table th:nth-child(4),
  .stock-table td:nth-child(4) { width: 11%; }
  .stock-table th:nth-child(5),
  .stock-table td:nth-child(5) { width: 11%; }
  .stock-table th:nth-child(6),
  .stock-table td:nth-child(6) { width: 13%; }
  .stock-table th:nth-child(7),
  .stock-table td:nth-child(7) { width: 13%; }

  /* Вид исполнителя: 5 колонок без "Исполнитель" и "Действия". */
  .stock-table-view th:nth-child(1),
  .stock-table-view td:nth-child(1) { width: 34%; }
  .stock-table-view th:nth-child(2),
  .stock-table-view td:nth-child(2) { width: 14%; }
  .stock-table-view th:nth-child(3),
  .stock-table-view td:nth-child(3) { width: 16%; }
  .stock-table-view th:nth-child(4),
  .stock-table-view td:nth-child(4) { width: 16%; }
  .stock-table-view th:nth-child(5),
  .stock-table-view td:nth-child(5) { width: 20%; }

  .stock-table td:nth-child(2),
  .stock-table-view td:nth-child(1) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.used-equipment-toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 1900;
  min-width: 280px;
  max-width: 380px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #86efac;
  background: linear-gradient(135deg, #ecfdf3, #dcfce7);
  box-shadow: 0 10px 24px rgba(21, 128, 61, 0.18);
  color: #14532d;
  animation: toastDropIn 0.2s ease-out;
}

.used-equipment-toast-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
}

.used-equipment-toast-body {
  font-size: 13px;
}

@keyframes toastDropIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.button-secondary {
  background-color: #e8ecf1;
  color: #17202a;
}

.button-secondary:hover {
  background-color: #dde3ea;
}

.request-row.status-completed {
  background-color: #d4edda;
  border-left-color: #0a7c59;
}

.request-row.status-progress {
  background-color: #cce5ff;
  border-left-color: #1f4f7a;
}

/* Подсветка списка по типу формата */
.request-row.format-mm {
  background-color: #fdecec;
  border-left: 4px solid #e74c3c;
}

.request-row.format-mk {
  background-color: #e6f7ec;
  border-left: 4px solid #27ae60;
}

.request-row.format-gm {
  background-color: #fff1e0;
  border-left: 4px solid #e67e22;
}

.request-row.format-rc {
  background-color: #dce7fb;
  border-left: 4px solid #2d6cdf;
}

.request-row.format-ma {
  background-color: #e0f5fb;
  border-left: 4px solid #3aa6c0;
}

/* Бейдж "Перенос" в правом верхнем углу заявки */
.request-row {
  position: relative;
}

.request-status-dot {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.28);
}

.status-dot-yellow {
  background: #facc15;
}

.status-dot-gray {
  background: #9ca3af;
}

.status-dot-green {
  background: #22c55e;
}

.status-dot-red {
  background: #ef4444;
}

.request-row strong,
.request-row .meta {
  padding-left: 12px;
}

.request-meta-line {
  color: #526073;
}

.request-meta-replacement {
  color: #355072;
  font-weight: 600;
}

.transfer-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  background: #6b3fa0;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}

/* Метка "Гарантия" в правом нижнем углу заявки */
.warranty-badge {
  position: absolute;
  bottom: 4px;
  right: 6px;
  color: #c0392b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Метка "Гарантия" рядом с INC в карточке */
.warranty-flag {
  margin-left: 10px;
  color: #c0392b;
  font-weight: 700;
}

/* Мультивыбор филиалов (для исполнителя) */
.multiselect {
  position: relative;
}

.multiselect-toggle {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  background: #ffffff;
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiselect-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  box-shadow: 0 12px 28px rgba(23, 32, 42, 0.16);
  padding: 6px;
  display: grid;
  gap: 2px;
}

.multiselect-menu.hidden {
  display: none;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.multiselect-option:hover {
  background: #eef7f6;
}

.multiselect-option input {
  width: 16px;
  height: 16px;
}

/* Список оборудования в модалке запроса */
.equipment-list {
  display: grid;
  gap: 4px;
}

.equipment-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid #e3e8ef;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
}

.equipment-option:hover {
  background: #eef7f6;
}

.equipment-option input {
  width: 18px;
  height: 18px;
}

.request-row.status-review {
  background-color: #fff3cd;
  border-left-color: #856404;
}

.request-row.status-cancelled {
  background-color: #e2e3e5;
  border-left-color: #5a6268;
}

.request-row.status-remarks {
  background-color: #f8d7da;
  border-left-color: #d4610a;
}

.request-row.status-warranty {
  background-color: #d1ecf1;
  border-left-color: #0c5460;
}

.request-row.request-row-treasurer-accepted {
  background-color: #e9f9ef;
  border-left-color: #15803d;
}

.treasurer-inc-sum {
  display: inline-block;
  margin-top: 3px;
  background: #166534;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 5px;
  padding: 1px 8px;
}

}

/* ─── Кнопка Навигатора ─── */
.navigator-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  vertical-align: middle;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.navigator-btn:hover { opacity: 0.8; }
.navigator-btn.disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* ─── SN-модалка ─── */
.sn-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sn-type-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}
.sn-type-btn {
  flex: 1;
  padding: 14px 8px;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sn-type-btn:hover { background: #3b82f6; color: #fff; }
.sn-section-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: -4px;
}
.sn-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sn-opt-btn {
  padding: 8px 14px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.sn-opt-btn.active {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}
.sn-serial-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}
.sn-serial-input:focus { border-color: #3b82f6; }

.sn-photo-source-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.sn-photo-source-btn {
  padding: 18px 12px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sn-photo-source-btn:hover { background: #3b82f6; color: #fff; }

.sn-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
  align-items: center;
}
.sn-progress-label {
  font-size: 15px;
  font-weight: 600;
  color: #1d4ed8;
}
.sn-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.sn-progress-fill {
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: #3b82f6;
  animation: snProgressSlide 1.1s ease-in-out infinite;
}
@keyframes snProgressSlide {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}

/* Глобальный тост состояния загрузки файлов */
.notification-toast {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 4000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: min(92vw, 440px);
  padding: 14px 16px;
  border-radius: 14px;
  background: #1f5f7f;
  color: #f8fafc;
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.notification-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.notification-toast.hidden { display: none; }
.notification-toast-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notification-toast-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notification-toast-body {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60px;
  overflow: hidden;
}
.notification-toast-close {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.notification-toast-close:hover {
  opacity: 1;
}

.upload-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 4000;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: min(92vw, 440px);
  padding: 12px 16px;
  border-radius: 14px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.upload-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.upload-toast.hidden { display: none; }
.upload-toast-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.35);
  border-top-color: #38bdf8;
  animation: uploadSpin 0.8s linear infinite;
}
.upload-toast.state-processing .upload-toast-icon {
  border-top-color: #fbbf24;
}
.upload-toast.state-success .upload-toast-icon,
.upload-toast.state-error .upload-toast-icon {
  animation: none;
  border: none;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.upload-toast.state-success .upload-toast-icon { background: #16a34a; }
.upload-toast.state-success .upload-toast-icon::before { content: "✓"; }
.upload-toast.state-error .upload-toast-icon { background: #dc2626; }
.upload-toast.state-error .upload-toast-icon::before { content: "!"; }
.upload-toast-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upload-toast-label {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-toast-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  overflow: hidden;
}
.upload-toast-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: #38bdf8;
  transition: width 0.2s ease;
}
.upload-toast.state-success .upload-toast-fill { width: 100% !important; background: #16a34a; }
.upload-toast.state-error .upload-toast-fill { background: #dc2626; }
/* Неопределённый прогресс (обработка на сервере) */
.upload-toast.state-processing .upload-toast-fill {
  width: 40% !important;
  background: #fbbf24;
  animation: snProgressSlide 1.1s ease-in-out infinite;
}
.upload-toast-percent {
  flex: 0 0 auto;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  min-width: 34px;
  text-align: right;
}
.upload-toast.state-processing .upload-toast-percent,
.upload-toast.state-success .upload-toast-percent,
.upload-toast.state-error .upload-toast-percent { display: none; }
@keyframes uploadSpin {
  to { transform: rotate(360deg); }
}


@media (max-width: 980px) {
  body {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 56px 0;
    width: 100%;
    height: auto;
    max-height: 70vh;
    border-right: 0;
    border-top: 2px solid #dde3ea;
    border-radius: 16px 16px 0 0;
    padding: 14px 18px 18px;
    z-index: 1200;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateY(0);
  }

  /* Скрываем кнопку Фильтры при открытом сайдбаре */
  body.mobile-sidebar-open .mobile-sidebar-toggle {
    display: none !important;
  }

  /* В нижней шторке фильтров показываем исполнителя и кнопку выхода сверху,
     даже если сайдбар свёрнут (header-collapsed). */
  .sidebar.header-collapsed .user-panel {
    display: flex;
    order: -1;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    overflow: hidden;
  }

  /* Порядок: 1-счётчики, 2-карта; список скрыт */
  .mobile-stat-bar { order: 1; }
  .map-wrapper    { order: 2; }
  .list-panel     { display: none !important; }
  /* Показываем список когда включен поиск на мобильной версии */
  .list-panel.show-on-mobile {
    display: grid !important;
    order: 2;
    position: absolute;
    top: 48px;
    bottom: 56px;
    left: 0;
    right: 0;
    z-index: 1350;
    background: #fff;
    border-bottom: 1px solid #e3e8ef;
  }

  .mobile-stat-bar {
    display: flex;
    gap: 0;
    background: #1e293b;
    color: #fff;
    align-items: center;
    justify-content: space-around;
    padding: 6px 12px;
    z-index: 10;
  }
  .mobile-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
  }
  .mobile-stat-num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
  }
  .mobile-stat-label {
    font-size: 15px;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .mobile-stat-progress .mobile-stat-num { color: #60a5fa; }

  .list-panel {
    height: auto;
    overflow: hidden;
  }

  .request-list {
    overflow-y: auto;
    flex: 1;
  }

  .map-wrapper {
    height: auto;
    min-height: 0;
  }

  .mobile-sidebar-toggle,
  .mobile-sidebar-backdrop {
    display: block;
  }

  /* Строка поиска внизу экрана */
  .mobile-search-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1400;
    background: #fff;
    border-top: 1px solid #dde3ea;
    padding: 8px 12px;
    height: 56px;
    align-items: center;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.10);
  }
  .mobile-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    font-size: 23px;
    outline: none;
    background: #f8fafc;
  }
  .mobile-search-input:focus {
    border-color: #3b82f6;
    background: #fff;
  }

  /* Зум карты — поднимаем над кнопкой Фильтры и строкой поиска */
  .leaflet-bottom.leaflet-right {
    bottom: 130px;
    right: 12px;
  }

  /* Карта не должна обрезаться строкой поиска */
  .map-wrapper {
    padding-bottom: 56px;
  }

  /* Деталь заявки открывается полноэкранным слоем, а не внутри области карты */
  .detail-panel {
    position: fixed;
    inset: 0;
    z-index: 1500;
    transform: translateY(100%);
  }

  .detail-panel.visible {
    transform: translateY(0);
  }

  /* Меню пользователя на мобильной версии */
  .user-panel {
    display: none;
  }

  .user-panel.visible {
    display: flex !important;
    position: absolute;
    top: 60px;
    left: 18px;
    right: 18px;
    z-index: 1300;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  /* iOS не масштабирует страницу при фокусе на поле, если шрифт >= 16px */
  .field input,
  .field select,
  .field textarea,
  .remarks-modal-body textarea {
    font-size: 23px;
  }
}

@media (max-width: 600px) {
  .workspace {
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    padding: 14px;
    gap: 14px;
  }

  .panel-head {
    padding: 14px;
  }

  .request-row {
    padding: 10px 12px;
  }

  .detail-panel-body {
    padding: 16px;
  }

  .detail-head {
    padding: 14px;
  }

  .detail-head h2 {
    font-size: 15px;
  }

  .detail-format {
    font-size: 13px;
  }

  .detail-head .meta {
    font-size: 12px;
  }

  .call-btn {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 44px;
  }

  .excel-table th {
    width: 42%;
  }

  .image-modal-header {
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .image-modal-controls .icon-button {
    width: 40px;
    height: 40px;
  }

  .act-controls {
    padding: 10px 14px;
  }

  /* Крупнее зоны касания для основных кнопок */
  .button-accept,
  .button-remarks,
  .button-ok,
  .button-cancel,
  .detail-close-btn {
    min-height: 44px;
  }

  /* Мини-карточка маркера */
  .marker-card {
    position: fixed;
    bottom: 80px;
    left: 12px;
    z-index: 1000;
    max-width: 473px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    padding: 3px 3px 3px 3px;
    font-size: 14px;
    animation: slideIn 0.2s ease-out;
    line-height: 1;
  }

  @keyframes slideIn {
    from {
      transform: translateY(20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .marker-card.hidden {
    display: none;
  }

  .marker-card-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
  }

  .marker-card-close:active {
    color: #333;
  }

  .marker-card-content {
    pointer-events: auto;
    padding-right: 30px;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .marker-card h3 {
    margin: 0 0 0px 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
    line-height: 1;
  }

  .marker-card h3:empty {
    display: none;
    margin: 0;
  }

  .marker-card-body {
    display: flex;
    flex-direction: column;
    gap: 0px;
    font-size: 11px;
    color: #555;
    margin: 0;
    padding: 0;
  }

  .marker-card-row {
    display: flex;
    gap: 2px;
    align-items: flex-start;
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  .marker-card-label {
    font-weight: 500;
    color: #666;
    min-width: 75px;
    flex-shrink: 0;
    line-height: 1;
    margin: 0;
    padding: 0;
  }

  .marker-card-value {
    color: #333;
    flex: 1;
    word-break: break-word;
    line-height: 1;
    margin: 0;
    padding: 0;
  }

  .marker-card-badge {
    display: inline-block;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 2px;
    line-height: 1;
  }

  .marker-card-badge.transfer {
    background: #ffc107;
    color: #333;
  }

  .marker-card-badge.warranty {
    background: #17a2b8;
    color: white;
  }

  /* Мультизаявочная карточка */
  .marker-card-addr {
    font-size: 13px;
    color: #888;
    margin-bottom: 0px;
    margin-top: 0px;
    border-bottom: 1px solid #eee;
    padding-bottom: 1px;
    padding-top: 0px;
    word-break: break-word;
    line-height: 1;
  }

  .marker-multi-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
    max-height: 50vh;
    overflow-y: auto;
    margin: 0;
    padding: 0;
  }

  .marker-multi-item {
    padding: 2px 4px;
    margin: 0;
    border-radius: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
  }

  .marker-multi-item:active { background: #e8f0fe; }

  .marker-multi-inc {
    font-weight: 700;
    font-size: 12px;
    color: #1d4ed8;
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  .marker-multi-detail {
    font-size: 11px;
    color: #555;
    margin-top: 0px;
    margin: 0;
    padding: 0;
    word-break: break-word;
    line-height: 1;
  }
}

/* Desktop marker card positioning */
@media (min-width: 981px) {
  .marker-card {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    z-index: 1000;
    max-width: 480px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 3px;
    font-size: 14px;
    animation: slideIn 0.2s ease-out;
    line-height: 1;
  }

  .marker-card-close {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
  }

  .marker-card-close:hover {
    color: #666;
  }

  .marker-card-content {
    pointer-events: auto;
    padding-right: 20px;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .marker-card h3 {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
    line-height: 1;
  }

  .marker-card h3:empty {
    display: none;
    margin: 0;
  }

  .marker-card-body {
    display: flex;
    flex-direction: column;
    gap: 0px;
    font-size: 14px;
    color: #555;
    margin: 0;
    padding: 0;
  }

  .marker-card-row {
    display: flex;
    gap: 2px;
    align-items: flex-start;
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  .marker-card-label {
    font-weight: 500;
    color: #666;
    min-width: 70px;
    flex-shrink: 0;
    line-height: 1;
    margin: 0;
    padding: 0;
  }

  .marker-card-value {
    color: #333;
    flex: 1;
    word-break: break-word;
    line-height: 1;
    margin: 0;
    padding: 0;
  }

  .marker-card-badge {
    display: inline-block;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 2px;
    line-height: 1;
  }

  .marker-card-badge.transfer {
    background: #ffc107;
    color: #333;
  }

  .marker-card-badge.warranty {
    background: #17a2b8;
    color: white;
  }

  /* Десктоп: мультизаявочная карточка */
  .marker-card-addr {
    font-size: 13px;
    color: #888;
    margin-bottom: 0px;
    margin-top: 0px;
    border-bottom: 1px solid #eee;
    padding-bottom: 1px;
    padding-top: 0px;
    word-break: break-word;
    line-height: 1;
  }

  .marker-multi-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
  }

  .marker-multi-item {
    padding: 2px 4px;
    margin: 0;
    border-radius: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
  }

  .marker-multi-item:hover { background: #eff6ff; }

  .marker-multi-inc {
    font-weight: 700;
    font-size: 11px;
    color: #1d4ed8;
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  .marker-multi-detail {
    font-size: 10px;
    color: #555;
    margin-top: 0px;
    margin: 0;
    padding: 0;
    word-break: break-word;
    line-height: 1;
  }
}

/* Bullseye marker icon */
.bullseye-marker {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  line-height: 0;
}

/* Role-based access UI */
.review-filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid #d4610a;
  border-radius: 8px;
  background: #fff6ef;
  color: #b14a06;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.review-filter-btn:hover {
  background: #ffe9d6;
}

.review-filter-btn.active {
  background: #d4610a;
  color: #ffffff;
}

.review-badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 11px;
  background: #d4610a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.review-filter-btn.active .review-badge {
  background: #ffffff;
  color: #d4610a;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.upload-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 7px;
  background: #1f4f7a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.upload-btn:hover {
  background: #163a5a;
}

.file-item-accepted {
  background: #e9f7ef;
  border-left: 3px solid #0a7c59;
  padding-left: 6px;
}

.file-item-remarks {
  background: #fdecec;
  border-left: 3px solid #d4610a;
  padding-left: 6px;
}

.file-delete-btn {
  border: none;
  background: #f8d7da;
  color: #b02a37;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.file-delete-btn:hover {
  background: #f1aeb5;
}

.act-remark-banner {
  margin: 10px 16px 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fdecec;
  border: 1px solid #d4610a;
  color: #b14a06;
  font-size: 13px;
  font-weight: 500;
}

/* "Акты с замечаниями": зелёный когда 0, красный когда есть */
.review-filter-btn.review-empty {
  border-color: #0a7c59;
  background: #e9f7ef;
  color: #0a7c59;
}

.review-filter-btn.review-empty:hover {
  background: #d5efe0;
}

.review-filter-btn.review-empty .review-badge {
  background: #0a7c59;
  color: #ffffff;
}

.review-filter-btn.review-empty.active {
  background: #0a7c59;
  color: #ffffff;
}

.review-filter-btn.review-empty.active .review-badge {
  background: #ffffff;
  color: #0a7c59;
}

.review-filter-btn.review-alert {
  border-color: #c0392b;
  background: #fdecec;
  color: #c0392b;
}

.review-filter-btn.review-alert:hover {
  background: #f9d6d3;
}

.review-filter-btn.review-alert .review-badge {
  background: #c0392b;
  color: #ffffff;
}

.review-filter-btn.review-alert.active {
  background: #c0392b;
  color: #ffffff;
}

.review-filter-btn.review-alert.active .review-badge {
  background: #ffffff;
  color: #c0392b;
}

/* Формат объекта над названием в карточке */
.detail-format {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1f4f7a;
}

/* Увеличенный текст под INC в шапке карточки */
.detail-head .meta {
  font-size: 11px;
  line-height: 1.3;
}

/* Подсветка счётчиков замечаний красным при значении > 0 */
.stats div.stat-alert {
  border-color: #c0392b;
  background: #fdecec;
}

.stats div.stat-alert dt,
.stats div.stat-alert dd {
  color: #c0392b;
}

/* Диапазон дат От—До в фильтре */
.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-range input {
  flex: 1;
  min-width: 0;
}

.date-range-sep {
  color: #65758b;
}

/* Миниатюры jpg/png в списке файлов */
.file-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dde3ea;
  background: #fff;
  flex: none;
}

/* Кнопка скачивания файла */
.file-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #e7f0f7;
  color: #1f4f7a;
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
  flex: none;
}

.file-download-btn:hover {
  background: #cfe2f0;
}

/* ─── Планирование маршрута ─────────────────────────────────────────────────── */

/* Кнопки на мини-карточке маркера */
.marker-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.route-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.route-add-btn.in-route {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.route-add-btn:active { opacity: 0.8; }

/* Кнопка навигатора (мобильная) */
.route-nav-single-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid #fc3f1d;
  background: #fff3f0;
  color: #c0321a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.route-nav-single-btn:active { opacity: 0.8; }

/* На десктопе кнопка навигатора скрыта */
@media (min-width: 981px) {
  .route-nav-single-btn {
    display: none;
  }
  .route-add-btn { font-size: 14px; }
}

/* Счётчик маршрутных точек (нижний левый угол) */
.route-counter {
  position: fixed;
  bottom: 24px;
  left: 16px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 24px;
  background: #1d4ed8;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(29,78,216,0.4);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, transform 0.1s;
}

.route-counter:active { transform: scale(0.96); }

.route-counter-num {
  font-size: 17px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

/* На мобильном счётчик чуть выше */
@media (max-width: 980px) {
  .route-counter {
    bottom: 80px;
    left: 12px;
    font-size: 18px;
    padding: 10px 16px;
    border-radius: 28px;
  }
  .route-counter-num { font-size: 20px; }
}

/* Панель маршрута */
.route-plan-panel {
  position: fixed;
  bottom: 72px;
  left: 16px;
  z-index: 1200;
  width: min(380px, calc(100vw - 32px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: slideIn 0.2s ease-out;
}

@media (max-width: 980px) {
  .route-plan-panel {
    bottom: 136px;
    left: 12px;
    width: calc(100vw - 24px);
    max-height: 60vh;
    display: flex;
    flex-direction: column;
  }
}

.route-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: #1d4ed8;
  color: #fff;
}

.route-plan-title-text {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 15px;
}

.route-plan-close-btn {
  color: rgba(255,255,255,0.8) !important;
}

.route-plan-close-btn:hover { color: #fff !important; }

.route-plan-reset-btn {
  border: 1.5px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.route-plan-reset-btn:hover { background: rgba(255,255,255,0.22); }

.route-plan-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 5px;
  vertical-align: middle;
}

.route-plan-badge.transfer { background: #ffc107; color: #333; }
.route-plan-badge.warranty { background: #17a2b8; color: #fff; }

.route-plan-items {
  max-height: 300px;
  overflow-y: auto;
  padding: 6px 8px;
}

@media (max-width: 980px) {
  .route-plan-items { flex: 1; max-height: none; }
}

.route-plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid #f1f5f9;
}

.route-plan-item:last-child { border-bottom: none; }

.route-plan-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.route-plan-info {
  flex: 1;
  min-width: 0;
}

.route-plan-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-plan-addr {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-plan-remove {
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.route-plan-remove:hover { color: #ef4444; background: #fee2e2; }

.route-plan-footer {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.route-open-yandex-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #fc3f1d;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.route-open-yandex-btn:hover { background: #e0361a; }
.route-open-yandex-btn:active { opacity: 0.85; }

.marker-card-note {
  color: #c0392b;
  font-weight: 600;
  font-style: normal;
}

/* ─── Мобильный сайдбар: переупорядочивание и скрытие ─────────────────────── */
@media (max-width: 980px) {
  .brand-stock-btn {
    display: none !important;
  }

  /* Скрываем поле поиска в сайдбаре (дублируется нижней строкой) */
  .sidebar .field:has(#search) {
    display: none !important;
  }

  /* Скрываем счётчики (dl.stats) */
  .sidebar .stats {
    display: none !important;
  }

  /* Скрываем бренд и логотип в нижнем листе */
  .sidebar .brand {
    display: none !important;
  }

  /* Drag-индикатор сверху нижнего листа */
  .sidebar::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 0 auto 12px;
    flex-shrink: 0;
  }

  /* Переупорядочивание через flex order */
  .sidebar .brand            { order: 1; }
  #userPanel                 { order: 2; }
  #executorFilterField       { order: 3; }
  /* Фильтр по статусу — выше */
  .sidebar .field:has(#statusFilter) { order: 4; }
  /* Фильтр по дате — выше */
  #dateFilterField           { order: 5; }
  #refresh                   { order: 6; }
  #reviewFilterBtn           { order: 7; }
  #remarksFilterBtn          { order: 8; }
  /* Филиал — ниже */
  #regionField               { order: 9; }
  #regionMultiField          { order: 10; }
  /* Формат — в самый низ */
  #formatFilterField         { order: 11; }

  /* Уменьшаем шрифт в фильтре по статусу и по дате на ~1/3 */
  .sidebar .field:has(#statusFilter) span,
  .sidebar .field:has(#statusFilter) select,
  #dateFilterField span,
  #dateFilterField select,
  #dateFilterField input {
    font-size: 11px !important;
  }
  #dateFilterField .date-range {
    gap: 3px;
  }
}

/* Переключатель "Конец маршрута — Дом" */
.route-home-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 8px;
  cursor: pointer;
  user-select: none;
}

.route-home-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1d4ed8;
  cursor: pointer;
  flex-shrink: 0;
}

.route-home-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

/* ������ ����� ��� �������� */
.act-mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.act-mini-link {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e0f0f7;
  color: #0369a1;
  cursor: pointer;
  border: 1px solid #bae0f5;
  user-select: none;
  transition: background 0.15s;
}
.act-mini-link:hover {
  background: #bae0f5;
}
.act-mini-link.act-link-accepted {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.act-mini-link.act-link-remarks {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.act-status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e0f0f7;
  color: #0369a1;
  margin-top: 4px;
}

.act-status-badge.has-pending {
  background: #fef3c7;
  color: #d97706;
}

.act-sum-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #dcfce7;
  color: #15803d;
  margin-top: 4px;
  margin-left: 4px;
}

.act-sum-badge.act-sum-expr {
  display: block;
  margin-left: 0;
  white-space: normal;
  word-break: break-word;
  font-size: 11px;
}

.act-sum-total {
  font-size: 13px;
  font-weight: 800;
  color: #065f46;
  background: #a7f3d0;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ���� ������� ���������� */
.executed-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #dbeafe;
  color: #0369a1;
  margin-top: 4px;
}
