/* ─────────────────────────────────────────────
   layout.css — App shell, header, stats, filters
   ───────────────────────────────────────────── */

/* ─── App Shell ─── */
.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ─── Header ─── */
header {
  padding: 36px 0 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.wordmark {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.wordmark span { color: var(--accent); }

.header-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Stats Row ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border-hi); }

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  font-family: var(--mono);
}

.stat-num.danger  { color: var(--danger); }
.stat-num.warning { color: var(--warning); }

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── Section Header ─── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-family: var(--mono);
}

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: var(--mono);
  transition: all 0.15s;
}

.filter-btn.active,
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ─── Auth Wall ─── */
#auth-wall {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.35s ease;
}

.auth-logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.auth-logo span { color: var(--accent); }

.auth-sub {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--mono);
  transition: all 0.15s;
}

.auth-tab.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.auth-error {
  font-size: 0.78rem;
  color: var(--danger);
  font-family: var(--mono);
  margin-top: 10px;
  min-height: 20px;
}

/* ─── User Menu ─── */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--mono);
  transition: all 0.15s;
}

.user-btn:hover { border-color: var(--border-hi); color: var(--text); }

.user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 180px;
  z-index: 50;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.user-dropdown.open { display: block; animation: fadeIn 0.15s ease; }

.dropdown-email {
  padding: 8px 10px;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  word-break: break-all;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.82rem;
  text-align: left;
  border-radius: 6px;
  transition: background 0.15s;
}

.dropdown-item:hover { background: var(--surface2); }
.dropdown-item.danger { color: var(--danger); }

/* ─── Responsive ─── */
@media (max-width: 580px) {
  .stats-row { grid-template-columns: 1fr; }
  header { flex-direction: column; align-items: flex-start; }
  .header-right { width: 100%; justify-content: space-between; }
  .auth-card { padding: 28px 20px; }
}
