/* Générateur de planning restaurant — complète guides.css */

.gen {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 40px 8px;
  min-width: 0;
}

/* —— Formulaire —— */
.gen-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}
.gen-step {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 22px;
  padding: 20px 22px 22px;
}
.gen-step legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.gen-step legend + * { clear: both; }
.gen-n {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
}
.gen-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 8px;
}
.gen-row .gen-label { margin-top: 0; }
.gen-hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 4px; }

.gen-input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  min-width: 0;
}
.gen-input:focus-visible,
.chip:focus-visible,
.gen-link:focus-visible,
.gen-tool .btn:focus-visible,
.gen-actions .btn:focus-visible,
.gen-table-wrap:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.gen-date { width: 100%; max-width: 220px; }

.gen-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 52px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.gen-services { display: flex; flex-direction: column; gap: 8px; }
.svc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.svc-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
  min-width: 80px;
}
.svc-name input { width: 18px; height: 18px; accent-color: var(--blue); }
.svc-hours { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.svc-hours .gen-input { padding: 6px 8px; width: 108px; }
.svc:has(input[type="checkbox"]:not(:checked)) .svc-hours { opacity: 0.45; }

.gen-team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.gen-brigade { display: block; min-width: 0; }
.gen-brigade .gen-label { margin-top: 6px; }
.gen-brigade textarea { width: 100%; resize: vertical; line-height: 1.5; }
.gen-link {
  margin-top: 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2C48C8;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gen-submit {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.gen-tool .btn, .gen-actions .btn, .gen-cta .btn {
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}
.gen-tool .btn-lg, .gen-cta .btn-lg { padding: 15px 26px; font-size: 1rem; }
.gen-actions .btn-ghost { border-color: var(--line); }
.gen-error {
  flex-basis: 100%;
  color: #B42318;
  font-weight: 700;
  font-size: 0.92rem;
}
.gen-error[hidden] { display: none; }

/* —— Résultat —— */
.gen-result {
  margin-top: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 24px 24px;
  min-width: 0;
  scroll-margin-top: 90px;
}
.gen-result[hidden] { display: none; }
.gen-print-head h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 2px;
}
.gen-week { color: var(--muted); font-size: 0.95rem; margin-bottom: 14px; }

.gen-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 100%;
}
.gen-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 560px;
  font-size: 0.86rem;
}
.gen-table th,
.gen-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.gen-table thead th {
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}
.gen-table th small,
.gen-table td span {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.76rem;
}
.gen-table .col-name {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 1px 0 0 var(--line);
}
.gen-table thead .col-name { background: var(--bg); }
.gen-table .col-total { text-align: right; font-weight: 800; white-space: nowrap; }
.gen-table .row-group th {
  position: sticky;
  left: 0;
  background: var(--lilac);
  color: #2C48C8;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
}
.cell-work strong { display: block; font-size: 0.84rem; }
.cell-work span { white-space: nowrap; }
.cell-rest { color: var(--muted); font-style: italic; }
.gen-table tfoot .col-name,
.gen-table tfoot td { background: #FAFBFD; }
.cell-cov strong { font-size: 0.95rem; }
.cell-cov span { white-space: nowrap; }
.cov-zero strong { color: #B42318; }
.cov-zero { background: #FDECEC !important; }
.row-legend td {
  color: var(--muted);
  font-size: 0.76rem;
  border-bottom: none;
}

.gen-note { color: var(--muted); font-size: 0.86rem; margin: 12px 0 0; max-width: 72ch; }
.gen-print-foot { display: none; }

.gen-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.gen-copied { color: #1B7A4A; font-size: 0.88rem; font-weight: 700; }
.gen-fallback { width: 100%; margin-top: 10px; font-size: 0.85rem; }
.gen-fallback[hidden] { display: none; }

.gen-cta {
  margin-top: 22px;
  background: var(--ink);
  color: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
}
.gen-cta h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 34ch;
  margin: 0 auto 8px;
}
.gen-cta p { color: #C9D2E0; max-width: 52ch; margin: 0 auto 18px; }
.gen-cta .btn-fill { background: #fff; color: var(--ink); }
.gen-cta .gen-cta-note { margin: 10px auto 0; font-size: 0.85rem; font-weight: 700; color: #C9D2E0; }

@media (max-width: 960px) {
  .gen-tool { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .gen { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 640px) {
  .gen-team { grid-template-columns: minmax(0, 1fr); }
  .gen-team textarea { min-height: 96px; }
  .gen-step, .gen-result { padding: 18px 16px; border-radius: 18px; }
  .gen-tool .btn-lg { width: 100%; justify-content: center; }
  .gen-cta .btn-lg { width: 100%; justify-content: center; padding-left: 16px; padding-right: 16px; }
  .gen-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* —— Impression : seulement le titre, la semaine, le tableau et le pied —— */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { background: #fff !important; }
  body > *:not(main),
  .gen > *:not(.gen-result),
  .gen-result .no-print,
  .cp-consent { display: none !important; }
  .gen { max-width: none; padding: 0; margin: 0; }
  .gen-result { border: none; padding: 0; margin: 0; border-radius: 0; }
  .gen-table-wrap { overflow: visible; border: none; border-radius: 0; }
  .gen-table { min-width: 0; font-size: 9pt; }
  .gen-table th, .gen-table td { border: 1px solid #999; padding: 4px 6px; }
  .gen-table .col-name { position: static; box-shadow: none; }
  .gen-table .row-group th { position: static; background: #eee !important; color: #000; }
  .gen-table tr { break-inside: avoid; }
  .cell-work span, .cell-cov span { white-space: normal; }
  .cov-zero { background: #fff !important; }
  .cov-zero strong { text-decoration: underline; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .gen-print-foot {
    display: block;
    margin-top: 8px;
    font-size: 8pt;
    color: #555;
    text-align: right;
  }
}
