/* ==========================================================================
   Circuit — Touch & Go planning for Belgian aviation schools
   Single stylesheet, no external dependencies.
   Sections: 1 tokens · 2 base · 3 layout · 4 components · 5 auth
             6 agenda · 7 dashboard · 8 overlays · 9 responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* brand */
  --brand-900: #08243f;
  --brand-800: #0d3358;
  --brand-700: #124470;
  --brand-600: #1b5c91;
  --brand-500: #2a7ab8;
  --brand-100: #dceaf6;
  --brand-050: #eef5fb;

  --accent: #e08a1e;          /* runway amber */
  --accent-soft: #fdf0dc;

  /* neutrals */
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;
  --ink: #10233a;
  --ink-2: #3d5573;
  --muted: #6b809b;
  --line: #dfe6ef;
  --line-strong: #c6d2e0;
  --grid-line: #e6ecf3;
  --grid-line-soft: #f0f4f8;

  /* status */
  --st-created-fg: #8a5a00;
  --st-created-bg: #fdf1d8;
  --st-created-bd: #eccb8a;
  --st-created-dot: #d99413;

  --st-approved-fg: #14663d;
  --st-approved-bg: #dcf3e6;
  --st-approved-bd: #9fd8ba;
  --st-approved-dot: #1c8b52;

  --st-refused-fg: #97231f;
  --st-refused-bg: #fbe2e0;
  --st-refused-bd: #eeb2ae;
  --st-refused-dot: #c8362f;

  --st-best-fg: #4c3a8e;
  --st-best-bg: #e9e6fa;
  --st-best-bd: #c0b7ea;
  --st-best-dot: #6d5bc9;

  --danger: #c8362f;
  --ok: #1c8b52;

  /* shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow-1: 0 1px 2px rgba(16, 35, 58, .06), 0 1px 3px rgba(16, 35, 58, .05);
  --shadow-2: 0 4px 12px rgba(16, 35, 58, .09), 0 1px 3px rgba(16, 35, 58, .06);
  --shadow-3: 0 18px 48px rgba(8, 36, 63, .22);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --hour-px: 54px;
}

:root[data-theme="dark"] {
  --brand-900: #04101c;
  --brand-800: #0a1e33;
  --brand-700: #143b60;
  --brand-600: #1d5585;
  --brand-500: #3d8fc9;
  --brand-100: #17334d;
  --brand-050: #12283d;

  --accent: #f0a63f;
  --accent-soft: #35291a;

  --bg: #070f18;
  --surface: #0e1a27;
  --surface-2: #122232;
  --surface-3: #17293b;
  --ink: #e6eef7;
  --ink-2: #b3c5d8;
  --muted: #7f95ad;
  --line: #1d3247;
  --line-strong: #294560;
  --grid-line: #182a3c;
  --grid-line-soft: #132334;

  --st-created-fg: #f0c274;
  --st-created-bg: #33280f;
  --st-created-bd: #6b5423;
  --st-created-dot: #e0a63a;

  --st-approved-fg: #86e0b0;
  --st-approved-bg: #10321f;
  --st-approved-bd: #24623f;
  --st-approved-dot: #3fbc7c;

  --st-refused-fg: #f4a9a3;
  --st-refused-bg: #391714;
  --st-refused-bd: #6d302b;
  --st-refused-dot: #e0574d;

  --st-best-fg: #bdb2f2;
  --st-best-bg: #221d3f;
  --st-best-bd: #443a70;
  --st-best-dot: #8a79e0;

  --danger: #e0574d;
  --ok: #3fbc7c;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, .6);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 12px; }

/* Default size for the inline icons produced by AMS.ui.icon().
   More specific rules (.btn svg, .empty svg, .icon-btn svg …) win over this. */
.ic { width: 16px; height: 16px; flex: none; }
.callout > .ic { margin-top: 1px; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--brand-100); color: var(--brand-900); }

/* --------------------------------------------------------------------------
   3. Layout & top bar
   -------------------------------------------------------------------------- */
.page { min-height: 100%; display: flex; flex-direction: column; }
.container { width: min(1440px, 100%); margin: 0 auto; padding: 0 24px; }
main { flex: 1; padding: 24px 0 56px; }

