/* NEVV Helpdesk Insight */
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #08050e;
  --bg2: #0f0a19;
  --panel: rgba(255, 255, 255, .035);
  --panel-2: rgba(255, 255, 255, .06);
  --panel-solid: #130d1f;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eeebf6;
  --muted: #a39cb6;
  --dim: #6f6784;
  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --violet-3: #c4b5fd;
  --violet-deep: #5b21b6;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --info: #60a5fa;
  --radius: 14px;
  --radius-s: 9px;
  --side: 248px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(124, 58, 237, .22), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(91, 33, 182, .18), transparent 60%),
    var(--bg);
}
a { color: var(--violet-2); text-decoration: none; }
a:hover { color: var(--violet-3); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }
svg.i { width: 1.1em; height: 1.1em; vertical-align: -.18em; flex: none; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
::selection { background: rgba(139, 92, 246, .45); }

/* ---------- układ ---------- */
.side {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--side);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(10, 6, 18, .72);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; color: var(--text); }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand b { display: block; font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.brand span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: -2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { background: linear-gradient(90deg, rgba(139, 92, 246, .22), rgba(139, 92, 246, .06)); color: #fff; box-shadow: inset 2px 0 0 var(--violet); }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--err); color: #1a0505; font-size: 11px; font-weight: 800; text-align: center; line-height: 19px; }
.nav .count.warn { background: var(--warn); }
.side .sep { flex: 1; }
.side .me { padding: 12px; border-top: 1px solid var(--line); margin-top: 8px; font-size: 12.5px; }
.side .me b { display: block; font-weight: 700; }
.side .me span { color: var(--dim); }
.side .me .links { display: flex; gap: 12px; margin-top: 8px; }

.main { margin-left: var(--side); padding: 26px 34px 60px; max-width: 1500px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mobilebar { display: none; }

@media (max-width: 960px) {
  .side { transform: translateX(-100%); transition: transform .25s ease; width: 270px; }
  body.nav-open .side { transform: none; box-shadow: var(--shadow); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 20; }
  .main { margin-left: 0; padding: 16px 16px 50px; }
  .mobilebar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 15;
    padding: 12px 16px; margin: -16px -16px 16px;
    background: rgba(8, 5, 14, .85); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .mobilebar img { width: 28px; height: 28px; }
  .mobilebar b { font-weight: 800; font-size: 14px; }
  h1 { font-size: 19px; }
}

/* ---------- elementy ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card > h2 { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.card > h2 .hint { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--dim); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 20px 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.aside { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1000px) { .grid.aside { grid-template-columns: 1fr; } }
.grid > .card + .card { margin-top: 0; }
@media (max-width: 1100px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }

.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1200px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile {
  display: block; padding: 14px 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-1px); color: var(--text); }
.tile.on { border-color: rgba(139, 92, 246, .6); background: rgba(139, 92, 246, .08); }
.tile .n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.tile .l { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.tile.ok .n { color: var(--ok); }
.tile.err .n { color: var(--err); }
.tile.warn .n { color: var(--warn); }
.tile.vio .n { color: var(--violet-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(180deg, #8b5cf6, #6d28d9); border-color: rgba(167, 139, 250, .5); color: #fff; box-shadow: 0 8px 22px -10px rgba(139, 92, 246, .8); }
.btn.primary:hover { background: linear-gradient(180deg, #9d74f8, #7c3aed); }
.btn.danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .4); color: #fecaca; }
.btn.danger:hover { background: rgba(248, 113, 113, .22); }
.btn.ok { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .4); color: #bbf7d0; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; line-height: 19px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.ok { color: var(--ok); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .25); }
.chip.warn { color: var(--warn); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .25); }
.chip.err { color: var(--err); background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); }
.chip.vio { color: var(--violet-3); background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .3); }
.chip.info { color: var(--info); background: rgba(96, 165, 250, .1); border-color: rgba(96, 165, 250, .25); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--dim); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .15); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, .15); }
.dot.err, .dot.error { background: var(--err); box-shadow: 0 0 0 3px rgba(248, 113, 113, .18); animation: pulse 2s infinite; }
.dot.stale { background: #94a3b8; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(248, 113, 113, 0); } }

/* tabele */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--dim);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .025); }
.tbl tr.rowlink { cursor: pointer; }
.tbl .name { font-weight: 700; color: var(--text); }
.tbl .sub { font-size: 12px; color: var(--dim); }
.tbl .num { text-align: right; }
.tbl-wrap { overflow-x: auto; }
@media (max-width: 760px) {
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl.cards td { border: 0; padding: 3px 0; }
  .tbl.cards td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 118px; color: var(--dim); font-size: 12px; }
}

