/* =====================================================
   ISFEC B2B Pilot — Styles principaux
   Charte graphique Bordeaux ISFEC
   ===================================================== */

/* Variables CSS */
:root {
  /* Couleurs principales */
  --bordeaux: #722F37;
  --bordeaux-light: #8B4049;
  --bordeaux-lighter: #A65560;
  --rose-pale: #F5E6E8;
  --rose-tres-pale: #FAF3F4;

  /* Neutres */
  --white: #FFFFFF;
  --gray-text: #333333;
  --gray-secondary: #666666;
  --gray-light: #E5E5E5;
  --gray-bg: #F7F7F7;

  /* États */
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --warning: #F57C00;
  --warning-light: #FFF3E0;
  --error: #C62828;
  --error-light: #FFEBEE;

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

  /* Bordures */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 0px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-text);
  background-color: var(--rose-tres-pale);
  min-height: 100vh;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-text);
}

h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p { margin-bottom: var(--space-md); }

a {
  color: var(--bordeaux);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--bordeaux-light);
}

/* Layout principal */
.app-container {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  padding-top: var(--header-height);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-normal);
  min-height: calc(100vh - var(--header-height));
}

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

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

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bordeaux);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--white);
  text-decoration: none;
}

.header-logo {
  height: 40px;
  width: auto;
}

.header-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

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

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

.nav-link svg {
  opacity: 0.8;
}

.nav-link.active svg,
.nav-link:hover svg {
  opacity: 1;
}

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

/* User Menu */
.user-menu {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--white);
  color: var(--bordeaux);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-name {
  font-weight: 500;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-sm));
  right: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  z-index: 1001;
}

.dropdown-header {
  padding: var(--space-md);
  background: var(--gray-bg);
}

.dropdown-name {
  display: block;
  font-weight: 600;
  color: var(--gray-text);
}

.dropdown-email {
  display: block;
  font-size: 13px;
  color: var(--gray-secondary);
}

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--gray-light);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  color: var(--gray-text);
  transition: background var(--transition-fast);
}

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

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--white);
  border-right: 1px solid var(--gray-light);
  overflow-y: auto;
  transition: transform var(--transition-normal);
  z-index: 900;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-content {
  padding: var(--space-lg);
}

.sidebar-section {
  margin-bottom: var(--space-xl);
}

.sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-secondary);
  margin-bottom: var(--space-md);
}

.sidebar-text {
  font-size: 14px;
  color: var(--gray-secondary);
  line-height: 1.5;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--gray-text);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.sidebar-link:hover {
  background: var(--rose-pale);
  color: var(--bordeaux);
}

.sidebar-link-icon {
  width: 24px;
  height: 24px;
  background: var(--bordeaux);
  color: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

/* Version toggle */
.version-toggle {
  display: flex;
  gap: var(--space-sm);
}

.version-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--gray-bg);
  color: var(--gray-secondary);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  transition: all var(--transition-fast);
}

.version-btn:hover {
  background: var(--rose-pale);
  color: var(--bordeaux);
}

.version-btn.active {
  background: var(--bordeaux);
  color: var(--white);
}

/* Filter buttons */
.filter-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-btn {
  padding: var(--space-sm) var(--space-md);
  background: var(--gray-bg);
  border: none;
  color: var(--gray-secondary);
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: var(--rose-pale);
  color: var(--bordeaux);
}

.filter-btn.active {
  background: var(--bordeaux);
  color: var(--white);
}

.filter-btn.critical.active {
  background: var(--error);
}

.filter-btn.important.active {
  background: var(--warning);
}

/* Auth pages */
.auth-body {
  background: linear-gradient(135deg, var(--rose-tres-pale) 0%, var(--rose-pale) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo {
  height: 80px;
  width: auto;
  margin-bottom: var(--space-md);
}

.auth-title {
  font-size: 24px;
  color: var(--bordeaux);
  margin-bottom: var(--space-xs);
}

.auth-subtitle {
  color: var(--gray-secondary);
  font-size: 14px;
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gray-light);
}

.auth-footer p {
  color: var(--gray-secondary);
  font-size: 13px;
  margin: 0;
}

/* Error page */
.error-card {
  text-align: center;
}

.error-icon {
  color: var(--bordeaux);
  margin-bottom: var(--space-lg);
}

.error-title {
  font-size: 24px;
  margin-bottom: var(--space-sm);
}

.error-message {
  color: var(--gray-secondary);
  margin-bottom: var(--space-xl);
}

/* Page header */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: 28px;
  color: var(--bordeaux);
  margin-bottom: var(--space-xs);
}

.page-date {
  color: var(--gray-secondary);
  font-size: 14px;
  margin: 0;
  text-transform: capitalize;
}

/* Responsive */
@media (max-width: 1024px) {
  .header-nav .nav-link span {
    display: none;
  }

  .nav-link {
    padding: var(--space-sm);
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar:not(.collapsed) {
    transform: translateX(0);
  }

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

@media (max-width: 640px) {
  .content-wrapper {
    padding: var(--space-md);
  }

  .header-title {
    display: none;
  }

  .user-name {
    display: none;
  }

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