/* ============================================================
   AnyPlace — Main Stylesheet
   Design system: light-first, CSS custom properties,
   violet accent (#6B4EFF), clean modern typography.
   Dark mode applied via [data-theme="dark"] on <html>.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Lora:ital@1&display=swap');

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Design Tokens — Light Mode ────────────────────────── */
:root {
  /* Colours */
  --accent:          #6B4EFF;
  --accent-hover:    #5a3fe6;
  --accent-light:    #f0edff;
  --accent-dark:     #4535cc;
  --secondary:       #FF6B4E;
  --secondary-light: #fff0ed;
  --success:         #10b981;
  --warning:         #f59e0b;
  --danger:          #ef4444;
  --danger-light:    #fff1f1;

  /* Backgrounds */
  --bg:              #f8f9fc;
  --bg-hero:         linear-gradient(140deg, #eaf4ff 0%, #f8f9fc 45%, #f0edff 100%);
  --surface:         #ffffff;
  --surface-2:       #f4f5f9;
  --surface-3:       #edeef4;
  --overlay:         rgba(13,15,26,0.5);

  /* Text */
  --text-1:          #0d0f1a;
  --text-2:          #4b5263;
  --text-3:          #8b92a5;
  --text-invert:     #ffffff;

  /* Borders */
  --border:          #e4e6ef;
  --border-2:        #d0d3e0;

  /* Shadows */
  --shadow-xs:       0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:       0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:       0 4px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:       0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-accent:   0 8px 24px rgba(107,78,255,0.25);

  /* Radius */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 100px;

  /* Typography */
  --font:        'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-serif:  'Lora', Georgia, serif;

  /* Layout */
  --nav-h:       68px;
  --content-w:   1160px;
  --gap:         24px;

  /* Transitions */
  --t:  0.18s ease;
  --t2: 0.3s ease;
}

/* ── Dark Mode Tokens ───────────────────────────────────── */
[data-theme="dark"] {
  --bg:              #0d0f1a;
  --bg-hero:         linear-gradient(140deg, #0d1520 0%, #0d0f1a 45%, #110d20 100%);
  --surface:         #151722;
  --surface-2:       #1c1f30;
  --surface-3:       #23273a;
  --overlay:         rgba(0,0,0,0.7);

  --text-1:          #f0f2fc;
  --text-2:          #9499b0;
  --text-3:          #5a607a;
  --text-invert:     #0d0f1a;

  --border:          #242740;
  --border-2:        #2e3250;

  --accent-light:    #1c1830;
  --secondary-light: #201510;
  --danger-light:    #200d0d;

  --shadow-xs:       0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm:       0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:       0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:       0 12px 40px rgba(0,0,0,0.6);
  --shadow-accent:   0 8px 24px rgba(107,78,255,0.35);
}

/* ── Base Styles ────────────────────────────────────────── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--t2), color var(--t2);
}

main { flex: 1; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-1);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.lead  { font-size: 1.125rem; color: var(--text-2); line-height: 1.75; }

/* ── Layout Utilities ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-w);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section { padding-block: 80px; }
.section-sm { padding-block: 48px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }

@media (max-width: 900px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section { padding-block: 56px; }
}

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm      { gap: 8px; }
.gap-md      { gap: 16px; }
.gap-lg      { gap: 24px; }
.text-center { text-align: center; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(248,249,252,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t2), border-color var(--t2);
}

[data-theme="dark"] .navbar {
  background: rgba(13,15,26,0.88);
}

.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.navbar-brand {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.navbar-brand .brand-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  display: block;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-pill);
  transition: background var(--t), color var(--t);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--surface-2);
  color: var(--text-1);
}

.navbar-nav a.active {
  background: var(--accent-light);
  color: var(--accent);
}

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

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: all var(--t);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .navbar-nav, .navbar-actions .btn:not(.btn-icon) {
    display: none;
  }
  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(107,78,255,0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}
.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}

.card-body { padding: 20px; }
.card-img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  background: var(--surface-2);
}

/* App card */
.app-card { text-decoration: none; display: block; color: inherit; }

.app-card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface-2);
  overflow: hidden;
}

