/* ============================================================================
   ATLAS REDESIGN — Hire-an-agent modal + toast  (v2.3)
   Branch: atlas-redesign-2026-06-29 · pairs with js/redesign/hire-agent.js

   A centered modal opened from the AI Workforce "Add agent" button and from the
   ⌘K palette. Both themes via html[data-rtheme]. Tokens-only — ZERO raw hex.
   No fabricated provisioning: submit shows an honest "now onboarding" toast and
   routes to AI Workforce (the agent runtime wiring is a separate step).
   ========================================================================== */

/* AI Workforce "Add agent" button (header) */
.rd-agents__add {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--r-radius-control);
  border: 1px solid var(--r-primary); background: var(--r-primary); color: var(--r-primary-ink);
  font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: filter var(--r-dur) var(--r-ease), box-shadow var(--r-dur) var(--r-ease);
}
.rd-agents__add i { font-size: 15px; }
.rd-agents__add:hover { filter: brightness(1.05); box-shadow: var(--r-shadow-hover); }
.rd-agents__add:active { transform: translateY(.5px); }

/* scrim + modal card */
.rd-modal-scrim {
  position: fixed; inset: 0; z-index: 240;
  background: rgba(20, 18, 12, .42); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 7vh 20px 20px;
  animation: rdModalFade .16s ease both; overflow-y: auto;
}
html[data-rtheme="operator"] .rd-modal-scrim { background: rgba(0, 0, 0, .58); }
@keyframes rdModalFade { from { opacity: 0; } to { opacity: 1; } }

.rd-modal {
  width: 540px; max-width: 100%;
  background: var(--r-surface); border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card); box-shadow: var(--r-shadow-pop);
  font-family: var(--r-font-body); color: var(--r-ink); overflow: hidden;
  animation: rdModalIn .2s var(--r-ease) both;
}
@keyframes rdModalIn { from { transform: translateY(10px) scale(.985); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rd-modal, .rd-modal-scrim { animation: none; } }
html[data-rmotion="reduced"] .rd-modal, html[data-rmotion="reduced"] .rd-modal-scrim { animation: none; }

.rd-modal-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--r-hairline);
  background: linear-gradient(180deg, var(--r-canvas-raised), var(--r-surface));
}
.rd-modal-head-ic {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--r-mint-surface); color: var(--r-mint-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
}
.rd-modal-head-tt { flex: 1; min-width: 0; }
.rd-modal-head-tt b { font-family: var(--r-font-display); font-size: 19px; font-weight: 600; color: var(--r-ink); display: block; }
.rd-modal-head-tt span { font-size: 12px; color: var(--r-faint); }
.rd-modal-close {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--r-border); background: var(--r-surface); color: var(--r-muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-family: inherit;
}
.rd-modal-close:hover { background: var(--r-canvas-raised); color: var(--r-ink); }

.rd-modal-body { padding: 18px 20px; max-height: 64vh; overflow-y: auto; }
.rd-field { margin-bottom: 16px; }
.rd-field > label {
  display: block; font-family: var(--r-font-mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--r-faint); margin-bottom: 7px;
}
.rd-input, .rd-select, .rd-textarea {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13.5px; color: var(--r-ink);
  background: var(--r-surface-2); border: 1px solid var(--r-border); border-radius: var(--r-radius-control);
  padding: 9px 12px; transition: border-color var(--r-dur) var(--r-ease), box-shadow var(--r-dur) var(--r-ease);
}
.rd-input::placeholder, .rd-textarea::placeholder { color: var(--r-faint); }
.rd-input:focus, .rd-select:focus, .rd-textarea:focus {
  outline: none; border-color: var(--r-primary); box-shadow: 0 0 0 3px var(--r-select);
}
.rd-textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.rd-select { appearance: none; cursor: pointer; }
.rd-field-row { display: flex; gap: 14px; }
.rd-field-row > .rd-field { flex: 1; }

/* autonomy segmented (3-up) */
.rd-auto-seg { display: flex; gap: 8px; }
.rd-auto-btn {
  flex: 1; border: 1px solid var(--r-border); border-radius: var(--r-radius-control);
  background: var(--r-surface-2); color: var(--r-muted); cursor: pointer; font-family: inherit;
  padding: 9px 8px; text-align: center; transition: all var(--r-dur) var(--r-ease);
}
.rd-auto-btn b { display: block; font-size: 12px; font-weight: 600; color: var(--r-body); }
.rd-auto-btn span { font-size: 12px; color: var(--r-faint); }
.rd-auto-btn.is-on { border-color: var(--r-primary); background: var(--r-mint-surface); }
.rd-auto-btn.is-on b { color: var(--r-mint-ink); }
.rd-auto-btn.is-on span { color: var(--r-mint-ink); }

/* tools access chips (multi-select) */
.rd-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-tool-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--r-border); border-radius: var(--r-radius-pill);
  background: var(--r-surface-2); color: var(--r-muted); cursor: pointer; font-family: inherit;
  padding: 6px 12px; font-size: 12px; transition: all var(--r-dur) var(--r-ease);
}
.rd-tool-chip i { font-size: 13px; }
.rd-tool-chip.is-on { border-color: var(--r-primary); background: var(--r-mint-surface); color: var(--r-mint-ink); font-weight: 600; }

/* footer */
.rd-modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--r-hairline); background: var(--r-surface-2);
}
.rd-btn-ghost {
  height: 36px; padding: 0 16px; border-radius: var(--r-radius-control);
  border: 1px solid var(--r-border); background: var(--r-surface); color: var(--r-body);
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.rd-btn-ghost:hover { background: var(--r-canvas-raised); }
.rd-btn-primary {
  height: 36px; padding: 0 18px; border-radius: var(--r-radius-control);
  border: 1px solid var(--r-primary); background: var(--r-primary); color: var(--r-primary-ink);
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.rd-btn-primary i { font-size: 15px; }
.rd-btn-primary:hover { filter: brightness(1.05); box-shadow: var(--r-shadow-hover); }
.rd-btn-primary:active { transform: translateY(.5px); }

/* toast */
.rd-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  z-index: 260; display: inline-flex; align-items: center; gap: 9px;
  background: var(--r-ink); color: var(--r-canvas);
  border-radius: var(--r-radius-pill); padding: 11px 18px;
  font-family: var(--r-font-body); font-size: 13px; font-weight: 600;
  box-shadow: var(--r-shadow-pop); opacity: 0;
  animation: rdToastIn .22s var(--r-ease) forwards;
}
.rd-toast i { font-size: 16px; color: var(--r-primary-2); }
.rd-toast.is-out { animation: rdToastOut .25s var(--r-ease) forwards; }
@keyframes rdToastIn { to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes rdToastOut { to { opacity: 0; transform: translateX(-50%) translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .rd-toast { animation: none; opacity: 1; transform: translateX(-50%); } }
