/* Letmar Déneigeur — mobile-first PWA */
:root {
  --navy: #0B1F3A;
  --navy-soft: #132a4a;
  --red: #C85340;
  --red-dark: #a43f30;
  --red-bg: #fdf0ee;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #5a6a7e;
  --border: #e2e8f0;
  --ok: #1f7a4d;
  --ok-bg: #e8f6ee;
  --warn-bg: #fff6e5;
  --shadow: 0 2px 10px rgba(11, 31, 58, 0.08);
  --radius: 14px;
  --header-h: 56px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="night"] {
  --bg: #0a1220;
  --surface: #132033;
  --text: #eef2f7;
  --muted: #9aabbd;
  --border: #243247;
  --red-bg: #3a1f1c;
  --ok-bg: #163326;
  --warn-bg: #3a2e14;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
}

img { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; }
a { color: var(--red); }

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy);
  color: #fff;
  padding: 10px 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.app-header .brand {
  flex: 1;
  min-width: 0;
}
.app-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.app-header .sub {
  margin: 2px 0 0;
  font-size: 0.72rem;
  opacity: 0.78;
}
.header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.icon-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn:active { transform: scale(0.96); }
.accident-btn {
  background: var(--red);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0 12px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.accident-btn:active { background: var(--red-dark); }

/* Main */
main {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 14px 20px;
}

.screen { display: none; animation: fade .18s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Banner rule */
.rule-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}
.rule-banner span {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.7;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Progress */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.progress-card h2 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.bar {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), #e07a68);
  border-radius: 99px;
  transition: width .3s ease;
}
.bar.ok > i { background: linear-gradient(90deg, var(--ok), #3cb371); }

/* Tiles */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile,
a.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  min-height: 88px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
a.tile:visited { color: inherit; }
.tile:active { transform: scale(0.98); }
.tile .emoji {
  font-size: 1.4rem;
  line-height: 1;
}
.tile strong {
  font-size: 0.95rem;
}
.tile small {
  color: var(--muted);
  font-size: 0.75rem;
}
.tile.wide { grid-column: 1 / -1; }

/* Section titles */
.section-title {
  margin: 4px 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
}
[data-theme="night"] .section-title { color: #fff; }
.section-lead {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Search */
.search-wrap {
  position: sticky;
  top: calc(var(--header-h) + 4px);
  z-index: 20;
  margin-bottom: 12px;
}
.search-wrap input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%235a6a7e' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 12px center no-repeat;
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow);
}
.search-wrap input:focus { border-color: var(--red); }

/* Checklist */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 12px 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.check-item.done {
  border-color: #9fd4b5;
  background: var(--ok-bg);
}
.check-item input {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--ok);
}
.check-item .body { flex: 1; min-width: 0; }
.check-item .body strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.check-item .body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.note-box {
  background: var(--warn-bg);
  border-left: 4px solid #e0a040;
  border-radius: 0 12px 12px 0;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 0.88rem;
}
.toolbar {
  display: flex;
  gap: 8px;
  margin: 14px 0 6px;
  flex-wrap: wrap;
}
.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  min-height: 44px;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-danger { background: var(--red); color: #fff; }
.btn:active { opacity: 0.9; }

/* Expandable cards */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card[hidden] { display: none !important; }
.card-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 52px;
}
.card-head .num {
  background: var(--navy);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.card-head .title {
  flex: 1;
  font-weight: 650;
  font-size: 0.95rem;
}
.card-head .chev {
  color: var(--muted);
  transition: transform .2s;
  font-size: 1.1rem;
}
.card.open .card-head .chev { transform: rotate(180deg); }
.card-body {
  display: none;
  padding: 0 14px 14px;
  font-size: 0.9rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.card.open .card-body { display: block; }
.card-body p { margin: 0 0 10px; }
.card-body ul, .card-body ol {
  margin: 0 0 10px;
  padding-left: 1.2em;
}
.card-body li { margin-bottom: 4px; }

.callout {
  background: var(--red-bg);
  border-left: 4px solid var(--red);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.callout .label {
  display: block;
  color: var(--red);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.tip {
  background: var(--ok-bg);
  border-left: 4px solid var(--ok);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 0.88rem;
}
.collapsed-notes {
  margin-top: 10px;
}
.collapsed-notes summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 0;
}
.collapsed-notes[open] summary { margin-bottom: 6px; }
.collapsed-notes .inner {
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: 10px;
  padding: 10px;
}

/* Lexique / FAQ blocks */
.term {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.term[hidden] { display: none !important; }
.term h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--red);
}
.term p, .term ul { margin: 0; font-size: 0.88rem; }
.term ul { padding-left: 1.2em; margin-top: 6px; }

.comp-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.comp {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.comp .en {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}
.comp h3 { margin: 2px 0 6px; font-size: 0.98rem; }
.comp p { margin: 0; font-size: 0.86rem; color: var(--muted); }

.annexe-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.annexe-block[hidden] { display: none !important; }
.annexe-block h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.annexe-block .img-wrap {
  margin: 10px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.annexe-block .img-wrap img {
  width: 100%;
  cursor: zoom-in;
}
.annexe-block .caption {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 10px 10px 44px;
  margin-bottom: 8px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 0.86rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.65);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-b));
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  color: var(--text);
  border-radius: 18px 18px 14px 14px;
  width: 100%;
  max-width: 480px;
  max-height: 85dvh;
  overflow: auto;
  padding: 18px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.3);
  animation: slideUp .22s ease;
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--red);
}
.modal .close-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 92dvh;
  object-fit: contain;
  border-radius: 4px;
}
.lightbox button {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Bottom tabs */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  box-shadow: 0 -2px 12px rgba(11,31,58,.08);
}
.tab {
  background: none;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 2px;
  -webkit-tap-highlight-color: transparent;
}
.tab .ico { font-size: 1.25rem; line-height: 1; }
.tab.active { color: var(--red); }
.tab.active .ico { transform: translateY(-1px); }

.footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 20px 0 8px;
  line-height: 1.4;
}
.footer-note a { color: var(--muted); }

.hidden { display: none !important; }
.badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 4px;
}

@media (min-width: 520px) {
  main { padding-top: 18px; }
}

/* Checklist groups (entretien) */
.check-group-title {
  margin: 18px 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
}
[data-theme="night"] .check-group-title { color: #c5d4e8; }
#list-entretien .checklist { margin-bottom: 4px; }
.link-btn {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--red);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* —— Portail / login —— */
.login-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(160deg, var(--navy) 0%, #132a4a 55%, #1a3558 100%);
}
.login-gate[hidden] { display: none !important; }
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
}
.login-brand {
  text-align: center;
  margin-bottom: 18px;
}
.login-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--navy);
}
[data-theme="night"] .login-brand h1 { color: #fff; }
.login-brand p {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.login-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 14px 0 0;
}
.login-error {
  background: var(--red-bg);
  color: var(--red);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.field input,
.field select {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 44px;
  outline: none;
}
.field input:focus,
.field select:focus { border-color: var(--red); }
.btn-block { width: 100%; }
.btn-sm {
  padding: 8px 10px;
  min-height: 36px;
  font-size: 0.78rem;
}

.app-shell[hidden] { display: none !important; }

.user-chip {
  margin: 4px 0 0;
  font-size: 0.7rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logout-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  font-weight: 650;
  font-size: 0.72rem;
  padding: 0 10px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.logout-btn:active { background: rgba(255,255,255,0.22); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.panel-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}
[data-theme="night"] .panel-title { color: #eef2f7; }

.emp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.emp-empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 8px 0;
}
.emp-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.emp-item.disabled {
  opacity: 0.65;
  border-style: dashed;
}
.emp-info strong {
  display: block;
  font-size: 0.95rem;
}
.emp-meta {
  font-size: 0.78rem;
  color: var(--muted);
}
.emp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 380px) {
  .logout-btn { font-size: 0.65rem; padding: 0 8px; }
  .accident-btn { padding: 0 8px; font-size: 0.7rem; }
}


/* Accueil — sections & lexique */
.home-section-title {
  margin: 6px 0 12px;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--navy);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
[data-theme="night"] .home-section-title { color: #eef2f7; }

.search-wrap-lg input {
  padding: 16px 16px 16px 44px;
  font-size: 1.05rem;
  border-radius: 14px;
  border-width: 2px;
  min-height: 52px;
}
.search-wrap-lg input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 83, 64, 0.18);
}

.lexique-list { display: flex; flex-direction: column; gap: 10px; }
.lexique-list .term { margin-bottom: 0; }
.term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.term-head h3 { margin: 0; }
.term-cat {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 99px;
}
[data-theme="night"] .term-cat { color: #c5d4e8; }
.term-en {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 2px;
}
.lexique-empty, .lexique-more {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 8px 4px;
}
.lexique-meta {
  margin: -4px 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.tile small { display: block; }

/* —— Fleet / entretien machines —— */
.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.fleet-list,
.problem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fleet-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fleet-item:active { border-color: var(--red); }
.fleet-item-main { min-width: 0; flex: 1; }
.fleet-item-main strong {
  display: block;
  font-size: 0.98rem;
  color: var(--navy);
}
[data-theme="night"] .fleet-item-main strong { color: #eef2f7; }
.fleet-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-item-side {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.fleet-pct {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
}
[data-theme="night"] .fleet-pct { color: #c5d4e8; }
.fleet-chevron {
  font-size: 1.4rem;
  color: var(--muted);
  line-height: 1;
}
.template-details {
  margin: 12px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.template-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
}
[data-theme="night"] .template-details summary { color: #eef2f7; }
.template-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--muted);
}
.template-list li { margin-bottom: 4px; }
.fleet-check .fleet-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.fleet-date-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
}
.fleet-date {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 36px;
}
.problem-form {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.field textarea {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 72px;
  outline: none;
  resize: vertical;
}
.field textarea:focus { border-color: var(--red); }
.problem-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.problem-item.resolved { opacity: 0.72; }
.problem-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.problem-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.problem-tractor {
  font-size: 0.92rem;
  color: var(--navy);
}
[data-theme="night"] .problem-tractor { color: #eef2f7; }
.problem-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
}
.problem-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.problem-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.badge.sev-faible { background: #5a7a9a; }
.badge.sev-moyen { background: #c48a2a; }
.badge.sev-urgent { background: var(--red); }
.tile .badge {
  margin-left: 6px;
  vertical-align: middle;
}
#detail-admin-actions {
  margin-bottom: 12px;
  gap: 8px;
}

/* Équipe + Punch */
.equipe-steps {
  margin: 0 0 14px;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: .95rem;
  line-height: 1.45;
}
.equipe-steps li { margin-bottom: 6px; }

.punch-panel .punch-status {
  margin: 0 0 6px;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.punch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.punch-dot.in { background: #1a7f37; box-shadow: 0 0 0 3px rgba(26,127,55,.2); }
.punch-dot.out { background: var(--accent, #C85340); }
.punch-dot.idle { background: var(--muted); }
.punch-today {
  margin: 0 0 12px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy);
}
[data-theme="night"] .punch-today { color: #eef2f7; }
.punch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.punch-subtitle {
  margin: 14px 0 8px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.punch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.punch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg, #f4f6f9);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: .88rem;
}
.punch-item.open { border-color: rgba(26,127,55,.45); }
.punch-item.compact { padding: 8px 10px; }
.punch-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.punch-range { color: var(--muted); font-size: .82rem; }
.punch-dur { font-weight: 700; white-space: nowrap; color: var(--navy); }
[data-theme="night"] .punch-dur { color: #eef2f7; }
[data-theme="night"] .punch-item { background: rgba(255,255,255,.04); }

.admin-punches {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-punch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}
.admin-punch-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ap-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: .85rem;
}
.ap-status { color: var(--muted); }
