:root {
  --ink: #17212f;
  --muted: #667085;
  --line: #dce3ea;
  --panel: rgba(255, 255, 255, 0.92);
  --soft: #f5f8fb;
  --blue: #1f5f8b;
  --teal: #168078;
  --amber: #b8822f;
  --rose: #a14b5f;
  --shadow: 0 18px 48px rgba(26, 42, 58, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #edf2f6;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(245, 248, 251, 0.98) 0%, rgba(245, 248, 251, 0.86) 44%, rgba(245, 248, 251, 0.35) 100%),
    url("assets/aviation-ops-hero.png") center / cover no-repeat fixed;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 18px 34px;
  border-bottom: 1px solid rgba(220, 227, 234, 0.86);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 95, 139, 0.24);
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue);
}

.brand h1 {
  font-size: 16px;
  line-height: 1.1;
  margin: 0;
  font-weight: 720;
}

.brand p,
.micro {
  color: var(--muted);
  margin: 3px 0 0;
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  grid-column: 2;
}

.nav a,
.button,
button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  min-height: 36px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.nav a.active,
.button.primary,
button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.user-menu {
  position: relative;
  grid-column: 3;
  justify-self: end;
}

.avatar-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  border-color: rgba(31, 95, 139, 0.22);
  background: #fff;
  color: var(--blue);
  font-weight: 760;
}

.avatar-button span {
  display: grid;
  place-items: center;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  display: none;
  z-index: 30;
}

.user-menu.open .user-dropdown {
  display: block;
}

.user-dropdown button {
  width: 100%;
  text-align: left;
  border-color: transparent;
  background: transparent;
}

.user-dropdown button:hover {
  background: var(--soft);
}

.icon {
  width: 17px;
  height: 17px;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 7px;
}

.main {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: end;
  padding: 34px 0 26px;
}

.intro h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1;
  max-width: 880px;
  letter-spacing: 0;
}

.intro p {
  max-width: 780px;
  margin: 14px 0 0;
  color: #4f5f70;
  line-height: 1.6;
  font-size: 15px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

body[data-page="statistics"] .hero-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  border: 1px solid rgba(220, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 22px;
  margin-bottom: 3px;
}

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

.index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.entry {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  border: 1px solid rgba(220, 227, 234, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.entry h3 {
  margin: 0;
  font-size: 24px;
}

.entry p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.entry-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.login-layout {
  min-height: calc(100vh - 75px);
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(260px, 1fr);
  gap: 54px;
  align-items: center;
}

.single-login {
  grid-template-columns: minmax(320px, 560px);
  justify-content: center;
}

.login-card {
  border: 1px solid rgba(220, 227, 234, 0.96);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 30px;
}

.login-card h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 8px;
}

.login-card .sub {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 24px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}

.field label {
  font-size: 13px;
  color: #354356;
  font-weight: 680;
}

.login-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #b7791f;
  font-size: 13px;
  font-weight: 680;
}

.cn-note {
  display: block;
  margin-top: 3px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 560;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(22, 128, 120, 0.18);
  border-color: var(--teal);
}

.date-picker-input {
  cursor: pointer;
}

.date-picker-panel {
  position: absolute;
  z-index: 80;
  width: 292px;
  padding: 12px;
  border: 1px solid #d7e0e8;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(15, 32, 51, 0.18);
}

.date-picker-head,
.date-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.date-picker-head strong {
  font-size: 15px;
  color: var(--ink);
}

.date-picker-head button,
.date-picker-foot button {
  min-height: 34px;
  border: 1px solid #d7e0e8;
  background: #fff;
  color: var(--ink);
  font-weight: 720;
  box-shadow: none;
}

.date-picker-foot button {
  border-color: transparent;
  color: var(--teal);
}

.date-weekdays,
.date-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-weekdays {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-align: center;
  text-transform: uppercase;
}

.date-days {
  margin-top: 8px;
}

.date-day {
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-weight: 650;
  box-shadow: none;
}

.date-day.muted {
  color: #8d99a8;
}

.date-day.today {
  border-color: #9ecfca;
}

.date-day.selected {
  background: var(--teal);
  color: #fff;
}

.date-picker-foot {
  margin-top: 10px;
}

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

.ticket {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  padding: 22px;
  box-shadow: var(--shadow);
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px dashed #c9d5df;
}

.ticket-row:last-child {
  border-bottom: 0;
}

.ticket small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-bottom: 5px;
}

