/* CloverAC – logowanie, panel klienta i panel administracyjny.
   Ten sam styl co strona główna: ciemne tło, zieleń #3cc24d, font Outfit. */

:root {
  --bg: #060606;
  --surface: #0b0c0b;
  --surface-2: #101210;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.13);
  --text: #f4f4f4;
  --muted: rgba(255, 255, 255, 0.62);
  --dim: rgba(255, 255, 255, 0.42);
  --green: #3cc24d;
  --green-2: #62d572;
  --green-soft: rgba(60, 194, 77, 0.12);
  --green-line: rgba(60, 194, 77, 0.35);
  --btn: #23893a;
  --btn-h: #2a9a43;
  --red: #ff6b6b;
  --red-soft: rgba(255, 77, 77, 0.12);
  --amber: #ffc46b;
  --amber-soft: rgba(255, 184, 77, 0.12);
  --blue: #8fb3ff;
  --blue-soft: rgba(120, 160, 255, 0.12);
  --font: "Outfit", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --r: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-color: #2ea440 var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  flex: none;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

/* ——— przyciski i pola ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.6rem;
  padding: 0 1.1rem;
  border: 1px solid var(--border-2);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s var(--ease);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
}

.btn--primary {
  border-color: transparent;
  background: var(--btn);
  color: #fff;
}

.btn--primary:hover {
  border-color: transparent;
  background: var(--btn-h);
}

.btn--danger {
  border-color: rgba(255, 90, 90, 0.35);
  background: var(--red-soft);
  color: var(--red);
}

.btn--danger:hover {
  border-color: rgba(255, 90, 90, 0.6);
  background: rgba(255, 77, 77, 0.2);
}

.btn--sm {
  height: 2.15rem;
  padding: 0 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.84rem;
}

.btn--icon {
  width: 2.6rem;
  padding: 0;
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--border-2);
  border-radius: 0.6rem;
  background: #0a0b0a;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.textarea {
  height: auto;
  min-height: 6rem;
  padding: 0.7rem 0.9rem;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--dim);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green-line);
  background: #0c0e0c;
  outline: none;
}

.select {
  padding-right: 2.2rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.85rem center;
  background-repeat: no-repeat;
  cursor: pointer;
}

.select option {
  background: #111311;
}

.search {
  position: relative;
  flex: 1;
  min-width: 12rem;
}

.search svg {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}

.search .input {
  padding-left: 2.6rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
}

.form-error {
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--red);
}

.form-ok {
  color: var(--green-2);
}

/* przełącznik */
.switch {
  position: relative;
  flex: none;
  width: 2.5rem;
  height: 1.45rem;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  appearance: none;
  cursor: pointer;
  transition: background 0.25s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.45rem - 6px);
  height: calc(1.45rem - 6px);
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s var(--ease);
}

.switch:checked {
  background: var(--btn);
}

.switch:checked::after {
  transform: translateX(1.05rem);
}

.switch:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
}

/* plakietki */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 1.6rem;
  padding: 0 0.6rem;
  border: 1px solid var(--border-2);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
}

.badge--green {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green-2);
}

.badge--red {
  border-color: rgba(255, 90, 90, 0.35);
  background: var(--red-soft);
  color: var(--red);
}

.badge--amber {
  border-color: rgba(255, 184, 77, 0.35);
  background: var(--amber-soft);
  color: var(--amber);
}

.badge--blue {
  border-color: rgba(120, 160, 255, 0.35);
  background: var(--blue-soft);
  color: var(--blue);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--dim);
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.status--on {
  color: var(--green-2);
}

.status--on::before {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(60, 194, 77, 0.18);
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 1.55rem;
  padding: 0 0.55rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.74rem;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
}

/* ——— logowanie ——— */

.auth {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  isolation: isolate;
}

.auth::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 45% 50% at 50% 0%, rgba(60, 194, 77, 0.16), transparent 70%),
    radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1.6px) 0 0 / 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 80%);
}

