:root {
  color-scheme: dark;
  --bg: #090d18;
  --panel: #111827;
  --panel2: #151e30;
  --border: #253149;
  --text: #edf2fb;
  --muted: #8995aa;
  --accent: #8b7cff;
  --accent2: #6b5ce7;
  --green: #39c98a;
  --red: #f06c78;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
}

[hidden] { display: none !important; }

button, input, select { font: inherit; }
button { cursor: pointer; }

button:disabled { opacity: .55; cursor: not-allowed; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(111, 92, 231, .16), transparent 55%),
    var(--bg);
}

.login-card {
  width: min(100%, 410px);
  padding: 42px;
  background: rgba(17, 24, 39, .96);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 25px 90px #0007;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #a397ff, #6252d8);
  color: white;
  font-size: 25px;
  font-weight: 900;
  box-shadow: 0 8px 30px #7766ef44;
}

.brand-mark.small { width: 39px; height: 39px; font-size: 19px; border-radius: 12px; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
}

.login-card .eyebrow { margin-top: 26px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 30px; letter-spacing: -.8px; }
h1 span { color: #a397ff; }
h2 { margin-bottom: 8px; font-size: 20px; }
h3 { margin-bottom: 5px; }
.muted, .subheading, .hint { color: var(--muted); line-height: 1.6; }
.subheading { margin-bottom: 25px; }

label {
  display: block;
  margin: 17px 0 8px;
  color: #cbd4e4;
  font-size: 12px;
  font-weight: 650;
}

input, select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  color: var(--text);
  background: #0b1220;
  border: 1px solid #2a3650;
  border-radius: 9px;
  outline: none;
  transition: border .2s, box-shadow .2s;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #8b7cff20;
}

button[type="submit"], .form-submit button {
  min-height: 44px;
  padding: 0 18px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 0;
  border-radius: 9px;
  font-weight: 750;
  transition: filter .2s, transform .2s;
}

