/* ==========================================================================
   NXTOPS FLIGHT OPERATIONS · DISPATCH DESK & BRIEFING CENTER
   Unified with Qatar Airways / LineOps Intranet UI Theme
   ========================================================================== */

.dispatch-desk {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  font-family: var(--font-graphik), 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f212b;
}

/* ─── Top Control & Status Bar ─── */
.dispatch-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #dbdee8;
  border-radius: 14px;
  padding: 14px 22px;
  box-shadow: 0 2px 10px rgba(31, 33, 43, 0.04);
}

.dispatch-top-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.dispatch-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f2f3fa;
  border: 1px solid #dbdee8;
  color: #1f212b;
  font-family: var(--font-graphik);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dispatch-btn-back:hover {
  background: #e2e5ec;
  color: #1f212b;
  border-color: #cbd2e0;
}

.dispatch-flight-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dispatch-flight-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #5c0931;
  border: 1px solid #5c0931;
  color: #ffffff;
}

.dispatch-flight-pill img {
  height: 18px;
  width: auto;
  object-fit: contain;
}

.dispatch-route-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-jotia), sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #1f212b;
}

.dispatch-route-title .arrow {
  color: #5c0931;
  font-size: 16px;
  font-weight: 700;
}

.dispatch-route-sub {
  font-family: var(--font-graphik);
  font-size: 12.5px;
  color: #5c6474;
  margin-top: 1px;
}

.dispatch-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dispatch-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-graphik);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 6px 14px;
  border-radius: 999px;
  text-transform: uppercase;
}

.dispatch-status-pill.is-pending {
  background: rgba(204, 160, 96, 0.12);
  border: 1px solid rgba(204, 160, 96, 0.35);
  color: #9b7637;
}

.dispatch-status-pill.is-released {
  background: rgba(16, 126, 84, 0.1);
  border: 1px solid rgba(16, 126, 84, 0.3);
  color: #107e54;
}

.dispatch-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* ─── Main Two-Column Operations Layout ─── */
.dispatch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 1080px) {
  .dispatch-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Left Column: Flight Deck & Briefing ─── */
.dispatch-left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dispatch-card {
  background: #ffffff;
  border: 1px solid #dbdee8;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(31, 33, 43, 0.05);
  color: #1f212b;
}

.dispatch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ebeff5;
}

.dispatch-card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-graphik);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #5c0931;
  margin: 0;
}

.dispatch-card-header h3 svg {
  color: #5c0931;
}

/* ─── Navlog & Route Map Container ─── */
.dispatch-map-wrap {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dbdee8;
  background: #0c141d;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dispatch-map-canvas {
  width: 100%;
  height: 100%;
}

.dispatch-map-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.dispatch-map-ctrl-btn {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dbdee8;
  color: #1f212b;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-graphik);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dispatch-map-ctrl-btn:hover {
  background: #ffffff;
  color: #5c0931;
  border-color: #5c0931;
}

/* ─── Weather METAR / TAF Cards ─── */
.dispatch-weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.metar-card {
  background: #f8f9fc;
  border: 1px solid #e2e5ec;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metar-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metar-airport-title {
  font-family: var(--font-graphik);
  font-weight: 700;
  font-size: 15px;
  color: #1f212b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metar-airport-role {
  font-size: 10px;
  font-family: var(--font-graphik);
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(92, 9, 49, 0.08);
  color: #5c0931;
  border: 1px solid rgba(92, 9, 49, 0.2);
}

.metar-cat-badge {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.metar-cat-badge.vfr {
  background: rgba(16, 126, 84, 0.1);
  border: 1px solid rgba(16, 126, 84, 0.35);
  color: #107e54;
}

.metar-cat-badge.mvfr {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.35);
  color: #0284c7;
}

.metar-cat-badge.ifr {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #dc2626;
}

.metar-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  background: #ffffff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ebeff5;
}

.metar-stat-col span {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #5c6474;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metar-stat-col strong {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #1f212b;
  margin-top: 3px;
}

.metar-raw-text {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #4a525d;
  background: #ffffff;
  border: 1px solid #ebeff5;
  padding: 9px 12px;
  border-radius: 8px;
  word-break: break-all;
}

/* ─── OFP Viewer Container ─── */
.dispatch-ofp-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid #ebeff5;
  padding-bottom: 8px;
}

