.login-card { width: 100%; max-width: 380px; }
/* Налаштування: групи сіткою на всю ширину, на телефоні — одна колонка */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: .5rem 2.5rem; }
.settings-group { min-width: 0; margin: 0; padding: 0 0 .5rem; border: 0; border-bottom: 1px solid #eef0f2; }
.settings-group h6 { font-weight: 600; }
/* Кнопка «Зберегти» завжди під рукою, навіть унизу довгої сторінки */
.settings-save { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; box-shadow: 0 -4px 12px rgba(0, 0, 0, .06); }

.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.board-col { background: #e9ecef; border-radius: .5rem; display: flex; flex-direction: column; min-height: 320px; }
.board-col-head { font-weight: 600; padding: .6rem .75rem; display: flex; justify-content: space-between; align-items: center; }
.board-list { flex: 1; padding: 0 .5rem .5rem; display: flex; flex-direction: column; gap: .5rem; min-height: 80px; }
.board-col-drop { background: #fff5f5; border: 2px dashed #f1aeb5; }

.order-card { background: #fff; border-radius: .4rem; border-left: 4px solid #0d6efd; padding: .5rem .6rem; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.08); font-size: .875rem; }
.order-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.order-card.is-late { border-left-color: #dc3545; background: #fff8f8; }
.order-card .oc-head { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; }
.order-card .oc-line { color: #495057; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sortable-ghost { opacity: .4; }

.map-box { height: calc(100vh - 190px); min-height: 420px; }
.legend-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: middle; border: 2px solid #fff; box-shadow: 0 0 0 1px #adb5bd; }
.legend-onshift { background: #198754; }
.legend-stale { background: #adb5bd; }
.legend-order { background: #dc3545; }
.legend-inwork { background: #6f42c1; }
.legend-approx { background: #fff; border: 2px dashed #dc3545; box-shadow: none; }

/* Заклад на карті: квадратик із заокругленням — щоб з першого погляду
   відрізнявся від круглих кур'єрів і замовлень */
.legend-merchant, .merchant-pin {
  display: inline-block; width: .9rem; height: .9rem; border-radius: 4px; vertical-align: middle;
  background: #0b5fff; border: 2px solid #fff; box-shadow: 0 0 0 1px #0b5fff;
}
.merchant-pin { position: relative; width: 22px; height: 22px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.merchant-pin::after { /* «дах» закладу */
  content: ''; position: absolute; left: 4px; right: 4px; top: 5px; height: 3px; background: #fff; border-radius: 1px;
}
.merchant-pin .merchant-count {
  position: absolute; top: -9px; right: -11px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: #fd7e14; color: #fff; font: 700 11px/18px system-ui, sans-serif;
  text-align: center; border: 2px solid #fff;
}
.merchant-pin.is-waiting { background: #0b5fff; box-shadow: 0 0 0 3px rgba(253,126,20,.55), 0 1px 4px rgba(0,0,0,.35); }

.kpi { background: #fff; border-radius: .5rem; padding: .75rem 1rem; height: 100%; }
.kpi .kpi-value { font-size: 1.4rem; font-weight: 600; }
.kpi .kpi-label { font-size: .8rem; color: #6c757d; }

.history-list { font-size: .85rem; }
.token-box { font-family: var(--bs-font-monospace); word-break: break-all; }
.clickable { cursor: pointer; }
.w-40 { width: 40%; }


/* ================= Бренд ================= */
/* Знак і назва — один блок, щоб не роз'їжджалися при зміні кегля. */
.lanka-logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.lanka-logo .lanka-mark {
  /* Висота йде за розміром тексту: логотип масштабується разом із ним */
  height: 1.15em;
  width: auto;
  flex: 0 0 auto;
}
.lanka-logo-lg {
  font-size: 2rem;
  display: flex;
}

/* ================= Закриття дня: друк ================= */
@media print {
  .navbar, .no-print, #toasts { display: none !important; }
  body { background: #fff !important; }
  .table { font-size: 11px; }
}

/* ================= Телефон ================= */
.board-search-input { min-width: 14rem; }
@media (max-width: 767.98px) {
  /* Колонки дошки — одна під одною, а не горизонтальна прокрутка */
  .board { grid-template-columns: 1fr; overflow-x: visible; }
  .board-col { min-height: 0; }
  .board-list { min-height: 40px; }
  /* Перетягування пальцем незручне — скасування є в картці замовлення */
  .board-col-drop { display: none; }
  .order-card { cursor: pointer; font-size: .95rem; padding: .6rem .7rem; }
  .board-search-input { min-width: 0; width: 100%; }
  #board-search { flex: 1 1 100%; order: 10; }
  main.container-fluid { padding-left: .75rem; padding-right: .75rem; }
  .kpi .kpi-value { font-size: 1.15rem; }
  /* Кнопки дій у картці замовлення — на всю ширину, щоб влучати пальцем */
  #modal-footer .btn { flex: 1 1 auto; }
}

/* «Потребує уваги» над дошкою */
.attention { background: #fff; border: 1px solid #f1c40f55; border-left: 4px solid #e67e22; border-radius: .5rem; padding: .5rem .75rem; }
.attention.is-high { border-left-color: #dc3545; }
.attention-item { display: flex; gap: .5rem; align-items: baseline; padding: .25rem 0; cursor: pointer; border-bottom: 1px dashed #0000000f; }
.attention-item:last-child { border-bottom: 0; }
.attention-item:hover { background: #00000008; }
.attention-dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; background: #e67e22; transform: translateY(.1rem); }
.attention-dot.high { background: #dc3545; }
.live-tile { background: #fff; border-radius: .5rem; padding: .4rem .75rem; box-shadow: 0 1px 2px #0000000f; height: 100%; }
.live-tile .v { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.live-tile .l { font-size: .75rem; color: #6c757d; }
.live-tile.warn .v { color: #dc3545; }
.candidate { border: 1px solid #dee2e6; border-radius: .5rem; padding: .5rem .75rem; display: flex; gap: .75rem; align-items: center; }
.candidate + .candidate { margin-top: .5rem; }
.candidate.disabled { opacity: .55; }

/* Середній розмір вікна для підтверджень (у Bootstrap є sm / типовий / lg / xl, md немає) */
@media (min-width: 576px) {
  .modal-md { --bs-modal-width: 640px; }
}

/* Гарячі клавіші */
.hotkey-cell { width: 4.5rem; }

/* Код із Telegram при вході */
.code-input { letter-spacing: .5em; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Підказки адреси у формі виклику кур'єра */
.addr-suggest { margin-top: .25rem; max-height: 18rem; overflow-y: auto; }
.addr-suggest .list-group-item { text-align: left; }

/* Покриття за годинами */
.cov-table { table-layout: fixed; min-width: 560px; }
.cov-table th:first-child { width: 4.5rem; }
.cov-cell { text-align: center; line-height: 1.1; padding: .25rem .15rem !important; font-size: .85rem; color: #1b1f24; }
.cov-cell .cov-sub { font-size: .7rem; opacity: .8; }
/* --bs-table-bg: Bootstrap фарбує клітинки таблиці через змінну — інакше колір не видно */
.cov-s0 { --bs-table-bg: #cde2fb; background: #cde2fb; } .cov-s1 { --bs-table-bg: #9ec5f4; background: #9ec5f4; }
.cov-s2 { --bs-table-bg: #6da7ec; background: #6da7ec; } .cov-s3 { --bs-table-bg: #3987e5; background: #3987e5; }
.cov-s4 { --bs-table-bg: #256abf; background: #256abf; } .cov-s5 { --bs-table-bg: #184f95; background: #184f95; }
.cov-table td.cov-s3, .cov-table td.cov-s4, .cov-table td.cov-s5 { --bs-table-color: #fff; color: #fff; }
.cov-table td.cov-empty { --bs-table-bg: #f8f9fa; }
.cov-table td.cov-none { --bs-table-bg: #fbe9e9; --bs-table-color: #8a1c1c; }
.cov-cell.cov-empty { background: #f8f9fa; }
.cov-cell.cov-none, .cov-swatch.cov-none { background: #fbe9e9; color: #8a1c1c; box-shadow: inset 0 0 0 2px #c62828; }
.cov-hour { font-weight: 500; font-size: .8rem; color: #6c757d; white-space: nowrap; }
.cov-swatch { display: inline-block; width: 1rem; height: .8rem; border-radius: 3px; }

/* Зони доставки */
.zones-map { height: 320px; border-radius: .5rem; border: 1px solid #dee2e6; }
[data-view="zones"] .zones-map { height: 70vh; min-height: 360px; }
@media (max-width: 575.98px) { [data-view="zones"] .zones-map { height: 50vh; min-height: 300px; } }
.zones-list-name { min-width: 0; }
.zones-map-edit { height: 55vh; min-height: 320px; cursor: crosshair; }
.zone-vertex { background: #fff; border: 2px solid #1b1f24; border-radius: 50%; }
.zone-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; }
.zone-dot.zone-city { background: #2a78d6; } .zone-dot.zone-suburb { background: #eb6834; }
.zone-radius { width: 5rem; }

/* Звіт «Куди возимо» */
.ep-map { height: 520px; border-radius: .5rem; border: 1px solid var(--bs-border-color); }
@media (max-width: 576px) { .ep-map { height: 380px; } }
.ep-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: -1px; }
.ep-s0 { background: #2e7d32; } .ep-s1 { background: #f9a825; } .ep-s2 { background: #ef6c00; } .ep-s3 { background: #c62828; }
.ep-sx { background: #9aa4ae; }
.ep-merchant { background: #fff; border: 2px solid #0b5fff; }
