.dash-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --- sidebar --- */
.dash-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: rgba(15, 11, 21, 0.6);
}
.dash-logo {
  padding: 0 8px;
  margin-bottom: 28px;
}
.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.dash-nav-item:hover {
  background: var(--card);
  color: var(--text);
}
.dash-nav-item.active {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
}
.dash-nav-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.dash-nav-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 12px 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  cursor: pointer;
}
.dash-chevron {
  font-size: 12px;
  transition: transform 0.15s ease;
}
.dash-nav-section-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: 400px;
  transition: max-height 0.2s ease;
}
.dash-nav-section-body.collapsed {
  max-height: 0;
}
.dash-nav-section-head.collapsed .dash-chevron {
  transform: rotate(-90deg);
}
.dash-nav-subitem {
  padding-left: 14px;
  font-size: 13px;
}
.dash-nav-locked {
  color: #6b6675;
  cursor: not-allowed;
}
.dash-nav-locked:hover {
  background: none;
  color: #6b6675;
}
.dash-lock {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.7;
}

.dash-sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.dash-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
}
.dash-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.dash-user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.dash-user-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.dash-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-user-tier {
  font-size: 11px;
  color: var(--muted);
}
.dash-logout-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.dash-logout-btn:hover {
  color: var(--pink);
  border-color: var(--pink);
}

/* --- main --- */
.dash-main {
  flex: 1;
  min-width: 0;
  padding: 34px 40px 60px;
}
.dash-welcome h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}
.dash-welcome p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 26px;
}

.dash-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}
.dash-action-btn { width: auto; }

.l-btn-purple {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  box-shadow: 0 8px 26px -8px rgba(124, 58, 237, 0.6);
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.dash-stat-card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
}
.dash-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 14px;
}
.dash-stat-card h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.dash-stat-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
}
.dash-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.dash-status-dot.online {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}
.dash-status-dot.offline {
  background: #fb7185;
}
.dash-stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.dash-lower {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
.dash-logs {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 20px 22px;
}
.dash-logs h2 {
  font-size: 14.5px;
  font-weight: 800;
  margin: 0 0 16px;
}
.dash-log-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.dash-log-item:first-of-type { border-top: none; padding-top: 0; }
.dash-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.dash-log-dot-green { background: #4ade80; }
.dash-log-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
}
.dash-log-item p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 6px;
}
.dash-log-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
}

.dash-premium {
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(168, 85, 247, 0.14), rgba(251, 113, 133, 0.08));
  border-radius: 16px;
  padding: 26px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dash-premium-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.dash-premium h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 8px;
}
.dash-premium p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 18px;
}
.dash-premium-btn {
  width: 100%;
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 880px) {
  .dash-layout { flex-direction: column; }
  .dash-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }
  .dash-logo { margin-bottom: 0; }
  .dash-nav { flex-direction: row; }
  .dash-sidebar-footer { border-top: none; padding-top: 0; margin-left: auto; }
  .dash-main { padding: 26px 20px 50px; }
  .dash-stats { grid-template-columns: 1fr; }
  .dash-lower { grid-template-columns: 1fr; }
}
