/* DEV-240 P1-P3 app-wide page/detail/form adoption.
   Presentation only: business authority remains in routes and PostgreSQL. */

.form-page{margin-bottom:22px}
.form-page .page-shell-subtitle{max-width:760px}
.field-label-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.field-label-row>label{margin:0}
.required-marker{font-size:8px;line-height:1;text-transform:uppercase;letter-spacing:.65px;color:#8a5d20;background:#f8f0dd;border:1px solid #ead9ae;border-radius:999px;padding:4px 6px;white-space:nowrap}
.form-shell,.editor{overflow:visible}
.form-shell .field,.editor .field{min-width:0}
.form-shell .form-footer,.form-card .form-actions,.editor .form-actions{position:relative}
.form-footer{display:flex;align-items:center;justify-content:space-between;gap:22px;flex-wrap:wrap;padding:20px 28px;background:#fbfcfa;border-top:1px solid var(--line);border-radius:0 0 9px 9px}
.form-footer>.hint{margin:0;max-width:720px}
.form-footer-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-left:auto}

/* Detail/review screens keep their existing domain layouts while sharing one
   header, status and action rhythm. */
.page-shell-header+.card,.page-shell-header+.roadmap-grid,.page-shell-header+.overview-grid,.page-shell-header+.notice{margin-top:0}
.detail-grid dd{font-variant-numeric:tabular-nums}
.detail-grid dd strong{color:var(--ink)}
.detail-grid .money,.money{font-variant-numeric:tabular-nums;white-space:nowrap}
.status-badge+small,.status-badge+.reference{margin-left:6px}
.review-shell{max-width:1180px}
.review-shell>.card{overflow:visible}
.review-context{display:flex;gap:8px 16px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:10px;margin:8px 0 0}
.review-context strong{color:var(--ink)}

/* Compatibility shell for large domain workspaces and low-risk forms that still
   own specialized markup. It gives legacy top-level page-heading screens the
   same rhythm as page_header without rewriting their business-heavy bodies. */
.content>.page-heading{align-items:flex-end;gap:28px;margin-bottom:26px;padding:2px 0}
.content>.page-heading>div:first-child{min-width:0;max-width:940px}
.content>.page-heading h1{min-width:0}
.content>.page-heading .muted{max-width:820px;margin-top:9px;font-size:12px;line-height:1.7}
.content>.page-heading>.page-actions,.content>.page-heading>div:last-child{justify-content:flex-end}
.content>.page-heading .entry-title-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.content>.page-heading .entry-title-row .badge{border-radius:999px;padding:6px 9px;text-transform:uppercase;letter-spacing:.45px}

/* Existing complex workspace heroes (beneficiary, distribution, project) keep
   their domain navigation while inheriting the same action/button cadence. */
.beneficiary-360-heading,.distribution-hero,.project-hero{gap:28px}
.beneficiary-360-heading .page-actions,.project-hero-actions{gap:10px;flex-wrap:wrap}

/* Legacy section headings remain supported inside complex documents, but use
   the same spacing and action alignment as the shared section macro. */
.card>.page-heading{padding:20px 22px;margin:0;border-bottom:1px solid var(--line);align-items:flex-start}
.card>.page-heading h2{font-size:21px}
.card>.page-heading .eyebrow{margin-bottom:7px}
.card>.page-heading .muted{margin:5px 0 0;max-width:720px;font-size:11px}
.card>.page-heading+.table-wrap{margin-top:0}

/* Consistent destructive affordance without making it visually primary. */
.secondary.danger,.text-button.danger{color:#9b4032}
.secondary.danger{border-color:#e3c3bd;background:#fffafa}
.secondary.danger:hover{border-color:#c68f85;background:#fbefec}

@media(max-width:760px){
  .form-footer{align-items:stretch;padding:18px}
  .form-footer-actions{width:100%;justify-content:flex-start;margin-left:0}
  .form-footer-actions>*{flex:1 1 auto}
  .field-label-row{align-items:flex-start}
  .content>.page-heading{display:block}
  .content>.page-heading>.page-actions,.content>.page-heading>div:last-child{margin-top:18px;justify-content:flex-start}
}


/* DEV-241 register system */
.register-shell{display:grid;gap:16px}
.register-filter-panel{padding:18px 20px}
.register-filter-bar{display:grid;grid-template-columns:minmax(240px,2fr) repeat(auto-fit,minmax(145px,1fr));gap:12px;align-items:end}
.register-filter-bar label{margin:0}
.register-filter-bar input,.register-filter-bar select{width:100%}
.register-filter-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.active-filter-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.active-filter-label{font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.6px;color:var(--muted)}
.filter-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border:1px solid #d9e0db;border-radius:999px;background:#f7f9f7;color:var(--ink);font-size:10px;text-decoration:none}
.filter-chip:hover{background:#eef3ef;border-color:#c5d1c8}
.table-meta{display:flex;align-items:baseline;gap:7px}
.register-range{font-size:12px;font-weight:800;font-variant-numeric:tabular-nums}
.register-pagination{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 0 0;border-top:1px solid var(--line);margin-top:14px;color:var(--muted);font-size:10px}
.register-sort{min-width:160px}
.register-table th a{color:inherit;text-decoration:none}
.register-table th a:hover{text-decoration:underline}
.register-empty{padding:34px 20px}
@media(max-width:760px){
  .register-filter-bar{grid-template-columns:1fr}
  .register-filter-actions{grid-column:1}
  .register-pagination{align-items:flex-start}
}


/* DEV-242 guided workflow UX */
.workflow-path{margin:0 0 16px;padding:14px 16px;border:1px solid var(--line);border-radius:10px;background:#fbfcfa}
.workflow-path-heading{margin-bottom:10px;font-size:9px;font-weight:800;letter-spacing:.65px;text-transform:uppercase;color:var(--muted)}
.workflow-path ol{display:flex;gap:0;list-style:none;margin:0;padding:0}
.workflow-path li{position:relative;display:flex;align-items:center;gap:8px;flex:1 1 0;min-width:105px;padding:8px 10px;color:var(--muted);font-size:9px;border-top:2px solid #d8ded9}
.workflow-path li strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}
.workflow-path li.is-done{color:#476253;border-color:#8eb39b}
.workflow-path li.is-current{color:var(--ink);border-color:#486c55;background:#f0f5f1}
.workflow-path-index{display:inline-grid;place-items:center;flex:0 0 20px;height:20px;border:1px solid currentColor;border-radius:50%;font-size:8px;font-weight:800}
.workflow-guidance{display:flex;align-items:center;justify-content:space-between;gap:28px;padding:20px 22px;border-left:4px solid #6d8e78}
.workflow-guidance.is-blocked,.workflow-guidance.is-attention{border-left-color:#b98239;background:#fffaf2}
.workflow-guidance.is-complete{border-left-color:#5f8c70;background:#f7fbf8}
.workflow-guidance.is-stopped{border-left-color:#a55c50;background:#fff8f7}
.workflow-guidance-copy{min-width:0}
.workflow-guidance-copy .eyebrow{margin-bottom:6px}
.workflow-guidance-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.workflow-guidance-title h2{margin:0;font-size:20px}
.workflow-guidance-copy .muted{margin:6px 0 0;max-width:780px}
.workflow-guidance-state{display:inline-flex;align-items:center;padding:4px 7px;border:1px solid #d5ddd7;border-radius:999px;background:#fff;font-size:8px;font-weight:800;letter-spacing:.45px;text-transform:uppercase}
.workflow-guidance-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;flex:0 0 auto}
.workflow-guidance-actions:empty{display:none}
@media(max-width:900px){
  .workflow-path{overflow-x:auto}
  .workflow-path ol{min-width:760px}
  .workflow-guidance{align-items:flex-start;flex-direction:column}
  .workflow-guidance-actions{justify-content:flex-start}
}


/* DEV-243 Project 360 Workspace */
.project-360-workspace{display:grid;gap:16px;margin:0 0 22px}
.project-360-commandbar{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:18px 20px;border:1px solid var(--line);border-radius:10px;background:#fbfcfa}
.project-360-commandbar h2{margin:0;font-size:24px}
.project-360-commandbar .muted{margin:6px 0 0;max-width:720px}
.project-360-panel{overflow:hidden}
.project-360-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0}
.project-360-metrics-compact{grid-template-columns:repeat(3,minmax(0,1fr))}
.project-360-metric{display:flex;flex-direction:column;gap:5px;min-width:0;padding:20px 22px;border-right:1px solid var(--line)}
.project-360-metric:last-child{border-right:0}
.project-360-metric span,.project-360-control-strip span,.project-360-stage-grid span,.project-360-activity-row span{font-size:9px;font-weight:800;letter-spacing:.55px;text-transform:uppercase;color:var(--muted)}
.project-360-metric strong{font-size:24px;font-variant-numeric:tabular-nums;line-height:1.15}
.project-360-metric small{color:var(--muted);font-size:9px;line-height:1.45}
.project-360-metric-emphasis{background:#f7faf7}
.project-360-control-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--line);background:#fbfcfa}
.project-360-control-strip>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-right:1px solid var(--line)}
.project-360-control-strip>div:last-child{border-right:0}
.project-360-control-strip strong{font-variant-numeric:tabular-nums}
.project-360-stage-grid{display:grid;grid-template-columns:repeat(7,minmax(105px,1fr));gap:10px;padding:18px 20px}
.project-360-stage-grid>a,.project-360-stage-grid>div{display:flex;flex-direction:column;gap:8px;min-width:0;padding:14px;border:1px solid var(--line);border-radius:9px;background:#fff;text-decoration:none;color:var(--ink)}
.project-360-stage-grid>a:hover{border-color:#aebeb2;background:#f8faf8}
.project-360-stage-grid strong{font-size:22px;font-variant-numeric:tabular-nums}
.project-360-two-column{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}
.project-360-panel .compact-notice{margin:0 20px 18px}
.project-360-activity-list{display:grid}
.project-360-activity-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 20px;border-top:1px solid var(--line)}
.project-360-activity-row:first-child{border-top:0}
.project-360-activity-row>div{display:flex;align-items:center;gap:10px;min-width:0}
.project-360-activity-row>div:first-child{flex-direction:column;align-items:flex-start;gap:4px}
.project-360-activity-row strong{min-width:0}
.project-360-activity-row strong a{overflow-wrap:anywhere}
.project-360-activity-row>div:last-child{justify-content:flex-end;flex:0 0 auto}
@media(max-width:1100px){
  .project-360-stage-grid{grid-template-columns:repeat(4,minmax(120px,1fr))}
  .project-360-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .project-360-metrics-compact{grid-template-columns:repeat(3,minmax(0,1fr))}
  .project-360-metric:nth-child(2n){border-right:0}
  .project-360-two-column{grid-template-columns:1fr}
}
@media(max-width:760px){
  .project-360-commandbar{align-items:flex-start;flex-direction:column}
  .project-360-commandbar .page-actions{justify-content:flex-start}
  .project-360-stage-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px}
  .project-360-metrics,.project-360-metrics-compact{grid-template-columns:1fr}
  .project-360-metric{border-right:0;border-bottom:1px solid var(--line);padding:16px 18px}
  .project-360-metric:last-child{border-bottom:0}
  .project-360-control-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .project-360-control-strip>div:nth-child(2n){border-right:0}
  .project-360-control-strip>div:nth-child(n+3){border-top:1px solid var(--line)}
  .project-360-activity-row{align-items:flex-start;flex-direction:column}
  .project-360-activity-row>div:last-child{justify-content:flex-start}
}
