/* ========================================
   xEllerator - Modern Styles
   ======================================== */

/* CSS Variables */
:root {
  /* The plum family, anchored on the two colours in the logo artwork:
     500 is Momentum Plum (the bar under "xE": accents, hover, progress),
     700 is Leadership Plum (the wordmark: buttons, navigation, headlines).
     The brand guide prints #3D1B4E / #A35AA6 for these, but its own swatches
     and logo files are #562244 / #944872, so the artwork wins. */
  --primary-50: #fbf3f7;
  --primary-100: #f5e3ec;
  --primary-200: #ecc6d9;
  --primary-300: #d99aba;
  --primary-400: #b76c93;
  --primary-500: #944872;
  --primary-600: #75365a;
  --primary-700: #562244;
  --primary-800: #461b37;
  --primary-900: #36142a;

  /* Secondary Colors */
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --green-400: #34d399;
  --green-500: #10b981;
  --green-600: #059669;
  --orange-500: #f59e0b;
  --orange-600: #d97706;
  --red-500: #ef4444;

  /* Neutrals — warmed toward the plum so every surface belongs to the brand */
  --gray-50: #f8f4f6;
  --gray-100: #f1eaee;
  --gray-200: #e5dae0;
  --gray-300: #cfc0c8;
  --gray-400: #a2909a;
  --gray-500: #7d6a74;
  --gray-600: #5e4c55;
  --gray-700: #46373e;
  --gray-800: #2f242a;
  --gray-900: #211519;

  /* Semantic */
  --bg-primary: #faf7f8;
  --bg-card: #ffffff;
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-400);
  --border-color: #ebe0e6;

  /* Type */
  --font-display: 'Poppins', 'Inter', sans-serif; /* the guide's headline face; Inter for everything else */

  /* Shadows — plum-cast, not black */
  --shadow-sm: 0 1px 2px 0 rgb(62 22 44 / 0.05);
  --shadow: 0 1px 3px 0 rgb(62 22 44 / 0.09), 0 1px 2px -1px rgb(62 22 44 / 0.09);
  --shadow-md: 0 4px 6px -1px rgb(62 22 44 / 0.09), 0 2px 4px -2px rgb(62 22 44 / 0.09);
  --shadow-lg: 0 10px 15px -3px rgb(62 22 44 / 0.09), 0 4px 6px -4px rgb(62 22 44 / 0.09);
  --shadow-xl: 0 20px 25px -5px rgb(62 22 44 / 0.10), 0 8px 10px -6px rgb(62 22 44 / 0.10);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary-700) 0%, var(--primary-800) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* The logo is always an image (public/brand/): the guide's Poppins Bold wordmark
   with the Momentum Plum bar under "xE". Reverse on plum, standard on paper.
   Never type the wordmark in a font. */
.brand-logo {
  display: block;
  height: 34px;
  width: auto;
}

/* The brand element (guide p.11): the bar from under "xE" reused as an overline
   above a title. Same proportions as in the logo: 1.13em wide, 0.226em tall. */
.overline::before,
.page-head h1::before {
  content: "";
  display: block;
  width: 1.13em;
  height: 0.226em;
  margin-bottom: 0.34em;
  background: var(--primary-500);
}

.nav-menu {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--primary-400);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.badge {
  margin-left: auto;
  background: var(--primary-500);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--gray-600);
}

.menu-toggle:hover {
  background: var(--gray-100);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  width: 320px;
  transition: all var(--transition);
}

.search-box:focus-within {
  background: white;
  box-shadow: 0 0 0 2px var(--primary-200);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--gray-400);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  position: relative;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--red-500);
  border-radius: 50%;
  border: 2px solid white;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.user-menu:hover {
  background: var(--gray-100);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gray-200);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========================================
   Dashboard
   ======================================== */
.dashboard {
  flex: 1;
  padding: 32px;
  max-width: 1600px;
}

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

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition);
}

.card-link:hover {
  color: var(--primary-700);
}

.match-reason {
  padding-top: 20px;
}

.match-reason h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.match-reason p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none; /* anchors styled as buttons must not keep the UA underline */
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-primary {
  background: var(--primary-700); /* Leadership Plum, 12.3:1 against white text */
  color: white;
}

.btn-primary:hover {
  background: var(--primary-500); /* the guide puts hover states in Momentum Plum */
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
  color: var(--primary-700);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

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

  .menu-toggle {
    display: flex;
  }

  .top-header {
    padding: 0 16px;
  }

  .search-box {
    display: none;
  }

  .user-info {
    display: none;
  }

  .dashboard {
    padding: 20px 16px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
