.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.button:active { transform: scale(.985); }
.button--primary { background: #202a25; color: white; }
.button--primary:hover { background: #34443a; }
.button--secondary { border-color: var(--line); background: white; color: var(--ink); }
.button--secondary:hover, .button--quiet:hover { background: #f5f6f5; }
.button--quiet { border-color: transparent; background: transparent; color: #4e5852; }
.button--light { background: white; color: #202a25; }
.button--danger { background: var(--red); color: white; }
.button--danger-outline { border-color: #efd4d4; background: white; color: var(--red); }
.button--wide { width: 100%; }

.form { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label, .field-label { color: var(--ink); font-size: 13px; font-weight: 750; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #727b75; box-shadow: 0 0 0 3px rgba(32, 42, 37, .06); }
.field-error { min-height: 0; color: var(--red); font-size: 12px; }
.input-error { border-color: var(--red) !important; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline-status { margin: 0; color: var(--muted); font-size: 13px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}
.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status--active { background: var(--green-soft); color: var(--green); }
.status--approved { background: #edf3f7; color: #426d8c; }
.status--pending { background: var(--amber-soft); color: var(--amber); }
.status--completed, .status--paused, .status--pause_requested, .status--resume_requested, .status--edit_requested { background: #eff1f4; color: #5d6470; }
.status--rejected { background: var(--red-soft); color: var(--red); }
.status--unknown { background: var(--surface); color: var(--muted); }

.error-banner, .notice { margin: 0 0 18px; padding: 13px 15px; border-radius: 11px; font-size: 13px; line-height: 1.5; }
.error-banner { border: 1px solid #f1d3d3; background: var(--red-soft); color: #8d2929; }
.notice { border: 1px solid #eee0be; background: var(--amber-soft); color: #704b08; }
.notice h2, .notice h3 { margin: 0 0 5px; font-size: 15px; }
.notice p { margin: 0 0 12px; }
.notice--danger { border-color: #f0caca; background: var(--red-soft); color: #792626; }
.empty-state { margin: 16px 0 0; padding: 28px 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 13px; }
.empty-state a { font-weight: 750; }

.dialog-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 22, 19, .38);
}
.dialog {
  width: min(100%, 440px);
  padding: 26px;
  border: 1px solid #e9ece9;
  border-radius: 16px;
  background: white;
  box-shadow: 0 20px 70px rgba(17, 26, 20, .2);
}
.dialog h2 { margin: 0 0 8px; font: 750 20px Manrope, sans-serif; }
.dialog p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }

.toast-root { position: fixed; z-index: 120; right: 20px; bottom: calc(20px + var(--safe-bottom)); width: min(420px, calc(100% - 40px)); pointer-events: none; }
.toast { margin-top: 8px; padding: 13px 15px; border-radius: 11px; background: var(--ink); color: white; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.error-message { color: var(--red); }

@media (max-width: 520px) {
  .field-row { gap: 10px; }
  .dialog { align-self: end; padding: 22px 18px calc(20px + var(--safe-bottom)); border-radius: 17px 17px 0 0; }
  .dialog__actions { display: grid; grid-template-columns: 1fr 1fr; }
}