.topbar {
  background: var(--brand-900);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar .container { display: flex; align-items: center; gap: 22px; height: 58px; }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: -.02em; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(150deg, var(--brand-500), var(--brand-700));
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.brand-mark svg { width: 17px; height: 17px; fill: #fff; }
.brand-sub { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #7fa6c9; font-weight: 600; display: block; margin-top: -3px; }

.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a {
  color: #b9d0e4;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-weight: 550;
  font-size: 13.5px;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.userchip {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(150deg, var(--accent), #b96f10);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #23150a;
}
.userchip-txt { line-height: 1.1; }
.userchip-txt b { font-size: 12.5px; font-weight: 600; color: #fff; display: block; }
.userchip-txt span { font-size: 10.5px; color: #8fb3d0; }

.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06); color: #cfe0ee; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.icon-btn svg { width: 15px; height: 15px; }

.demo-strip {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--st-created-bd);
  color: var(--st-created-fg);
  font-size: 12px;
}
.demo-strip .container { display: flex; align-items: center; gap: 8px; padding-top: 6px; padding-bottom: 6px; }
.demo-strip b { font-weight: 700; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .subtitle { color: var(--muted); margin: 4px 0 0; font-size: 13.5px; }
.page-head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   4. Components
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 13.5px;
  padding: 8px 15px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { color: var(--danger); border-color: var(--st-refused-bd); background: var(--st-refused-bg); }
.btn-danger:hover { background: var(--st-refused-bd); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* form controls */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .label {
  font-size: 12px; font-weight: 650; color: var(--ink-2);
  letter-spacing: .01em;
}
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="tel"], input[type="time"], select, textarea {
  font: inherit; font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
select { appearance: none; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
textarea { min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(42, 122, 184, .18);
}
input.invalid, select.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(200, 54, 47, .14); }
.field-error { font-size: 11.5px; color: var(--danger); font-weight: 600; }

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

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; cursor: pointer; }
.check input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--brand-600); flex: none; }
.check span b { display: block; font-weight: 600; }
.check span small { color: var(--muted); }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg button {
  font: inherit; font-size: 12.5px; font-weight: 600;
  border: 0; background: transparent; color: var(--muted);
  padding: 5px 11px; border-radius: 4px; cursor: pointer;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.st-created { color: var(--st-created-fg); background: var(--st-created-bg); border-color: var(--st-created-bd); }
.pill.st-approved { color: var(--st-approved-fg); background: var(--st-approved-bg); border-color: var(--st-approved-bd); }
.pill.st-refused { color: var(--st-refused-fg); background: var(--st-refused-bg); border-color: var(--st-refused-bd); }
.pill.st-best-effort { color: var(--st-best-fg); background: var(--st-best-bg); border-color: var(--st-best-bd); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 650;
  padding: 2px 7px; border-radius: 4px;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line);
}
.tag.icao { font-family: var(--mono); letter-spacing: .04em; background: var(--brand-050); color: var(--brand-700); border-color: var(--brand-100); }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--surface-2);
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data th .arrow { opacity: .45; font-size: 9px; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }

.empty {
  padding: 42px 20px; text-align: center; color: var(--muted);
}
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 3px; }

/* toast */
.toast-host {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--brand-900); color: #fff;
  padding: 10px 16px; border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  font-size: 13.5px; font-weight: 550;
  display: flex; align-items: center; gap: 9px;
  animation: toast-in .22s ease-out;
  border: 1px solid rgba(255, 255, 255, .12);
}
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.toast.err .dot { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   5. Auth / landing page
   -------------------------------------------------------------------------- */
.auth-shell { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }

.auth-visual {
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(42, 122, 184, .40), transparent 62%),
    radial-gradient(700px 420px at 92% 108%, rgba(224, 138, 30, .22), transparent 60%),
    var(--brand-900);
  color: #fff;
  padding: 40px 48px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.auth-visual::after {
  content: "";
  position: absolute; left: -8%; right: -8%; bottom: 8%;
  height: 132px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  border-top: 1px solid rgba(255, 255, 255, .09);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  transform: rotate(-6deg);
}
.auth-visual::before {
  content: "";
  position: absolute; left: -8%; right: -8%; bottom: calc(8% + 64px);
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 44px, transparent 44px 88px);
  transform: rotate(-6deg);
  z-index: 2;
}
.auth-visual > * { position: relative; z-index: 3; }

.auth-visual .brand { margin-bottom: auto; }
.auth-hero { max-width: 470px; margin: 40px 0; }
.auth-hero h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.025em; }
.auth-hero p { color: #b9d0e4; font-size: 15px; margin-top: 14px; }

.hero-points { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 11px; }
.hero-points li { display: flex; gap: 10px; align-items: flex-start; color: #cfe0ee; font-size: 13.5px; }
.hero-points svg { width: 16px; height: 16px; fill: var(--accent); flex: none; margin-top: 2px; }

.hero-airports { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: auto; }
.hero-ap {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r-md);
  padding: 11px 12px;
}
.hero-ap b { font-family: var(--mono); font-size: 15px; letter-spacing: .05em; display: block; }
.hero-ap span { font-size: 11px; color: #9dbdd8; display: block; margin-top: 2px; line-height: 1.3; }

.auth-panel {
  background: var(--surface);
  padding: 40px 44px;
  display: flex; flex-direction: column; justify-content: center;
  overflow-y: auto;
}
.auth-box { width: min(430px, 100%); margin: 0 auto; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-3); padding: 3px; border-radius: var(--r-sm); margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; font: inherit; font-weight: 650; font-size: 13.5px;
  padding: 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer;
}
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.demo-note {
  margin-top: 18px; padding: 11px 13px;
  background: var(--brand-050); border: 1px dashed var(--brand-100);
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-2);
}
.demo-note code { font-family: var(--mono); background: var(--surface); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line); font-size: 12px; }

