/* ========================================== */
/* GoScores - Calendrier Gestationnel         */
/* Vue « colonnes par trimestre »             */
/* ========================================== */

/* Layout pleine largeur : grille mono-colonne, la sidebar résultat est
   masquée par le renderer (hidden) et rétablie par resetScoreLayout() */
.score-grid.gestcal-grid {
  grid-template-columns: 1fr;
}

/* .score-sidebar a display:flex, qui écrase l'attribut hidden posé
   par le renderer — on rétablit la sémantique de hidden */
.score-sidebar[hidden] {
  display: none;
}

/* La carte formulaire devient un conteneur transparent : chaque bloc
   (barre, bandeau, colonnes, pied) porte sa propre carte */
.score-form-card.gestcal-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

/* ------------------------------------------ */
/* Barre de saisie compacte                   */
/* ------------------------------------------ */
.gestcal-formbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 20px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  padding: 12px 16px;
}

.gestcal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gestcal-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: pre;
}

.gestcal-select,
.gestcal-input {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 10px;
}

.gestcal-select:focus,
.gestcal-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(217, 119, 87, 0.15);
}

.gestcal-conditional {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.gestcal-number-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gestcal-input-number {
  width: 72px;
}

.gestcal-unit {
  font-size: 12px;
  color: var(--text-muted);
}

.gestcal-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.gestcal-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 7px 12px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.gestcal-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.gestcal-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

/* ------------------------------------------ */
/* État vide                                  */
/* ------------------------------------------ */
.gestcal-empty {
  background: var(--bg-canvas);
  border: 1px dashed var(--border-medium);
  border-radius: var(--border-radius-lg);
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 16px;
  padding: 48px 24px;
  text-align: center;
}

/* ------------------------------------------ */
/* Bandeau des chiffres clés                  */
/* ------------------------------------------ */
.gestcal-keys {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  margin-top: 16px;
  overflow: hidden;
}

.gestcal-key {
  flex: 1;
  min-width: 150px;
  border-left: 1px solid var(--border-light);
  padding: 12px 16px 11px;
}

.gestcal-key:first-child {
  border-left: none;
}

.gestcal-key-accent {
  box-shadow: inset 0 3px 0 var(--accent-primary);
}

.gestcal-key-accent .gestcal-key-value {
  color: var(--accent-primary-hover);
}

.gestcal-key-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.gestcal-key-value {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gestcal-key-sub {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 1px;
}

/* ------------------------------------------ */
/* Colonnes par trimestre                     */
/* ------------------------------------------ */
.gestcal-tris {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 12px;
}

.gestcal-tri {
  flex: 1;
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}

.gestcal-tri-current {
  border-color: var(--accent-primary);
  box-shadow: inset 0 3px 0 var(--accent-primary);
}

.gestcal-tri-head {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
  padding: 11px 14px 9px;
}

.gestcal-tri-current .gestcal-tri-head {
  background: var(--bg-canvas);
}

.gestcal-tri-name {
  align-items: center;
  color: var(--text-primary);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.gestcal-tri-range {
  color: var(--text-muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.gestcal-chip {
  background: var(--accent-primary);
  border-radius: var(--border-radius-pill);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  text-transform: uppercase;
}

.gestcal-ev {
  border-top: 1px solid var(--border-light);
  padding: 9px 14px;
}

.gestcal-ev:first-of-type {
  border-top: none;
}

.gestcal-ev-name {
  align-items: baseline;
  color: var(--text-primary);
  display: flex;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 600;
  gap: 6px;
}

.gestcal-ev-dates {
  color: var(--text-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.gestcal-ev-sa {
  color: var(--text-muted);
  font-size: 10.5px;
}

.gestcal-tick {
  color: var(--accent-success);
  font-size: 11px;
  font-weight: 700;
}

.gestcal-ev-past .gestcal-ev-name,
.gestcal-ev-past .gestcal-ev-dates {
  color: var(--text-muted);
}

.gestcal-ev-now {
  background: var(--bg-sidebar);
  box-shadow: inset 3px 0 0 var(--accent-primary);
}

/* ------------------------------------------ */
/* Pied de page : termes 40 / 41 / 42 SA      */
/* ------------------------------------------ */
.gestcal-terms {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  margin-top: 12px;
  overflow: hidden;
}

.gestcal-term {
  flex: 1;
  min-width: 150px;
  border-left: 1px solid var(--border-light);
  padding: 10px 16px 9px;
}

.gestcal-term:first-child {
  border-left: none;
}

.gestcal-term-value {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gestcal-term-accent .gestcal-term-value {
  color: var(--accent-primary-hover);
}

/* ------------------------------------------ */
/* Responsive                                 */
/* ------------------------------------------ */
@media (max-width: 900px) {
  .gestcal-tris {
    flex-direction: column;
  }

  .gestcal-actions {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .gestcal-key,
  .gestcal-term {
    flex-basis: 100%;
    border-left: none;
    border-top: 1px solid var(--border-light);
  }

  .gestcal-key:first-child,
  .gestcal-term:first-child {
    border-top: none;
  }
}
