/* =============================================
   STYLE DE BASE — Suivi Chantiers
   Aligné sur Suiv'Heures, surcouché par theme-volitis.css
   ============================================= */

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  color: #222;
}

/* Header bleu (surchargé par theme-volitis.css) */
.main-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #2563eb; color: #fff; padding: 0.8rem 1rem;
  margin: 0; line-height: 1; position: relative; z-index: 10;
}
.main-header .entreprise-nom { font-weight: bold; font-size: 1rem; min-width: 180px; }
.main-header .page-title { flex: 1; text-align: center; margin: 0; font-size: 1.4rem; }

/* Nav (surchargée par theme-volitis.css) */
.nav {
  background: #e8edf3; display: flex; justify-content: center; gap: 1rem;
  padding: 0.6rem; margin: 0; position: relative; z-index: 5;
}
.nav a {
  text-decoration: none; color: #2563eb; font-weight: bold;
  padding: 2px 4px; border-radius: 3px;
}
.nav a:hover { background: #d1d9e6; }
.nav a.active { text-decoration: underline; color: #1d4ed8; }

/* Sections / cartes */
section {
  background: #fff; margin: 1rem; padding: 1rem;
  border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
section h2 {
  margin-top: 0; font-size: 1.1rem; color: #1f2937;
  padding-bottom: 0.5rem; border-bottom: 1px solid #e5e7eb; margin-bottom: 1rem;
}

/* Boutons */
button, .btn {
  border: none; border-radius: 4px; padding: 0.5rem 1rem;
  font-weight: bold; cursor: pointer; color: #fff;
  transition: opacity 0.15s; font-family: inherit; font-size: 0.9rem;
}
button:hover, .btn:hover { opacity: 0.88; }
button:disabled, .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary, button.btn-primary,
.btn--primary, button.btn--primary { background: #2563eb; color: #fff; }
.btn-success, button.btn-success,
.btn--success, button.btn--success,
.btn--ok, button.btn--ok { background: #16a34a; color: #fff; }
.btn-danger,  button.btn-danger,
.btn--danger,  button.btn--danger  { background: #dc2626; color: #fff; }
.btn-warning, button.btn-warning,
.btn--warning, button.btn--warning { background: #f59e0b; color: #000; }
.btn-ghost,
.btn--ghost {
  background: #fff; color: #374151; border: 1px solid #d1d5db;
}
.btn-sm, .btn--sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }

/* Inputs */
input, select, textarea {
  border: 1px solid #ccc; border-radius: 4px;
  padding: 5px 8px; font-family: inherit; font-size: inherit;
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #93c5fd; border-color: #2563eb;
}
label { font-size: 0.85rem; font-weight: 600; color: #374151; }

/* Utilitaires */
.flex { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hidden { display: none; }
.muted { color: #6b7280; }
.text-xs { font-size: 0.75rem; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.flex-1 { flex: 1; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Tableaux */
table {
  border-collapse: collapse; width: 100%; margin-top: 1rem; font-size: 0.9rem;
}
th, td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; }
th { background: #e8edf3; font-weight: 700; color: #374151; }
tbody tr:hover td { background: #f8fafc; }

/* Badges */
.badge, .tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.badge-actif, .tag-success { background: #dcfce7; color: #15803d; }
.badge-termine, .tag-muted { background: #f3f4f6; color: #6b7280; }
.badge-depasse, .tag-danger { background: #fee2e2; color: #b91c1c; }
.badge-pause, .tag-warn { background: #fef9c3; color: #92400e; }
.tag-info { background: #dbeafe; color: #1e40af; }

/* Cartes stat */
.stat-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 0.8rem 1.2rem; min-width: 150px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.stat-card .val {
  font-size: 1.7rem; font-weight: 800; color: #2563eb; line-height: 1.1;
}
.stat-card .lbl { font-size: 0.8rem; color: #6b7280; margin-top: 3px; }

/* Page login */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: linear-gradient(135deg, #f4f6f8 0%, #e2e8f0 100%);
}
.login-box {
  background: #fff; width: 100%; max-width: 24rem;
  border-radius: 10px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.login-box h1 {
  font-size: 1.2rem; font-weight: 800; text-align: center;
  margin: 0 0 1.5rem; color: #2563eb;
}
.error-msg {
  background: #fee2e2; color: #b91c1c; padding: 0.5rem 0.75rem;
  border: 1px solid #fca5a5; border-radius: 4px; font-size: 0.85rem; margin-bottom: 0.75rem;
}

/* Combobox */
.combo { position: relative; }
.combo__display {
  width: 100%; padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px;
  font-size: 0.9rem; cursor: text; background: #fff;
  display: flex; align-items: center; gap: 0.5rem; box-sizing: border-box;
}
.combo.open .combo__display { outline: 2px solid #93c5fd; border-color: #2563eb; }
.combo__display input {
  flex: 1; border: none; outline: none; background: transparent; font-size: 0.9rem; padding: 0;
}
.combo__list {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff;
  border: 1px solid #d1d5db; border-radius: 4px; max-height: 18rem; overflow-y: auto;
  z-index: 30; margin-top: 2px; display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.combo.open .combo__list { display: block; }
.combo__opt {
  padding: 5px 10px; cursor: pointer; border-bottom: 1px solid #f3f4f6; font-size: 0.88rem;
}
.combo__opt:hover { background: #eff6ff; }
.combo__opt small { display: block; color: #6b7280; font-size: 0.75rem; }
.combo__create {
  background: #dcfce7; color: #15803d; font-weight: 700; border-top: 1px solid #86efac;
}
.combo__empty { padding: 0.75rem; font-size: 0.85rem; color: #6b7280; font-style: italic; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 60;
  display: none; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff; border-radius: 10px; width: 100%; max-width: 32rem;
  margin-top: 2rem; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal__head {
  background: #f1f5f9; padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 0.95rem; border-radius: 10px 10px 0 0;
}
.modal__head button { background: none; border: none; cursor: pointer; font-size: 1.2rem; line-height: 1; color: #374151; }
.modal__body { padding: 1rem; }

/* Toast */
#toast {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 0.7rem 1.2rem; border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); font-size: 0.88rem; font-weight: 500;
  z-index: 100; display: none;
}
#toast.show { display: block; }
#toast.success { background: #16a34a; }
#toast.error { background: #dc2626; }

/* Impression */
@media print {
  header, .nav, .no-print, button, .btn { display: none !important; }
  body { background: white; color: black; }
  section { box-shadow: none; border: none; margin: 0; padding: 0; }
}

/* Champ "field" pour compatibilité avec mes pages existantes */
label.field { display: block; margin-bottom: 0.5rem; }
label.field > span { display: block; font-size: 0.78rem; font-weight: 600; color: #374151; margin-bottom: 0.25rem; }

/* main */
.app-main { max-width: 1200px; margin: 0 auto; padding: 0.5rem; }

/* Cartes "card" pour compatibilité ascendante */
.card {
  background: #fff; margin: 1rem 0; padding: 1rem;
  border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.card__header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.card__header h2 { font-size: 0.95rem; font-weight: 700; margin: 0; color: #1f2937; }
.card__header .dot { width: 0.7rem; height: 0.7rem; background: #f59e0b; border-radius: 2px; }