.form-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11.5px; margin: 18px 0; }
.form-sep::before, .form-sep::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* --------------------------------------------------------------------------
   6. Agenda
   -------------------------------------------------------------------------- */
.ap-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ap-tab {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 9px 14px 9px 11px;
  cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: border-color .12s, box-shadow .12s;
  min-width: 186px;
}
.ap-tab:hover { border-color: var(--line-strong); }
.ap-tab.active { border-color: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-600), var(--shadow-1); }
.ap-tab .code {
  font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .04em;
  background: var(--brand-050); color: var(--brand-700);
  border: 1px solid var(--brand-100);
  padding: 5px 7px; border-radius: 6px;
}
.ap-tab.active .code { background: var(--brand-700); color: #fff; border-color: var(--brand-700); }
.ap-tab .nm { font-size: 13px; font-weight: 600; line-height: 1.2; }
.ap-tab .sub { font-size: 11px; color: var(--muted); }

.agenda-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; user-select: none; }
.legend-item input { display: none; }
.legend-item .swatch { width: 11px; height: 11px; border-radius: 3px; border: 1px solid; flex: none; }
.legend-item.off { opacity: .38; }
.legend-item .swatch.st-created { background: var(--st-created-bg); border-color: var(--st-created-dot); }
.legend-item .swatch.st-approved { background: var(--st-approved-bg); border-color: var(--st-approved-dot); }
.legend-item .swatch.st-refused { background: var(--st-refused-bg); border-color: var(--st-refused-dot); }
.legend-item .swatch.st-best-effort { background: var(--st-best-bg); border-color: var(--st-best-dot); }

.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 16px; align-items: start; }

.agenda-wrap { overflow: auto; max-height: 74vh; border-radius: 0 0 var(--r-md) var(--r-md); }
.agenda {
  display: grid;
  grid-template-columns: 62px repeat(10, minmax(126px, 1fr));
  min-width: 940px;
  background: var(--surface);
}
.ag-corner {
  position: sticky; top: 0; left: 0; z-index: 6;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
}
.ag-dayhead {
  position: sticky; top: 0; z-index: 4;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line);
  padding: 7px 9px 6px;
}
.ag-dayhead.today { background: var(--brand-050); }
.ag-dayhead.weekend .dow { color: var(--accent); }
.ag-dayhead .dow { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.ag-dayhead .dnum { font-size: 15px; font-weight: 650; line-height: 1.15; }
.ag-dayhead .dnum span { font-size: 11px; font-weight: 500; color: var(--muted); }
.ag-dayhead.today .dnum { color: var(--brand-600); }
.ag-load { height: 3px; border-radius: 2px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.ag-load i { display: block; height: 100%; background: var(--brand-500); border-radius: 2px; }
.ag-load i.hot { background: var(--accent); }
.ag-load i.full { background: var(--danger); }
.ag-dayhead .cnt { font-size: 10px; color: var(--muted); margin-top: 3px; display: block; }

.ag-gutter {
  position: sticky; left: 0; z-index: 3;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  position: sticky;
}
.ag-gutter .hr {
  position: absolute; right: 7px;
  transform: translateY(-50%);
  font-size: 10.5px; font-family: var(--mono); color: var(--muted);
}

.ag-col {
  position: relative;
  border-right: 1px solid var(--line);
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-px) - 1px), var(--grid-line) calc(var(--hour-px) - 1px), var(--grid-line) var(--hour-px)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-px) / 2 - 1px), var(--grid-line-soft) calc(var(--hour-px) / 2 - 1px), var(--grid-line-soft) calc(var(--hour-px) / 2));
  cursor: copy;
}
.ag-col.today { background-color: rgba(42, 122, 184, .035); }
.ag-col.past { background-color: var(--surface-2); cursor: not-allowed; }

