:root {
  --app-bg: #f4f6f8;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-ink: #182230;
  --app-muted: #667085;
  --app-line: #d9e0ea;
  --app-line-soft: #edf1f5;
  --app-primary: #2457a7;
  --app-primary-dark: #17345f;
  --app-accent: #c9a24a;
  --app-success: #14795f;
  --app-warning: #b76e00;
  --app-danger: #b42318;
  --app-info: #0f766e;
  --app-shadow: 0 16px 40px rgba(24, 34, 48, .08);
  --app-shadow-lg: 0 24px 64px rgba(24, 34, 48, .16);
}

.passenger-status-cell {
  min-width: 150px;
}

.mini-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  font-size: 12px;
  color: #475569;
}

.mini-status-row > span:first-child {
  width: 44px;
  font-weight: 700;
}

.mini-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.mini-status-ok,
.mini-status-mail-ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #86efac;
}

.mini-status-mail-missing {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.mini-status-empty {
  background: #f8fafc;
}

.passenger-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.passenger-section-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.passenger-section-head,
.passenger-section-file {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.passenger-section-file {
  margin-top: 10px;
  font-size: 14px;
}

.passenger-direction-switch {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.passenger-direction-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(24, 34, 48, .05);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 88px;
  padding: 14px;
}

.passenger-direction-card.active {
  background: #eef5ff;
  border-color: #b8cdf5;
  box-shadow: inset 4px 0 0 var(--app-primary);
}

.passenger-direction-card span,
.passenger-direction-card strong,
.passenger-direction-card small {
  display: block;
  line-height: 1.25;
}

.passenger-direction-card span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.passenger-direction-card strong {
  color: var(--app-ink);
  font-size: 18px;
  margin-top: 3px;
}

.passenger-direction-card small {
  color: var(--app-muted);
  margin-top: 4px;
}

.finance-rule-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(180px, .9fr) minmax(220px, 1fr) minmax(220px, 1fr) minmax(140px, .7fr) minmax(140px, .7fr) minmax(150px, .7fr);
  gap: 10px;
  align-items: end;
}

.finance-rule-action {
  align-self: end;
}

.finance-scope-options {
  display: grid;
  gap: 7px;
}

.finance-scope-option {
  cursor: pointer;
  display: block;
  margin: 0;
}

.finance-scope-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.finance-scope-option span {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  display: block;
  min-height: 46px;
  padding: 8px 10px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.finance-scope-option strong,
.finance-scope-option small {
  display: block;
  line-height: 1.25;
}

.finance-scope-option strong {
  color: #26364c;
  font-size: 13px;
}

.finance-scope-option small {
  color: var(--app-muted);
  font-size: 11px;
  margin-top: 2px;
}

.finance-scope-option input:checked + span {
  background: #eef5ff;
  border-color: var(--app-primary);
  box-shadow: inset 4px 0 0 var(--app-primary);
}

.finance-auto-cell small {
  color: #64748b;
  line-height: 1.35;
}

.filter-foot {
  color: var(--app-muted);
  font-size: 13px;
  margin-top: 10px;
}

.finance-tabs {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(24, 34, 48, .05);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 8px;
}

.finance-tab {
  border: 1px solid transparent;
  border-radius: 7px;
  color: #34445a;
  display: block;
  min-height: 64px;
  padding: 12px 14px;
  text-decoration: none;
}

.finance-tab:hover {
  background: #f8fafc;
  color: var(--app-primary);
}

.finance-tab.active {
  background: #eef5ff;
  border-color: #b8cdf5;
  box-shadow: inset 4px 0 0 var(--app-primary);
  color: #17345f;
}

.finance-tab strong,
.finance-tab small {
  display: block;
  line-height: 1.25;
}

.finance-tab strong {
  font-size: 15px;
  font-weight: 900;
}

.finance-tab small {
  color: var(--app-muted);
  font-size: 12px;
  margin-top: 4px;
}

.finance-price-filter {
  border-top: 1px solid var(--app-line-soft);
  padding-top: 14px;
}

@media (max-width: 768px) {
  .passenger-section-grid {
    grid-template-columns: 1fr;
  }

  .passenger-direction-switch {
    grid-template-columns: 1fr;
  }

  .finance-rule-form {
    grid-template-columns: 1fr;
  }

  .finance-tabs {
    grid-template-columns: 1fr;
  }
}

* {
  letter-spacing: 0;
}

body {
  background:
    linear-gradient(180deg, #eef2f7 0, var(--app-bg) 210px);
  color: var(--app-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--app-primary);
}

.app-navbar {
  background:
    linear-gradient(135deg, #0d1728 0%, #17345f 54%, #0f766e 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 14px 34px rgba(20, 32, 52, .2);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-navbar-inner {
  align-items: center;
  display: flex;
  gap: 16px;
  min-height: 74px;
  padding: 12px 24px;
}

.app-brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
  min-width: 230px;
  text-decoration: none;
}

.app-brand:hover {
  color: #fff;
}

.app-brand-logo {
  display: block;
  height: 44px;
  max-width: 218px;
  object-fit: contain;
  width: auto;
}

.app-brand-text,
.app-brand-text small {
  display: block;
  line-height: 1.12;
}

.app-brand-text small {
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 750;
  margin-top: 1px;
  text-transform: uppercase;
}

.app-nav-links {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 5px;
  backdrop-filter: blur(14px);
}

.app-nav-link {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, .82);
  display: inline-flex;
  font-weight: 750;
  gap: 6px;
  min-height: 36px;
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.app-nav-link:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.app-nav-link.active {
  background: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
  color: #142238;
}

.app-nav-menu,
.app-user-menu {
  position: relative;
}

.app-nav-menu summary,
.app-user-menu summary {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, .82);
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  gap: 7px;
  list-style: none;
  min-height: 36px;
  padding: 8px 12px;
  user-select: none;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.app-nav-menu summary::-webkit-details-marker,
.app-user-menu summary::-webkit-details-marker {
  display: none;
}

.app-nav-menu summary::after,
.app-user-menu summary::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  content: "";
  height: 0;
  opacity: .8;
  width: 0;
}

.app-nav-menu:hover summary,
.app-nav-menu[open] summary,
.app-nav-menu.active summary,
.app-user-menu:hover summary,
.app-user-menu[open] summary {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.app-nav-menu.active summary {
  background: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
  color: #142238;
}

.app-nav-menu-panel,
.app-user-menu-panel {
  background: #fff;
  border: 1px solid rgba(20, 32, 52, .12);
  border-radius: 8px;
  box-shadow: 0 20px 44px rgba(20, 32, 52, .2);
  display: grid;
  gap: 3px;
  min-width: 220px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
}

.app-nav-menu-panel {
  left: 0;
  right: auto;
}

.app-nav-menu[open] .app-nav-menu-panel,
.app-user-menu[open] .app-user-menu-panel {
  animation: menu-pop .14s ease-out;
}

@keyframes menu-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-nav-menu-panel a,
.app-user-menu-panel a,
.app-user-menu-panel button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #26364c;
  display: block;
  font-size: 13px;
  font-weight: 750;
  padding: 9px 10px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.app-nav-menu-panel a:hover,
.app-user-menu-panel a:hover,
.app-user-menu-panel button:hover {
  background: #f2f5f8;
  color: var(--app-primary);
}

.nav-badge {
  align-items: center;
  background: #e94b5b;
  border: 2px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-width: 22px;
  padding: 4px 6px;
}

.app-top-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.app-season-form {
  align-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  display: inline-flex;
  gap: 7px;
  min-height: 38px;
  padding: 5px 8px 5px 12px;
}

.app-season-form label {
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 850;
  margin: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-season-form select {
  appearance: none;
  background: rgba(255, 255, 255, .95);
  border: 0;
  border-radius: 999px;
  color: #142238;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  max-width: 180px;
  min-height: 28px;
  padding: 4px 26px 4px 10px;
}

.app-notify-pill {
  align-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-height: 38px;
  padding: 8px 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease;
}

.app-notify-pill:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.app-user-card {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  min-width: 92px;
  padding: 8px 10px;
}

.app-user-name,
.app-user-role {
  display: block;
  line-height: 1.1;
}

.app-user-name {
  font-weight: 850;
}

.app-user-role {
  color: rgba(255, 255, 255, .68);
  font-size: 12px;
  margin-top: 3px;
}

.app-logout {
  background: #fff;
  border: 1px solid #fff;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
  color: #142238;
  font-weight: 850;
  min-height: 38px;
  padding: 8px 13px;
  white-space: nowrap;
}

.app-logout:hover {
  background: #f2f5f8;
}

.app-shell {
  max-width: 1840px;
  padding: 26px 26px 42px;
}

.app-alerts {
  margin-bottom: 16px;
}

.alert {
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(24, 34, 48, .05);
}

.page-header {
  align-items: flex-start;
  border-bottom: 1px solid rgba(24, 34, 48, .08);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.page-kicker {
  color: var(--app-primary);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.page-title {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
}

.page-subtitle {
  color: var(--app-muted);
  margin: 6px 0 0;
  max-width: 850px;
}

.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.btn {
  border-radius: 7px;
  font-weight: 650;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-primary:hover {
  background: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
}

.btn-success {
  background: var(--app-success);
  border-color: var(--app-success);
}

.btn-outline-success {
  border-color: var(--app-success);
  color: var(--app-success);
}

.btn-outline-primary {
  border-color: #9bb5de;
  color: var(--app-primary);
}

.btn-outline-secondary {
  border-color: #c8d0db;
  color: #465568;
}

.form-control,
.form-select {
  border-color: #ccd5e1;
  border-radius: 7px;
  min-height: 40px;
}

.form-control:focus,
.form-select:focus {
  border-color: #7ba1d6;
  box-shadow: 0 0 0 .2rem rgba(36, 87, 167, .14);
}

.form-label {
  color: #435164;
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 5px;
}

.filter-bar,
.finance-rules,
.passenger-preview,
.passenger-add,
.passenger-edit-table,
.message-panel,
.message-compose,
.message-reply,
.conversation-thread,
.schedule-aircraft,
.schedule-empty,
.data-card {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(24, 34, 48, .06);
}

.filter-bar,
.finance-rules,
.passenger-preview,
.passenger-add,
.passenger-edit-table,
.message-compose,
.message-reply,
.conversation-thread,
.data-card {
  padding: 14px;
}

.login-wrap {
  display: grid;
  min-height: calc(100vh - 128px);
  place-items: center;
}

.login-card {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: var(--app-shadow-lg);
  max-width: 480px;
  padding: 30px;
  width: 100%;
}

.login-logo-panel {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(13, 23, 40, .98) 0%, rgba(23, 52, 95, .96) 58%, rgba(15, 118, 110, .96) 100%);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  min-height: 106px;
  padding: 18px;
}

.login-logo-panel img {
  display: block;
  max-height: 56px;
  max-width: 280px;
  object-fit: contain;
  width: 100%;
}

.login-card h1 {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 6px;
}

.login-card p {
  color: var(--app-muted);
  margin-bottom: 20px;
}

.login-card form p,
.upload-card p {
  margin-bottom: 14px;
}

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

.login-field {
  display: grid;
  gap: 5px;
}

.login-card label,
.upload-card label {
  color: #435164;
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 5px;
}

.login-card input,
.upload-card input,
.upload-card select {
  border: 1px solid #ccd5e1;
  border-radius: 7px;
  display: block;
  padding: 8px 10px;
  width: 100%;
}

.filter-bar {
  margin-bottom: 18px;
}

.multi-select {
  min-height: 96px;
}

.message-compose .multi-select {
  min-height: 220px;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-grid.metric-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card,
.finance-summary {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(24, 34, 48, .055);
  min-height: 86px;
  padding: 14px;
  position: relative;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.metric-card:hover,
.finance-summary:hover {
  border-color: #c8d6e8;
  box-shadow: 0 16px 36px rgba(24, 34, 48, .09);
  transform: translateY(-1px);
}

.metric-card::before,
.finance-summary::before {
  background: var(--app-primary);
  border-radius: 8px 0 0 8px;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 4px;
}

.metric-card.success::before,
.finance-summary.success::before {
  background: var(--app-success);
}

.metric-card.warning::before,
.finance-summary.warning::before {
  background: var(--app-warning);
}

.metric-card.danger::before,
.finance-summary.danger::before {
  background: var(--app-danger);
}

.metric-card.info::before,
.finance-summary.info::before {
  background: var(--app-info);
}

.metric-card span,
.finance-summary span {
  color: var(--app-muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
}

.metric-card strong,
.finance-summary strong {
  color: var(--app-ink);
  display: block;
  font-size: 24px;
  line-height: 1.1;
  margin-top: 7px;
}

.metric-card small,
.finance-summary small {
  color: var(--app-muted);
  display: block;
  margin-top: 6px;
}

.table-wrap {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.table-wrap .table-responsive,
.data-card > .table-responsive {
  max-height: 66vh;
  overflow: auto;
}

.table {
  --bs-table-bg: transparent;
  color: var(--app-ink);
  margin-bottom: 0;
}

.table thead th {
  background: #f2f5f8;
  border-bottom: 1px solid var(--app-line);
  color: #4b596b;
  font-size: 12px;
  font-weight: 800;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  vertical-align: middle;
  white-space: nowrap;
  z-index: 2;
}

.table td {
  border-color: var(--app-line-soft);
  line-height: 1.35;
  vertical-align: middle;
}

.table tbody tr:nth-child(even) > * {
  background-color: rgba(248, 250, 252, .55);
}

.table-hover > tbody > tr:hover > * {
  background: #f8fbff;
}

.table > tbody > tr.flight-row-changed > * {
  background: #fff6dd;
}

.table-hover > tbody > tr.flight-row-changed:hover > * {
  background: #ffefbd;
}

.badge {
  border-radius: 999px;
  font-weight: 750;
  padding: .42em .7em;
}

.text-bg-primary {
  background-color: var(--app-primary) !important;
}

.text-bg-success {
  background-color: var(--app-success) !important;
}

.text-bg-warning {
  background-color: #f6c453 !important;
  color: #3d2b00 !important;
}

.text-bg-danger {
  background-color: var(--app-danger) !important;
}

.text-bg-info {
  background-color: #c7ece8 !important;
  color: #0d4f49 !important;
}

.text-bg-secondary {
  background-color: #667085 !important;
}

.change-history-card {
  background: #fffaf0;
  border: 1px solid #f5c76a;
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.change-history-head,
.change-history-item {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.change-history-head {
  background: #fff3cd;
  border-bottom: 1px solid #f5c76a;
  padding: 14px 16px;
}

.change-history-head small {
  color: #7a4b00;
  display: block;
  margin-top: 2px;
}

.change-history-list {
  display: grid;
}

.change-history-item {
  border-bottom: 1px solid #f7ddb0;
  padding: 13px 16px;
}

.change-history-item:last-child {
  border-bottom: 0;
}

.change-history-item.is-new {
  background: #fff7df;
}

.change-history-item p {
  color: #3d2b00;
  margin: 6px 0 0;
}

.change-history-item small {
  color: #8a6100;
  white-space: nowrap;
}

.flight-code-cell strong,
.finance-flight strong {
  color: #111827;
  font-size: 15px;
}

.agency-cell small,
.route-cell small,
.capacity-cell small,
.finance-cell small,
.schedule-aircraft-head small,
.schedule-event small {
  color: var(--app-muted);
}

.route-block {
  display: grid;
  gap: 2px;
}

.route-block strong {
  font-weight: 750;
}

.capacity-cell {
  min-width: 120px;
}

.empty-state,
.finance-empty,
.message-empty {
  background: #fbfcfe;
  border: 1px dashed #ccd5e1;
  border-radius: 8px;
  color: var(--app-muted);
  padding: 22px;
  text-align: center;
}

.empty-state strong,
.message-empty strong {
  color: var(--app-ink);
  display: block;
  margin-bottom: 4px;
}

.finance-table-wrap {
  border: 1px solid var(--app-line);
  border-radius: 8px;
}

.finance-table th,
.finance-table td {
  white-space: nowrap;
}

.money-input {
  min-width: 110px;
}

.finance-note-input {
  min-width: 220px;
}

.note-inline-form textarea {
  min-width: 220px;
  resize: vertical;
}

.inline-edit-details {
  position: relative;
}

.inline-edit-details summary {
  list-style: none;
}

.inline-edit-details summary::-webkit-details-marker {
  display: none;
}

.inline-edit-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: var(--app-shadow-lg);
  min-width: 280px;
  padding: 12px;
  position: absolute;
  right: 0;
  text-align: left;
  top: 36px;
  z-index: 20;
}

.inline-edit-panel label {
  color: var(--app-muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-top: 8px;
}

.finance-ledger {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  overflow-x: auto;
}

.finance-ledger-head,
.finance-ledger-row {
  display: grid;
  grid-template-columns: 110px 170px 120px 145px 145px 120px 125px 125px 100px 150px 90px 230px;
  min-width: 1730px;
}

.finance-ledger-head {
  background: #f2f5f8;
  border-bottom: 1px solid var(--app-line);
  color: #4b596b;
  font-size: 12px;
  font-weight: 800;
  padding: 10px 12px;
  text-transform: uppercase;
}

.finance-ledger-row {
  border-bottom: 1px solid var(--app-line-soft);
  padding: 11px 12px;
}

.finance-row-attention {
  background: #fff7df;
  box-shadow: inset 4px 0 0 #f6c453;
}

.finance-row-attention .finance-flight strong {
  color: #7a4b00;
}

.finance-change-alert {
  border-color: #f5c76a;
}

.finance-ledger-item {
  border-bottom: 1px solid var(--app-line-soft);
}

.finance-ledger-item:last-child {
  border-bottom: 0;
}

.finance-ledger-item .finance-ledger-row {
  border-bottom: 0;
}

.finance-cell {
  align-self: center;
  min-width: 0;
  padding-right: 10px;
}

.finance-amount strong {
  font-size: 15px;
}

.finance-action {
  text-align: right;
}

.finance-mobile-label {
  display: none;
}

.finance-pagination,
.list-pagination {
  align-items: center;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  color: var(--app-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 14px;
}

.finance-pagination span:first-child,
.list-pagination span:first-child {
  font-weight: 750;
}

.finance-pagination-actions,
.list-pagination-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.finance-page-chip,
.list-page-chip {
  background: #eef4fb;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  color: var(--app-ink);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
}

.finance-savebar {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
  position: sticky;
  bottom: 12px;
}

.static-field,
.static-field-sm {
  background: #f8fafc;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  color: var(--app-ink);
  font-weight: 750;
  min-height: 38px;
  padding: 7px 10px;
}

.static-field-sm {
  font-size: 12px;
  min-height: 31px;
  padding: 5px 8px;
}

.finance-customer-panel {
  background: #fbfcfe;
  border-top: 1px dashed var(--app-line);
  min-width: 1730px;
  padding: 12px;
}

.finance-customer-summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.finance-customer-summary small {
  color: var(--app-muted);
  display: block;
  margin-top: 3px;
}

.finance-customer-grid {
  display: grid;
  gap: 6px;
}

.finance-customer-head,
.finance-customer-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 170px 160px 145px 120px 125px 125px 100px 135px minmax(180px, 1fr) 80px 70px;
}

.finance-customer-head {
  color: #4b596b;
  font-size: 11px;
  font-weight: 850;
  padding: 0 2px;
  text-transform: uppercase;
}

.finance-customer-row {
  background: #fff;
  border: 1px solid var(--app-line-soft);
  border-radius: 8px;
  padding: 8px;
}

.finance-customer-add {
  background: #f6fbff;
  border-color: #d9e7ff;
}

.finance-customer-amount {
  text-align: right;
}

.finance-customer-empty {
  background: #fff;
  border: 1px dashed var(--app-line);
  border-radius: 8px;
  color: var(--app-muted);
  padding: 10px 12px;
}

.flight-finance-panel {
  padding: 16px;
}

.flight-finance-breakdown {
  background: #fbfcfe;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  overflow-x: auto;
  padding: 12px;
}

.flight-finance-panel .finance-customer-grid {
  min-width: 1470px;
}

.passenger-mini {
  min-width: 64px;
}

.passenger-edit-table {
  overflow-x: auto;
}

.passenger-edit-table input {
  min-width: 110px;
}

.flight-leg-card {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(24, 34, 48, .05);
  height: 100%;
  padding: 16px;
}

.flight-leg-card h5 {
  color: #4b596b;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.flight-leg-card strong {
  font-size: 20px;
}

.password-card {
  max-width: 620px;
  padding: 18px;
}

.password-result-card,
.agency-password-toolbar {
  padding: 16px;
}

.password-code {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #9a3412;
  display: inline-block;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .02em;
  padding: 6px 8px;
}

.schedule-board {
  display: grid;
  gap: 14px;
}

.schedule-aircraft {
  overflow: hidden;
}

.schedule-aircraft-head {
  align-items: center;
  background: #f2f5f8;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  justify-content: space-between;
  padding: 13px 15px;
}

.schedule-events {
  display: grid;
}

.schedule-event {
  align-items: center;
  border-bottom: 1px solid var(--app-line-soft);
  display: grid;
  gap: 12px;
  grid-template-columns: 34px 150px 150px 90px minmax(180px, 1fr) 100px 120px 78px;
  padding: 12px 15px;
}

.schedule-event:last-child {
  border-bottom: 0;
}

.schedule-event-ferry {
  background: #f8fafc;
}

.schedule-date,
.schedule-route {
  display: block;
  font-size: 12px;
}

.schedule-date {
  color: var(--app-muted);
}

.schedule-route {
  color: var(--app-ink);
  font-weight: 800;
}

.message-panel {
  overflow: hidden;
}

.message-panel-head {
  background: #f2f5f8;
  border-bottom: 1px solid var(--app-line);
  padding: 13px 15px;
}

.message-list,
.meeting-list {
  display: grid;
}

.message-list-item {
  align-items: center;
  border-bottom: 1px solid var(--app-line-soft);
  color: inherit;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 15px;
  text-decoration: none;
}

.message-list-item:hover {
  background: #f8fbff;
}

.message-list-item:last-child,
.meeting-list-item:last-child {
  border-bottom: 0;
}

.meeting-list-item {
  border-bottom: 1px solid var(--app-line-soft);
  padding: 14px 15px;
}

.conversation-thread {
  display: grid;
  gap: 12px;
}

.conversation-message {
  background: #f8fafc;
  border: 1px solid var(--app-line-soft);
  border-radius: 8px;
  max-width: 760px;
  padding: 11px 13px;
}

.conversation-message-own {
  background: #edf6ff;
  justify-self: end;
}

.conversation-message-meta {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
  margin-bottom: 6px;
}

.conversation-message-body {
  white-space: normal;
}

.support-handoff-card {
  align-items: center;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.09), rgba(15, 118, 110, 0.09));
  border: 1px solid rgba(13, 110, 253, 0.2);
  border-radius: 10px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 16px;
}

.support-handoff-card p {
  color: var(--app-muted);
}

.live-support-widget {
  bottom: 22px;
  position: fixed;
  right: 22px;
  z-index: 80;
}

.live-support-widget summary {
  align-items: center;
  background: #0f766e;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-weight: 800;
  gap: 9px;
  list-style: none;
  padding: 12px 16px;
}

.live-support-widget summary::-webkit-details-marker {
  display: none;
}

.live-support-pulse {
  background: #22c55e;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.18);
  height: 13px;
  width: 13px;
}

.live-support-panel {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  bottom: 58px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  padding: 16px;
  position: absolute;
  right: 0;
  width: min(370px, calc(100vw - 32px));
}

.live-support-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.live-support-head span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
}

.live-support-panel p {
  color: var(--app-muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.live-support-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.live-support-quick button {
  background: #f8fafc;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  color: var(--app-ink);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.live-support-quick button:hover {
  background: #eaf3ff;
  border-color: rgba(13, 110, 253, 0.28);
}

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

.live-support-actions .btn {
  flex: 1 1 0;
}

@media (max-width: 1199px) {
  .app-navbar-inner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .app-brand {
    min-width: 190px;
  }

  .app-brand-logo {
    height: 38px;
    max-width: 185px;
  }

  .app-nav-links {
    justify-content: flex-start;
    order: 3;
    width: 100%;
  }

  .app-nav-menu-panel {
    left: auto;
    right: 0;
  }

  .app-top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
  }

  .metric-grid,
  .metric-grid.metric-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .app-shell {
    padding: 18px 14px 32px;
  }

  .page-header {
    display: grid;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .finance-ledger {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow-x: visible;
  }

  .finance-ledger-head {
    display: none;
  }

  .finance-ledger-row {
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 12px;
    min-width: 0;
    padding: 12px;
  }

  .finance-ledger-item {
    border-bottom: 0;
    margin-bottom: 14px;
  }

  .finance-cell {
    padding-right: 0;
  }

  .finance-mobile-label {
    color: var(--app-muted);
    display: block;
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 3px;
  }

  .finance-note-input {
    min-width: 0;
  }

  .finance-action {
    grid-column: 1 / -1;
    text-align: right;
  }

  .finance-pagination,
  .list-pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .finance-pagination-actions,
  .list-pagination-actions {
    justify-content: space-between;
  }

  .finance-customer-panel {
    border: 1px solid var(--app-line);
    border-radius: 8px;
    margin-top: -6px;
    min-width: 0;
  }

  .finance-customer-head {
    display: none;
  }

  .finance-customer-row {
    grid-template-columns: 1fr 1fr;
  }

  .flight-finance-breakdown {
    overflow-x: visible;
  }

  .flight-finance-panel .finance-customer-grid {
    min-width: 0;
  }

  .schedule-event {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 575px) {
  .app-navbar-inner,
  .app-top-actions,
  .app-nav-links {
    width: 100%;
  }

  .app-top-actions {
    justify-content: space-between;
  }

  .app-notify-pill,
  .app-season-form,
  .app-user-menu,
  .app-user-menu summary {
    flex: 1 1 auto;
    justify-content: center;
  }

  .app-season-form select {
    max-width: 160px;
  }

  .app-user-menu-panel {
    left: 0;
    right: auto;
  }

  .app-user-card {
    border-left: 0;
    flex: 1 1 100%;
    padding-left: 0;
  }

  .metric-grid,
  .metric-grid.metric-grid-5,
  .finance-ledger-row,
  .finance-customer-row,
  .schedule-event {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 22px;
  }

  .message-list-item {
    align-items: flex-start;
    display: grid;
  }

  .support-handoff-card,
  .live-support-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .live-support-widget {
    bottom: 14px;
    right: 14px;
  }

  .live-support-panel {
    right: -4px;
    width: calc(100vw - 28px);
  }
}