.auth__card {
  width: min(420px, 100%);
  padding: 2rem 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: var(--surface);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: rise 0.6s var(--ease) both;
}

.auth__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

.auth__head h1 {
  margin-top: 0.4rem;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth__head p {
  color: var(--muted);
}

.auth__switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin: 1.5rem 0 1.25rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: #080908;
}

.auth__switch button {
  height: 2.3rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth__switch button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green-2);
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth__hint {
  font-size: 0.8rem;
  color: var(--dim);
}

.auth__back {
  display: block;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  text-align: center;
  color: var(--dim);
  transition: color 0.2s ease;
}

.auth__back:hover {
  color: var(--text);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
  transition: transform 0.45s var(--ease);
}

.brand:hover img {
  transform: rotate(-10deg) scale(1.06);
}

/* ——— układ panelu ——— */

.app {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sb {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100vh;
  padding: 1.4rem 1rem 1rem;
  border-right: 1px solid var(--border);
  background: #080908;
  overflow-y: auto;
}

.sb__brand {
  justify-content: center;
  padding: 0 0.5rem;
}

.sb__label {
  margin: 0 0 0.45rem;
  padding: 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.sb__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sb__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 2.6rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  font-size: 0.94rem;
  font-weight: 500;
  text-align: left;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sb__link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s var(--ease);
}

.sb__link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sb__link:hover svg {
  transform: scale(1.1);
}

.sb__link[aria-current="page"] {
  background: var(--green-soft);
  color: var(--green-2);
}

.sb__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--green);
}

.sb__count {
  min-width: 1.4rem;
  margin-left: auto;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}

.sb__servers {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sb__server {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 2.3rem;
  padding: 0 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.88rem;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.sb__server span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb__server:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sb__server i {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.sb__server i.on {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(60, 194, 77, 0.18);
}

.sb__empty {
  padding: 0 0.75rem;
  font-size: 0.84rem;
  color: var(--dim);
}

.sb__bottom {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.sb__row {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
}

.sb__row .sb__link {
  flex: 1;
  min-width: 0;
}

.sb__row .sb__link--icon {
  flex: 0 0 2.6rem;
  justify-content: center;
  padding: 0;
}

.sb__row .sb__link[aria-current="page"]::before {
  display: none;
}

.sb__copy {
  padding: 0.6rem 0.5rem 0.2rem;
  font-size: 0.8rem;
  text-align: center;
  color: var(--dim);
}

.sb__plan {
  margin-bottom: 0.5rem;
  padding: 0.9rem;
  border: 1px solid var(--green-line);
  border-radius: 0.8rem;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(60, 194, 77, 0.14), transparent 70%),
    var(--surface);
}

.sb__plan span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.sb__plan strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.05rem;
}

.sb__plan a {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--green-2);
}

.sb__plan a:hover {
  text-decoration: underline;
}

.sb__admin {
  color: var(--amber);
}

.sb__admin:hover {
  background: var(--amber-soft);
  color: var(--amber);
}

.sb__link.sb__admin[aria-current="page"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.sb__link.sb__admin[aria-current="page"]::before {
  background: var(--amber);
}

/* poziomy pasek zakładek w części administracyjnej */
.admin-tabs {
  margin-bottom: 1.25rem;
}

/* licznik aktywnych obok zakładek administracji */
.admin-tabs .live {
  flex: none;
  transition: border-color 0.2s ease;
}

.admin-tabs .live:hover {
  border-color: var(--green-line);
}

.sb-backdrop {
  display: none;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tb {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.4rem;
  padding: 0.8rem 1.75rem;
  background: rgba(6, 6, 6, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.tb__menu {
  display: none;
}

.tb__title {
  min-width: 0;
}

.tb__title h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tb__title p {
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .tb__title p {
    display: none;
  }
}

.tb__spacer {
  flex: 1;
}

.usermenu {
  position: relative;
}

.user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.user:hover,
.usermenu.is-open .user {
  border-color: var(--border-2);
  background: var(--surface-2);
}

.user:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
}

.user__text {
  display: block;
  min-width: 0;
  max-width: 12rem;
}

.user__text strong,
.user__text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user__chev {
  margin-left: 0.15rem;
  color: var(--dim);
  transition: transform 0.3s var(--ease), color 0.2s ease;
}

.usermenu.is-open .user__chev {
  transform: rotate(180deg);
  color: var(--text);
}

.usermenu__pop {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 40;
  width: 15rem;
  padding: 0.4rem;
  border: 1px solid var(--border-2);
  border-radius: 0.9rem;
  background: rgba(14, 16, 14, 0.97);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: pop-in 0.25s var(--ease) both;
  transform-origin: top right;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
}

.usermenu__pop a,
.usermenu__pop button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  height: 2.5rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.usermenu__pop a:hover,
.usermenu__pop button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

#usermenu-admin {
  color: var(--amber);
}

#usermenu-admin:hover {
  background: var(--amber-soft);
  color: var(--amber);
}

.usermenu__sep {
  height: 1px;
  margin: 0.35rem 0.4rem;
  background: var(--border);
}

.avatar {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, #2ea440, #1b5f29);
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

/* domyślny avatar (gdy użytkownik nie ma zdjęcia): zielony okrąg z ikoną osoby */
.avatar--icon {
  border: 2px solid var(--green);
  border-radius: 50%;
  background: rgba(60, 194, 77, 0.14);
  color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(60, 194, 77, 0.08);
}

.avatar--icon svg {
  width: 52%;
  height: 52%;
}

.avatar--lg {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.9rem;
  font-size: 1.4rem;
}

.avatar--lg.avatar--icon {
  border-radius: 50%;
}

.user strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
}

.user small {
  font-size: 0.76rem;
  color: var(--dim);
}

/* ogłoszenie w górnym pasku */
.notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  max-width: 720px;
  padding: 0.45rem 0.5rem 0.45rem 0.6rem;
  border: 1px solid rgba(120, 160, 255, 0.3);
  border-radius: 0.8rem;
  background: var(--surface);
  animation: rise 0.5s var(--ease) both;
}

.notice__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 0.55rem;
  background: var(--blue-soft);
  color: var(--blue);
}

