:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #162436;
  --muted: #5d6e83;
  --faint: #8b9aac;
  --border: #dfe6ee;
  --primary: #0f5f9e;
  --primary-dark: #0a4675;
  --accent: #0b7a75;
  --soft: #e9f2fa;
  --shadow: 0 1px 2px rgba(16, 36, 56, .04), 0 10px 30px rgba(16, 36, 56, .05);
  --radius: 14px;

  --th-bg: #fafbfd;
  --row-hover: #f8fafc;
  --focus-ring: rgba(15, 95, 158, .1);
  --badge-ok-bg: #e3f5ec;
  --badge-ok-fg: #0f6e56;
  --badge-warn-bg: #fdf0d9;
  --badge-warn-fg: #8a5a12;
  --warn-accent: #c88a1a;
  --callout-bg: #e9f2fa;
  --callout-border: #cfe0ef;
  --callout-fg: #244460;
  --callout-warn-bg: #fff8ec;
  --callout-warn-border: #f0dcb4;
  --callout-warn-fg: #6d4d17;

  --chart-label: #5d6e83;
  --chart-value: #162436;
  --chart-grid: #e7edf4;
  --chart-track: #eef3f8;
  --chart-faint: #8b9aac;
  --chart-bar: #0f5f9e;
}

[data-theme="dark"] {
  --bg: #0e1622;
  --surface: #172231;
  --surface-2: #1e2d3f;
  --text: #e6eef7;
  --muted: #9fb0c4;
  --faint: #7d90a6;
  --border: #2b3a4d;
  --primary: #63b3f5;
  --primary-dark: #8cc9ff;
  --accent: #4dd0b1;
  --soft: #1b3046;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .3);

  --th-bg: #1a2838;
  --row-hover: #1c2b3b;
  --focus-ring: rgba(99, 179, 245, .22);
  --badge-ok-bg: #16382e;
  --badge-ok-fg: #6ee7b7;
  --badge-warn-bg: #3a2d14;
  --badge-warn-fg: #f0c46a;
  --warn-accent: #d4a03c;
  --callout-bg: #17293b;
  --callout-border: #2d4a63;
  --callout-fg: #bcd6ea;
  --callout-warn-bg: #332914;
  --callout-warn-border: #5c481f;
  --callout-warn-fg: #f0d59b;

  --chart-label: #9fb0c4;
  --chart-value: #e6eef7;
  --chart-grid: #2b3a4d;
  --chart-track: #1e2d3f;
  --chart-faint: #7d90a6;
  --chart-bar: #63b3f5;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.brand-text { line-height: 1.2; }
.brand-text b { display: block; font-size: 14px; font-weight: 600; }
.brand-text span { font-size: 11px; color: var(--faint); }

.nav-links { display: flex; gap: 2px; flex-wrap: wrap; }
.nav-links a {
  padding: 7px 13px; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 400;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active { background: var(--soft); color: var(--primary); font-weight: 500; }

.hero { padding: 46px 0 26px; }
.hero .eyebrow {
  display: inline-block; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary); font-weight: 600;
  background: var(--soft); padding: 4px 11px; border-radius: 20px;
}
.hero h1 { font-size: 36px; line-height: 1.25; margin: 14px 0 10px; font-weight: 650; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0; max-width: 760px; font-size: 15px; }
.hero-meta { margin-top: 14px; font-size: 12px; color: var(--faint); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0 8px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 19px 20px; box-shadow: var(--shadow);
}
.kpi .v { font-size: 29px; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kpi .sub { color: var(--faint); font-size: 11px; margin-top: 6px; }

.section { padding: 26px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section h2 { font-size: 19px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.section .desc { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.section-note { font-size: 12px; color: var(--faint); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
}
.card h3 { font-size: 15px; margin: 0 0 3px; font-weight: 600; }
.card .card-sub { color: var(--faint); font-size: 12px; margin: 0 0 16px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

.airline-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.airline-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.airline-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--bar, var(--primary));
}
.airline-card .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.airline-card .name { font-size: 15px; font-weight: 600; }
.airline-card .code { font-size: 11px; color: var(--faint); border: 1px solid var(--border); padding: 1px 7px; border-radius: 5px; }
.airline-card .en { font-size: 11px; color: var(--faint); margin-top: 1px; }
.airline-card .big { font-size: 27px; font-weight: 650; margin-top: 12px; line-height: 1.2; }
.airline-card .big small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.airline-card .meta { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.airline-card .desc { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.airline-card a { font-size: 12px; display: inline-block; margin-top: 12px; font-weight: 500; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--th-bg); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--row-hover); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--primary); }
th .arrow { color: var(--primary); margin-left: 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.dim { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; vertical-align: middle; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search {
  flex: 1; min-width: 220px; padding: 9px 13px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  font-size: 13px; font-family: inherit; color: var(--text); outline: none;
}
.search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: 6px 12px; border-radius: 20px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.count-line { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--badge-ok-bg); color: var(--badge-ok-fg); }
.badge.warn { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }
.badge.info { background: var(--soft); color: var(--primary); }

.timeline-item { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-item .when { font-weight: 600; font-size: 13px; color: var(--primary); }
.timeline-item .what { font-size: 13px; color: var(--muted); }

.evidence { border-left: 3px solid var(--border); padding: 2px 0 2px 16px; margin: 14px 0; font-size: 13px; color: var(--muted); }
.evidence.ok { border-left-color: var(--accent); }
.evidence.warn { border-left-color: var(--warn-accent); }
.evidence b { color: var(--text); font-weight: 600; }

.callout { background: var(--callout-bg); border: 1px solid var(--callout-border); border-radius: 12px; padding: 16px 18px; font-size: 13px; color: var(--callout-fg); }
.callout.warn { background: var(--callout-warn-bg); border-color: var(--callout-warn-border); color: var(--callout-warn-fg); }

.theme-toggle {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; font-family: inherit;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

.lang-toggle {
  flex-shrink: 0; min-width: 38px; height: 34px; padding: 0 9px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer;
  display: grid; place-items: center; font-family: inherit; letter-spacing: .03em;
}
.lang-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* Per-airline MRO profile cards */
.mro-profile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.mro-profile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bar, var(--primary));
}
.mro-profile .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mro-profile .who { font-size: 16px; font-weight: 600; line-height: 1.3; }
.mro-profile .who small { font-size: 11px; color: var(--faint); font-weight: 400; margin-left: 8px; }
.mro-profile .role { font-size: 12px; color: var(--primary); font-weight: 500; margin-top: 3px; }
.mro-profile .fleet-tag {
  font-size: 11px; color: var(--muted); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 9px; white-space: nowrap; flex-shrink: 0;
}
.mro-profile .rows { margin-top: 14px; display: grid; gap: 8px; }
.mro-profile .row-item { display: grid; grid-template-columns: 74px 1fr; gap: 12px; font-size: 12.5px; line-height: 1.55; }
.mro-profile .row-item .k { color: var(--faint); }
.mro-profile .row-item .v { color: var(--muted); }
.mro-profile .row-item .v b { color: var(--text); font-weight: 600; }
.mro-profile ul.mini { margin: 0; padding-left: 16px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.mro-profile ul.mini li { margin: 3px 0; }
.mro-profile .proof {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
}
.mro-profile .proof .label { font-size: 11px; color: var(--faint); margin-right: 2px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 26px 0 40px; color: var(--faint); font-size: 12px; }
.site-footer .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

ul.clean { padding-left: 18px; margin: 8px 0; }
ul.clean li { margin: 5px 0; }

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .airline-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 29px; }
  .nav { height: auto; padding: 12px 0; flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
