/* ============================================
   CrewBoard - Design System
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f35;
  --bg-card-hover: #222845;
  --bg-glass: rgba(26, 31, 53, 0.7);
  --bg-input: #151b2e;

  --accent-primary: #6366f1;
  --accent-primary-hover: #818cf8;
  --accent-primary-glow: rgba(99, 102, 241, 0.3);
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --accent-gradient-hover: linear-gradient(135deg, #818cf8, #a78bfa);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a5b4fc;

  --border-color: rgba(99, 102, 241, 0.15);
  --border-color-hover: rgba(99, 102, 241, 0.35);

  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);

  /* YouTube / FB / IG colors */
  --yt-color: #ff0000;
  --fb-color: #1877f2;
  --ig-color: #e4405f;
  --yt-bg: rgba(255, 0, 0, 0.1);
  --fb-bg: rgba(24, 119, 242, 0.1);
  --ig-bg: rgba(228, 64, 95, 0.1);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-primary-glow);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 2rem;
  --font-4xl: 2.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-primary-hover);
}

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

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================
   Layout
   ============================================ */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex: 1;
  padding: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-xl);
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
}

.navbar-brand svg {
  width: 28px;
  height: 28px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
}

.navbar-nav a,
.navbar-nav button {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav button:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.navbar-nav a.active {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.navbar-user .user-email {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* --- Role Badge --- */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

.role-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  animation: shine 3s infinite;
}

.role-badge.editor {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.role-badge.advertiser {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary-hover);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.role-badge.admin {
  background: linear-gradient(90deg, #d97706, #fbbf24);
  color: white !important;
  border: 1px solid #f59e0b;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Stat Card --- */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card .stat-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: var(--font-3xl);
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xl);
}

.stat-card.yt .stat-icon { background: var(--yt-bg); }
.stat-card.fb .stat-icon { background: var(--fb-bg); }
.stat-card.ig .stat-icon { background: var(--ig-bg); }
.stat-card.total .stat-icon { background: rgba(99, 102, 241, 0.1); }

.stat-card.yt .stat-value { background: var(--yt-color); -webkit-background-clip: text; background-clip: text; }
.stat-card.fb .stat-value { background: var(--fb-color); -webkit-background-clip: text; background-clip: text; }
.stat-card.ig .stat-value { background: var(--ig-color); -webkit-background-clip: text; background-clip: text; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-xs);
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--font-base);
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.form-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

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

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ============================================
   Auth Page
   ============================================ */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: var(--space-lg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: var(--font-2xl);
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-xs);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  margin-bottom: var(--space-xl);
}

.auth-card .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: var(--font-base);
  margin-top: var(--space-sm);
}

.auth-toggle {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.auth-toggle a {
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
}

/* --- Role Selector --- */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.role-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.role-option:hover {
  border-color: var(--border-color-hover);
}

.role-option.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.role-option .role-icon {
  font-size: 2rem;
}

.role-option .role-name {
  font-weight: 700;
  font-size: var(--font-sm);
}

.role-option .role-desc {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

/* ============================================
   Page Headers
   ============================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-header h1 {
  font-size: var(--font-2xl);
  font-weight: 800;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

/* --- Month Selector --- */
.month-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
}

.month-selector .btn-icon {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: var(--font-lg);
}

.month-selector .btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.month-selector .current-month {
  font-weight: 700;
  min-width: 160px;
  text-align: center;
  font-size: var(--font-sm);
}

/* ============================================
   Clip Card
   ============================================ */
.clip-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.clip-card {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  align-items: center;
}

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

.clip-thumbnail {
  width: 160px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-input);
}

.clip-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.clip-info .clip-title {
  font-weight: 700;
  font-size: var(--font-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-info .clip-date {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.clip-views {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.view-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
}

.view-badge.yt { background: var(--yt-bg); color: var(--yt-color); }
.view-badge.fb { background: var(--fb-bg); color: var(--fb-color); }
.view-badge.ig { background: var(--ig-bg); color: var(--ig-color); }

.clip-actions {
  display: flex;
  gap: var(--space-xs);
}

/* --- Shorts Badge --- */
.shorts-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 700;
  background: rgba(255, 0, 0, 0.15);
  color: #ff4444;
  border: 1px solid rgba(255, 0, 0, 0.3);
}

/* --- Ad Work Badge --- */
.adwork-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 700;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ============================================
   Calendar
   ============================================ */
.calendar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-header-cell {
  padding: var(--space-sm);
  text-align: center;
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  position: relative;
}

.calendar-cell:hover {
  background: var(--bg-card-hover);
}

.calendar-cell.today {
  border: 1px solid var(--accent-primary);
}

.calendar-cell.has-work {
  color: var(--text-primary);
  font-weight: 700;
}

.calendar-cell.has-work::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  position: absolute;
  bottom: 6px;
}

.calendar-cell.other-month {
  color: var(--text-muted);
  opacity: 0.4;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
  padding: var(--space-md);
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-header h2 {
  font-size: var(--font-xl);
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   Toast
   ============================================ */
#toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  font-size: var(--font-sm);
  font-weight: 500;
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 280px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

.toast.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

/* ============================================
   Sections & Tabs
   ============================================ */
.section-title {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-lg);
}

.tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-family);
  text-align: center;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ============================================
   Chart Container
   ============================================ */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.chart-container canvas {
  max-height: 300px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ============================================
   Settings
   ============================================ */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.settings-section h3 {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ============================================
   Portal Theme
   ============================================ */
.portal-page {
  min-height: 100vh;
  position: relative;
}

.portal-page .portal-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: brightness(0.3);
}

.portal-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-xl);
}

/* ============================================
   Color Picker
   ============================================ */
.color-picker-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.color-picker-group input[type="color"] {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  padding: 2px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  text-align: center;
  gap: var(--space-md);
}

.empty-state .empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: var(--font-sm);
  max-width: 300px;
}

/* ============================================
   Summary Card (Editor backend)
   ============================================ */
.summary-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  text-align: center;
}

.summary-item .summary-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.summary-item .summary-value {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
}

.summary-item .summary-value.price {
  color: var(--success);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Loading
   ============================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  #main-content {
    padding: var(--space-md);
  }

  .clip-card {
    grid-template-columns: 1fr;
  }

  .clip-thumbnail {
    width: 100%;
    height: 180px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .navbar-inner {
    flex-wrap: wrap;
  }

  .navbar-nav {
    flex-wrap: wrap;
    order: 3;
    width: 100%;
    justify-content: center;
  }

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

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

  .auth-card {
    padding: var(--space-lg);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .role-selector {
    grid-template-columns: 1fr;
  }
}
