/* Komponenty wspólne: kropki statusu, pigułki, panele, KPI, zdarzenia, tabele, hero, stany puste, toasty */

/* Logotyp */
.nf-brand { display: flex; align-items: center; gap: .6rem; color: var(--nf-ink); text-decoration: none; }
.nf-brand:hover { color: var(--nf-ink); text-decoration: none; }
.nf-logo-mark { width: 36px; height: 36px; flex: none; }
.nf-wordmark { font-weight: 800; font-size: 1.2rem; letter-spacing: -.025em; line-height: 1.1; }
.nf-wordmark > span { color: var(--nf-accent); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-moving { background: var(--nf-moving); }
.dot-idle { background: var(--nf-idle); }
.dot-parked { background: var(--nf-accent); }
.dot-off { background: var(--nf-off); }
.dot-alarm { background: var(--nf-alarm); }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.pill-moving { background: color-mix(in srgb, var(--nf-moving) 13%, transparent); color: var(--nf-moving); }
.pill-idle { background: color-mix(in srgb, var(--nf-idle) 14%, transparent); color: var(--nf-idle); }
.pill-parked { background: var(--nf-accent-soft); color: var(--nf-accent); }
.pill-off { background: color-mix(in srgb, var(--nf-off) 18%, transparent); color: var(--nf-muted); }

.signal { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; vertical-align: middle; }
.signal span { width: 3px; background: var(--nf-line); border-radius: 1px; }
.signal span:nth-child(1) { height: 4px; } .signal span:nth-child(2) { height: 6px; } .signal span:nth-child(3) { height: 8px; }
.signal span:nth-child(4) { height: 10px; } .signal span:nth-child(5) { height: 12px; }
.signal span.on { background: var(--nf-ink); }

/* Panele */
.nf-panel { border: 1px solid var(--nf-line); border-radius: 12px; background: var(--nf-bg); overflow: hidden; }
.nf-panel-head { display: flex; align-items: center; gap: .75rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--nf-line); flex-wrap: wrap; }
.nf-panel-head h2 { font-size: .95rem; font-weight: 700; margin: 0; }
.nf-panel-head .ms-auto { display: flex; gap: .5rem; flex-wrap: wrap; }
.nf-panel-body { padding: 1.1rem; }

/* KPI */
.nf-kpi { border: 1px solid var(--nf-line); border-radius: 12px; padding: 1rem 1.1rem; background: var(--nf-bg); height: 100%; }
.nf-kpi-label { font-size: .75rem; color: var(--nf-muted); font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.nf-kpi-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: .25rem; }
.nf-kpi-value small { font-size: .9rem; color: var(--nf-muted); font-weight: 500; }
.nf-kpi-sub { font-size: .75rem; color: var(--nf-muted); }

/* Zdarzenia */
.nf-event { display: flex; gap: .75rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--nf-line); }
.nf-event:last-child { border-bottom: 0; }
.nf-event-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ev-crit { background: color-mix(in srgb, var(--nf-alarm) 12%, transparent); color: var(--nf-alarm); }
.ev-warn { background: color-mix(in srgb, var(--nf-idle) 14%, transparent); color: var(--nf-idle); }
.ev-info { background: var(--nf-accent-soft); color: var(--nf-accent); }
.nf-event-body { min-width: 0; flex: 1; }
.nf-event-title { font-weight: 600; }
.nf-event-meta { font-size: .76rem; color: var(--nf-muted); }

/* Tabele */
.nf-table { margin: 0; --bs-table-bg: transparent; --bs-table-color: var(--nf-ink); font-size: .84rem; }
.nf-table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--nf-muted); font-weight: 600; background: var(--nf-surface); white-space: nowrap; border-bottom-color: var(--nf-line); }
.nf-table td { vertical-align: middle; white-space: nowrap; border-bottom-color: var(--nf-line); }

/* Hero pulpitu */
.nf-hero {
  position: relative; overflow: hidden; border-radius: 16px; border: 1px solid var(--nf-line);
  background: linear-gradient(105deg, var(--nf-accent-soft) 0%, var(--nf-bg) 70%);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: center; gap: 1rem;
  padding: 1.75rem 2rem; margin-bottom: 1.5rem;
}
.nf-hero-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--nf-accent); display: flex; align-items: center; gap: .45rem; }
.nf-hero h1 { font-size: clamp(1.45rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: -.025em; margin: .4rem 0 .5rem; text-wrap: balance; }
.nf-hero p { color: var(--nf-muted); max-width: 52ch; margin-bottom: 1.1rem; }
.nf-hero p strong { color: var(--nf-ink); }
.nf-hero-meter { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--nf-line); max-width: 420px; margin-bottom: .5rem; }
.nf-hero-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .76rem; color: var(--nf-muted); margin-bottom: 1.25rem; }
.nf-hero-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.nf-hero-art { width: 100%; height: auto; display: block; }
.nf-hero-art .road { fill: none; stroke: var(--nf-line); stroke-width: 10; stroke-linecap: round; }
.nf-hero-art .route { fill: none; stroke: var(--nf-accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 8; animation: nfRoute 1.6s linear infinite; }
.nf-hero-art .grid { stroke: var(--nf-line); stroke-width: 1; }
.nf-hero-art .ping { fill: var(--nf-accent); opacity: .25; transform-origin: 318px 46px; animation: nfPing 2s ease-out infinite; }
@keyframes nfRoute { to { stroke-dashoffset: -20; } }
@keyframes nfPing { from { transform: scale(.6); opacity: .45; } to { transform: scale(2.2); opacity: 0; } }
@media (max-width: 767.98px) { .nf-hero { grid-template-columns: 1fr; padding: 1.25rem; } .nf-hero-art { max-width: 360px; } }

/* Stan pusty / strona w budowie */
.nf-empty { text-align: center; padding: 3rem 1.5rem; max-width: 520px; margin-inline: auto; }
.nf-empty-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--nf-accent-soft); color: var(--nf-accent); font-size: 1.5rem; }
.nf-empty h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: .4rem; }
.nf-empty p { color: var(--nf-muted); }

/* Toasty */
.nf-toasts { position: fixed; right: 1rem; bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem); z-index: 1100; display: flex; flex-direction: column; gap: .5rem; }
.nf-toasts .toast { --bs-toast-bg: var(--nf-ink); --bs-toast-color: var(--nf-bg); --bs-toast-border-width: 0; }
.nf-toasts .toast-error { --bs-toast-bg: var(--nf-alarm); --bs-toast-color: #fff; }

/* Pole hasła z przyciskiem pokaż/ukryj */
.nf-pass { position: relative; }
.nf-pass .form-control { padding-right: 2.8rem; }
.nf-pass button { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--nf-muted); padding: .35rem .5rem; border-radius: 6px; }
.nf-pass button:hover { color: var(--nf-ink); }

/* Formularze w panelach */
.nf-form { max-width: 560px; }
.nf-form .helptext, .nf-form .form-text { color: var(--nf-muted); font-size: .76rem; }
