:root {
  --bg: #070a12;
  --panel: rgba(17, 24, 39, .76);
  --panel-strong: rgba(15, 23, 42, .94);
  --border: rgba(148, 163, 184, .18);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #56f0c2;
  --accent-two: #7c3aed;
  --danger: #fb7185;
  --ok: #34d399;
  --unknown: #64748b;
  --radius: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 5%, rgba(86, 240, 194, .13), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(124, 58, 237, .17), transparent 26%),
    linear-gradient(180deg, #070a12 0%, #0f172a 55%, #020617 100%);
  overflow-x: hidden;
}

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

code {
  color: var(--accent);
}

button {
  font: inherit;
}

.background-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(80px);
  opacity: .22;
  pointer-events: none;
}

.orb-one {
  left: -160px;
  top: 160px;
  background: var(--accent);
}

.orb-two {
  right: -170px;
  bottom: -80px;
  background: var(--accent-two);
}

.sidebar {
  position: fixed;
  inset: 18px auto 18px 18px;
  width: 270px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, .68);
  backdrop-filter: blur(22px);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.brand-symbol {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(86, 240, 194, .22), rgba(124, 58, 237, .26));
  border: 1px solid var(--border);
  font-size: 1.35rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.side-nav {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border-radius: 16px;
  color: var(--soft);
  border: 1px solid transparent;
  transition: .18s ease;
}

.side-nav a span {
  width: 22px;
  text-align: center;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--text);
  background: rgba(86, 240, 194, .1);
  border-color: rgba(86, 240, 194, .24);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 13px;
}

.sidebar-footer a {
  display: block;
  color: var(--muted);
  padding: 10px 12px;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
  position: relative;
  z-index: 1;
}

.shell.with-sidebar {
  width: min(1180px, calc(100% - 330px));
  margin-left: 310px;
  margin-right: 20px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4.9rem);
  line-height: .92;
  letter-spacing: -.07em;
}

.title-icon {
  letter-spacing: 0;
  margin-right: .1em;
}

.subtitle {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions a,
.header-actions button,
.login-form button,
.maintenance-card button {
  border: 1px solid rgba(86, 240, 194, .35);
  background: rgba(86, 240, 194, .11);
  color: var(--text);
  padding: 11px 15px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}

.header-actions a:hover,
.header-actions button:hover,
.login-form button:hover,
.maintenance-card button:hover {
  transform: translateY(-1px);
  border-color: rgba(86, 240, 194, .7);
  background: rgba(86, 240, 194, .18);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.hero-card,
.section-card,
.admin-panel,
.service-card,
.login-card,
.maintenance-card,
.compact-status-list {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: 20px;
  border-radius: var(--radius);
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-label {
  color: var(--muted);
  font-size: .88rem;
}

.hero-card strong {
  font-size: 2.2rem;
  letter-spacing: -.04em;
}

.hero-card span:last-child {
  color: var(--soft);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 34px;
}

.section-card {
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  transition: .2s ease;
}

.section-card:hover {
  transform: translateY(-3px);
  border-color: rgba(86, 240, 194, .35);
}

.section-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .07);
  font-size: 1.45rem;
}

.section-card h2 {
  margin: 0 0 8px;
}

.section-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.section-card small {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-weight: 800;
}

.service-group {
  margin-top: 34px;
}

.service-group.first {
  margin-top: 0;
}

.group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.group-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-card {
  border-radius: var(--radius);
  padding: 20px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  transition: .2s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(86, 240, 194, .1), transparent 42%);
  opacity: 0;
  transition: .2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(86, 240, 194, .38);
}

.service-card:hover::before {
  opacity: 1;
}

.card-top,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--border);
  font-size: 1.3rem;
}

.status-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--unknown);
  box-shadow: 0 0 0 5px rgba(100, 116, 139, .13);
  flex: 0 0 auto;
}

.status-ok {
  background: var(--ok);
  box-shadow: 0 0 0 5px rgba(52, 211, 153, .13);
}

.status-bad {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(251, 113, 133, .13);
}

.status-unknown {
  background: var(--unknown);
}

.service-card h3 {
  margin: 22px 0 8px;
  font-size: 1.25rem;
  position: relative;
}

.service-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  position: relative;
}

.card-footer {
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
  font-size: .88rem;
}

.card-footer strong {
  color: var(--accent);
}

.login-card {
  width: min(430px, 100%);
  margin: 10vh auto 0;
  padding: 34px;
  border-radius: 32px;
  text-align: center;
}