.notice--promo {
  border-color: var(--green-line);
}

.notice--promo .notice__icon {
  background: var(--green-soft);
  color: var(--green-2);
}

.notice--warning {
  border-color: rgba(255, 184, 77, 0.35);
}

.notice--warning .notice__icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.notice__text {
  min-width: 0;
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice__close {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  flex: none;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}

.notice__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.content {
  width: 100%;
  padding: 1.75rem 2rem 2.5rem;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: rise 0.5s var(--ease) both;
}

.page-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 1rem;
}

.page-title h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.page-title p {
  margin-top: 0.25rem;
  color: var(--muted);
}

/* ——— karty ——— */

.card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card__head h2 {
  font-size: 1rem;
  font-weight: 600;
}

.card__head p {
  font-size: 0.82rem;
  color: var(--dim);
}

.card__head .grow {
  flex: 1;
  min-width: 0;
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  border: 1px solid var(--green-line);
  border-radius: 0.6rem;
  background: var(--green-soft);
  color: var(--green-2);
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid--2-1 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* kafelki z liczbami */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.kpis--6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi {
  position: relative;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.4s var(--ease);
}

.kpi:hover {
  transform: translateY(-3px);
  border-color: var(--green-line);
}

.kpi__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.kpi__label svg {
  color: var(--green-2);
}

.kpi__value {
  display: block;
  margin-top: 0.55rem;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.kpi__value small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--dim);
}

.kpi__sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--dim);
}

.delta {
  font-weight: 600;
}

.delta--up {
  color: var(--red);
}

.delta--down {
  color: var(--green-2);
}

/* zakładki zakresu czasu */
.seg {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: #080908;
}

