/* ═══════════════════════════════════════════════════════════════════════
   AE Roadmap — page styles
   ───────────────────────────────────────────────────────────────────────
   Brand variables come from /css/brand.css. This file styles the page
   shell, the Now/Next/Later board, the cards, and the empty/denied/
   loading states. Mobile-first defaults, desktop refinements at the
   bottom of the file.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --rm-col-gap: 16px;
  --rm-card-radius: 10px;
  --rm-col-radius: 14px;
  --ae-fg: var(--ae-text, #262626);
  --ae-fg-muted: var(--ae-text-muted, #999999);
  --ae-border: var(--ae-grey-border, #e5e5e5);
  --ae-accent: var(--ae-purple, #5F51D5);
  --ae-accent-hover: #4a3eb0;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  color: var(--ae-fg);
  background: #fafafa;
  font-size: 15px;
  line-height: 1.5;
}

* { box-sizing: border-box; }

/* ─── Header (dash-* shared with Hub + sibling tools) ────────────────── */

.dash-header {
  background: #fff;
  border-bottom: 1px solid var(--ae-border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dash-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dash-logo img {
  height: 22px;
  width: auto;
  flex-shrink: 0;
}

.dash-logo-divider {
  width: 1px;
  height: 22px;
  background: var(--ae-border);
}

.dash-logo-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ae-fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8125rem;
}

.dash-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #f4f5f7;
}

.dash-user img:not([src]),
.dash-user img[src=""] {
  display: none;
}

.dash-user a {
  color: var(--ae-fg-muted);
  text-decoration: none;
}

.dash-user a:hover { color: var(--ae-accent); }
.dash-user span { font-weight: 500; }

@media (max-width: 720px) {
  .dash-header { padding: 12px 16px; gap: 12px; }
  .dash-user { gap: 10px; font-size: 0.75rem; }
}

/* ─── Page shell ─────────────────────────────────────────────────────── */

