:root {
  /* ── Palette principale ─── blanc/pâle + sidebar foncée ── */
  --bg:           #f0f4f8;
  --surface:      #ffffff;
  --surface2:     #f8fafc;
  --surface3:     #edf2f7;
  --border:       #e2e8f0;
  --border2:      #cbd5e0;
  --text:         #1a202c;
  --text-muted:   #718096;
  --text-light:   #a0aec0;

  /* ── Sidebar foncée ── */
  --sidebar-bg:     #1a202c;
  --sidebar-border: #2d3748;
  --sidebar-text:   #a0aec0;
  --sidebar-hover:  #2d3748;
  --sidebar-active: #4299e1;
  --sidebar-active-bg: rgba(66,153,225,.12);

  /* ── Accents ── */
  --accent:         #3182ce;
  --accent-hover:   #2b6cb0;
  --success:        #38a169;
  --warning:        #d69e2e;
  --danger:         #e53e3e;
  --info:           #3182ce;
  --purple:         #805ad5;

  --sidebar-w: 240px;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Layout ─────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.sidebar-logo {
  height: 56px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sidebar-brand-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.sidebar-nav { flex: 1; padding: 8px 0; }

.nav-section {
  padding: 14px 16px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #4a5568;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  border-right: 2px solid transparent;
  transition: background .12s, color .12s;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  background: none;
  border-top: none; border-bottom: none; border-left: none;
  text-align: left;
  font-family: inherit;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); border-right-color: var(--sidebar-active); }
.nav-item.active svg { opacity: 1; }

.sidebar-footer { padding: 8px 0; border-top: 1px solid var(--sidebar-border); flex-shrink: 0; }

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

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.page-header h1 { font-size: 17px; font-weight: 700; color: var(--text); }
.page-header .hdr-right { display: flex; align-items: center; gap: 10px; }
.page-header .date-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
}

.page-body { padding: 24px; flex: 1; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
}
.card-header h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
}
.card-body { padding: 16px; }