.ag-block {
  position: absolute;
  left: 3px; right: 3px;
  border-radius: 5px;
  border: 1px solid;
  border-left-width: 3px;
  padding: 3px 5px;
  overflow: hidden;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.25;
  box-shadow: var(--shadow-1);
  transition: transform .07s, box-shadow .12s;
}
.ag-block:hover { box-shadow: var(--shadow-2); z-index: 3; transform: translateY(-1px); }
.ag-block .bt { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: -.01em; opacity: .85; }
.ag-block .bc { font-family: var(--mono); font-weight: 700; font-size: 11.5px; letter-spacing: .02em; }
.ag-block .bs { font-size: 10px; opacity: .8; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.ag-block.mine { box-shadow: 0 0 0 1px var(--brand-600), var(--shadow-1); }
.ag-block.st-created { background: var(--st-created-bg); border-color: var(--st-created-bd); border-left-color: var(--st-created-dot); color: var(--st-created-fg); }
.ag-block.st-approved { background: var(--st-approved-bg); border-color: var(--st-approved-bd); border-left-color: var(--st-approved-dot); color: var(--st-approved-fg); }
.ag-block.st-refused { background: var(--st-refused-bg); border-color: var(--st-refused-bd); border-left-color: var(--st-refused-dot); color: var(--st-refused-fg); text-decoration: line-through; text-decoration-thickness: 1px; }
.ag-block.st-best-effort { background: var(--st-best-bg); border-color: var(--st-best-bd); border-left-color: var(--st-best-dot); color: var(--st-best-fg); }

.ag-closed {
  position: absolute; left: 0; right: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 5px, var(--grid-line) 5px 10px),
    var(--surface-2);
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
  pointer-events: none;
  overflow: hidden;
}
.ag-closed span {
  position: absolute; top: 2px; left: 4px;
  font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--surface); padding: 0 3px; border-radius: 2px;
  max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ag-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 4; pointer-events: none; }
.ag-now::before { content: ""; position: absolute; left: 0; top: -4px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }

.ap-info { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 74px; }
.info-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.info-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.info-list li:last-child { border-bottom: 0; }
.info-list .k { color: var(--muted); }
.info-list .v { font-weight: 600; text-align: right; }

