/*


 */

/* ═══════════════════════════════════════════════════════════════════════════
   FunnelBrain - Premium Design System
   Migrated from React app
   ═══════════════════════════════════════════════════════════════════════════ */

/* Google Fonts Import */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100..900&family=Nanum+Gothic:wght@400;700;800&display=swap");

:root {
  /* ─────────────────────────────────────────────────────────────────────────
     Premium Color Palette - Deep Indigo & Warm Gold
     ───────────────────────────────────────────────────────────────────────── */

  /* Primary - Deep Indigo */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;
  --primary-950: #1e1b4b;

  /* Accent - Warm Gold */
  --accent-50: #fffbeb;
  --accent-100: #fef3c7;
  --accent-200: #fde68a;
  --accent-300: #fcd34d;
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;
  --accent-700: #b45309;
  --accent-800: #92400e;
  --accent-900: #78350f;

  /* Neutral - Slate */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  --neutral-950: #020617;

  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Theme Variables - Light Mode */
  --primary-color: var(--primary-600);
  --secondary-color: var(--success);
  --accent-color: var(--accent-500);
  --background-color: var(--neutral-100); /* 배경을 조금 더 어둡게 (#f1f5f9) */
  --text-color: var(--neutral-700);
  --heading-color: var(--neutral-900);
  --card-background: #ffffff;
  --card-bg: #ffffff;
  --border-color: #d4dae4;
  --text-secondary: var(--neutral-500);
  --text-muted: var(--neutral-400);
  --text-primary: var(--neutral-900);
  --input-bg: var(--neutral-50); /* 입력창을 연한 회색으로 분리 (#f8fafc) */
  --hover-bg: var(--primary-50);
  --bg-secondary: var(--neutral-100);
  --accent-bg: var(--primary-50);
  --info-bg: #eff6ff;
  --warning-bg: var(--accent-50);
  --success-bg: #dcfce7;

  /* Dashboard specific */
  --dashboard-bg: #f5f5f7;
  --section-bg: #eaeaec;

  /* Sidebar specific */
  --sidebar-bg: #ffffff;
  --sidebar-border: var(--neutral-200);
  --sidebar-hover: var(--neutral-100);
  --sidebar-active: var(--primary-50);
  --sidebar-active-text: var(--primary-700);
  --sidebar-text: var(--neutral-600);
  --sidebar-text-muted: var(--neutral-400);

  /* Typography */
  --font-display:
    "Noto Sans KR", "Nanum Gothic", -apple-system, BlinkMacSystemFont,
    sans-serif;
  --font-body:
    "Noto Sans KR", "Nanum Gothic", -apple-system, BlinkMacSystemFont,
    sans-serif;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 40px -10px var(--primary-500);
  --shadow-gold: 0 0 40px -10px var(--accent-400);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Sidebar dimensions */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;
  --header-height: 56px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Dark Mode
   ───────────────────────────────────────────────────────────────────────── */
.dark {
  --primary-color: var(--primary-400);
  --secondary-color: #4ade80;
  --accent-color: var(--accent-400);
  --background-color: #1a1d24;
  --text-color: #d1d5db;
  --heading-color: #f3f4f6;
  --card-background: #242830;
  --card-bg: #242830;
  --border-color: #3a3f4b;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-primary: #f9fafb;
  --input-bg: #2d323c;
  --hover-bg: #2d323c;
  --bg-secondary: #1f2329;
  --accent-bg: rgba(99, 102, 241, 0.2);
  --info-bg: rgba(59, 130, 246, 0.2);
  --warning-bg: rgba(245, 158, 11, 0.2);
  --success-bg: rgba(16, 185, 129, 0.2);

  /* Dashboard specific */
  --dashboard-bg: linear-gradient(
    135deg,
    #0a0a0f 0%,
    #1a1a2e 50%,
    #0f0f1a 100%
  );
  --section-bg: rgba(30, 30, 45, 0.5);

  /* Sidebar specific */
  --sidebar-bg: #1f2329;
  --sidebar-border: #3a3f4b;
  --sidebar-hover: #2d323c;
  --sidebar-active: rgba(99, 102, 241, 0.2);
  --sidebar-active-text: var(--primary-300);
  --sidebar-text: #d1d5db;
  --sidebar-text-muted: #6b7280;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Global Base Styles
   ═══════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.7;
  font-size: 16px;
  letter-spacing: -0.011em;
}

.dark body {
  background-color: var(--background-color);
  color: var(--text-color);
}

/* Selection */
::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

.dark ::selection {
  background: var(--primary-700);
  color: white;
}

/* Focus States */
:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════════════════════════════════ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--heading-color);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Sidebar Layout
   ═══════════════════════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 40;
  transition:
    width var(--transition-base),
    transform var(--transition-base);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.sidebar-logo-link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-logo {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

.sidebar-version {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-collapse-btn {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.sidebar-collapse-btn .expand-icon {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn .collapse-icon {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn .expand-icon {
  display: block;
}

/* Collapsed state - hide text */
.sidebar.collapsed .sidebar-logo-link {
  justify-content: center;
}

.sidebar.collapsed .sidebar-version,
.sidebar.collapsed .sidebar-menu-button span,
.sidebar.collapsed .sidebar-submenu,
.sidebar.collapsed .sidebar-group-label {
  display: none;
}

.sidebar.collapsed .sidebar-menu-button {
  justify-content: center;
  padding: 0.75rem;
}

.sidebar.collapsed .sidebar-footer-content span,
.sidebar.collapsed .sidebar-footer-btn span {
  display: none;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
}

.sidebar-group {
  margin-bottom: var(--space-4);
}

.sidebar-group-label {
  padding: var(--space-2) var(--space-4);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-item {
  padding: 0 var(--space-2);
}

.sidebar-menu-button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-menu-button:hover {
  background: var(--sidebar-hover);
}

.sidebar-menu-button.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

.sidebar-menu-button svg,
.sidebar-menu-button i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Sidebar Submenu - Hierarchical Navigation */
.sidebar-submenu {
  list-style: none;
  padding: 0;
  margin: var(--space-1) 0 0 0;
  margin-left: calc(var(--space-4) + 9px); /* Align with parent icon center */
  padding-left: var(--space-4);
  border-left: 2px solid var(--border-color);
  position: relative;
}

.sidebar-submenu-item {
  padding: var(--space-1) 0;
  position: relative;
}

.sidebar-submenu-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-4) - 2px);
  top: 50%;
  width: var(--space-3);
  height: 2px;
  background: var(--border-color);
}

.sidebar-submenu-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--sidebar-text-muted);
  font-size: 0.813rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-submenu-button:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.sidebar-submenu-button.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

.sidebar-submenu-button.active::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-4) - 2px);
  top: 50%;
  width: var(--space-3);
  height: 2px;
  background: var(--primary-400);
}

