/* ============================================================
   style.css — Identité visuelle "Registre d'Hôtel"
   Palette : ivoire papier, encre profonde, rouge tampon, or
   ============================================================ */

:root {
  --paper: #F7F3EA;
  --paper-dim: #EFE9DA;
  --ink: #1F2A24;
  --ink-soft: #4A5750;
  --stamp-red: #A8341F;
  --stamp-red-dark: #832717;
  --gold: #C9A356;
  --pine: #2F4538;
  --pine-soft: #DCE5DD;
  --line: #D8D0BC;
  --white: #FFFDF8;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "Space Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(168,52,31,0.025) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(47,69,56,0.03) 0%, transparent 50%);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- LAYOUT ---------- */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 248px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 8%),
    var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 30px 18px;
  flex-shrink: 0;
  position: relative;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 8px 26px;
  border-bottom: 1px solid rgba(247,243,234,0.12);
  margin-bottom: 22px;
}

.brand-mark {
  width: 42px; height: 42px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
  position: relative;
  box-shadow: 0 0 0 3px rgba(201,163,86,0.08);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: 0.01em; }
.brand-text span { font-size: 10.5px; letter-spacing: 0.08em; color: rgba(247,243,234,0.5); text-transform: uppercase; }

.profile-widget {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px;
  margin-bottom: 18px;
  background: rgba(247,243,234,0.05);
  border: 1px solid rgba(247,243,234,0.12);
  border-radius: 8px;
}
.profile-widget-name { font-size: 12.5px; font-weight: 600; color: var(--paper); line-height: 1.3; }
.profile-widget-role { font-size: 10px; color: rgba(247,243,234,0.5); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-widget-role--formateur { color: #E8B84B; font-weight: 600; }
.profile-pick-card--formateur { border: 1.5px solid #E8B84B; }
.profile-pick-card--formateur .room-price { color: #C9941F; font-weight: 600; }
.profile-widget-switch {
  background: none; border: none; color: var(--gold);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 6px; white-space: nowrap;
}
.profile-widget-empty { font-size: 12px; color: rgba(247,243,234,0.6); }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 13px;
  background: none; border: none; color: rgba(247,243,234,0.68);
  text-align: left;
  padding: 12px 13px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
  position: relative;
}
.nav-item:hover { background: rgba(247,243,234,0.06); color: var(--paper); padding-left: 16px; }
.nav-item.active {
  background: rgba(201,163,86,0.13);
  color: var(--gold);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -18px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 18px;
  background: var(--stamp-red);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 15px; width: 18px; text-align: center; }

.nav-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247,243,234,0.32);
  margin: 14px 13px 4px;
  font-weight: 600;
}

.reset-link {
  background: none; border: none;
  color: rgba(247,243,234,0.32);
  font-size: 11px;
  padding: 12px 8px 0;
  text-align: left;
  text-decoration: underline;
}
.reset-link:hover { color: rgba(247,243,234,0.58); }
.build-marker {
  margin: 4px 8px 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: rgba(247,243,234,0.22);
  letter-spacing: 0.03em;
  user-select: text;
}

.main-content {
  flex: 1;
  padding: 36px 44px;
  overflow-x: auto;
  overflow-y: auto;
  height: 100vh;
}

/* ---------- HEADER ---------- */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stamp-red);
  margin: 0 0 4px;
}
.view-header h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.header-actions { display: flex; gap: 10px; align-items: center; }
.closure-badge {
  font-size: 12.5px;
  color: var(--pine);
  background: #E6EEE8;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
}

/* ---------- BUTTONS ---------- */
.btn-primary {
  background: var(--stamp-red);
  color: var(--white);
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--stamp-red-dark); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
}
.btn-ghost:hover { border-color: var(--ink-soft); }