.rm-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.rm-loading {
  text-align: center;
  padding: 64px 16px;
  color: var(--ae-fg-muted, #6b7280);
  font-size: 0.95rem;
}

.rm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.rm-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.rm-page-title {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  color: var(--ae-fg, #111827);
}

.rm-page-sub {
  font-size: 0.95rem;
  color: var(--ae-fg-muted, #6b7280);
  margin: 0;
  max-width: 56ch;
}

.rm-header-actions {
  flex: 0 0 auto;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */

.rm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  font-family: inherit;
}

.rm-btn-primary {
  background: var(--ae-accent, #5f51d5);
  color: #fff;
}

.rm-btn-primary:hover {
  background: var(--ae-accent-hover, #4a3eb0);
}

.rm-btn-secondary {
  background: #fff;
  color: var(--ae-fg, #111827);
  border-color: var(--ae-border, #e5e7eb);
}

.rm-btn-secondary:hover {
  background: #f9fafb;
}

/* ─── Board ──────────────────────────────────────────────────────────── */

.rm-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--rm-col-gap);
}

@media (min-width: 880px) {
  .rm-board {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rm-col {
  background: #f4f5f7;
  border-radius: var(--rm-col-radius);
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.rm-col-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}

.rm-col-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.005em;
  color: var(--ae-fg, #111827);
}

.rm-col-sub {
  font-size: 0.78rem;
  color: var(--ae-fg-muted, #6b7280);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rm-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

/* ─── Cards ──────────────────────────────────────────────────────────── */

.rm-card {
  background: #fff;
  border-radius: var(--rm-card-radius);
  padding: 14px 16px;
  border: 1px solid var(--ae-border, #e5e7eb);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rm-card.is-channel-priority {
  border-left: 3px solid var(--ae-accent, #5f51d5);
  padding-left: 13px;
}

.rm-card-title {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0;
  color: var(--ae-fg, #111827);
  line-height: 1.35;
}

.rm-card-desc {
  font-size: 0.86rem;
  color: var(--ae-fg-muted, #4b5563);
  margin: 0;
  line-height: 1.45;
}

.rm-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.78rem;
  color: var(--ae-fg-muted, #6b7280);
  margin-top: 4px;
  align-items: center;
}

.rm-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0f4;
  font-weight: 500;
  font-size: 0.76rem;
  color: #374151;
}

.rm-pill.rm-pill-channel {
  background: rgba(95, 81, 213, 0.12);
  color: var(--ae-accent, #5f51d5);
}

.rm-pill.rm-pill-status-shipped {
  background: #def7ec;
  color: #03543f;
}

.rm-pill.rm-pill-status-in_progress {
  background: #fef3c7;
  color: #92400e;
}

.rm-pill.rm-pill-status-committed {
  background: #dbeafe;
  color: #1e40af;
}

.rm-card-link {
  font-size: 0.82rem;
  color: var(--ae-accent, #5f51d5);
  text-decoration: none;
  font-weight: 500;
}

.rm-card-link:hover {
  text-decoration: underline;
}

/* ─── Empty state ────────────────────────────────────────────────────── */

.rm-empty {
  text-align: center;
  padding: 64px 16px 32px;
  color: var(--ae-fg-muted, #6b7280);
}

.rm-empty-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.rm-empty h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ae-fg, #111827);
}

.rm-empty p {
  margin: 0;
  font-size: 0.95rem;
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Footer / version badge ─────────────────────────────────────────── */

.rm-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--ae-border, #e5e7eb);
  display: flex;
  justify-content: flex-end;
}

.rm-version {
  font-size: 0.72rem;
  color: var(--ae-fg-muted, #9ca3af);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ─── Denied state ───────────────────────────────────────────────────── */

#rm-denied {
  text-align: center;
  padding: 64px 16px;
}

#rm-denied h1 {
  font-size: 1.4rem;
  margin: 0 0 8px;
}

#rm-denied a {
  color: var(--ae-accent, #5f51d5);
}

/* ─── Modal (intake form, edit dialogs) ──────────────────────────────── */

.rm-modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rm-modal-root[hidden] { display: none; }

.rm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(2px);
}

.rm-modal {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px -16px rgba(0,0,0,0.25);
  overflow: hidden;
}

.rm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--ae-border, #e5e7eb);
}

.rm-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.rm-modal-close {
  background: none;
  border: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ae-fg-muted, #6b7280);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.rm-modal-close:hover { background: #f3f4f6; }

.rm-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.rm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--ae-border, #e5e7eb);
}

/* ─── Form fields ────────────────────────────────────────────────────── */

.rm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.rm-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ae-fg, #111827);
}

.rm-field-hint {
  font-size: 0.78rem;
  color: var(--ae-fg-muted, #6b7280);
  margin-top: 2px;
}

.rm-input,
.rm-select,
.rm-textarea {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 8px 10px;
  border: 1px solid var(--ae-border, #d1d5db);
  border-radius: 8px;
  background: #fff;
  color: var(--ae-fg, #111827);
  width: 100%;
  box-sizing: border-box;
}

.rm-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}

.rm-input:focus,
.rm-select:focus,
.rm-textarea:focus {
  outline: none;
  border-color: var(--ae-accent, #5f51d5);
  box-shadow: 0 0 0 3px rgba(95, 81, 213, 0.15);
}

.rm-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.rm-checkbox-row label {
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

.rm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .rm-form-row {
    grid-template-columns: 1fr;
  }
}

.rm-form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.86rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.rm-form-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.86rem;
  padding: 12px 14px;
  border-radius: 8px;
  text-align: center;
}

/* ─── Admin page ─────────────────────────────────────────────────────── */

.rm-admin {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.rm-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.rm-admin-tabs {
  display: flex;
  gap: 4px;
  background: #f4f5f7;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
  width: fit-content;
}

.rm-admin-tab {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  background: none;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  color: var(--ae-fg-muted, #6b7280);
  font-family: inherit;
}

.rm-admin-tab.is-active {
  background: #fff;
  color: var(--ae-fg, #111827);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.rm-admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.rm-admin-count {
  font-size: 0.86rem;
  color: var(--ae-fg-muted, #6b7280);
}

.rm-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rm-admin-item {
  background: #fff;
  border: 1px solid var(--ae-border, #e5e7eb);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.rm-admin-item.is-channel-priority {
  border-left: 3px solid var(--ae-accent, #5f51d5);
}

.rm-admin-item-main {
  min-width: 0;
}

.rm-admin-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--ae-fg, #111827);
}

.rm-admin-item-meta {
  font-size: 0.78rem;
  color: var(--ae-fg-muted, #6b7280);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.rm-admin-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.rm-icon-btn {
  background: none;
  border: 1px solid var(--ae-border, #e5e7eb);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.8rem;
  color: var(--ae-fg-muted, #4b5563);
  cursor: pointer;
  font-family: inherit;
}

.rm-icon-btn:hover {
  background: #f9fafb;
  color: var(--ae-fg, #111827);
}

.rm-icon-btn.is-danger:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.rm-admin-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--ae-fg-muted, #6b7280);
  font-size: 0.92rem;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px dashed var(--ae-border, #e5e7eb);
}

/* Intake-specific bits */
.rm-intake-card {
  background: #fff;
  border: 1px solid var(--ae-border, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rm-intake-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.rm-intake-card-meta {
  font-size: 0.78rem;
  color: var(--ae-fg-muted, #6b7280);
  display: flex;
  gap: 12px;
}

.rm-intake-card-desc {
  font-size: 0.88rem;
  color: var(--ae-fg-muted, #4b5563);
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.rm-intake-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
