/* ============================================================
   WIT HUB v3 — Design System & Global Styles
   Font: DM Sans (headings) + Inter (body)
   Palette: Deep navy/slate + electric blue + cyan accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- Variables ---- */
:root {
  --bg-base: #060d1a;
  --bg-surface: #0d1829;
  --bg-card: #111f33;
  --bg-card-hover: #162540;
  --bg-elevated: #1a2d45;
  --border: #1e3a5f;
  --border-light: #243d60;

  --text-primary: #e8f0fe;
  --text-secondary: #8ba3c7;
  --text-muted: #4a6280;
  --text-inverse: #060d1a;

  --blue-600: #1d4ed8;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --emerald-500: #10b981;
  --amber-500: #f59e0b;
  --red-500: #ef4444;
  --purple-500: #8b5cf6;

  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.6);
  --shadow-glow: 0 0 32px rgba(59,130,246,.15);

  --transition: .2s ease;
  --font-head: 'DM Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-w: 260px;
  --header-h: 64px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* ---- Typography ---- */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; color: var(--text-primary); }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
p { color: var(--text-secondary); line-height: 1.7; }
.lead { font-size: 1.2rem; font-weight: 400; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-primary-c { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-gradient {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.font-mono { font-family: var(--font-mono); }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-fluid { padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

/* ---- Grid ---- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; align-items: center; gap: .75rem; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ---- Navigation ---- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(6, 13, 26, .92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1.5rem;
}
.navbar-brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-head); font-weight: 800; font-size: 1.35rem;
  color: var(--text-primary) !important;
  letter-spacing: -.02em;
}
.navbar-brand .brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; color: white; font-weight: 700; letter-spacing: .05em;
}
.navbar-nav {
  display: flex; align-items: center; gap: .25rem;
  list-style: none;
}
.navbar-nav a {
  padding: .5rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}
.navbar-actions { display: flex; align-items: center; gap: .5rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.5rem;
  border: none; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
  transition: all var(--transition);
  cursor: pointer; white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,.4); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--primary); }
.btn-accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}
.btn-accent:hover { opacity: .9; color: white; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(6,182,212,.4); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: .4rem 1rem; font-size: .8rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-icon { padding: .6rem; border-radius: var(--radius-sm); }
.btn-icon svg, .btn-icon .icon { width: 1rem; height: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); box-shadow: var(--shadow-glow); }
.card-body { padding: 1.5rem; }
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.card-cover {
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  position: relative; overflow: hidden;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover .cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card-hover));
  color: var(--text-muted); font-size: 2.5rem;
}
.card-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; color: var(--text-primary); }
.card-desc { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
.card-featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-glow); }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; margin-bottom: .4rem;
  font-size: .875rem; font-weight: 600;
  color: var(--text-primary);
}
.form-label span { color: var(--danger); margin-left: .2rem; }
.form-control {
  width: 100%; padding: .7rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { appearance: none; 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='%238ba3c7' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input[type="checkbox"], .form-check input[type="radio"] {
  width: 16px; height: 16px; accent-color: var(--primary);
}

/* ---- Alerts ---- */
.alert {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem; font-weight: 500;
  gap: .5rem;
}
.alert button { background: none; border: none; color: inherit; opacity: .6; font-size: 1.2rem; cursor: pointer; padding: 0 .25rem; }
.alert-success { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.alert-error   { background: rgba(239,68,68,.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3);  }
.alert-info    { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }
.alert-warning { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem;
  border-radius: var(--radius-full);
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-success   { background: rgba(16,185,129,.2);  color: #6ee7b7; }
.badge-error     { background: rgba(239,68,68,.2);   color: #fca5a5; }
.badge-warning   { background: rgba(245,158,11,.2);  color: #fcd34d; }
.badge-info      { background: rgba(59,130,246,.2);  color: #93c5fd; }
.badge-secondary { background: rgba(139,162,199,.15); color: var(--text-secondary); }
.badge-premium   { background: linear-gradient(135deg, rgba(139,92,246,.3), rgba(6,182,212,.3)); color: #c4b5fd; border: 1px solid rgba(139,92,246,.4); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg-elevated); }
th {
  padding: .85rem 1rem; text-align: left;
  font-size: .8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: .85rem 1rem;
  font-size: .875rem; color: var(--text-secondary);
  border-bottom: 1px solid rgba(30,58,95,.5);
  vertical-align: middle;
}
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: .5rem; align-items: center; }

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: var(--header-h);
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,.12) 0%, transparent 60%),
              radial-gradient(ellipse 60% 40% at 80% 70%, rgba(6,182,212,.08) 0%, transparent 50%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: 0; opacity: .04;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .85rem;
  background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--radius-full);
  font-size: .8rem; font-weight: 600; color: var(--primary-light);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 1.5rem;
}
.hero-title { margin-bottom: 1.25rem; }
.hero-desc { font-size: 1.15rem; max-width: 560px; margin-bottom: 2.5rem; color: var(--text-secondary); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 2rem; margin-top: 3rem;
  padding-top: 2rem; border-top: 1px solid var(--border);
}
.hero-stat-val { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--text-primary); }
.hero-stat-label { font-size: .85rem; color: var(--text-muted); }

/* ---- Section Headers ---- */
.section-header { text-align: center; max-width: 640px; margin: 0 auto 3.5rem; }
.section-eyebrow {
  display: inline-block;
  padding: .3rem .8rem;
  background: rgba(6,182,212,.1); border: 1px solid rgba(6,182,212,.3);
  border-radius: var(--radius-full);
  font-size: .78rem; font-weight: 600; color: var(--cyan-400);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: .85rem;
}
.section-title { margin-bottom: .75rem; }
.section-desc { color: var(--text-secondary); font-size: 1.05rem; }

/* ---- Feature Cards ---- */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.feature-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 48px; height: 48px;
  background: rgba(59,130,246,.15);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1.25rem;
}

/* ---- Pricing Cards ---- */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  transition: all var(--transition);
}
.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-glow);
  transform: scale(1.03);
}
.pricing-card.featured::before {
  content: 'MAIS POPULAR';
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white; font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  padding: .2rem .75rem; border-radius: var(--radius-full);
}
.pricing-price { font-family: var(--font-head); font-size: 2.5rem; font-weight: 800; margin: 1rem 0 .5rem; }
.pricing-price sup { font-size: 1.25rem; font-weight: 600; vertical-align: top; margin-top: .6rem; display: inline-block; }
.pricing-price .cycle { font-size: .9rem; font-weight: 400; color: var(--text-muted); }
.pricing-features { list-style: none; margin: 1.5rem 0 2rem; }
.pricing-features li { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; font-size: .9rem; color: var(--text-secondary); border-bottom: 1px solid rgba(30,58,95,.4); }
.pricing-features li:last-child { border: none; }
.pricing-features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* ---- Admin Layout ---- */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 50;
  display: flex; flex-direction: column;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .6rem;
}
.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-section {
  padding: .5rem 1rem .25rem;
  font-size: .7rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.25rem;
  color: var(--text-secondary);
  font-size: .875rem; font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
}
.sidebar-nav a:hover { color: var(--text-primary); background: rgba(59,130,246,.08); }
.sidebar-nav a.active {
  color: var(--primary-light);
  background: rgba(59,130,246,.1);
  font-weight: 600;
}
.sidebar-nav a.active::before {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 2px; background: var(--primary); border-radius: 0 2px 2px 0;
}
.sidebar-nav .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.admin-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: rgba(13, 24, 41, .9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
}
.admin-content { flex: 1; padding: 2rem 1.5rem; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem;
}
.page-header-info h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.page-header-info p { color: var(--text-muted); font-size: .9rem; }

/* ---- Stats Cards ---- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; align-items: flex-start; gap: 1rem;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-icon.blue { background: rgba(59,130,246,.15); color: var(--blue-400); }
.stat-icon.cyan { background: rgba(6,182,212,.15); color: var(--cyan-400); }
.stat-icon.green { background: rgba(16,185,129,.15); color: var(--emerald-500); }
.stat-icon.amber { background: rgba(245,158,11,.15); color: var(--amber-500); }
.stat-icon.purple { background: rgba(139,92,246,.15); color: var(--purple-500); }
.stat-icon.red { background: rgba(239,68,68,.15); color: var(--red-500); }
.stat-val { font-family: var(--font-head); font-size: 2rem; font-weight: 800; line-height: 1; color: var(--text-primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; margin-top: .2rem; }
.stat-change { font-size: .8rem; margin-top: .4rem; display: flex; align-items: center; gap: .25rem; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; gap: .4rem; margin-top: 1.5rem; justify-content: center; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(59,130,246,.1); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 1.5rem;
}
.filter-bar .form-control { max-width: 200px; }
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap input { padding-left: 2.4rem; width: 100%; }
.search-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .9rem; pointer-events: none; }

/* ---- User Avatar ---- */
.avatar {
  border-radius: 50%; object-fit: cover;
  background: var(--bg-elevated);
  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; }

/* ---- User Menu ---- */
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .75rem .4rem .4rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer; transition: all var(--transition);
}
.user-menu-trigger:hover { border-color: var(--primary); }
.user-menu-name { font-size: .875rem; font-weight: 500; color: var(--text-primary); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + .5rem);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 200px;
  box-shadow: var(--shadow-lg); z-index: 100;
  overflow: hidden; display: none;
}
.dropdown.open { display: block; animation: fadeDown .15s ease; }
.dropdown-header { padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.dropdown-header strong { display: block; font-size: .875rem; color: var(--text-primary); }
.dropdown-header span { font-size: .8rem; color: var(--text-muted); }
.dropdown a {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1rem;
  font-size: .875rem; color: var(--text-secondary);
  transition: all var(--transition);
}
.dropdown a:hover { background: var(--bg-card); color: var(--text-primary); }
.dropdown a.danger { color: var(--danger); }
.dropdown a.danger:hover { background: rgba(239,68,68,.1); }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ---- Footer ---- */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: auto;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand .brand-desc { color: var(--text-muted); font-size: .9rem; margin-top: .75rem; max-width: 280px; }
.footer-col h4 { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-primary); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a { font-size: .875rem; color: var(--text-muted); transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--text-primary); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 2rem; border-top: 1px solid var(--border);
  font-size: .85rem; color: var(--text-muted);
}

