/* ===== Wnętrze aplikacji w stylu strony powitalnej: menu z teczką szybowca, nagłówek, podsumowanie ===== */

/* ---------- Menu po lewej ---------- */
.sidebar { padding: 20px 14px 14px; }
.sb-logo { display: block; padding: 2px 10px 16px; font-size: 25px; font-weight: 700; letter-spacing: -.015em; color: var(--primary); text-decoration: none; }
.sb-logo:hover { text-decoration: none; }
.nav-label { margin: 20px 12px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav { gap: 2px; }
.nav a { padding: 9px 12px; border-radius: 9px; font-weight: 500; color: var(--text); }
.nav a .icon { color: var(--muted); }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.active .icon { color: var(--primary); }
.sidebar-foot { gap: 8px; }
.sb-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Przełącznik szybowca */
.gsw { position: relative; }
.gsw-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; transition: border-color .15s, background .15s;
}
.gsw-btn:hover { border-color: var(--border-strong); background: var(--surface); }
.gsw-btn > .icon { color: var(--muted); }
.gsw-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(145deg, #3b7be0, var(--primary)); box-shadow: 0 6px 14px rgba(18, 85, 198, .25); }
.gsw-ic .icon { width: 22px; height: 22px; }
.gsw-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.gsw-txt b { font-size: 15.5px; font-weight: 650; }
.gsw-txt small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsw-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70; max-height: 65vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.gsw-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14.5px; }
.gsw-menu a:hover, .gsw-menu a.on { background: var(--surface-3); text-decoration: none; }
.gsw-menu a .icon { color: var(--muted); }
.gsw-reg { font-weight: 600; }
.gsw-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.gsw-type { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gsw-label { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gsw-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.gsw-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.gsw-dot.lvl-soon { background: var(--warn); }
.gsw-dot.lvl-overdue { background: var(--danger); }
.gsw.compact .gsw-btn { width: auto; padding: 6px 10px 6px 12px; border-radius: 999px; gap: 6px; }
.gsw.compact .gsw-txt b { font-size: 14px; }
.gsw.compact .gsw-menu { left: auto; right: 0; width: min(300px, calc(100vw - 24px)); }

/* ---------- Teczka: nagłówek ---------- */
.teczka { max-width: 1240px; }
.tz-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 24px;
  background: linear-gradient(105deg, var(--surface) 55%, color-mix(in srgb, var(--primary) 7%, var(--surface)));
}
.tz-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tz-avatar { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(145deg, #3b7be0, var(--primary)); box-shadow: 0 10px 22px rgba(18, 85, 198, .25); }
.tz-avatar .icon { width: 32px; height: 32px; stroke-width: 1.7; }
.tz-names { min-width: 0; }
.tz-kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tz-reg { font-size: 30px; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tz-cn { font-size: 14px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 2px 9px; border-radius: 7px; letter-spacing: 0; }
.tz-type { color: var(--muted); font-size: 15.5px; margin-top: 2px; }
.tz-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.tz-chips, .tz-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.tz-state { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--neutral-soft); color: var(--neutral); }
.tz-state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tz-state.lvl-ok { background: var(--ok-soft); color: var(--ok); }
.tz-state.lvl-soon { background: var(--warn-soft); color: var(--warn); }
.tz-state.lvl-overdue { background: var(--danger-soft); color: var(--danger); }
.tz-note { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: var(--primary); background: var(--primary-soft); }
.tz-tabs { display: none; }
.tz-tabs + .card, .tz-tabs + .tz-overview > .kpis { margin-top: 18px; }

/* ---------- Teczka: podsumowanie ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi {
  position: relative; overflow: hidden; display: block; padding: 16px 18px 16px 20px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.kpi:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border); }
.kpi.lvl-ok::before { background: var(--ok); }
.kpi.lvl-soon::before { background: var(--warn); }
.kpi.lvl-overdue::before { background: var(--danger); }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.kpi.lvl-ok .kpi-ic { background: var(--ok-soft); color: var(--ok); }
.kpi.lvl-soon .kpi-ic { background: var(--warn-soft); color: var(--warn); }
.kpi.lvl-overdue .kpi-ic { background: var(--danger-soft); color: var(--danger); }
.kpi-k { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-v { margin-top: 12px; font-size: 22px; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-s { margin-top: 3px; font-size: 13px; color: var(--muted); }

.tz-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tz-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tz-col > .card + .card { margin-top: 0; }
.tz-panel { overflow: hidden; }
.tz-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 10px; }
.tz-panel-head h2 { font-size: 16.5px; font-weight: 600; }
.tz-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 500; }
.tz-link .icon { width: 16px; height: 16px; }
.tz-empty { padding: 2px 18px 18px; color: var(--muted); font-size: 14px; }
.tz-more { padding: 0 18px 14px; font-size: 13.5px; }
.tz-foot { padding: 11px 18px 13px; border-top: 1px solid var(--border); }
.tz-ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-line; }

.dl-list { list-style: none; margin: 0; padding: 0 8px 8px; }
.dl-list a { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.dl-list a:hover { background: var(--surface-2); text-decoration: none; }
.dl-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--neutral); }
.dl-ic.lvl-ok { background: var(--ok-soft); color: var(--ok); }
.dl-ic.lvl-soon { background: var(--warn-soft); color: var(--warn); }
.dl-ic.lvl-overdue { background: var(--danger-soft); color: var(--danger); }
.dl-main { display: flex; flex-direction: column; min-width: 0; }
.dl-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.dl-rem { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.tz-flights { width: 100%; }
.tz-flights th:first-child, .tz-flights td:first-child { padding-left: 18px; }
.tz-flights th:last-child, .tz-flights td:last-child { padding-right: 18px; }
.tz-flights td.tz-ell { max-width: 160px; }

.tz-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; padding: 2px 18px 18px; }
.tz-data dt { font-size: 12.5px; color: var(--muted); }
.tz-data dd { margin: 2px 0 0; font-weight: 400; overflow-wrap: anywhere; }
.tz-data .wide { grid-column: 1 / -1; }

.tz-docs { list-style: none; margin: 0; padding: 0 8px 8px; }
.tz-docs a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.tz-docs a:hover { background: var(--surface-2); text-decoration: none; }
.tz-docs .doc-icon { width: 32px; height: 32px; font-size: 9px; }

.tz-people { list-style: none; margin: 0; padding: 0 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.tz-people li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tz-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Telefon ---------- */
@media (max-width: 860px) {
  .topbar .sb-logo { padding: 0; font-size: 21px; }
  .topbar .spacer { flex: 1; }
  .tz-head { padding: 16px; flex-direction: column; align-items: stretch; gap: 14px; }
  .tz-avatar { width: 48px; height: 48px; border-radius: 14px; }
  .tz-avatar .icon { width: 26px; height: 26px; }
  .tz-reg { font-size: 24px; }
  .tz-side { align-items: stretch; }
  .tz-chips, .tz-actions { justify-content: flex-start; }
  .tz-actions .btn, .tz-actions .tz-note { flex: 1; justify-content: center; }
  .tz-tabs {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 12px -16px 0; padding: 6px 16px;
    position: sticky; top: 53px; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  }
  .tz-tabs::-webkit-scrollbar { display: none; }
  .tz-tabs a {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 500;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
  }
  .tz-tabs a .icon { width: 16px; height: 16px; color: var(--muted); }
  .tz-tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
  .tz-tabs a.on .icon { color: #fff; }
  .tz-tabs .count { height: 18px; min-width: 18px; font-size: 10.5px; }
  .tz-tabs + .card, .tz-tabs + .tz-overview > .kpis { margin-top: 12px; }
  .kpis { gap: 10px; margin-bottom: 12px; }
  .kpi { padding: 12px 12px 12px 15px; }
  .kpi-ic { width: 28px; height: 28px; border-radius: 8px; }
  .kpi-ic .icon { width: 16px; height: 16px; }
  .kpi-k { font-size: 12px; line-height: 1.25; }
  .kpi-v { margin-top: 8px; font-size: 18px; }
  .kpi-s { font-size: 12px; }
  .tz-cols, .tz-col { gap: 12px; }
  .tz-data { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dl-right .badge { height: 22px; font-size: 11.5px; }
  .tz-flights .tz-pilot, .tz-flights .tz-wd { display: none; }
  .tz-flights th:last-child, .tz-flights td:last-child { padding-right: 12px; }
}
