/* PurposeDNA design tokens — augments Tailwind */
:root {
  --pdna-brand:        #1a4480;
  --pdna-brand-2:      #2c6b9c;
  --pdna-accent:       #0a8754;
  --pdna-accent-warn:  #b35900;
  --pdna-text:         #0f172a;
  --pdna-text-muted:   #475569;
  --pdna-text-faint:   #94a3b8;
  --pdna-bg:           #f8fafc;
  --pdna-surface:      #ffffff;
  --pdna-border:       #e2e8f0;
  --pdna-emerald:      #059669;   /* emerald-600 */
  --pdna-red:          #b91c1c;
  --pdna-amber:        #92400e;
  --pdna-blue:         #1e40af;
}

body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }

/* Module-card hover */
.module-card { transition: transform .12s ease, box-shadow .12s ease; }
.module-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -10px rgba(15,23,42,.18); }

/* ---------- Form primitives — real CSS so they work without Tailwind processing ---------- */
.label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 6px;
}
.input {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--pdna-text);
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus {
  border-color: var(--pdna-brand-2);
  box-shadow: 0 0 0 3px rgba(44, 107, 156, .18);
}
.input:disabled { background: #f1f5f9; color: var(--pdna-text-muted); }

.btn, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn {
  background: var(--pdna-brand);
  color: white;
}
.btn:hover { background: var(--pdna-brand-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary {
  background: white;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-secondary:hover { background: #f1f5f9; color: var(--pdna-text); }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

.btn-sm, .btn-secondary-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }

/* Compact form input (filter bars) */
.input-sm {
  display: inline-block;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--pdna-text);
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
}
.input-sm:focus { border-color: var(--pdna-brand-2); box-shadow: 0 0 0 2px rgba(44,107,156,.15); }

/* ---------- Cards & section chrome — unified across the suite ---------- */
.card {
  background: var(--pdna-surface);
  border: 1px solid var(--pdna-border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.card-hover:hover {
  border-color: var(--pdna-brand-2);
  box-shadow: 0 6px 18px -8px rgba(26, 68, 128, .25);
}
.card-accent::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--pdna-brand) 0%, var(--pdna-brand-2) 50%, var(--pdna-accent) 100%);
}
.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pdna-brand);
  margin-bottom: 6px;
}

/* ---------- Pills / chips — unified across tasks, tickets, statuses ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; font-size: 11px; font-weight: 600;
  border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap;
}
.pill-brand   { background: #e8f1fb; color: var(--pdna-brand);   border-color: #c6dcf2; }
.pill-emerald { background: #ecfdf5; color: #065f46;             border-color: #a7f3d0; }
.pill-amber   { background: #fffbeb; color: var(--pdna-amber);   border-color: #fde68a; }
.pill-red     { background: #fef2f2; color: var(--pdna-red);     border-color: #fecaca; }
.pill-slate   { background: #f1f5f9; color: var(--pdna-text-muted); border-color: var(--pdna-border); }

/* ---------- "Coming next" card — brand-toned, not alarm-amber ---------- */
.next-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #ecfdf5 100%);
  border: 1px solid #c6dcf2;
  border-radius: 12px;
  padding: 22px 26px;
  position: relative;
}
.next-card::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--pdna-brand) 0%, var(--pdna-accent) 100%);
  border-radius: 12px 0 0 12px;
}
.next-card .next-label {
  display: inline-block;
  background: var(--pdna-brand); color: white;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
  margin-bottom: 10px;
}
.next-card h2 { font-size: 18px; font-weight: 700; color: var(--pdna-text); margin: 0 0 6px; }
.next-card p  { font-size: 14px; line-height: 1.55; color: var(--pdna-text-muted); margin: 0; }
.next-card a  { color: var(--pdna-brand); text-decoration: underline; }

