@charset "UTF-8";

/**
 * style.css — Styles communs à toute l'application
 * Distribution Tôle Dashboard — Header fixe gradient bleu, Menu à DROITE
 */

/* ────────────────────────────────────────────────────────────
   VARIABLES & RESET
   ──────────────────────────────────────────────────────────── */
:root {
  --navy: #003087;
  --navy-light: #0040a3;
  --navy-dark: #002266;
  --navy-bg: #e6f0fa;
  --orange: #F7941D;
  --orange-light: #ffac4d;
  --orange-bg: #fff3e0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6c757d;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --transition: all 0.2s ease;
  --sidebar-width: 280px;
  --header-height: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-top: var(--header-height); /* Espace pour le header fixe */
}

/* ────────────────────────────────────────────────────────────
   HEADER FIXE — Gradient Bleu
   ──────────────────────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(90deg, var(--navy-dark) 0%, var(--navy) 40%, var(--navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1050;
  box-shadow: 0 3px 15px rgba(0,48,135,0.25);
}

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

.header-logo {
  height: 42px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-title {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.header-title span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 2px;
}

/* ────────────────────────────────────────────────────────────
   LAYOUT APP — Menu à DROITE
   ──────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  flex-direction: row-reverse;
  margin-top: var(--header-height);
}

/* ────────────────────────────────────────────────────────────
   NAVIGATION — MENU À DROITE
   ──────────────────────────────────────────────────────────── */
.main-nav {
  position: fixed;
  right: 0;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  z-index: 1000;
  transition: var(--transition);
}

.nav-toggle {
  display: none;
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  background: var(--navy);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: var(--transition);
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle:hover { background: var(--navy-light); transform: scale(1.05); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 998;
  backdrop-filter: blur(3px);
}

.nav-panel {
  width: var(--sidebar-width);
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  height: 100%;
  z-index: 999;
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-brand {
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.1);
}

.menu-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: white;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.nav-title h1 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: white;
}
.nav-title span {
  font-size: 0.72rem;
  opacity: 0.85;
  display: block;
  color: rgba(255,255,255,0.8);
}

.nav-links {
  list-style: none;
  padding: 0.8rem 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.nav-links li { margin: 4px 10px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  border-radius: 10px;
  border-right: 3px solid transparent;
}
.nav-link:hover {
  color: white;
  background: rgba(255,255,255,0.08);
  transform: translateX(-2px);
}
.nav-link.active {
  color: white;
  background: rgba(255,255,255,0.12);
  border-right-color: var(--orange);
  font-weight: 600;
}

.nav-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  flex-shrink: 0;
  transition: var(--transition);
}
.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  background: var(--orange);
  transform: scale(1.08);
}
.nav-icon i { font-size: 0.95rem; }
.nav-text { line-height: 1.3; }

.nav-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.clock {
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: rgba(255,255,255,0.12);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  color: white;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ────────────────────────────────────────────────────────────
   MAIN CONTENT
   ──────────────────────────────────────────────────────────── */
.main-content {
  margin-right: var(--sidebar-width);
  margin-left: 0;
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: calc(100vw - var(--sidebar-width));
  min-height: calc(100vh - var(--header-height));
  transition: margin 0.3s ease, max-width 0.3s ease;
}

/* ────────────────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 240px; }
  .main-content { padding: 1.2rem 1.4rem; }
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .nav-toggle { display: flex; }
  .nav-panel {
    width: 260px;
    transform: translateX(100%);
    right: 0;
    top: 0;
  }
  .nav-open .nav-panel { transform: translateX(0); }
  .nav-open .nav-overlay { display: block; }
  .nav-open .nav-toggle span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }
  .main-content {
    margin-right: 0;
    max-width: 100%;
    padding: 1rem;
    padding-top: 70px;
  }
  body.nav-open-body { overflow: hidden; }
}

@media (max-width: 480px) {
  .nav-panel { width: 100%; }
  .main-content { padding: 0.8rem; padding-top: 70px; }
  .header-title { font-size: 1.05rem; }
  .header-title span { display: none; }
}

/* ────────────────────────────────────────────────────────────
   COMPOSANTS COMMUNS (extraits conservés)
   ──────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; color: var(--navy); margin-bottom: 4px; }
.page-header p { color: var(--text-muted); font-size: 0.9rem; }
.global-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card { background: var(--card); padding: 1.2rem; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 12px; border-right: 4px solid var(--navy); transition: var(--transition); }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--navy); margin-top: 4px; line-height: 1.2; }
.kpi-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { background: #fafafa; padding: 10px 12px; text-align: left; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid #eee; position: sticky; top: 0; z-index: 10; }
td { padding: 10px 12px; border-bottom: 1px solid #eee; }
tr:hover { background: #f8f9fa; }
.status-badge { padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.st-realise { background: #d4edda; color: #155724; }
.st-retard { background: #f8d7da; color: #721c24; }
.btn { padding: 10px 18px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-light); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}