button[type="submit"]:hover, .form-submit button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.login-card button[type="submit"] { width: 100%; margin-top: 22px; }
.login-card button span { float: right; }
.footnote { margin: 22px 0 0; color: #657187; font-size: 11px; text-align: center; }

.error { margin: 12px 0; color: #ff8994; font-size: 12px; }
.success { margin: 12px 0; color: #62dca5; font-size: 12px; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: 248px;
  padding: 25px 16px 16px;
  background: #0d1321;
  border-right: 1px solid #202b40;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 7px 34px; }
.sidebar-brand strong { display: block; font-size: 13px; }
.sidebar-brand small { display: block; margin-top: 4px; color: #68758c; font-size: 9px; letter-spacing: 1.5px; }

.nav-label {
  margin: 14px 10px 10px;
  color: #64718a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.navigation { display: grid; gap: 5px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  color: #9aa7bc;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
  font-size: 13px;
  transition: .18s;
}

.nav-item span { width: 18px; color: #8591a8; font-size: 17px; text-align: center; }
.nav-item:hover { color: white; background: #171f31; }
.nav-item.active { color: white; background: #242344; border-color: #3b376e; }
.nav-item.active span { color: #a397ff; }

.sidebar-bottom { margin-top: auto; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 7px; border-top: 1px solid #202b40; }
.avatar {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #dcd7ff;
  background: #302c59;
  border: 1px solid #514a8c;
  border-radius: 11px;
  font-weight: 800;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-info strong { display: block; overflow: hidden; max-width: 150px; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sidebar-user-info small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }

.logout-button {
  width: 100%;
  padding: 11px;
  color: #e58b94;
  background: #281a28;
  border: 1px solid #482735;
  border-radius: 8px;
  text-align: left;
  font-size: 12px;
}
.logout-button:hover { background: #38202e; }
.sidebar-version { margin: 17px 0 0; color: #566178; font-size: 9px; letter-spacing: 1px; text-align: center; }

.main-content { min-height: 100vh; margin-left: 248px; }
.topbar {
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 42px;
  background: #0c1220;
  border-bottom: 1px solid #202b40;
}
.topbar .eyebrow { margin-bottom: 6px; }
.topbar h1 { margin: 0; font-size: 23px; }
.topbar-right { display: flex; align-items: center; gap: 9px; color: #9aa7bc; font-size: 11px; }
.online-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 12px #39c98a88; }

.page-content { width: min(100%, 1200px); margin: 0 auto; padding: 34px 42px 25px; }
.welcome-panel {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 180px;
  overflow: hidden;
  padding: 30px 34px;
  background: linear-gradient(110deg, #211f43, #171d35 65%, #17243b);
  border: 1px solid #39375f;
  border-radius: 15px;
}
.welcome-panel h2 { margin-bottom: 8px; font-size: 27px; }
.welcome-panel .muted { margin: 0; }
.welcome-symbol { color: #ffffff0b; font-size: 145px; font-weight: 950; line-height: .8; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 20px 0; }
.stat-card, .content-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.stat-card { min-width: 0; padding: 20px; }
.stat-icon { width: 35px; height: 35px; display: grid; place-items: center; margin-bottom: 16px; color: #b2a8ff; background: #29264b; border-radius: 10px; font-size: 17px; }
.stat-card p { margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.stat-card h3 { overflow: hidden; margin-bottom: 5px; text-overflow: ellipsis; font-size: 19px; }
.stat-card small { color: #68758a; font-size: 10px; }
.stat-card .stat-date { font-size: 15px; }

.content-card { margin-bottom: 18px; padding: 23px; }
.card-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-heading { margin-bottom: 17px; }
.card-heading .eyebrow, .section-heading .eyebrow { margin-bottom: 5px; }
.card-heading h2, .section-heading h2 { margin: 0; }
.card-heading h2 { font-size: 17px; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { font-size: 24px; }
.section-heading .muted { margin: 7px 0 0; font-size: 12px; }

.secondary-button, .small-button {
  padding: 9px 13px;
  color: #c3cbe0;
  background: #1a2437;
  border: 1px solid #303d57;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
}
.secondary-button:hover, .small-button:hover { background: #26334c; }
.small-button { padding: 7px 10px; }
.danger-button { color: #f18a95; background: #2b1d2b; border-color: #533044; }
.danger-button:hover { background: #402333; }
.count-label, .level-pill { padding: 6px 9px; color: #bcb4ff; background: #29264b; border-radius: 7px; font-size: 10px; font-weight: 750; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid label { margin-top: 4px; }
.form-submit { display: flex; align-items: end; padding-bottom: 0; }
.form-submit button { width: 100%; }

.users-list { display: grid; }
.user-row, .session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 0;
  border-bottom: 1px solid #253149;
}
.user-row:last-child, .session-row:last-child { border-bottom: 0; }
.user-main { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.user-details strong, .user-details small, .session-row small { display: block; }
.user-details strong { margin-bottom: 5px; font-size: 13px; }
.user-details small, .session-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.user-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.status { display: inline-block; padding: 5px 8px; border-radius: 6px; font-size: 9px; font-weight: 750; }
.status-active { color: #6fe0ad; background: #16352f; }
.status-disabled { color: #f1bd76; background: #3a2b1d; }
.status-root { color: #c2baff; background: #2c2850; }

.logs-list { display: grid; }
.log-row { padding: 15px 0; border-bottom: 1px solid #253149; }
.log-row:last-child { border-bottom: 0; }
.log-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.log-row p { margin: 7px 0; color: #c0c9d9; font-size: 12px; }
.log-row small, .log-details { display: block; margin-top: 5px; color: #7e8ba2; font-size: 10px; overflow-wrap: anywhere; }
.log-details { color: #69768d !important; }

.security-form { max-width: 470px; }
.security-form label:first-child { margin-top: 0; }
.security-form button { margin-top: 17px; min-width: 160px; }
.session-row { align-items: center; }
.session-row > div { min-width: 0; }
.session-row strong { display: block; margin-bottom: 7px; font-size: 12px; }
.session-row .small-button { flex: 0 0 auto; }

.main-footer { padding: 15px 42px 25px; color: #58657b; font-size: 10px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #03060dcc;
  backdrop-filter: blur(7px);
}
.modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 28px;
  background: #141c2c;
  border: 1px solid #34415d;
  border-radius: 15px;
  box-shadow: 0 25px 90px #0009;
}
.modal-card h2 { margin-bottom: 18px; }
.modal-close {
  position: absolute;
  top: 13px;
  right: 15px;
  color: #9aa7bc;
  background: transparent;
  border: 0;
  font-size: 25px;
}
.modal-card button[type="submit"] { width: 100%; margin-top: 17px; }
.modal-card .muted { font-size: 12px; }

@media (max-width: 900px) {
  .sidebar { width: 210px; }
  .main-content { margin-left: 210px; }
  .page-content { padding: 25px 22px; }
  .topbar { padding: 20px 22px; }
  .stats-grid { grid-template-columns: 1fr; }
  .user-row { align-items: flex-start; flex-direction: column; }
  .user-meta { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .sidebar {
    position: relative;
    width: 100%;
    min-height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid #202b40;
  }
  .sidebar-brand { padding: 0 5px 12px; }
  .sidebar .nav-label, .sidebar-bottom { display: none; }
  .navigation { display: flex; overflow-x: auto; gap: 5px; }
  .nav-item { width: auto; flex: 0 0 auto; padding: 10px; white-space: nowrap; }
  .main-content { margin-left: 0; }
  .topbar { min-height: 80px; }
  .topbar-right { display: none; }
  .page-content { padding: 20px 14px; }
  .welcome-panel { min-height: 145px; padding: 23px; }
  .welcome-panel h2 { font-size: 22px; }
  .welcome-symbol { font-size: 95px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-submit { padding-top: 15px; }
  .section-heading { align-items: flex-start; }
  .content-card { padding: 17px; }
  .login-card { padding: 30px 24px; }
  .session-row { align-items: flex-start; }
}
