:root {
  --bg: #07070a;
  --panel: #0f0f14;
  --panel-2: #14141a;
  --panel-3: #191920;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f7f7fa;
  --muted: #8d909d;
  --orange: #ff9b17;
  --pink: #ff3f98;
  --purple: #9b46ff;
  --blue: #4f5eff;
  --green: #43d28b;
  --red: #ff6477;
  --yellow: #ffbf48;
  --gradient: linear-gradient(105deg, var(--orange), var(--pink) 45%, var(--purple) 72%, var(--blue));
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --sidebar: 238px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at 85% 5%, rgba(79, 94, 255, 0.07), transparent 24%),
              radial-gradient(circle at 14% 92%, rgba(255, 63, 152, 0.05), transparent 24%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

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

img {
  max-width: 100%;
  display: block;
}

/* =========================================
   LOGIN PAGE STYLES
   ========================================= */
.portal-login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-shell {
  width: min(1050px, 100%);
  min-height: 600px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, #101016, #0b0b10);
  box-shadow: var(--shadow);
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: radial-gradient(circle at 28% 26%, rgba(255, 63, 152, 0.14), transparent 24%),
              radial-gradient(circle at 78% 68%, rgba(79, 94, 255, 0.15), transparent 29%),
              #0b0b10;
}

.login-logo {
  width: 170px !important;
  max-width: 170px !important;
  height: auto !important;
  margin-bottom: 36px;
  display: block;
}

.login-brand-panel h1 {
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin: 10px 0 14px;
  font-weight: 800;
}

.login-brand-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-points {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.login-points span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b0b3be;
  font-size: 12px;
}

.login-points i[data-lucide], .login-points svg.lucide {
  color: var(--green);
  width: 16px;
  height: 16px;
}

.login-card-wrap {
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #0e0e13;
}

.login-card {
  display: grid;
  gap: 16px;
}

.login-card h2 {
  font-size: 28px;
  letter-spacing: -0.04em;
  margin: 2px 0 0;
  font-weight: 800;
}

.login-card > p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.login-card form {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.login-card .primary-button {
  width: 100% !important;
  min-height: 48px;
  margin-top: 14px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  font-size: 11px;
  font-weight: 750;
  color: #a1a4af;
}

.field input {
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #07070b;
  color: #fff;
  padding: 0 14px;
  outline: 0;
  font-size: 13px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus {
  border-color: rgba(255, 63, 152, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 63, 152, 0.08);
}

.form-notice {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.5;
}

.form-notice.error {
  color: #ff9aa6;
  background: rgba(255, 100, 119, 0.08);
  border: 1px solid rgba(255, 100, 119, 0.18);
}

.form-notice.warning {
  color: #e5bd70;
  background: rgba(255, 191, 72, 0.08);
  border: 1px solid rgba(255, 191, 72, 0.18);
}

.login-security {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 6px;
  color: #737784;
}

.login-security p {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
}

.back-link {
  margin-top: 22px;
  color: #777b87;
  font-size: 11px;
  text-align: center;
  display: block;
}

.back-link:hover {
  color: #fff;
}

[hidden], .button-loading[hidden], .button-label[hidden] {
  display: none !important;
}

.button-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.button-loading b {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 20px;
  }
  .login-brand-panel {
    display: none;
  }
  .login-card-wrap {
    padding: 28px 20px;
  }
}

/* =========================================
   PORTAL / DASHBOARD STYLES
   ========================================= */

/* Lucide and Icon styling */
i[data-lucide], svg.lucide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  stroke-width: 2;
  vertical-align: middle;
  flex-shrink: 0;
}

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

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: rgba(9, 9, 12, 0.94);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  z-index: 40;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 10px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand img {
  width: 128px;
  height: auto;
  display: block;
}

.sidebar-brand span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #767985;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.nav-item {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #858894;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s ease;
  position: relative;
  overflow: hidden;
}

.nav-item i[data-lucide], .nav-item svg.lucide {
  color: #727685;
  transition: color 0.16s ease;
}

.nav-item:hover {
  background: #111117;
  color: #fff;
}

.nav-item:hover i[data-lucide], .nav-item:hover svg.lucide {
  color: #d1d5e0;
}