.brand-mark {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(86, 240, 194, .22), rgba(124, 58, 237, .26));
  border: 1px solid var(--border);
  font-size: 2rem;
}

.login-card h1 {
  font-size: 3rem;
}

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

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  text-align: left;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, .72);
  color: var(--text);
  padding: 13px 14px;
  border-radius: 16px;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(86, 240, 194, .7);
}

.login-form button {
  margin-top: 8px;
  border-radius: 16px;
}

.alert {
  margin-top: 18px;
  border: 1px solid rgba(251, 113, 133, .4);
  background: rgba(251, 113, 133, .1);
  color: #fecdd3;
  padding: 12px 14px;
  border-radius: 16px;
}

.admin-panel {
  border-radius: var(--radius);
  padding: 22px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--soft);
  vertical-align: top;
}

th {
  color: var(--text);
}

.muted-row {
  opacity: .55;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
}

.pill.ok {
  background: rgba(52, 211, 153, .13);
  color: #bbf7d0;
}

.pill.off {
  background: rgba(148, 163, 184, .1);
  color: var(--muted);
}

.note {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(86, 240, 194, .08);
  color: var(--soft);
  border: 1px solid rgba(86, 240, 194, .18);
}

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.maintenance-card {
  border-radius: var(--radius);
  padding: 20px;
}

.maintenance-card h2 {
  margin: 0 0 8px;
}

.maintenance-card p {
  color: var(--muted);
  line-height: 1.45;
}

pre {
  white-space: pre-wrap;
  overflow-x: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(2, 6, 23, .7);
  border: 1px solid var(--border);
}

pre code {
  color: #d1fae5;
}

.compact-status-list {
  border-radius: var(--radius);
  overflow: hidden;
}

.compact-status-row {
  display: grid;
  grid-template-columns: 18px 180px 1fr 120px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.compact-status-row:last-child {
  border-bottom: none;
}

.compact-status-row small {
  color: var(--muted);
}

.compact-status-row em {
  color: var(--soft);
  font-style: normal;
  text-align: right;
}

.compact-status-row.disabled {
  opacity: .5;
}

@media (max-width: 1050px) {
  .sidebar {
    position: static;
    width: min(1180px, calc(100% - 32px));
    margin: 16px auto 0;
  }

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

  .shell.with-sidebar {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
  }

  .page-header {
    margin-top: 20px;
  }
}

@media (max-width: 900px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .hero-grid,
  .cards,
  .section-grid,
  .maintenance-grid {
    grid-template-columns: 1fr;
  }

  .compact-status-row {
    grid-template-columns: 18px 1fr;
  }

  .compact-status-row small,
  .compact-status-row em {
    grid-column: 2;
    text-align: left;
  }
}

/* === V2.3 users admin === */
.sidebar-footer small {
  display: block;
  color: var(--muted);
  padding: 8px 12px 2px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 15px;
  background: rgba(15, 23, 42, .74);
  color: var(--soft);
}

.flash.success {
  border-color: rgba(52, 211, 153, .35);
  background: rgba(52, 211, 153, .1);
  color: #bbf7d0;
}

.flash.error {
  border-color: rgba(251, 113, 133, .4);
  background: rgba(251, 113, 133, .1);
  color: #fecdd3;
}

.user-add-panel {
  margin-bottom: 18px;
}

.user-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 160px auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.user-form-grid label,
.user-actions form {
  display: grid;
  gap: 7px;
}

.user-form-grid input,
.user-form-grid select,
.user-actions input,
.user-actions select {
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, .72);
  color: var(--text);
  padding: 11px 12px;
  border-radius: 14px;
  outline: none;
}

.user-form-grid button,
.user-actions button {
  border: 1px solid rgba(86, 240, 194, .35);
  background: rgba(86, 240, 194, .11);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.user-actions button.danger {
  border-color: rgba(251, 113, 133, .42);
  background: rgba(251, 113, 133, .1);
  color: #fecdd3;
}

.users-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.user-row {
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, .36);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.user-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.user-main strong {
  font-size: 1.1rem;
}

.user-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill.role {
  background: rgba(124, 58, 237, .14);
  color: #ddd6fe;
}

.user-actions {
  display: grid;
  grid-template-columns: 1.3fr .65fr auto auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 1000px) {
  .user-form-grid,
  .user-actions {
    grid-template-columns: 1fr;
  }

  .user-main {
    align-items: flex-start;
    flex-direction: column;
  }
}
