/* ==========================================================================
   MailPulse — Design System
   Single shared stylesheet for all pages. Mobile-first (base = 375px).
   Breakpoints: 640px / 768px / 960px.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --border: #1f2937;
  --border-input: #374151;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-btn: 0 4px 20px rgba(16, 185, 129, 0.3);
  --shadow-btn-hover: 0 8px 28px rgba(16, 185, 129, 0.45);
  --font: 'Inter', sans-serif;
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  padding: 32px 0 48px;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }

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

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  main {
    padding: 48px 0 64px;
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .page-title {
    font-size: 48px;
  }
}

/* --------------------------------------------------------------------------
   4. Header / footer
   -------------------------------------------------------------------------- */
.site-header {
  position: relative;
  background: rgba(10, 14, 26, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo:hover {
  text-decoration: none;
}

.admin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  border-radius: 999px;
  vertical-align: middle;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
}

.balance-chip {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-input);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.2s, transform 0.2s;
}

.balance-chip:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

.user-chip {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 999px;
  white-space: nowrap;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 20px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.site-header.nav-open .nav-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px 16px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.site-header.nav-open .balance-chip,
.site-header.nav-open .user-chip {
  text-align: center;
  margin-top: 8px;
}

.admin-header {
  border-bottom-color: rgba(245, 158, 11, 0.35);
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-input);
}

.btn-secondary:hover {
  background: var(--border-input);
}

.btn-blue {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.45);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(239, 68, 68, 0.4);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 18px 40px;
  font-size: 18px;
}

.btn-block {
  width: 100%;
}

.btn-pulse {
  animation: pulse 3s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   6. Cards & stats
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.card-hover {
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-delta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
}

.stat-delta.up {
  color: var(--accent);
}

.stat-delta.down {
  color: var(--accent-red);
}

@media (min-width: 960px) {
  .stat-value {
    font-size: 32px;
  }
}

.news-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.news-card-title {
  font-size: 18px;
  font-weight: 600;
}

.news-card-date {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.news-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Auth pages */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
}

.auth-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.auth-logo:hover {
  text-decoration: none;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card .card-title {
  text-align: center;
  font-size: 24px;
  margin-bottom: 4px;
}

.auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.auth-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-secondary);
}

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

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.input-row .input {
  flex: 1;
  min-width: 200px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-row input[type='checkbox'] {
  appearance: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-input);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.checkbox-row input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-row input[type='checkbox']:checked::after {
  content: '✓';
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.search-input {
  max-width: 420px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 42px;
}

/* --------------------------------------------------------------------------
   8. Tables
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  color: var(--text-secondary);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  white-space: nowrap;
}

.table tbody tr {
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

.table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.table th[data-sort]::after {
  content: ' ↕';
  opacity: 0.4;
}

.table th[data-sort].sort-asc::after {
  content: ' ↑';
  opacity: 1;
  color: var(--accent);
}

.table th[data-sort].sort-desc::after {
  content: ' ↓';
  opacity: 1;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   9. Badges / status pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-success {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.12);
}

.badge-info {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.12);
}

.badge-warn {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
}

.badge-danger {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.12);
}

.badge-neutral {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

/* --------------------------------------------------------------------------
   10. Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.page-btn:hover {
  background: var(--border-input);
  text-decoration: none;
}

.page-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.page-ellipsis {
  color: var(--text-secondary);
  padding: 0 4px;
}

.page-info {
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

@media (min-width: 640px) {
  .page-info {
    width: auto;
    margin-bottom: 0;
    margin-right: 8px;
  }
}

/* --------------------------------------------------------------------------
   13. Hero (homepage)
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  animation: glow 4s ease-in-out infinite alternate;
}

.hero-subtitle {
  margin-top: 16px;
  font-size: 18px;
  color: var(--text-secondary);
}

.hero-ctas {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

@media (min-width: 640px) {
  .hero-ctas {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 960px) {
  .hero {
    padding: 64px 0 48px;
  }

  .hero-title {
    font-size: 64px;
  }

  .hero-subtitle {
    font-size: 20px;
  }
}

/* --------------------------------------------------------------------------
   11. Modal
   -------------------------------------------------------------------------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  margin: auto;
}

.modal-dialog .card {
  animation: fadeUp 0.25s ease-out;
}

/* --------------------------------------------------------------------------
   12. Chat (support tickets)
   -------------------------------------------------------------------------- */
.chat {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 85%;
}

.chat-row.operator {
  align-self: flex-start;
}

.chat-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 16px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-input);
}

.chat-row.user .chat-avatar {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.chat-msg {
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.55;
  border-radius: var(--radius-md);
}

.chat-row.operator .chat-msg {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-input);
  border-bottom-left-radius: 4px;
}

.chat-row.user .chat-msg {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-bottom-right-radius: 4px;
}

.chat-msg-meta {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.input:disabled,
.textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   13. Misc — alerts, states, utilities
   -------------------------------------------------------------------------- */
.alert {
  padding: 12px 16px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.alert-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.alert-success {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.alert-info {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.skeleton {
  display: block;
  height: 16px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--border-input) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-input);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  border-radius: 6px;
}

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

.text-green {
  color: var(--accent);
}

.text-blue {
  color: var(--accent-blue);
}

.text-red {
  color: var(--accent-red);
}

/* --------------------------------------------------------------------------
   14. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-btn);
  }
  50% {
    transform: scale(1.03);
    box-shadow: var(--shadow-btn-hover);
  }
}

@keyframes glow {
  from {
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
  }
  to {
    text-shadow: 0 0 40px rgba(16, 185, 129, 0.55);
  }
}

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

/* Scroll reveal: elements start hidden only when JS is available */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pure-CSS load stagger for above-the-fold sections */
.stagger > * {
  animation: fadeUp 0.3s ease-out both;
}

.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.2s; }
.stagger > *:nth-child(4) { animation-delay: 0.3s; }
.stagger > *:nth-child(5) { animation-delay: 0.4s; }
.stagger > *:nth-child(6) { animation-delay: 0.5s; }
.stagger > *:nth-child(7) { animation-delay: 0.6s; }
.stagger > *:nth-child(8) { animation-delay: 0.7s; }

/* --------------------------------------------------------------------------
   15. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   16. User dropdown
   -------------------------------------------------------------------------- */
.user-dropdown {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.user-chip:hover {
  background: rgba(16,185,129,0.18);
  border-color: rgba(16,185,129,0.35);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px;
  z-index: 1000;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: rgba(16,185,129,0.1);
  color: var(--accent);
}

.dropdown-item.text-danger {
  color: #ef4444;
}

.dropdown-item.text-danger:hover {
  background: rgba(239,68,68,0.1);
}