.notice { display: flex; gap: 9px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.notice:last-child { border-bottom: 0; }
.notice .nb { width: 4px; border-radius: 2px; background: var(--accent); flex: none; }
.notice b { display: block; font-size: 12.5px; }
.notice p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* --------------------------------------------------------------------------
   7. Dashboard
   -------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 13px 15px; box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
.kpi.k-created::after { background: var(--st-created-dot); }
.kpi.k-approved::after { background: var(--st-approved-dot); }
.kpi.k-refused::after { background: var(--st-refused-dot); }
.kpi.k-best::after { background: var(--st-best-dot); }
.kpi.k-total::after { background: var(--brand-600); }
.kpi .n { font-size: 27px; font-weight: 680; line-height: 1.05; letter-spacing: -.02em; }
.kpi .l { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.kpi .d { font-size: 11px; color: var(--muted); margin-top: 6px; }

.next-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  background: linear-gradient(120deg, var(--brand-800), var(--brand-700) 62%, var(--brand-600));
  color: #fff; border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 18px;
  box-shadow: var(--shadow-2);
}
.next-card .cd { text-align: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r-md); padding: 10px 16px; }
.next-card .cd .d1 { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #a8c8e2; }
.next-card .cd .d2 { font-size: 26px; font-weight: 680; line-height: 1.1; }
.next-card .cd .d3 { font-size: 11.5px; color: #a8c8e2; }
.next-card h3 { font-size: 17px; }
.next-card .meta { color: #bcd6ea; font-size: 12.5px; margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.next-card .meta b { color: #fff; font-weight: 600; }
.next-card .pill { background: rgba(255, 255, 255, .14) !important; border-color: rgba(255, 255, 255, .22) !important; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 130px; font-size: 12.5px; padding: 6px 9px; }
.filters input[type="text"] { min-width: 190px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { font-size: 12.5px; }
.bar-row .bl { display: flex; justify-content: space-between; margin-bottom: 3px; }
.bar-row .bl b { font-weight: 650; }
.bar-track { height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 4px; }
.bar-track i.st-created { background: var(--st-created-dot); }
.bar-track i.st-approved { background: var(--st-approved-dot); }
.bar-track i.st-refused { background: var(--st-refused-dot); }
.bar-track i.st-best-effort { background: var(--st-best-dot); }
.bar-track i.brand { background: var(--brand-500); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.feed li:last-child { border-bottom: 0; }
.feed .fdot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
.feed .fdot.st-created { background: var(--st-created-dot); }
.feed .fdot.st-approved { background: var(--st-approved-dot); }
.feed .fdot.st-refused { background: var(--st-refused-dot); }
.feed .fdot.st-best-effort { background: var(--st-best-dot); }
.feed .ft { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* --------------------------------------------------------------------------
   8. Overlays: modal & drawer
   -------------------------------------------------------------------------- */
.scrim {
  position: fixed; inset: 0; background: rgba(8, 24, 40, .48);
  z-index: 90; backdrop-filter: blur(2px);
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: fixed; z-index: 100;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(690px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  animation: pop .16s ease-out;
  border: 1px solid var(--line);
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.modal-head, .drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 17px; }
.modal-head .sub, .drawer-head .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.modal-body, .drawer-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot, .drawer-foot {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 20px; border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.x-btn {
  margin-left: auto; width: 30px; height: 30px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer; display: grid; place-items: center; font-size: 16px; line-height: 1; flex: none;
}
.x-btn:hover { background: var(--surface-3); color: var(--ink); }

.drawer {
  position: fixed; z-index: 100; top: 0; right: 0; bottom: 0;
  width: min(460px, 100vw);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  animation: slide-in .2s ease-out;
  border-left: 1px solid var(--line);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-foot { border-radius: 0; }

.callout {
  display: flex; gap: 10px; padding: 11px 13px; border-radius: var(--r-sm);
  font-size: 12.5px; line-height: 1.45; margin-bottom: 16px;
  border: 1px solid;
}
.callout b { display: block; margin-bottom: 2px; }
.callout.st-created { background: var(--st-created-bg); border-color: var(--st-created-bd); color: var(--st-created-fg); }
.callout.st-approved { background: var(--st-approved-bg); border-color: var(--st-approved-bd); color: var(--st-approved-fg); }
.callout.st-refused { background: var(--st-refused-bg); border-color: var(--st-refused-bd); color: var(--st-refused-fg); }
.callout.st-best-effort { background: var(--st-best-bg); border-color: var(--st-best-bd); color: var(--st-best-fg); }
.callout.info { background: var(--brand-050); border-color: var(--brand-100); color: var(--ink-2); }
.callout.warn { background: var(--accent-soft); border-color: var(--st-created-bd); color: var(--st-created-fg); }

dl.kv { margin: 0; display: grid; grid-template-columns: 118px 1fr; gap: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
dl.kv dd { margin: 0; padding: 7px 0; border-bottom: 1px dashed var(--line); font-weight: 550; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong);
}
.timeline li.done::before { background: var(--brand-600); border-color: var(--brand-600); }
.timeline li.st-approved::before { background: var(--st-approved-dot); border-color: var(--st-approved-dot); }
.timeline li.st-refused::before { background: var(--st-refused-dot); border-color: var(--st-refused-dot); }
.timeline li.st-best-effort::before { background: var(--st-best-dot); border-color: var(--st-best-dot); }
.timeline b { font-size: 12.5px; }
.timeline p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }

.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--muted); margin: 20px 0 9px;
}
.section-title:first-child { margin-top: 0; }

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .agenda-layout, .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .ap-info { position: static; flex-direction: row; flex-wrap: wrap; }
  .ap-info > * { flex: 1 1 280px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { padding: 26px 22px 34px; }
  .auth-visual::before, .auth-visual::after { display: none; }
  .auth-hero { margin: 26px 0; }
  .auth-hero h1 { font-size: 29px; }
  .auth-panel { padding: 28px 22px 46px; }
  .hero-airports { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .container { padding: 0 14px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav a { padding: 7px 9px; font-size: 13px; }
  .userchip-txt { display: none; }
  .next-card { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
}

@media print {
  .topbar, .agenda-toolbar, .page-head-actions, .demo-strip { display: none; }
  body { background: #fff; }
  .agenda-wrap { max-height: none; overflow: visible; }
}