.btn-danger {
  background: transparent;
  color: var(--stamp-red);
  border: 1.5px solid var(--stamp-red);
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---------- STATS ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card.stamp {
  border-color: var(--stamp-red);
  background: linear-gradient(135deg, #FFFDF8 0%, #FBF0EC 100%);
  position: relative;
  overflow: hidden;
}
.stat-card.stamp::after {
  content: "";
  position: absolute;
  right: -16px; top: -16px;
  width: 70px; height: 70px;
  border: 2px solid rgba(168,52,31,0.12);
  border-radius: 50%;
  transform: rotate(-12deg);
}
.stat-card--alert {
  border-color: var(--gold);
  background: linear-gradient(135deg, #FFFDF8 0%, #FBF3E2 100%);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
}
.stat-label {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- PANELS ---------- */
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
.panel--danger { border-color: var(--stamp-red); background: #FBF1EF; }
.panel h2 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 14px;
  font-weight: 600;
}
.ledger-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ledger-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--paper-dim);
  font-size: 13.5px;
  flex-wrap: wrap;
}
.ledger-list li:last-child { border-bottom: none; }
.ledger-name { flex: 1; font-weight: 500; }
.ledger-meta { color: var(--ink-soft); font-size: 12.5px; }
.ledger-meta.due { color: var(--stamp-red); font-weight: 600; }
.empty { color: var(--ink-soft); font-size: 13.5px; font-style: italic; }

.btn-checkin, .btn-checkout {
  background: var(--pine);
  color: var(--white);
  border: none;
  font-weight: 600;
}
.btn-checkin:hover, .btn-checkout:hover { background: #243A2E; }

/* ---------- SEARCH ---------- */
.search-input {
  padding: 9px 14px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-size: 13.5px;
  background: var(--white);
  min-width: 220px;
}
.search-input:focus { outline: none; border-color: var(--stamp-red); }

/* ---------- HOUSEKEEPING (room cards) ---------- */
.room-card { position: relative; border-left: 4px solid var(--line); }
.room-card.hk-clean { border-left-color: var(--pine); }
.room-card.hk-dirty { border-left-color: var(--gold); }
.room-card.hk-inspected { border-left-color: #6F93C9; }
.room-card.hk-out_of_order { border-left-color: var(--stamp-red); }
.hk-select-label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; color: var(--ink-soft); margin-top: 10px;
}
.hk-select {
  padding: 7px 9px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  font-size: 12.5px;
  background: var(--white);
}

.guest-notes {
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 6px 0;
  padding-left: 8px;
  border-left: 2px solid var(--paper-dim);
}

/* ---------- ACTIVITY LOG ---------- */
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity-list li {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--paper-dim);
}
.activity-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  width: 100px;
  flex-shrink: 0;
  padding-top: 2px;
}
.activity-content { display: flex; flex-direction: column; gap: 2px; }
.activity-content strong { font-size: 13.5px; font-weight: 600; }
.activity-details { font-size: 12.5px; color: var(--ink-soft); }
.activity-actor-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--stamp-red-dark);
  background: #F2DCDA;
  border-radius: 4px;
  padding: 1px 6px;
}