/* ---- Auth Pages ---- */
.auth-page {
  min-height: 100vh; display: flex;
  background: var(--bg-base);
}
.auth-left {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 2rem; position: relative; overflow: hidden;
}
.auth-right {
  width: 480px; flex-shrink: 0;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.auth-form-wrap { width: 100%; max-width: 380px; }
.auth-logo { display: flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; margin-bottom: 2.5rem; color: var(--text-primary); }
.auth-title { font-size: 1.75rem; margin-bottom: .5rem; }
.auth-sub { color: var(--text-muted); margin-bottom: 2rem; font-size: .9rem; }

/* ---- User Dashboard ---- */
.dashboard-layout { display: flex; min-height: 100vh; padding-top: var(--header-h); }
.dash-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-surface); border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.dash-main { flex: 1; padding: 2rem; max-width: 960px; }
.plan-badge-card {
  background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(6,182,212,.1));
  border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-bottom: 2rem;
}

/* ---- Animations ---- */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.animate-fade-up   { animation: fadeUp .4s ease both; }
.animate-fade-in   { animation: fadeIn .3s ease both; }

/* ---- Utility ---- */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.p-0 { padding: 0; } .py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.text-center { text-align: center; } .text-right { text-align: right; }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.sticky-top { position: sticky; top: var(--header-h); }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.tag {
  display: inline-flex; padding: .2rem .6rem;
  background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--radius-full); font-size: .75rem; font-weight: 500; color: var(--primary-light);
}
.tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.access-locked {
  position: relative;
  filter: blur(4px); pointer-events: none; user-select: none;
}
.access-lock-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,13,26,.7); border-radius: inherit;
  filter: blur(0);
}
.toggle-switch {
  position: relative; display: inline-block; width: 44px; height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-full); transition: .2s;
}
.toggle-slider:before {
  position: absolute; content: '';
  height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: var(--text-muted); border-radius: 50%; transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); background: white; }
.empty-state {
  text-align: center; padding: 3rem 2rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: .5rem; }

/* ---- Mobile Header toggle ---- */
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; padding: .25rem; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 49; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .auth-left { display: none; }
  .auth-right { width: 100%; border: none; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  .navbar-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .admin-main { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
  .page-header { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: .75rem; text-align: center; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control { max-width: 100%; }
  .dash-sidebar { display: none; }
  .dash-main { padding: 1rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .section { padding: 3rem 0; }
  h1 { font-size: 1.75rem; }
}
