:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #6b7788;
  --line: #dfe5ec;
  --accent: #245b8f;
  --accent-dark: #173f64;
  --accent-soft: #eaf2f9;
  --danger: #b42318;
  --success: #18794e;
  --sidebar: #182433;
  --sidebar-soft: #223247;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background: linear-gradient(135deg, #eef2f6 0%, #f7f9fb 100%);
}

.login-shell { width: min(100%, 430px); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: white; font-weight: 800; letter-spacing: .02em;
}.brand-mark.small { width: 38px; height: 38px; border-radius: 8px; font-size: 14px; }
.brand-image {
  display: block;
  object-fit: cover;
  padding: 0;
  overflow: hidden;
}
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.brand-name.compact { color: #fff; font-size: 16px; }
.brand-subtitle, .sidebar-caption { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sidebar-caption { color: #93a4b8; }

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(20, 33, 50, .08);
}
.login-heading h1 { margin: 0 0 7px; font-size: 24px; }
.login-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.role-switch {
  display: grid; grid-template-columns: 1fr 1fr;
  background: #eef2f6; padding: 4px; border-radius: 9px; margin: 22px 0;
}
.role-switch a {
  color: #526174; text-decoration: none; text-align: center;
  padding: 9px 10px; border-radius: 7px; font-size: 14px; font-weight: 650;
}
.role-switch a.active { background: white; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.alert {
  background: #fff0ee; color: var(--danger);
  border: 1px solid #f3c9c5; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 16px; font-size: 14px;
}.login-form { display: grid; gap: 15px; }
.login-form label { display: grid; gap: 7px; }
.login-form label span { font-size: 13px; font-weight: 700; color: #344256; }
.login-form input, .toolbar input, .toolbar select {
  width: 100%; border: 1px solid #cfd7e1; background: white;
  border-radius: 8px; padding: 11px 12px; color: var(--text);
  outline: none; transition: border .15s, box-shadow .15s;
}
.login-form input:focus, .toolbar input:focus, .toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36,91,143,.12);
}

.primary-button, .secondary-button, .logout-button {
  border: 0; border-radius: 8px; cursor: pointer; font-weight: 700;
}
.primary-button {
  background: var(--accent); color: white; padding: 11px 16px;
}
.primary-button:hover { background: var(--accent-dark); }
.secondary-button {
  background: white; color: #344256; border: 1px solid #cfd7e1; padding: 10px 14px;
}
.login-footnote {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 1.5;
}

.app-body { min-height: 100vh; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--sidebar); color: white;
  display: flex; flex-direction: column; padding: 18px 14px;
}.sidebar-brand { display: flex; gap: 11px; align-items: center; padding: 4px 6px 20px; }
.sidebar-nav { display: grid; gap: 4px; }
.sidebar-nav a {
  text-decoration: none; color: #cbd5e1; padding: 10px 12px;
  border-radius: 8px; font-size: 14px; font-weight: 650;
}
.sidebar-nav a:hover { background: var(--sidebar-soft); color: white; }
.sidebar-nav a.active { background: #2a425d; color: white; }
.nav-divider { height: 1px; background: #304256; margin: 12px 6px 10px; }
.nav-label {
  color: #8192a6; font-size: 10px; letter-spacing: .11em;
  text-transform: uppercase; font-weight: 800; padding: 0 12px 4px;
}

.sidebar-user {
  margin-top: auto; border-top: 1px solid #304256; padding: 15px 6px 3px;
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: #2b5b86; color: white; font-weight: 800;
}
.user-meta { min-width: 0; display: grid; gap: 2px; }
.user-meta strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { color: #93a4b8; font-size: 11px; }
.logout-button { background: transparent; color: #aebdcd; padding: 7px; font-size: 12px; }
.logout-button:hover { color: white; background: #26384d; }

.main-area { min-width: 0; }
.topbar {
  min-height: 92px; background: white; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 28px;
}.topbar h1 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.02em; }
.topbar p { margin: 0; color: var(--muted); font-size: 13px; }
.status-pill {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid #cfe6d9; background: #f2fbf6; color: var(--success);
  border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 700;
}
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.content-area { padding: 24px 28px 36px; }
.toolbar {
  display: grid; grid-template-columns: minmax(220px, 1fr) 180px 160px 160px auto;
  gap: 10px; margin-bottom: 18px;
}
.toolbar select, .toolbar input { min-height: 41px; }
.search-field { min-width: 0; }

.summary-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px; margin-bottom: 18px;
}
.summary-card {
  background: white; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
}
.summary-card span { color: var(--muted); font-size: 13px; }
.summary-card strong { font-size: 24px; }

.panel {
  background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.panel-head {
  min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}.panel-head h2 { margin: 0 0 4px; font-size: 17px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 12px; }
.empty-state {
  min-height: 320px; display: grid; place-items: center; align-content: center;
  text-align: center; padding: 40px 20px;
}
.empty-icon {
  width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 25px; margin-bottom: 12px;
}
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

.settings-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px;
}
.setting-card {
  background: white; border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; min-height: 160px;
}
.setting-title { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.setting-card p { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0 0 18px; }
.tag {
  display: inline-flex; padding: 5px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800;
}
.tag.muted { background: #f0f2f5; color: #667386; }

.compact-button { padding: 9px 12px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: #5d6a7c; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
.online-dot { color: var(--success); font-weight: 700; }
@media (max-width: 1050px) {
  .toolbar { grid-template-columns: 1fr 1fr 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .settings-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; padding: 12px;
  }
  .sidebar-brand { padding-bottom: 12px; }
  .sidebar-nav { grid-template-columns: 1fr 1fr; }
  .nav-divider, .nav-label { display: none; }
  .sidebar-user { margin-top: 12px; }
  .topbar { padding: 16px; min-height: auto; align-items: flex-start; }
  .topbar h1 { font-size: 21px; }
  .status-pill { display: none; }
  .content-area { padding: 16px; }
  .toolbar { grid-template-columns: 1fr; }
  .summary-grid, .settings-grid { grid-template-columns: 1fr; }
  .summary-card { padding: 14px 16px; }
}

@media (max-width: 480px) {
  .login-body { padding: 18px 12px; }
  .login-card { padding: 22px 18px; }
  .sidebar-nav { grid-template-columns: 1fr; }
  .sidebar-user { grid-template-columns: 36px 1fr auto; }
}
.flash-message {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 11px 13px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 650;
}
.flash-message.success { background: #f2fbf6; color: #18794e; border-color: #cfe6d9; }
.flash-message.error { background: #fff0ee; color: #b42318; border-color: #f3c9c5; }

.users-table td { vertical-align: middle; }
.actions-cell { text-align: right; white-space: nowrap; }
.edit-user-button { padding: 7px 10px; font-size: 12px; }
.you-label {
  display: inline-flex; margin-left: 7px; padding: 2px 6px; border-radius: 999px;
  background: #eaf2f9; color: #245b8f; font-size: 10px; font-weight: 800;
}
.login-code {
  background: #f2f4f7; border: 1px solid #e2e7ed; border-radius: 5px;
  padding: 3px 6px; color: #344256; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.status-active, .status-inactive {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750;
}
.status-active { color: #18794e; }
.status-inactive { color: #8a4b11; }
.status-active::before, .status-inactive::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}

.user-dialog {
  width: min(92vw, 500px);
  border: 0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(18, 33, 51, .24);
}
.user-dialog::backdrop { background: rgba(16, 27, 40, .48); }
.user-form { display: grid; gap: 14px; padding: 22px; }
.dialog-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
  padding-bottom: 13px; border-bottom: 1px solid #dfe5ec;
}
.dialog-head h2 { margin: 0 0 4px; font-size: 19px; }
.dialog-head p { margin: 0; color: #6b7788; font-size: 12px; }
.dialog-close {
  border: 0; background: transparent; color: #6b7788; cursor: pointer;
  width: 32px; height: 32px; border-radius: 7px; font-size: 23px; line-height: 1;
}
.dialog-close:hover { background: #f0f2f5; color: #18212f; }
.user-form label { display: grid; gap: 7px; }
.user-form label span { font-size: 12px; font-weight: 750; color: #344256; }
.user-form input, .user-form select {
  width: 100%; border: 1px solid #cfd7e1; background: white;
  border-radius: 8px; padding: 10px 11px; color: #18212f; outline: none;
}
.user-form input:focus, .user-form select:focus {
  border-color: #245b8f; box-shadow: 0 0 0 3px rgba(36,91,143,.12);
}
.form-note { color: #6b7788; font-size: 11px; margin-top: -6px; }
.dialog-actions {
  display: flex; justify-content: flex-end; gap: 9px;
  padding-top: 6px; margin-top: 2px;
}

@media (max-width: 760px) {
  .users-table th:nth-child(3), .users-table td:nth-child(3) { display: none; }
  .panel-head { align-items: flex-start; }
}

.source-stack { display: grid; gap: 16px; }
.source-panel { overflow: visible; }
.source-form { padding: 18px; display: grid; gap: 16px; }
.source-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.source-form label:not(.switch-line) { display: grid; gap: 7px; }
.source-form label span { font-size: 12px; font-weight: 750; color: #344256; }
.source-form input[type="text"],
.source-form input[type="password"],
.source-form input:not([type]) {
  width: 100%;
  border: 1px solid #cfd7e1;
  border-radius: 8px;
  padding: 10px 11px;
  outline: none;
  background: white;
}
.source-form input:focus {
  border-color: #245b8f;
  box-shadow: 0 0 0 3px rgba(36,91,143,.12);
}
.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  cursor: pointer;
}
.switch-line input { width: 17px; height: 17px; }
.source-actions { display: flex; justify-content: flex-start; }
.source-test-row {
  border-top: 1px solid #dfe5ec;
  padding: 14px 18px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.source-meta { color: #6b7788; font-size: 12px; }
.source-ok { background: #f2fbf6; color: #18794e; }
.source-error { background: #fff0ee; color: #b42318; }
.source-error-box {
  margin: 0 18px 18px;
  background: #fff7f5;
  border: 1px solid #f3c9c5;
  color: #8f2d24;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}
@media (max-width: 760px) {
  .source-row { grid-template-columns: 1fr; }
  .source-test-row { align-items: flex-start; flex-direction: column; }
}

.orders-preview-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px; margin-bottom: 16px;
}
.orders-preview-head h2 { margin: 3px 0 6px; font-size: 20px; }
.orders-preview-head p { margin: 0; color: var(--muted); font-size: 13px; }
.preview-label {
  display: inline-flex; padding: 4px 7px; border-radius: 6px;
  background: #fff7e8; color: #8a5a00; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
}
.orders-toolbar { grid-template-columns: minmax(260px, 1fr) 180px 180px; }
.summary-text { font-size: 14px !important; text-align: right; }
.orders-list { display: grid; gap: 14px; }
.order-card {
  background: white; border: 1px solid var(--line); border-radius: 11px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(23, 38, 56, .035);
}
.order-card[hidden] { display: none; }
.order-card-head {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center;
  gap: 14px; padding: 13px 16px; background: #fafbfc;
  border-bottom: 1px solid var(--line);
}
.order-number-block { display: flex; align-items: center; gap: 10px; min-width: 0; }
.order-number-block strong { font-size: 15px; }
.source-badge {
  display: inline-flex; padding: 4px 7px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 800;
}
.order-time { font-size: 18px; font-weight: 850; letter-spacing: -.02em; }
.order-source-status {
  font-size: 11px; color: #586779; background: #eef1f4;
  border-radius: 999px; padding: 5px 8px; white-space: nowrap;
}
.order-main-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px; padding: 16px;
}
.order-field { display: grid; gap: 5px; }
.order-field span, .route-point span, .order-comment span, .raw-field span {
  color: var(--muted); font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
}
.order-field strong { font-size: 14px; line-height: 1.45; }
.preline { white-space: pre-line; }
.route-block {
  margin: 0 16px 16px; border: 1px solid var(--line);
  border-radius: 9px; overflow: hidden;
}
.route-point {
  display: grid; grid-template-columns: 30px 1fr; gap: 11px;
  align-items: flex-start; padding: 12px 13px;
}
.route-point + .route-point { border-top: 1px dashed #d7dde5; }
.route-point > div:last-child { display: grid; gap: 4px; }
.route-point strong { font-size: 13px; line-height: 1.48; font-weight: 650; }
.route-letter {
  width: 27px; height: 27px; border-radius: 7px;
  display: grid; place-items: center; background: #eaf2f9;
  color: #245b8f; font-size: 12px; font-weight: 850;
}
.order-comment {
  margin: 0 16px 16px; padding: 11px 12px;
  background: #f7f9fb; border-radius: 8px; display: grid; gap: 5px;
  font-size: 13px; line-height: 1.45;
}
.raw-details { border-top: 1px solid var(--line); }
.raw-details summary {
  cursor: pointer; padding: 11px 16px; color: #516071;
  font-size: 12px; font-weight: 700; user-select: none;
}
.raw-details[open] summary { border-bottom: 1px solid var(--line); background: #fafbfc; }
.raw-fields-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1px; background: var(--line);
}
.raw-field { background: white; padding: 11px 13px; min-width: 0; }
.raw-field div { margin-top: 4px; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .raw-fields-grid { grid-template-columns: 1fr 1fr; }
  .orders-toolbar { grid-template-columns: 1fr 1fr; }
  .orders-toolbar .search-field { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .orders-preview-head { flex-direction: column; }
  .order-card-head { grid-template-columns: 1fr auto; }
  .order-source-status { grid-column: 1 / -1; justify-self: start; }
  .order-main-grid { grid-template-columns: 1fr; }
  .raw-fields-grid { grid-template-columns: 1fr; }
  .orders-toolbar { grid-template-columns: 1fr; }
  .orders-toolbar .search-field { grid-column: auto; }
}

/* Taxomet-ready order preview */
.taxomet-card { position: relative; }
.taxomet-card.is-cancelled { opacity: .72; }

.soc-source-preview {
  padding: 9px 14px 10px;
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
  color: #708093;
  font-size: 10px;
  line-height: 1.4;
}
.soc-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: center;
  margin-bottom: 4px;
}
.soc-source-meta b { color: #536274; font-weight: 750; }
.soc-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8edf3;
  color: #506274;
  font-weight: 900;
  letter-spacing: .04em;
}
.soc-source-route {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  gap: 8px;
  align-items: start;
}
.soc-arrow { color: #95a1af; font-weight: 800; padding-top: 1px; }

.taxomet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 15px 16px 4px;
}
.taxomet-label {
  display: inline-flex;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
}
.taxomet-time {
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: -.025em;
}
.driver-price {
  display: grid;
  justify-items: end;
  gap: 2px;
}
.driver-price span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.driver-price strong {
  font-size: 21px;
  line-height: 1.1;
  white-space: nowrap;
}

.taxomet-main-grid { padding-top: 10px; }
.compact-info { justify-items: end; }
.taxomet-route { margin-top: 0; }

.order-warning {
  margin: 10px 16px 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: #fff8e7;
  border: 1px solid #ead9a8;
  color: #765615;
  font-size: 11px;
  font-weight: 700;
}
.cancelled-warning {
  background: #fff1ef;
  border-color: #efc9c4;
  color: var(--danger);
}

.taxomet-card-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
  color: var(--muted);
  font-size: 10px;
}
.adapt-ok { color: var(--success); font-weight: 750; }
.adapt-check { color: #8a5a00; font-weight: 750; }

@media (max-width: 620px) {
  .soc-source-route { grid-template-columns: 1fr; }
  .soc-arrow { display: none; }
  .taxomet-head { align-items: center; }
  .driver-price strong { font-size: 18px; }
  .compact-info { justify-items: start; }
}

/* Paired (there-and-back) order blocks */
.orders-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.day-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
}
.day-switch a {
  padding: 7px 10px;
  border-radius: 6px;
  color: #5e6d7f;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}
.day-switch a.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(20,33,50,.08);
}

.paired-order-block {
  padding: 12px;
  border: 1px solid #bddfc9;
  border-radius: 13px;
  background: #edf8f1;
  box-shadow: 0 3px 12px rgba(24,121,78,.05);
}
.paired-order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 1px 3px 11px;
}
.paired-order-head > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  min-width: 0;
}
.paired-order-head strong {
  font-size: 14px;
  color: #155d3c;
}
.paired-order-head > div:first-child > span:last-child {
  color: #6a7f72;
  font-size: 11px;
}
.paired-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #d7efdf;
  color: #17663f;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.paired-total {
  display: grid;
  justify-items: end;
  gap: 1px;
  white-space: nowrap;
}
.paired-total span {
  color: #6a7f72;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.paired-total strong {
  font-size: 17px;
  color: #155d3c;
}
.paired-order-cards {
  display: grid;
  gap: 10px;
}
.paired-order-block .order-card {
  border-color: #cce5d4;
  box-shadow: none;
}
.single-orders-label {
  margin: 6px 2px -2px;
  color: #7a8796;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

@media (max-width: 700px) {
  .orders-head-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .day-switch { width: 100%; }
  .day-switch a { flex: 1; text-align: center; }
  .paired-order-head { align-items: flex-start; }
}

/* Ultra-compact order cards */
.orders-list { gap: 8px; }

.taxomet-card {
  border-radius: 8px;
}

.taxomet-card .soc-source-preview {
  padding: 4px 8px 5px;
  font-size: 8.5px;
  line-height: 1.2;
}

.taxomet-card .soc-source-meta {
  gap: 4px 8px;
  margin-bottom: 2px;
  font-size: 8.5px;
}

.taxomet-card .soc-source-route {
  gap: 5px;
  font-size: 8.5px;
  line-height: 1.2;
}

.taxomet-card .taxomet-head {
  padding: 5px 9px 2px;
  align-items: center;
}

.taxomet-card .taxomet-label {
  display: none;
}

.taxomet-card .taxomet-time {
  margin: 0;
  font-size: 17px;
  line-height: 1;
}

.taxomet-card .driver-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.taxomet-card .driver-price span {
  font-size: 8px;
}

.taxomet-card .driver-price strong {
  font-size: 16px;
}

.taxomet-card .order-main-grid {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 2px 9px 5px;
  align-items: center;
}

.taxomet-card .order-field {
  gap: 0;
}

.taxomet-card .order-field span {
  display: none;
}

.taxomet-card .order-field strong {
  font-size: 10.5px;
  line-height: 1.2;
}

.taxomet-card .compact-info {
  justify-items: end;
}

.taxomet-card .route-block {
  margin: 0 9px 5px;
  border-radius: 6px;
}

.taxomet-card .route-point {
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 6px;
  padding: 4px 6px;
  align-items: center;
}

.taxomet-card .route-point > div:last-child {
  display: block;
}

.taxomet-card .route-point span {
  display: none;
}

.taxomet-card .route-point strong {
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 650;
}

.taxomet-card .route-letter {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 9px;
}

.taxomet-card .order-comment {
  margin: 0 9px 5px;
  padding: 4px 6px;
  display: flex;
  gap: 5px;
  align-items: baseline;
  font-size: 10px;
  line-height: 1.2;
}

.taxomet-card .order-comment span {
  flex: 0 0 auto;
  font-size: 8px;
}

.taxomet-card .taxomet-card-foot {
  display: none;
}

.taxomet-card .order-warning {
  margin: 3px 9px 4px;
  padding: 4px 6px;
  font-size: 9px;
}

.paired-order-block {
  padding: 7px;
  border-radius: 10px;
}

.paired-order-head {
  padding: 0 2px 6px;
  gap: 8px;
}

.paired-order-head strong {
  font-size: 12px;
}

.paired-order-head > div:first-child > span:last-child {
  font-size: 9px;
}

.paired-badge {
  padding: 3px 6px;
  font-size: 8px;
}

.paired-total span {
  font-size: 8px;
}

.paired-total strong {
  font-size: 14px;
}

.paired-order-cards {
  gap: 6px;
}

.single-orders-label {
  margin: 3px 2px -2px;
  font-size: 9px;
}

@media (max-width: 620px) {
  .taxomet-card .soc-source-route {
    grid-template-columns: 1fr;
  }
  .taxomet-card .soc-arrow {
    display: none;
  }
  .taxomet-card .taxomet-head {
    flex-direction: row;
  }
  .taxomet-card .driver-price strong {
    font-size: 15px;
  }
}

.taxomet-card .soc-source-route > span:not(.soc-arrow) {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Historical day filter */
.history-date-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.history-date-filter span {
  padding-left: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.history-date-filter input[type="date"] {
  height: 31px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  outline: none;
}
.history-date-filter .secondary-button {
  padding: 7px 9px;
  font-size: 10px;
}

@media (max-width: 900px) {
  .orders-head-actions {
    flex-wrap: wrap;
  }
  .history-date-filter {
    order: 3;
    width: 100%;
  }
  .history-date-filter input[type="date"] {
    flex: 1;
  }
}

/* Visual distinction for one-way orders */
.single-order-card {
  background: #fffaf0;
  border-color: #ead9a8;
}
.single-order-card .soc-source-preview {
  background: #fff6dc;
  border-bottom-color: #ead9a8;
}
.single-order-card .route-block {
  border-color: #eadfbd;
}
.single-order-card .route-point + .route-point {
  border-top-color: #eadfbd;
}
.single-order-card .order-comment {
  background: #fff8e7;
  border-color: #ead9a8;
}

/* Non-reserve / cancelled source statuses */
.status-alert-card,
.single-order-card.status-alert-card {
  background: #fff2f0;
  border-color: #efc7c1;
}
.status-alert-card.is-cancelled {
  opacity: 1;
}
.status-alert-card .soc-source-preview,
.single-order-card.status-alert-card .soc-source-preview {
  background: #ffe8e4;
  border-bottom-color: #efc7c1;
}
.status-alert-card .route-block,
.single-order-card.status-alert-card .route-block {
  border-color: #efd2cd;
}
.status-alert-card .route-point + .route-point,
.single-order-card.status-alert-card .route-point + .route-point {
  border-top-color: #efd2cd;
}
.status-alert-card .order-comment,
.single-order-card.status-alert-card .order-comment {
  background: #fff0ed;
  border-color: #efc7c1;
}
.status-alert-card .soc-source-meta span,
.status-alert-card .soc-source-meta b {
  color: #9b3b31;
}

/* Two green tones for paired orders: outer group + inner order cards */
.paired-order-block {
  background: #edf8f1;
  border-color: #b9ddc6;
}

.paired-order-block .taxomet-card:not(.status-alert-card) {
  background: #f7fcf8;
  border-color: #c8e4d1;
}

.paired-order-block .taxomet-card:not(.status-alert-card) .soc-source-preview {
  background: #e3f3e8;
  border-bottom-color: #c8e4d1;
}

.paired-order-block .taxomet-card:not(.status-alert-card) .route-block {
  background: #fbfefc;
  border-color: #d4e9db;
}

.paired-order-block .taxomet-card:not(.status-alert-card) .route-point + .route-point {
  border-top-color: #d4e9db;
}

.paired-order-block .taxomet-card:not(.status-alert-card) .order-comment {
  background: #f0f9f3;
  border-color: #d4e9db;
}

/* Strong visual separation between paired-order groups */
.paired-order-block {
  border-left: 5px solid #69a97c;
  box-shadow: 0 4px 12px rgba(39, 91, 58, .10);
  overflow: hidden;
}

.paired-order-block + .paired-order-block {
  margin-top: 16px;
}

.paired-order-head {
  margin: -7px -7px 7px;
  padding: 7px 10px;
  background: #dcefe2;
  border-bottom: 1px solid #b9ddc6;
}

.paired-order-head strong {
  color: #124d31;
}

.paired-badge {
  background: #c8e7d2;
  border: 1px solid #afd5bc;
}

.paired-order-cards {
  position: relative;
}

.paired-order-cards .order-card + .order-card {
  margin-top: 2px;
}

@media (max-width: 700px) {
  .paired-order-block + .paired-order-block {
    margin-top: 13px;
  }
}

/* Order + technical driver panel as one visual unit */
.order-work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: stretch;
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(30, 45, 58, .08);
}

.order-work-main {
  min-width: 0;
}

.order-work-row .order-card {
  height: 100%;
  margin: 0;
  border-radius: 8px 0 0 8px;
  border-right: 0;
  box-shadow: none;
}

.order-tech-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #d7dee6;
  border-left: 1px dashed #bdc8d3;
  border-radius: 0 8px 8px 0;
  background: #f5f7f9;
}

.row-paired .order-tech-panel {
  background: #eaf6ee;
  border-color: #c8e4d1;
  border-left-color: #a9d0b6;
}

.row-single .order-tech-panel {
  background: #fff5d9;
  border-color: #ead9a8;
  border-left-color: #ddc98e;
}

.row-cancelled .order-tech-panel {
  background: #ffe9e6;
  border-color: #efc7c1;
  border-left-color: #dfa9a1;
}

.row-email-petniva:not(.row-cancelled) .order-tech-panel {
  background: #f4eadf;
  border-color: #ddc8af;
  border-left-color: #c8a47d;
}

.row-email-petniva:not(.row-cancelled) .tech-panel-head > span {
  color: #76583a;
}

.row-email-petniva:not(.row-cancelled) .driver-empty {
  color: #8a663c;
}

.row-email-petniva:not(.row-cancelled) .tech-save-button {
  border-color: #caa77f;
  color: #6d4d2f;
  background: #fffaf5;
}

.row-email-petniva:not(.row-cancelled) .tech-save-button:hover {
  background: #f8efe5;
}

.tech-panel-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(80, 98, 112, .12);
}

.tech-panel-head > span {
  color: #536271;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.tech-panel-head > b {
  font-size: 9px;
  line-height: 1.2;
}

.driver-set {
  color: #267048;
}

.driver-empty {
  color: #8a6a20;
}

.row-cancelled .driver-empty,
.row-cancelled .driver-set {
  color: #a04439;
}

.driver-assign-form {
  display: grid;
  gap: 5px;
}

.driver-assign-form label {
  color: #607080;
  font-size: 9px;
  font-weight: 800;
}

.driver-assign-form input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 29px;
  padding: 0 7px;
  border: 1px solid #cbd4dd;
  border-radius: 6px;
  background: rgba(255,255,255,.88);
  color: var(--text);
  font: inherit;
  font-size: 10.5px;
  outline: none;
}

.driver-assign-form input[type="text"]:focus {
  border-color: #7298bc;
  box-shadow: 0 0 0 2px rgba(93, 139, 183, .12);
}

.tech-save-button {
  height: 28px;
  border: 1px solid #b8c5d0;
  border-radius: 6px;
  background: #fff;
  color: #34485a;
  font-size: 9.5px;
  font-weight: 850;
  cursor: pointer;
}

.tech-save-button:hover {
  background: #f7fafc;
}

.row-paired .tech-save-button {
  border-color: #add1b9;
  color: #276542;
}

.row-single .tech-save-button {
  border-color: #d9c37f;
  color: #775d1d;
}

.row-cancelled .tech-save-button {
  border-color: #dda9a2;
  color: #944237;
}

@media (max-width: 1050px) {
  .order-work-row {
    grid-template-columns: minmax(0, 1fr) 205px;
  }
}

@media (max-width: 760px) {
  .order-work-row {
    grid-template-columns: 1fr;
  }

  .order-work-row .order-card {
    border-right: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
  }

  .order-tech-panel {
    border-left-style: solid;
    border-top-style: dashed;
    border-radius: 0 0 8px 8px;
  }

  .driver-assign-form {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .driver-assign-form label {
    margin-right: 2px;
  }

  .driver-assign-form input[type="text"],
  .tech-save-button {
    height: 30px;
  }
}

/* Driver planning controls */
.order-work-row {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.driver-assign-form select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 7px;
  border: 1px solid #cbd4dd;
  border-radius: 6px;
  background: rgba(255,255,255,.92);
  color: var(--text);
  font: inherit;
  font-size: 10.5px;
  outline: none;
}

.driver-assign-form select:focus {
  border-color: #7298bc;
  box-shadow: 0 0 0 2px rgba(93, 139, 183, .12);
}

.driver-plan-note {
  color: #71808d;
  font-size: 8.5px;
  line-height: 1.25;
}

.driver-assignment-warning {
  padding: 5px 6px;
  border: 1px solid #e5c675;
  border-radius: 5px;
  background: #fff7d8;
  color: #765a12;
  font-size: 9px;
  line-height: 1.25;
}

/* Calculation schedule */
.planning-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.planning-head h2 {
  margin: 2px 0 3px;
}

.planning-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.planning-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.schedule-summary {
  margin-bottom: 8px;
}

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 6px 0 9px;
  color: #5f6e7b;
  font-size: 9.5px;
}

.schedule-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-box {
  width: 13px;
  height: 13px;
  border: 1px solid #c8d0d7;
  border-radius: 3px;
  display: inline-block;
}

.schedule-scroll {
  max-width: 100%;
  max-height: calc(100vh - 275px);
  overflow: auto;
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  background: #fff;
}

.driver-schedule {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 9px;
}

.driver-schedule th,
.driver-schedule td {
  border-right: 1px solid #e2e7eb;
  border-bottom: 1px solid #e5eaee;
}

.driver-schedule thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  width: 145px;
  min-width: 145px;
  height: 62px;
  padding: 5px 6px;
  background: #f5f8fa;
  text-align: left;
  vertical-align: top;
}

.driver-schedule thead th strong,
.driver-schedule thead th span,
.driver-schedule thead th small {
  display: block;
  line-height: 1.25;
}

.driver-schedule thead th strong {
  font-size: 11px;
}

.driver-schedule thead th small {
  color: #71808d;
  font-size: 8px;
}

.driver-schedule .schedule-time-col {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 54px;
  min-width: 54px;
  padding: 0 6px;
  background: #f8fafb;
  color: #526271;
  font-weight: 800;
  text-align: center;
}

.driver-schedule thead .schedule-time-col {
  z-index: 6;
  top: 0;
  padding-top: 8px;
}

.driver-schedule tbody tr {
  height: 24px;
}

.schedule-cell {
  width: 145px;
  min-width: 145px;
  height: 24px;
  padding: 0;
  text-align: center;
  font-weight: 900;
}

.schedule-cell.empty { background: #fff; }
.schedule-cell.paired,
.legend-box.paired { background: #dff2e5; }
.schedule-cell.single,
.legend-box.single { background: #fff2c9; }
.schedule-cell.off,
.legend-box.off { background: #e1e5e8; }
.schedule-cell.off-part,
.legend-box.off-part {
  background: repeating-linear-gradient(135deg, #edf0f2 0 5px, #dfe4e8 5px 10px);
}
.schedule-cell.conflict,
.legend-box.conflict {
  background: #f8d5d0;
  color: #a0352b;
}

.driver-schedule thead th.not-social {
  background: #f1f2f3;
  color: #7d858c;
}

@media (max-width: 1050px) {
  .order-work-row {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
}

@media (max-width: 760px) {
  .planning-head,
  .planning-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .order-work-row {
    grid-template-columns: 1fr;
  }

  .driver-assign-form {
    grid-template-columns: 1fr;
  }
}

.driver-plan-note.needs-route {
  color: #9a6817;
}

.driver-assign-form optgroup {
  font-weight: 800;
}
/* Ultra-compact planning page */
.page-schedule .app-shell {
  grid-template-columns: 205px minmax(0, 1fr);
}

.page-schedule .sidebar {
  padding: 10px 9px;
}

.page-schedule .sidebar-brand {
  gap: 8px;
  padding: 2px 5px 10px;
}

.page-schedule .sidebar-nav {
  gap: 2px;
}

.page-schedule .sidebar-nav a {
  padding: 7px 9px;
  font-size: 12px;
}

.page-schedule .nav-divider {
  margin: 8px 5px 7px;
}

.page-schedule .topbar {
  display: none;
}
.page-schedule .content-area {
  padding: 8px 10px 10px;
}

.page-schedule .planning-head {
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.page-schedule .planning-head .preview-label {
  font-size: 8px;
  line-height: 1;
  margin-bottom: 1px;
}

.page-schedule .planning-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.05;
}

.page-schedule .planning-head p {
  margin-top: 2px;
  font-size: 8.5px;
  line-height: 1.15;
  white-space: nowrap;
}

.page-schedule .planning-actions {
  gap: 5px;
}
.page-schedule .history-date-filter {
  gap: 3px;
  padding: 1px 2px;
  border-radius: 6px;
}

.page-schedule .history-date-filter span {
  padding-left: 4px;
  font-size: 8px;
}

.page-schedule .history-date-filter input[type="date"] {
  height: 26px;
  padding: 0 4px;
  font-size: 9px;
}

.page-schedule .history-date-filter .secondary-button,
.page-schedule .planning-actions > .secondary-button {
  min-height: 26px;
  padding: 5px 7px;
  font-size: 8.5px;
}

.schedule-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  min-height: 22px;
  padding: 3px 7px;
  margin-bottom: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
}
.schedule-metrics strong {
  margin-left: 3px;
  color: var(--text);
  font-size: 11px;
}

.page-schedule .schedule-legend {
  gap: 3px 10px;
  margin: 2px 0 4px;
  font-size: 8px;
  line-height: 1;
}

.page-schedule .schedule-legend span {
  gap: 3px;
}

.page-schedule .legend-box {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.page-schedule .schedule-scroll {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 6px;
}

.page-schedule .driver-schedule {
  font-size: 7.5px;
}

.page-schedule .driver-schedule thead th {
  width: 124px;
  min-width: 124px;
  height: 51px;
  padding: 3px 4px;
}
.page-schedule .driver-schedule thead th strong {
  font-size: 9px;
  line-height: 1.05;
}

.page-schedule .driver-schedule thead th span {
  max-height: 18px;
  overflow: hidden;
  font-size: 7.5px;
  line-height: 1.15;
}

.page-schedule .driver-schedule thead th small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 6.8px;
  line-height: 1.1;
}

.page-schedule .driver-schedule .schedule-time-col {
  width: 42px;
  min-width: 42px;
  padding: 0 3px;
  font-size: 8px;
}

.page-schedule .driver-schedule thead .schedule-time-col {
  padding-top: 5px;
}

.page-schedule .driver-schedule tbody tr {
  height: 13px;
}

.page-schedule .schedule-cell {
  width: 124px;
  min-width: 124px;
  height: 13px;
  font-size: 7px;
  line-height: 1;
}
.page-schedule .sidebar-user {
  padding: 9px 5px 2px;
  gap: 7px;
}

.page-schedule .user-avatar {
  width: 31px;
  height: 31px;
}

.page-schedule .user-meta strong {
  font-size: 11px;
}

.page-schedule .user-meta span,
.page-schedule .logout-button {
  font-size: 9px;
}

@media (max-width: 760px) {
  .page-schedule .app-shell {
    grid-template-columns: 1fr;
  }

  .page-schedule .topbar {
    display: none;
  }

  .page-schedule .planning-head p {
    white-space: normal;
  }

  .page-schedule .driver-schedule thead th,
  .page-schedule .schedule-cell {
    width: 118px;
    min-width: 118px;
  }
}

/* Fit full planning grid on standard desktop screens */
.page-schedule .app-shell {
  grid-template-columns: 190px minmax(0, 1fr);
}

.page-schedule .driver-schedule thead th,
.page-schedule .schedule-cell {
  width: 108px;
  min-width: 108px;
}

.page-schedule .driver-schedule thead th {
  height: 46px;
  padding: 2px 3px;
}

.page-schedule .driver-schedule thead th strong {
  font-size: 8.5px;
}

.page-schedule .driver-schedule thead th span {
  max-height: 16px;
  font-size: 7px;
}

.page-schedule .driver-schedule thead th small {
  font-size: 6.2px;
}

.page-schedule .driver-schedule tbody tr,
.page-schedule .schedule-cell {
  height: 12px;
}

.page-schedule .driver-schedule .schedule-time-col {
  width: 40px;
  min-width: 40px;
}
/* Feed-time planning settings */
.active-setting-card {
  border-color: #b9d3e8;
  background: #f8fbfe;
}

.settings-link {
  text-decoration: none;
}

.feed-times-panel {
  margin-top: 16px;
}

.feed-panel-head {
  min-height: 58px;
  padding: 12px 15px;
}

.feed-add-form {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) 110px 110px 110px minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
}
.feed-add-form label,
.planning-rule-form label {
  display: grid;
  gap: 4px;
}

.feed-add-form label > span,
.planning-rule-form label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.feed-add-form input,
.feed-times-table input,
.planning-rule-form input {
  width: 100%;
  min-width: 0;
  height: 31px;
  padding: 0 7px;
  border: 1px solid #d4dce4;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 10.5px;
}

.feed-times-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.feed-times-table th,
.feed-times-table td {
  padding: 6px 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.feed-times-table th {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  background: #fafbfc;
}

.feed-times-table td:nth-child(2),
.feed-times-table td:nth-child(3),
.feed-times-table td:nth-child(4) {
  width: 105px;
}
.feed-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.feed-actions form {
  margin: 0;
}

.danger-text-button {
  border: 0;
  background: transparent;
  color: #a33d35;
  padding: 5px 4px;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.base-city-label {
  color: #307553;
  font-size: 9px;
  font-weight: 850;
}

.planning-rule-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px 190px auto;
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
  background: #f7fafc;
}

.planning-rule-form > div > strong {
  font-size: 11px;
}

.planning-rule-form > div > p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}

.planning-rule-form label > div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.planning-rule-form small {
  color: var(--muted);
  font-size: 9px;
}

.pair-reason {
  display: block;
  margin-top: 2px;
  color: #557563;
  font-size: 8px;
  font-weight: 650;
}

@media (max-width: 1050px) {
  .feed-add-form,
  .planning-rule-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .feed-add-form,
  .planning-rule-form {
    grid-template-columns: 1fr;
  }
}
/* Smart suggested order links */
.single-order-card.smart-suggested-card {
  background: #fbf7ff;
  border-color: #d8c2ea;
}

.single-order-card.smart-suggested-card .soc-source-preview {
  background: #f1e8fa;
  border-bottom-color: #d8c2ea;
}

.single-order-card.smart-suggested-card .route-block {
  border-color: #e0d1ed;
  background: #fefcff;
}

.single-order-card.smart-suggested-card .route-point + .route-point {
  border-top-color: #e0d1ed;
}

.single-order-card.smart-suggested-card .order-comment {
  background: #f8f1fd;
  border-color: #e0d1ed;
}

.row-smart .order-tech-panel {
  background: #f2eafa;
  border-color: #d8c2ea;
  border-left-color: #c7a8df;
}

.row-smart .tech-save-button {
  border-color: #c8abdf;
  color: #68447e;
}
.smart-pair-offer {
  display: grid;
  gap: 5px;
  margin-top: 1px;
  padding: 7px;
  border: 1px solid #c9afe0;
  border-radius: 7px;
  background: rgba(255,255,255,.68);
  color: #59416b;
  font-size: 8.5px;
  line-height: 1.25;
}

.smart-pair-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 850;
}

.smart-pair-title b {
  color: #775093;
}

.smart-pair-partner {
  font-size: 9.5px;
}

.smart-pair-route {
  color: #674879;
  font-weight: 800;
}

.smart-pair-metrics {
  display: grid;
  gap: 2px;
  color: #6c5b78;
}

.smart-pair-metrics b {
  color: #4f3561;
}

.smart-pair-late {
  color: #9a5b22;
}
.smart-pair-source {
  padding-top: 3px;
  border-top: 1px solid rgba(104,68,126,.14);
  color: #76657f;
  font-size: 7.5px;
}

.smart-pair-source.ai-source {
  color: #7e5797;
  font-weight: 750;
}

.smart-pair-button {
  width: 100%;
  min-height: 27px;
  border: 1px solid #b990d7;
  border-radius: 6px;
  background: #7d56a0;
  color: white;
  font-size: 8.5px;
  font-weight: 850;
  cursor: pointer;
}
.smart-pair-button:hover {
  background: #6f4a91;
}

.smart-suggestion-summary {
  margin: 0 0 8px;
  padding: 7px 10px;
  border: 1px solid #d3bee6;
  border-radius: 7px;
  background: #f6effc;
  color: #654779;
  font-size: 10px;
}

.smart-suggestion-summary.smart-error {
  border-color: #e2cbb0;
  background: #fff8ed;
  color: #86602e;
}

.unlink-smart-pair {
  display: inline-block;
  margin-left: 7px;
}

.unlink-smart-pair button {
  border: 0;
  background: transparent;
  color: #4b7659;
  padding: 0;
  font-size: 8px;
  text-decoration: underline;
  cursor: pointer;
}

.smart-planning-rules {
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(125px, .8fr)) auto;
}

@media (max-width: 1200px) {
  .smart-planning-rules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Segmented schedule: feed / trip / return */
.schedule-cell.paired-feed,
.schedule-cell.paired-return {
  background: #eef8f1;
  color: #71907a;
  font-weight: 750;
}

.schedule-cell.single-feed,
.schedule-cell.single-return {
  background: #fff9e8;
  color: #9a864d;
  font-weight: 750;
}

.schedule-cell.paired-wait {
  background: #e6f3e9;
  color: #6b8372;
  font-weight: 750;
}

.schedule-cell.single-wait {
  background: #fff6d9;
  color: #907d46;
  font-weight: 750;
}

.legend-box.service {
  background: linear-gradient(90deg, #eef8f1 0 50%, #fff9e8 50% 100%);
}

.page-schedule .schedule-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

.page-schedule .schedule-cell.paired,
.page-schedule .schedule-cell.single {
  font-size: 6.8px;
  letter-spacing: -0.1px;
}

.page-schedule .schedule-cell.paired-feed,
.page-schedule .schedule-cell.paired-return,
.page-schedule .schedule-cell.single-feed,
.page-schedule .schedule-cell.single-return,
.page-schedule .schedule-cell.paired-wait,
.page-schedule .schedule-cell.single-wait {
  font-size: 6.4px;
}

.feed-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 850;
  white-space: nowrap;
}

.feed-source-badge.ai {
  border: 1px solid #d0b8e3;
  background: #f5edfb;
  color: #704b89;
}

.feed-source-badge.manual {
  border: 1px solid #b9d7c5;
  background: #eef8f1;
  color: #356a4a;
}

.feed-source-badge.system {
  border: 1px solid #cbd4dc;
  background: #f2f5f7;
  color: #60707c;
}

.feed-times-table td:nth-child(5) {
  width: 105px;
}

/* Feed time editor: hours + minutes */
.feed-add-form {
  grid-template-columns: minmax(150px, 1.3fr) 100px 170px 170px minmax(150px, 1fr) auto;
}

.time-hm-input {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) auto minmax(42px, 1fr) auto;
  align-items: center;
  gap: 4px;
}

.time-hm-input input {
  min-width: 0;
  text-align: center;
}

.time-hm-input small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.time-hm-input.compact {
  grid-template-columns: 42px auto 42px auto;
}

.feed-times-table td:nth-child(3),
.feed-times-table td:nth-child(4) {
  width: 145px;
}

@media (max-width: 1050px) {
  .feed-add-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* PE source preview — turquoise identifies Portenergo orders.
   Purple remains reserved for smart merge suggestions. */
.pe-order-card {
  background: #f1fbfb;
  border-color: #b8dedd;
}

.pe-order-card.single-order-card {
  background: #f1fbfb;
  border-color: #b8dedd;
}

.pe-source-preview {
  background: #e6f6f5;
  color: #356e6d;
  border-bottom-color: #bfdfde;
}

.pe-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #cceceb;
  color: #176f6d;
  font-weight: 900;
  letter-spacing: .04em;
}

.pe-order-kind {
  min-width: 74px;
  text-align: right;
}

.pe-order-kind span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.pe-order-kind strong {
  color: #197674;
  font-size: 18px;
}

 .pe-card-foot {
  background: #eaf8f7;
  border-top-color: #bfdfde;
}

 .pe-preview-note {
  color: #1d7775;
  font-weight: 850;
}

.row-pe {
  background: #effafa;
  border-color: #c4e1df;
  border-left-color: #58aaa6;
}

.row-pe .order-tech-panel {
  background: #eaf8f7;
  border-color: #bfdfde;
  border-left-color: #8fcac8;
}

 .pe-tech-state {
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ccebea;
  color: #176f6d;
  font-size: 9px;
}

 .pe-tech-message {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: #496b6a;
  font-size: 10px;
  line-height: 1.35;
}

 .pe-tech-message strong {
  color: #2c6664;
  font-size: 11px;
}

.pe-hide-form {
  margin-top: auto;
  padding-top: 10px;
}

 .pe-hide-button {
  width: 100%;
  min-height: 32px;
  border: 1px solid #9ecfcd;
  border-radius: 7px;
  background: #fff;
  color: #1d7472;
  font-weight: 800;
  cursor: pointer;
}

 .pe-hide-button:hover {
  background: #e2f5f4;
}

.hidden-pe-stack {
  display: grid;
  gap: 5px;
  margin: 8px 0 12px;
}

 .hidden-pe-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
  color: #5c7776;
  font-size: 10px;
  font-weight: 800;
}

 .hidden-pe-title strong {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dcefee;
  color: #216d6b;
  text-align: center;
}

 .hidden-pe-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid #c6e1e0;
  border-radius: 7px;
  background: #f6fbfb;
}

 .hidden-pe-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: #5d7776;
  font-size: 10px;
}

 .hidden-pe-meta b {
  color: #315f5e;
}

 .hidden-pe-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: #d2eeed;
  color: #176f6d;
  font-weight: 900;
}

.hidden-pe-route {
  overflow: hidden;
  color: #4d4653;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

 .hidden-pe-show-button {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #a8d3d1;
  border-radius: 6px;
  background: #fff;
  color: #1c716f;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

 .hidden-pe-show-button:hover {
  background: #e5f6f5;
}

.customer-phone-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(80, 98, 112, .12);
}

.customer-phone-line span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.customer-phone-line strong {
  color: #2d3742;
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 850px) {
  .hidden-pe-row {
    grid-template-columns: 1fr auto;
  }

  .hidden-pe-route {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* PE point directory */
.pe-route-unresolved {
  background: #fff8e8;
  box-shadow: inset 3px 0 0 #d69a27;
}

.pe-route-unresolved .route-letter {
  background: #fff0c8;
  color: #8b5b00;
}

.pe-unresolved-point {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.pe-unresolved-point strong {
  color: #7b5408;
}

.pe-unresolved-point small {
  color: #9a6806;
  font-size: 10px;
  font-weight: 800;
}

.pe-unresolved-point:hover strong {
  text-decoration: underline;
}

.pe-points-panel {
  margin-bottom: 18px;
}

.pe-points-head {
  align-items: flex-start;
}

.pe-unknown-box {
  display: grid;
  gap: 10px;
  margin: 0 16px 14px;
  padding: 12px;
  border: 1px solid #efd5a0;
  border-radius: 9px;
  background: #fffaf0;
}

.pe-unknown-box > div:first-child {
  display: grid;
  gap: 3px;
}

.pe-unknown-box span {
  color: var(--muted);
  font-size: 11px;
}

.pe-unknown-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pe-unknown-chip {
  padding: 6px 9px;
  border: 1px solid #e2bd70;
  border-radius: 999px;
  background: #fff;
  color: #7a560d;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.pe-unknown-chip:hover {
  background: #fff3d7;
}

.pe-points-table td {
  vertical-align: top;
}

.pe-points-table code {
  white-space: nowrap;
}

.pe-aliases {
  margin-bottom: 6px;
  color: #526173;
  font-size: 11px;
}

.pe-alias-form {
  display: flex;
  gap: 6px;
  min-width: 280px;
}

.pe-alias-form input {
  min-width: 170px;
}

.pe-point-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.muted-cell {
  color: var(--muted);
  text-align: center;
}

.pe-map-dialog {
  width: min(900px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 24px 70px rgba(22, 35, 50, .25);
}

.pe-map-dialog::backdrop {
  background: rgba(24, 34, 45, .42);
}

.pe-map-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.pe-map-form .dialog-head {
  margin-bottom: 0;
}

.pe-map-name,
.pe-coordinate-row label {
  display: grid;
  gap: 5px;
}

.pe-map-name span,
.pe-coordinate-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.pe-point-map {
  height: 500px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #eef1f4;
}

.pe-coordinate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pe-map-hint {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 760px) {
  .pe-point-map { height: 390px; }
  .pe-coordinate-row { grid-template-columns: 1fr; }
  .pe-alias-form { min-width: 0; flex-direction: column; }
  .pe-point-actions { flex-direction: column; align-items: stretch; }
}

.soc-order-kind {
  min-width: 92px;
  text-align: right;
}

.soc-order-kind span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.soc-order-kind strong {
  display: block;
  color: #405469;
  font-size: 18px;
}

.soc-order-kind small {
  display: block;
  margin-top: 2px;
  color: #6e7c8c;
  font-size: 9px;
  font-weight: 750;
}

/* PE tariff routes */
.pe-tariffs-panel {
  margin-bottom: 18px;
}

.pe-tariffs-head {
  align-items: flex-start;
}

.pe-tariff-searchbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 0 16px 12px;
}

.pe-tariff-search-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.pe-tariff-add-form {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(5, minmax(86px, .65fr)) minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin: 0 16px 14px;
  padding: 12px;
  border: 1px solid #c9e2e0;
  border-radius: 9px;
  background: #f4fbfa;
}

.pe-tariff-add-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.pe-tariff-add-form label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pe-tariff-table-wrap {
  max-height: 640px;
  overflow: auto;
}

.pe-tariff-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.pe-tariff-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f7f9fb;
  padding-left: 5px;
  padding-right: 5px;
  font-size: 9px;
}

.pe-tariff-row[hidden] {
  display: none;
}

.pe-tariff-table td {
  vertical-align: middle;
  padding-left: 5px;
  padding-right: 5px;
}

.pe-tariff-table input {
  width: 100%;
  min-width: 0;
  padding: 6px 6px;
  font-size: 10px;
}

.pe-tariff-table th:nth-child(1),
.pe-tariff-table td:nth-child(1) {
  width: 36%;
}

.pe-tariff-route-cell {
  min-width: 0;
}

.pe-tariff-route-cell input {
  font-size: 10px;
  font-weight: 700;
}

.pe-tariff-table th:nth-child(2),
.pe-tariff-table td:nth-child(2),
.pe-tariff-table th:nth-child(3),
.pe-tariff-table td:nth-child(3) {
  width: 6%;
}

.pe-tariff-table th:nth-child(4),
.pe-tariff-table td:nth-child(4) {
  width: 5%;
}

.pe-tariff-table th:nth-child(5),
.pe-tariff-table td:nth-child(5),
.pe-tariff-table th:nth-child(6),
.pe-tariff-table td:nth-child(6) {
  width: 7%;
}

.pe-tariff-table th:nth-child(7),
.pe-tariff-table td:nth-child(7) {
  width: 8%;
}

.pe-tariff-table th:nth-child(8),
.pe-tariff-table td:nth-child(8) {
  width: 13%;
}

.pe-tariff-table th:nth-child(9),
.pe-tariff-table td:nth-child(9) {
  width: 12%;
}

.pe-tariff-table .feed-source-badge {
  padding: 3px 6px;
  font-size: 8px;
  white-space: nowrap;
}

.pe-tariff-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  align-items: stretch;
  white-space: normal;
}

.pe-tariff-actions form,
.pe-tariff-actions button {
  width: 100%;
}

.pe-tariff-actions .secondary-button,
.pe-tariff-actions .danger-text-button {
  padding: 5px 6px;
  font-size: 9px;
}

@media (max-width: 1100px) {
  .pe-tariff-add-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pe-tariff-route-field,
  .pe-tariff-note-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .pe-tariff-searchbar {
    grid-template-columns: 1fr;
  }
  .pe-tariff-add-form {
    grid-template-columns: 1fr 1fr;
  }
  .pe-tariff-route-field,
  .pe-tariff-note-field {
    grid-column: 1 / -1;
  }
}

/* Linked one-way orders: same customer, reverse route through Kingisepp */
.linked-single-block {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #bfd6ea;
  border-left: 5px solid #6d9fc9;
  border-radius: 13px;
  background: #eef6fd;
  box-shadow: 0 4px 12px rgba(55, 103, 145, .10);
  overflow: hidden;
}
.linked-single-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -7px -7px 7px;
  padding: 7px 10px;
  background: #dcecf9;
  border-bottom: 1px solid #bfd6ea;
}
.linked-single-head > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  min-width: 0;
}
.linked-single-head strong {
  font-size: 14px;
  color: #1d517b;
}
.linked-single-head > div:first-child > span:not(.linked-single-badge) {
  color: #58738a;
  font-size: 11px;
}
.linked-single-badge {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid #a9cbe6;
  border-radius: 999px;
  background: #c9e1f4;
  color: #235f8e;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.linked-single-route {
  color: #2d668f;
  font-size: 10px;
  font-weight: 800;
}
.linked-single-head .pair-reason {
  color: #58738a;
}
.linked-single-head .paired-total span {
  color: #637f95;
}
.linked-single-head .paired-total strong {
  color: #1d517b;
}
.linked-single-cards {
  display: grid;
  gap: 10px;
}
.linked-single-block .taxomet-card:not(.status-alert-card) {
  background: #f8fbfe;
  border-color: #caddeb;
  box-shadow: none;
}
.linked-single-block .taxomet-card:not(.status-alert-card) .soc-source-preview {
  background: #e8f2fa;
  border-bottom-color: #caddeb;
}
.linked-single-block .taxomet-card:not(.status-alert-card) .route-block {
  background: #fbfdff;
  border-color: #d7e5f0;
}
.linked-single-block .taxomet-card:not(.status-alert-card) .route-point + .route-point {
  border-top-color: #d7e5f0;
}
.linked-single-block .taxomet-card:not(.status-alert-card) .order-comment {
  background: #f0f7fc;
  border-color: #d7e5f0;
}
.row-linked-single .order-tech-panel {
  background: #edf6fd;
  border-color: #caddeb;
  border-left-color: #adcbe1;
}
.linked-single-block + .single-orders-label {
  margin-top: 16px;
}
@media (max-width: 700px) {
  .linked-single-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Excel ↔ PE tariff reconciliation */
.excel-price-change-alert {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:0 0 14px;
  padding:12px 14px;
  border:1px solid #e5c875;
  border-radius:10px;
  background:#fff9e7;
}
.excel-price-change-alert > div {
  display:grid;
  gap:3px;
}
.excel-price-change-alert strong {
  color:#76580c;
  font-size:13px;
}
.excel-price-change-alert span {
  color:#806f42;
  font-size:11px;
}
.excel-price-dialog {
  width:min(980px, calc(100vw - 32px));
  max-height:88vh;
  padding:0;
  border:0;
  border-radius:14px;
  background:#fff;
  box-shadow:0 22px 70px rgba(20,33,50,.25);
}
.excel-price-dialog::backdrop {
  background:rgba(20,33,50,.42);
}
.excel-price-dialog-card {
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  max-height:88vh;
}
.excel-price-dialog .dialog-head {
  padding:18px 20px 14px;
  border-bottom:1px solid #e5eaf0;
}
.excel-price-change-list {
  display:grid;
  gap:10px;
  padding:14px 20px;
  overflow:auto;
}
.excel-price-change-item {
  padding:12px;
  border:1px solid #dce4ec;
  border-left:4px solid #7d9fbd;
  border-radius:10px;
  background:#fbfdff;
}
.excel-price-change-item.new { border-left-color:#4d9a68; }
.excel-price-change-item.removed { border-left-color:#c36a5f; }
.excel-price-change-route {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px 10px;
}
.excel-price-change-route strong {
  flex:1 1 420px;
  font-size:12px;
  overflow-wrap:anywhere;
}
.excel-price-change-route small {
  color:#7a8796;
  font-size:9px;
}
.excel-change-type {
  display:inline-flex;
  padding:4px 7px;
  border-radius:999px;
  background:#e7eef5;
  color:#49687f;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
}
.excel-price-change-item.new .excel-change-type {
  background:#e5f4ea;
  color:#397350;
}
.excel-price-change-item.removed .excel-change-type {
  background:#fae9e6;
  color:#9a4d44;
}
.excel-price-values {
  display:grid;
  grid-template-columns:minmax(120px,1fr) 28px minmax(120px,1fr) minmax(180px,1.2fr);
  gap:8px;
  align-items:stretch;
  margin-top:10px;
}
.excel-price-values > div:not(.excel-price-arrow) {
  display:grid;
  gap:2px;
  padding:9px 10px;
  border:1px solid #e1e7ed;
  border-radius:8px;
  background:#fff;
}
.excel-price-values span {
  color:#7a8796;
  font-size:9px;
  font-weight:750;
  text-transform:uppercase;
}
.excel-price-values b {
  font-size:17px;
}
.excel-price-values small {
  color:#657587;
  font-size:10px;
}
.excel-price-arrow {
  display:flex;
  align-items:center;
  justify-content:center;
  color:#7890a5;
  font-size:18px;
}
.excel-current-program-price {
  background:#f0f7fd !important;
  border-color:#cbddeb !important;
}
.excel-price-metrics-note {
  margin-top:8px;
  padding:7px 9px;
  border-radius:7px;
  background:#f5f7f9;
  color:#667789;
  font-size:10px;
}
.excel-price-change-actions {
  display:flex;
  gap:8px;
  margin-top:10px;
}
.excel-price-change-actions form {
  margin:0;
}
.excel-price-dialog-footer {
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding:12px 20px 16px;
  border-top:1px solid #e5eaf0;
  background:#fafbfd;
}
@media (max-width:760px) {
  .excel-price-change-alert {
    align-items:flex-start;
    flex-direction:column;
  }
  .excel-price-values {
    grid-template-columns:1fr;
  }
  .excel-price-arrow {
    transform:rotate(90deg);
    min-height:20px;
  }
  .excel-price-change-actions {
    flex-wrap:wrap;
  }
}

/* Customers */
.customer-credential-box{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  margin-bottom:14px;padding:14px 16px;border:1px solid #c7dced;border-left:4px solid #5c91bc;
  border-radius:12px;background:#eff7fd
}
.customer-credential-box>div:first-child{display:grid;gap:4px}
.customer-credential-box strong{font-size:14px;color:#254f70}
.customer-credential-box span{font-size:11px;color:#66798a}
.customer-credential-values{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.customer-credential-values label{display:grid;gap:4px}
.customer-credential-values label span{font-size:9px;font-weight:800;text-transform:uppercase;color:#6c7f91}
.customer-credential-values code{display:block;padding:7px 9px;border:1px solid #c4d7e6;border-radius:8px;background:#fff;font-size:14px;font-weight:800;color:#173b57}
.customer-stats-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}
.customer-stats-row>div{display:grid;gap:3px;padding:10px 12px;border:1px solid #e0e6ec;border-radius:10px;background:#fafbfd}
.customer-stats-row span{font-size:9px;font-weight:800;text-transform:uppercase;color:#7b8997}
.customer-stats-row strong{font-size:21px;color:#25384a}
.customer-search-row{margin:10px 0 12px}
.customer-search-row input{width:min(520px,100%);padding:10px 12px;border:1px solid #d5dde5;border-radius:9px;background:#fff}
.customers-table th,.customers-table td{vertical-align:top}
.customers-table td{font-size:11px}
.customer-note{display:block;margin-top:4px;color:#7b8792;max-width:260px}
.customer-status{display:inline-flex;padding:4px 7px;border-radius:999px;font-size:9px;font-weight:800;white-space:nowrap}
.customer-status.ready{background:#e6f5eb;color:#39754e}
.customer-status.temp{background:#fff3cf;color:#8a6614}
.customer-status.off{background:#f2f3f5;color:#707882}
.customer-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.customer-actions form{margin:0}
.customer-reset-button{border:0;background:transparent;color:#6b7b8b;font-size:10px;text-decoration:underline;cursor:pointer;padding:4px}
.customer-form textarea{resize:vertical;min-height:72px}
@media(max-width:900px){
  .customer-credential-box{align-items:flex-start;flex-direction:column}
  .customer-stats-row{grid-template-columns:1fr}
}

/* Late customer trip cancellations */
.late-cancellations-panel{
  margin-bottom:14px;
  border-left:4px solid #ba5b4f;
}
.late-cancel-count{
  display:grid;
  place-items:center;
  min-width:30px;
  height:30px;
  padding:0 8px;
  border-radius:999px;
  background:#f4dedb;
  color:#9a473e;
  font-size:12px;
  font-weight:900;
}
.late-cancellations-table td{font-size:11px}
.late-cancellations-table td:first-child strong{display:block}
.late-cancellations-table td:first-child small{display:block;margin-top:3px;color:#788692}
.late-cancel-badge{
  display:inline-flex;
  padding:4px 7px;
  border-radius:999px;
  background:#fae7e4;
  color:#9d4c43;
  font-size:9px;
  font-weight:850;
}

/* Port-E route builder */
.port-e-builder-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:14px}
.port-e-builder-head h2{margin:3px 0 5px;font-size:22px}
.port-e-builder-head p{margin:0;color:#6e7c87;font-size:12px}
.port-e-builder-actions{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}
.port-e-builder-actions form:last-child{margin:0}
.port-e-metrics{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:9px;margin-bottom:14px}
.port-e-metrics>div{padding:11px 13px;border:1px solid #e0e6ea;border-radius:12px;background:#fff}
.port-e-metrics span{display:block;font-size:9px;text-transform:uppercase;color:#80909b;font-weight:800}
.port-e-metrics strong{display:block;margin-top:3px;font-size:20px}
.port-e-metrics .has-problem{border-color:#e2b5ae;background:#fff8f6}
.port-e-metrics .has-problem strong{color:#a64b41}
.port-e-preview-panel{margin-bottom:14px}
.port-e-machine-list{display:grid;gap:10px}
.port-e-machine-card{padding:13px;border:1px solid #dfe6eb;border-radius:13px;background:#fbfcfd}
.port-e-machine-card.ready{border-left:4px solid #57936a}
.port-e-machine-card.problem{border-left:4px solid #b85a4e;background:#fffafa}
.port-e-machine-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.port-e-machine-head>div{display:grid;gap:2px}
.port-e-machine-kind{font-size:8px;text-transform:uppercase;font-weight:900;color:#758692}
.port-e-machine-head strong{font-size:13px}

.port-e-machine-status{padding:4px 7px;border-radius:999px;background:#e8f4eb;color:#477757;font-size:8px;font-weight:900}
.port-e-machine-card.problem .port-e-machine-status{background:#f8e5e2;color:#98483f}
.port-e-machine-route{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin:10px 0;padding:9px;border-radius:9px;background:#f1f5f7}
.port-e-machine-route span{font-size:10px;font-weight:750}
.port-e-machine-route b{color:#98a6b0;font-size:10px}
.port-e-machine-info{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:7px}
.port-e-machine-info>div{display:grid;gap:2px}
.port-e-machine-info span{font-size:8px;text-transform:uppercase;color:#89959e;font-weight:800}
.port-e-machine-info strong,.port-e-machine-info code{font-size:10px}
.port-e-price-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px;padding-top:9px;border-top:1px dashed #d7dfe4;font-size:10px}
.port-e-price-line>strong{margin-left:auto;font-size:14px}
.port-e-price-line .price-missing{color:#a44c43}
.port-e-passengers{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}
.port-e-passengers span{padding:4px 6px;border-radius:6px;background:#eef4f7;font-size:8px}
.port-e-machine-warnings{display:grid;gap:3px;margin-top:9px;padding:8px;border-radius:8px;background:#fff0ed;color:#91483f;font-size:9px}
.port-e-config-grid{display:grid;grid-template-columns:1fr;gap:14px}
.port-e-routes-intro{margin-bottom:14px;padding:18px 20px;border:1px solid #dce5e9;border-radius:14px;background:#fff}
.port-e-routes-intro h2{margin:3px 0 6px;font-size:20px}
.port-e-routes-intro p{margin:0;max-width:900px;color:#6f7e88;font-size:11px;line-height:1.55}
.port-e-node-create{display:grid;grid-template-columns:1fr 150px 1.3fr auto;gap:7px;margin-bottom:10px}
.port-e-node-create input,.port-e-node-create select,.port-e-node-edit input,.port-e-node-edit select,
.port-e-route-form input,.port-e-route-form select{min-width:0;padding:8px 9px;border:1px solid #d3dce3;border-radius:8px;background:#fff}
.port-e-node-list{display:grid;gap:6px}

.port-e-node-list details,.port-e-route-editor{border:1px solid #e0e6ea;border-radius:10px;background:#fafcfd}
.port-e-node-list summary,.port-e-route-editor>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px;cursor:pointer}
.port-e-node-list summary span,.port-e-route-editor>summary span{font-size:9px;color:#71808b}
.port-e-node-edit{display:grid;grid-template-columns:1fr 140px 1.4fr 110px auto;gap:7px;padding:0 10px 10px}
.port-e-routes-panel{min-width:0;order:1}
.port-e-config-grid>section:first-child{order:2}
.port-e-node-dialog{width:min(560px,calc(100vw - 24px))}
.port-e-route-editor{margin-bottom:8px}
.port-e-route-editor.create-route{background:#f5faf7;border-color:#cfe2d4}
.port-e-route-form{padding:0 10px 10px}
.port-e-route-main-fields{display:grid;grid-template-columns:minmax(180px,1fr) 170px 170px 110px 120px;gap:8px;margin-bottom:12px}
.port-e-route-main-fields .port-e-route-name{grid-column:1/-1;font-size:13px;font-weight:750;padding:10px 11px}
.port-e-route-main-fields label{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:5px}
.port-e-route-main-fields label span{font-size:8px;color:#788792;text-transform:uppercase;font-weight:800}
.create-route .port-e-route-main-fields{grid-template-columns:minmax(180px,1fr) 170px 170px 110px}
.port-e-route-points{display:grid;gap:6px;margin-bottom:8px}
.port-e-route-point-row{display:grid;grid-template-columns:minmax(150px,1fr) 100px 180px minmax(280px,2.2fr) 36px;gap:7px;align-items:center}
.port-e-remove-point{height:34px;border:0;border-radius:8px;background:#f4e8e6;color:#a34e45;font-size:16px;cursor:pointer}
.compact-empty{padding:18px}
button[disabled]{opacity:.5;cursor:not-allowed}

@media(max-width:1100px){
  .port-e-config-grid{grid-template-columns:1fr}
  .port-e-machine-info{grid-template-columns:repeat(2,minmax(120px,1fr))}
}
@media(max-width:760px){
  .port-e-builder-head{flex-direction:column}
  .port-e-builder-actions{width:100%}
  .port-e-metrics{grid-template-columns:repeat(2,1fr)}
  .port-e-node-create,.port-e-node-edit{grid-template-columns:1fr}
  .port-e-route-main-fields,.create-route .port-e-route-main-fields{grid-template-columns:1fr 1fr}
  .port-e-route-point-row{grid-template-columns:1fr 90px}
  .port-e-route-point-row select:nth-of-type(2),
  .port-e-route-point-row input[name="point_meeting_address"]{grid-column:1/-1}
  .port-e-remove-point{grid-column:2}
  .port-e-machine-info{grid-template-columns:1fr 1fr}
}

.port-e-unrouted-panel{margin-bottom:14px;border-left:4px solid #b95a4e;background:#fffafa}
.port-e-unrouted-list{display:grid;gap:6px}
.port-e-unrouted-list>div{display:grid;grid-template-columns:1.2fr .8fr 1.4fr;gap:8px;align-items:center;padding:8px 10px;border-radius:8px;background:#fff1ef}
.port-e-unrouted-list strong{font-size:10px}
.port-e-unrouted-list span{font-size:9px;font-weight:800;color:#8b554d}
.port-e-unrouted-list small{font-size:9px;color:#86635e}
@media(max-width:760px){.port-e-unrouted-list>div{grid-template-columns:1fr}.port-e-unrouted-list span,.port-e-unrouted-list small{display:block}}

/* Explicit customer-to-route assignments */
.customer-route-assignments{
  margin:2px 0 4px;
  padding:10px;
  border:1px solid #d8e1e7;
  border-radius:11px;
}
.customer-route-assignments legend{
  padding:0 5px;
  font-size:10px;
  font-weight:900;
}
.customer-route-assignments>p{
  margin:0 0 8px;
  font-size:9px;
  line-height:1.4;
  color:#74838e;
}
.customer-route-assignment-list{display:grid;gap:6px;max-height:260px;overflow:auto}
.customer-route-assignment-item{
  display:grid;
  grid-template-columns:20px 1fr 92px;
  align-items:center;
  gap:8px;
  padding:8px;
  border:1px solid #e0e6ea;
  border-radius:9px;
  background:#fafcfd;
}
.customer-route-assignment-item>input[type="checkbox"]{width:16px;height:16px}
.customer-route-assignment-main{display:grid;gap:2px}
.customer-route-assignment-main strong{font-size:10px}
.customer-route-assignment-main small{font-size:8px;color:#758590}
.customer-route-priority{display:grid;grid-template-columns:1fr 44px;align-items:center;gap:4px}
.customer-route-priority em{font-size:7px;font-style:normal;text-transform:uppercase;color:#81909a}
.customer-route-priority input{width:44px;padding:6px!important;text-align:center}
.customer-route-empty{font-size:9px;color:#8b98a1}
.port-e-route-customers{display:flex;gap:5px;flex-wrap:wrap;padding:0 10px 9px}
.port-e-route-customers span{
  display:inline-flex;align-items:center;gap:5px;padding:4px 6px;
  border-radius:7px;background:#eef4f7;font-size:8px
}
.port-e-route-customers small{color:#6f7e89}
.port-e-passengers span{display:grid;gap:2px}
.port-e-passengers span small{font-size:7px;color:#71808b}
.port-e-passengers .used-alternative-route{background:#fff2dc;border:1px solid #e7c57f}
.port-e-passengers .used-alternative-route small{color:#8b671e;font-weight:800}
@media(max-width:560px){
  .customer-route-assignment-item{grid-template-columns:20px 1fr}
  .customer-route-priority{grid-column:2}
}

/* E-mail order source */
.email-source-form input[type="number"]{
  width:100%;
  border:1px solid #cfd7e1;
  border-radius:8px;
  padding:10px 11px;
  outline:none;
  background:#fff;
}
.email-source-form input[type="number"]:focus{
  border-color:#245b8f;
  box-shadow:0 0 0 3px rgba(36,91,143,.12);
}
.email-source-server-row{
  grid-template-columns:minmax(260px,1fr) 140px;
}
.email-source-switches{
  display:flex;
  align-items:center;
  gap:24px;
  flex-wrap:wrap;
}
.email-preview-block{
  border-top:1px solid #dfe5ec;
  padding:16px 18px 18px;
}
.email-preview-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:12px;
}
.email-preview-head>div{
  display:grid;
  gap:3px;
}
.email-preview-head strong{
  font-size:14px;
}
.email-preview-head span{
  color:#6b7788;
  font-size:10px;
}
.email-preview-table-wrap{
  max-height:440px;
  overflow:auto;
  border:1px solid #e0e6eb;
  border-radius:10px;
}
.email-preview-table{
  width:100%;
  table-layout:fixed;
}
.email-preview-table th,
.email-preview-table td{
  padding:9px 10px;
  vertical-align:top;
  font-size:10px;
}
.email-preview-table th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f7f9fb;
}
.email-preview-table th:nth-child(1),
.email-preview-table td:nth-child(1){width:145px}
.email-preview-table th:nth-child(2),
.email-preview-table td:nth-child(2){width:24%}
.email-preview-table th:nth-child(4),
.email-preview-table td:nth-child(4){width:85px;text-align:center}
.email-preview-table th:nth-child(5),
.email-preview-table td:nth-child(5){width:100px}
.email-preview-table td{
  overflow-wrap:anywhere;
}
.email-preview-detail-cell details summary{
  cursor:pointer;
  color:#245b8f;
  font-weight:800;
}
.email-preview-detail-cell details[open]{
  position:relative;
}
.email-preview-text{
  margin-top:8px;
  padding:10px;
  min-width:360px;
  max-width:760px;
  border:1px solid #dce4ea;
  border-radius:8px;
  background:#fafcfd;
  white-space:pre-wrap;
  line-height:1.45;
  color:#2f3b49;
}
.email-attachment-count{
  display:inline-flex;
  min-width:24px;
  height:24px;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#eef4f7;
  font-weight:900;
}
.email-attachment-list{
  display:grid;
  gap:4px;
  margin-top:8px;
}
.email-attachment-list span{
  padding:5px 7px;
  border-radius:7px;
  background:#f1f5f7;
  font-size:9px;
}
.email-empty-state{
  margin:0;
}
@media(max-width:760px){
  .email-source-server-row{grid-template-columns:1fr}
  .email-source-switches{display:grid;gap:10px}
  .email-preview-table{min-width:760px}
}

.email-source-interval-row{
  grid-template-columns:minmax(180px,260px);
}
.email-folder-block{
  border-top:1px solid #dfe5ec;
  padding:16px 18px 18px;
}
.email-folder-add-form{
  display:grid;
  grid-template-columns:minmax(240px,1fr) minmax(240px,1fr) auto;
  gap:10px;
  align-items:end;
  padding:12px;
  border:1px solid #dce5ea;
  border-radius:10px;
  background:#f8fbfc;
  margin-bottom:12px;
}
.email-folder-add-form label,
.email-folder-edit-form label:not(.switch-line){
  display:grid;
  gap:5px;
  min-width:0;
}
.email-folder-add-form label>span,
.email-folder-edit-form label>span{
  color:#6b7788;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.email-folder-add-form select,
.email-folder-add-form input,
.email-folder-edit-form input{
  width:100%;
  min-width:0;
  border:1px solid #cfd7e1;
  border-radius:8px;
  padding:9px 10px;
  background:#fff;
  outline:none;
}
.email-folder-hint{
  padding:11px 12px;
  border:1px dashed #cbd7df;
  border-radius:9px;
  color:#6b7788;
  font-size:11px;
  margin-bottom:12px;
}
.email-folder-list{
  display:grid;
  gap:8px;
}
.email-folder-row{
  display:grid;
  grid-template-columns:minmax(220px,.9fr) minmax(430px,1.8fr) auto;
  gap:12px;
  align-items:end;
  padding:10px 12px;
  border:1px solid #e0e6eb;
  border-radius:10px;
  background:#fff;
}
.email-folder-name{
  display:grid;
  gap:4px;
  min-width:0;
}
.email-folder-name span{
  color:#7c8898;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
}
.email-folder-name strong{
  overflow-wrap:anywhere;
}
.email-folder-edit-form{
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto auto;
  gap:10px;
  align-items:end;
}
.email-mailbox-label{
  display:block;
  margin-top:3px;
  color:#7c8898;
  font-size:9px;
  overflow-wrap:anywhere;
}
.email-preview-table th:nth-child(1),
.email-preview-table td:nth-child(1){width:140px}
.email-preview-table th:nth-child(2),
.email-preview-table td:nth-child(2){width:18%}
.email-preview-table th:nth-child(3),
.email-preview-table td:nth-child(3){width:20%}
.email-preview-table th:nth-child(5),
.email-preview-table td:nth-child(5){width:80px;text-align:center}
.email-preview-table th:nth-child(6),
.email-preview-table td:nth-child(6){width:95px}
@media(max-width:900px){
  .email-folder-add-form,
  .email-folder-row,
  .email-folder-edit-form{
    grid-template-columns:1fr;
  }
}

/* Embedded external workspaces */
.page-external-weekends .content-area,
.page-external-soc-orders .content-area,
.page-external-transport-order .content-area{
  padding:14px;
}
.external-app-shell{
  display:grid;
  grid-template-rows:auto minmax(560px,1fr);
  gap:10px;
  min-height:calc(100vh - 118px);
}
.external-app-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  border:1px solid #dce4eb;
  border-radius:12px;
  background:#fff;
}
.external-app-toolbar>div{display:grid;gap:2px}
.external-app-toolbar strong{font-size:14px}
.external-app-toolbar span{font-size:10px;color:#718092}
.external-app-note{
  padding:8px 11px;
  border:1px dashed #cad6df;
  border-radius:9px;
  background:#f8fbfd;
  color:#667588;
  font-size:10px;
}
.external-app-frame{
  width:100%;
  height:calc(100vh - 220px);
  min-height:620px;
  border:1px solid #d6dfe7;
  border-radius:12px;
  background:#fff;
}
@media(max-width:900px){
  .external-app-toolbar{align-items:flex-start;flex-direction:column}
  .external-app-frame{height:calc(100vh - 250px);min-height:540px}
}

/* PE route point coordinates / employee coordinates */
.coordinate-picker-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:8px 10px;
  border:1px dashed #cbd7e0;
  border-radius:9px;
  background:#f8fbfd;
}
.coordinate-picker-row .coordinate-value{
  font-size:11px;
  color:#607180;
  font-weight:700;
}
.coordinate-missing{color:#a55b24!important;font-weight:800}
.route-node-key{
  padding:2px 6px;
  border-radius:999px;
  background:#edf2f6;
  color:#506274!important;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-weight:800;
  white-space:nowrap;
}
.port-e-node-edit{
  grid-template-columns:minmax(180px,1fr) 150px minmax(220px,1.3fr) minmax(240px,1.2fr);
  align-items:center;
}
.port-e-node-edit .compact-coordinate-row{min-width:0}
.port-e-node-edit .compact-coordinate-row .coordinate-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:980px){
  .port-e-node-edit{grid-template-columns:1fr 1fr}
}
@media (max-width:620px){
  .port-e-node-edit{grid-template-columns:1fr}
  .coordinate-picker-row{align-items:flex-start;flex-direction:column}
}

/* Leaflet in modal: keep tiles at their native size and fill the opened dialog correctly */
.pe-point-map.leaflet-container{width:100%;min-width:0;position:relative}
.pe-point-map .leaflet-tile{max-width:none!important;max-height:none!important}
.coordinate-search-status{
  min-height:18px;
  padding:6px 9px;
  border-radius:7px;
  background:#f5f8fa;
  color:#607180;
  font-size:11px;
  line-height:1.4;
}
.coordinate-search-status:empty{display:none}
.coordinate-search-status[data-kind="loading"]{background:#f4f7fb;color:#465f78}
.coordinate-search-status[data-kind="ok"]{background:#eef8f2;color:#37664a}
.coordinate-search-status[data-kind="warn"]{background:#fff7e8;color:#825d19}
.coordinate-map-marker-wrap{background:transparent!important;border:0!important}
.coordinate-map-marker{
  position:relative;
  width:28px;
  height:28px;
  border-radius:50% 50% 50% 0;
  transform:rotate(-45deg);
  background:#1f6feb;
  border:3px solid #fff;
  box-shadow:0 2px 8px rgba(0,0,0,.35);
}
.coordinate-map-marker span{
  position:absolute;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#fff;
  left:7px;
  top:7px;
}

/* Coordinate picker fits the viewport without an internal vertical scrollbar */
#coordinatePickerDialog{
  height:min(820px,calc(100vh - 20px));
  max-height:calc(100vh - 20px);
  overflow:hidden;
}
#coordinatePickerDialog .pe-map-form{
  height:100%;
  box-sizing:border-box;
  overflow:hidden;
  grid-template-rows:auto minmax(260px,1fr) auto auto auto auto;
}
#coordinatePickerMap{
  height:100%;
  min-height:260px;
}
@media(max-height:760px){
  #coordinatePickerDialog .pe-map-form{gap:8px;padding:14px}
  #coordinatePickerMap{min-height:220px}
}
.pe-map-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end}
.pe-map-search-row .pe-map-name{min-width:0}
@media(max-width:620px){.pe-map-search-row{grid-template-columns:1fr}.pe-map-search-row button{width:100%}}

/* PE manual price lock */
.pe-order-kind{display:grid;justify-items:end;gap:3px;min-width:170px}
.pe-price-edit{display:flex;align-items:end;justify-content:flex-end;gap:6px;margin-top:3px}
.pe-price-edit label{display:grid;gap:2px;text-align:left}
.pe-price-edit label span{font-size:8px;color:#71808b;font-weight:800;text-transform:uppercase}
.pe-price-edit input{width:96px;height:29px;padding:4px 7px;border:1px solid #cbd5df;border-radius:7px;background:#fff;font-weight:800;text-align:right}
.pe-price-edit button{height:29px;padding:0 9px;border:1px solid #b9c8d6;border-radius:7px;background:#f5f8fa;color:#32475a;font-size:9px;font-weight:800;cursor:pointer}
.pe-price-rule{display:block;max-width:245px;text-align:right;color:#6b7b89;font-size:9px;line-height:1.25}
.pe-price-rule.manual{color:#375d47;font-weight:800}
@media(max-width:720px){.pe-order-kind{justify-items:start}.pe-price-edit{justify-content:flex-start;flex-wrap:wrap}.pe-price-rule{text-align:left}}

/* Employee schedule editor for manager/admin */
.customer-schedule-button{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.employee-schedule-toolbar{display:flex;align-items:center;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.employee-schedule-person{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.employee-schedule-person strong{font-size:16px;color:#243647}
.employee-schedule-person span{font-size:11px;color:#6e7d8a}
.employee-schedule-person em{font-style:normal;font-size:10px;font-weight:800;color:#8c5d2d;background:#fff2df;padding:4px 7px;border-radius:999px}
.employee-schedule-summary{margin-bottom:14px}
.employee-schedule-stats{display:grid;grid-template-columns:repeat(5,minmax(100px,1fr));gap:8px;margin-top:10px}
.employee-schedule-stats>div{padding:10px 12px;border:1px solid #e2e8ed;border-radius:9px;background:#f8fafb;display:grid;gap:3px}
.employee-schedule-stats span{font-size:9px;text-transform:uppercase;color:#71808d;font-weight:800}
.employee-schedule-stats strong{font-size:18px;color:#283b4d}
.employee-schedule-legend{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;font-size:10px;color:#647584}
.employee-schedule-legend span{padding:4px 7px;border-radius:999px;border:1px solid #dce4ea;background:#fff}
.employee-schedule-month{margin-bottom:14px}
.employee-calendar-weekdays,.employee-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px}
.employee-calendar-weekdays{margin:4px 0 7px}
.employee-calendar-weekdays span{text-align:center;font-size:9px;font-weight:900;color:#7c8994;text-transform:uppercase}
.employee-calendar-gap{min-height:86px}
.employee-calendar-day{position:relative;min-height:86px;padding:8px;border:1px solid #dfe6eb;border-radius:10px;background:#fff;text-align:left;cursor:pointer;display:grid;grid-template-rows:auto 1fr auto;gap:3px;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}
.employee-calendar-day:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(31,48,64,.08);border-color:#b9c8d5}
.employee-calendar-number{font-size:11px;font-weight:900;color:#526474}
.employee-calendar-day strong{align-self:center;justify-self:center;font-size:19px;color:#30465b}
.employee-calendar-day small{font-size:9px;color:#687987;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.employee-calendar-day.shift-day{background:#eef7f1;border-color:#d4e8db}
.employee-calendar-day.shift-night{background:#eef2fa;border-color:#d6dfef}
.employee-calendar-day.shift-duty{background:#f4effa;border-color:#e2d7ef}
.employee-calendar-day.shift-off{background:#f7f7f7;border-color:#e6e6e6}
.employee-calendar-day.shift-unset{background:#fffaf0;border-color:#eadfca}
.employee-calendar-day.today{outline:2px solid #607f99;outline-offset:1px}
.employee-calendar-day.has-absence{background:#fff1ee;border-color:#e9c5be}
.employee-calendar-day.manual i{position:absolute;right:7px;top:7px;width:7px;height:7px;border-radius:50%;background:#3d789f;box-shadow:0 0 0 2px #fff}
.employee-schedule-dialog{width:min(520px,calc(100vw - 28px))}
.employee-schedule-absence-warning{padding:9px 10px;border-radius:8px;background:#fff3e8;color:#81552b;font-size:11px;line-height:1.4}
.employee-absence-remove-form{padding:0 18px 18px}
.employee-absence-remove-form button{border:0;background:transparent;color:#a34c42;text-decoration:underline;font-size:10px;font-weight:800;cursor:pointer;padding:0}
@media(max-width:900px){.employee-schedule-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.employee-calendar-weekdays,.employee-calendar-grid{gap:4px}.employee-calendar-day{min-height:72px;padding:6px}.employee-calendar-day strong{font-size:16px}.employee-calendar-day small{font-size:8px}.employee-calendar-gap{min-height:72px}}
.employee-schedule-template-form{display:grid;grid-template-columns:minmax(180px,1fr) 170px 210px auto;gap:8px;align-items:end;margin:12px 0;padding:10px;border:1px solid #e0e7ec;border-radius:10px;background:#fbfcfd}
.employee-schedule-template-form label{display:grid;gap:4px}
.employee-schedule-template-form label>span{font-size:9px;font-weight:900;text-transform:uppercase;color:#71808d}
.employee-schedule-template-form select,.employee-schedule-template-form input{height:34px;border:1px solid #ccd7df;border-radius:8px;background:#fff;padding:0 9px;font-size:11px;color:#304253}
.employee-schedule-template-form>small{grid-column:1/-1;color:#758390;font-size:9px}
@media(max-width:980px){.employee-schedule-template-form{grid-template-columns:1fr 1fr}}
@media(max-width:620px){.employee-schedule-template-form{grid-template-columns:1fr}}

/* Port-E: scheduled trip without a configured route */
.row-port-e-unrouted{
  border:1px solid #e6b7b2!important;
  background:#fff8f7!important;
  box-shadow:0 5px 18px rgba(145,57,48,.08)!important;
}
.port-e-unrouted-card{
  border-color:#dfaaa4!important;
  background:linear-gradient(180deg,#fffafa 0%,#fff 32%)!important;
}
.port-e-no-route-warning{
  display:grid;
  gap:3px;
  border-left:4px solid #b84f45!important;
  background:#fff0ee!important;
  color:#7e3d37!important;
}
.port-e-no-route-warning strong{font-size:11px;color:#9b4138}
.port-e-no-route-warning span{font-size:10px;font-weight:700}
.port-e-no-route-warning small{font-size:9px;color:#8a5c57}
.port-e-route-resolution{
  margin:10px 0 12px;
  padding:11px;
  border:1px solid #e8c4bf;
  border-radius:10px;
  background:#fff9f8;
  display:grid;
  gap:9px;
}
.port-e-route-resolution-head{display:flex;justify-content:space-between;gap:10px;align-items:start}
.port-e-route-resolution-head>div{display:grid;gap:2px}
.port-e-route-resolution-head strong{font-size:11px;color:#7c3f39}
.port-e-route-resolution-head span{font-size:9px;color:#80635f;font-weight:700}
.port-e-missing-points{display:grid;gap:3px;padding:8px 9px;border-radius:8px;background:#fff1df;border:1px solid #ecd7b7}
.port-e-missing-points strong{font-size:9px;color:#8a5d20;text-transform:uppercase}
.port-e-missing-points span{font-size:9px;color:#755f45}
.port-e-existing-route-form{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:8px;align-items:end}
.port-e-existing-route-form label{display:grid;gap:4px}
.port-e-existing-route-form label>span{font-size:9px;font-weight:900;text-transform:uppercase;color:#725d59}
.port-e-existing-route-form select{height:34px;border:1px solid #d6bdb9;border-radius:8px;background:#fff;padding:0 9px;font-size:10px;color:#384b5c}
.port-e-no-compatible-route{font-size:9px;color:#8d5c55}
.port-e-unrouted-tech-block{display:grid;gap:5px;padding:10px;border-radius:9px;background:#fff0ee;border:1px solid #e6c1bc;color:#78423d}
.port-e-unrouted-tech-block strong{font-size:11px}
.port-e-unrouted-tech-block span{font-size:9px;line-height:1.45}
.port-e-unrouted-route-dialog{width:min(920px,calc(100vw - 24px));max-height:calc(100vh - 24px);overflow:auto}
.port-e-unrouted-route-form{gap:12px!important}
.port-e-new-route-summary{display:flex;gap:6px;flex-wrap:wrap}
.port-e-new-route-summary span{padding:5px 8px;border-radius:999px;background:#eef3f6;color:#506577;font-size:9px;font-weight:900}
.port-e-route-create-main{display:grid;grid-template-columns:minmax(260px,1fr) 130px;gap:8px}
.port-e-route-section-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.port-e-route-section-head>div:first-child{display:grid;gap:2px}
.port-e-route-section-head strong{font-size:11px;color:#31485c}
.port-e-route-section-head small{font-size:9px;color:#72818e}
.port-e-route-customer-points,.port-e-route-builder,.port-e-route-price-box{padding:10px;border:1px solid #dfe6eb;border-radius:10px;background:#fafcfd}
.port-e-route-person-map{display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) minmax(180px,1fr);gap:8px;align-items:end;padding:8px 0;border-top:1px solid #edf1f3}
.port-e-route-person-map:first-of-type{border-top:0}
.port-e-route-person-map>strong{font-size:10px;color:#344b5f;padding-bottom:9px}
.port-e-route-person-map label{display:grid;gap:3px}
.port-e-route-person-map label span{font-size:8px;font-weight:900;text-transform:uppercase;color:#74828e}
.port-e-route-person-map select{height:33px;border:1px solid #ccd8e0;border-radius:8px;background:#fff;padding:0 8px;font-size:10px}
.port-e-route-builder-actions{display:flex;gap:6px;flex-wrap:wrap}
.port-e-unrouted-route-points{display:grid;gap:6px}
.port-e-unrouted-point-row{display:grid;grid-template-columns:minmax(170px,1.2fr) 105px 155px minmax(210px,1.4fr) 28px;gap:6px;align-items:center}
.port-e-unrouted-point-row select,.port-e-unrouted-point-row input{height:32px;border:1px solid #ced9e1;border-radius:7px;background:#fff;padding:0 7px;font-size:9px;min-width:0}
.port-e-remove-created-point{width:28px;height:28px;border:0;border-radius:7px;background:#f7e9e7;color:#9c4d45;font-weight:900;cursor:pointer}
.port-e-generated-key{display:flex;align-items:center;gap:8px;min-width:0;margin-top:8px;padding:7px 8px;border-radius:8px;background:#edf3f6}
.port-e-generated-key span{font-size:8px;font-weight:900;text-transform:uppercase;color:#6f7e89;white-space:nowrap}
.port-e-generated-key code{font-size:9px;color:#344e63;overflow-wrap:anywhere}
.port-e-route-price-box{display:grid;gap:8px}
.port-e-route-price-box>strong{font-size:11px;color:#30495d}
.port-e-route-price-box>div{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.port-e-route-price-box label{display:grid;gap:3px}
.port-e-route-price-box label span{font-size:8px;font-weight:900;text-transform:uppercase;color:#73828e}
.port-e-route-price-box input{height:34px;border:1px solid #cbd7df;border-radius:8px;padding:0 9px;background:#fff}
.port-e-route-price-box small{font-size:9px;color:#71818e}
@media(max-width:820px){
  .port-e-existing-route-form{grid-template-columns:1fr}
  .port-e-route-create-main{grid-template-columns:1fr}
  .port-e-route-person-map{grid-template-columns:1fr}
  .port-e-route-person-map>strong{padding-bottom:0}
  .port-e-unrouted-point-row{grid-template-columns:1fr 1fr}
  .port-e-unrouted-point-row input[name="point_meeting_address"]{grid-column:1/-1}
}
@media(max-width:540px){.port-e-route-price-box>div{grid-template-columns:1fr}.port-e-unrouted-point-row{grid-template-columns:1fr}}
.port-e-point-create-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
