/* ===== VARIABLES ===== */
:root {
  --bg: #edeaf0;
  --bg2: #e8e4ee;
  --surface: #ffffff;
  --surface2: #f5f3f8;
  --navy: #1a2268;
  --navy2: #252d82;
  --blue-mid: #3d4dbf;
  --blue-soft: #eef0fb;
  --red: #c0392b;
  --green: #2a8a4a;
  --green-soft: #eaf6ef;
  --orange: #e08a1e;
  --orange-soft: #fdf3e3;
  --text: #2c2c2c;
  --text2: #555566;
  --text3: #9090a8;
  --border: #d8d4e4;
  --border2: #c8c4d8;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(26,34,104,0.08);
  --shadow-sm: 0 2px 10px rgba(26,34,104,0.06);
}

/* ===== BASE ===== */
body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,h2,h3,h4,h5,h6,
.fw-bold, .fw-semibold {
  font-family: 'Raleway', sans-serif;
}

/* ===== HEADER ===== */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-shrink: 0;
}

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

.app-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.logo-square {
  width: 38px;
  height: 38px;
  background: var(--navy);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.04em;
}

.header-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.header-app-name {
  font-family: 'Raleway', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 4px 14px 4px 5px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
}

.user-chip-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
}

.logout-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s;
}
.logout-btn:hover { color: var(--red); }

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  flex: 1;
}

/* ===== SIDEBAR ===== */
.app-sidebar {
  width: 232px;
  min-width: 232px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
}

.nav-section-label {
  font-family: 'Raleway', sans-serif;
  font-size: 9px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 12px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  transition: all 0.15s;
}
.nav-item:hover {
  background: var(--surface2);
  color: var(--navy);
}
.nav-item.active {
  background: var(--blue-soft);
  color: var(--navy);
}
.nav-item svg,
.nav-item i {
  width: 16px;
  height: 16px;
  font-size: 15px;
  flex-shrink: 0;
  color: var(--text3);
}
.nav-item.active i,
.nav-item:hover i {
  color: var(--blue-mid);
}
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  font-family: 'Raleway', sans-serif;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.main-content main {
  flex: 1;
}

/* ===== PAGE HEADER ===== */
.page-title {
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.page-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}
.page-sub {
  font-size: 12.5px;
  color: var(--text3);
  padding-left: 14px;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
}

.card-header {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: 'Raleway', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== TABLES ===== */
.table thead tr {
  background: var(--navy);
}
.table thead th {
  font-family: 'Raleway', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 11px 14px;
  border: none;
  white-space: nowrap;
}
.table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
  border-top: none;
}
.table tbody tr:nth-child(even) td {
  background: var(--surface2);
}
.table tbody tr:hover td {
  background: #eeebf8;
}

/* ===== BUTTONS ===== */
.btn {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
}
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--navy2);
  border-color: var(--navy2);
}
.btn-outline-secondary {
  border-color: var(--border2);
  color: var(--text2);
}
.btn-outline-secondary:hover {
  background: var(--surface2);
  border-color: var(--navy);
  color: var(--navy);
}

/* ===== FORM CONTROLS ===== */
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(61,77,191,0.1);
}
.form-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text2);
}

/* ===== ALERTS ===== */
.alert-success {
  background: var(--green-soft);
  border-color: #a8d8b8;
  color: #1a5c2c;
}
.alert-danger {
  background: #fdf0f0;
  border-color: #f5c0c0;
  color: #8b1a1a;
}
.alert-warning {
  background: var(--orange-soft);
  border-color: #f0d9a8;
  color: #7a5500;
}
.alert-info {
  background: #f0f0fc;
  border-color: #b0b4e8;
  color: var(--navy);
}

/* ===== FOOTER ===== */
.app-footer {
  background: var(--navy);
  padding: 12px 28px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
}

/* ===== KPI CARDS (IT-specific) ===== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--navy);
}
.kpi-card.green  { border-top-color: var(--green); }
.kpi-card.orange { border-top-color: var(--orange); }
.kpi-card.red    { border-top-color: var(--red); }
.kpi-card.blue   { border-top-color: var(--blue-mid); }
.kpi-label {
  font-size: 10.5px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.kpi-value {
  font-family: 'Raleway', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

/* ===== STATUS BADGES ===== */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Raleway', sans-serif;
  padding: 4px 11px;
  border-radius: 12px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.st-done     { background: var(--green-soft);  color: var(--green); }
