/* Portal-owned overview cards within the existing StudioShell workspace. */
.mf-portal-dashboard{display:grid;gap:24px}
.mf-dashboard-intro{display:grid;gap:5px}
.mf-dashboard-intro p{margin:0}
.mf-dashboard-eyebrow{text-transform:uppercase;letter-spacing:1.2px;font-weight:750;font-size:11px;color:var(--coop-institution-accent,#147d6c)}
.mf-dashboard-source,.mf-dashboard-caption{font-size:12px;color:var(--muted,#637d84)}
.mf-dashboard-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));gap:14px}
.mf-dashboard-metric{display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-height:150px;border:1px solid #e2ecee;background:var(--surface,#fff);border-radius:14px;padding:21px}
.mf-dashboard-metric .metric-label{font-size:12px;line-height:1.5;color:var(--muted,#5c747b)}
.mf-dashboard-metric .metric-value{font-size:31px;font-weight:800;line-height:1.1}
.mf-dashboard-link{margin-top:auto;color:var(--coop-institution-accent,#147d6c);text-decoration:none;font-size:12px;font-weight:700}
.mf-dashboard-link:hover{text-decoration:underline}
.mf-dashboard-sections{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr));gap:18px;align-items:start}
.mf-dashboard-panel h3{font-size:16px;margin:0 0 15px}
.mf-dashboard-activity{display:grid}
.mf-dashboard-activity-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:13px 0;border-bottom:1px solid #e8eff1}
.mf-dashboard-activity-row:last-child{border-bottom:0}
.mf-dashboard-activity-row>div{display:grid;gap:5px;min-width:0}
.mf-dashboard-activity-row strong{font-size:13px;overflow-wrap:anywhere}
.mf-dashboard-activity-row time{white-space:nowrap}
.mf-dashboard-shortcuts{display:grid;gap:9px}
.mf-dashboard-shortcut{display:flex;justify-content:space-between;align-items:center;padding:12px 13px!important;border:1px solid #e3ebed;border-radius:9px;background:var(--surface,#fff);font-size:13px;font-weight:700;color:inherit;text-decoration:none}
.mf-dashboard-shortcut:hover{border-color:var(--coop-institution-accent,#147d6c)}
.mf-dashboard-chevron{font-size:22px;color:var(--coop-institution-accent,#147d6c)}
.coop-dark .mf-dashboard-metric,.coop-dark .mf-dashboard-shortcut{background:#1c303a;border-color:#34515b;color:#e3eeef}
.coop-dark .mf-dashboard-activity-row{border-color:#34515b}
.coop-dark .mf-dashboard-caption,.coop-dark .mf-dashboard-source{color:#b3cdd1}
@media(max-width:680px){.mf-dashboard-metrics{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}.mf-dashboard-sections{grid-template-columns:1fr}.mf-dashboard-metric{min-height:132px}}
/* Cooperative Admin: clear separation between operational and financial summaries. */
.mf-dashboard-block{display:grid;gap:12px}
.mf-dashboard-section-title{font-size:16px;font-weight:750;margin:0}
.mf-coop-admin-overview .mf-dashboard-metric{min-height:152px}
.mf-coop-admin-overview .mf-dashboard-metric .metric-value{font-size:clamp(23px,2.3vw,31px);overflow-wrap:anywhere}
.mf-dashboard-worklist{display:grid;gap:0}
.mf-dashboard-work-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid #e8eff1}
.mf-dashboard-work-row:last-child{border-bottom:0}
.mf-dashboard-work-label{color:inherit;text-decoration:none;font-size:13px}
a.mf-dashboard-work-label:hover{text-decoration:underline}
.mf-dashboard-work-count{border-radius:999px;min-width:35px;padding:4px 9px;text-align:center;background:var(--surface-secondary,#edf4f5);font-size:13px}
.coop-dark .mf-dashboard-work-row{border-color:#34515b}
.coop-dark .mf-dashboard-work-count{background:#29414b}

/* Cooperative Admin: grouped recent member transactions from the local cache. */
.mf-dashboard-transaction-groups{display:grid;gap:16px}
.mf-dashboard-transaction-group{min-width:0}
.mf-dashboard-transaction-header{display:flex;justify-content:space-between;align-items:center;gap:10px;background:var(--surface-secondary,#edf4f5);border-radius:8px;padding:9px 11px;font-size:12px}
.mf-dashboard-transaction-header strong{overflow-wrap:anywhere}
.coop-dark .mf-dashboard-transaction-header{background:#29414b}

/* Cooperative Admin approval queue. All content is read-only local SiteData. */
.mf-pending-panel{min-width:0;display:grid;gap:14px}
.mf-pending-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.mf-pending-toolbar h3{margin:0}
.mf-pending-controls{display:flex;gap:9px;flex-wrap:wrap}
.mf-pending-control{min-height:38px;padding:7px 10px;border:1px solid #cedfe0;border-radius:8px;background:var(--surface,#fff);color:inherit;font:inherit;font-size:13px;max-width:100%}
.mf-pending-controls input{min-width:220px}
.mf-pending-table-scroll{overflow-x:auto;max-width:100%}
.mf-pending-table{width:100%;border-collapse:collapse;font-size:13px}
.mf-pending-table th{text-align:left;white-space:nowrap;font-size:11px;color:var(--muted,#637d84);padding:12px 10px;border-bottom:1px solid #dce7e9}
.mf-pending-table td{padding:12px 10px;vertical-align:middle;border-bottom:1px solid #e8eff1}
.mf-pending-table td:nth-child(3),.mf-pending-table td:nth-child(2){min-width:150px}
.mf-pending-table td strong{display:block;font-size:12px}
.mf-pending-table td .mf-dashboard-caption{display:block;margin-top:4px}
.mf-pending-state{display:inline-block;font-size:11px;border-radius:999px;padding:4px 9px;background:#fff4d9;color:#785711;white-space:nowrap}
.mf-pending-empty{text-align:center;color:var(--muted,#637d84);padding:24px!important}
.mf-pending-more{background:var(--surface-secondary,#edf4f5);color:inherit;border:1px solid #cedfe0;border-radius:8px;padding:9px 15px;cursor:pointer}
.mf-pending-footer{display:flex;justify-content:center}
.coop-dark .mf-pending-control{background:#1c303a;border-color:#34515b}
.coop-dark .mf-pending-table th,.coop-dark .mf-pending-table td{border-color:#34515b}
.coop-dark .mf-pending-state{background:#493b24;color:#f8dc9d}
@media(max-width:680px){.mf-pending-controls,.mf-pending-controls input,.mf-pending-controls select{width:100%}}
/* Cooperative request workspace: left list, right RecordType-specific content. */
.mf-request-split{display:grid;grid-template-columns:minmax(245px,330px) minmax(0,1fr);gap:16px;align-items:start;min-width:0}
.mf-request-queue,.mf-request-content{border:1px solid #e1e9eb;background:var(--surface,#fff);border-radius:13px;min-width:0;overflow:hidden}
.mf-request-queue{position:sticky;top:12px;max-height:calc(100vh - 70px);display:flex;flex-direction:column}
.mf-request-queue-header{padding:17px;border-bottom:1px solid #e1e9eb}
.mf-request-queue-filters{padding:12px;display:grid;gap:8px}
.mf-request-queue-filters .mf-pending-control{width:100%;min-width:0}
.mf-request-list{overflow:auto;max-height:70vh}
.mf-request-list-item{width:100%;text-align:left;border:0;border-top:1px solid #e8eff1;border-left:4px solid transparent;padding:15px 13px;background:transparent;color:inherit;cursor:pointer;display:grid;gap:5px;font:inherit}
.mf-request-list-item:hover{background:var(--surface-secondary,#edf4f5)}
.mf-request-list-item.is-active{border-left-color:var(--coop-institution-accent,#147d6c);background:var(--surface-secondary,#edf4f5)}
.mf-request-list-top{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px}
.mf-request-stage{font-size:10px;font-weight:650;background:#e8f4f1;padding:3px 7px;border-radius:20px;color:#176b62;white-space:nowrap}
.mf-request-list-name{font-size:13px;font-weight:700}
.mf-request-list-meta,.mf-request-empty{font-size:11px;color:var(--muted,#637d84);line-height:1.5}
.mf-request-empty{padding:20px}
.mf-request-content{padding:20px;display:grid;gap:16px}
.mf-request-detail-header{display:flex;align-items:start;justify-content:space-between;gap:12px}
.mf-request-detail-header h2{font-size:21px;margin:5px 0 0;overflow-wrap:anywhere}
.mf-request-progress{display:flex;gap:9px;flex-wrap:wrap}
.mf-request-progress span{font-size:11px;padding:7px 12px;border-radius:999px;background:var(--surface-secondary,#edf4f5)}
.mf-request-progress .is-current{background:#d9f2e6;color:#096142;font-weight:700}
.mf-request-detail-body,.mf-request-actions{display:grid;gap:15px}
.mf-request-detail-section{border:1px solid #e5eded;border-radius:10px;padding:15px;min-width:0}
.mf-request-detail-section h3{font-size:14px;margin:0 0 14px}
.mf-request-detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px 18px;margin:0}
.mf-request-field{min-width:0}.mf-request-field dt{font-size:11px;color:var(--muted,#637d84);margin-bottom:4px}
.mf-request-field dd{font-size:13px;font-weight:650;margin:0;overflow-wrap:anywhere}
.mf-request-table-scroll{overflow-x:auto}.mf-request-document{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #e8eff1}
.mf-request-action{border:1px solid #dfebea;border-radius:10px;padding:15px;display:grid;gap:9px}
.mf-request-action h4{font-size:13px;margin:0}
.mf-request-action-form{display:grid;gap:12px;min-width:0}
.mf-request-label{display:grid;gap:5px;font-size:12px;font-weight:650}
.mf-request-label textarea,.mf-request-label input{width:100%;max-width:100%;font-size:13px}
.mf-request-submit,.mf-request-detail-toggle{border:0;border-radius:8px;background:var(--coop-institution-accent,#147d6c);color:white;padding:10px 14px;font-size:13px;font-weight:700;cursor:pointer;justify-self:start}
.mf-request-detail-toggle{background:var(--surface-secondary,#edf4f5);color:inherit;border:1px solid #d5e4e5}
.mf-request-submit:disabled{opacity:.55;cursor:not-allowed}
.mf-request-warning,.mf-request-error{font-size:12px;color:#922525;background:#fff0ed;border:1px solid #f6cfc8;border-radius:8px;padding:9px}
.mf-request-action-status{font-size:12px;margin:0}
.coop-dark .mf-request-queue,.coop-dark .mf-request-content,.coop-dark .mf-request-detail-section,.coop-dark .mf-request-action{background:#1c303a;border-color:#34515b}
.coop-dark .mf-request-list-item{border-color:#34515b}.coop-dark .mf-request-list-item.is-active,.coop-dark .mf-request-list-item:hover,.coop-dark .mf-request-progress span{background:#29414b}
@media(max-width:860px){.mf-request-split{grid-template-columns: minmax(200px,260px) minmax(0,1fr)}.mf-request-detail-grid{grid-template-columns:1fr}}
@media(max-width:640px){.mf-request-split{grid-template-columns:1fr}.mf-request-queue{position:static;max-height:360px}.mf-request-list{max-height:230px}.mf-request-content{padding:14px}}

.mf-request-document-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.mf-request-document-preview{border:1px solid #d4e4e6;border-radius:7px;background:transparent;color:inherit;cursor:pointer;padding:6px 10px;font:inherit;font-size:11px}
.mf-request-document-view{border:1px solid #d4e4e6;border-radius:9px;padding:8px;background:var(--surface-secondary,#edf4f5)}
.mf-request-document-view img,.mf-request-document-view iframe{max-width:100%;width:100%;height:340px;object-fit:contain;border:0}

/* Cooperative Members: searchable, group-filtered collection. Shell navigation stays backend-owned. */
.mf-member-collection{display:grid;gap:17px;min-width:0}
.mf-member-collection-heading{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:12px}
.mf-member-collection-heading h2{font-size:22px;margin:0 0 6px;color:var(--coo-ink,inherit)}
.mf-member-muted{color:var(--muted,#607d83);font-size:12px;margin:0;line-height:1.55}
.mf-member-add{display:inline-block;background:var(--coop-institution-accent,#147d6c);color:#fff;padding:10px 14px;border-radius:8px;font-size:13px;font-weight:700;text-decoration:none}
.mf-member-controls{display:flex;flex-wrap:wrap;gap:12px;padding:14px;background:var(--surface,#fff);border:1px solid #e1e9eb;border-radius:12px}
.mf-member-control{display:grid;gap:6px;min-width:195px;font-size:12px;font-weight:650;color:inherit}
.mf-member-control select,.mf-member-control input{min-height:40px;width:100%;font:inherit;font-size:13px;padding:9px 12px;border-radius:8px;background:var(--surface,#fff);border:1px solid #ccdfe1;color:inherit}
.mf-member-search{flex:1;min-width:230px}
.mf-member-result-count{font-size:12px;color:var(--muted,#607d83);margin:0}
.mf-member-table-scroll{min-width:0;overflow-x:auto;background:var(--surface,#fff);border:1px solid #e1e9eb;border-radius:12px}
.mf-member-table{border-collapse:collapse;width:100%;font-size:13px}
.mf-member-table th{background:var(--surface-secondary,#edf4f5);text-align:left;padding:13px 14px;font-size:11px;letter-spacing:.02em;color:var(--muted,#607d83);white-space:nowrap}
.mf-member-table td{padding:13px 14px;border-top:1px solid #e7eff0;vertical-align:middle}
.mf-member-table .is-openable{cursor:pointer}
.mf-member-table .is-openable:hover,.mf-member-table .is-openable:focus-visible{background:var(--surface-secondary,#edf4f5)}
.mf-member-link{color:var(--coop-institution-accent,#116d75);text-decoration:none;font-weight:700}
.mf-member-link:hover{text-decoration:underline}
.mf-member-empty{padding:30px!important;text-align:center;color:var(--muted,#607d83)}
.mf-member-pagination{display:flex;justify-content:flex-end;align-items:center;gap:10px;font-size:12px}
.mf-member-pagination button{border:1px solid #d3e0e0;border-radius:8px;padding:8px 12px;background:var(--surface,#fff);color:inherit;cursor:pointer}
.mf-member-pagination button:disabled{opacity:.45;cursor:not-allowed}
.coop-dark .mf-member-controls,.coop-dark .mf-member-table-scroll,.coop-dark .mf-member-control input,.coop-dark .mf-member-control select,.coop-dark .mf-member-pagination button{background:#1c303a;border-color:#34515b}
.coop-dark .mf-member-table th,.coop-dark .mf-member-table .is-openable:hover,.coop-dark .mf-member-table .is-openable:focus-visible{background:#29414b}
.coop-dark .mf-member-table td{border-color:#34515b}
@media(max-width:650px){.mf-member-control,.mf-member-search{width:100%;min-width:0}.mf-member-table th,.mf-member-table td{padding:10px}}

/* Cooperative Member Workspace: record-specific internal navigation, not a Portal sidebar. */
.mf-member-workspace{display:grid;gap:15px;min-width:0}
.mf-member-profile-header{display:flex;align-items:center;gap:17px;padding:22px;background:var(--surface,#fff);border:1px solid #e1e9eb;border-radius:13px;flex-wrap:wrap}
.mf-member-avatar{display:grid;place-items:center;width:62px;height:62px;flex:0 0 auto;border-radius:17px;background:#e1f1ee;color:#126f69;font-size:24px;font-weight:800}
.mf-member-identity{flex:1;min-width:160px}
.mf-member-identity h2{margin:5px 0 7px;font-size:22px;color:var(--coo-ink,inherit)}
.mf-member-profile-status{font-size:11px;font-weight:750;background:#dbf4e9;color:#08694c;padding:6px 12px;border-radius:999px}
.mf-member-workspace-actions{display:flex;gap:10px;flex-wrap:wrap}
.mf-member-workspace-link{display:inline-block;text-decoration:none;color:var(--coop-institution-accent,#116d75);font-size:12px;font-weight:700;border:1px solid #cbdfe0;border-radius:8px;padding:9px 12px;background:var(--surface,#fff)}
.mf-member-workspace-link:hover{border-color:var(--coop-institution-accent,#116d75)}
.mf-member-workspace-body .mf-page-workspace--left{display:grid;grid-template-columns:minmax(180px,215px) minmax(0,1fr);gap:16px;align-items:start}
.mf-member-workspace-body .mf-page-workspace-navigation{background:var(--surface,#fff);border:1px solid #e1e9eb;border-radius:12px;padding:9px;min-width:0}
.mf-member-workspace-body .mf-page-workspace-content{min-width:0}
.mf-member-workspace-body .mf-page-workspace-panel{display:grid;gap:14px;min-width:0}
.mf-member-profile-card{background:var(--surface,#fff);border:1px solid #e1e9eb;border-radius:12px;padding:19px;min-width:0}
.mf-member-profile-card h3{font-size:15px;margin:0 0 15px;color:var(--coo-ink,inherit)}
.mf-member-profile-grid{margin:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:18px 15px}
.mf-member-profile-grid div{min-width:0}
.mf-member-profile-grid dt{font-size:11px;color:var(--muted,#607d83);margin-bottom:6px}
.mf-member-profile-grid dd{font-size:13px;font-weight:650;margin:0;overflow-wrap:anywhere}
.mf-member-profile-card .mf-member-table-scroll{margin-top:13px}
.coop-dark .mf-member-profile-header,.coop-dark .mf-member-profile-card,.coop-dark .mf-member-workspace-body .mf-page-workspace-navigation,.coop-dark .mf-member-workspace-link{background:#1c303a;border-color:#34515b;color:#e3eeef}
.coop-dark .mf-member-avatar{background:#294e4b;color:#d4f5ec}
@media(max-width:750px){.mf-member-workspace-body .mf-page-workspace--left{grid-template-columns:1fr}.mf-member-profile-header{padding:15px}.mf-member-avatar{width:50px;height:50px}}

/* Member workspace parity: these styles are shared by the live page and its generated preview. */
.mf-member-tab-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:2px}
.mf-member-tab-heading h3{font-size:20px;line-height:1.25;letter-spacing:-.35px;margin:0;color:var(--coo-ink,inherit)}
.mf-member-tab-heading .mf-member-muted{flex-basis:100%}
.mf-member-transaction-filter{border:1px solid #d8e7e7;border-radius:8px;padding:9px 12px;background:var(--surface,#fff);color:inherit;font-size:12px}
.mf-member-workspace-body .mf-page-navigation ul{gap:3px}
.mf-member-workspace-body .mf-page-nav-item{border:0;border-left:3px solid transparent;border-radius:8px;color:var(--muted,#567078);background:transparent;padding:12px 14px;font-size:13px;font-weight:650}
.mf-member-workspace-body .mf-page-nav-item:hover{background:var(--surface-secondary,#f2f7f7)}
.mf-member-workspace-body .mf-page-nav-item[aria-current="page"]{border-color:var(--coop-institution-accent,#147d71);background:#e8f4f0;color:#0e6f63;font-weight:800}
.coop-dark .mf-member-workspace-body .mf-page-nav-item[aria-current="page"]{background:#284a46;color:#d5f5e8}
@media(max-width:750px){.mf-member-workspace-body .mf-page-navigation ul{display:flex;flex-wrap:nowrap;overflow-x:auto}}

/* Member Profile inner pages: cards and metadata-scoped embedded editor. */
.mf-member-profile-subnav{display:flex;gap:8px;overflow-x:auto;white-space:nowrap;border-bottom:1px solid var(--coo-border,#d9e4e5);padding:1px 1px 12px;scrollbar-width:thin}
.mf-member-profile-subtab{padding:10px 12px;border:1px solid #dfe9e9;border-radius:8px;color:var(--coo-muted,#567078);background:var(--surface,#fff);font-size:12px;font-weight:700;cursor:pointer}
.mf-member-profile-subtab:hover{border-color:var(--coo-primary,#116d75)}
.mf-member-profile-subtab.active{background:#e2f4ee;color:#0c6a58;border-color:#b5ded0}
.mf-member-profile-inner{display:grid;gap:15px;min-width:0}
.mf-member-profile-inner-header{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.mf-member-profile-inner-header h3{font-size:16px;margin:0 0 5px}
.mf-member-embedded-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:13px;align-items:start}
.mf-member-embedded-card{padding:17px;border-radius:12px;border:1px solid #dce7e7;background:var(--surface,#fff);min-width:0;display:grid;gap:13px}
.mf-member-embedded-card-title{display:flex;justify-content:space-between;align-items:center;gap:10px}
.mf-member-embedded-card-title h4{font-size:15px;line-height:1.35;margin:0;overflow-wrap:anywhere}
.mf-member-embedded-default{font-size:10px;border-radius:100px;background:#def5e8;color:#086b4d;padding:5px 9px;font-weight:750}
.mf-member-embedded-fields{margin:0;display:grid;gap:8px}
.mf-member-embedded-fields div{display:grid;grid-template-columns:minmax(90px,42%) minmax(0,1fr);gap:8px}
.mf-member-embedded-fields dt{font-size:11px;color:var(--muted,#607d83)}
.mf-member-embedded-fields dd{font-size:12px;margin:0;font-weight:650;overflow-wrap:anywhere}
.mf-member-embedded-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}
.mf-member-embed-action{display:inline-flex;align-items:center;justify-content:center;background:var(--surface,#fff);color:var(--coo-primary,#116d75);border:1px solid #cbdfe0;border-radius:8px;padding:9px 13px;font-size:12px;font-weight:700;text-decoration:none;cursor:pointer;font-family:inherit}
.mf-member-embed-primary{background:var(--coo-primary,#116d75);color:#fff;border-color:var(--coo-primary,#116d75)}
.mf-member-embed-danger{border-color:#dfaaa8;color:#a12828;background:#fff6f5}
.mf-member-embedded-editor{padding:20px}
.mf-member-embedded-editor h4{margin:0 0 10px;font-size:16px}
.mf-member-embedded-form{display:grid;gap:13px;margin-top:17px}
.mf-member-embedded-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.mf-member-embedded-input{display:grid;gap:7px;min-width:0;color:var(--coo-ink,#183b46);font-size:12px;font-weight:700}
.mf-member-embedded-input input,.mf-member-embedded-input select,.mf-member-embedded-input textarea{width:100%;min-width:0;background:var(--surface,#fff);border:1px solid #cbdadc;border-radius:8px;padding:10px 11px;color:inherit;box-sizing:border-box;font:inherit;font-size:13px}
.mf-member-embedded-input input[type="checkbox"]{width:18px;height:18px}
.mf-member-embed-feedback{font-size:12px;line-height:1.5;margin:5px 0 0}
.mf-member-embed-error{color:#a12828}
.mf-member-embed-warning{color:#9c6611}
.mf-member-embed-success{color:#137355}
.mf-member-embedded-removal{background:var(--surface-secondary,#f5f8f8);border-radius:9px;padding:12px 16px;font-size:12px;display:grid;gap:5px}
.mf-member-embedded-removal p{margin:0}
.mf-member-profile-empty{text-align:center;min-height:150px;display:grid;justify-content:center;align-content:center;gap:8px}
.mf-member-profile-empty h4{margin:0}
.mf-member-embed-hint{font-size:11px;line-height:1.5;margin-top:3px}
.coop-dark .mf-member-profile-subtab,.coop-dark .mf-member-embedded-card,.coop-dark .mf-member-embed-action,.coop-dark .mf-member-embedded-input input,.coop-dark .mf-member-embedded-input select,.coop-dark .mf-member-embedded-input textarea{background:#1c303a;color:#e3eeef;border-color:#34515b}
.coop-dark .mf-member-profile-subtab.active{background:#294f48;color:#d5f8e9}
.coop-dark .mf-member-embed-primary{background:#186c63;color:#fff}
.coop-dark .mf-member-embed-danger{background:#542c30;color:#ffe1e1}
@media(max-width:740px){.mf-member-embedded-form-grid{grid-template-columns:1fr}.mf-member-profile-subnav{gap:5px}.mf-member-profile-subtab{padding:9px 11px}}

/* Extra member accounts: rendered from the same member_account RecordType and GL snapshots. */
.mf-member-extra-accounts-section{display:grid;gap:11px;min-width:0}
.mf-member-extra-accounts-section>h3{margin:3px 0 0;font-size:15px;color:var(--coo-ink,inherit)}
.mf-member-extra-account-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:12px;min-width:0}
.mf-member-extra-account-card{display:grid;gap:12px}
.mf-member-extra-account-card h4{font-size:15px;margin:0;overflow-wrap:anywhere}
.mf-member-extra-account-card .mf-member-profile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

/* Member Portal home: uses only the authenticated member's synchronized records. */
.mf-member-portal-dashboard{display:grid;gap:22px;min-width:0}
.mf-member-portal-hero{display:grid;gap:7px}
.mf-member-portal-hero h2{font-size:clamp(21px,2.1vw,29px);line-height:1.2;margin:0;color:inherit}
.mf-member-portal-hero p{margin:0}
.mf-member-portal-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:13px}
.mf-member-portal-card{border:1px solid #e0ebed;background:var(--surface,#fff);border-radius:12px;padding:19px 16px;display:grid;align-content:start;gap:11px;min-height:140px;min-width:0}
.mf-member-portal-card .metric-label{font-size:12px;color:var(--muted,#637d84)}
.mf-member-portal-card .metric-value{font-size:clamp(20px,2.2vw,26px);line-height:1.15;overflow-wrap:anywhere}
.mf-member-portal-card .mf-dashboard-caption{line-height:1.4}
.mf-member-portal-columns{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(245px,1fr);gap:15px;align-items:start}
.mf-member-portal-columns>.panel,.mf-member-portal-actions{min-width:0;padding:21px;border:1px solid #e0ebed;border-radius:12px;background:var(--surface,#fff)}
.mf-member-portal-transaction{display:flex;gap:12px;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid #e6edef;font-size:13px}
.mf-member-portal-transaction:last-child{border-bottom:0}
.mf-member-portal-transaction>div{display:grid;gap:4px;min-width:0}
.mf-member-portal-transaction strong{font-size:13px}
.mf-member-portal-amount{font-weight:750;white-space:nowrap}
.mf-member-portal-actions{display:grid;gap:11px}
.mf-member-portal-actions h3{margin:0;font-size:16px}
.mf-member-portal-action-row{display:flex;gap:9px;flex-wrap:wrap}
.mf-member-portal-form-host:empty{display:none}
.mf-member-portal-form-host .mf-savings-form-card{margin-top:9px}
.coop-dark .mf-member-portal-card,.coop-dark .mf-member-portal-columns>.panel,.coop-dark .mf-member-portal-actions{background:#1c303a;border-color:#34515b}
.coop-dark .mf-member-portal-transaction{border-color:#34515b}
@media(max-width:760px){.mf-member-portal-columns{grid-template-columns:1fr}.mf-member-portal-card{min-height:120px}}
/* Cooperative salary deduction upload and review. Reuses StudioShell cards and request controls. */
.mf-salary-upload{display:grid;gap:19px;min-width:0}
.mf-salary-tabs{display:flex;gap:7px;border-bottom:1px solid #e1e9eb}
.mf-salary-tabs button{padding:13px 20px;background:transparent;border:0;border-bottom:3px solid transparent;font-size:13px;font-weight:700;color:var(--muted,#647d85)}
.mf-salary-tabs button.is-active{border-color:#16876f;color:#146e60}
.mf-salary-panel{padding:22px;background:var(--surface,#fff);border:1px solid #e1e9eb;border-radius:13px;display:grid;gap:18px;min-width:0}
.mf-salary-panel h3{font-size:16px;color:var(--ink,#183b46);margin:0}
.mf-salary-section-head{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}
.mf-salary-section-head p{margin:5px 0 0;max-width:690px}
.mf-salary-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.mf-salary-field{display:grid;gap:7px;min-width:0;font-size:12px;color:var(--ink,#24424b);font-weight:700}
.mf-salary-field .mf-pending-control{width:100%;min-width:0;min-height:43px;padding:9px 10px;border-radius:9px;border:1px solid #dbe7e8;background:var(--surface,#fff);color:inherit}
.mf-salary-file input{font-size:12px}
.mf-salary-actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center}
.mf-salary-actions button{padding:11px 18px;border-radius:9px}
.mf-salary-actions button:disabled{opacity:.5;cursor:not-allowed}
.mf-salary-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.mf-salary-stat{display:grid;gap:7px;padding:15px;border:1px solid #e0eceb;background:var(--surface,#fff);border-radius:12px}
.mf-salary-stat small{font-size:11px;color:var(--muted,#71898d)}
.mf-salary-stat strong{font-size:20px;color:var(--ink,#203c45)}
.mf-salary-invalid{background:#fff4ef;color:#a44936}
.mf-salary-batch-split{display:grid;grid-template-columns:minmax(190px,290px) minmax(0,1fr);gap:13px;min-width:0}
.mf-salary-batch-list{display:grid;align-content:start;gap:8px}
.mf-salary-batch-item{display:grid;text-align:left;gap:7px;background:var(--surface-secondary,#f4f8f8);color:inherit;border:1px solid #e2eaeb;border-radius:10px;padding:15px;cursor:pointer}
.mf-salary-batch-item:hover{border-color:#16876f}
.mf-salary-batch-item strong{font-size:12px}
.mf-salary-batch-item small{font-size:11px;color:var(--muted,#6d8387)}
.mf-salary-batch-detail{min-width:0;display:grid;align-content:start;gap:15px;padding:16px;border:1px solid #e3ebeb;border-radius:12px}
.mf-salary-batch-detail .mf-request-action{min-width:0}
@media(max-width:850px){.mf-salary-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.mf-salary-batch-split{grid-template-columns:1fr}}
@media(max-width:540px){.mf-salary-fields{grid-template-columns:1fr}.mf-salary-panel{padding:14px}.mf-salary-stat strong{font-size:17px}}

/* Accounting Dashboard — retains the V6 panels, metric cards and Portal shell. */
.mf-accounting-dashboard{gap:20px;min-width:0}
.mf-accounting-heading{display:flex;justify-content:space-between;align-items:end;gap:18px;flex-wrap:wrap}
.mf-accounting-heading h2{font-size:clamp(23px,2.4vw,30px);margin:0;color:inherit}
.mf-accounting-controls{display:flex;gap:10px;flex-wrap:wrap}
.mf-accounting-filter{display:grid;gap:6px;font-size:12px;font-weight:700;min-width:145px}
.mf-accounting-filter select{background:var(--surface,#fff);color:inherit;border:1px solid #cddfe1;padding:10px 12px;border-radius:9px;min-width:140px}
.mf-accounting-block{display:grid;gap:12px}
.mf-accounting-review-note{color:#86591b;background:#fff8e6;border:1px solid #f1dcaf;padding:12px 16px;border-radius:10px;font-size:12px;line-height:1.55}
.mf-accounting-alert{color:#87552b;background:#fff5e7;border:1px solid #efdbb6;border-radius:9px;padding:11px 13px;font-size:12px;line-height:1.5}
.mf-accounting-good{background:#e7f5ed;color:#176d50;border-radius:9px;padding:11px;font-size:12px}
.mf-accounting-dashboard .metric-value{font-size:clamp(20px,2vw,27px);overflow-wrap:anywhere}
.mf-accounting-dashboard .mf-dashboard-metric{min-height:138px;gap:9px}
.mf-accounting-checks{display:grid;gap:0}
.mf-accounting-check{display:flex;justify-content:space-between;align-items:center;gap:8px;border-bottom:1px solid #e4ecee;padding:11px 0;font-size:13px}
.mf-accounting-check:last-child{border-bottom:none}.mf-accounting-check span{text-align:right}
.mf-accounting-shortcuts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,205px),1fr));gap:8px;margin-top:10px}
.mf-accounting-group-list{display:grid;gap:13px}
.mf-accounting-group{display:grid;grid-template-columns:minmax(120px,1.1fr) minmax(110px,3fr) auto;gap:13px;align-items:center}
.mf-accounting-group-label{display:grid;gap:3px}.mf-accounting-group-label strong{font-size:12px}.mf-accounting-group-label small{font-size:10px;color:var(--muted,#6b8990);text-transform:uppercase}
.mf-accounting-group-track{height:11px;background:var(--surface-secondary,#e9f1f2);border-radius:10px;overflow:hidden}
.mf-accounting-group-track span{display:block;height:100%;border-radius:10px;background:#19836d}
.mf-accounting-group-track .is-expense{background:#d8a357}
.mf-accounting-group-value{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px;font-weight:700}
.mf-accounting-issues{font-size:12px;line-height:1.7;padding-left:20px;max-height:250px;overflow:auto}
.mf-accounting-empty{display:grid;gap:11px}
.coop-dark .mf-accounting-filter select{background:#1c303a;border-color:#34515b}
.coop-dark .mf-accounting-review-note,.coop-dark .mf-accounting-alert{background:#493c2a;border-color:#6f5b35;color:#ffe9bf}
.coop-dark .mf-accounting-good{background:#1b4437;color:#b6efd5}
.coop-dark .mf-accounting-check{border-color:#34515b}
@media(max-width:680px){.mf-accounting-heading,.mf-accounting-controls{width:100%}.mf-accounting-filter{flex:1;min-width:120px}.mf-accounting-group{grid-template-columns:1fr auto}.mf-accounting-group-track{grid-column:1/-1;grid-row:2}.mf-accounting-dashboard .mf-dashboard-metric{min-height:120px}}
@media print{.mf-accounting-controls{display:none}.mf-accounting-dashboard{gap:12px}.mf-accounting-review-note{break-inside:avoid}}

/* MetaForge service integration readiness: descriptive only, no mutation controls. */
.mf-accounting-integration{margin-top:4px;display:grid;gap:14px}
.mf-accounting-integration .mf-accounting-check{gap:12px;flex-wrap:wrap}
.mf-accounting-integration .mf-accounting-route-ready{color:var(--green,#168b70);font-size:.82rem;font-weight:650}
.mf-accounting-integration .mf-accounting-alert{margin:0}

/* Cement operational dashboards. The institution shell stays authoritative for navigation. */
.mf-cement-dash{display:grid;gap:18px;min-width:0;color:inherit}
.mf-cement-dash-hero{display:flex;justify-content:space-between;align-items:end;flex-wrap:wrap;gap:18px}
.mf-cement-dash-hero h2{font-size:clamp(22px,2.5vw,29px);letter-spacing:-.04em;line-height:1.15;margin:5px 0 7px}
.mf-cement-dash-hero p{margin:0;color:var(--muted,#607d83);font-size:13px}
.mf-cement-dash-hero .mf-dashboard-eyebrow{font-size:10px;color:var(--coop-institution-accent,#147d6c);font-weight:800}
.mf-cement-dash-filters{display:flex;gap:10px;flex-wrap:wrap;align-items:end}
.mf-cement-dash-filters label{display:grid;gap:5px;font-size:11px;color:var(--muted,#607d83);font-weight:700}
.mf-cement-dash-filters select{border:1px solid #d4e2e5;background:var(--surface,#fff);border-radius:9px;padding:10px 34px 10px 12px;color:inherit;min-height:39px;font-size:13px}
.mf-cement-dash-provenance{margin:0;font-size:11px;color:var(--muted,#607d83);line-height:1.5}
.mf-cement-dash-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.mf-cement-dash-kpi{background:var(--surface,#fff);border:1px solid #e1e9eb;border-radius:13px;padding:19px;display:flex;flex-direction:column;gap:11px;min-height:151px;min-width:0}
.mf-cement-dash-kpi::before{content:"";width:34px;height:4px;border-radius:99px;background:var(--coop-institution-accent,#147d6c)}
.mf-cement-dash-kpi:nth-child(3n + 2)::before{background:#5c86b2}
.mf-cement-dash-kpi:nth-child(3n)::before{background:#e2ab5f}
.mf-cement-dash-kpi-name{margin:0;font-size:12px;color:var(--muted,#607d83);font-weight:650}
.mf-cement-dash-kpi-value{font-size:clamp(20px,2vw,29px);font-weight:800;line-height:1.05;letter-spacing:-.035em;overflow-wrap:anywhere}
.mf-cement-dash-kpi-caption{margin:0;color:var(--muted,#607d83);font-size:11px;line-height:1.45;flex:1}
.mf-cement-dash-kpi.is-incomplete{border-color:#e8c9a7}
.mf-cement-dash-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(270px,.75fr);gap:16px}
.mf-cement-dash-panel{padding:20px;min-width:0;background:var(--surface,#fff);border:1px solid #e1e9eb;border-radius:13px}
.mf-cement-dash-panel h3{font-size:15px;margin:0 0 8px;font-weight:750}
.mf-cement-dash-muted{font-size:12px;color:var(--muted,#607d83)}
.mf-cement-dash-bars{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:11px;align-items:end;padding:25px 4px 7px;height:170px;border-bottom:1px solid #e4eded}
.mf-cement-dash-month{display:flex;flex-direction:column;align-items:center;justify-content:end;gap:9px;min-width:0;height:100%}
.mf-cement-dash-month>span{font-size:10px;color:var(--muted,#607d83);white-space:nowrap}
.mf-cement-dash-bar-pair{height:120px;display:flex;align-items:end;gap:5px;justify-content:center;width:100%}
.mf-cement-dash-bar{background:#1a8c84;width:min(24px,37%);border-radius:5px 5px 0 0;min-height:3px}
.mf-cement-dash-bar.is-loading{background:#edae60}
.mf-cement-dash-legend{display:flex;gap:15px;align-items:center;padding-top:17px;color:var(--muted,#607d83);font-size:11px}
.mf-cement-dash-legend span::before{content:"";width:9px;height:9px;display:inline-block;margin-right:6px;background:#1a8c84;border-radius:3px}
.mf-cement-dash-legend .is-loading::before{background:#edae60}
.mf-cement-dash-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:18px}
.mf-cement-dash-shortcut{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:12px;color:inherit;background:var(--surface-secondary,#f1f7f8);border-radius:9px;border:1px solid #e1e9eb;text-decoration:none;font-weight:650;font-size:12px}
.mf-cement-dash-shortcut:hover{border-color:var(--coop-institution-accent,#147d6c);color:var(--coop-institution-accent,#147d6c)}
.mf-cement-dash-shortcut>span{font-size:17px}
.mf-cement-dash-activity{display:flex;justify-content:space-between;gap:10px;padding:11px 1px;border-bottom:1px solid #e8eff0;align-items:center;font-size:12px}
.mf-cement-dash-activity:last-child{border-bottom:0}
.mf-cement-dash-activity>div{display:grid;gap:4px;min-width:0}
.mf-cement-dash-activity strong{font-size:12px;overflow-wrap:anywhere}
.mf-cement-dash-activity small{font-size:11px;color:var(--muted,#607d83);text-transform:capitalize}
.mf-cement-dash-activity a{color:var(--coop-institution-accent,#147d6c);text-decoration:none;white-space:nowrap}
.mf-cement-dash-activity time{color:var(--muted,#607d83);white-space:nowrap}
.mf-cement-dash-warning{font-size:12px;color:#835a27;background:#fff8e9;border:1px solid #f4e3ba;padding:9px 10px;border-radius:8px;line-height:1.5}
.mf-cement-dash-good{font-size:12px;color:#166c52;background:#eaf8f1;border:1px solid #c8e7d7;padding:10px;border-radius:8px}
.coop-dark .mf-cement-dash-panel,.coop-dark .mf-cement-dash-kpi{background:#1c303a;border-color:#34515b}
.coop-dark .mf-cement-dash-filters select{background:#1c303a;border-color:#34515b}
.coop-dark .mf-cement-dash-shortcut{background:#29414b;border-color:#34515b}
.coop-dark .mf-cement-dash-warning{background:#493c25;color:#ffdfac;border-color:#71562a}
.coop-dark .mf-cement-dash-good{background:#1c4a3b;color:#b3e6d3;border-color:#316850}
@media(max-width:1100px){.mf-cement-dash-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.mf-cement-dash-grid{grid-template-columns:1fr}}
@media(max-width:580px){.mf-cement-dash-kpis{grid-template-columns:1fr}.mf-cement-dash-links{grid-template-columns:1fr}.mf-cement-dash-hero{align-items:stretch}.mf-cement-dash-filters label{flex:1}.mf-cement-dash-filters select{width:100%}}
/* Configuration-driven dashboard. Shared theme and compact action controls. */
.mf-config-dashboard{gap:18px;min-width:0}
.mf-dashboard-filters{display:flex;flex-wrap:wrap;align-items:end;gap:12px}
.mf-dashboard-filters label{display:grid;gap:6px;font-size:12px;font-weight:600;min-width:130px;flex:1 1 150px}
.mf-dashboard-filters select{width:100%;max-width:100%;font-weight:400}
.mf-dashboard-filters button{min-height:38px;align-self:end}
.mf-dashboard-surface{padding:18px;background:var(--surface,#fff);border:1px solid #dce7e9;border-radius:12px;min-width:0}
.mf-config-dashboard .mf-dashboard-metrics{grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))}
.mf-config-dashboard .mf-dashboard-metric{min-height:124px;gap:10px;padding:17px;min-width:0}
.mf-config-dashboard .metric-value{font-size:clamp(19px,1.9vw,27px);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.mf-dashboard-metric-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%}
.mf-dashboard-metric-heading svg{color:var(--coop-institution-accent,#147d6c);flex:none}
.mf-dashboard-metric-heading h3{margin:0}
.mf-config-dashboard .mf-dashboard-metric .mf-ui-action{font-size:11px;padding:5px 8px;margin-top:auto}
.mf-dashboard-shortcut-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr));gap:10px}
.mf-dashboard-shortcut-grid a{justify-content:flex-start;padding:14px;min-width:0;white-space:normal}
.mf-dashboard-notices{border:1px solid #d7b679;border-radius:9px;padding:10px 14px;background:#fff8e9;color:#73501a;font-size:12px;overflow-wrap:anywhere}
.mf-dashboard-notices[hidden]{display:none}.mf-dashboard-notices p{margin:4px 0}
.mf-dashboard-legend{display:flex;gap:12px;flex-wrap:wrap;margin:8px 0 12px;font-size:12px}
.mf-dashboard-series::before{display:inline-block;content:'';width:10px;height:10px;border-radius:2px;margin-right:6px;background:#178176}
.mf-dashboard-series[data-series="1"]::before{background:#86a7b9}
.mf-dashboard-chart-group{display:grid;gap:5px;margin:10px 0;font-size:12px}
.mf-dashboard-chart-line{display:grid;grid-template-columns:minmax(70px,1fr) minmax(95px,auto);align-items:center;gap:8px}
.mf-dashboard-chart-track{position:relative;height:12px;border-radius:3px;background:linear-gradient(90deg,#ecf1f2 49.5%,#87979b 49.5%,#87979b 50.5%,#ecf1f2 50.5%)}
.mf-dashboard-chart-bar{position:absolute;height:100%;border-radius:2px;background:#178176}.mf-dashboard-chart-bar[data-series="1"]{background:#86a7b9}
.mf-dashboard-chart-value{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.mf-config-dashboard .mf-table-container{border:0;background:transparent;padding:0;overflow-x:auto}
.mf-config-dashboard .mf-dashboard-panel .mf-table-container{margin-top:12px}
.coop-dark .mf-dashboard-surface{background:#1c303a;border-color:#34515b;color:#e3eeef}
.coop-dark .mf-dashboard-notices{background:#372e20;color:#f0d49a;border-color:#8d7148}
.coop-dark .mf-dashboard-chart-track{background:linear-gradient(90deg,#263d46 49.5%,#87979b 49.5%,#87979b 50.5%,#263d46 50.5%)}
@media(max-width:680px){.mf-dashboard-filters label{flex-basis:100%}.mf-dashboard-filters button{width:100%}.mf-dashboard-chart-line{grid-template-columns:minmax(70px,1fr) minmax(90px,1fr)}}

.mf-dashboard-filters[hidden]{display:none!important}
.mf-dashboard-empty-chart{min-height:150px;display:grid;place-items:center;align-content:center;gap:6px;color:var(--muted,#84979d)}
.mf-dashboard-empty-chart svg{width:min(100%,260px);height:100px;opacity:.55}
.mf-dashboard-empty-chart p{margin:0}

/* Cement overview only: keep quick reports beside the main dashboard content. */
.mf-dataset-side-links{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(210px,265px);grid-template-areas:"title title" "body quick" "footer quick";align-items:start;}
.mf-dataset-side-links>.mf-collection-toolbar{grid-area:title}
.mf-dataset-side-links>.mf-collection-body{grid-area:body;min-width:0}
.mf-dataset-side-links>.mf-collection-footer{grid-area:footer;min-width:0}
.mf-dataset-quick-links{grid-area:quick;min-width:0;padding:16px;border-left:1px solid var(--mf-border,#dce7e9);align-self:stretch}
.mf-dataset-quick-links>.mf-collection-header-actions{display:grid;gap:8px;justify-content:stretch;margin-top:12px}
.mf-dataset-quick-links .mf-ui-action{display:flex;justify-content:flex-start;white-space:normal;text-align:left;line-height:1.4;width:100%;box-sizing:border-box}
@media(max-width:900px){.mf-dataset-side-links{grid-template-columns:minmax(0,1fr);grid-template-areas:"title" "body" "footer" "quick"}.mf-dataset-quick-links{border-left:0;border-top:1px solid var(--mf-border,#dce7e9)}}

/* MetaForge presentation refinement | shared app-owned visual layer.
   No DOM, routing, data, service or permission changes. Existing status colours,
   branding and print/export logic remain in place. */
:root {
  --mf-ui-bg: #f3f6fa;
  --mf-ui-surface: #fff;
  --mf-ui-subtle: #f1f5f8;
  --mf-ui-ink: #192c3d;
  --mf-ui-muted: #526578;
  --mf-ui-line: #d7e1e9;
  --mf-ui-accent: #116d75;
  --mf-ui-accent-hover: #0a535b;
  --mf-ui-focus: #137d85;
  --mf-ui-radius: 10px;
  --mf-ui-shadow: 0 1px 3px rgb(15 35 55 / 5%);
  --coo-background: var(--mf-ui-bg);
  --coo-card: var(--mf-ui-surface);
  --coo-ink: var(--mf-ui-ink);
  --coo-muted: var(--mf-ui-muted);
  --coo-border: var(--mf-ui-line);
  --coo-primary: var(--mf-ui-accent);
  --coo-primary-hover: var(--mf-ui-accent-hover);
  --surface: var(--mf-ui-surface);
  --surface-secondary: var(--mf-ui-subtle);
  --muted: var(--mf-ui-muted);
  --border: var(--mf-ui-line);
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  color-scheme: light;
}
:root.coop-dark {
  --mf-ui-bg: #111d2b;
  --mf-ui-surface: #1b2b3a;
  --mf-ui-subtle: #223545;
  --mf-ui-ink: #e4edf5;
  --mf-ui-muted: #b0c3d1;
  --mf-ui-line: #3b5060;
  --mf-ui-focus: #73dfce;
  --mf-ui-shadow: 0 1px 3px rgb(0 0 0 / 14%);
  --coo-background: var(--mf-ui-bg);
  --coo-card: var(--mf-ui-surface);
  --coo-ink: var(--mf-ui-ink);
  --coo-muted: var(--mf-ui-muted);
  --coo-border: var(--mf-ui-line);
  --surface: var(--mf-ui-surface);
  --surface-secondary: var(--mf-ui-subtle);
  --muted: var(--mf-ui-muted);
  --border: var(--mf-ui-line);
  color-scheme: dark;
}
/* Keep the complete shell/navigation structure and its original mobile toggle. */
.v6-shell, .coop-dark .v6-shell, .v6-main, .coop-dark .v6-main {
  background: var(--mf-ui-bg); color: var(--mf-ui-ink);
}
.v6-shell .v6-sidebar {
  background: #112433; color: #e7f0f6; box-shadow: none;
  border-right: 1px solid #283e4e;
}
.v6-sidebar .sidebar-header {padding: 20px 16px; border-color: #304452;}
.v6-sidebar .brand-copy {min-width: 0;}
.v6-sidebar .brand-copy strong {font-size: 16px; letter-spacing: -.25px; line-height: 1.3;}
.v6-sidebar .brand-copy small {color: #a5bdca; letter-spacing: .7px; line-height: 1.4;}
.v6-navigation {padding: 16px 12px;}
.v6-navigation .nav-flat-section {margin: 13px 0 5px; padding: 7px 10px 3px; color: #a5bdca; font-size: 10px; letter-spacing: 1.1px;}
.v6-navigation .nav-item {height: auto; min-height: 37px; padding: 8px 11px; gap: 10px; border-radius: 7px; margin-bottom: 3px; color: #c5d6e1; line-height: 1.35; font-size: 13px; font-weight: 550;}
.v6-navigation .nav-item span {min-width: 0; overflow-wrap: anywhere;}
.v6-navigation .nav-item:hover {background: #253d4c; color: #fff;}
.v6-navigation .nav-item.active {background: var(--coop-institution-accent,#19565b); color: #fff; box-shadow: inset 3px 0 #8de2cf; font-weight: 700;}
.v6-sidebar .sidebar-bottom {border-color: #304452; padding: 15px 16px;}
.v6-sidebar .role-tag {display: inline-block; max-width: 100%; overflow-wrap: anywhere; background: #263f4f; color: #e1eef5; border-radius: 6px;}
.v6-shell .v6-topbar, .coop-dark .v6-shell .v6-topbar {min-height: 64px; height: auto; padding: 10px clamp(15px,2.2vw,30px); gap: 14px; background: var(--mf-ui-surface); color: var(--mf-ui-ink); border-bottom: 1px solid var(--mf-ui-line); box-shadow: none;}
.v6-top-title {min-width: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 700;}
.v6-top-actions {gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0;}
.v6-topbar .icon-button, .coop-dark .v6-topbar .icon-button {min-width: 36px; min-height: 36px; width: auto; height: auto; color: var(--mf-ui-ink); background: var(--mf-ui-subtle); border: 1px solid var(--mf-ui-line); border-radius: 7px;}
.v6-topbar .sync-button {min-height: 36px; border-radius: 7px;}
.v6-topbar .user-chip, .coop-dark .v6-topbar .user-chip {border-radius: 7px; color: var(--mf-ui-ink); background: var(--mf-ui-subtle);}
.v6-content {padding: clamp(18px,2.5vw,34px) clamp(16px,2.5vw,36px) 40px; min-width: 0;}
.coo-page-header {margin-bottom: 20px; gap: 12px;}
.coo-page-title {font-size: clamp(21px,2vw,27px); line-height: 1.25; font-weight: 700; letter-spacing: -.45px; overflow-wrap: anywhere;}
.coo-page, .mf-page-workspace-content, .mf-page-workspace-panel {min-width: 0;}
/* Cards, summaries and operational dashboards. No new metrics or charts. */
.v6-content .panel, .coop-dark .v6-content .panel,
.mf-dashboard-metric, .coop-dark .mf-dashboard-metric,
.mf-dashboard-surface, .coop-dark .mf-dashboard-surface,
.mf-cement-dash-panel, .coop-dark .mf-cement-dash-panel,
.mf-cement-dash-kpi, .coop-dark .mf-cement-dash-kpi,
.mf-member-profile-header, .coop-dark .mf-member-profile-header,
.mf-member-profile-card, .coop-dark .mf-member-profile-card,
.mf-card, .coop-dark .mf-collection .mf-card,
.mf-summary-card, .mf-report-kpi {
  background: var(--mf-ui-surface); border: 1px solid var(--mf-ui-line);
  border-radius: var(--mf-ui-radius); box-shadow: var(--mf-ui-shadow); min-width: 0;
}
.v6-content .panel {padding: clamp(14px,1.6vw,22px);}
.mf-portal-dashboard, .mf-cement-dash {gap: 18px;}
.mf-dashboard-metric, .mf-cement-dash-kpi {padding: 17px; gap: 9px; min-height: 128px;}
.mf-dashboard-metric .metric-value, .mf-cement-dash-kpi-value, .mf-collection-stat-value, .mf-report-kpi-value {font-size: clamp(22px,2.1vw,29px); font-weight: 700; letter-spacing: -.45px; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;}
.mf-dashboard-metric .metric-label, .mf-cement-dash-kpi-name, .mf-collection-stat-label, .mf-report-kpi-label {font-size: 12px; font-weight: 600; line-height: 1.45; color: var(--mf-ui-muted);}
.mf-dashboard-panel h3, .mf-cement-dash-panel h3 {font-size: 16px; font-weight: 700; line-height: 1.4;}
.mf-dashboard-activity-row, .mf-dashboard-work-row {border-color: var(--mf-ui-line);}
.mf-dashboard-shortcut, .coop-dark .mf-dashboard-shortcut,
.mf-member-workspace-link, .coop-dark .mf-member-workspace-link {background: var(--mf-ui-surface); border-color: var(--mf-ui-line); border-radius: 8px;}
.mf-dashboard-shortcut:hover, .mf-member-workspace-link:hover {background: var(--mf-ui-subtle); border-color: var(--mf-ui-focus);}
.coop-dark .mf-dashboard-link, .coop-dark .mf-member-workspace-link {color: #8de2d2;}
/* Common collection, table, action and form system. */
.mf-collection, .coop-dark .mf-collection {--collection-surface: var(--mf-ui-surface); --collection-border: var(--mf-ui-line); --collection-ink: var(--mf-ui-ink); --collection-muted: var(--mf-ui-muted); --collection-subtle: var(--mf-ui-subtle); --collection-accent: var(--mf-ui-accent); gap: 14px;}
.mf-collection-main, .mf-collection-stat, .mf-table-container, .mf-card-collection, .mf-form {border-radius: var(--mf-ui-radius); box-shadow: var(--mf-ui-shadow);}
.mf-collection-stat {gap: 6px; padding: 15px 17px; min-height: 84px;}
.mf-collection-toolbar {padding: 15px 18px; gap: 12px;}
.mf-collection-title {font-size: 16px; font-weight: 700; overflow-wrap: anywhere; min-width: 0;}
.mf-collection-body .mf-table th, .coop-dark .mf-collection .mf-table th {background: var(--mf-ui-subtle); color: var(--mf-ui-muted); font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: .1px;}
.mf-collection-body .mf-table td, .mf-collection-body .mf-table th {padding: 11px 15px;}
.mf-table, .register-table, .mf-cement-table, .tb-table, .ap-table {font-variant-numeric: tabular-nums;}
.mf-table th, .mf-table td {line-height: 1.45;}
.mf-collection-footer {padding: 12px 18px;}
.mf-ui-action, .coo-primary, .coo-secondary, .mf-cement-action, .mf-form button[type=submit] {border-radius: 7px; line-height: 1.4;}
.mf-ui-action, .coo-secondary {font-weight: 600;}
.mf-collection-header-actions .mf-ui-action, .mf-form button[type=submit] {min-height: 38px; font-weight: 650;}
.mf-form .mf-form-section {border-radius: 8px; padding: 16px; gap: 16px 20px;}
.mf-form .mf-form-section legend {font-size: 14px; font-weight: 650;}
.mf-form .mf-field-label {font-size: 13px; line-height: 1.4;}
.mf-form .mf-field-control:not([type=checkbox]):not([type=radio]), .mf-collection-controls input, .mf-collection-controls select {min-height: 40px; border-radius: 7px; font-size: 13px;}
.mf-form textarea.mf-field-control {min-height: 82px;}
.mf-form .mf-form-actions {gap: 10px;}
.mf-form .mf-field-error {line-height: 1.45;}
.mf-page-workspace .mf-page-nav-item {border-radius: 7px; line-height: 1.4; font-size: 13px;}
.mf-page-workspace-navigation, .mf-member-workspace-body .mf-page-workspace-navigation, .coop-dark .mf-member-workspace-body .mf-page-workspace-navigation {border-radius: var(--mf-ui-radius);}
.mf-member-workspace-body .mf-page-nav-item {padding: 10px 12px;}
/* Authentication: retain institution-owned text, logo and the established flow. */
.auth-form-wrap h2 {font-size: clamp(29px,3.3vw,40px); letter-spacing: -.8px;}
.auth-copy h1 {letter-spacing: -1.6px; line-height: 1.12;}
.auth-form-wrap .field-with-icon, .auth-submit, .auth-choice, .password-modal {border-radius: 9px;}
.auth-form-wrap .auth-submit {font-weight: 700;}
/* Native print/export controls are untouched. Refine report typography only. */
.tb-page .tb-table, .ap-page .ap-table, .mf-report .mf-table {font-variant-numeric: tabular-nums; line-height: 1.45;}
.tb-page .tb-table th, .ap-page .ap-table th {font-weight: 700;}
/* Keyboard access and responsive sizing: never hide actions or data. */
.v6-shell :is(a,button,input,select,textarea,summary):focus-visible,
.auth-shell :is(a,button,input,select,textarea):focus-visible {outline: 2px solid var(--mf-ui-focus); outline-offset: 2px;}
.v6-sidebar :is(a,button):focus-visible {outline-color: #8de2cf; outline-offset: -2px;}
@media (max-width: 850px) {
  .v6-shell .v6-topbar {gap: 8px; padding: 9px 12px; flex-wrap: wrap;}
  .v6-top-title {flex: 1 1 120px; font-size: 14px;}
  .v6-top-actions {gap: 6px;}
  .v6-content {padding: 18px 13px 30px;}
  .v6-navigation .nav-item {min-height: 42px;}
}
@media (max-width: 600px) {
  .v6-top-actions {flex: 1 1 100%; justify-content: flex-start;}
  .v6-topbar .icon-button, .v6-topbar .sync-button {min-height: 40px;}
  .mf-collection-toolbar, .mf-collection-footer {padding: 12px;}
  .mf-collection-body .mf-table th, .mf-collection-body .mf-table td {padding: 10px 12px;}
  .mf-collection-stat {padding: 12px;}
  .mf-form .mf-form-section {padding: 12px; gap: 13px;}
  .mf-form .mf-field-control:not([type=checkbox]):not([type=radio]), .mf-collection-controls input, .mf-collection-controls select {font-size: 16px;}
  .mf-dashboard-metric, .mf-cement-dash-kpi {min-height: 105px; padding: 14px;}
}
@media (prefers-reduced-motion: reduce) {
  html {scroll-behavior: auto;}
  .v6-navigation .nav-item, .v6-sidebar, .auth-submit {transition: none;}
}
@media print {
  .tb-page, .ap-page, .mf-report {font-family: Arial, sans-serif;}
  .tb-page .tb-table, .ap-page .ap-table, .mf-report .mf-table {font-size: 10pt;}
  .tb-page .tb-table thead, .ap-page .ap-table thead, .mf-report .mf-table thead {display: table-header-group;}
  .tb-page .tb-table tr, .ap-page .ap-table tr, .mf-report .mf-table tr {break-inside: avoid;}
}

/* The current Cooperative overview and Cement operational dashboard use their
   own existing markup; style these too without changing any dashboard content. */
.mf-portal-dashboard > .mf-collection-summary {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,205px),1fr));
  gap:12px;
}
.mf-portal-dashboard > .mf-collection-summary > .mf-collection-stat {
  background:var(--mf-ui-surface); border:1px solid var(--mf-ui-line);
  color:var(--mf-ui-ink); min-height:132px; justify-content:flex-start;
}
.mf-portal-dashboard > .mf-collection-summary > .mf-collection-stat .mf-collection-stat-label {color:var(--mf-ui-muted);}
.mf-portal-dashboard > .mf-collection-summary > .mf-collection-stat .mf-collection-stat-value {color:var(--mf-ui-ink);}
.mf-portal-dashboard > .mf-collection-summary > .mf-collection-stat > a {align-self:flex-start;margin-top:auto;min-height:34px;padding:7px 10px;font-size:12px;}
.mf-portal-dashboard > section:has(> .mf-form-actions) {padding:16px 18px;border:1px solid var(--mf-ui-line);background:var(--mf-ui-surface);border-radius:var(--mf-ui-radius);}
.mf-portal-dashboard > section:has(> .mf-form-actions) > h3 {margin-bottom:12px;font-size:16px;}
.coop-dark .mf-portal-dashboard > section > .mf-form-actions > .mf-ui-action,
.coop-dark .mf-portal-dashboard > .mf-collection-summary > .mf-collection-stat > .mf-ui-action,
.coop-dark .cement-dash .cd-link:not(.cd-primary) {background:var(--mf-ui-subtle);color:#b6e8df;border-color:var(--mf-ui-line);}
.coop-dark .mf-portal-dashboard > section > .mf-form-actions > .mf-ui-action:hover,
.coop-dark .mf-portal-dashboard > .mf-collection-summary > .mf-collection-stat > .mf-ui-action:hover,
.coop-dark .cement-dash .cd-link:not(.cd-primary):hover {border-color:#73dfce;color:#e7fff9;}
.cement-dash {--mf-border:var(--mf-ui-line);--mf-surface:var(--mf-ui-surface);}
.cement-dash .cd-panel,.cement-dash .cd-card,.cement-dash .cd-role {background:var(--mf-ui-surface);border-color:var(--mf-ui-line);box-shadow:var(--mf-ui-shadow);}
.cement-dash .cd-card {display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:16px;}
.cement-dash .cd-card strong {font-variant-numeric:tabular-nums;font-size:clamp(21px,2vw,28px);font-weight:700;line-height:1.15;margin:0;}
.cement-dash .cd-card small {color:var(--mf-ui-muted);opacity:1;line-height:1.45;}
.cement-dash .cd-card .cd-link {margin-top:auto;}
.cement-dash .cd-panel-head h3 {font-size:15px;font-weight:700;}
.cement-dash .cd-link {min-height:32px;border-radius:7px;}
@media(max-width:600px){.mf-portal-dashboard > .mf-collection-summary {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}.mf-portal-dashboard > .mf-collection-summary > .mf-collection-stat {padding:12px;}.cement-dash .cd-card{padding:12px;}}
@media(max-width:350px){.mf-portal-dashboard > .mf-collection-summary {grid-template-columns:1fr;}}

/* Keep page and top-bar surfaces consistent in dark mode. */
.coop-dark body,.coop-dark .v6-content {background:var(--mf-ui-bg);color:var(--mf-ui-ink);}
.coop-dark .v6-topbar .sync-button {background:#294653;color:#b8ecdf;border:1px solid var(--mf-ui-line);}
.coop-dark .v6-topbar .connection-status:not(.is-offline) {background:#244a40;color:#a9e7cc;}
@media(max-width:850px){.v6-shell:not(.sidebar-open) .v6-sidebar{transform:translateX(-105%);}}

/* QA member workspace: grouped horizontal navigation and readable financial cards. */
.mf-member-workspace .mf-member-identity p{margin:0}.mf-member-workspace .mf-member-profile-header{align-items:center;gap:12px}
.mf-member-status{font-size:12px;border:1px solid var(--mf-ui-line);border-radius:999px;padding:6px 10px;color:var(--mf-ui-muted);background:var(--mf-ui-subtle)}
.mf-member-status[data-status=active]{background:#dff4e9;color:#08694c;border-color:#b7e3cd}.coop-dark .mf-member-status[data-status=active]{background:#204b40;color:#b6f0d6;border-color:#356356}
.mf-member-workspace-body .mf-page-workspace--top{display:flex;flex-direction:column;gap:12px}.mf-member-workspace-body .mf-page-workspace-navigation{background:var(--mf-ui-surface);border-color:var(--mf-ui-line)}
.mf-member-workspace-body .mf-page-navigation ul{flex-wrap:wrap;overflow-x:visible;gap:5px}.mf-member-workspace-body .mf-page-nav-item{border:1px solid transparent;white-space:normal;padding:10px 12px;min-height:38px}.mf-workspace-subnav:not([hidden]){border-top:1px solid var(--mf-ui-line);padding-top:7px;margin-top:7px}.mf-workspace-subnav .mf-page-nav-item{font-size:12px;padding:8px 10px}
.mf-member-metrics,.mf-member-account-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr));gap:12px}.mf-member-metric,.mf-member-account-card{display:flex;flex-direction:column;gap:9px;padding:16px;border-radius:10px;border:1px solid var(--mf-ui-line);background:var(--mf-ui-subtle);min-width:0}.mf-member-metric span,.mf-member-muted{color:var(--mf-ui-muted);font-size:12px;line-height:1.5}.mf-member-metric strong,.mf-member-account-balance{font-size:clamp(17px,2vw,23px);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.mf-member-account-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr))}.mf-member-account-card h4,.mf-member-account-card p{margin:0}.mf-member-account-card .mf-member-profile-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,100px),1fr))}.mf-member-workspace-link:focus-visible{outline:2px solid var(--mf-ui-focus);outline-offset:2px}.mf-member-profile-card .mf-member-workspace-actions{margin-top:8px}.mf-member-workspace .mf-table-scroll{max-width:100%}
.mf-record-detail .mf-card-header-actions,.mf-record-detail .mf-card-actions{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:8px}.mf-record-detail .mf-ui-action{white-space:normal;flex:0 1 auto;min-height:36px}.mf-record-detail .mf-card dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:16px 22px}.mf-record-detail-field{min-width:0}.mf-record-detail .mf-card dt{margin:0 0 5px;color:var(--mf-ui-muted)}.mf-record-detail .mf-card dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap}.mf-record-detail .mf-card-grid{grid-template-columns:minmax(0,1fr)}
@media(max-width:600px){.mf-member-workspace .mf-member-profile-header,.mf-member-profile-card{padding:14px}.mf-member-workspace-body .mf-page-nav-item{font-size:12px;padding:8px}.mf-record-detail .mf-card dl{grid-template-columns:minmax(0,1fr)}.mf-member-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.mf-member-metric{padding:10px}}

/* Keep overview panels full width; actions wrap in a deliberate grid, not compressed text. */
.mf-member-workspace-body .mf-page-workspace--top{align-items:stretch}.mf-member-workspace-body .mf-page-workspace-navigation,.mf-member-workspace-body .mf-page-workspace-content{width:100%;box-sizing:border-box}.mf-member-quick-transactions .mf-member-workspace-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr))}.mf-member-quick-transactions .mf-member-workspace-link{text-align:center;display:flex;align-items:center;justify-content:center;min-height:38px;white-space:normal}.mf-member-quick-transactions .mf-member-workspace-link:first-child{border-color:var(--mf-ui-focus)}
@media(max-width:600px){.mf-member-quick-transactions .mf-member-workspace-actions{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* The member overview's small transaction table is not inside CollectionRenderer. */
.mf-member-workspace .mf-table th{background:var(--mf-ui-subtle);color:var(--mf-ui-muted);border-color:var(--mf-ui-line)}
.mf-member-workspace .mf-table td{color:var(--mf-ui-ink);border-color:var(--mf-ui-line)}