.sidebar-submenu-button svg,
.sidebar-submenu-button i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

/* Dark mode adjustments for submenu */
.dark .sidebar-submenu {
  border-left-color: var(--sidebar-border);
}

.dark .sidebar-submenu-item::before {
  background: var(--sidebar-border);
}

.dark .sidebar-submenu-button.active::before {
  background: var(--primary-400);
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-version-footer {
  text-align: center;
  font-size: 0.65rem;
  color: var(--sidebar-text-muted);
  padding-bottom: 0.5rem;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.sidebar.collapsed .sidebar-version-footer {
  display: none;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  color: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.dark .sidebar-user-avatar {
  background: var(--primary-900);
  color: var(--primary-300);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--dashboard-bg);
  transition: margin-left var(--transition-base);
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}

.main-header-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--heading-color);
}

.main-body {
  padding: var(--space-6);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Auth Page Styles (Login/Register)
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: linear-gradient(
    135deg,
    var(--primary-950) 0%,
    var(--primary-900) 50%,
    var(--primary-800) 100%
  );
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: radial-gradient(
    circle at 1px 1px,
    var(--primary-400) 1px,
    transparent 0
  );
  background-size: 40px 40px;
  pointer-events: none;
}

.auth-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(79, 70, 229, 0.4) 0%,
    transparent 70%
  );
  filter: blur(60px);
  top: -200px;
  right: -200px;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3rem 2.5rem;
  box-shadow:
    0 32px 64px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  background: linear-gradient(
    135deg,
    var(--neutral-50) 0%,
    var(--accent-400) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 1.125rem;
  color: var(--neutral-400);
  font-weight: 400;
}

.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--neutral-300);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.auth-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  color: var(--neutral-100);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input:focus {
  border-color: var(--primary-500);
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.3),
    0 0 20px rgba(99, 102, 241, 0.2);
}