/* ---------- INVOICE ---------- */
.invoice-card { max-width: 520px; }
.invoice-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--stamp-red);
  border: 2px solid var(--stamp-red);
  border-radius: 4px;
  padding: 4px 12px;
  transform: rotate(-3deg);
  margin-bottom: 12px;
}
.invoice-guest { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 0; }
.invoice-meta { color: var(--ink-soft); font-size: 12.5px; margin: 2px 0 16px; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.invoice-table td { padding: 8px 4px; border-bottom: 1px solid var(--paper-dim); }
.invoice-table td:last-child { text-align: right; font-family: var(--font-mono); }
.invoice-total-row td { font-weight: 600; border-top: 1.5px solid var(--ink); }
.invoice-balance-row td { font-weight: 700; font-size: 15px; border-bottom: none; padding-top: 12px; }
.field-hint--tax { color: var(--ink-soft); font-style: italic; }

.room-tag {
  font-family: var(--font-mono);
  background: var(--pine-soft);
  color: var(--pine);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.room-tag.large { font-size: 20px; padding: 6px 14px; }

/* ---------- LEGEND ---------- */
.legend-row { display: flex; gap: 18px; margin-bottom: 12px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-confirmed { background: var(--gold); }
.legend-checked_in { background: var(--pine); }
.legend-free { background: var(--paper-dim); border: 1px solid var(--line); }

/* ---------- PLANNING / CALENDAR ---------- */
.planning-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 1px 0 var(--line) inset; }
.planning-grid {
  display: grid;
  min-width: 950px;
}
.planning-corner, .planning-daycol {
  padding: 10px 8px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-dim);
  text-align: center;
  position: sticky;
  top: 0;
}
.planning-daycol { display: flex; flex-direction: column; gap: 2px; }
.day-name { font-size: 10.5px; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.04em; }
.day-num { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.planning-daycol.is-today { background: rgba(168,52,31,0.1); }
.planning-daycol.is-today .day-num { color: var(--stamp-red); }

.planning-roomlabel {
  padding: 10px 10px;
  border-bottom: 1px solid var(--paper-dim);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--paper-dim);
  position: relative;
}
.room-type-mini { font-size: 10.5px; color: var(--ink-soft); }
.hk-dot {
  position: absolute; right: 10px; top: 12px;
  width: 8px; height: 8px; border-radius: 50%;
}
.hk-dot.hk-dirty { background: var(--gold); }
.hk-dot.hk-inspected { background: var(--pine); }
.hk-dot.hk-out_of_order { background: var(--stamp-red); }

.planning-cell {
  border-bottom: 1px solid var(--paper-dim);
  border-left: 1px solid var(--paper-dim);
  min-height: 46px;
  display: flex;
  align-items: center;
}
.planning-cell.free:hover { background: var(--pine-soft); cursor: pointer; }
.planning-cell.occupied { cursor: pointer; }
.planning-cell.occ-confirmed { background: var(--gold); }
.planning-cell.occ-checked_in { background: var(--pine); }
.planning-cell.occ-checked_in .cell-guest { color: var(--paper); }
.planning-cell.occupied.is-start {
  border-radius: 6px 0 0 6px;
  margin-left: 3px;
}
.planning-cell.drag-source { opacity: 0.3; }
.planning-cell.drag-target-ok { outline: 2px solid var(--pine); outline-offset: -2px; background: var(--pine-soft) !important; }
.planning-cell.drag-target-bad { outline: 2px solid var(--stamp-red); outline-offset: -2px; background: #F2DCDA !important; }
.planning-drag-ghost {
  position: fixed;
  z-index: 999;
  transform: translate(-50%, -140%);
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  pointer-events: none;
  white-space: nowrap;
}
.cell-guest {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

/* ---------- TABLE ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13.5px;
}
.table-scroll {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}
.table-scroll table { min-width: 100%; }
.table-scroll .data-table { border-radius: 0; }
.data-table th {
  text-align: left;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--paper-dim); }
.table-label-first th, .table-label-first td { text-align: center; }
.table-label-first th:first-child, .table-label-first td:first-child { text-align: left; }
.num-right { text-align: right !important; font-family: var(--font-mono); }
.row-clickable:hover { background: var(--paper-dim); cursor: pointer; }
.due { color: var(--stamp-red); font-weight: 600; }
.row-actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }

.status-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.status-confirmed { background: var(--pine-soft); color: var(--pine); }
.status-cancelled { background: #F2DCDA; color: var(--stamp-red-dark); }
.status-checked_in { background: #FCEBC9; color: #8A6116; }
.status-checked_out { background: var(--paper-dim); color: var(--ink-soft); }
.status-no_show { background: #F2DCDA; color: var(--stamp-red); }

/* ---------- CARDS (guests / rooms) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.guest-card, .room-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.guest-card h3, .room-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 8px 0 6px;
}
.guest-meta { font-size: 12.5px; color: var(--ink-soft); margin: 2px 0; }
.guest-stays { font-size: 12px; color: var(--pine); font-weight: 600; margin-top: 8px; }

.room-card-top { display: flex; justify-content: space-between; align-items: center; }
.floor-badge { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; }
.room-price { font-family: var(--font-mono); font-size: 14px; color: var(--stamp-red); margin: 0; }

/* ---------- MODAL TABS ---------- */
.modal-card--tabs { max-width: 540px; }
.modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--line);
  padding: 0 24px;
  gap: 0;
}
.modal-tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.modal-tab:hover { color: var(--ink); }
.modal-tab.active { color: var(--stamp-red); border-bottom-color: var(--stamp-red); font-weight: 600; }
.tab-panel { display: none; flex-direction: column; gap: 16px; }
.tab-panel.active { display: flex; }

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(31,42,36,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  background: var(--paper);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 { font-family: var(--font-display); font-size: 19px; margin: 0; }
.btn-close { background: none; border: none; font-size: 22px; color: var(--ink-soft); line-height: 1; }
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.field-row { display: flex; flex-direction: column; gap: 6px; }
.field-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row label { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; display: flex; flex-direction: column; gap: 6px; }
.field-row input, .field-row select, .field-row textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}
.field-row input:focus, .field-row select:focus, .field-row textarea:focus {
  outline: none;
  border-color: var(--stamp-red);
}
.field-hint { font-size: 12px; color: var(--pine); margin: 0; }
.field-hint.pin-error { color: var(--stamp-red); font-weight: 600; }

/* ---------- MISC TEXT HELPERS ---------- */
.explainer { font-size: 13.5px; color: var(--ink-soft); max-width: 720px; line-height: 1.6; margin: -6px 0 20px; }
.section-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 30px 0 14px; }
.link-back { background: none; border: none; color: var(--stamp-red); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 0; }
.stat-row--three { grid-template-columns: repeat(3, 1fr); }
.panel-row--detail { grid-template-columns: 280px 1fr; }
.panel--wide { grid-column: span 1; }
.data-table--compact td, .data-table--compact th { padding: 9px 12px; font-size: 12.5px; }
.group-tag {
  font-family: var(--font-mono);
  background: #EFE3F0;
  color: #6B3F75;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.source-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  display: inline-block;
}
.source-direct { background: var(--pine-soft); color: var(--pine); }
.source-phone { background: #E4ECF5; color: #3A5A85; }
.source-booking { background: #DCEEF7; color: #1A6E96; }
.source-expedia { background: #FCEAD8; color: #B25E1E; }
.source-agency { background: #EFE3F0; color: #6B3F75; }
.source-walkin { background: var(--paper-dim); color: var(--ink-soft); }

/* ---------- WAITLIST ---------- */
.waitlist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.waitlist-list li {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.waitlist-main { display: flex; flex-direction: column; gap: 3px; }
.waitlist-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- TASKS ---------- */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
}
.task-list li.task-done { opacity: 0.5; }
.task-list li.task-done .task-content { text-decoration: line-through; }
.data-table tr.row-inactive { opacity: 0.55; }
.task-check { width: 17px; height: 17px; accent-color: var(--pine); }
.task-content { flex: 1; font-size: 13.5px; }
.dashboard-task-summary { font-size: 14px; color: var(--ink-soft); margin: 4px 0 14px; }

/* ---------- NIGHT AUDIT ---------- */
.audit-sheet { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 28px; max-width: 760px; }
.audit-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.audit-head h2 { font-family: var(--font-display); font-size: 20px; margin: 0; font-weight: 600; }
.audit-sheet h3 { font-family: var(--font-display); font-size: 16px; margin: 22px 0 8px; }
.audit-alert {
  background: #FBF0EC;
  border: 1px solid rgba(168,52,31,0.25);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  margin: 10px 0;
  color: var(--stamp-red-dark);
}
.audit-ok {
  background: var(--pine-soft);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  margin: 10px 0;
  color: var(--pine);
}
.audit-list { margin: 8px 0 0; padding-left: 18px; }
@media print {
  .sidebar, .view-header .header-actions { display: none !important; }
  .audit-sheet { border: none; box-shadow: none; }
}

/* ---------- TRAINING MODE ---------- */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.scenario-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  border-top: 3px solid var(--gold);
}
.scenario-card h3 { font-family: var(--font-display); font-size: 17px; margin: 0 0 10px; }
.scenario-brief { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 14px; }
.scenario-goals-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pine); font-weight: 600; margin: 0 0 6px; }
.scenario-goals { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }

/* Trois couleurs de métier, cohérentes dans tout le mode formation */
:root {
  --job-reception: var(--stamp-red);
  --job-reception-bg: #FBF0EC;
  --job-housekeeper: #2E6E8E;
  --job-housekeeper-bg: #E4EFF4;
  --job-governess: #6B3F75;
  --job-governess-bg: #F1E7F2;
}

.job-generate-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.job-generate-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  text-align: left;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.job-generate-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.07); }
.job-generate-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.job-generate-text { display: flex; flex-direction: column; gap: 2px; }
.job-generate-text strong { font-size: 14.5px; }
.job-generate-text span { font-size: 12px; color: var(--ink-soft); }