.nav-item.active {
  background: linear-gradient(100deg, rgba(255, 155, 23, 0.10), rgba(255, 63, 152, 0.10), rgba(79, 94, 255, 0.10));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.nav-item.active i[data-lucide], .nav-item.active svg.lucide {
  color: var(--pink);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: var(--gradient);
  box-shadow: 0 0 14px rgba(255, 63, 152, 0.35);
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-foot a, .sidebar-foot button {
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #111118;
  color: #9094a2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 750;
  transition: 0.16s ease;
}

.sidebar-foot button:hover, .sidebar-foot a:hover {
  color: #fff;
  background: #171722;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Main Area & Topbar */
.main-area {
  margin-left: var(--sidebar);
  min-height: 100vh;
  width: calc(100% - var(--sidebar));
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 7, 10, 0.78);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-kicker {
  display: block;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #777a86;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h1 {
  font-size: 20px;
  margin: 2px 0 0;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.mobile-menu {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #111117;
  color: #fff;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #101016;
  color: #9295a4;
  display: grid;
  place-items: center;
  transition: 0.16s ease;
}

.icon-button:hover {
  background: #181822;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Profile Menu Wrap & Avatar (Matched Admin) */
.profile-menu-wrap {
  position: relative;
}

.admin-avatar {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 0;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-image, .profile-menu-avatar {
  display: block;
  overflow: hidden;
  background: #111117;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.profile-avatar-image {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.035);
  transition: border-color 0.2s ease;
}

.admin-avatar:hover .profile-avatar-image {
  border-color: rgba(255, 63, 152, 0.5);
}

.profile-avatar-image img, .profile-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-chevron {
  position: absolute;
  right: -2px;
  bottom: -1px;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #17171d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #8c909b;
  z-index: 2;
  padding: 2px;
  transition: transform 0.2s ease;
}

.profile-menu-wrap.open .avatar-chevron {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  z-index: 150;
  right: 0;
  top: calc(100% + 10px);
  width: 300px;
  padding: 8px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(16, 16, 22, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px) scale(0.985);
  transform-origin: top right;
  transition: 0.18s ease;
}

.profile-menu-wrap.open .profile-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.profile-menu-head {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-menu-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.profile-menu-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-menu-head strong {
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-head small {
  font-size: 9px;
  color: #777b87;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-head em {
  font-size: 8px;
  color: #a58dbd;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-menu-status {
  margin: 8px 3px;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(67, 210, 139, 0.065);
  border: 1px solid rgba(67, 210, 139, 0.18);
  display: flex;
  align-items: center;
  gap: 9px;
}

.profile-menu-status > i[data-lucide] {
  color: var(--green);
  width: 14px;
  height: 14px;
}

.profile-menu-status span {
  display: grid;
  gap: 1px;
}

.profile-menu-status strong {
  font-size: 9px;
  color: #9ceac2;
}

.profile-menu-status small {
  font-size: 8px;
  color: #719784;
}

.profile-menu > button, .profile-menu > a {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #a4a7b1;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 750;
  transition: 0.16s ease;
}

.profile-menu > button:hover, .profile-menu > a:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.profile-menu > button i[data-lucide], .profile-menu > a i[data-lucide] {
  width: 16px;
  height: 16px;
  color: #777b87;
}

.profile-menu > button.danger {
  color: #e98491;
}

.profile-menu > button.danger i[data-lucide] {
  color: #e98491;
}

.profile-menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 6px 4px;
}

/* Content Area & Views */
.content-area {
  padding: 28px 32px 48px;
  width: 100%;
  flex: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 0.26s ease;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.section-label, .eyebrow {
  font-size: 9px;
  letter-spacing: 0.15em;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: uppercase;
}

.welcome-row, .view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

.welcome-row h2, .view-heading h2 {
  margin: 5px 0 5px;
  font-size: 32px;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.welcome-row p, .view-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

/* Buttons */
.primary-action, .secondary-action, .primary-button, .secondary-button {
  height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  transition: 0.18s ease;
}

.primary-action, .primary-button {
  border: 0;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 28px rgba(255, 63, 152, 0.16);
}

.primary-action:hover, .primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.secondary-action, .secondary-button {
  border: 1px solid var(--line);
  background: #111117;
  color: #b4b6bf;
}

.secondary-action:hover, .secondary-button:hover {
  background: #171720;
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
}

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

/* Hero Panel (Overview) */
.hero-panel {
  padding: 26px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 90% 20%, rgba(79, 94, 255, 0.12), transparent 28%),
              radial-gradient(circle at 15% 100%, rgba(255, 63, 152, 0.09), transparent 34%),
              linear-gradient(180deg, #111117, #0d0d12);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.hero-panel h2 {
  font-size: 32px;
  letter-spacing: -0.05em;
  margin: 7px 0 7px;
  font-weight: 800;
}

.hero-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Metric Cards */
.metrics-grid, .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #111117, #0c0c11);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card-head span, .metric-card > span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #656976;
}

.metric-card strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.metric-card small {
  font-size: 11px;
  color: #747884;
}

.metric-card strong.good { color: #78dfaa; }
.metric-card strong.warn { color: #e5bc6d; }
.metric-card strong.bad { color: #ff8593; }

/* Panels & Grids */
.overview-grid, .dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: linear-gradient(180deg, #101016, #0c0c11);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.panel-head h3 {
  font-size: 16px;
  font-weight: 750;
  margin: 4px 0 0;
}

.version-pill, .service-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.version-pill {
  color: #c7b7e1;
  background: #17151e;
  border: 1px solid rgba(155, 70, 255, 0.18);
}

.service-badge.online {
  color: #78dfaa;
  background: rgba(67, 210, 139, 0.08);
  border: 1px solid rgba(67, 210, 139, 0.2);
}

.service-badge.maintenance {
  color: #e9bd67;
  background: rgba(255, 191, 72, 0.08);
  border: 1px solid rgba(255, 191, 72, 0.2);
}

.service-badge.offline {
  color: #ff8290;
  background: rgba(255, 100, 119, 0.08);
  border: 1px solid rgba(255, 100, 119, 0.2);
}

.service-badge.checking {
  color: #9ca0ad;
  background: #17171d;
  border: 1px solid var(--line);
}

.update-panel > p, .service-panel > p {
  margin: 0 0 16px;
  color: #8b8f9b;
  font-size: 12px;
  line-height: 1.65;
}

.update-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.update-meta span {
  font-size: 11px;
  color: #737784;
}

.update-meta strong {
  color: #c3c5cd;
}

.service-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.service-line span {
  color: #777b87;
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-line strong {
  color: #c4c6ce;
}

/* Downloads */
.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.download-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #101016, #0c0c11);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.download-card.featured {
  border-color: rgba(255, 63, 152, 0.22);
  background: radial-gradient(circle at 88% 8%, rgba(79, 94, 255, 0.12), transparent 30%),
              linear-gradient(180deg, #111117, #0c0c11);
}

.download-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 155, 23, 0.16), rgba(155, 70, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.download-card > div {
  display: grid;
  gap: 6px;
}

.download-card small {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #6e7280;
  font-weight: 800;
}

.download-card h3 {
  font-size: 19px;
  margin: 0;
  font-weight: 750;
}

.download-card p {
  margin: 0;
  color: #858995;
  font-size: 12px;
  line-height: 1.6;
}

.download-version {
  font-size: 11px;
  color: #777b87;
  margin-top: 5px;
}

.download-version strong {
  color: #d2d3da;
}

.download-card > a {
  margin-top: auto;
  align-self: flex-start;
}

.security-note {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(67, 210, 139, 0.14);
  background: rgba(67, 210, 139, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.security-note-icon {
  color: var(--green);
  width: 18px !important;
  height: 18px !important;
  margin-top: 2px;
}

.security-note strong {
  font-size: 12px;
  color: #9ce8c2;
  display: block;
}

.security-note p {
  margin: 3px 0 0;
  font-size: 11px;
  color: #74887e;
  line-height: 1.55;
}

/* License View */
.license-panel {
  display: grid;
  gap: 18px;
}

.license-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.license-summary > div, .license-details > div {
  padding: 16px;
  border-radius: 14px;
  background: #0a0a0f;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 5px;
}

.license-summary span, .license-details span {
  font-size: 9px;
  color: #666a76;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 750;
}

.license-summary strong {
  font-size: 18px;
  font-weight: 800;
}

.license-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.license-details strong {
  font-size: 12px;
  color: #c3c5cc;
  overflow: hidden;
  text-overflow: ellipsis;
}

.license-foot {
  padding-top: 4px;
  color: #6f7380;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Status View */
.status-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 22px 26px;
  overflow: hidden;
}

.status-hero > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.status-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
  position: relative;
  background: #646875;
  margin: 0 6px 0 2px;
  align-self: center;
  box-sizing: border-box;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status-orb.online {
  background-color: var(--green);
  box-shadow: 0 0 12px rgba(67, 210, 139, 0.6);
}

.status-orb.online:before {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  margin-left: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(67, 210, 139, 0.7);
  box-sizing: border-box;
  animation: scale-before 3.2s infinite ease-out;
  pointer-events: none;
}

.status-orb.online:after {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  margin-left: -6px;
  border-radius: 50%;
  border: 1px solid rgba(67, 210, 139, 0.45);
  box-sizing: border-box;
  animation: scale-after 3.2s infinite ease-out 0.5s;
  pointer-events: none;
}

.status-orb.maintenance {
  background-color: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 191, 72, 0.5);
}

.status-orb.offline {
  background-color: var(--red);
  box-shadow: 0 0 12px rgba(255, 100, 119, 0.5);
}

.status-orb.checking {
  background-color: #646875;
}

/* Pulse Keyframes (subtle, contained expansion) */
@keyframes scale-before {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    opacity: 0.35;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

@keyframes scale-after {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  30% {
    opacity: 0.5;
  }
  60% {
    opacity: 0.25;
  }
  100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

.status-hero h3 {
  font-size: 19px;
  margin: 4px 0 3px;
  font-weight: 750;
  line-height: 1.25;
}

.status-hero p {
  margin: 0;
  color: #858995;
  font-size: 12px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.status-card {
  padding: 18px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: #101016;
  display: grid;
  gap: 5px;
}

.status-card span {
  font-size: 11px;
  color: #686c78;
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-card strong {
  font-size: 16px;
  font-weight: 750;
}

.status-card small {
  font-size: 10px;
  color: #646875;
}

.last-check {
  margin: 14px 2px 0;
  color: #666a76;
  font-size: 11px;
}

.last-check strong {
  color: #9699a4;
}

/* Account Section & Avatar Picker (Matched Admin) */
.account-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.settings-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.settings-title {
  display: flex;
  gap: 11px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--gradient);
  font-size: 12px;
  color: #fff;
}

.settings-title h3 {
  font-size: 14px;
  font-weight: 750;
  margin: 0 0 3px;
}

.settings-title p {
  margin: 0;
  color: #747884;
  font-size: 10px;
}

.avatar-picker-block {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar-picker-block > div:first-child {
  display: grid;
  gap: 3px;
}

.avatar-picker-block strong {
  font-size: 12px;
  font-weight: 750;
}

.avatar-picker-block small {
  font-size: 10px;
  color: #727683;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.avatar-picker button {
  aspect-ratio: 1;
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #0a0a0f;
  overflow: hidden;
  transition: 0.18s ease;
}

.avatar-picker button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.avatar-picker button.active {
  border-color: rgba(67, 210, 139, 0.7);
  box-shadow: 0 0 0 2px rgba(67, 210, 139, 0.12);
}

.avatar-picker img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

.account-form {
  display: grid;
  gap: 13px;
  margin-top: 17px;
}

.modal-field {
  display: grid;
  gap: 6px;
}

.modal-field > span {
  font-size: 10px;
  font-weight: 800;
  color: #9a9da8;
}

.modal-field input {
  width: 100%;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #0a0a0f;
  color: #fff;
  padding: 0 12px;
  outline: 0;
  font-size: 12px;
}

.modal-field input:focus {
  border-color: rgba(255, 63, 152, 0.38);
  box-shadow: 0 0 0 3px rgba(255, 63, 152, 0.05);
}

.modal-field input:disabled {
  opacity: 0.65;
  background: #07070a;
  cursor: not-allowed;
}

.account-session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 17px 0 14px;
}

.account-session-grid > div {
  padding: 12px;
  border-radius: 12px;
  background: #0a0a0f;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 5px;
  min-width: 0;
}

.account-session-grid small {
  font-size: 8px;
  color: #626673;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.account-session-grid strong {
  font-size: 11px;
  color: #b8bbc5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-session-grid strong.good {
  color: #79dfa9;
}

.danger-account {
  color: #ff8795;
  border-color: rgba(255, 100, 119, 0.16);
  background: rgba(255, 100, 119, 0.045);
}

/* Toast */
.portal-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #131319;
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.2s ease;
}

.portal-toast.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.portal-toast.success {
  border-color: rgba(67, 210, 139, 0.2);
  color: #a0f0c7;
}

.portal-toast.error {
  border-color: rgba(255, 100, 119, 0.25);
  color: #ff9aa6;
}

/* Drawer Backdrop */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 35;
}

.drawer-backdrop.open {
  display: block;
}

/* Scrollbars */
html, * {
  scrollbar-width: thin;
  scrollbar-color: #7138a8 #0a0a0e;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: #0a0a0e;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff4d9f 0%, #a047ff 52%, #5865ff 100%);
  border: 2px solid #0a0a0e;
  border-radius: 999px;
  min-height: 38px;
}

/* Responsive queries */
@media (max-width: 900px) {
  .overview-grid, .download-grid, .account-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid, .metric-grid, .license-details {
    grid-template-columns: repeat(2, 1fr);
  }
  .status-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar: 220px;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: none;
  }
  .main-area {
    margin-left: 0;
  }
  .mobile-menu {
    display: flex;
  }
  .topbar {
    padding: 0 16px;
  }
  .content-area {
    padding: 18px;
  }
}

@media (max-width: 600px) {
  .topbar {
    height: 68px;
  }
  .content-area {
    padding: 14px;
  }
  .welcome-row, .view-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .welcome-row h2, .view-heading h2 {
    font-size: 27px;
  }
  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }
  .hero-panel h2 {
    font-size: 26px;
  }
  .hero-actions {
    width: 100%;
  }
  .hero-actions > * {
    flex: 1;
  }
  .metrics-grid, .metric-grid, .license-summary, .license-details, .status-grid, .account-session-grid {
    grid-template-columns: 1fr;
  }
  .avatar-picker {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  .avatar-picker button {
    padding: 3px;
  }
  .profile-menu {
    width: min(300px, calc(100vw - 28px));
    right: -2px;
  }
}
