/* =============================================
   AIT Formation — Feuille de styles principale
   ============================================= */

:root {
  /* Palette AIT — extraite du logo (bleu marine + orange) */
  --color-primary:     #1a3a5c;   /* Bleu marine AIT */
  --color-primary-light: #2a5a8c;
  --color-accent:      #e8720c;   /* Orange AIT */
  --color-accent-light:#f0953a;

  /* Neutres */
  --color-bg:          #f4f6f9;
  --color-surface:     #ffffff;
  --color-border:      #dde3ea;
  --color-text:        #2c3e50;
  --color-text-muted:  #7f8c9a;
  --color-text-light:  #b0bec5;

  /* États */
  --color-green:       #27ae60;
  --color-orange:      #e67e22;
  --color-red:         #e74c3c;
  --color-purple:      #8e44ad;
  --color-teal:        #16a085;
  --color-blue:        #2980b9;

  /* Layout */
  --sidebar-width:     260px;
  --topbar-height:     64px;
  --border-radius:     8px;
  --shadow-sm:         0 1px 3px rgba(0,0,0,.08);
  --shadow-md:         0 4px 12px rgba(0,0,0,.1);
}

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* =============================================
   LAYOUT
   ============================================= */

body {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--color-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.sidebar-logo img {
  max-width: 140px;
  height: auto;
  filter: brightness(0) invert(1);
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255,255,255,.4);
  padding: 16px 20px 6px;
  text-transform: uppercase;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.75);
  border-left: 3px solid transparent;
  transition: all .15s;
  font-size: 13.5px;
}

.nav-item a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--color-accent-light);
}

.nav-item.active a {
  background: rgba(232,114,12,.15);
  color: #fff;
  border-left-color: var(--color-accent);
  font-weight: 600;
}

.nav-icon {
  font-size: 9px;
  opacity: .7;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 20px;
  font-size: 11px;
  color: rgba(255,255,255,.3);
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
}

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

/* TOPBAR */
.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}
.sidebar-toggle:hover { background: var(--color-bg); color: var(--color-primary); }

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-date {
  font-size: 13px;
  color: var(--color-text-muted);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.user-name { font-weight: 500; font-size: 13.5px; }

/* Responsive sidebar toggle */
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); }
.sidebar.collapsed ~ .main-content { margin-left: 0; }