.st-pending  { background: var(--orange-soft); color: var(--orange); }
.st-relance  { background: var(--blue-soft);   color: var(--blue-mid); }
.st-alert    { background: #fdf0f0;            color: var(--red); }
.st-late     { background: #fdf0f0;            color: var(--red); }
.st-inactive { background: var(--bg2);         color: var(--text3); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ===== LAYOUT UTILITIES ===== */
.grid-2       { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.flex-gap     { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mb-14 { margin-bottom: 14px; }
.mb-18 { margin-bottom: 18px; }
.mt-14 { margin-top: 14px; }
.mt-1  { margin-top: 4px; }

/* ===== LINK ===== */
.link { color: var(--blue-mid); text-decoration: none; }
.link:hover { text-decoration: underline; color: var(--navy); }

/* ===== TABS (Bootstrap override) ===== */
.nav-tabs .nav-link {
  font-family: 'Raleway', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  border-radius: 0;
}
.nav-tabs .nav-link.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  background: none;
}
.nav-tabs {
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

/* ===== BAR CHARTS ===== */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-label { width: 120px; font-size: 12px; color: var(--text2); flex-shrink: 0; text-align: right; }
.bar-track { flex: 1; height: 22px; background: var(--bg2); border-radius: 5px; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding-left: 9px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  font-family: 'Raleway', sans-serif;
  min-width: 5px;
  transition: width 0.6s ease;
}

/* ===== STAT CARDS (dashboard) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card.orange { border-top-color: var(--orange); }
.stat-card.blue   { border-top-color: var(--blue-mid); }
.stat-card.green  { border-top-color: var(--green); }
.stat-card.red    { border-top-color: var(--red); }
.stat-lbl {
  font-size: 10.5px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.stat-val {
  font-family: 'Raleway', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-note { font-size: 11px; color: var(--text3); }

/* ===== KANBAN ===== */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}
.kanban-col {
  flex: 0 0 260px;
  background: var(--bg2);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  min-height: 200px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-count {
  background: var(--navy);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'Raleway', sans-serif;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  border-left: 4px solid var(--text3);
  text-decoration: none;
  display: block;
  color: inherit;
}
.kanban-card:hover {
  box-shadow: 0 4px 14px rgba(26,34,104,0.12);
  transform: translateY(-2px);
  color: inherit;
}
.kanban-card.urg-critique { border-left-color: var(--red); }
.kanban-card.urg-urgente  { border-left-color: var(--orange); }
.kanban-card.urg-normale  { border-left-color: var(--green); }
.kanban-card-num {
  font-size: 10px;
  font-weight: 800;
  color: var(--text3);
  font-family: 'Raleway', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.kanban-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}
.kanban-card-meta {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  font-family: 'Raleway', sans-serif;
  flex-shrink: 0;
}
.kanban-drop-zone {
  min-height: 80px;
  border: 2px dashed transparent;
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
  padding: 4px;
}
.kanban-drop-zone.drag-over {
  border-color: var(--blue-mid);
  background: var(--blue-soft);
}

/* ===== TEAM CARDS ===== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.team-card:hover { box-shadow: var(--shadow); }
.team-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.team-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.team-name {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--navy);
}
.team-role { font-size: 11px; color: var(--text3); margin-top: 2px; }
.team-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.team-stat {
  text-align: center;
  padding: 10px 4px;
  background: var(--bg);
  border-radius: var(--radius);
}
.team-stat-val {
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.team-stat-val.orange { color: var(--orange); }
.team-stat-val.red    { color: var(--red); }
.team-stat-val.green  { color: var(--green); }
.team-stat-lbl {
  font-size: 9.5px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ===== TABLE ROUNDED ===== */
.table-rounded {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ===== Sélecteur de vue (planning) ===== */
.view-switch {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.view-switch-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 7px;
  text-decoration: none;
  transition: all .15s ease;
  white-space: nowrap;
}
.view-switch-btn:hover { color: var(--navy); background: rgba(0,0,0,0.03); }
.view-switch-btn.active {
  background: var(--card);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ===== Pleine largeur d'écran sur toutes les pages ===== */
/* Les vues définissent un max-width inline ; on l'annule globalement
   pour exploiter toute la largeur. Les formulaires restent lisibles
   grâce à .form-narrow (cartes de formulaire centrées). */
.main-content > main { max-width: none !important; width: 100%; }

/* Optionnel : limite la largeur des cartes de formulaire pur pour rester lisible */
.form-narrow { max-width: 760px; }