.ticket strong {
  font-size: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.panel {
  border: 1px solid rgba(220, 227, 234, 0.96);
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px;
  position: sticky;
  top: 96px;
}

.top-filter-grid {
  grid-template-columns: 1fr;
}

.top-filter-grid .sidebar {
  position: static;
}

.top-filter-grid .filters {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: end;
}

.sidebar h3,
.panel h3 {
  margin: 0;
  font-size: 16px;
}

.filters {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.filter-label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 0;
}

.filter-actions button {
  width: 100%;
  min-height: 44px;
}

.content {
  display: grid;
  gap: 18px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.segmented button {
  min-height: 32px;
  padding: 6px 10px;
}

.segmented button.active {
  background: #e7f3f1;
  color: #0b6d66;
  border-color: rgba(22, 128, 120, 0.28);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 18px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

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

.summary-card strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.pagination-info {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

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

.pagination-actions button {
  min-height: 34px;
  padding: 6px 12px;
}

.pagination-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

table {
  width: 100%;
  min-width: 1520px;
  border-collapse: collapse;
  background: #fff;
}

.stat-table {
  min-width: 0;
  table-layout: fixed;
}

.order-table {
  min-width: 0;
  table-layout: fixed;
}

.order-table th {
  white-space: normal;
}

.order-table td,
.order-table th {
  overflow-wrap: anywhere;
}

.order-table th:nth-child(1),
.order-table td:nth-child(1) {
  width: 7%;
}

.order-table th:nth-child(2),
.order-table td:nth-child(2) {
  width: 11%;
}

.order-table th:nth-child(3),
.order-table td:nth-child(3) {
  width: 20%;
}

.order-table th:nth-child(4),
.order-table td:nth-child(4) {
  width: 14%;
}

.order-table th:nth-child(5),
.order-table td:nth-child(5) {
  width: 16%;
}

.order-table th:nth-child(6),
.order-table td:nth-child(6) {
  width: 16%;
}

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

.stat-table th {
  white-space: normal;
}

.stat-table td,
.stat-table th {
  overflow-wrap: anywhere;
}

th,
td {
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  font-size: 12px;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  background: #f7fafc;
  color: #344256;
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fbfdff;
}

.strong-cell {
  font-weight: 720;
  color: #0f2538;
}

.money-value {
  display: inline-block;
  font-weight: 720;
  white-space: nowrap;
}

.stack {
  display: grid;
  gap: 4px;
}

.route-line,
.money-line,
.passenger-line {
  padding-bottom: 5px;
  border-bottom: 1px dashed #e3eaf0;
  white-space: nowrap;
}

.flight-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: baseline;
}

.flight-no {
  font-weight: 760;
  color: #102033;
}

.flight-route {
  color: #344256;
}

.flight-time {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.order-table .route-line,
.order-table .money-line,
.order-table .passenger-line {
  white-space: normal;
}

.route-line:last-child,
.money-line:last-child,
.passenger-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7f1f6;
  color: #18577c;
  font-weight: 760;
  font-size: 12px;
}

.positive {
  color: var(--teal);
  font-weight: 760;
}

.warning {
  color: var(--amber);
  font-weight: 760;
}

.negative {
  color: var(--rose);
  font-weight: 760;
}

.footnote {
  padding: 12px 18px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .intro,
  .login-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .top-filter-grid .filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    min-width: 0;
  }

  .sidebar {
    position: static;
  }

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

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 16px;
  }

  .brand {
    grid-column: 1;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    width: 100%;
  }

  .user-menu {
    grid-column: 2;
    grid-row: 1;
  }

  .main {
    width: min(100% - 28px, 1480px);
    padding-top: 18px;
  }

  .index-grid,
  .hero-metrics,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 22px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
