/* High Flyers: panel członka.
   Kierunek: granat z logo, pasek nawigacji jak kokpit, zadania jak paski lotu (flight strips),
   sygnałowy bursztyn tylko dla terminów. Wszystko w obrębie #hf-app, żeby nie ruszać motywu strony. */
#hf-app {
  --hf-navy: #10294d; --hf-navy-2: #1b3a68; --hf-on-navy: #eef3fa; --hf-on-navy-2: #a9bcd6;
  --hf-bg: #f2f5f9; --hf-surface: #ffffff; --hf-ink: #13233a; --hf-ink-2: #55657b;
  --hf-line: #d6deea; --hf-accent: #1f5fbf; --hf-accent-soft: #e4edf9; --hf-on-accent: #ffffff;
  --hf-amber: #9a5b00; --hf-amber-soft: #fbefd9; --hf-red: #b3261e; --hf-red-soft: #fbe6e4;
  --hf-green: #17693c; --hf-green-soft: #e0f2e7;
  --hf-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --hf-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--hf-bg); color: var(--hf-ink); font: 15px/1.5 var(--hf-sans);
  display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 720px; text-align: left;
  border-radius: 0; box-sizing: border-box;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #hf-app {
  --hf-navy: #0a1a33; --hf-navy-2: #16305a; --hf-bg: #0e1725; --hf-surface: #17233a; --hf-ink: #e8eef7; --hf-ink-2: #a3b2c7;
  --hf-line: #2c3c57; --hf-accent: #8ab8f5; --hf-accent-soft: #1d3355; --hf-on-accent: #0a1a33;
  --hf-amber: #f1bd6b; --hf-amber-soft: #3a2c13; --hf-red: #f2a29c; --hf-red-soft: #41201e; --hf-green: #8fd8ab; --hf-green-soft: #16321f;
  color-scheme: dark; } }
:root[data-theme="dark"] #hf-app {
  --hf-navy: #0a1a33; --hf-navy-2: #16305a; --hf-bg: #0e1725; --hf-surface: #17233a; --hf-ink: #e8eef7; --hf-ink-2: #a3b2c7;
  --hf-line: #2c3c57; --hf-accent: #8ab8f5; --hf-accent-soft: #1d3355; --hf-on-accent: #0a1a33;
  --hf-amber: #f1bd6b; --hf-amber-soft: #3a2c13; --hf-red: #f2a29c; --hf-red-soft: #41201e; --hf-green: #8fd8ab; --hf-green-soft: #16321f;
  color-scheme: dark; }
#hf-app *, #hf-app *::before, #hf-app *::after { box-sizing: border-box; }
#hf-app h1, #hf-app h2, #hf-app h3, #hf-app p, #hf-app ul, #hf-app ol { margin: 0; padding: 0; font-family: inherit; letter-spacing: 0; }
#hf-app ul, #hf-app ol { list-style: none; }
/* Motyw strony nie może narzucać koloru nagłówków (w ciemnym trybie byłyby niewidoczne) */
#hf-app h1, #hf-app h2, #hf-app h3 { color: var(--hf-ink); }
#hf-app .hf-pilot h2, #hf-app .hf-modal h2 { color: inherit; }
#hf-app .hf-modal { color: var(--hf-ink); }
#hf-app a { color: var(--hf-accent); }
#hf-app button, #hf-app input, #hf-app select, #hf-app textarea { font: inherit; color: inherit; }
#hf-app :focus-visible { outline: 2px solid var(--hf-accent); outline-offset: 2px; }