.app-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t2);
}

.app-card:hover .app-card-thumb img { transform: scale(1.04); }

.nsfw-blur img { filter: blur(20px); }
.nsfw-badge {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.nsfw-badge .badge-label {
  background: rgba(0,0,0,0.6);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.nsfw-revealed .nsfw-badge  { display: none; }
.nsfw-revealed img           { filter: none; }

.app-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-card-genre {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.app-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
}

.app-card-desc {
  font-size: 0.85rem;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Badges / Tags ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
}

.badge-accent   { background: var(--accent-light);    color: var(--accent); }
.badge-success  { background: #d1fae5;                color: #065f46; }
.badge-warning  { background: #fef3c7;                color: #92400e; }
.badge-danger   { background: var(--danger-light);    color: var(--danger); }
.badge-nsfw     { background: #fef3c7; color: #92400e; }

[data-theme="dark"] .badge-success { background: #064433; color: #34d399; }
[data-theme="dark"] .badge-warning { background: #3d2f00; color: #fbbf24; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 0.9rem;
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107,78,255,0.12);
}

.form-control::placeholder { color: var(--text-3); }

textarea.form-control { resize: vertical; min-height: 120px; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b92a5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-hint  { font-size: 0.8rem; color: var(--text-3); }
.form-error { font-size: 0.8rem; color: var(--danger); }

.form-control.is-invalid {
  border-color: var(--danger);
  background-color: color-mix(in srgb, var(--danger) 5%, var(--bg-card));
}
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}
.alert-error, .alert-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fecaca;
}
.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.alert-info {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: #c4b5fd;
}

[data-theme="dark"] .alert-success { background: #064433; color: #34d399; border-color: #065f46; }
[data-theme="dark"] .alert-warning { background: #3d2f00; color: #fbbf24; border-color: #78350f; }

/* ── Section headings ───────────────────────────────────── */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 32px;
}

.section-title h2 { font-size: 1.5rem; }

.section-title a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-left: auto;
}
.section-title a:hover { text-decoration: underline; }

/* ── Hero Section ───────────────────────────────────────── */
.hero {
  background: var(--bg-hero);
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107,78,255,0.08) 0%, transparent 70%);
  top: -100px; left: -100px;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,78,0.06) 0%, transparent 70%);
  bottom: -80px; right: -80px;
  pointer-events: none;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 2rem);
  color: var(--text-2);
  margin-top: 8px;
  display: block;
}

.hero-desc {
  max-width: 560px;
  margin: 20px auto 36px;
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Genre Grid ─────────────────────────────────────────── */
.genre-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--t);
  white-space: nowrap;
}

.genre-pill:hover, .genre-pill.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.genre-pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── App Detail Page ────────────────────────────────────── */
.app-hero {
  background: var(--bg-hero);
  padding: 48px 0;
}

.app-screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.app-screenshot {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  cursor: pointer;
}

.app-screenshot img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t2);
}

.app-screenshot:hover img { transform: scale(1.03); }

.app-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.app-meta-item {
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.app-meta-item .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.app-meta-item .value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--t);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn:hover:not(.active) { color: var(--text-1); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Comments ───────────────────────────────────────────── */
.comment {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.comment:last-child { border-bottom: none; }

.comment-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.comment-body { flex: 1; }

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-username { font-weight: 700; font-size: 0.9rem; }
.comment-time { font-size: 0.78rem; color: var(--text-3); }
.comment-text { font-size: 0.9rem; color: var(--text-2); line-height: 1.65; }

/* ── Forum ──────────────────────────────────────────────── */
.forum-category-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all var(--t);
}

.forum-category-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.forum-category-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.forum-thread-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.forum-thread-row:last-child { border-bottom: none; }

.forum-thread-pin { color: var(--accent); flex-shrink: 0; }

.forum-thread-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.forum-thread-title a { color: var(--text-1); }
.forum-thread-title a:hover { color: var(--accent); }

.forum-thread-meta { font-size: 0.78rem; color: var(--text-3); flex-shrink: 0; }

.forum-post {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 20px;
}

.forum-post-author {
  width: 110px;
  flex-shrink: 0;
  text-align: center;
}

.forum-post-author img {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  background: var(--surface-2);
}

.forum-post-author .username {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-1);
}