.ofp-tab-btn {
  background: transparent;
  border: none;
  color: #5c6474;
  font-family: var(--font-graphik);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.ofp-tab-btn:hover {
  background: #f2f3fa;
  color: #1f212b;
}

.ofp-tab-btn.is-active {
  background: #5c0931;
  color: #ffffff;
  font-weight: 600;
}

.ofp-tab-pane {
  display: none;
}

.ofp-tab-pane.is-active {
  display: block;
}

.ofp-exec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.ofp-exec-item {
  background: #f8f9fc;
  border: 1px solid #e2e5ec;
  border-radius: 8px;
  padding: 12px;
}

.ofp-exec-item span {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #5c6474;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ofp-exec-item strong {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #1f212b;
  margin-top: 3px;
}

.ofp-raw-box {
  background: #f8f9fc;
  border: 1px solid #dbdee8;
  border-radius: 8px;
  padding: 14px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #1f212b;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* ─── Right Column: Aircraft, SimBrief, & Release ─── */
.dispatch-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dispatch-control-group {
  margin-bottom: 16px;
}

.dispatch-control-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #5c6474;
  margin-bottom: 6px;
  font-family: var(--font-graphik);
}

.dispatch-select,
.dispatch-input {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #dbdee8;
  border-radius: 8px;
  color: #1f212b;
  font-size: 13.5px;
  font-family: var(--font-graphik);
  transition: all 0.2s;
}

.dispatch-select:focus,
.dispatch-input:focus {
  outline: none;
  border-color: #5c0931;
  box-shadow: 0 0 0 3px rgba(92, 9, 49, 0.12);
}

.dispatch-tail-info {
  margin-top: 6px;
  font-size: 11.5px;
  color: #5c6474;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ferry-bonus-pill {
  font-family: var(--font-graphik);
  font-size: 10px;
  font-weight: 700;
  background: rgba(204, 160, 96, 0.15);
  border: 1px solid rgba(204, 160, 96, 0.4);
  color: #9b7637;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ─── SimBrief Section ─── */
.simbrief-box {
  background: #f8f9fc;
  border: 1px solid #dbdee8;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simbrief-btn-1click {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #5c0931 0%, #3e0420 100%);
  border: 1px solid #5c0931;
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font-graphik);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(92, 9, 49, 0.25);
  transition: all 0.2s;
}

.simbrief-btn-1click:hover {
  background: linear-gradient(135deg, #740c3e 0%, #4f0529 100%);
  box-shadow: 0 6px 18px rgba(92, 9, 49, 0.35);
  transform: translateY(-1px);
}

.simbrief-btn-1click:active {
  transform: translateY(0);
}

.simbrief-external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #5c0931;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.simbrief-external-link:hover {
  color: #740c3e;
  text-decoration: underline;
}

/* ─── Primary Dispatch Release Action ─── */
.dispatch-action-card {
  background: #ffffff;
  border: 1px solid #dbdee8;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(31, 33, 43, 0.06);
}

.btn-release-flight {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, #107e54 0%, #085536 100%);
  border: 1px solid #107e54;
  border-radius: 10px;
  color: #ffffff;
  font-family: var(--font-graphik);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 126, 84, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-release-flight:hover {
  background: linear-gradient(135deg, #139765 0%, #0b6c45 100%);
  box-shadow: 0 6px 20px rgba(16, 126, 84, 0.4);
  transform: translateY(-1px);
}

.btn-release-flight:active {
  transform: translateY(0);
}

.btn-release-flight.is-released {
  background: #f2f3fa;
  border-color: rgba(16, 126, 84, 0.3);
  color: #107e54;
  box-shadow: none;
}

.dispatch-release-hint {
  font-size: 11.5px;
  color: #5c6474;
  line-height: 1.5;
  margin: 0;
}

/* ─── Active Operations Banner in Schedules View ─── */
.active-ops-banner {
  background: #ffffff;
  border: 1px solid #dbdee8;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(31, 33, 43, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.active-ops-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.active-ops-leg-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-graphik);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  background: rgba(92, 9, 49, 0.08);
  border: 1px solid rgba(92, 9, 49, 0.2);
  color: #5c0931;
  padding: 4px 10px;
  border-radius: 6px;
}

.active-ops-title-group h2 {
  font-family: var(--font-jotia);
  font-size: 18px;
  font-weight: 400;
  color: #1f212b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-ops-title-group p {
  font-family: var(--font-graphik);
  font-size: 12px;
  color: #5c6474;
  margin: 4px 0 0 0;
}

.active-ops-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-dispatch-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #5c0931;
  border: 1px solid #5c0931;
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font-graphik);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(92, 9, 49, 0.25);
  transition: all 0.2s;
}

.btn-dispatch-launch:hover {
  background: #740c3e;
  box-shadow: 0 6px 18px rgba(92, 9, 49, 0.35);
  transform: translateY(-1px);
}

.btn-dispatch-launch.is-released {
  background: #107e54;
  border-color: #107e54;
  box-shadow: 0 4px 14px rgba(16, 126, 84, 0.25);
}

.btn-cancel-roster {
  background: #f2f3fa;
  border: 1px solid #dbdee8;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-graphik);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel-roster:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
}

/* ─── Post-Release Action Buttons ─── */
.dispatch-post-release-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.dispatch-btn-action {
  flex: 1 1 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  font-family: var(--font-graphik);
}

.dispatch-btn-action.is-radar {
  background: #5c0931;
  color: #ffffff;
  border: 1px solid #5c0931;
  box-shadow: 0 4px 14px rgba(92, 9, 49, 0.25);
}

.dispatch-btn-action.is-radar:hover {
  background: #740c3e;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(92, 9, 49, 0.35);
}

.dispatch-btn-action.is-mobile {
  background: #ffffff;
  color: #1f212b;
  border: 1px solid #dbdee8;
  box-shadow: 0 2px 8px rgba(31, 33, 43, 0.04);
}

.dispatch-btn-action.is-mobile:hover {
  background: #f2f3fa;
  border-color: #cbd2e0;
  transform: translateY(-1px);
}

.dispatch-btn-action.is-back {
  background: #f2f3fa;
  color: #5c6474;
  border: 1px solid #dbdee8;
}

.dispatch-btn-action.is-back:hover {
  background: #e2e5ec;
  color: #1f212b;
}

/* ─── Dispatch Pop-up Modal ─── */
.dispatch-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(31, 33, 43, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  opacity: 1;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dispatch-modal-backdrop[hidden] {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

body.dispatch-modal-open {
  overflow: hidden !important;
}

.dispatch-modal-window {
  background: #f4f6fa;
  border: 1px solid #dbdee8;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(31, 33, 43, 0.28);
  max-width: 1420px;
  width: 100%;
  height: 94vh;
  max-height: 980px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-graphik), 'Plus Jakarta Sans', sans-serif;
  color: #1f212b;
  animation: dispatchModalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dispatchModalSlideUp {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dispatch-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px;
  background: #5c0931;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.dispatch-modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dispatch-modal-badge {
  font-family: var(--font-graphik);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}

.dispatch-modal-title {
  font-size: 20px;
  font-weight: 300;
  color: #ffffff;
  margin: 0;
  font-family: var(--font-jotia), sans-serif;
  letter-spacing: 0.5px;
}

.dispatch-modal-close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dispatch-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.dispatch-modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  background: #f4f6fa;
}

.dispatch-modal-body .dispatch-desk {
  padding: 20px 24px 48px;
  max-width: 100%;
}

/* ─── Schedule Leg Dispatch Button ─── */
.qr-btn-dispatch-leg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 22px;
  font-family: var(--font-graphik);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: #5c0931;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(92, 9, 49, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-transform: uppercase;
}

.qr-btn-dispatch-leg:hover {
  background: #7a0c41;
  box-shadow: 0 6px 20px rgba(92, 9, 49, 0.6);
  transform: translateY(-1px);
}

.qr-btn-dispatch-leg.is-released {
  background: #107e54;
  box-shadow: 0 4px 14px rgba(16, 126, 84, 0.35);
}

.qr-btn-dispatch-leg.is-released:hover {
  background: #0b6c45;
  box-shadow: 0 6px 20px rgba(16, 126, 84, 0.55);
}

@media (max-width: 768px) {
  .dispatch-modal-backdrop {
    padding: 10px;
  }
  .dispatch-modal-window {
    height: 98vh;
    border-radius: 12px;
  }
  .dispatch-modal-header {
    padding: 14px 18px;
  }
  .dispatch-modal-body .dispatch-desk {
    padding: 12px 12px 32px;
  }
}