.job-generate-btn--reception { border-color: var(--job-reception); }
.job-generate-btn--reception .job-generate-icon { background: var(--job-reception-bg); color: var(--job-reception); }
.job-generate-btn--housekeeper { border-color: var(--job-housekeeper); }
.job-generate-btn--housekeeper .job-generate-icon { background: var(--job-housekeeper-bg); color: var(--job-housekeeper); }
.job-generate-btn--governess { border-color: var(--job-governess); }
.job-generate-btn--governess .job-generate-icon { background: var(--job-governess-bg); color: var(--job-governess); }

.scenario-card--generated { border-top-width: 0; border-left: 5px solid var(--gold); max-width: 640px; animation: scenario-appear 0.25s ease; }
.scenario-card--reception { border-left-color: var(--job-reception); }
.scenario-card--housekeeper { border-left-color: var(--job-housekeeper); }
.scenario-card--governess { border-left-color: var(--job-governess); }

@keyframes scenario-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.scenario-job-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 11px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.scenario-job-badge--reception { background: var(--job-reception-bg); color: var(--job-reception); }
.scenario-job-badge--housekeeper { background: var(--job-housekeeper-bg); color: var(--job-housekeeper); }
.scenario-job-badge--governess { background: var(--job-governess-bg); color: var(--job-governess); }

