:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #080c13;
  --surface: #101722;
  --line: rgba(255, 255, 255, .09);
  --text: #f4f7fb;
  --muted: #8f9bab;
  --accent: #79f2c0;
  --danger: #ff8f8f;
}
* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body {
  background: radial-gradient(circle at 75% 10%, rgba(40,123,98,.18), transparent 32rem), var(--bg);
  color: var(--text);
}
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 16.5rem 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 1.5rem 1.1rem;
  border-right: 1px solid var(--line); background: rgba(8,12,19,.82);
  backdrop-filter: blur(18px); display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; padding: .4rem; }
.brand-mark {
  width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  border: 1px solid rgba(121,242,192,.45); border-radius: .8rem;
  color: var(--accent); background: rgba(121,242,192,.08); font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: .15rem; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
nav { display: grid; gap: .35rem; margin-top: 2.5rem; }
nav a {
  display: flex; align-items: center; gap: .75rem; padding: .8rem .85rem;
  border-radius: .75rem; color: var(--muted); text-decoration: none;
}
nav a:hover, nav a.active { color: var(--text); background: rgba(255,255,255,.055); }
nav a.active { box-shadow: inset 2px 0 var(--accent); }
.nav-icon { color: var(--accent); font-size: .72rem; }
.sidebar-footer {
  margin-top: auto; display: flex; gap: .6rem; align-items: center;
  padding: .7rem; color: var(--muted); font-size: .8rem;
}
.status-dot, .live-badge i, .connection i {
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 1rem rgba(121,242,192,.65);
}
main { min-width: 0; }
.topbar {
  height: 4.6rem; padding: 0 2.2rem; display: flex;
  justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line);
}
.connection, .live-badge {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--muted); font-size: .82rem;
}
.content { max-width: 88rem; margin: 0 auto; padding: 3.2rem 3rem 5rem; }
.page-heading {
  display: flex; align-items: end; justify-content: space-between;
  gap: 2rem; margin-bottom: 2.2rem;
}
h1 {
  max-width: 18ch; margin: .25rem 0; font-size: clamp(2.1rem,4vw,4.2rem);
  line-height: .98; letter-spacing: -.055em;
}
h2 { margin: .25rem 0; font-size: 1.55rem; letter-spacing: -.025em; }
h3 { margin: .25rem 0; }
p { line-height: 1.65; }
.eyebrow {
  margin: 0; color: var(--accent); text-transform: uppercase;
  letter-spacing: .14em; font-size: .72rem; font-weight: 750;
}
.muted { color: var(--muted); }
.live-badge, .pill {
  padding: .55rem .75rem; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(255,255,255,.025);
}
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1rem; }
.metric-card, .panel, .login-card, .state-card {
  border: 1px solid var(--line); border-radius: 1rem;
  background: linear-gradient(145deg, rgba(21,31,44,.92), rgba(13,19,29,.88));
  box-shadow: 0 1.4rem 4rem rgba(0,0,0,.18);
}
.metric-card { padding: 1.35rem; display: grid; gap: .45rem; }
.metric-card.accent { border-color: rgba(121,242,192,.25); }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card strong { font-size: 1.65rem; letter-spacing: -.035em; }
.panel { padding: 1.5rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; }
.empty-state {
  min-height: 16rem; display: grid; place-items: center;
  align-content: center; text-align: center;
}
.empty-state p { max-width: 38rem; color: var(--muted); }
.empty-icon {
  width: 3.2rem; height: 3.2rem; display: grid; place-items: center;
  border-radius: 50%; background: rgba(121,242,192,.09);
  color: var(--accent); font-size: 1.35rem;
}
.detail-list > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1rem .2rem; border-bottom: 1px solid var(--line);
}
.detail-list > div:last-child { border-bottom: 0; }
.detail-list span { color: var(--muted); }
.login-grid {
  min-height: calc(100vh - 11rem); display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(20rem,28rem);
  gap: clamp(3rem,8vw,9rem); align-items: center;
}
.login-copy h1 { max-width: 13ch; }
.login-copy > p:not(.eyebrow) { max-width: 36rem; color: var(--muted); }
.trust-row { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: 2rem; }
.trust-row span {
  padding: .45rem .65rem; border: 1px solid var(--line);
  border-radius: .5rem; color: var(--muted); font-size: .76rem;
}
.login-card { padding: clamp(1.5rem,4vw,2.4rem); }
form { display: grid; gap: .55rem; margin-top: 1.5rem; }
label { margin-top: .5rem; color: #cbd3dd; font-size: .82rem; }
input {
  width: 100%; padding: .85rem .9rem; border: 1px solid var(--line);
  border-radius: .65rem; outline: none; color: var(--text); background: #0b111a;
}
input:focus { border-color: rgba(121,242,192,.55); box-shadow: 0 0 0 3px rgba(121,242,192,.08); }
.button {
  display: inline-flex; justify-content: center; margin-top: 1rem;
  padding: .85rem 1rem; border: 1px solid transparent;
  border-radius: .65rem; text-decoration: none; font-weight: 750;
}
.button.primary { background: var(--accent); color: #06251c; }
.button.secondary { border-color: var(--line); background: transparent; color: var(--text); }
.button:disabled { opacity: .55; cursor: wait; }
.text-button { border: 0; background: transparent; color: var(--muted); }
.text-button:hover { color: var(--text); }
.form-message {
  margin: .75rem 0 0; padding: .75rem; border-radius: .55rem;
  color: var(--danger); background: rgba(255,80,80,.07); font-size: .82rem;
}
.state-card { max-width: 36rem; padding: 2rem; margin: 10vh auto 0; }
.state-card.compact {
  padding: 1rem; margin: 0; display: flex; align-items: center; gap: .8rem;
}
.spinner {
  width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
.boot {
  min-height: 100vh; display: grid; place-items: center;
  align-content: center; gap: 1rem; color: var(--muted);
}
#blazor-error-ui {
  display: none; position: fixed; inset: auto 1rem 1rem;
  padding: .8rem 1rem; background: #421f27;
  border: 1px solid #82404d; border-radius: .6rem;
}
#blazor-error-ui .dismiss { float: right; border: 0; color: white; background: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; width: 100%; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .sidebar nav { margin-top: 1rem; grid-template-columns: repeat(2,1fr); }
  .sidebar-footer { display: none; }
  .content { padding: 2rem 1.1rem 4rem; }
  .topbar { padding: 0 1.1rem; }
  .metric-grid, .login-grid { grid-template-columns: 1fr; }
  .login-grid { gap: 2.5rem; }
  .page-heading { align-items: start; flex-direction: column; }
}

/* WEB-002: minimalna brama logowania bez identyfikacji produktu. */
.anonymous-shell {
  min-height: 100vh;
  background: #c3c4c4;
  color: #464747;
}
.anonymous-content { min-height: 100vh; }
.login-gateway {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #c3c4c4;
}
.login-gateway .login-gateway-panel {
  width: min(35.25rem, calc(100% - 2rem));
  padding: 2rem 4.625rem 2.5rem;
  border: 1px solid #d8d9d9;
  border-radius: 0;
  background: #aeafb0;
  box-shadow: none;
}
.login-gateway h1 {
  max-width: none;
  margin: 0;
  color: #464747;
  font-size: 1.85rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
}
.login-gateway h1:focus { outline: none; }
.login-gateway form {
  display: grid;
  gap: .55rem;
  margin-top: 2.25rem;
}
.login-gateway label {
  margin-top: 0;
  color: #1f2020;
  font-size: .95rem;
  font-weight: 400;
}
.login-gateway label:not(:first-of-type) { margin-top: 1.65rem; }
.login-gateway input {
  min-height: 3.25rem;
  padding: .65rem .8rem;
  color: #303131;
  border: 1px solid #d8d9d9;
  border-radius: 0;
  background: #c3c4c4;
}
.login-gateway input:focus {
  border-color: #f1f1f1;
  box-shadow: none;
}
.login-gateway .button.primary {
  width: 8.25rem;
  min-width: 0;
  min-height: 3.375rem;
  margin-top: 2.25rem;
  margin-left: auto;
  padding: .65rem .8rem;
  color: #4d4d4d;
  border: 1px solid #dbdbdb;
  border-radius: 0;
  background: #c3c4c4;
  font-size: 1.05rem;
  font-weight: 400;
}
.login-gateway .button.primary:hover { background: #cccdcd; }
.login-gateway .state-card.compact {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.login-gateway .form-message {
  border: 1px solid rgba(255, 143, 143, .45);
  border-radius: 0;
  background: rgba(255, 255, 255, .2);
}
@media (max-width: 560px) {
  .login-gateway .login-gateway-panel {
    width: 100%;
    padding: 1.75rem 1.25rem 2rem;
  }
  .login-gateway .button.primary { width: 8.25rem; }
}
.neutral-not-found {
  width: min(36rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding-top: 18vh;
  text-align: center;
}
.neutral-not-found .cover-code {
  margin: 0;
  color: #343a43;
  font-size: clamp(5.4rem, 18vw, 10rem);
  font-weight: 750;
  line-height: .9;
  letter-spacing: -.075em;
}
.neutral-not-found h1 {
  max-width: none;
  margin: 1.2rem 0 .55rem;
  color: #292d34;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}
.neutral-not-found p { margin: 0; color: #777d86; }
.neutral-not-found .button.secondary { color: #4b515a; border-color: #d8dbd8; }