.auth-input::placeholder {
  color: var(--neutral-500);
}

.auth-submit {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-950);
  background: linear-gradient(
    135deg,
    var(--accent-400) 0%,
    var(--accent-500) 100%
  );
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  margin-top: 0.5rem;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.75rem 0;
  gap: 1rem;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider-text {
  font-size: 0.8rem;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--neutral-200);
}

.auth-social-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.auth-social-button svg {
  width: 20px;
  height: 20px;
}

.auth-link {
  color: var(--primary-400);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--primary-300);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--neutral-400);
  font-size: 0.9rem;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  color: #fca5a5;
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Premium Card Styles
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--card-background);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--border-color);
}

/* Settings Card */
.settings-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.settings-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-50);
  color: var(--primary-600);
}

.settings-card-icon.accent {
  background: var(--accent-50, #fffbeb);
  color: var(--accent-600, #d97706);
}

.settings-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 0 0 0.25rem;
}

.settings-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.settings-card-body {
  padding: var(--space-6);
}

.settings-card-content {
  padding: var(--space-4) var(--space-6);
}

.settings-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
}

.dark .glass-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  box-shadow: var(--shadow-md);
}

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

.btn-gold {
  background: linear-gradient(
    135deg,
    var(--accent-400) 0%,
    var(--accent-500) 100%
  );
  color: var(--primary-950);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.4);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-color);
}

.btn-ghost:hover {
  background: var(--hover-bg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Stats Cards (Dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */

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

.stat-card {
  background: var(--card-background);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--border-color);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.stat-icon.primary {
  background: var(--primary-100);
  color: var(--primary-600);
}

.stat-icon.success {
  background: var(--success-bg);
  color: var(--success);
}

.stat-icon.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--heading-color);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dropdown Menu
   ═══════════════════════════════════════════════════════════════════════════ */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: var(--space-2);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  min-width: 200px;
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-color);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--hover-bg);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-2) 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Responsive
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Utility Classes
   ═══════════════════════════════════════════════════════════════════════════ */

.text-gradient {
  background: linear-gradient(135deg, #1251C2, #8EC7F6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-dashboard {
  background: var(--dashboard-bg);
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dashboard Page
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--heading-color);
}

.dashboard-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Project Cards Grid
   ═══════════════════════════════════════════════════════════════════════════ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

.project-card {
  display: block;
  position: relative;
  background: var(--card-background);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-400);
}

.project-card:hover .project-card-gradient {
  opacity: 1;
}

.project-card-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-400));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card-header {
  padding: var(--space-6) var(--space-6) var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 0;
}

.project-card-menu {
  position: relative;
}

.project-menu-btn {
  padding: var(--space-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.project-menu-btn:hover {
  background: var(--hover-bg);
  color: var(--text-color);
}

.project-card-content {
  padding: 0 var(--space-6) var(--space-4);
}

.project-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

.project-card-stats {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-2);
}

.project-stat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.project-card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-badge {
  padding: var(--space-1) var(--space-2);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--primary-300);
  background: rgba(99, 102, 241, 0.2);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  background: var(--card-background);
  border-radius: 24px;
  border: 2px dashed var(--border-color);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  padding: var(--space-6);
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-100) 0%,
    var(--primary-50) 100%
  );
  color: var(--primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark .empty-state-icon {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.3) 0%,
    rgba(99, 102, 241, 0.1) 100%
  );
  color: var(--primary-400);
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: var(--space-3);
}

.empty-state-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Inline Dropdown (Project Card Menu)
   ═══════════════════════════════════════════════════════════════════════════ */

.dropdown-content {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: var(--space-1);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.15s ease;
}

.project-card-menu.open .dropdown-content,
[data-controller="dropdown"].open .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-color);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--hover-bg);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dropdown-item-danger {
  color: var(--error);
}

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

.dropdown-item-danger svg {
  color: var(--error);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Flash Messages
   ═══════════════════════════════════════════════════════════════════════════ */

.flash-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
}

.flash-message {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease-out;
}

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

.flash-notice {
  background: var(--success-bg);
  border: 1px solid var(--success);
  color: var(--success);
}

.flash-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Responsive - Dashboard
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .dashboard-actions {
    width: 100%;
  }

  .dashboard-actions .btn {
    flex: 1;
    justify-content: center;
  }

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

  .empty-state {
    padding: var(--space-8) var(--space-4);
  }
}