.forum-post-content { flex: 1; }
.forum-post-content .post-time { font-size: 0.78rem; color: var(--text-3); margin-bottom: 12px; }
.forum-post-content .body { font-size: 0.9rem; line-height: 1.75; color: var(--text-2); }

/* Markdown rendered output */
.markdown p        { margin-bottom: 12px; }
.markdown h3, .markdown h4 { margin: 20px 0 8px; color: var(--text-1); }
.markdown ul, .markdown ol { padding-left: 20px; margin-bottom: 12px; }
.markdown li       { margin-bottom: 4px; }
.markdown code     { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; font-family: 'Courier New', monospace; color: var(--secondary); }
.markdown pre      { background: var(--surface-2); border: 1px solid var(--border); padding: 16px; border-radius: var(--r-md); overflow-x: auto; margin-bottom: 12px; }
.markdown pre code { background: none; padding: 0; color: var(--text-1); }
.markdown blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-2); font-style: italic; margin-bottom: 12px; }
.markdown a        { color: var(--accent); text-decoration: underline; }
.markdown hr       { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── News / Blog ────────────────────────────────────────── */
.news-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 24px;
  align-items: start;
}

@media (max-width: 600px) {
  .news-card { grid-template-columns: 1fr; }
}

.news-card-date {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 8px;
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.news-card-title a { color: var(--text-1); }
.news-card-title a:hover { color: var(--accent); }

.news-card-excerpt { font-size: 0.9rem; color: var(--text-2); }

/* ── User Avatar ────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }

/* Default avatar (initials) */
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 50%;
}

/* ── Notification Bell ──────────────────────────────────── */
.notif-bell {
  position: relative;
}

.notif-count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.notif-bell.open .notif-dropdown { display: block; }

.notif-header {
  padding: 14px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-list { max-height: 340px; overflow-y: auto; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  text-decoration: none;
  color: inherit;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-light); }
.notif-item.unread:hover { background: #e4dfff; }
[data-theme="dark"] .notif-item.unread:hover { background: #221c40; }

.notif-item-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: var(--accent);
}

.notif-item-body { flex: 1; }
.notif-item-msg  { font-size: 0.82rem; line-height: 1.45; color: var(--text-1); }
.notif-item-time { font-size: 0.73rem; color: var(--text-3); margin-top: 2px; }

.notif-empty {
  padding: 28px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.875rem;
}

/* ── Dashboard Sidebar ──────────────────────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
}

.dash-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.dash-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.dash-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--t);
}

.dash-nav a:hover, .dash-nav a.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--t);
}

.pagination a:hover { background: var(--surface-2); color: var(--text-1); }

.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-3);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 { color: var(--text-2); margin-bottom: 8px; }
.empty-state p  { font-size: 0.9rem; margin-bottom: 24px; }

/* ── Modal (lightbox) ───────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-body { padding: 24px; }

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

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

.footer-brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 10px; }
.footer-tagline { font-size: 0.85rem; color: var(--text-3); line-height: 1.6; }

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-2);
  transition: color var(--t);
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-3);
  flex-wrap: wrap;
  gap: 10px;
}

.footer-anytech { display: flex; align-items: center; gap: 6px; }
.footer-anytech span { font-weight: 600; color: var(--text-2); }

/* ── Theme Toggle ───────────────────────────────────────── */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
  font-size: 1rem;
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

/* Show sun in dark mode, moon in light mode */
.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── Utility ────────────────────────────────────────────── */
.divider      { height: 1px; background: var(--border); margin-block: 28px; }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-3); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.775rem; }
.fw-700       { font-weight: 700; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mt-32        { margin-top: 32px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.mb-32        { margin-bottom: 32px; }

/* ── Skeleton Loading ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Lightbox ───────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img  { max-width: 92vw; max-height: 88vh; border-radius: var(--r-md); box-shadow: var(--shadow-lg); }

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .navbar, .footer, .btn, .sidebar { display: none !important; }
}