/* ---------- Stepper pills (12-step workflow) ---------- */
.step-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  border-radius: 999px; border: 1px solid; white-space: nowrap;
  text-decoration: none;
  transition: opacity .12s, transform .12s;
}
.step-pill:hover { opacity: .85; transform: translateY(-1px); }
.step-pill-current    { background: var(--pdna-brand);  color: white; border-color: var(--pdna-brand); }
.step-pill-complete   { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.step-pill-inprogress { background: #fffbeb; color: var(--pdna-amber); border-color: #fde68a; }
.step-pill-pending    { background: #f8fafc; color: var(--pdna-text-faint); border-color: var(--pdna-border); }

/* ---------- Collapsible left sidebar ---------- */
.pdna-sidebar {
  width: 14rem;
  transition: width .18s ease;
  flex-shrink: 0;
}
.pdna-sidebar-inner { transition: opacity .12s ease; }
.pdna-sidebar.is-collapsed { width: 1.25rem; }
.pdna-sidebar.is-collapsed .pdna-sidebar-inner { opacity: 0; pointer-events: none; }
.pdna-sidebar.is-collapsed #pdnaSidebarToggleIcon { transform: rotate(180deg); }
#pdnaSidebarToggle { transition: transform .12s ease; }
#pdnaSidebarToggle:hover { transform: scale(1.08); }

/* Top-level menu items pop more; sub items recede */
.pdna-menu-top  { letter-spacing: 0; }
.pdna-menu-sub  { letter-spacing: 0; }
.pdna-menu-group-header svg { transition: transform .12s ease; }
.pdna-menu-group-header.rotate-90 svg { transform: rotate(90deg); }
.pdna-menu-children { position: relative; }

/* ---------- Page header bar (top of every step page) ---------- */
.page-header {
  background: linear-gradient(135deg, var(--pdna-brand) 0%, var(--pdna-brand-2) 100%);
  color: white;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(10,135,84,.35) 0%, transparent 70%);
  pointer-events: none;
}
.page-header .eyebrow {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700; opacity: 0.85; margin-bottom: 4px;
}
.page-header h1 { font-size: 24px; font-weight: 700; margin: 0; }
.page-header .subtitle { font-size: 14px; opacity: 0.85; margin-top: 4px; line-height: 1.5; }

/* Help article body — small prose styles for inline HTML */
.prose-pdna h3 { font-size: 15px; font-weight: 600; color: #1a4480; margin: 12px 0 4px; }
.prose-pdna p  { margin: 0 0 8px; line-height: 1.55; }
.prose-pdna ul { margin: 4px 0 10px; padding-left: 20px; }
.prose-pdna li { margin: 3px 0; }
.prose-pdna code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.prose-pdna strong { color: #0f172a; }
.prose-pdna em { color: #475569; font-style: normal; font-weight: 500; }
.prose-pdna a { color: #1a4480; text-decoration: underline; }

/* Flash messages */
.flash       { border-radius: 8px; padding: 10px 14px; font-size: 14px; border-width: 1px; border-style: solid; }
.flash-info  { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.flash-ok    { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-warn  { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.flash-err   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ============================================================
   Floating-panel modal — phone-friendly
   Desktop: centered card, 480px max
   Mobile (≤640px): bottom sheet that slides up
   ============================================================ */
dialog.pdna-modal {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 480px;
  width: calc(100% - 2rem);
  margin: auto;
  color: var(--pdna-text);
}
dialog.pdna-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
dialog.pdna-modal[open] {
  animation: pdnaModalIn .18s ease-out;
}
@keyframes pdnaModalIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.pdna-modal-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 20px 60px -10px rgba(15, 23, 42, .35);
  overflow: hidden;
}
.pdna-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--pdna-border);
}
.pdna-modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--pdna-text);
}
.pdna-modal-close {
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--pdna-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.pdna-modal-close:hover { background: var(--pdna-border); color: var(--pdna-text); }
.pdna-modal-body { padding: 18px; }

/* Mobile: slide up from bottom as a sheet */
@media (max-width: 640px) {
  dialog.pdna-modal {
    max-width: 100%;
    width: 100%;
    margin: 0;
    position: fixed;
    bottom: 0; left: 0; right: 0; top: auto;
  }
  dialog.pdna-modal[open] { animation: pdnaSheetUp .22s ease-out; }
  @keyframes pdnaSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .pdna-modal-card {
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}
