:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel2: #f8fafc;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --green-bg: #f0fdf4;
  --amber-bg: #fffbeb;
  --red-bg: #fef2f2;
  --blue-bg: #eff6ff;
  --sidebar: #0f172a;
  --sidebar-text: #cbd5e1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.sidebar a:hover, .ac-actions a:hover, .wk-nav a:hover { text-decoration: none; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; background: var(--sidebar);
  padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-size: 17px; font-weight: 700; letter-spacing: -.01em; padding: 0 8px; }
.brand svg { width: 21px; height: 21px; color: #60a5fa; }
.brand-sub { color: #475569; font-size: 11px; margin: 4px 0 22px 38px; letter-spacing: .02em; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.sidebar nav a {
  color: var(--sidebar-text); padding: 8px 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 11px;
}
.sidebar nav a svg { width: 17px; height: 17px; opacity: .75; flex: 0 0 auto; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: var(--blue); color: #fff; }
.sidebar nav a.active svg { opacity: 1; }
.sidebar-foot { margin-top: auto; color: #475569; font-size: 11px; padding: 12px 10px 0; border-top: 1px solid #1e293b; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.bell { position: relative; color: var(--muted); display: flex; }
.bell svg { width: 19px; height: 19px; }
.bell:hover { color: var(--text); }
.bell-count {
  position: absolute; top: -7px; right: -9px; background: var(--red); color: #fff;
  font-size: 10px; border-radius: 9px; padding: 0 5px; font-weight: 700; line-height: 15px;
}
.role-label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }

select, input, textarea, button {
  background: var(--panel); color: var(--text); border: 1px solid #cbd5e1;
  border-radius: 7px; padding: 7px 10px; font-size: 13.5px; font-family: inherit;
}
select:focus, input:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--blue); }
button { cursor: pointer; font-weight: 550; color: #334155; background: var(--panel); }
button:hover { background: var(--panel2); }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: var(--blue-dark); }
button.danger { background: transparent; border-color: #fca5a5; color: var(--red); }
button.danger:hover { background: var(--red-bg); }
button.small, .btn-small { padding: 4px 11px; font-size: 12.5px; border-radius: 6px; }

.content { padding: 26px 28px 64px; max-width: 1360px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card h2 { font-size: 14.5px; font-weight: 650; margin-bottom: 14px; letter-spacing: -.01em; }
.card h3 { font-size: 13px; margin: 10px 0 6px; }

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.tile .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-top: 2px; }
.tile.green .num { color: var(--green); }
.tile.amber .num { color: var(--amber); }
.tile.red .num { color: var(--red); }
.tile.blue .num { color: var(--blue); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ready { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.badge.due { background: var(--amber-bg); color: var(--amber); border: 1px solid #fde68a; }
.badge.grounded { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.badge.neutral { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.badge.blue { background: var(--blue-bg); color: var(--blue); border: 1px solid #bfdbfe; }

.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.ac-card .tail { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.ac-card .model { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.ac-head { display: flex; justify-content: space-between; align-items: flex-start; }
.reasons { color: var(--muted); font-size: 13px; margin: 8px 0; min-height: 40px; }
.fuelbar { background: #e2e8f0; border-radius: 5px; height: 8px; overflow: hidden; margin: 6px 0 4px; }
.fuelbar > div { height: 100%; background: var(--blue); border-radius: 5px; }
.fuelbar.low > div { background: var(--red); }
.meta-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.ac-actions { display: flex; gap: 8px; margin-top: 14px; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tile .num, .evt-time, .notif .ts { font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef2f6; font-size: 13.5px; vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
tr:last-child td { border-bottom: none; }

.progress { background: #e2e8f0; height: 8px; border-radius: 5px; overflow: hidden; }
.progress > div { height: 100%; background: var(--green); border-radius: 5px; }
.progress.blue > div { background: var(--blue); }

.check-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 13px 16px; border: 1px solid var(--line);
  border-radius: 9px; margin-bottom: 8px; background: var(--panel); cursor: pointer; box-shadow: var(--shadow);
}
.check-item:hover { border-color: #cbd5e1; }
.check-item.done { opacity: .5; background: var(--panel2); }
.check-item input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); flex: 0 0 auto; margin-top: 1px; }
.check-item .ci-title { font-weight: 600; font-size: 14px; }
.check-item .ci-detail { color: var(--muted); font-size: 12.5px; }
.flag-btn { margin-left: auto; flex: 0 0 auto; }
.section-h { margin: 22px 0 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }

.tabbar { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 7px 15px; border: 1px solid #cbd5e1; border-radius: 8px; background: var(--panel);
  color: #334155; font-size: 13px; font-weight: 600;
}
.tab:hover { background: var(--panel2); text-decoration: none; }
.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.action-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 4px; border-bottom: 1px solid #eef2f6;
}
.action-row:last-child { border-bottom: none; }
.action-row .badge { flex: 0 0 auto; }

.wk-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.cal-day { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px; min-height: 220px; box-shadow: var(--shadow); }
.cal-day.today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.cal-day h4 { font-size: 11px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.cal-day.today h4 { color: var(--blue); }
.evt { border-left: 3px solid var(--blue); background: var(--panel2); border: 1px solid #eef2f6; border-left-width: 3px; border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; }
.evt .evt-time { font-weight: 650; }
.evt .evt-sub { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.error-banner { background: var(--red-bg); border: 1px solid #fecaca; border-left: 3px solid var(--red); color: var(--red);
  border-radius: 8px; padding: 11px 15px; margin-bottom: 16px; font-weight: 550; font-size: 13.5px; }
.warn-banner { background: var(--amber-bg); border: 1px solid #fde68a; border-left: 3px solid var(--amber); color: var(--amber);
  border-radius: 8px; padding: 11px 15px; margin-bottom: 16px; font-weight: 550; font-size: 13.5px; }
.ok-banner { background: var(--green-bg); border: 1px solid #bbf7d0; border-left: 3px solid var(--green); color: var(--green);
  border-radius: 8px; padding: 11px 15px; margin-bottom: 16px; font-weight: 550; font-size: 13.5px; }

.checks { padding: 0; }
.checks li { list-style: none; padding: 3px 0; font-size: 13px; }
.checks li::before { display: inline-block; width: 18px; font-weight: 700; }
.checks .pass::before { content: "✓"; color: var(--green); }
.checks .fail::before { content: "✕"; color: var(--red); }
.checks .detail { color: var(--muted); }

form.inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
form.inline label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.chat { display: flex; flex-direction: column; height: 60vh; }
.chat-log { flex: 1; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 75%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; font-size: 13.5px; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 10px; margin-top: 14px; }
.chat-input input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 5px 13px;
  font-size: 12.5px; cursor: pointer; color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }

.svgmap { width: 100%; background: #0f172a; border: 1px solid var(--line); border-radius: 9px; }
.route-label { font-weight: 700; font-size: 13px; }
#routemap { z-index: 0; }
.notif { padding: 10px 4px; border-bottom: 1px solid #eef2f6; display: flex; gap: 14px; align-items: baseline; }
.notif:last-child { border-bottom: none; }
.notif .ts { color: var(--muted); font-size: 12px; flex: 0 0 128px; font-variant-numeric: tabular-nums; }
details.mini summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 550; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