/* Nawigacja */
.hf-nav { background: var(--hf-navy); color: var(--hf-on-navy); padding: 20px 12px; display: flex; flex-direction: column; gap: 16px; }
.hf-nav img { width: 112px; height: auto; display: block; margin: 0 8px; }
.hf-nav ul { display: flex; flex-direction: column; gap: 2px; }
.hf-nav button { width: 100%; background: none; border: 0; color: var(--hf-on-navy-2); text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.hf-nav button:hover { background: var(--hf-navy-2); color: var(--hf-on-navy); }
.hf-nav button[aria-current="page"] { background: var(--hf-navy-2); color: #fff; font-weight: 600; }
.hf-nav .hf-count { font: 12px var(--hf-mono); background: #f1bd6b; color: #2c1d00; border-radius: 9px; padding: 0 6px; align-self: center; }
.hf-who { margin-top: auto; border-top: 1px solid var(--hf-navy-2); padding: 12px 8px 0; font-size: 13px; color: var(--hf-on-navy-2); display: flex; flex-direction: column; gap: 6px; }
.hf-who b { color: var(--hf-on-navy); display: block; font-size: 14px; }
.hf-who label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.hf-who select { background: var(--hf-navy-2); border: 1px solid #3c5885; border-radius: 6px; padding: 5px; color: #fff; }

/* Główna część */
.hf-main { padding: 24px clamp(16px, 3vw, 36px) 48px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hf-demo { background: var(--hf-amber-soft); color: var(--hf-amber); padding: 7px 12px; border-radius: 6px; font-size: 13px; }
.hf-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.hf-head h1 { font-size: 27px; line-height: 1.2; font-weight: 600; }
.hf-head p { color: var(--hf-ink-2); max-width: 62ch; }
.hf-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: start; }
.hf-card { background: var(--hf-surface); border: 1px solid var(--hf-line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hf-card h2 { font-size: 16px; font-weight: 600; line-height: 1.3; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.hf-card h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
.hf-sub { color: var(--hf-ink-2); font-size: 13px; }
.hf-mono { font-family: var(--hf-mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.hf-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hf-between { justify-content: space-between; }
.hf-stack { display: flex; flex-direction: column; gap: 8px; }
.hf-empty { color: var(--hf-ink-2); font-size: 14px; padding: 8px 0; }

/* Przyciski i znaczniki */
.hf-btn { background: var(--hf-surface); border: 1px solid var(--hf-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.hf-btn:hover { border-color: var(--hf-accent); color: var(--hf-accent); }
.hf-btn.hf-primary { background: var(--hf-accent); border-color: var(--hf-accent); color: var(--hf-on-accent); }
.hf-btn.hf-primary:hover { color: var(--hf-on-accent); filter: brightness(1.1); }
.hf-btn.hf-danger { color: var(--hf-red); }
.hf-btn.hf-small { padding: 2px 8px; font-size: 13px; }
.hf-tag { display: inline-block; font-size: 12px; line-height: 1.5; padding: 0 7px; border-radius: 4px; background: var(--hf-accent-soft); color: var(--hf-accent); white-space: nowrap; }
.hf-tag.hf-warn { background: var(--hf-amber-soft); color: var(--hf-amber); }
.hf-tag.hf-bad { background: var(--hf-red-soft); color: var(--hf-red); }
.hf-tag.hf-good { background: var(--hf-green-soft); color: var(--hf-green); }
.hf-tag.hf-plain { background: none; border: 1px solid var(--hf-line); color: var(--hf-ink-2); }

/* Paski zadań */
.hf-strip { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; background: var(--hf-surface); border: 1px solid var(--hf-line); border-left: 4px solid var(--hf-accent); border-radius: 4px; padding: 8px 10px; }
.hf-strip.hf-done { border-left-color: var(--hf-green); opacity: .72; }
.hf-strip.hf-late { border-left-color: var(--hf-red); }
.hf-strip.hf-child { margin-left: 22px; }
.hf-strip .hf-code { font: 12px var(--hf-mono); color: var(--hf-ink-2); }
.hf-strip select { background: var(--hf-surface); border: 1px solid var(--hf-line); border-radius: 4px; padding: 2px 4px; font-size: 13px; }
.hf-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.hf-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hf-board .hf-strip { grid-template-columns: minmax(0, 1fr); }
.hf-board .hf-strip.hf-child { margin-left: 12px; }
.hf-board .hf-strip .hf-row { justify-content: space-between; }
.hf-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--hf-ink-2); font-weight: 600; }

/* Tabele */
.hf-table-wrap { overflow-x: auto; background: var(--hf-surface); border: 1px solid var(--hf-line); border-radius: 8px; }
.hf-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0; border: 0; color: var(--hf-ink); }
.hf-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--hf-ink-2); font-weight: 600; background: none; }
.hf-table th, .hf-table td { padding: 9px 12px; border: 0; border-bottom: 1px solid var(--hf-line); vertical-align: top; }
.hf-table tr:last-child td { border-bottom: 0; }
.hf-table select { background: var(--hf-surface); border: 1px solid var(--hf-line); border-radius: 4px; padding: 3px; max-width: 150px; }

/* Karta pilota */
.hf-pilot { background: var(--hf-navy); color: var(--hf-on-navy); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.hf-pilot h2 { font-size: 21px; }
.hf-pilot .hf-sub { color: var(--hf-on-navy-2); }
.hf-dl { display: grid; grid-template-columns: minmax(90px, auto) minmax(0, 1fr); gap: 3px 14px; font-size: 14px; }
.hf-dl dt { color: var(--hf-ink-2); }
.hf-dl dd { margin: 0; }

/* Laboratorium */
.hf-lab { padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.hf-lab-ok { background: var(--hf-green-soft); color: var(--hf-green); }
.hf-lab-warn { background: var(--hf-amber-soft); color: var(--hf-amber); }

/* Filtry, grupy, opisy */
.hf-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--hf-surface); border: 1px solid var(--hf-line); border-radius: 8px; padding: 12px; }
.hf-filters .hf-field { min-width: 150px; flex: 1 1 150px; max-width: 260px; }
.hf-filters .hf-field input, .hf-filters .hf-field select { padding: 5px 8px; font-size: 14px; }
.hf-check { display: flex; gap: 6px; align-items: center; font-size: 14px; padding-bottom: 6px; white-space: nowrap; }
.hf-group { font-size: 18px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; border-bottom: 2px solid var(--hf-line); padding-bottom: 4px; }
.hf-note summary { cursor: pointer; color: var(--hf-accent); font-size: 13px; }
.hf-note p { font-size: 14px; color: var(--hf-ink-2); white-space: pre-line; margin-top: 4px; }
.hf-modal select[multiple] { min-height: 160px; }

/* Kalendarz */
.hf-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--hf-line); border-radius: 8px; overflow: hidden; background: var(--hf-line); gap: 1px; }
.hf-cal div { background: var(--hf-surface); min-height: 88px; padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12px; }
.hf-cal .hf-dow { min-height: 0; color: var(--hf-ink-2); font-weight: 600; text-align: center; }
.hf-cal .hf-off { background: var(--hf-bg); color: var(--hf-ink-2); }
.hf-cal .hf-today { box-shadow: inset 0 0 0 2px var(--hf-accent); }
.hf-cal .hf-ev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 3px; padding: 0 4px; background: var(--hf-accent-soft); color: var(--hf-accent); }
.hf-cal .hf-ev.nabor { background: var(--hf-amber-soft); color: var(--hf-amber); }
.hf-cal .hf-ev.zawody { background: var(--hf-green-soft); color: var(--hf-green); }

/* Modal */
.hf-modal-bg { position: fixed; inset: 0; background: rgba(8, 18, 34, .55); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; z-index: 99999; }
.hf-modal { background: var(--hf-surface); color: var(--hf-ink); border-radius: 10px; width: min(560px, 100%); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.hf-modal h2 { font-size: 19px; font-weight: 600; }
.hf-field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 500; }
.hf-field input, .hf-field select, .hf-field textarea { background: var(--hf-surface); border: 1px solid var(--hf-line); border-radius: 6px; padding: 7px 9px; font-weight: 400; font-size: 15px; width: 100%; }
.hf-field small { color: var(--hf-ink-2); font-weight: 400; }
.hf-toast { position: fixed; right: 20px; bottom: 20px; background: var(--hf-navy); color: #fff; padding: 9px 14px; border-radius: 6px; z-index: 100000; }
.hf-score { font: 600 22px var(--hf-mono); color: var(--hf-accent); }
.hf-meter { height: 6px; background: var(--hf-line); border-radius: 3px; overflow: hidden; }
.hf-meter i { display: block; height: 100%; background: var(--hf-accent); }

@media (max-width: 820px) {
  #hf-app { grid-template-columns: minmax(0, 1fr); }
  #hf-app .hf-grid { grid-template-columns: minmax(0, 1fr); }
  #hf-app .hf-grid > * { grid-column: auto !important; }
  .hf-nav { flex-direction: column; padding: 12px; gap: 10px; }
  .hf-nav img { width: 76px; margin: 0; }
  .hf-nav ul { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .hf-nav button { white-space: nowrap; width: auto; }
  .hf-who { margin-top: 0; }
  .hf-board { grid-template-columns: minmax(0, 1fr); }
  .hf-strip { grid-template-columns: minmax(0, 1fr); }
  .hf-strip .hf-row { justify-content: space-between; }
  .hf-strip .hf-code { display: none; }
  .hf-cal div { min-height: 56px; }
  .hf-cal .hf-ev { font-size: 10px; }
}

/* Logowanie do panelu */
.hf-login { max-width: 420px; margin: 40px auto; background: #10294d; color: #eef3fa; border-radius: 12px; padding: 28px; font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; }
.hf-login img { width: 96px; height: auto; margin-bottom: 8px; }
.hf-login h2 { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 32px; text-transform: uppercase; margin: 0 0 4px; color: #fff; }
.hf-login p { color: #a9bcd6; font-size: 15px; margin: 0 0 16px; }
.hf-login label { display: block; font-size: 14px; color: #eef3fa; margin-bottom: 4px; }
.hf-login input[type=text], .hf-login input[type=password] { width: 100%; padding: 10px 12px; border-radius: 6px; border: 1px solid #3c5885; background: #1b3a68; color: #fff; font-size: 16px; box-sizing: border-box; }
.hf-login .login-remember label { display: flex; gap: 8px; align-items: center; color: #a9bcd6; }
.hf-login input[type=submit] { width: 100%; padding: 12px; border: 0; border-radius: 6px; background: #f2b84b; color: #1c1300; font-weight: 600; font-size: 16px; cursor: pointer; }
.hf-login a { color: #f2b84b; }

.hf-discord-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px; border-radius: 6px; background: #5865f2; color: #fff !important; font-weight: 600; font-size: 16px; text-decoration: none; margin: 4px 0 16px; box-sizing: border-box; }
.hf-discord-btn:hover { background: #4752c4; }
.hf-login-pass summary { cursor: pointer; color: #a9bcd6; font-size: 14px; margin-bottom: 12px; }
.hf-login-error { background: #41201e; color: #f2a29c !important; padding: 10px 12px; border-radius: 6px; }

/* Panel na całą wysokość ekranu (bez białego pasa pod spodem) */
body.hf-panel-page { background: #f2f5f9; margin: 0; }
@media (prefers-color-scheme: dark) { body.hf-panel-page { background: #0e1725; } }
#hf-app { min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px)); min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); }
.hf-nav { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); align-self: start; height: calc(100vh - var(--wp-admin--admin-bar--height, 0px)); height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); overflow-y: auto; }
/* Logowanie na całym ekranie */
.hf-login-page { min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px)); min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); background: #0c1e3a; display: flex; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box; }
.hf-login-page .hf-login { margin: 0; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.hf-login-page .hf-login p:last-child { margin-bottom: 0; }
/* Instrukcja instalacji aplikacji */
#hf-app .hf-steps { list-style: decimal; padding-left: 20px; display: grid; gap: 4px; }
/* Telefony: iOS powiększa stronę przy polach mniejszych niż 16 px */
@media (max-width: 820px) {
  #hf-app input, #hf-app select, #hf-app textarea, .hf-login input { font-size: 16px !important; }
  .hf-nav { position: static; height: auto; overflow: visible; }
  #hf-app .hf-btn { min-height: 40px; }
  .hf-modal-bg { padding: 12px 10px calc(12px + env(safe-area-inset-bottom)); }
  .hf-toast { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
}