/* ---------- HOUSEKEEPING PILLS ---------- */
.hk-pill {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; display: inline-block;
}
.hk-pill--clean { background: var(--pine-soft); color: var(--pine); }
.hk-pill--dirty { background: #FBF0D9; color: #8A6116; }
.hk-pill--inspected { background: #E4ECF5; color: #3A5A85; }
.hk-pill--out_of_order { background: #F2DCDA; color: var(--stamp-red-dark); }

/* ---------- FEUILLE DE MÉNAGE ---------- */
.hk-sheet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hk-sheet-list li {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; flex-wrap: wrap;
}
.hk-sheet-list li.hk-task-done { opacity: 0.5; }
.hk-sheet-list li.hk-task-done .hk-task-type { text-decoration: line-through; }
.hk-task-check { width: 17px; height: 17px; accent-color: var(--pine); }
.hk-task-type { font-weight: 600; font-size: 13.5px; }
.hk-task-hk { font-size: 12.5px; color: var(--ink-soft); flex: 1; }

/* ---------- ANOMALIES ---------- */
.anomaly-list { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.anomaly-list li {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 8px; padding: 14px 16px;
}
.anomaly-list li.anomaly-minor { border-left-color: var(--gold); }
.anomaly-list li.anomaly-major { border-left-color: #B25E1E; }
.anomaly-list li.anomaly-urgent { border-left-color: var(--stamp-red); }
.anomaly-content { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.anomaly-list--resolved li { opacity: 0.65; }
.severity-pill { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.severity-minor { background: #FBF0D9; color: #8A6116; }
.severity-major { background: #FCEAD8; color: #B25E1E; }
.severity-urgent { background: #F2DCDA; color: var(--stamp-red-dark); }

/* ---------- SOURCE TAG already defined above; minibar/keys/lost-found reuse ledger-list & waitlist-list ---------- */

/* ---------- RESPONSIVE (tablette) ---------- */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; height: 100vh; }
  .sidebar {
    width: 100%; height: auto; max-height: 64px;
    flex-direction: row; align-items: center;
    padding: 14px 16px; overflow-x: auto; overflow-y: hidden;
    flex-shrink: 0;
  }
  .brand { border-bottom: none; padding: 0; margin: 0 16px 0 0; }
  .nav { flex-direction: row; flex: none; }
  .nav-item.active::before { display: none; }
  .nav-group-label { display: none; }
  .reset-link { display: none; }
  .main-content { padding: 20px; height: auto; flex: 1; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-row--three { grid-template-columns: repeat(2, 1fr); }
  .panel-row { grid-template-columns: 1fr; }
  .panel-row--detail { grid-template-columns: 1fr; }
  .field-row.two-col { grid-template-columns: 1fr; }
  .view-header { flex-direction: column; align-items: stretch; }
  .header-actions { flex-wrap: wrap; }
  .search-input { flex: 1; min-width: 0; }
}

/* ---------- RESPONSIVE (téléphone) ---------- */
@media (max-width: 480px) {
  .sidebar { padding: 10px 12px; max-height: 56px; gap: 2px; }
  .brand { margin: 0 10px 0 0; }
  .brand-text strong { font-size: 16px; }
  .brand-text span { display: none; }
  .nav-item { padding: 9px 10px; font-size: 13px; gap: 9px; white-space: nowrap; }
  .main-content { padding: 14px; }
  .stat-row, .stat-row--three { grid-template-columns: 1fr 1fr; gap: 10px; }
  .view-header h1 { font-size: 19px; }
  .header-actions { gap: 6px; }
  .header-actions .btn, .header-actions button { flex: 1 1 auto; }
  table { font-size: 13px; }
}

/* ---------- SIMULATEUR DE TERMINAL DE PAIEMENT (formation) ---------- */
.terminal-card { max-width: 340px; background: var(--ink); border-radius: 18px; overflow: hidden; }
.terminal-body {
  padding: 30px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  color: var(--white);
  font-family: var(--font-mono);
  text-align: center;
  min-height: 260px;
  justify-content: center;
}
.terminal-brand { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); opacity: 0.85; }
.terminal-amount { font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.terminal-status { font-size: 13px; line-height: 1.5; color: #D9DDD9; min-height: 34px; }
.terminal-icon { font-size: 34px; animation: terminal-pulse 1.4s ease-in-out infinite; }
.terminal-icon.spin { animation: terminal-spin 0.9s linear infinite; display: inline-block; }
@keyframes terminal-pulse { 0%, 100% { opacity: 0.45; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes terminal-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.terminal-approved { color: #7FD08A; font-size: 40px; }
.terminal-declined { color: #E38375; font-size: 40px; }
.pin-dots { display: flex; gap: 12px; }
.pin-dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--gold); background: transparent; transition: background 0.15s; }
.pin-dot.filled { background: var(--gold); }
.terminal-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 220px; }
.terminal-keypad button {
  padding: 12px 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 15px;
}
.terminal-keypad button:active { background: rgba(255,255,255,0.16); }
.terminal-keypad button.key-wide { grid-column: span 1; font-size: 11px; letter-spacing: 0.04em; }
.terminal-footer {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 14px 24px 20px;
}
.terminal-footer .btn-ghost, .terminal-footer .btn-primary, .terminal-footer .btn-danger {
  flex: 1; text-align: center; justify-content: center;
}
.terminal-hint { font-size: 11px; color: var(--gold); }
