/* components.css — buttons, modal, toasts, form fields shared across the
   Divider and future tools. */

.chip-btn {
  background: var(--chassis-200);
  border: 1px solid var(--chassis-500);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 600;
  box-shadow: var(--shadow-hard);
  white-space: nowrap;
}
.chip-btn:hover { filter: brightness(1.04); }
.chip-btn:active { transform: translateY(1px); box-shadow: none; }

.chip-btn--primary {
  background: linear-gradient(180deg, var(--orange-300), var(--orange-500));
  border-color: var(--orange-700);
  color: #2a1400;
}
.chip-btn--danger {
  background: linear-gradient(180deg, var(--red-300), var(--red-500));
  border-color: var(--red-700);
  color: #340a06;
}
.chip-btn--back { margin-right: 4px; }

.ghost-btn {
  background: transparent;
  border: 1px dashed var(--chassis-500);
  color: var(--ink-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  letter-spacing: 0.04em;
  width: 100%;
  margin-top: 10px;
}
.ghost-btn:hover { color: var(--ink); border-color: var(--chassis-600); }
.ghost-btn--sm { width: auto; margin-top: 0; padding: 5px 9px; font-size: 11px; }
.ghost-btn--danger:hover { color: var(--red-700); border-color: var(--red-500); }

/* ---------- modal ---------- */

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 10, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal__dialog {
  background: var(--chassis-100);
  border: 1px solid var(--chassis-500);
  border-radius: 8px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.modal__dialog--wide { max-width: 720px; }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--chassis-400);
}
.modal__title { font-weight: 700; letter-spacing: 0.06em; font-size: 13px; }
.modal__close {
  background: none; border: none; color: var(--ink-muted); font-size: 16px; line-height: 1; padding: 4px;
}
.modal__close:hover { color: var(--ink); }

.modal__body {
  padding: 16px;
  overflow-y: auto;
}
.modal__text { font-size: 13px; margin-bottom: 8px; }
.modal__text--muted { color: var(--ink-muted); font-size: 12px; }

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--chassis-400);
}

/* ---------- toast ---------- */

.toast-root {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1100;
  align-items: center;
}
.toast {
  background: var(--chassis-800);
  color: var(--phosphor-300);
  border: 1px solid var(--chassis-600);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast--in { opacity: 1; transform: translateY(0); }
.toast--warn { color: var(--amber-300); }
.toast--error { color: var(--red-300); }

/* ---------- forms ---------- */

.form-grid { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.field__label { font-size: 11px; letter-spacing: 0.06em; color: var(--ink-muted); }
.field-row { display: flex; gap: 10px; }

.text-input, .select-input {
  background: #fff;
  border: 1px solid var(--chassis-500);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 13px;
}
.text-input--num { width: 100%; }
.text-input--area { resize: vertical; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
}
.checkbox-label--sm { font-size: 11px; }

.form-section-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  border-top: 1px dashed var(--chassis-400);
  padding-top: 10px;
  margin-top: 4px;
}

.date-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.date-edit-row .text-input { flex: 1; }

.pref-table { display: flex; flex-direction: column; gap: 8px; }
.pref-row {
  display: grid;
  grid-template-columns: 1fr 140px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--chassis-300);
}
.pref-row__title { font-size: 12px; font-weight: 600; }
.pref-row__dates { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 620px) {
  .pref-row { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; }
}