/* formularze */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
label.f small, .help { display: block; font-size: 12px; color: var(--dim); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input[type=datetime-local], input[type=date], input[type=search], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .25); }
input::placeholder, textarea::placeholder { color: var(--dim); }
input.code { font-size: 22px; letter-spacing: .5em; text-align: center; font-weight: 700; padding: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 160px; }
.row > .auto { flex: none; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--violet); width: 16px; height: 16px; }
.check span small { display: block; color: var(--dim); font-size: 12px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: block; padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--violet); color: #fff; }

/* komunikaty */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.flash.ok { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .3); color: #a7f3d0; }
.flash.err { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .35); color: #fecaca; }
.flash.info { background: rgba(139, 92, 246, .1); border-color: rgba(139, 92, 246, .3); color: var(--violet-3); }
.flash.warn { background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .3); color: #fde68a; }

.empty { padding: 34px 20px; text-align: center; color: var(--dim); }
.empty b { display: block; color: var(--muted); font-size: 14px; margin-bottom: 4px; }

/* lista definicji */
.kv { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--dim); font-size: 12.5px; font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

.problems { list-style: none; margin: 0; padding: 0; }
.problems li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.problems li:last-child { border-bottom: 0; }
.problems .dot { margin-top: 6px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: #fff; border-bottom-color: var(--violet); }
.tabs a .chip { margin-left: 6px; }

.bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--violet), var(--violet-2)); }
.bar.warn > i { background: var(--warn); }
.bar.err > i { background: var(--err); }

.keybox { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.keybox code { flex: 1; overflow-wrap: anywhere; color: var(--violet-3); }
pre.json { margin: 0; padding: 14px; border-radius: 10px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); overflow: auto; max-height: 420px; font-size: 12px; color: #d8d2ea; }
details > summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details > summary:hover { color: var(--text); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 320px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.ok-t { color: var(--ok); }
.warn-t { color: var(--warn); }
.err-t { color: var(--err); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* status nagłówka instancji */
.hero { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.hero .t { display: flex; gap: 14px; align-items: center; }
.hero .big-dot { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); }
.hero .big-dot .dot { width: 13px; height: 13px; }
.hero .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin-top: 18px; border-radius: 12px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.facts > div { background: var(--panel-solid); padding: 12px 14px; }
.facts .l { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.facts .v { font-weight: 700; margin-top: 3px; word-break: break-word; }
@media (max-width: 1000px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.banner { padding: 14px 18px; border-radius: 12px; margin-bottom: 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.banner.err { background: linear-gradient(90deg, rgba(248, 113, 113, .16), rgba(248, 113, 113, .05)); border: 1px solid rgba(248, 113, 113, .35); }
.banner.warn { background: linear-gradient(90deg, rgba(251, 191, 36, .14), rgba(251, 191, 36, .04)); border: 1px solid rgba(251, 191, 36, .3); }
.banner.vio { background: linear-gradient(90deg, rgba(139, 92, 246, .2), rgba(139, 92, 246, .05)); border: 1px solid rgba(139, 92, 246, .35); }
.banner .grow { flex: 1; min-width: 220px; }

/* okno modalne */
dialog {
  border: 1px solid var(--line-2); border-radius: 18px; padding: 0;
  background: #120c1e; color: var(--text);
  width: min(460px, calc(100vw - 32px));
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .8);
}
dialog::backdrop { background: rgba(5, 2, 10, .7); backdrop-filter: blur(4px); }
dialog form { padding: 22px 22px 18px; }
dialog h3 { font-size: 17px; margin-bottom: 6px; }
dialog p { color: var(--muted); }
dialog .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* logowanie */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; }
.auth .box { width: 100%; max-width: 400px; }
.auth .card { padding: 28px; box-shadow: var(--shadow); background: rgba(19, 13, 31, .78); backdrop-filter: blur(18px); }
.auth .logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; text-align: center; }
.auth .logo svg { width: 74px; height: 74px; filter: drop-shadow(0 14px 30px rgba(124, 58, 237, .55)); }
.auth .logo b { font-size: 22px; font-weight: 800; letter-spacing: .02em; display: block; }
.auth .logo span { color: var(--muted); font-weight: 500; font-size: 13px; }
.intro rect { transform-origin: 32px 32px; animation: pop .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.intro path { stroke-dasharray: 120; stroke-dashoffset: 120; animation: draw 1.1s .35s ease forwards; }
.intro-t { animation: rise .7s .7s ease both; }
@keyframes pop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .intro rect, .intro path, .intro-t { animation: none; stroke-dashoffset: 0; } }

.qrbox { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qrbox svg.qr { width: 190px; height: 190px; border-radius: 12px; padding: 4px; background: #fff; flex: none; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 16px; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin-bottom: 10px; color: var(--muted); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 23px; height: 23px; border-radius: 50%; background: rgba(139, 92, 246, .2); color: var(--violet-3); font-weight: 800; font-size: 12px; display: grid; place-items: center; }

.live-note { font-size: 12px; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.live-note .dot { width: 7px; height: 7px; }
.ver-new { font-size: 11px; color: var(--violet-3); font-weight: 700; display: block; }
