/* dashboard.css — Authenticated app shell styles */

/* === Layout === */
.dash-body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: block;
}

.dash-layout {
  display: flex;
  min-height: 100vh;
  margin-left: 240px; /* sidebar width */
}

/* === Sidebar === */
.dash-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  margin-bottom: 24px;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.sidebar-brand:hover {
  color: var(--accent-light);
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg-muted);
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--fg);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-light);
  border: 1px solid rgba(108, 92, 231, 0.2);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  font-family: var(--font-display);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid rgba(108, 92, 231, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-light);
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-form {
  flex-shrink: 0;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-dim);
  font-size: 16px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.logout-btn:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}

/* === Main content === */
.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-topbar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
}

.dash-content {
  padding: 32px 28px;
  max-width: 1100px;
}

/* === Dashboard home === */
.dash-welcome {
  margin-bottom: 32px;
}

.dash-welcome h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.dash-welcome p {
  font-size: 15px;
  color: var(--fg-muted);
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px;
}

.stat-card-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}

.stat-card-sub {
  font-size: 12px;
  color: var(--fg-dim);
}

/* Onboarding card */
.onboarding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px;
}

.onboarding-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 20px;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.onboard-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.onboard-step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.onboard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid rgba(108, 92, 231, 0.25);
  color: var(--accent-light);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboard-step-text {
  flex: 1;
  min-width: 0;
}

.onboard-step-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
}

.onboard-step-text span {
  font-size: 13px;
  color: var(--fg-muted);
}

.onboard-action {
  color: var(--accent-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.onboard-action:hover {
  text-decoration: underline;
}

/* === Empty state === */
.empty-state {
  text-align: center;
  padding: 80px 40px;
}

.empty-state.compact {
  padding: 20px 0 4px;
  text-align: left;
}

.empty-icon {
  font-size: 32px;
  color: var(--fg-dim);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 15px;
  color: var(--fg-muted);
  max-width: 420px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.empty-state.compact p {
  margin: 0;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Settings === */
.settings-section {
  margin-bottom: 32px;
}

.settings-heading {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-card.danger {
  border-color: rgba(255, 80, 80, 0.2);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

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

.settings-row-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-row-label strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.settings-row-label span {
  font-size: 13px;
  color: var(--fg-muted);
}

.btn-danger {
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.25);
  border-radius: 7px;
  color: #ff7070;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger:hover {
  background: rgba(255, 80, 80, 0.18);
}

/* === Mobile overlay === */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.nav-overlay.active {
  display: block;
}

/* === Responsive === */
@media (max-width: 900px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dash-layout {
    margin-left: 0;
  }

  .dash-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .dash-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .menu-toggle {
    display: block;
  }

  .topbar-title {
    font-size: 16px;
  }

  .dash-content {
    padding: 20px 16px;
  }

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

  .onboard-action {
    display: none;
  }
}

@media (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }

  .onboarding-card {
    padding: 20px 16px;
  }
}
