:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #61717c;
  --line: #d7e0e5;
  --panel: #ffffff;
  --surface: #f3f6f7;
  --sea: #0d6f84;
  --sea-dark: #075869;
  --green: #1d8b57;
  --amber: #b76b09;
  --red: #b83232;
  --violet: #6953b8;
  --shadow: 0 14px 40px rgba(18, 36, 46, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 470px) 1fr;
  background: #eef4f5;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--sea);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.login-panel h1 {
  font-size: 34px;
}

.lead {
  color: var(--muted);
  line-height: 1.5;
}

.login-art {
  min-height: 100vh;
  background:
    linear-gradient(rgba(12, 31, 40, 0.18), rgba(12, 31, 40, 0.2)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='900' viewBox='0 0 1200 900'%3E%3Crect width='1200' height='900' fill='%23c8d9df'/%3E%3Cpath d='M0 620h1200v280H0z' fill='%238fa9b2'/%3E%3Cpath d='M-60 715 1280 470' stroke='%23f5f3e6' stroke-width='78'/%3E%3Cpath d='M-40 760 1275 520' stroke='%2333444b' stroke-width='8' stroke-dasharray='58 42'/%3E%3Cpath d='M190 205h480v155H190z' fill='%23788d96'/%3E%3Cpath d='M230 245h400v76H230z' fill='%23edf6f8'/%3E%3Cpath d='M735 270h310v112H735z' fill='%235f7882'/%3E%3Cpath d='M775 305h230v42H775z' fill='%23e7f1f4'/%3E%3Cpath d='M760 575h80l30 42 155 16c22 2 28 31 8 40l-55 24-132-18-70 54h-58l38-62-108-14c-31-4-30-49 1-52z' fill='%23ffffff'/%3E%3Cpath d='M780 609h210' stroke='%23172026' stroke-width='8'/%3E%3Cpath d='M820 584l45-92h52l-20 103z' fill='%23ffffff'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.quick-login {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  color: #3f5059;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-btn {
  background: var(--sea);
  color: #fff;
}

.primary-btn:hover {
  background: var(--sea-dark);
}

.secondary-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-btn {
  background: transparent;
  color: var(--sea-dark);
}

.danger-btn {
  background: #ffe8e8;
  color: var(--red);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-tabs button,
.nav-tabs a {
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 12px;
  background: transparent;
  color: #465760;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nav-tabs button.active,
.nav-tabs a.active {
  background: #e3f2f5;
  color: var(--sea-dark);
}

.nav-tabs button.admin-tab,
.nav-tabs a.admin-tab {
  border: 2px solid #d8b100;
  background: #fff8cc;
  color: #352b00;
}

.nav-tabs button.admin-tab.active,
.nav-tabs a.admin-tab.active {
  background: #ffe45c;
  color: #241c00;
}

.page {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(28, 47, 56, 0.05);
}

.metric {
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 32px;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.operations-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.75fr);
  gap: 18px;
}

.panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.compact-head {
  margin-top: 18px;
}

.panel-head h2 {
  margin-bottom: 4px;
  font-size: 19px;
}

.panel-head p,
.muted {
  color: var(--muted);
  margin-bottom: 0;
}

.lot-switcher {
  margin-bottom: 18px;
}

.lot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.lot-tabs button {
  width: auto;
  min-height: 38px;
  padding: 8px 12px;
}

.lot-tabs button.active {
  border-color: var(--sea);
  background: #e3f5f8;
  color: var(--sea-dark);
}

.main-airport-map {
  position: relative;
  width: min(100%, 720px);
  aspect-ratio: var(--map-aspect, 1056 / 1489);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #b7c9ce;
  overflow: hidden;
  user-select: none;
}

.main-airport-map img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lot-outline {
  position: absolute;
  z-index: 3;
  min-width: 56px;
  min-height: 44px;
  border: 2px solid rgba(13, 111, 132, 0.82);
  border-radius: 8px;
  background: rgba(13, 111, 132, 0.14);
  color: #062f39;
  cursor: pointer;
  touch-action: none;
}

.lot-outline.active {
  border-color: #d8b100;
  background: rgba(255, 228, 92, 0.2);
}

.lot-outline.selected {
  outline: 3px solid rgba(105, 83, 184, 0.55);
  z-index: 4;
}

.lot-outline span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.lot-shape-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.lot-polygon {
  fill: rgba(13, 111, 132, 0.18);
  stroke: rgba(13, 111, 132, 0.88);
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  pointer-events: all;
}

.lot-polygon.active {
  fill: rgba(255, 228, 92, 0.22);
  stroke: #d8b100;
}

.lot-polygon.selected {
  fill: rgba(105, 83, 184, 0.18);
  stroke: var(--violet);
  stroke-width: 0.7;
}

.lot-label {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  width: auto;
  min-width: 54px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: 0 4px 12px rgba(23, 32, 38, 0.18);
  cursor: pointer;
  touch-action: none;
}

.lot-label.active {
  background: #fff3ad;
}

.lot-label.selected {
  outline: 3px solid rgba(105, 83, 184, 0.55);
}

.lot-point {
  position: absolute;
  z-index: 6;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 2px 8px rgba(23, 32, 38, 0.38);
  cursor: grab;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.lot-point:active {
  cursor: grabbing;
}

.polygon-field textarea {
  font-family: Consolas, "Liberation Mono", monospace;
  min-height: 128px;
  resize: vertical;
}

.service-app-launches {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.service-app-launches p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.service-launch {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.service-launch.refuel { background: #0b78c8; }
.service-launch.maintenance { background: #a76500; }
.service-launch.clean { background: #138a62; }

.service-phone {
  min-height: 100vh;
  background: #eef2f4;
  color: #132027;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.service-phone button,
.service-phone input,
.service-phone select,
.service-phone textarea {
  font: inherit;
}

.service-phone-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(18px, env(safe-area-inset-top)) 18px 18px;
  background: linear-gradient(135deg, #10212b, #193847);
  color: #fff;
  box-shadow: 0 8px 24px rgba(16, 33, 43, .22);
}

.service-phone-header h1,
.service-phone-header p { margin: 0; }
.service-phone-header h1 { font-size: clamp(24px, 6vw, 34px); line-height: 1.05; }
.service-phone-header p { margin-top: 5px; color: #bcd0da; font-size: 13px; }
.service-kicker { display: block; margin-bottom: 4px; color: #8fc5dc; font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.service-phone-header button { padding: 8px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: transparent; color: #fff; }

.service-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #d6e0e5;
  border-bottom: 1px solid #cad5da;
}

.service-summary div { display: grid; gap: 2px; padding: 14px 10px; background: #fff; text-align: center; }
.service-summary strong { color: var(--service-accent); font-size: 23px; }
.service-summary span { color: #63737b; font-size: 11px; font-weight: 700; }
.service-summary .priority strong { color: #d84135; }

.service-phone-nav {
  position: sticky;
  top: 94px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #d7e0e4;
  backdrop-filter: blur(12px);
}

.service-phone-nav button { padding: 11px 6px; border: 0; border-radius: 8px; background: transparent; color: #69777d; font-weight: 850; }
.service-phone-nav button.active { background: color-mix(in srgb, var(--service-accent) 13%, white); color: var(--service-accent); }
.service-phone-content { width: min(100%, 760px); margin: 0 auto; padding: 18px 14px 110px; }
.service-view-head { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 14px; }
.service-view-head span { color: var(--service-accent); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.service-view-head h2, .service-view-head p { margin: 0; }
.service-view-head h2 { font-size: 25px; }
.service-view-head p { max-width: 220px; color: #63737b; font-size: 12px; text-align: right; }

.service-filters { display: grid; grid-template-columns: 1fr 140px 140px; gap: 8px; margin-bottom: 14px; }
.service-filters input, .service-filters select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #c9d5da; border-radius: 9px; background: #fff; color: #132027; }
.service-order-list { display: grid; gap: 10px; }
.service-order-card { position: relative; display: grid; gap: 4px; width: 100%; padding: 16px; border: 1px solid #d3dde2; border-left: 5px solid var(--service-accent); border-radius: 12px; background: #fff; color: #132027; text-align: left; box-shadow: 0 5px 16px rgba(22, 43, 54, .08); cursor: pointer; }
.service-order-card.priority { order: -1; border-color: #ef9a91; border-left-color: #d84135; background: #fff8f7; box-shadow: 0 6px 18px rgba(216,65,53,.13); }
.service-order-card strong { font-size: 23px; letter-spacing: .02em; }
.service-order-card > span:not(.service-order-status):not(.priority-badge) { color: #50636c; font-size: 13px; }
.service-order-card small { margin-top: 5px; color: #6c7b82; }
.service-order-status { justify-self: start; padding: 4px 7px; border-radius: 999px; background: #f0f3f5; color: #66767d; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.service-order-status.in_progress { background: #fff1c9; color: #8b5b00; }
.service-order-status.completed { background: #dff4e9; color: #126545; }
.priority-badge { position: absolute; right: 13px; top: 13px; padding: 4px 7px; border-radius: 999px; background: #d84135; color: #fff; font-size: 10px; font-weight: 950; letter-spacing: .06em; }
.service-empty { padding: 28px; border: 1px dashed #bac8ce; border-radius: 12px; color: #64757c; text-align: center; }

.service-lot-tabs { display: flex; gap: 7px; margin-bottom: 10px; overflow-x: auto; }
.service-lot-tabs button { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #c9d5da; border-radius: 999px; background: #fff; color: #50636c; }
.service-lot-tabs button.active { border-color: var(--service-accent); background: var(--service-accent); color: #fff; }
.service-mobile-map { min-height: 520px; border: 2px solid #fff; box-shadow: 0 8px 24px rgba(20,42,52,.14); }
.service-map-spot, .service-map-plane { position: absolute; z-index: 3; display: grid; place-content: center; min-width: 32px; min-height: 28px; border: 1px solid rgba(32,55,64,.42); border-radius: 5px; background: rgba(255,255,255,.4); color: #203740; font-size: clamp(7px, 1.7vw, 11px); text-align: center; }
.service-map-spot span { opacity: .65; }
.service-map-plane { border: 2px solid #89979d; background: rgba(255,255,255,.86); cursor: default; }
.service-map-plane.needs-service { border-color: var(--service-accent); background: color-mix(in srgb, var(--service-accent) 20%, white); cursor: pointer; box-shadow: 0 0 0 3px color-mix(in srgb, var(--service-accent) 20%, transparent); }
.service-map-plane.priority { border-color: #d84135; background: #fff2f0; animation: servicePulse 1.4s infinite; }
.service-map-plane strong { line-height: 1; }
.service-map-plane span { margin-top: 2px; font-size: .75em; text-transform: uppercase; }
@keyframes servicePulse { 50% { box-shadow: 0 0 0 7px rgba(216,65,53,0); } }
.service-map-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 3px; color: #5d6e75; font-size: 11px; }
.service-map-legend span { display: flex; align-items: center; gap: 5px; }
.service-map-legend i { width: 10px; height: 10px; border: 2px solid #89979d; border-radius: 3px; background: #fff; }
.service-map-legend i.need { border-color: var(--service-accent); }
.service-map-legend i.priority-dot { border-color: #d84135; background: #fff2f0; }

.service-message-thread { display: grid; gap: 10px; margin-bottom: 16px; }
.service-message { width: min(88%, 560px); padding: 12px 14px; border-radius: 14px 14px 14px 3px; background: #fff; box-shadow: 0 4px 14px rgba(18,37,46,.08); }
.service-message.field { justify-self: end; border-radius: 14px 14px 3px 14px; background: color-mix(in srgb, var(--service-accent) 13%, white); }
.service-message strong, .service-message p, .service-message time { display: block; margin: 0; }
.service-message p { margin: 5px 0; line-height: 1.4; }
.service-message time { color: #75838a; font-size: 10px; }
.service-message-form { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(18,37,46,.09); }
.service-message-form label { font-weight: 850; }
.service-message-form textarea { padding: 11px; border: 1px solid #c8d4d9; border-radius: 8px; resize: vertical; }
.service-message-form button, .save-order { min-height: 46px; border: 0; border-radius: 9px; background: var(--service-accent); color: #fff; font-weight: 900; }

.service-sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(9,20,26,.55); backdrop-filter: blur(3px); }
.service-order-sheet { position: fixed; left: 50%; bottom: 0; z-index: 41; width: min(100%, 680px); max-height: 92vh; overflow-y: auto; transform: translateX(-50%); border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -16px 50px rgba(0,0,0,.25); }
.service-order-sheet header { display: flex; justify-content: space-between; padding: 20px 18px 14px; border-bottom: 1px solid #dbe3e6; }
.service-order-sheet header span { color: var(--service-accent); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.service-order-sheet header h2, .service-order-sheet header p { margin: 0; }
.service-order-sheet header h2 { font-size: 30px; }
.service-order-sheet header p { color: #64757c; }
.service-order-sheet header button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eef2f4; color: #21343d; font-size: 27px; }
.service-order-sheet form { display: grid; gap: 13px; padding: 16px 18px max(24px, env(safe-area-inset-bottom)); }
.service-order-sheet label { display: grid; gap: 6px; color: #43575f; font-size: 12px; font-weight: 800; }
.service-order-sheet input, .service-order-sheet select, .service-order-sheet textarea { width: 100%; padding: 11px; border: 1px solid #c8d4d9; border-radius: 8px; color: #132027; }
.service-order-sheet .priority-toggle { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; padding: 11px; border-radius: 8px; background: #fff4f2; color: #9e2e26; }
.service-order-sheet .priority-toggle input { width: 20px; height: 20px; }
.service-action-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.service-action-row button { min-height: 46px; border: 0; border-radius: 9px; color: #fff; font-weight: 900; }
.service-action-row .begin { background: #e79a0a; }
.service-action-row .complete { background: #168558; }
.service-action-row .manual { background: #667780; }
.service-manual-fields { display: none; grid-template-columns: 1fr 1fr; gap: 9px; padding: 12px; border-radius: 10px; background: #f0f4f6; }
.service-manual-fields.show { display: grid; }
.service-manual-fields label:first-child { grid-column: 1 / -1; }
.service-order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px; background: #f4f6f7; }
.service-order-meta span { color: #6a7980; font-size: 11px; }
.service-order-meta strong { text-transform: uppercase; }
.service-order-meta small { flex-basis: 100%; color: #6a7980; }

.dispatcher-message-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 9px; }
.dispatcher-message-grid article { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; }
.dispatcher-message-grid strong, .dispatcher-message-grid span, .dispatcher-message-grid time { display: block; }
.dispatcher-message-grid span { color: var(--sea); font-size: 11px; font-weight: 850; }
.dispatcher-message-grid p { margin: 7px 0; }
.dispatcher-message-grid time { color: var(--muted); font-size: 10px; }
.dispatcher-reply-form { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; margin-top: 12px; }
.dispatcher-reply-form select, .dispatcher-reply-form input { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }

@media (max-width: 640px) {
  .service-phone-nav { top: 99px; }
  .service-filters { grid-template-columns: 1fr 1fr; }
  .service-filters input { grid-column: 1 / -1; }
  .service-mobile-map { min-height: 430px; }
  .service-manual-fields { grid-template-columns: 1fr; }
  .service-manual-fields label:first-child { grid-column: auto; }
  .dispatcher-reply-form { grid-template-columns: 1fr; }
}

.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: var(--map-aspect, 1387 / 1134);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.72) 0 1px, transparent 1px 100%),
    linear-gradient(rgba(255,255,255,.72) 0 1px, transparent 1px 100%),
    #b7c9ce;
  background-size: 38px 38px;
  overflow: hidden;
  user-select: none;
}

.map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-wrap:not(:has(.map-bg)) {
  min-height: 520px;
  aspect-ratio: auto;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #3f5963;
  text-align: center;
  padding: 20px;
}

.runway-line {
  position: absolute;
  left: -5%;
  top: 54%;
  width: 110%;
  height: 74px;
  transform: rotate(-11deg);
  background: #3b464b;
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.16);
}

.runway-line::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 34px;
  border-top: 5px dashed #eef0df;
}

.spot {
  position: absolute;
  min-width: 36px;
  min-height: 28px;
  border: 2px solid var(--sea);
  background: rgba(13, 111, 132, 0.18);
  color: #062f39;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px;
  overflow: hidden;
  touch-action: none;
}

.spot.occupied {
  border-color: var(--red);
  background: rgba(184, 50, 50, 0.22);
}

.spot.pending {
  border-color: var(--amber);
  background: rgba(183, 107, 9, 0.24);
}

.spot.arrived {
  border-color: var(--green);
  background: rgba(29, 139, 87, 0.2);
}

.spot.selected {
  outline: 3px solid rgba(105, 83, 184, 0.6);
  cursor: move;
  overflow: visible;
  z-index: 5;
}

.spot.service-menu-open {
  overflow: visible;
  z-index: 30;
}

.spot-name {
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  word-break: break-word;
}

.spot-tail {
  font-size: 12px;
  font-weight: 800;
}

.plane-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-grid;
  min-width: 58px;
  min-height: 32px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px dashed #d87110;
  border-radius: 999px;
  background: rgba(255, 143, 31, 0.9);
  color: #351c02;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 5px 16px rgba(130, 71, 8, 0.26);
  z-index: 2;
  cursor: pointer;
}

.plane-marker::before {
  content: "✈";
  margin-right: 3px;
  font-size: 15px;
}

.plane-marker.arrival-flash {
  animation: arrivalFlash 1.2s ease-in-out infinite;
}

.plane-marker::before {
  content: "✈";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 0;
  font-size: 15px;
}

.plane-label,
.plane-cycle {
  display: inline-grid;
  min-width: 42px;
  min-height: 18px;
  place-items: center;
  padding-left: 12px;
}

.plane-cycle {
  position: relative;
}

.service-code {
  font-size: 17px;
  letter-spacing: 0;
}

.plane-marker::before {
  content: none !important;
  display: none;
}

.plane-label,
.plane-cycle {
  padding-left: 0;
}

.plane-marker.departure-flash {
  animation: departureFlash 1.2s ease-in-out infinite;
}

.plane-marker.arrived-green {
  border-color: #176f43;
  background: rgba(49, 166, 102, 0.92);
  color: #062515;
}

.plane-marker.delayed-glow {
  border-color: #b83232;
  background: rgba(218, 54, 54, 0.94);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(184, 50, 50, 0.18), 0 0 22px rgba(184, 50, 50, 0.8);
  animation: delayGlow 1.8s ease-in-out infinite;
}

.plane-marker.service-flash {
  border-color: #c01870;
  background: rgba(245, 126, 188, 0.95);
  color: #3b0320;
  box-shadow: 0 0 0 5px rgba(192, 24, 112, 0.16), 0 0 18px rgba(192, 24, 112, 0.48);
}

.map-service-menu {
  position: absolute;
  left: 50%;
  top: calc(50% + 24px);
  width: 190px;
  transform: translateX(-50%);
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #f0b3d3;
  border-radius: 8px;
  background: #fff4fa;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(47, 18, 34, 0.2);
  z-index: 20;
}

.map-service-menu strong {
  font-size: 13px;
}

.map-service-actions {
  display: grid;
  gap: 6px;
}

.map-service-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #f0b3d3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.map-service-actions button span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #f7d7e9;
  color: #7f0a45;
}

.map-service-actions button.active {
  border-color: #c01870;
  background: #ffe2f1;
}

@keyframes arrivalFlash {
  0%,
  100% {
    border-color: #d87110;
    background: rgba(255, 255, 255, 0.96);
    color: #4a2b00;
  }
  50% {
    border-color: #d87110;
    background: rgba(255, 143, 31, 0.95);
    color: #351c02;
  }
}

@keyframes departureFlash {
  0%,
  100% {
    border-color: #176f43;
    background: rgba(49, 166, 102, 0.94);
    color: #062515;
  }
  50% {
    border-color: #d87110;
    background: rgba(255, 143, 31, 0.95);
    color: #351c02;
  }
}

@keyframes delayGlow {
  0%,
  100% {
    box-shadow: 0 0 0 5px rgba(184, 50, 50, 0.16), 0 0 18px rgba(184, 50, 50, 0.65);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(184, 50, 50, 0.22), 0 0 30px rgba(184, 50, 50, 0.95);
  }
}

.resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 2px 7px rgba(23, 32, 38, 0.3);
  padding: 0;
}

.resize-handle.nw {
  left: -8px;
  top: -8px;
  cursor: nwse-resize;
}

.resize-handle.ne {
  right: -8px;
  top: -8px;
  cursor: nesw-resize;
}

.resize-handle.sw {
  left: -8px;
  bottom: -8px;
  cursor: nesw-resize;
}

.resize-handle.se {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.draw-ghost {
  position: absolute;
  border: 2px dashed var(--violet);
  background: rgba(105, 83, 184, 0.12);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.upload-row {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px dashed #9fc8d0;
  border-radius: 8px;
  background: #f7fcfd;
}

.upload-row input {
  padding: 8px;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lookup-message {
  min-height: 18px;
  font-size: 13px;
}

.divider-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.divider-panel h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cards {
  display: grid;
  gap: 10px;
}

.below-map-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.departure-import {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fcfd;
}

.departure-import textarea {
  min-height: 160px;
}

.spot-use-list {
  display: grid;
  gap: 10px;
  max-height: 760px;
  overflow-y: auto;
  padding-right: 4px;
}

.card {
  padding: 12px;
}

.inbound-panel {
  margin-bottom: 18px;
}

.date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.date-strip button {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 800;
}

.date-strip button.active {
  border-color: #aad5de;
  background: #e3f2f5;
  color: var(--sea-dark);
}

.inbound-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 10px;
  color: var(--muted);
}

.inbound-table-wrap {
  overflow-x: auto;
}

.inbound-table select {
  min-width: 150px;
}

.source-pill {
  border: 0;
}

.director-board {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
}

.director-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.director-summary div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.director-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.director-summary strong {
  font-size: 24px;
}

.director-table-block {
  display: grid;
  gap: 8px;
}

.director-table-block h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.director-raw-section {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.director-raw-section summary {
  cursor: pointer;
  font-weight: 900;
  margin-bottom: 8px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #fff;
  background: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.status-pill.incoming,
.status-pill.pending {
  background: var(--amber);
}

.status-pill.arrived,
.status-pill.occupied {
  background: var(--green);
}

.status-pill.outgoing {
  background: var(--violet);
}

.status-pill.departed {
  background: var(--muted);
}

.status-pill.late {
  background: var(--red);
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table th,
.list-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.list-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.help {
  padding: 10px 12px;
  background: #edf6f8;
  border: 1px solid #cce4ea;
  border-radius: 6px;
  color: #28434c;
  font-size: 13px;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .login-screen,
  .split,
  .operations-layout {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: 260px;
    order: -1;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .map-wrap:not(:has(.map-bg)) {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .page,
  .login-panel {
    padding: 18px;
  }

  .dashboard-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
