/* ============================================================
   LAYOUT — Header, Main Container
   ============================================================ */
.app-header {
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .app-header {
  background: linear-gradient(135deg, #0a0a14 0%, #111827 50%, #0f172a 100%);
}

.app-header .btn-ghost,
.app-header .btn-icon {
  color: rgba(255,255,255,0.85);
}
.app-header .btn-ghost:hover,
.app-header .btn-icon:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: white;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 2px 10px rgba(67, 97, 238, 0.4);
  transition: all var(--transition);
}

.brand-logo:hover {
  transform: rotate(-5deg) scale(1.1);
  box-shadow: 0 4px 16px rgba(67, 97, 238, 0.5);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-pill {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-weight: 600;
}

.user-pill .badge {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
}

main.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* ─── Page greeting / hero banner ─── */
.page-hero {
  background: var(--grad);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  margin-bottom: 24px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.page-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.page-hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.page-hero h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
  position: relative;
}

.page-hero p {
  opacity: 0.85;
  font-size: 0.9rem;
  position: relative;
}

/* ============================================================
   GRID SYSTEM
   ============================================================ */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex {
  display: flex;
}

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

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

.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.fw-bold { font-weight: 700; }