/* ── Grid / Flex ─────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.flex { display: flex; }
.ai-center { align-items: center; }
.jc-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.f1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
  text-decoration: none;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(49,130,206,.3); }
.btn-primary:hover  { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border2); }
.btn-secondary:hover { background: var(--surface3); }
.btn-danger    { background: transparent; color: var(--danger); border-color: rgba(229,62,62,.3); }
.btn-danger:hover   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost     { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover    { color: var(--text); background: var(--surface3); }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-xs  { padding: 3px 8px; font-size: 11px; }
.btn-icon { padding: 6px; border-radius: 6px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; margin-bottom: 5px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.form-control {
  width: 100%;
  padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  transition: border-color .12s, box-shadow .12s;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49,130,206,.15); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 72px; }
select.form-control { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; padding-right: 32px; appearance: none; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── Rating dots (1-5) ───────────────────────────────────────── */
.rating-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.rating-wrap label { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.rating-wrap input[type=radio] { display: none; }
.rdot {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  transition: all .12s;
}
.rating-wrap input:checked + .rdot { color: #fff; border-color: transparent; }
.rating-wrap label:nth-child(1) input:checked + .rdot { background: #e53e3e; }
.rating-wrap label:nth-child(2) input:checked + .rdot { background: #dd6b20; }
.rating-wrap label:nth-child(3) input:checked + .rdot { background: #d69e2e; }
.rating-wrap label:nth-child(4) input:checked + .rdot { background: #68d391; color: #1a202c; }
.rating-wrap label:nth-child(5) input:checked + .rdot { background: #38a169; }
.rlabel { font-size: 10px; color: var(--text-muted); }

/* ── Score dots ──────────────────────────────────────────────── */
.sdot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
}
.s5 { background: #c6f6d5; color: #22543d; }
.s4 { background: #d4edda; color: #155724; }
.s3 { background: #fef9c3; color: #713f12; }
.s2 { background: #fed7aa; color: #7c2d12; }
.s1 { background: #fed7d7; color: #742a2a; }
.s0 { background: var(--surface3); color: var(--text-muted); }

/* ── Tables ──────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 9px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); border-bottom: 2px solid var(--border);
  font-weight: 700; background: var(--surface2); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 10px 12px; font-size: 13px; vertical-align: middle; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.b-note       { background: #ebf8ff; color: #2b6cb0; }
.b-priorité   { background: #fff5f5; color: #c53030; }
.b-point      { background: #fffaf0; color: #c05621; }
.b-idée       { background: #faf5ff; color: #6b46c1; }
.b-risque     { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.b-follow-up  { background: #f0fff4; color: #276749; }

.b-haute      { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.b-moyenne    { background: #fffaf0; color: #c05621; border: 1px solid #feebc8; }
.b-basse      { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }

.b-ouvert     { background: #ebf8ff; color: #2b6cb0; }
.b-en-cours   { background: #fffaf0; color: #c05621; }
.b-résolu     { background: #f0fff4; color: #276749; }
.b-annulé     { background: #f7fafc; color: #718096; }
.b-reporté    { background: #faf5ff; color: #6b46c1; }
.b-à-faire    { background: #f7fafc; color: #4a5568; }

.b-neutre         { background: #f7fafc; color: #718096; }
.b-favorable      { background: #f0fff4; color: #276749; }
.b-défavorable    { background: #fff5f5; color: #c53030; }
.b-délégué        { background: #faf5ff; color: #6b46c1; }
.b-non-syndiqué   { background: #f7fafc; color: #718096; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.alert-error   { background: #fff5f5; border-color: #fed7d7; color: #c53030; }
.alert-success { background: #f0fff4; border-color: #c6f6d5; color: #276749; }
.alert-info    { background: #ebf8ff; border-color: #bee3f8; color: #2b6cb0; }

/* ── Dialog ──────────────────────────────────────────────────── */
dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 0;
  max-width: 580px;
  width: calc(100% - 40px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.05);
}
dialog::backdrop { background: rgba(26,32,44,.5); backdrop-filter: blur(2px); }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-body   { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface2); }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border: none; border-bottom: 2px solid transparent;
  background: transparent; cursor: pointer; transition: all .12s; white-space: nowrap;
  font-family: inherit; margin-bottom: -2px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .cnt { font-size: 11px; background: var(--surface3); border-radius: 10px; padding: 1px 6px; margin-left: 4px; color: var(--text-muted); }

/* ── Stats cards ─────────────────────────────────────────────── */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat .lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }

/* ── Note items ──────────────────────────────────────────────── */
.note-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.note-item:last-child { border-bottom: none; }
.note-body { flex: 1; min-width: 0; }
.note-text { font-size: 13.5px; line-height: 1.5; word-break: break-word; color: var(--text); }
.note-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.note-actions { display: flex; gap: 3px; opacity: 0; transition: opacity .12s; flex-shrink: 0; }
.note-item:hover .note-actions { opacity: 1; }

/* ── Person cards ────────────────────────────────────────────── */
.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.person-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.pc-name { font-size: 15px; font-weight: 700; margin-bottom: 1px; color: var(--text); }
.pc-role { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.pc-dept { font-size: 11px; background: var(--surface3); color: var(--text-muted); padding: 2px 8px; border-radius: 10px; display: inline-block; margin-bottom: 10px; border: 1px solid var(--border); }
.pc-scores { display: flex; gap: 10px; flex-wrap: wrap; }
.pc-score { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pc-score-lbl { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }

/* ── Observations ────────────────────────────────────────────── */
.obs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow .12s;
}
.obs-card:hover { box-shadow: var(--shadow-md); }
.obs-card.haute   { border-left-color: var(--danger); }
.obs-card.moyenne { border-left-color: var(--warning); }
.obs-card.basse   { border-left-color: var(--success); }
.obs-card.résolu  { opacity: .65; }
.obs-prob  { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.obs-meta  { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.obs-sol   { font-size: 12px; color: var(--text-muted); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.obs-actions { display: flex; gap: 4px; }

/* ── Documents ───────────────────────────────────────────────── */
.doc-sidebar { display: flex; flex-direction: column; gap: 2px; }
.doc-cat {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 6px;
  font-size: 13px; cursor: pointer; color: var(--text-muted);
  transition: all .12s; border: none; background: transparent;
  font-family: inherit; text-align: left; width: 100%;
}
.doc-cat:hover { background: var(--surface3); color: var(--text); }
.doc-cat.active { background: #ebf8ff; color: var(--accent); font-weight: 600; }
.doc-cat .dc-cnt { margin-left: auto; font-size: 11px; background: var(--surface3); border-radius: 10px; padding: 1px 6px; }
.doc-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.doc-item:last-child { border-bottom: none; }
.doc-ico { width: 34px; height: 34px; background: #ebf8ff; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent); }
.doc-info { flex: 1; min-width: 0; }
.doc-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.doc-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.doc-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 10px; }

/* ── Plan 90 jours ───────────────────────────────────────────── */
.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid;
}
.phase-1 { background: #ebf8ff; border-color: #bee3f8; color: #2b6cb0; }
.phase-2 { background: #fffaf0; border-color: #feebc8; color: #c05621; }
.phase-3 { background: #f0fff4; border-color: #c6f6d5; color: #276749; }
.phase-header h2 { font-size: 15px; font-weight: 700; }
.phase-header p { font-size: 12px; opacity: .8; margin-top: 1px; }
.phase-badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; flex-shrink: 0;
}
.phase-1 .phase-badge { background: #2b6cb0; color: #fff; }
.phase-2 .phase-badge { background: #c05621; color: #fff; }
.phase-3 .phase-badge { background: #276749; color: #fff; }

.week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.week-header {
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.week-header h4 { font-size: 13px; font-weight: 700; }
.week-header .wk-num { font-size: 11px; color: var(--text-muted); }
.week-progress { height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.week-progress-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

.plan-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.plan-item:last-child { border-bottom: none; }
.plan-item:hover { background: var(--surface2); }
.plan-item.completed { opacity: .55; }
.plan-item.completed .pi-title { text-decoration: line-through; color: var(--text-muted); }

.plan-item input[type=checkbox] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.pi-body { flex: 1; min-width: 0; }
.pi-title { font-size: 13px; font-weight: 500; line-height: 1.4; }
.pi-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.pi-cat { font-size: 10px; background: var(--surface3); color: var(--text-muted); padding: 1px 6px; border-radius: 10px; }
.pi-piege { font-size: 10px; background: #fff5f5; color: #c53030; padding: 1px 6px; border-radius: 10px; border: 1px solid #fed7d7; }
.pi-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.pi-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; flex-shrink: 0; }
.plan-item:hover .pi-actions { opacity: 1; }

.progress-ring { position: relative; }
.progress-bar-wrap { background: var(--surface3); border-radius: 6px; height: 8px; overflow: hidden; margin-top: 4px; }
.progress-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #63b3ed); transition: width .4s; }

/* ── Eval table ──────────────────────────────────────────────── */
.eval-hdr { font-size: 10px; writing-mode: vertical-lr; text-orientation: mixed; transform: rotate(180deg); color: var(--text-muted); padding: 4px 0; white-space: nowrap; }

/* ── Login ───────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1a202c;
  background-image: url('/Machinex-sorting-systems-recycling-technology-balers-Ram_baler.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.login-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,32,44,.88) 0%, rgba(26,32,44,.7) 100%);
  backdrop-filter: blur(2px);
}
.login-box {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 16px;
  padding: 40px 36px;
  width: 380px;
  box-shadow: 0 24px 48px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.2);
}
.login-logo-img { height: 60px; width: auto; display: block; margin: 0 auto 12px; }
.login-title { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.2; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 0; }
.login-wrap .form-control { background: var(--surface2); }

/* ── Misc ────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.text-right { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.nowrap { white-space: nowrap; }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }

.empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty p { font-size: 14px; margin-top: 8px; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ── Équipes ─────────────────────────────────────────────────── */
details > summary { user-select: none; }
details > summary::-webkit-details-marker { display: none; }

/* ── Burger button ───────────────────────────────────────────── */
.burger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: background .12s;
}
.burger-btn:hover { background: var(--surface3); }
.burger-btn svg   { width: 20px; height: 20px; pointer-events: none; }

.hdr-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hdr-left h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Sidebar backdrop ────────────────────────────────────────── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,32,44,.55);
  z-index: 150;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility .28s ease;
}
.sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Responsive — Tablet + Mobile (< 1024px) ─────────────────── */
@media (max-width: 1023px) {

  /* Sidebar devient un drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s;
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,.3);
  }

  .main-content { margin-left: 0; }
  .burger-btn   { display: flex; }
}

/* ── Mobile (< 768px) ────────────────────────────────────────── */
@media (max-width: 767px) {

  /* Header */
  .page-header  { padding: 10px 14px; }
  .page-header h1 { font-size: 15px; }
  .date-badge   { display: none; }

  /* Body */
  .page-body    { padding: 12px; }
  .card-body    { padding: 12px; }

  /* Grilles */
  .g4  { grid-template-columns: 1fr 1fr; }
  .g3  { grid-template-columns: 1fr 1fr; }
  .g2  { grid-template-columns: 1fr; }
  .gauto { grid-template-columns: 1fr; }
  .form-row  { grid-template-columns: 1fr; }
  .form-row3 { grid-template-columns: 1fr; }

  /* Stats */
  .stat { padding: 12px 14px; }
  .stat .num { font-size: 22px; }
  .stat .lbl { font-size: 10px; }

  /* Tabs scrollables */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 1px; }
  .tab  { flex-shrink: 0; }

  /* Tables */
  .tbl-wrap { -webkit-overflow-scrolling: touch; }

  /* Modal → bottom sheet */
  dialog {
    position: fixed !important;
    bottom: 0 !important;
    left:   0 !important;
    right:  0 !important;
    top: auto !important;
    max-width:  100% !important;
    width:      100% !important;
    margin:     0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92svh;
    max-height: 92vh;
    animation: sheetUp .25s cubic-bezier(.4,0,.2,1);
  }
  @keyframes sheetUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* Poignée bottom sheet */
  .modal-header::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--border2);
    border-radius: 2px;
    margin: 0 auto 12px;
  }

  /* Modal avec deux colonnes → une colonne */
  .modal-body[style*="grid-template-columns:1fr 1fr"],
  .modal-body[style*="grid-template-columns: 1fr 1fr"] {
    display: block !important;
  }
  .modal-body > div + div { margin-top: 16px; }

  /* Actions : toujours visibles sur tactile */
  .note-actions,
  .pi-actions,
  .obs-actions { opacity: 1 !important; }

  /* Boutons — surfaces tactiles minimum 44px */
  .btn   { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .btn-xs { min-height: 28px; }
  .nav-item { padding: 12px 16px; min-height: 46px; }

  /* Dashboard: masquer la colonne note-actions hover sur mobile */
  .note-item:hover .note-actions { opacity: 1; }

  /* Observations layout */
  .obs-meta { gap: 6px; }

  /* Plan 90 — header de phase */
  .phase-header { gap: 8px; }
  .phase-header > div:last-child { display: none; } /* Masquer % à droite (visible dans la semaine) */

  /* Docs sidebar → dessus */
  .flex[style*="align-items:flex-start"] {
    flex-direction: column !important;
  }
  .flex[style*="align-items:flex-start"] > div:first-child {
    width: 100% !important;
  }

  /* Sites — grille 1 colonne */
  .grid.g3 { grid-template-columns: 1fr; }

  /* Équipes — grille 1 colonne */
  .grid.gauto { grid-template-columns: 1fr; }

  /* Évaluations table — masquer colonnes verticales */
  .eval-hdr { font-size: 9px; }
}

/* ── Très petit écran (< 480px) ──────────────────────────────── */
@media (max-width: 479px) {
  .g4, .g3 { grid-template-columns: 1fr; }
  .page-body  { padding: 10px; }
  .card-body  { padding: 10px; }
  .stat .num  { font-size: 20px; }

  /* Masquer badge type sur note mobile pour gagner de l'espace */
  .note-meta .badge { font-size: 10px; padding: 1px 6px; }
}

/* ── Touch device: actions toujours visibles ─────────────────── */
@media (hover: none) {
  .note-actions { opacity: 1; }
  .pi-actions   { opacity: 1; }
}

/* ── Audit nav active ────────────────────────────────────────── */
.b-brouillon { background:#f7fafc; color:#718096; }
.b-en-cours  { background:#fffaf0; color:#c05621; }
.b-complété  { background:#f0fff4; color:#276749; }

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .sidebar, .page-header .hdr-right, .note-actions, .obs-actions,
  dialog, .btn-ghost, .nav-item, .pi-actions { display: none !important; }
  .main-content { margin-left: 0; }
  .plan-item.completed { opacity: .7; }
}
