/**
 * #abō — Bulk Started-At Editor (v2.39.0)
 * Styles de l'overlay batch pour renseigner startedAt + engagementMonths.
 * Cohérent avec le design system : ivoire, nuit, Boow, mono pour labels.
 */

#bulk-started-at-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-body, system-ui, -apple-system, sans-serif);
}

#bulk-started-at-overlay .bulk-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 40, 69, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: bulkFadeIn 200ms ease-out;
}

#bulk-started-at-overlay .bulk-modal {
  position: relative;
  background: var(--ivoire, #F5EFE0);
  border-radius: 18px;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px -20px rgba(0, 0, 0, 0.4);
  animation: bulkSlideIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

@keyframes bulkFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bulkSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Header === */
.bulk-modal-header {
  padding: 22px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(26, 40, 69, 0.08);
}

.bulk-modal-header .bulk-eyebrow {
  font-family: var(--f-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--boow, #F85558);
  margin-bottom: 8px;
}

.bulk-modal-header h2 {
  font-family: var(--f-display, var(--f-body));
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--nuit, #1A2845);
  margin: 0 0 6px;
}

.bulk-modal-header .bulk-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: var(--nuit-soft, #6B7280);
  line-height: 1.45;
}

.bulk-close {
  background: transparent;
  border: 1px solid rgba(26, 40, 69, 0.12);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--nuit, #1A2845);
  flex-shrink: 0;
  transition: background 150ms;
}
.bulk-close:hover { background: rgba(26, 40, 69, 0.06); }

/* === Body === */
.bulk-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.bulk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bulk-table thead th {
  position: sticky;
  top: 0;
  background: var(--ivoire-deep, #F0E9D6);
  font-family: var(--f-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nuit-soft, #6B7280);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(26, 40, 69, 0.08);
}

.bulk-table tbody tr {
  border-bottom: 1px solid rgba(26, 40, 69, 0.05);
  transition: background 180ms ease-out;
}

.bulk-table tbody tr:hover { background: rgba(26, 40, 69, 0.025); }

.bulk-table tbody tr.is-just-saved {
  background: rgba(123, 159, 53, 0.08);
  animation: bulkFlash 1.2s ease-out;
}

@keyframes bulkFlash {
  0%, 100% { background: rgba(123, 159, 53, 0.08); }
  50% { background: rgba(123, 159, 53, 0.18); }
}

.bulk-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.bulk-cell-name .bulk-name {
  font-weight: 600;
  color: var(--nuit, #1A2845);
  margin-bottom: 2px;
}

.bulk-cell-name .bulk-meta {
  font-size: 11px;
  font-family: var(--f-mono, ui-monospace, monospace);
  color: var(--nuit-soft, #6B7280);
  letter-spacing: 0.02em;
}

.bulk-input-date,
.bulk-input-engagement {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(26, 40, 69, 0.16);
  border-radius: 8px;
  background: var(--ivoire-pure, #FFFFFF);
  font-family: inherit;
  font-size: 13px;
  color: var(--nuit, #1A2845);
  transition: border-color 150ms, box-shadow 150ms;
}

.bulk-input-date:focus,
.bulk-input-engagement:focus {
  outline: none;
  border-color: var(--boow, #F85558);
  box-shadow: 0 0 0 3px rgba(248, 85, 88, 0.12);
}

.bulk-status-pill {
  display: inline-block;
  font-family: var(--f-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  font-weight: 600;
}

.bulk-status-pill.is-missing {
  background: rgba(208, 167, 60, 0.18);
  color: #8C6A1A;
}

.bulk-status-pill.is-filled {
  background: rgba(123, 159, 53, 0.16);
  color: #4A6B1F;
}

/* === Footer === */
.bulk-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(26, 40, 69, 0.08);
  background: var(--ivoire-deep, #F0E9D6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bulk-footer-hint {
  font-size: 11.5px;
  color: var(--nuit-soft, #6B7280);
  font-family: var(--f-mono, ui-monospace, monospace);
  letter-spacing: 0.02em;
  flex: 1;
  min-width: 200px;
}

.bulk-footer-hint.is-success {
  color: #4A6B1F;
  font-weight: 600;
}

.bulk-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.bulk-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 100ms, background 150ms;
}

.bulk-btn:hover { transform: translateY(-1px); }
.bulk-btn:active { transform: translateY(0); }

.bulk-btn-ghost {
  background: transparent;
  border-color: rgba(26, 40, 69, 0.18);
  color: var(--nuit, #1A2845);
}
.bulk-btn-ghost:hover { background: rgba(26, 40, 69, 0.05); }

.bulk-btn-primary {
  background: var(--boow, #F85558);
  color: var(--ivoire, #F5EFE0);
}
.bulk-btn-primary:hover { background: #E64A4D; }

/* === Mobile === */
@media (max-width: 720px) {
  #bulk-started-at-overlay .bulk-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
    border-radius: 14px;
  }
  .bulk-modal-header { padding: 18px 18px 14px; }
  .bulk-modal-header h2 { font-size: 18px; }
  .bulk-modal-footer { padding: 14px 18px; flex-direction: column; align-items: stretch; }
  .bulk-actions { width: 100%; justify-content: flex-end; }
  .bulk-table thead { display: none; }
  .bulk-table tbody tr {
    display: block;
    padding: 14px;
    border-bottom: 1px solid rgba(26, 40, 69, 0.06);
  }
  .bulk-table td { display: block; padding: 5px 0; width: 100%; }
  .bulk-table .bulk-cell-name { margin-bottom: 8px; }
  .bulk-table .bulk-cell-status { margin-top: 6px; text-align: right; }
}

/* === Motion reduce === */
@media (prefers-reduced-motion: reduce) {
  .bulk-backdrop,
  .bulk-modal,
  .bulk-table tbody tr.is-just-saved {
    animation: none;
  }
}
