/* BAVORA OS · Kundenportal-Übersicht (CRM). Uses existing CRM editorial tokens only. */
.cpo-head-actions{gap:var(--sp-2,.5rem);flex-wrap:wrap;align-self:flex-end}
.cpo{display:flex;flex-direction:column;gap:24px}

/* Status strip: the counts are the filter. */
.cpo-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));border:1px solid var(--line);background:var(--bg-elev,#fff)}
.cpo-stat{all:unset;box-sizing:border-box;display:flex;flex-direction:column;gap:2px;padding:16px 18px;cursor:pointer;border-right:1px solid var(--line);position:relative;min-height:44px}
.cpo-stat:last-child{border-right:0}
.cpo-stat:hover{background:var(--bg-alt)}
.cpo-stat:focus-visible{outline:2px solid var(--ink);outline-offset:-2px}
.cpo-stat.is-active{background:var(--bg-alt)}
.cpo-stat.is-active::after{content:'';position:absolute;left:0;right:0;bottom:-1px;height:3px;background:var(--ink)}
.cpo-stat-value{font-family:var(--font-serif);font-size:clamp(1.9rem,3vw,2.6rem);line-height:1;color:var(--ink)}
.cpo-stat-label{font-weight:600;font-size:13px;color:var(--ink);margin-top:6px}
.cpo-stat-sub{font-size:12px;color:var(--ink-muted)}
.cpo-stat[data-status="not_invited"] .cpo-stat-value{color:var(--ink-muted)}

/* Layout */
.cpo-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,360px);gap:24px;align-items:start}
.cpo-main{padding:20px 22px;min-width:0}
.cpo-main-head,.cpo-side-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.cpo-main h2,.cpo-side h2{margin:0;font-size:20px}
.cpo-search{max-width:320px;flex:1 1 220px}
.cpo-list-meta{margin:10px 0 6px}
.cpo-list{overflow-x:auto;-webkit-overflow-scrolling:touch}
.cpo-side{display:flex;flex-direction:column;gap:24px;min-width:0}
.cpo-side .portal-access-management{margin-bottom:0}
.portal-access-management.is-compact{padding:18px 20px}
.portal-access-management.is-compact h2{font-size:18px}
.portal-access-management.is-compact .portal-access-meta{margin:10px 0}
.portal-access-management.is-compact .portal-access-actions{margin:10px 0 8px}

/* Table */
.cpo-table td{vertical-align:middle}
.cpo-table tbody tr{cursor:pointer}
.cpo-table tbody tr:hover{background:var(--bg-alt)}
.cpo-actions .row{gap:14px;justify-content:flex-end;flex-wrap:nowrap;align-items:center}
.cpo-actions .btn,.cpo-table .badge,.cpo-table .cpo-link{white-space:nowrap}
.cpo-actions .btn{padding:8px 12px;font-size:11px;letter-spacing:.08em}
.cpo-actions:empty{display:none}
.cpo-actions-col{width:1%}
.cpo-table td.cpo-actions{padding-right:4px}
.cpo-gap{margin-left:6px}
.cpo-link{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.cpo-danger{color:var(--danger)}
.cpo-empty{padding:28px 4px;display:flex;flex-direction:column;align-items:flex-start;gap:12px}
.cpo-empty p{margin:0;color:var(--ink-soft)}

/* Projects panel */
.cpo-projects{padding:18px 20px}
.cpo-project-list{list-style:none;margin:12px 0;padding:0;border-top:1px solid var(--line)}
.cpo-project-list li{border-bottom:1px solid var(--line)}
.cpo-project{display:grid;gap:3px;padding:12px 2px;color:inherit;text-decoration:none}
.cpo-project:hover .cpo-project-title{text-decoration:underline;text-underline-offset:3px}
.cpo-project:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.cpo-project-title{font-weight:600;color:var(--ink)}
.cpo-project .badge{justify-self:start;margin-top:4px}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@media (max-width:1100px){.cpo-grid{grid-template-columns:1fr}.cpo-side{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}}
@media (max-width:720px){
  .cpo-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cpo-stat{border-bottom:1px solid var(--line)}
  .cpo-stat:nth-child(2n){border-right:0}
  .cpo-stat-sub{display:none}
  .cpo-main{padding:16px}
  .cpo-search{max-width:none}
  /* Table becomes stacked cards */
  .cpo-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .cpo-table,.cpo-table tbody,.cpo-table tr,.cpo-table td{display:block;width:100%}
  .cpo-table tr{border-bottom:1px solid var(--line);padding:12px 0}
  .cpo-table td{border:0;padding:3px 0}
  .cpo-table td[data-label]:not(:first-child)::before{content:attr(data-label) ': ';color:var(--ink-muted);font-size:12px}
  .cpo-actions .row{justify-content:flex-start;margin-top:8px}
  .cpo-actions .btn{min-height:40px}
}