.seg button {
  height: 1.9rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dim);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.seg button:hover {
  color: var(--text);
}

.seg button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green-2);
}

/* ——— wykresy ——— */

.chart {
  position: relative;
  min-height: 220px;
}

.ch {
  display: block;
  overflow: visible;
}

.ch-grid {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.ch-axis {
  fill: rgba(255, 255, 255, 0.4);
  font-family: var(--font);
  font-size: 11px;
}

.ch-cross {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.ch-dot {
  stroke: var(--surface);
  stroke-width: 2;
}

.ch-tip {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border-2);
  border-radius: 0.55rem;
  background: rgba(16, 18, 16, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
}

.ch-tip span {
  color: var(--dim);
}

.ch-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  color: var(--dim);
  pointer-events: none;
}

.hb {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hb__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.hb__top span {
  color: var(--muted);
}

.hb__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.hb__fill {
  width: var(--w);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ea440, var(--green-2));
  transform-origin: left;
  animation: grow 0.9s var(--ease) both;
}

.hb__row:hover .hb__fill {
  filter: brightness(1.15);
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

.dn {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.dn__chart {
  position: relative;
  width: 150px;
  flex: none;
}

.dn__chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.dn-seg {
  transition: opacity 0.2s ease;
}

.dn__chart svg:hover .dn-seg:not(:hover) {
  opacity: 0.45;
}

.dn__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dn__center strong {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.dn__center span {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--dim);
}

.dn__legend {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dn__legend li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.dn__legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.dn__legend span {
  color: var(--muted);
}

.dn__legend em {
  min-width: 2.6rem;
  font-style: normal;
  text-align: right;
  color: var(--dim);
}

.spark {
  display: block;
}

/* ——— listy i tabele ——— */

.list {
  display: flex;
  flex-direction: column;
}

.list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}

.list__item:first-child {
  padding-top: 0;
  border-top: 0;
}

.list__item .grow {
  flex: 1;
  min-width: 0;
}

.list__item strong {
  display: block;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list__item small {
  font-size: 0.78rem;
  color: var(--dim);
}

.rank {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  flex: none;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.list__item:first-child .rank {
  background: var(--green-soft);
  color: var(--green-2);
}

.table-wrap {
  margin: 0 -1.25rem -1.25rem;
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table th {
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  color: var(--dim);
}

.table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table .num {
  text-align: right;
}

.table .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.link {
  border: 0;
  padding: 0;
  background: none;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.link:hover {
  color: var(--green-2);
  text-decoration: underline;
}

.empty {
  padding: 1.5rem 0;
  font-size: 0.92rem;
  text-align: center;
  color: var(--dim);
}

.empty a {
  color: var(--green-2);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.toolbar .select {
  width: auto;
  min-width: 11rem;
}

/* ——— serwery ——— */

.servers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.25rem;
}

.srv {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.srv:hover {
  border-color: rgba(255, 255, 255, 0.13);
}

.srv.is-flash {
  animation: flash 1.6s ease;
}

@keyframes flash {
  0%,
  60% {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(60, 194, 77, 0.18);
  }
}

.srv__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.srv__head h3 {
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srv__head .grow {
  flex: 1;
  min-width: 0;
}

.srv__rows {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 1.25rem;
}

.srv__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.srv__row:last-child {
  border-bottom: 0;
}

.srv__row > span:first-child {
  color: var(--dim);
}

.srv__row strong {
  font-weight: 600;
}

.srv__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding: 1rem 1.25rem 1.2rem;
  border-top: 1px solid var(--border);
}

.srv__checks {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.check-group h4 {
  margin: 1rem 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-2);
}

.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.check:hover {
  background: rgba(255, 255, 255, 0.03);
}

.add-server {
  display: flex;
  gap: 0.6rem;
  width: min(460px, 100%);
}

/* ——— konto ——— */

.profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

.info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.info div {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: #090a09;
}

.info span {
  display: block;
  font-size: 0.74rem;
  color: var(--dim);
}

.info strong {
  display: block;
  margin-top: 0.15rem;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ——— okno i powiadomienie ——— */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade 0.25s ease both;
}

.modal__box {
  width: min(520px, 100%);
  max-height: calc(100vh - 2rem);
  padding: 1.5rem;
  border: 1px solid var(--border-2);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  animation: rise 0.4s var(--ease) both;
}

.modal__box--wide {
  width: min(880px, 100%);
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal__head h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal__head .grow {
  flex: 1;
  min-width: 0;
}

.modal__box > p {
  color: var(--muted);
}

.keybox {
  display: flex;
  gap: 0.5rem;
  margin: 1.1rem 0;
}

.keybox code {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--green-line);
  border-radius: 0.6rem;
  background: #070807;
  font-family: var(--mono);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  color: var(--green-2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--green-line);
  border-radius: 0.75rem;
  background: #0d120d;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  font-size: 0.92rem;
  transform: translateX(-50%);
  animation: toast-in 0.4s var(--ease) both;
}

.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
}

.toast--error {
  border-color: rgba(255, 90, 90, 0.45);
  background: #170c0c;
}

.toast--error::before {
  background: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

/* ——— panel administracyjny ——— */

.admin {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.admin__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin__bar {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tabs {
  display: flex;
  flex: 1;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 2.7rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  font-size: 0.94rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tabs a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.tabs a[aria-current="page"] {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green-2);
}

.live {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1.2rem 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}

.live__icon {
  position: relative;
}

.live__icon::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 4px rgba(60, 194, 77, 0.25);
  }
}

.live span {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.live strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.filter-chips button {
  height: 2rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-chips button:hover {
  color: var(--text);
}

.filter-chips button[aria-pressed="true"] {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green-2);
}

.ucards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.ucard {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.35s var(--ease), background 0.25s ease;
}

.ucard:hover {
  transform: translateY(-3px);
  border-color: var(--green-line);
  background: #0c0f0c;
}

.ucard__name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.02rem;
  font-weight: 600;
}

.ucard__meta {
  font-size: 0.82rem;
  color: var(--dim);
}

.ucard__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.section-title {
  margin: 1.4rem 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.row .input,
.row .select {
  flex: 1;
  width: auto;
  min-width: 10rem;
}

.danger-zone {
  margin-top: 1.4rem;
  padding: 1rem;
  border: 1px solid rgba(255, 90, 90, 0.3);
  border-radius: 0.8rem;
  background: rgba(255, 77, 77, 0.04);
}

.danger-zone p {
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.preview {
  padding: 1rem;
  border: 1px dashed var(--border-2);
  border-radius: 0.8rem;
  background: #080908;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  cursor: pointer;
}

/* ——— responsywność ——— */

@media (max-width: 1280px) {
  .kpis--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .grid--2-1,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sb {
    position: fixed;
    left: 0;
    z-index: 60;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
  }

  .app.is-menu .sb {
    transform: none;
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.6);
  }

  .app.is-menu .sb-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    background: rgba(0, 0, 0, 0.5);
  }

  .tb__menu {
    display: inline-flex;
  }

  .tb {
    padding: 0.7rem 1rem;
  }

  .content {
    padding: 1.25rem 1rem;
  }

  .grid--2 {
    grid-template-columns: 1fr;
  }

  .servers {
    grid-template-columns: 1fr;
  }

  .admin__bar {
    flex-direction: column;
  }

  .live {
    padding: 0.7rem 1rem;
  }

  .user small,
  .notice__text {
    display: none;
  }
}

@media (max-width: 560px) {
  .kpis,
  .kpis--6 {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .kpi__value {
    font-size: 1.5rem;
  }

  .dn {
    flex-direction: column;
    align-items: stretch;
  }

  .dn__chart {
    margin: 0 auto;
  }

  .info {
    grid-template-columns: 1fr;
  }

  .add-server {
    flex-direction: column;
  }

  .admin {
    padding: 1rem 0.75rem 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
