
:root{
  --mg-bg:#eef3f8;
  --mg-panel:#ffffff;
  --mg-panel-2:#f7f9fc;
  --mg-text:#142133;
  --mg-muted:#65758b;
  --mg-border:#d6e0ec;
  --mg-accent:#0b5cab;
  --mg-accent-2:#0a4a88;
  --mg-danger:#b42318;
  --mg-danger-bg:#fef3f2;
  --mg-success:#067647;
  --mg-success-bg:#ecfdf3;
  --mg-warning:#b54708;
  --mg-warning-bg:#fffaeb;
  --mg-shadow:0 12px 30px rgba(15,23,42,.08);
}
html.dark, html[data-theme="dark"], body.dark{
  --mg-bg:#09111c;
  --mg-panel:#102033;
  --mg-panel-2:#12253c;
  --mg-text:#edf4ff;
  --mg-muted:#a6b7cc;
  --mg-border:#233a57;
  --mg-accent:#6cb7ff;
  --mg-accent-2:#4da3ff;
  --mg-danger:#ff8f8f;
  --mg-danger-bg:#331417;
  --mg-success:#6ee7b7;
  --mg-success-bg:#123024;
  --mg-warning:#ffcf7f;
  --mg-warning-bg:#34250f;
  --mg-shadow:0 12px 30px rgba(0,0,0,.34);
}
*{box-sizing:border-box}
body.mgmt-body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--mg-text);
  background:var(--mg-bg);
}
.mgmt-shell{display:grid;grid-template-columns:280px minmax(0,1fr);min-height:100vh}
.mgmt-side{
  background:linear-gradient(180deg,var(--mg-panel),var(--mg-panel-2));
  border-right:1px solid var(--mg-border);
  padding:22px 18px;
  position:sticky; top:0; height:100vh; overflow:auto;
}
.mgmt-brand{display:flex;align-items:center;gap:12px;margin:4px 0 22px;font-size:1.3rem;font-weight:800}
.mgmt-brand__logo{
  width:40px;height:40px;border-radius:14px;
  background:linear-gradient(135deg,var(--mg-accent),var(--mg-accent-2));
  color:#fff; display:grid; place-items:center;
  box-shadow:var(--mg-shadow);
}
.mgmt-brand__logo i{color:#fff!important;--fa-primary-color:#fff;--fa-secondary-color:#fff;--fa-secondary-opacity:1}
.mgmt-nav-group{margin-bottom:18px}
.mgmt-nav-label{font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; color:var(--mg-muted); margin:12px 10px 6px}
.mgmt-side a{
  display:flex;align-items:center;gap:12px; padding:11px 12px;
  border-radius:14px; text-decoration:none; color:var(--mg-text);
  transition:.18s ease; margin-bottom:4px; font-weight:600;
}
.mgmt-side a i{width:18px;text-align:center;color:var(--mg-muted)}
.mgmt-side a:hover{background:rgba(11,92,171,.08)}
.mgmt-side a.active{
  background:linear-gradient(180deg, rgba(11,92,171,.14), rgba(11,92,171,.08));
  border:1px solid rgba(11,92,171,.18);
}
.mgmt-main{padding:28px}
.mgmt-topbar{
  display:flex;justify-content:space-between;align-items:flex-start;gap:18px;flex-wrap:wrap;
  margin-bottom:22px;
}
.mgmt-title{margin:0 0 6px;font-size:2.1rem;line-height:1.1}
.mgmt-subtitle{color:var(--mg-muted);max-width:900px}
.mgmt-userchip{
  min-width:260px;background:var(--mg-panel);border:1px solid var(--mg-border);
  border-radius:18px;padding:14px 16px;box-shadow:var(--mg-shadow)
}
.mgmt-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:18px}
.mgmt-card{
  background:var(--mg-panel);
  border:1px solid var(--mg-border);
  border-radius:22px;
  box-shadow:var(--mg-shadow);
  padding:18px;
}
.mgmt-card h2,.mgmt-card h3{margin-top:0}
.mgmt-span-12{grid-column:span 12}
.mgmt-span-9{grid-column:span 9}
.mgmt-span-8{grid-column:span 8}
.mgmt-span-7{grid-column:span 7}
.mgmt-span-6{grid-column:span 6}
.mgmt-span-5{grid-column:span 5}
.mgmt-span-4{grid-column:span 4}
.mgmt-span-3{grid-column:span 3}
.mgmt-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.mgmt-kpi{padding:16px 18px;background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:20px;box-shadow:var(--mg-shadow)}
.mgmt-kpi__label{color:var(--mg-muted);font-size:.92rem;margin-bottom:8px}
.mgmt-kpi__value{font-size:2rem;font-weight:800;line-height:1}
.mgmt-actions{display:flex;gap:10px;flex-wrap:wrap}
.mgmt-btn,.btn--primary,.btn--secondary{
  appearance:none; border:0; border-radius:14px; padding:10px 14px; font-weight:700;
  text-decoration:none; cursor:pointer; display:inline-flex; align-items:center; gap:10px;
}
.mgmt-btn{background:var(--mg-accent);color:#fff}
.mgmt-btn:hover{background:var(--mg-accent-2)}
.mgmt-btn--soft{background:rgba(11,92,171,.08); color:var(--mg-text); border:1px solid var(--mg-border)}
.mgmt-btn--danger{background:var(--mg-danger); color:#fff}
.mgmt-btn--ghost{background:transparent;color:var(--mg-text);border:1px solid var(--mg-border)}
.mgmt-pill{
  display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;
  font-size:.85rem;font-weight:700;background:rgba(11,92,171,.08);color:var(--mg-text)
}
.mgmt-muted{color:var(--mg-muted)}
.mgmt-table-wrap{overflow:auto}
.mgmt-table{width:100%;border-collapse:collapse}
.mgmt-table th,.mgmt-table td{padding:12px 10px;border-top:1px solid var(--mg-border);vertical-align:top;text-align:left}
.mgmt-table th{font-size:.88rem;color:var(--mg-muted);font-weight:800}
.mgmt-table tr:first-child td{border-top:1px solid var(--mg-border)}
.mgmt-search{display:flex;gap:10px;flex-wrap:wrap}
.mgmt-search input,.mgmt-search select,.mgmt-field, .mgmt-textarea{
  width:100%; background:var(--mg-panel-2); color:var(--mg-text);
  border:1px solid var(--mg-border); border-radius:14px; padding:11px 12px;
}
.mgmt-textarea{min-height:120px; resize:vertical}
.mgmt-form-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px}
.mgmt-col-12{grid-column:span 12}.mgmt-col-8{grid-column:span 8}.mgmt-col-6{grid-column:span 6}.mgmt-col-4{grid-column:span 4}.mgmt-col-3{grid-column:span 3}
.mgmt-label{display:block;font-weight:800;margin-bottom:6px}
.mgmt-help{font-size:.92rem;color:var(--mg-muted);margin-top:6px}
.mgmt-row{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;padding:14px 0;border-top:1px solid var(--mg-border)}
.mgmt-row:first-child{border-top:0;padding-top:0}
.mgmt-notice{padding:12px 14px;border-radius:16px;margin-bottom:14px;font-weight:600}
.mgmt-notice--success{background:var(--mg-success-bg); color:var(--mg-success)}
.mgmt-notice--error{background:var(--mg-danger-bg); color:var(--mg-danger)}
.mgmt-notice--warn{background:var(--mg-warning-bg); color:var(--mg-warning)}
.mgmt-list{display:grid;gap:10px}
.mgmt-list__item{padding:12px 0;border-top:1px solid var(--mg-border)}
.mgmt-list__item:first-child{border-top:0;padding-top:0}
.mgmt-badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:.8rem;font-weight:700;background:var(--mg-panel-2);border:1px solid var(--mg-border)}
.mgmt-badge--ok{color:var(--mg-success);background:var(--mg-success-bg)}
.mgmt-badge--warn{color:var(--mg-warning);background:var(--mg-warning-bg)}
.mgmt-badge--danger{color:var(--mg-danger);background:var(--mg-danger-bg)}
.mgmt-avatar{width:56px;height:56px;border-radius:16px;object-fit:cover;background:var(--mg-panel-2);border:1px solid var(--mg-border)}
.mgmt-mini{font-size:.86rem}
.mgmt-section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.mgmt-empty{padding:16px;border-radius:16px;background:var(--mg-panel-2);color:var(--mg-muted)}
@media (max-width:1100px){
  .mgmt-shell{grid-template-columns:1fr}
  .mgmt-side{position:relative;height:auto}
  .mgmt-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mgmt-span-9,.mgmt-span-8,.mgmt-span-7,.mgmt-span-6,.mgmt-span-5,.mgmt-span-4,.mgmt-span-3{grid-column:span 12}
}
@media (max-width:640px){
  .mgmt-main{padding:18px}
  .mgmt-title{font-size:1.7rem}
  .mgmt-kpis{grid-template-columns:1fr}
}


.mgmt-overlay{display:none}
.mgmt-menu-toggle{
  display:none; border:1px solid var(--mg-border); background:var(--mg-panel); color:var(--mg-text);
  width:46px; height:46px; border-radius:14px; box-shadow:var(--mg-shadow); cursor:pointer;
}
.mgmt-userline{display:flex;gap:10px;align-items:center}
.mgmt-avatar--sm{width:38px;height:38px;border-radius:12px;object-fit:cover}
.mgmt-inline-forms{display:flex;flex-wrap:wrap;gap:8px}
.mgmt-inline-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mgmt-inline-form select,.mgmt-inline-form input[type="number"]{min-width:110px}
.mgmt-table-wrap{overflow:auto}
.mgmt-image-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.mgmt-image-card{
  background:var(--mg-panel); border:1px solid var(--mg-border); border-radius:20px; overflow:hidden; box-shadow:var(--mg-shadow);
}
.mgmt-image-card__banner{
  height:130px; background-size:cover; background-position:center; position:relative;
  background-color:var(--mg-panel-2); border-bottom:1px solid var(--mg-border);
  display:flex; align-items:center; justify-content:center; color:var(--mg-muted); font-weight:700;
}
.mgmt-image-card__banner.is-empty{
  background-image:linear-gradient(135deg, rgba(255,255,255,.03), rgba(0,0,0,.04));
}
.mgmt-image-card__body{padding:16px}
.mgmt-image-card__head{display:flex;align-items:center;gap:12px;margin-top:-46px;position:relative}
.mgmt-image-card__avatar{
  width:76px; height:76px; border-radius:22px; background:var(--mg-panel); border:4px solid var(--mg-panel);
  box-shadow:var(--mg-shadow); overflow:hidden; display:grid; place-items:center; color:var(--mg-muted)
}
.mgmt-image-card__avatar img{width:100%;height:100%;object-fit:cover}
.mgmt-upload-tags{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.mgmt-image-card__actions,.mgmt-image-card__footer{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.mgmt-stats--compact .mgmt-stat{min-height:unset}
@media (max-width: 1200px){.mgmt-image-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 980px){
  .mgmt-shell{grid-template-columns:minmax(0,1fr)}
  .mgmt-menu-toggle{display:inline-grid;place-items:center}
  .mgmt-side{
    position:fixed; left:0; top:0; bottom:0; width:290px; z-index:40; transform:translateX(-104%);
    transition:transform .22s ease; height:auto;
  }
  .mgmt-main{padding:18px}
  body.mgmt-menu-open .mgmt-side{transform:translateX(0)}
  .mgmt-overlay{
    position:fixed; inset:0; background:rgba(0,0,0,.38); z-index:30;
  }
  body.mgmt-menu-open .mgmt-overlay{display:block}
  .mgmt-topbar{align-items:center}
  .mgmt-userchip{min-width:unset;width:100%}
}
@media (max-width: 760px){
  .mgmt-image-grid{grid-template-columns:1fr}
  .mgmt-topbar{gap:12px}
  .mgmt-title{font-size:1.65rem}
}


.mgmt-shell{display:grid;grid-template-columns:280px minmax(0,1fr);min-height:100vh;align-items:start}
.mgmt-side{margin:0}
.mgmt-main{padding:28px 28px 36px 28px}
.mgmt-topbar{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(220px,320px);align-items:start;gap:18px;margin-bottom:22px}
.mgmt-titlewrap{min-width:0}
.mgmt-menu-toggle{display:none;border:1px solid var(--mg-border);background:var(--mg-panel);color:var(--mg-text);width:46px;height:46px;border-radius:14px;box-shadow:var(--mg-shadow);cursor:pointer}
.mgmt-overlay{display:none}
.mgmt-userchip{justify-self:end}
.mgmt-statrow{display:flex;flex-wrap:wrap;gap:10px;margin:10px 0 18px}
.mgmt-statpill{padding:10px 12px;border:1px solid var(--mg-border);background:var(--mg-panel-2);border-radius:999px;font-weight:700}
.mgmt-image-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.mgmt-image-card{background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:18px;box-shadow:var(--mg-shadow);overflow:hidden}
.mgmt-image-card__banner{height:86px;background-size:cover;background-position:center;background-color:var(--mg-panel-2);display:flex;align-items:center;justify-content:center;color:var(--mg-muted);font-weight:700;border-bottom:1px solid var(--mg-border)}
.mgmt-image-card__banner.is-empty{background-image:none}
.mgmt-image-card__body{padding:14px}
.mgmt-image-card__head{display:flex;gap:10px;align-items:center;margin-top:-34px}
.mgmt-image-card__avatar{width:66px;height:66px;border-radius:18px;background:var(--mg-panel);border:3px solid var(--mg-panel);box-shadow:var(--mg-shadow);overflow:hidden;display:grid;place-items:center}
.mgmt-image-card__avatar img{width:100%;height:100%;object-fit:cover}
.mgmt-image-card__meta{min-width:0;flex:1}
.mgmt-image-card__meta strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mgmt-upload-tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.mgmt-image-card__footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px}
.mgmt-iconbtn{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:12px;border:1px solid var(--mg-border);background:var(--mg-panel-2);color:var(--mg-text);text-decoration:none;cursor:pointer}
.mgmt-pop{position:relative}
.mgmt-pop > summary{list-style:none}
.mgmt-pop > summary::-webkit-details-marker{display:none}
.mgmt-pop[open] .mgmt-pop__panel{display:block}
.mgmt-pop__panel{display:none;position:absolute;right:0;top:44px;z-index:20;min-width:250px;background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:16px;box-shadow:var(--mg-shadow);padding:12px}
.mgmt-pop__panel h4{margin:0 0 10px}
.mgmt-pop__panel .mgmt-inline-form{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin-bottom:10px}
.mgmt-pop__panel .mgmt-inline-form:last-child{margin-bottom:0}
.mgmt-datefilters{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.mgmt-datefilters input,.mgmt-datefilters select{min-width:140px}
.mgmt-table-wrap{overflow:auto}
@media (max-width: 980px){
  .mgmt-main{padding:18px}
  .mgmt-topbar{grid-template-columns:auto 1fr;gap:12px}
  .mgmt-userchip{grid-column:1 / -1;justify-self:stretch}
  .mgmt-menu-toggle{display:inline-grid}
  .mgmt-side{position:fixed;left:0;top:0;bottom:0;width:286px;z-index:50;transform:translateX(-104%);transition:transform .22s ease;height:auto}
  body.mgmt-menu-open .mgmt-side{transform:translateX(0)}
  .mgmt-overlay{position:fixed;inset:0;background:rgba(0,0,0,.38);z-index:40}
  body.mgmt-menu-open .mgmt-overlay{display:block}
}
@media (max-width: 700px){
  .mgmt-image-grid{grid-template-columns:1fr}
  .mgmt-title{font-size:1.7rem}
}


/* v6 responsive and popover fixes */
.mgmt-topbar{grid-template-columns:auto minmax(0,1fr) auto;align-items:start}
.mgmt-userchip{justify-self:end;margin-left:auto;max-width:340px;width:100%}
.mgmt-card,.mgmt-image-card{overflow:visible}
.mgmt-image-card__banner{border-radius:18px 18px 0 0}
.mgmt-pop__panel{width:min(320px,calc(100vw - 32px));max-width:calc(100vw - 32px)}
.mgmt-datefilters input,.mgmt-datefilters select,.mgmt-datefilters .mgmt-btn{max-width:100%}
@media (max-width: 980px){
  .mgmt-shell{grid-template-columns:minmax(0,1fr)!important}
  .mgmt-topbar{grid-template-columns:auto minmax(0,1fr);align-items:start}
  .mgmt-titlewrap{grid-column:1 / -1}
  .mgmt-userchip{grid-column:1 / -1;justify-self:stretch;max-width:none;margin-left:0}
  .mgmt-card{padding:16px}
}
@media (max-width: 700px){
  .mgmt-main{padding:14px}
  .mgmt-section-head,.mgmt-datefilters,.mgmt-image-card__footer{display:flex;flex-direction:column;align-items:stretch}
  .mgmt-datefilters input,.mgmt-datefilters select,.mgmt-datefilters .mgmt-btn,.mgmt-image-card__footer .mgmt-btn{width:100%}
  .mgmt-statrow{gap:8px}
  .mgmt-pop{align-self:flex-end}
  .mgmt-pop__panel{right:0;left:auto;top:46px}
}


/* v7 compact user actions */
.mgmt-user-actions{display:grid;gap:8px;min-width:280px}
.mgmt-inline-form--compact{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.mgmt-inline-form--compact select,.mgmt-inline-form--compact input[type="number"]{width:100%;min-width:0;padding:8px 10px;border-radius:12px;border:1px solid var(--mg-border);background:var(--mg-panel-2);color:var(--mg-text)}
.mgmt-inline-form--compact .mgmt-btn{padding:8px 12px;justify-content:center}
.mgmt-user-actions__links{display:flex;gap:8px;flex-wrap:wrap}
.mgmt-table td{padding-top:10px;padding-bottom:10px}
.mgmt-userline{align-items:flex-start}
@media (max-width: 900px){
  .mgmt-user-actions{min-width:240px}
}
@media (max-width: 700px){
  .mgmt-inline-form--compact{grid-template-columns:1fr}
  .mgmt-user-actions__links{flex-direction:column}
  .mgmt-user-actions__links .mgmt-btn{width:100%;justify-content:center}
}

.mgmt-warn-summary{display:inline-flex;align-items:center;justify-content:center;flex-direction:row;flex-wrap:nowrap;gap:.35rem;width:auto;min-width:38px;padding:0 .65rem;white-space:nowrap}
.mgmt-warning-count{display:inline-flex;align-items:center;justify-content:center;min-width:1.35rem;height:1.35rem;padding:0 .35rem;border-radius:999px;background:rgba(185,28,28,.12);color:#b91c1c;font-size:.78rem;font-weight:800;line-height:1}
[data-theme="dark"] .mgmt-warning-count{background:rgba(248,113,113,.18);color:#fca5a5}

.mgmt-brand__logo i,.mgmt-login-brand__mark i{color:#fff!important;--fa-primary-color:#fff!important;--fa-secondary-color:#fff!important;--fa-secondary-opacity:1!important}
.mgmt-actions-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

/* v9 compact user-management actions + scroll to top */
.mgmt-user-action-panel{position:relative;display:inline-block;width:100%;max-width:170px}
.mgmt-user-action-panel > summary{list-style:none;justify-content:center;width:100%;white-space:nowrap}
.mgmt-user-action-panel > summary::-webkit-details-marker{display:none}
.mgmt-user-action-panel[open] > summary{background:var(--mg-accent);color:#fff}
.mgmt-user-action-panel .mgmt-user-actions{position:absolute;right:0;top:calc(100% + 8px);z-index:25;width:min(330px,calc(100vw - 36px));min-width:min(330px,calc(100vw - 36px));padding:12px;background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:18px;box-shadow:var(--mg-shadow)}
.mgmt-table tbody tr{position:relative}
.mgmt-table td{vertical-align:middle}
.mgmt-scrolltop{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom, 0px));z-index:70;width:46px;height:46px;border-radius:999px;border:1px solid var(--mg-border);background:var(--mg-accent);color:#fff;box-shadow:var(--mg-shadow);display:grid;place-items:center;cursor:pointer;opacity:0;pointer-events:none;transform:translateY(10px);transition:opacity .2s ease,transform .2s ease,background .2s ease}
.mgmt-scrolltop.is-visible{opacity:1;pointer-events:auto;transform:translateY(0)}
.mgmt-scrolltop:hover{background:var(--mg-accent-2)}
@media (max-width: 760px){
  .mgmt-user-action-panel{max-width:none;width:100%}
  .mgmt-user-action-panel .mgmt-user-actions{position:static;width:100%;min-width:0;margin-top:8px;box-shadow:none}
  .mgmt-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .mgmt-scrolltop{right:14px;bottom:calc(14px + env(safe-area-inset-bottom, 0px));width:44px;height:44px}
}

/* v10 sortable, paginated user-management table */
.mgmt-sort-link{display:inline-flex;align-items:center;gap:.35rem;color:inherit;text-decoration:none;white-space:nowrap}
.mgmt-sort-link:hover{color:var(--mg-accent)}
.mgmt-sort-icon{font-size:.78rem;opacity:.72}
.mgmt-user-name-status{display:inline-flex;align-items:center;gap:.42rem;line-height:1.25;flex-wrap:wrap}
.mgmt-verify-icon{display:inline-flex;align-items:center;justify-content:center;font-size:.98rem;line-height:1}
.mgmt-verify-icon--ok{color:#15803d}
.mgmt-verify-icon--no{color:#b91c1c}
.mgmt-pagination{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid var(--mg-border)}
.mgmt-pagination__status{font-weight:800;color:var(--mg-muted);font-size:.92rem}
@media (max-width: 760px){
  .mgmt-sort-link{white-space:normal}
  .mgmt-pagination{align-items:stretch}
  .mgmt-pagination .mgmt-btn{flex:1 1 120px;justify-content:center}
  .mgmt-pagination__status{flex:1 0 100%;text-align:center;order:-1}
}

.mgmt-form-field{display:flex;flex-direction:column;gap:6px;font-weight:800}
.mgmt-form-field span{font-size:.9rem;color:var(--mg-muted)}
.mgmt-form-field--button{justify-content:flex-end}
.span-12{grid-column:span 12}.span-10{grid-column:span 10}.span-8{grid-column:span 8}.span-6{grid-column:span 6}.span-4{grid-column:span 4}.span-3{grid-column:span 3}.span-2{grid-column:span 2}
.mgmt-note-box{border:1px solid var(--mg-border);border-radius:14px;background:var(--mg-panel-2);padding:10px}
.mgmt-note-box > summary{cursor:pointer;font-weight:800;list-style:none;display:flex;align-items:center;gap:8px}
.mgmt-note-box > summary::-webkit-details-marker{display:none}
.mgmt-note-list{display:grid;gap:8px;margin:10px 0}
.mgmt-note-item{padding:9px;border-radius:12px;background:var(--mg-panel);border:1px solid var(--mg-border);font-size:.92rem}
.mgmt-note-form{display:grid;gap:8px;margin-top:10px}
.mgmt-textarea--mini{min-height:76px;padding:9px;font-size:.92rem}
@media (max-width:820px){.span-10,.span-8,.span-6,.span-4,.span-3,.span-2{grid-column:span 12}.mgmt-form-field--button .mgmt-btn{width:100%;justify-content:center}}

.mgmt-tabs{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.mgmt-tab{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--mg-border);border-radius:999px;padding:9px 13px;text-decoration:none;color:var(--mg-text);font-weight:800;background:var(--mg-card)}
.mgmt-tab.is-active{background:var(--mg-primary);border-color:var(--mg-primary);color:#fff}
.mgmt-deleted-note{border:1px solid var(--mg-danger-bg);background:var(--mg-danger-bg);color:var(--mg-danger);border-radius:14px;padding:10px;font-size:.86rem;font-weight:700;line-height:1.35}
.mgmt-danger-zone{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--mg-danger-bg);background:var(--mg-danger-bg);border-radius:18px;padding:14px;margin:0 0 16px}
@media (max-width:700px){.mgmt-danger-zone{align-items:stretch;flex-direction:column}.mgmt-tabs,.mgmt-search{width:100%}.mgmt-tab{flex:1 1 auto;justify-content:center}}

/* Backup, maintenance and health checks */
.mgmt-health-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.mgmt-health{display:flex;gap:12px;align-items:flex-start;border:1px solid var(--mg-border);border-radius:16px;padding:14px;background:#fff}
.mgmt-health__icon{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;flex:0 0 auto;background:rgba(11,92,171,.1);color:var(--mg-accent)}
.mgmt-health--ok .mgmt-health__icon{background:rgba(22,163,74,.12);color:#15803d}
.mgmt-health--warn .mgmt-health__icon{background:rgba(245,158,11,.14);color:#b45309}
.mgmt-health--danger .mgmt-health__icon{background:rgba(220,38,38,.12);color:#b91c1c}
.mgmt-actions-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.mgmt-actions-inline form{margin:0}
.mgmt-table code,.mgmt-help code{background:rgba(15,23,42,.06);border:1px solid var(--mg-border);padding:2px 6px;border-radius:8px}
@media (max-width:760px){.mgmt-health-grid{grid-template-columns:1fr}.mgmt-actions-inline .mgmt-btn{width:100%;justify-content:center}.mgmt-actions-inline form{width:100%}}

/* Backup & Health layout fix */
.mgmt-grid > .mgmt-card{min-width:0;}
.mgmt-maintenance-grid{display:grid;grid-template-columns:minmax(0,7fr) minmax(280px,5fr);gap:18px;align-items:start;}
.mgmt-maintenance-grid .mgmt-card{min-width:0;}
.mgmt-actions-inline{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
@media (max-width:1000px){
  .mgmt-maintenance-grid{grid-template-columns:1fr;}
}
@media (max-width:760px){
  .mgmt-span-9,.mgmt-span-8,.mgmt-span-7,.mgmt-span-6,.mgmt-span-5,.mgmt-span-4,.mgmt-span-3{grid-column:span 12!important;}
}

/* Management 2FA settings */
.mgmt-grid--two{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.mgmt-form-stack{display:grid;gap:10px;align-content:start}
.mgmt-input{width:100%;box-sizing:border-box;background:var(--mg-panel-2);color:var(--mg-text);border:1px solid var(--mg-border);border-radius:14px;padding:11px 12px}
.mgmt-qr-box{display:inline-grid;place-items:center;background:#fff;border:1px solid var(--mg-border);border-radius:18px;padding:14px;box-shadow:var(--mg-shadow)}
.mgmt-qr-box img{display:block;width:220px;height:220px;max-width:100%}
.mgmt-recovery-codes{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin-top:12px}
.mgmt-recovery-codes code{display:block;background:var(--mg-panel-2);border:1px solid var(--mg-border);border-radius:12px;padding:10px 12px;font-weight:800;letter-spacing:.04em;text-align:center}
.mgmt-pill--ok{background:rgba(21,128,61,.12);color:#166534}
.mgmt-pill--warn{background:rgba(220,38,38,.12);color:#991b1b}
@media (max-width: 760px){.mgmt-grid--two{grid-template-columns:1fr}.mgmt-row{align-items:flex-start}.mgmt-actions{width:100%}.mgmt-actions .mgmt-btn{justify-content:center}}

/* Cookie pop-up management */
.mgmt-col-2{grid-column:span 2}
.cookie-choice-editor,.content-section-editor{
  border:1px solid var(--mg-border);
  border-radius:16px;
  padding:14px;
  margin-bottom:12px;
  background:var(--mg-panel-2);
}
.content-section-editor__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.mgmt-check{display:inline-flex;align-items:center;gap:8px;font-weight:700;color:var(--mg-text)}
.mgmt-subtitle{margin:6px 0 0;font-size:1.05rem;color:var(--mg-text)}
@media (max-width:820px){.mgmt-col-2,.mgmt-col-3,.mgmt-col-4,.mgmt-col-6,.mgmt-col-8{grid-column:span 12}}

/* Online members / live activity */
.mgmt-kpi__value--small{font-size:1.55rem}
.mgmt-online-status{display:inline-flex;align-items:center;gap:8px;font-weight:800;border-radius:999px;padding:6px 10px;background:var(--mg-panel-2);border:1px solid var(--mg-border)}
.mgmt-online-dot{width:10px;height:10px;border-radius:999px;background:var(--mg-muted);box-shadow:0 0 0 3px rgba(101,117,139,.12)}
.mgmt-online-status.is-online{color:var(--mg-success);background:var(--mg-success-bg)}
.mgmt-online-status.is-online .mgmt-online-dot{background:var(--mg-success);box-shadow:0 0 0 3px rgba(6,118,71,.14)}
.mgmt-online-status.is-recent{color:var(--mg-warning);background:var(--mg-warning-bg)}
.mgmt-online-status.is-recent .mgmt-online-dot{background:var(--mg-warning);box-shadow:0 0 0 3px rgba(181,71,8,.14)}
.mgmt-online-table td:nth-child(4){min-width:220px}
@media (max-width: 760px){.mgmt-online-table th:nth-child(5),.mgmt-online-table td:nth-child(5){display:none}.mgmt-kpi__value--small{font-size:1.25rem}}

/* Management mail shortcut / notifications */
.mgmt-top-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.mgmt-mail-link{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:46px;padding:10px 14px;border-radius:16px;border:1px solid var(--mg-border);background:var(--mg-panel);box-shadow:var(--mg-shadow);color:var(--mg-text);text-decoration:none;font-weight:800}
.mgmt-mail-link:hover{background:var(--mg-panel-2)}
.mgmt-mail-link.has-unread{border-color:rgba(11,92,171,.35)}
.mgmt-mail-badge{position:absolute;top:-7px;right:-7px;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--mg-danger);color:#fff;font-size:.78rem;display:inline-flex;align-items:center;justify-content:center;border:2px solid var(--mg-panel);line-height:1}
.mgmt-mail-badge.is-hidden{display:none}
.mgmt-mail-toast{position:fixed;right:22px;bottom:22px;z-index:1200;display:flex;align-items:center;gap:12px;max-width:min(420px,calc(100vw - 32px));padding:14px 16px;border-radius:18px;background:var(--mg-panel);color:var(--mg-text);border:1px solid var(--mg-border);box-shadow:0 18px 45px rgba(15,23,42,.18)}
.mgmt-mail-toast a{font-weight:800;color:var(--mg-accent);text-decoration:none;white-space:nowrap}
.mgmt-mail-toast button{border:0;background:transparent;color:var(--mg-muted);font-size:1.35rem;line-height:1;cursor:pointer;padding:0 2px}

/* Compact Online Members summary cards */
.mgmt-online-kpis{gap:10px}
.mgmt-online-kpis .mgmt-kpi{padding:12px 14px;border-radius:16px}
.mgmt-online-kpis .mgmt-kpi__label{font-size:.86rem;margin-bottom:5px}
.mgmt-online-kpis .mgmt-kpi__value{font-size:1.55rem}
.mgmt-online-kpis .mgmt-kpi__value--small{font-size:1.35rem}
@media (max-width: 760px){
  .mgmt-online-kpis{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px}
  .mgmt-online-kpis .mgmt-span-4{grid-column:span 1!important}
  .mgmt-online-kpis .mgmt-kpi{padding:10px 8px;border-radius:14px;min-width:0}
  .mgmt-online-kpis .mgmt-kpi__label{font-size:.74rem;line-height:1.15;margin-bottom:4px;white-space:normal}
  .mgmt-online-kpis .mgmt-kpi__value{font-size:1.35rem;line-height:1.05}
  .mgmt-online-kpis .mgmt-kpi__value--small{font-size:1.02rem;letter-spacing:-.02em}
  .mgmt-top-actions{width:100%;justify-content:space-between}
  .mgmt-userchip{min-width:0;flex:1}
}
@media (max-width: 430px){
  .mgmt-online-kpis .mgmt-kpi{padding:9px 7px}
  .mgmt-online-kpis .mgmt-kpi__value{font-size:1.18rem}
  .mgmt-online-kpis .mgmt-kpi__value--small{font-size:.92rem}
  .mgmt-mail-link span:not(.mgmt-mail-badge){display:none}
}

/* Online Members refresh / top-bar mail refinement */
.mgmt-userchip--with-mail{display:flex;align-items:center;justify-content:space-between;gap:12px;position:relative;padding-right:12px}
.mgmt-userchip__text{min-width:0}
.mgmt-userchip__text .mgmt-muted{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mgmt-mail-link--chip{width:40px;height:40px;min-height:40px;flex:0 0 40px;justify-content:center;padding:0;border-radius:14px;box-shadow:none;background:var(--mg-panel-2)}
.mgmt-mail-link--chip i{font-size:1.05rem}
.mgmt-mail-link--chip .mgmt-mail-badge{top:-6px;right:-6px}
@media (max-width:760px){
  .mgmt-top-actions{width:100%;justify-content:flex-end}
  .mgmt-userchip--with-mail{width:100%;max-width:none}
}
@media (max-width:430px){
  .mgmt-userchip--with-mail{padding:12px}
  .mgmt-mail-link--chip{width:36px;height:36px;min-height:36px;flex-basis:36px}
}

/* Privacy & Data / management tab active state contrast fix */
.mgmt-tab.is-active{
  background:linear-gradient(180deg,var(--mg-accent),var(--mg-accent-2));
  border-color:var(--mg-accent-2);
  color:#fff;
  box-shadow:0 8px 18px rgba(11,92,171,.18);
}
.mgmt-tab.is-active:hover,
.mgmt-tab.is-active:focus{
  color:#fff;
}
.mgmt-tab.is-active i,
.mgmt-tab.is-active .fa,
.mgmt-tab.is-active .fa-light,
.mgmt-tab.is-active .fa-solid{
  color:#fff;
}
.mgmt-tab.is-active .mgmt-badge{
  background:rgba(255,255,255,.2);
  border-color:rgba(255,255,255,.32);
  color:#fff;
}
html.dark .mgmt-tab.is-active,
html[data-theme="dark"] .mgmt-tab.is-active,
body.dark .mgmt-tab.is-active{
  background:linear-gradient(180deg,#0b5cab,#0a4a88);
  border-color:#0a4a88;
  color:#fff;
}

/* Announcement presets/history */
.mgmt-alert{padding:12px 14px;border-radius:14px;border:1px solid var(--mg-border);background:var(--mg-panel-2);color:var(--mg-text);margin:10px 0 16px}
.mgmt-alert--info{border-color:rgba(11,92,171,.25);background:rgba(11,92,171,.08)}
.mgmt-btn-secondary{background:var(--mg-panel-2);color:var(--mg-text);border-color:var(--mg-border)}
.mgmt-btn-secondary:hover{background:var(--mg-panel);color:var(--mg-text)}
.mgmt-btn-danger{background:#b42318;color:#fff;border-color:#b42318}
.mgmt-btn-danger:hover{background:#9f1f16;color:#fff;border-color:#9f1f16}
html.dark .mgmt-alert--info,html[data-theme="dark"] .mgmt-alert--info,body.dark .mgmt-alert--info{background:rgba(56,189,248,.1);border-color:rgba(56,189,248,.22)}

/* Shared management icon picker (Announcements + Pages/Policies) */
.mgmt-icon-picker{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
  padding:10px;
  border:1px solid rgba(100,116,139,.18);
  border-radius:14px;
  background:rgba(248,250,252,.82);
}
.mgmt-icon-picker--compact{max-height:none;overflow:visible}
.mgmt-icon-choice{
  width:34px;
  height:34px;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:inherit;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  cursor:pointer;
  text-align:center;
  font:inherit;
  transition:background .15s ease,border-color .15s ease,color .15s ease;
}
.mgmt-icon-choice i{font-size:1.05rem;line-height:1}
.mgmt-icon-choice:hover,
.mgmt-icon-choice:focus-visible,
.mgmt-icon-choice.is-selected{
  border-color:rgba(13,104,180,.55);
  background:rgba(13,104,180,.08);
  color:inherit;
  outline:none;
}
.mgmt-icon-choice .faq-icon-none{font-size:.72rem;font-weight:800;line-height:1;color:inherit}
html.dark .mgmt-icon-picker,
html[data-theme="dark"] .mgmt-icon-picker,
body.dark .mgmt-icon-picker{background:rgba(15,23,42,.28);border-color:rgba(148,163,184,.18)}
@media (max-width:760px){
  .mgmt-icon-picker{gap:6px;padding:10px}
  .mgmt-icon-choice{width:34px;height:34px;border-radius:10px}
}

/* Announcement select-style controls */
.mgmt-choice-dropdown{position:relative;margin-top:8px}
.mgmt-choice-trigger{
  width:100%;
  min-height:40px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 12px;
  border:1px solid var(--mg-border);
  border-radius:12px;
  background:var(--mg-panel-2);
  color:var(--mg-text);
  font:inherit;
  font-weight:700;
  text-align:left;
  cursor:pointer;
}
.mgmt-choice-trigger:hover,.mgmt-choice-trigger:focus-visible{border-color:rgba(13,104,180,.55);outline:none;box-shadow:0 0 0 3px rgba(13,104,180,.08)}
.mgmt-choice-trigger [data-choice-icon]{width:22px;text-align:center;font-size:1.05rem;color:var(--mg-accent,#0b5cab)}
.mgmt-choice-trigger [data-choice-label]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.mgmt-choice-caret{margin-left:auto;color:var(--mg-muted);font-size:.9rem;line-height:1}
.mgmt-choice-menu{
  position:absolute;
  z-index:60;
  top:calc(100% + 6px);
  left:0;
  width:100%;
  max-height:280px;
  overflow:auto;
  padding:8px;
  border:1px solid var(--mg-border);
  border-radius:14px;
  background:var(--mg-panel);
  box-shadow:0 18px 45px rgba(15,23,42,.18);
  display:none;
}
.mgmt-choice-dropdown.is-open .mgmt-choice-menu{display:block}
.mgmt-choice-option{
  width:100%;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--mg-text);
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 10px;
  cursor:pointer;
  text-align:left;
  font:inherit;
}
.mgmt-choice-option:hover,.mgmt-choice-option:focus-visible,.mgmt-choice-option.is-selected{background:rgba(13,104,180,.1);outline:none}
.mgmt-choice-option strong{display:block;font-size:.94rem;line-height:1.15}
.mgmt-choice-option small{display:block;color:var(--mg-muted);font-size:.78rem;line-height:1.2;margin-top:2px}
.mgmt-style-swatch{width:28px;height:20px;border-radius:999px;border:1px solid rgba(15,23,42,.12);flex:0 0 auto;box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)}
.mgmt-style-swatch--maintenance{background:linear-gradient(135deg,#991b1b,#ef4444)}
.mgmt-style-swatch--info{background:linear-gradient(135deg,#0369a1,#38bdf8)}
.mgmt-style-swatch--warning{background:linear-gradient(135deg,#b45309,#fbbf24)}
.mgmt-style-option{min-height:54px}
.mgmt-choice-menu--icons{display:none;grid-template-columns:1fr;gap:4px;max-height:320px}
.mgmt-choice-dropdown.is-open .mgmt-choice-menu--icons{display:grid}
.mgmt-choice-option--icon{min-height:42px}
.mgmt-choice-option--icon i{width:24px;text-align:center;font-size:1.05rem;color:var(--mg-accent,#0b5cab)}
.mgmt-choice-option--icon span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.dark .mgmt-choice-trigger,
html[data-theme="dark"] .mgmt-choice-trigger,
body.dark .mgmt-choice-trigger{background:rgba(15,23,42,.55);border-color:rgba(148,163,184,.22)}
html.dark .mgmt-choice-menu,
html[data-theme="dark"] .mgmt-choice-menu,
body.dark .mgmt-choice-menu{background:#111827;border-color:rgba(148,163,184,.22);box-shadow:0 18px 45px rgba(0,0,0,.35)}
html.dark .mgmt-choice-option:hover,
html.dark .mgmt-choice-option:focus-visible,
html.dark .mgmt-choice-option.is-selected,
html[data-theme="dark"] .mgmt-choice-option:hover,
html[data-theme="dark"] .mgmt-choice-option:focus-visible,
html[data-theme="dark"] .mgmt-choice-option.is-selected,
body.dark .mgmt-choice-option:hover,
body.dark .mgmt-choice-option:focus-visible,
body.dark .mgmt-choice-option.is-selected{background:rgba(56,189,248,.12)}
@media (max-width:760px){
  .mgmt-choice-menu{position:static;margin-top:6px;box-shadow:none;max-height:240px}
}

/* Announcement history refinements */
.mgmt-btn--sm{
  padding:7px 10px;
  min-height:34px;
  border-radius:10px;
  font-size:.88rem;
  line-height:1;
}
.mgmt-actions-inline--compact{gap:6px;flex-wrap:nowrap}
.mgmt-actions-inline--compact form{margin:0}
.mgmt-ann-icon-cell{text-align:center;white-space:nowrap}
.mgmt-ann-icon-cell i{font-size:1.05rem;color:var(--mg-accent,#0b5cab)}
.mgmt-alert.is-hidden{display:none}
.mgmt-alert--error{border-color:rgba(180,35,24,.35);background:rgba(180,35,24,.08);color:var(--mg-text)}
@media (max-width:760px){
  .mgmt-actions-inline--compact{flex-wrap:wrap}
  .mgmt-actions-inline--compact .mgmt-btn{width:auto;justify-content:center}
  .mgmt-actions-inline--compact form{width:auto}
}

/* Global announcement current-state panel */
.mgmt-current-announcement{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--mgmt-border, #d9e2ef);
  background:rgba(6, 95, 170, .06);
  border-radius:16px;
  margin:12px 0 16px;
}
.mgmt-current-announcement.is-disabled{
  background:rgba(100, 116, 139, .08);
}
.mgmt-disable-current-form{
  margin:0;
  flex:0 0 auto;
}
@media (max-width: 700px){
  .mgmt-current-announcement{
    align-items:flex-start;
    flex-direction:column;
  }
}

/* Keep management links clean and remove default/browser underlines. */
a,
a:visited,
a:hover,
a:focus,
a:active {
  text-decoration: none !important;
}



/* Keep User Management action menus above the table/card instead of clipping inside the scroll wrapper. */
.mgmt-table-wrap:has(.mgmt-user-action-panel){overflow:visible;}
.mgmt-table tbody tr:has(.mgmt-user-action-panel[open]){z-index:80;}
.mgmt-user-action-panel .mgmt-user-actions{z-index:120;}
@media (max-width:760px){.mgmt-table-wrap:has(.mgmt-user-action-panel){overflow-x:auto;overflow-y:visible;}}

/* Dashboard KPI cards: keep mobile dashboard stats compact like the Online Members summary cards. */
@media (max-width:640px){
  .mgmt-dashboard-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .mgmt-dashboard-kpis .mgmt-kpi{
    padding:10px 12px;
    border-radius:16px;
  }
  .mgmt-dashboard-kpis .mgmt-kpi__label{
    font-size:.82rem;
    line-height:1.15;
    margin-bottom:5px;
  }
  .mgmt-dashboard-kpis .mgmt-kpi__value{
    font-size:1.55rem;
    line-height:1.05;
  }
}
@media (max-width:380px){
  .mgmt-dashboard-kpis{gap:8px}
  .mgmt-dashboard-kpis .mgmt-kpi{padding:9px 10px}
  .mgmt-dashboard-kpis .mgmt-kpi__value{font-size:1.35rem}
}

/* 2026-05-17 management redesign: sleeker site-management shell */
:root{
  --mg-bg:#f5f7fb;
  --mg-panel:#ffffff;
  --mg-panel-2:#f8fafc;
  --mg-card:#ffffff;
  --mg-text:#101828;
  --mg-muted:#667085;
  --mg-border:#e4e7ec;
  --mg-accent:#155eef;
  --mg-accent-2:#004eeb;
  --mg-primary:#155eef;
  --mg-side:#071426;
  --mg-side-2:#0b1f37;
  --mg-side-text:#eaf0f8;
  --mg-side-muted:#96a6ba;
  --mg-shadow:0 18px 45px rgba(16,24,40,.08);
  --mg-soft-shadow:0 6px 18px rgba(16,24,40,.06);
}
html.dark,html[data-theme="dark"],body.dark{
  --mg-bg:#08111f;
  --mg-panel:#101c2e;
  --mg-panel-2:#14233a;
  --mg-card:#101c2e;
  --mg-text:#f3f8ff;
  --mg-muted:#a9b8cd;
  --mg-border:#223756;
  --mg-accent:#75adff;
  --mg-accent-2:#5599ff;
  --mg-primary:#5599ff;
  --mg-side:#050b14;
  --mg-side-2:#071426;
  --mg-side-text:#eef6ff;
  --mg-side-muted:#9eb0c8;
}
body.mgmt-body{background:var(--mg-bg);font-size:15px;line-height:1.45}
.mgmt-shell{grid-template-columns:272px minmax(0,1fr)!important;align-items:start;background:var(--mg-bg)}
.mgmt-side{background:linear-gradient(180deg,var(--mg-side),var(--mg-side-2));border-right:0;padding:22px 14px;color:var(--mg-side-text);box-shadow:6px 0 24px rgba(5,12,24,.12)}
.mgmt-brand{margin:0 8px 24px;color:#fff;font-size:1.25rem;gap:11px}
.mgmt-brand__logo{width:42px;height:42px;border-radius:13px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);box-shadow:none}
.mgmt-brand__text{line-height:1.12}.mgmt-brand .mgmt-muted{color:var(--mg-side-muted)}
.mgmt-nav-group{margin:0 0 18px}.mgmt-nav-label{color:var(--mg-side-muted);margin:12px 12px 7px;font-size:.72rem;letter-spacing:.1em}
.mgmt-side a{color:var(--mg-side-text);border:1px solid transparent;border-radius:13px;padding:10px 12px;font-weight:700;gap:11px;margin-bottom:3px}
.mgmt-side a i{color:var(--mg-side-muted);width:20px}.mgmt-side a:hover{background:rgba(255,255,255,.07)}
.mgmt-side a.active{background:linear-gradient(90deg,rgba(21,94,239,.34),rgba(21,94,239,.16));border-color:rgba(117,173,255,.22);box-shadow:inset 3px 0 0 #75adff}.mgmt-side a.active i{color:#fff}
.mgmt-side__footer{margin-top:22px;padding:14px 8px 0;border-top:1px solid rgba(255,255,255,.1)}
.mgmt-side-logout{background:rgba(255,255,255,.06)!important;color:#fff!important}.mgmt-side-logout:hover{background:rgba(255,255,255,.1)!important}
.mgmt-main{padding:0 28px 36px!important;min-width:0}.mgmt-topbar{position:sticky;top:0;z-index:30;display:grid!important;grid-template-columns:auto minmax(190px,1fr) minmax(260px,520px) auto;align-items:center;gap:14px;margin:0 -28px 26px!important;padding:12px 28px;background:rgba(255,255,255,.88);border-bottom:1px solid var(--mg-border);backdrop-filter:blur(14px);box-shadow:0 1px 0 rgba(16,24,40,.02)}
html.dark .mgmt-topbar,html[data-theme="dark"] .mgmt-topbar{background:rgba(16,28,46,.9)}
.mgmt-breadcrumbs{display:flex;align-items:center;gap:8px;min-width:0;color:var(--mg-muted);font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mgmt-breadcrumbs a{color:var(--mg-muted);text-decoration:none}.mgmt-breadcrumbs a:hover{color:var(--mg-accent)}.mgmt-breadcrumbs__sep{opacity:.55}.mgmt-breadcrumbs span:last-child{color:var(--mg-text)}.mgmt-breadcrumbs__home{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:10px;background:rgba(79,70,229,.08);color:var(--mg-accent)!important;flex:0 0 auto}.mgmt-breadcrumbs__home:hover{background:rgba(79,70,229,.14)}.mgmt-breadcrumbs__home i{font-size:.95rem}.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.mgmt-global-search{height:42px;display:flex;align-items:center;gap:10px;background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:13px;padding:0 12px;box-shadow:var(--mg-soft-shadow)}
.mgmt-global-search i{color:var(--mg-muted)}.mgmt-global-search input{width:100%;border:0;outline:0;background:transparent;color:var(--mg-text);font:inherit}.mgmt-global-search input::placeholder{color:var(--mg-muted)}
.mgmt-top-actions{display:flex;align-items:center;gap:10px;justify-content:flex-end}.mgmt-mail-link{position:relative;display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--mg-border);border-radius:13px;background:var(--mg-panel);color:var(--mg-text);text-decoration:none;box-shadow:var(--mg-soft-shadow)}.mgmt-mail-link:hover{color:var(--mg-accent);border-color:rgba(21,94,239,.35)}.mgmt-mail-badge{position:absolute;right:-5px;top:-6px;min-width:19px;height:19px;border-radius:999px;background:#155eef;color:#fff;border:2px solid var(--mg-panel);font-size:.72rem;font-weight:900;display:grid;place-items:center;padding:0 5px}.mgmt-mail-badge.is-hidden{display:none}
.mgmt-user-menu{position:relative}.mgmt-user-menu summary{list-style:none;display:flex;align-items:center;gap:9px;min-height:42px;padding:5px 10px 5px 5px;border:1px solid var(--mg-border);border-radius:999px;background:var(--mg-panel);box-shadow:var(--mg-soft-shadow);cursor:pointer}.mgmt-user-menu summary::-webkit-details-marker{display:none}.mgmt-user-avatar{width:32px;height:32px;border-radius:999px;background:linear-gradient(135deg,#155eef,#6938ef);color:#fff;display:grid;place-items:center;font-weight:900;font-size:.78rem}.mgmt-user-menu__name{font-weight:800;max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mgmt-user-menu__panel{position:absolute;right:0;top:calc(100% + 10px);width:250px;background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:18px;box-shadow:var(--mg-shadow);padding:12px;display:grid;gap:6px}.mgmt-user-menu__panel span{color:var(--mg-muted);font-size:.87rem;border-bottom:1px solid var(--mg-border);padding-bottom:10px;margin-bottom:4px}.mgmt-user-menu__panel a{display:flex;align-items:center;gap:9px;padding:9px 10px;border-radius:12px;text-decoration:none;color:var(--mg-text);font-weight:800}.mgmt-user-menu__panel a:hover{background:var(--mg-panel-2)}.mgmt-user-menu__panel a.is-danger{color:var(--mg-danger)}
.mgmt-page-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin:0 0 18px}.mgmt-title{font-size:1.8rem;letter-spacing:-.03em;margin:0 0 4px}.mgmt-subtitle{font-size:.98rem;color:var(--mg-muted);max-width:920px}.mgmt-card{border-radius:18px;border:1px solid var(--mg-border);box-shadow:var(--mg-soft-shadow);background:var(--mg-panel);padding:18px}.mgmt-card h2{font-size:1.15rem}.mgmt-card h3{font-size:1.02rem}.mgmt-kpi{box-shadow:var(--mg-soft-shadow);border-radius:18px}.mgmt-table{font-size:.94rem}.mgmt-table th{background:var(--mg-panel-2);color:#475467;white-space:nowrap}.mgmt-table th:first-child{border-top-left-radius:12px}.mgmt-table th:last-child{border-top-right-radius:12px}.mgmt-table td{border-top:1px solid var(--mg-border)}.mgmt-field,.mgmt-textarea,.mgmt-search input,.mgmt-search select{background:var(--mg-panel);border-color:var(--mg-border);border-radius:12px;box-shadow:0 1px 2px rgba(16,24,40,.04)}.mgmt-textarea{min-height:84px}.mgmt-btn{background:var(--mg-accent);border:1px solid transparent;border-radius:12px;box-shadow:0 4px 12px rgba(21,94,239,.16)}.mgmt-btn--soft{background:#eef4ff;color:#155eef;border-color:#c7d7fe;box-shadow:none}.mgmt-btn--ghost{background:var(--mg-panel);box-shadow:none}.mgmt-pill{border:1px solid var(--mg-border);background:var(--mg-panel-2)}.mgmt-pill--ok,.mgmt-badge--ok{background:#ecfdf3;color:#067647;border-color:#abefc6}.mgmt-pill--warn,.mgmt-badge--warn{background:#fffaeb;color:#b54708;border-color:#fedf89}.mgmt-badge--danger{background:#fef3f2;color:#b42318;border-color:#fecdca}
.mgmt-tabs{display:flex;align-items:center;gap:4px;flex-wrap:wrap;background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:15px;padding:5px;box-shadow:var(--mg-soft-shadow)}.mgmt-tab{border:0;background:transparent;border-radius:11px;color:var(--mg-muted);padding:9px 12px}.mgmt-tab.active,.mgmt-tab.is-active{background:#eef4ff;color:#155eef;box-shadow:inset 0 0 0 1px #c7d7fe}.mgmt-tab:hover{color:var(--mg-accent);background:var(--mg-panel-2)}
.mgmt-plan-hero{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}.mgmt-plan-card{padding:16px;border:1px solid var(--mg-border);border-radius:18px;background:var(--mg-panel);box-shadow:var(--mg-soft-shadow);display:flex;align-items:center;gap:13px}.mgmt-plan-card__icon{width:46px;height:46px;border-radius:15px;display:grid;place-items:center;background:#eef4ff;color:#155eef;font-size:1.2rem}.mgmt-plan-card__value{font-size:1.55rem;font-weight:900;line-height:1}.mgmt-plan-card__label{color:var(--mg-muted);font-weight:700;font-size:.9rem}.mgmt-preview-matrix{font-size:.86rem}.mgmt-preview-matrix td,.mgmt-preview-matrix th{text-align:center}.mgmt-preview-matrix td:first-child,.mgmt-preview-matrix th:first-child{text-align:left}.mgmt-check{color:#067647}.mgmt-dash{color:var(--mg-muted)}.mgmt-split{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px}.mgmt-table-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.mgmt-quick-form{background:var(--mg-panel-2);border:1px dashed var(--mg-border);border-radius:16px;padding:14px;margin-top:16px}
@media (max-width:1180px){.mgmt-shell{grid-template-columns:248px minmax(0,1fr)!important}.mgmt-plan-hero{grid-template-columns:repeat(2,minmax(0,1fr))}.mgmt-split{grid-template-columns:1fr}.mgmt-topbar{grid-template-columns:auto minmax(0,1fr) auto}.mgmt-global-search{grid-column:1 / -1;order:3}.mgmt-top-actions{grid-column:auto}}
@media (max-width:980px){.mgmt-shell{grid-template-columns:1fr!important}.mgmt-main{padding:0 16px 28px!important}.mgmt-topbar{margin:0 -16px 20px!important;padding:10px 16px;grid-template-columns:auto 1fr auto}.mgmt-menu-toggle{display:inline-grid!important;box-shadow:none}.mgmt-side{width:290px!important;position:fixed!important;height:100vh!important;z-index:50;transform:translateX(-104%);transition:transform .22s ease}.mgmt-breadcrumbs{font-size:.9rem}.mgmt-user-menu__name{display:none}body.mgmt-menu-open .mgmt-side{transform:translateX(0)}}
@media (max-width:700px){.mgmt-page-head{margin-bottom:14px}.mgmt-title{font-size:1.45rem}.mgmt-plan-hero{grid-template-columns:1fr}.mgmt-card{padding:14px;border-radius:16px}.mgmt-topbar{gap:8px}.mgmt-global-search{height:40px}.mgmt-tabs{overflow:auto;flex-wrap:nowrap}.mgmt-tab{white-space:nowrap}.mgmt-top-actions{gap:7px}.mgmt-mail-link{width:40px;height:40px}.mgmt-user-menu summary{padding:4px}.mgmt-user-menu__panel{right:-2px;width:min(250px,calc(100vw - 24px))}.mgmt-table-wrap{border:1px solid var(--mg-border);border-radius:14px}.mgmt-form-grid{grid-template-columns:1fr}.mgmt-col-12,.mgmt-col-8,.mgmt-col-6,.mgmt-col-4,.mgmt-col-3{grid-column:span 1!important}}

/* Stage 3 Plans & Features management */
.mgmt-stage3-notice code {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .06);
  color: var(--mgmt-text, #0f172a);
  white-space: nowrap;
}
.mgmt-plan-matrix th:not(:first-child),
.mgmt-plan-matrix td:not(:first-child) {
  min-width: 230px;
  vertical-align: top;
}
.mgmt-matrix-cell .mgmt-field {
  min-width: 190px;
}
@media (max-width: 760px) {
  .mgmt-stage3-notice .mgmt-table-toolbar {
    align-items: flex-start;
  }
  .mgmt-stage3-notice code {
    white-space: normal;
  }
  .mgmt-plan-matrix th:not(:first-child),
  .mgmt-plan-matrix td:not(:first-child) {
    min-width: 210px;
  }
}

/* Stage 4: neater Plans / Features / Versions / Add-ons management */
.mgmt-billing-workspace{display:grid;grid-template-columns:280px minmax(0,1fr);gap:18px;align-items:start}.mgmt-billing-main{display:grid;gap:18px}.mgmt-billing-guide{position:sticky;top:88px}.mgmt-guide-kicker{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:#155eef;font-weight:900;margin-bottom:6px}.mgmt-billing-guide p{color:var(--mg-muted);line-height:1.55;margin:8px 0 16px}.mgmt-guide-steps{display:grid;gap:8px}.mgmt-guide-steps a{display:flex;gap:10px;align-items:center;text-decoration:none;color:var(--mg-muted);font-weight:800;padding:10px 11px;border-radius:13px;border:1px solid transparent}.mgmt-guide-steps a span{width:24px;height:24px;border-radius:999px;display:grid;place-items:center;background:var(--mg-panel-2);color:#475467;font-size:.82rem}.mgmt-guide-steps a:hover,.mgmt-guide-steps a.is-active{background:#eef4ff;color:#155eef;border-color:#c7d7fe}.mgmt-guide-steps a.is-active span{background:#155eef;color:#fff}.mgmt-plan-editor-grid,.mgmt-category-grid,.mgmt-addon-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.mgmt-editor-card{border:1px solid var(--mg-border);background:var(--mg-panel);border-radius:18px;padding:15px;box-shadow:0 8px 24px rgba(16,24,40,.05);display:grid;gap:12px}.mgmt-editor-card__head{display:grid;grid-template-columns:46px minmax(0,1fr);gap:12px;align-items:start}.mgmt-editor-card__icon{width:46px;height:46px;border-radius:15px;background:#eef4ff;color:#155eef;display:grid;place-items:center;font-size:1.12rem}.mgmt-editor-card__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--mg-border);padding-top:10px}.mgmt-field--strong{font-weight:900;color:#101828}.mgmt-mini-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.mgmt-mini-grid--three{grid-template-columns:repeat(3,minmax(0,1fr))}.mgmt-switch{display:inline-flex;align-items:center;gap:8px;font-weight:800;color:#344054}.mgmt-switch input{width:18px;height:18px;accent-color:#155eef}.mgmt-savebar{display:flex;justify-content:flex-end;margin-top:16px;padding-top:14px;border-top:1px solid var(--mg-border)}.mgmt-feature-list{display:grid;gap:12px}.mgmt-feature-editor{display:grid;grid-template-columns:minmax(220px,1.35fr) minmax(130px,.8fr) minmax(150px,.8fr) minmax(140px,.8fr) 115px 88px;gap:10px;align-items:start;border:1px solid var(--mg-border);background:var(--mg-panel);border-radius:16px;padding:13px}.mgmt-feature-editor__wide{grid-column:span 3}.mgmt-feature-editor__status{display:flex;align-items:end;height:100%;padding-top:24px}.mgmt-version-stack{display:grid;gap:12px}.mgmt-version-group,.mgmt-matrix-group{border:1px solid var(--mg-border);border-radius:16px;background:var(--mg-panel);overflow:hidden}.mgmt-version-group summary,.mgmt-matrix-group summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;background:var(--mg-panel-2);font-weight:900}.mgmt-version-group summary small,.mgmt-matrix-group summary small{display:block;font-size:.78rem;color:var(--mg-muted);font-weight:700;margin-top:2px}.mgmt-version-row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(150px,.8fr) minmax(120px,.6fr) 90px;gap:10px;padding:13px 15px;border-top:1px solid var(--mg-border);align-items:start}.mgmt-version-row__desc{grid-column:span 3}.mgmt-version-row__status{display:flex;align-items:end;justify-content:flex-end;height:100%}.mgmt-empty-row{padding:14px 15px;color:var(--mg-muted);border-top:1px solid var(--mg-border)}.mgmt-matrix-board{display:grid;gap:14px}.mgmt-matrix-group .mgmt-table-wrap{border:0;border-radius:0}.mgmt-plan-matrix--clean th:first-child,.mgmt-plan-matrix--clean td:first-child{min-width:210px}.mgmt-plan-matrix--clean th:not(:first-child),.mgmt-plan-matrix--clean td:not(:first-child){min-width:210px}.mgmt-matrix-cell{background:linear-gradient(180deg,rgba(248,250,252,.65),rgba(255,255,255,.9))}.mgmt-matrix-cell .mgmt-label{margin-top:8px}.mgmt-matrix-cell .mgmt-label:first-child{margin-top:0}.mgmt-cell-extra{margin-top:8px}.mgmt-cell-extra summary{cursor:pointer;color:#155eef;font-weight:800;font-size:.86rem;margin-bottom:6px}.mgmt-category-card h3{margin:0;font-size:1.05rem}.mgmt-addon-card .mgmt-textarea,.mgmt-plan-editor-card .mgmt-textarea{min-height:72px}
@media (max-width:1280px){.mgmt-plan-editor-grid,.mgmt-category-grid,.mgmt-addon-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mgmt-feature-editor{grid-template-columns:repeat(3,minmax(0,1fr))}.mgmt-feature-editor__title,.mgmt-feature-editor__wide{grid-column:span 3}.mgmt-feature-editor__status{padding-top:0}}
@media (max-width:980px){.mgmt-billing-workspace{grid-template-columns:1fr}.mgmt-billing-guide{position:static}.mgmt-guide-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.mgmt-version-row{grid-template-columns:repeat(2,minmax(0,1fr))}.mgmt-version-row__desc{grid-column:span 2}.mgmt-version-row__status{justify-content:flex-start}}
@media (max-width:700px){.mgmt-plan-editor-grid,.mgmt-category-grid,.mgmt-addon-grid{grid-template-columns:1fr}.mgmt-guide-steps{grid-template-columns:1fr}.mgmt-mini-grid,.mgmt-mini-grid--three{grid-template-columns:1fr}.mgmt-feature-editor{grid-template-columns:1fr}.mgmt-feature-editor__title,.mgmt-feature-editor__wide{grid-column:span 1}.mgmt-version-row{grid-template-columns:1fr}.mgmt-version-row__desc{grid-column:span 1}.mgmt-savebar{justify-content:stretch}.mgmt-savebar .mgmt-btn{width:100%;justify-content:center}.mgmt-billing-guide{display:none}}

/* Stage 4b: plan lifecycle + compact matrix refinements */
.mgmt-btn--sm{min-height:34px;padding:7px 10px;border-radius:10px;font-size:.88rem;box-shadow:none}
.mgmt-plans-table td{vertical-align:middle}.mgmt-plans-table .mgmt-help{margin-top:3px}.mgmt-inline-edit-row[hidden],.mgmt-quick-form[hidden]{display:none!important}.mgmt-inline-edit-row>td{padding:0!important;background:var(--mg-panel-2)}.mgmt-inline-editor-panel{padding:16px;border-top:1px solid var(--mg-border);border-bottom:1px solid var(--mg-border);background:linear-gradient(180deg,rgba(248,250,252,.9),rgba(255,255,255,.95))}.mgmt-inline-warning{margin-top:14px;padding:11px 12px;border:1px solid #fedf89;border-radius:14px;background:#fffaeb;color:#93370d;font-weight:800;font-size:.9rem}.mgmt-inline-warning code{font-weight:900}.mgmt-table tr:hover td{background:rgba(21,94,239,.035)}.mgmt-inline-edit-row:hover td{background:var(--mg-panel-2)}.mgmt-table .mgmt-btn:hover,.mgmt-table a.mgmt-btn:hover{color:#fff;background:var(--mg-accent-2);border-color:var(--mg-accent-2)}.mgmt-table .mgmt-btn--soft:hover,.mgmt-table a.mgmt-btn--soft:hover{background:#dbeafe;color:#155eef;border-color:#b2ccff}.mgmt-btn[disabled],.mgmt-btn[aria-disabled="true"],a.mgmt-btn[aria-disabled="true"]{opacity:.55;cursor:not-allowed;filter:none}.mgmt-btn[disabled]:hover,.mgmt-btn[aria-disabled="true"]:hover,a.mgmt-btn[aria-disabled="true"]:hover{background:inherit;color:inherit;border-color:inherit}.mgmt-field--compact{min-width:118px!important;font-size:.88rem;padding:8px 9px}.mgmt-matrix-cell--compact{min-width:150px!important;vertical-align:top}.mgmt-matrix-cell--compact .mgmt-label{font-size:.78rem}.mgmt-cell-extra--compact{margin-top:7px}.mgmt-cell-extra--compact summary{display:inline-flex;align-items:center;gap:6px;color:#155eef;font-size:.82rem}.mgmt-cell-extra--compact[open]{padding:8px;margin-top:8px;border:1px dashed var(--mg-border);border-radius:12px;background:var(--mg-panel)}.mgmt-plan-matrix--clean th:not(:first-child),.mgmt-plan-matrix--clean td:not(:first-child){min-width:165px}.mgmt-plan-matrix--clean th:first-child,.mgmt-plan-matrix--clean td:first-child{min-width:190px}.mgmt-version-group summary small{color:var(--mg-muted)}
@media (max-width:760px){.mgmt-plans-table{min-width:860px}.mgmt-inline-editor-panel{padding:12px}.mgmt-plan-matrix--clean th:not(:first-child),.mgmt-plan-matrix--clean td:not(:first-child){min-width:155px}.mgmt-field--compact{min-width:105px!important}}

/* Stage 4c: neater catalogue tables + drag sorting */
.mgmt-admin-list td{vertical-align:middle}.mgmt-admin-list .mgmt-muted{margin-top:3px;font-size:.88rem}.mgmt-actions-cell{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.mgmt-inline-editor-row[hidden]{display:none!important}.mgmt-inline-editor-row>td{background:var(--mg-panel-2)!important;padding:0!important}.mgmt-inline-editor{padding:16px;background:linear-gradient(180deg,rgba(248,250,252,.92),rgba(255,255,255,.96));border-top:1px solid var(--mg-border);border-bottom:1px solid var(--mg-border)}.mgmt-drag-cell{width:38px;text-align:center}.mgmt-drag-handle{border:0;background:transparent;color:var(--mg-muted);cursor:grab;font-weight:900;letter-spacing:-.18em;padding:4px 8px;border-radius:9px}.mgmt-drag-handle:hover{background:#eef4ff;color:#155eef}.mgmt-sortable-row.is-dragging,.mgmt-sortable-section.is-dragging{opacity:.45}.mgmt-sortable-section{cursor:auto}.mgmt-matrix-group summary{justify-content:flex-start}.mgmt-matrix-group summary>span{flex:1}.mgmt-btn--danger{background:#d92d20!important;color:#fff!important;border-color:#d92d20!important}.mgmt-btn--danger:hover{background:#b42318!important;border-color:#b42318!important;color:#fff!important}.mgmt-version-group:not([open]){box-shadow:0 4px 14px rgba(16,24,40,.035)}.mgmt-matrix-board .mgmt-table th:first-child,.mgmt-matrix-board .mgmt-table td:first-child{min-width:44px!important;width:44px}.mgmt-matrix-board .mgmt-plan-matrix--clean th:nth-child(2),.mgmt-matrix-board .mgmt-plan-matrix--clean td:nth-child(2){min-width:190px}.mgmt-matrix-board .mgmt-plan-matrix--clean th:not(:first-child):not(:nth-child(2)),.mgmt-matrix-board .mgmt-plan-matrix--clean td:not(:first-child):not(:nth-child(2)){min-width:145px}.mgmt-matrix-board .mgmt-field--compact{min-width:116px!important}.mgmt-cell-extra--compact summary{white-space:nowrap}.mgmt-admin-list .mgmt-btn{box-shadow:none}.mgmt-admin-list .mgmt-btn--soft:hover{background:#eef4ff;color:#155eef;border-color:#b2ccff}.mgmt-admin-list tr:hover .mgmt-drag-handle{color:#155eef}
@media (max-width:760px){.mgmt-admin-list{min-width:880px}.mgmt-matrix-board .mgmt-plan-matrix--clean{min-width:850px}.mgmt-actions-cell{min-width:220px}.mgmt-inline-editor{padding:12px}}

/* Stage 4d: FAQ-style sort handles and compact archived ordering */
.mgmt-drag-cell{width:48px;text-align:center;white-space:nowrap;vertical-align:middle!important}
.mgmt-drag-handle{width:34px;height:34px;display:inline-grid;place-items:center;border:1px solid var(--mg-border)!important;background:#fff!important;color:#667085!important;border-radius:10px!important;cursor:grab;font-size:1rem;font-weight:800;letter-spacing:0;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.mgmt-drag-handle:hover,.mgmt-admin-list tr:hover .mgmt-drag-handle{background:#f8fbff!important;color:#155eef!important;border-color:#c7d7fe!important}
.mgmt-drag-handle:active{cursor:grabbing}
.mgmt-sortable-row.is-dragging,.mgmt-sortable-item.is-dragging,.mgmt-sortable-section.is-dragging{opacity:.45}
.mgmt-admin-list th:nth-child(1),.mgmt-admin-list td:nth-child(1){width:48px}
.mgmt-admin-list .mgmt-help{font-size:.82rem}
.mgmt-version-rows{display:grid;gap:0}
.mgmt-version-row{grid-template-columns:46px minmax(180px,1fr) minmax(150px,.8fr) minmax(120px,.6fr);align-items:start}
.mgmt-version-row__desc{grid-column:2 / span 3}
.mgmt-version-row__status{grid-column:2 / span 3;justify-content:flex-start;height:auto}
.mgmt-addon-card .mgmt-editor-card__head{grid-template-columns:38px 46px minmax(0,1fr)}
.mgmt-mini-grid--two{grid-template-columns:repeat(2,minmax(0,1fr))}
.mgmt-matrix-group:not([open]){box-shadow:0 4px 14px rgba(16,24,40,.035)}
.mgmt-matrix-group summary{min-height:48px}
@media (max-width:980px){.mgmt-version-row{grid-template-columns:46px 1fr}.mgmt-version-row__desc,.mgmt-version-row__status{grid-column:2}.mgmt-addon-card .mgmt-editor-card__head{grid-template-columns:38px minmax(0,1fr)}.mgmt-addon-card .mgmt-editor-card__icon{display:none}}
@media (max-width:700px){.mgmt-mini-grid--two{grid-template-columns:1fr}.mgmt-version-row{grid-template-columns:1fr}.mgmt-version-row__desc,.mgmt-version-row__status{grid-column:auto}.mgmt-version-row>.mgmt-drag-cell{justify-self:start}}


/* Stage 4e: restore sortable drag handles and fix row-hover/action-cell rendering */
.mgmt-admin-list tbody tr:hover > td,
.mgmt-plan-matrix tbody tr:hover > td{background:rgba(21,94,239,.035)!important}
.mgmt-admin-list tbody tr.mgmt-inline-editor-row:hover > td{background:var(--mg-panel-2)!important}
td.mgmt-actions-cell{display:table-cell!important;white-space:nowrap;vertical-align:middle!important;background:transparent}
td.mgmt-actions-cell .mgmt-btn,td.mgmt-actions-cell .mgmt-help{margin:3px 5px 3px 0}
.mgmt-drag-handle[draggable="true"]{-webkit-user-drag:element;user-select:none}
.mgmt-drag-handle span{pointer-events:none}
.mgmt-sortable-row.is-dragging > td,
.mgmt-sortable-item.is-dragging,
.mgmt-sortable-section.is-dragging{opacity:.45;background:#eef4ff!important}
.mgmt-matrix-group > summary .mgmt-drag-handle{flex:0 0 auto}

/* Stage 5: wider inner-page polish and responsive table behaviour */
.mgmt-card{
  overflow:hidden;
}
.mgmt-card > .mgmt-section-head:first-child{
  margin:-2px 0 16px;
}
.mgmt-card > .mgmt-section-head:first-child h2,
.mgmt-card > .mgmt-section-head:first-child h3{
  margin:0;
}
.mgmt-table-wrap{
  border:1px solid var(--mg-border);
  border-radius:16px;
  background:var(--mg-panel);
  box-shadow:0 8px 22px rgba(16,24,40,.035);
}
.mgmt-table-wrap .mgmt-table{
  margin:0;
}
.mgmt-table{
  border-collapse:separate;
  border-spacing:0;
}
.mgmt-table thead th{
  background:var(--mg-panel-2);
  border-top:0;
  border-bottom:1px solid var(--mg-border);
  color:#475467;
  font-size:.82rem;
  letter-spacing:.015em;
  text-transform:none;
}
html.dark .mgmt-table thead th,
html[data-theme="dark"] .mgmt-table thead th,
body.dark .mgmt-table thead th{color:var(--mg-muted)}
.mgmt-table tbody td{
  border-top:0;
  border-bottom:1px solid var(--mg-border);
  background:transparent;
}
.mgmt-table tbody tr:last-child td{border-bottom:0}
.mgmt-table tbody tr:hover > td{
  background:rgba(21,94,239,.04);
}
.mgmt-table tbody tr:has(.mgmt-inline-edit-row):hover > td,
.mgmt-inline-edit-row:hover > td{
  background:var(--mg-panel-2)!important;
}
.mgmt-table td:last-child,
.mgmt-table th:last-child{
  white-space:nowrap;
}
.mgmt-table td .mgmt-actions,
.mgmt-table td .mgmt-actions-inline,
.mgmt-actions-inline{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.mgmt-table td form{margin:0}
.mgmt-table td .mgmt-btn,
.mgmt-table td a.mgmt-btn{
  box-shadow:none;
}
.mgmt-table .mgmt-help{
  color:var(--mg-muted);
  font-size:.88rem;
  line-height:1.35;
}
.mgmt-table code,
.mgmt-code-pill{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:3px 8px;
  border-radius:8px;
  border:1px solid var(--mg-border);
  background:var(--mg-panel-2);
  color:var(--mg-text);
  font-size:.84rem;
}
.mgmt-search,
.mgmt-toolbar,
.mgmt-table-toolbar{
  align-items:center;
}
.mgmt-field:focus,
.mgmt-textarea:focus,
.mgmt-search input:focus,
.mgmt-search select:focus{
  outline:none;
  border-color:rgba(21,94,239,.48);
  box-shadow:0 0 0 3px rgba(21,94,239,.10);
}
.mgmt-btn,
.btn--primary,
.btn--secondary{
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.mgmt-btn:hover,
.btn--primary:hover,
.btn--secondary:hover{
  transform:translateY(-1px);
}
.mgmt-btn--ghost:hover,
.mgmt-btn--soft:hover{
  color:var(--mg-accent)!important;
}
.mgmt-btn--danger:hover{
  color:#fff!important;
}
.mgmt-badge,
.mgmt-pill{
  white-space:nowrap;
}
.mgmt-empty{
  border:1px dashed var(--mg-border);
}
.mgmt-list__item{
  border-color:var(--mg-border);
}
.mgmt-row{
  border-color:var(--mg-border);
}
.mgmt-drag-handle{
  cursor:grab;
}
.mgmt-drag-handle:active{
  cursor:grabbing;
}
.mgmt-sortable-row.is-dragging,
.mgmt-sortable-item.is-dragging,
.mgmt-sortable-section.is-dragging{
  opacity:.58;
}

@media (max-width: 760px){
  .mgmt-table-wrap{
    border:0;
    background:transparent;
    box-shadow:none;
    border-radius:0;
    overflow:visible;
  }
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table),
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) thead,
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) tbody,
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) tr,
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) th,
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) td{
    display:block;
    width:100%;
  }
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) thead{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
  }
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) tbody tr{
    margin:0 0 12px;
    border:1px solid var(--mg-border);
    border-radius:16px;
    background:var(--mg-panel);
    box-shadow:0 8px 22px rgba(16,24,40,.045);
    overflow:hidden;
  }
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) tbody td{
    display:grid;
    grid-template-columns:minmax(104px,38%) minmax(0,1fr);
    gap:10px;
    align-items:start;
    padding:10px 12px;
    border-bottom:1px solid var(--mg-border);
    white-space:normal;
  }
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) tbody td::before{
    content:attr(data-label);
    color:var(--mg-muted);
    font-weight:800;
    font-size:.82rem;
  }
  .mgmt-table.mgmt-table--enhanced:not(.mgmt-plan-matrix):not(.mgmt-drag-table):not(.mgmt-online-table):not(.mgmt-plans-table) tbody td:last-child{
    border-bottom:0;
  }
  .mgmt-table td:last-child,
  .mgmt-table th:last-child{
    white-space:normal;
  }
  .mgmt-table td .mgmt-actions,
  .mgmt-table td .mgmt-actions-inline,
  .mgmt-actions-inline{
    justify-content:flex-start;
  }
}

/* Stage 6: dashboard and section separation polish */
.mgmt-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  margin-bottom: 18px;
}
.mgmt-dashboard-hero__main,
.mgmt-dashboard-hero__side {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--mgmt-border, #e5e7eb);
  border-radius: 18px;
  box-shadow: var(--mgmt-shadow, 0 10px 30px rgba(15, 23, 42, .06));
  padding: 22px;
}
.mgmt-dashboard-hero__main h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.45rem, 2vw, 2rem);
}
.mgmt-dashboard-hero__main p {
  margin: 0;
  max-width: 720px;
  color: var(--mgmt-muted, #64748b);
}
.mgmt-eyebrow {
  color: var(--mgmt-primary, #2563eb);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mgmt-dashboard-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.mgmt-dashboard-hero__side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.mgmt-dashboard-date {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 800;
  padding: 6px 10px;
}
.mgmt-dashboard-kpis--modern {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.mgmt-dashboard-kpis--modern .mgmt-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.mgmt-dashboard-kpis--modern .mgmt-kpi:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .28);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .08);
}
.mgmt-kpi__icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #eef4ff;
  color: var(--mgmt-primary, #2563eb);
  flex: 0 0 auto;
}
.mgmt-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.mgmt-status-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--mgmt-border, #e5e7eb);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.mgmt-status-card:hover {
  background: #f8fbff;
  border-color: rgba(37, 99, 235, .25);
}
.mgmt-badge--neutral {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.mgmt-attention-list .mgmt-list__item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: inherit;
  text-decoration: none;
}
.mgmt-attention-list .mgmt-list__item:hover {
  background: #f8fbff;
}
.mgmt-attention-list .mgmt-list__item span {
  color: var(--mgmt-muted, #64748b);
  font-size: .9rem;
}
.mgmt-quick-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.mgmt-quick-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--mgmt-border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font-weight: 750;
  text-decoration: none;
}
.mgmt-quick-links a:hover {
  background: #f8fbff;
  border-color: rgba(37, 99, 235, .25);
  color: var(--mgmt-primary, #2563eb);
}
.mgmt-tabs--secondary {
  justify-content: flex-start;
  background: #fff;
}
.mgmt-dashboard-audit td,
.mgmt-dashboard-audit th {
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .mgmt-dashboard-hero,
  .mgmt-dashboard-kpis--modern,
  .mgmt-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .mgmt-dashboard-hero,
  .mgmt-dashboard-kpis--modern,
  .mgmt-status-grid {
    grid-template-columns: 1fr;
  }
  .mgmt-dashboard-hero__main,
  .mgmt-dashboard-hero__side {
    padding: 16px;
  }
}


/* Stage 7: dedicated billing/subscription pages */
.mgmt-stat-grid--compact{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}.mgmt-stat-card{background:var(--panel,#fff);border:1px solid var(--border,#d9dee7);border-radius:16px;padding:16px;box-shadow:0 10px 24px rgba(15,23,42,.05)}.mgmt-stat-card span{display:block;color:var(--muted,#687385);font-size:.82rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px}.mgmt-stat-card strong{display:block;font-size:1.45rem;color:var(--text,#111827)}.mgmt-tabs--anchor .mgmt-tab{border-radius:999px}.mgmt-inline-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.mgmt-action-stack{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.mgmt-row-details{display:inline-block}.mgmt-row-details summary{cursor:pointer;color:var(--accent,#2563eb);font-weight:700}.mgmt-row-details[open]{display:block;margin-top:8px}.mgmt-settings-disclosure>summary{display:flex;justify-content:space-between;gap:16px;align-items:center;cursor:pointer;list-style:none}.mgmt-settings-disclosure>summary::-webkit-details-marker{display:none}.mgmt-settings-disclosure>summary strong{display:block}.mgmt-settings-disclosure>summary small{display:block;color:var(--muted,#687385);font-weight:500;margin-top:3px}.mgmt-list-stack{display:grid;gap:10px}.mgmt-mini-record{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;border:1px solid var(--border,#d9dee7);border-radius:14px;padding:12px;background:rgba(255,255,255,.6)}.mgmt-mini-record__meta{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;color:var(--muted,#687385);font-size:.86rem}@media(max-width:760px){.mgmt-stat-grid--compact{grid-template-columns:repeat(2,minmax(0,1fr))}.mgmt-mini-record{display:block}.mgmt-mini-record__meta{justify-content:flex-start;margin-top:8px}.mgmt-action-stack{display:grid;align-items:stretch}.mgmt-inline-actions{align-items:stretch}}


/* Stage 8: billing section layout polish */
.mgmt-subpage-nav{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:-2px 0 16px;background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:16px;padding:6px;box-shadow:0 10px 28px rgba(16,24,40,.05)}
.mgmt-subpage-nav a{display:inline-flex;align-items:center;gap:8px;border-radius:12px;padding:9px 12px;text-decoration:none;color:var(--mg-muted);font-weight:850;border:1px solid transparent}
.mgmt-subpage-nav a:hover{background:var(--mg-panel-2);color:var(--mg-accent)}
.mgmt-subpage-nav a.is-active{background:#eef4ff;color:#155eef;border-color:#c7d7fe}
.mgmt-page-tools{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}
.mgmt-disclosure-card{padding:0;overflow:hidden}.mgmt-disclosure-card .mgmt-settings-disclosure>summary{padding:18px}.mgmt-disclosure-body{padding:0 18px 18px;margin-top:0!important}
.mgmt-subscription-list,.mgmt-request-list{display:grid;gap:10px}.mgmt-subscription-card,.mgmt-request-card{border:1px solid var(--mg-border);background:var(--mg-panel);border-radius:16px;padding:14px;box-shadow:0 8px 22px rgba(16,24,40,.04)}
.mgmt-subscription-card__main{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.mgmt-subscription-card__badges{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.mgmt-inline-editor{display:block;margin-top:10px}.mgmt-inline-editor>summary{display:inline-flex;align-items:center;gap:8px;color:#155eef;font-weight:850;cursor:pointer}.mgmt-inline-editor__body{margin-top:12px;padding:12px;border-radius:14px;background:var(--mg-panel-2);border:1px solid var(--mg-border)}
.mgmt-request-card__head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.mgmt-request-card__meta{display:flex;gap:12px;flex-wrap:wrap;color:var(--mg-muted);font-size:.88rem;margin-top:10px}.mgmt-request-card__meta span{display:inline-flex;gap:6px;align-items:center}.mgmt-request-card__message{margin-top:10px;padding:10px 12px;border-radius:12px;background:var(--mg-panel-2);color:var(--mg-text);line-height:1.45}
@media(max-width:760px){.mgmt-subpage-nav{overflow:auto;flex-wrap:nowrap}.mgmt-subpage-nav a{white-space:nowrap}.mgmt-subscription-card__main,.mgmt-request-card__head{display:grid}.mgmt-subscription-card__badges{justify-content:flex-start}.mgmt-page-tools .mgmt-btn{flex:1 1 auto;justify-content:center}}

/* Stage 9: invoice range and tax summary polish */
.mgmt-invoice-tax-summary,
.mgmt-invoice-range-card{
  margin:0 0 16px;
}
.mgmt-stat-card small{
  display:block;
  margin-top:6px;
  color:var(--mgmt-muted,#6b7280);
  font-size:.82rem;
  font-weight:500;
}
.mgmt-form-grid--compact{
  align-items:end;
}
.mgmt-form-actions--bottom{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:end;
}
.mgmt-page-tools button.mgmt-btn{
  cursor:pointer;
}
@media(max-width:760px){
  .mgmt-form-actions--bottom .mgmt-btn{flex:1 1 auto;justify-content:center;}
}

/* Stage 9b: keep invoice action panels tucked away until opened */
.mgmt-settings-disclosure--inline{
  margin:0 0 14px;
  padding:12px 14px;
  border:1px solid var(--mg-border, #d9dee7);
  border-radius:14px;
  background:var(--mg-panel-2, #f8fafc);
}
.mgmt-settings-disclosure--inline > summary{
  min-height:34px;
}
.mgmt-settings-disclosure--inline .mgmt-disclosure-body{
  padding:12px 0 2px;
}

/* Stage 10: subscriptions and billing requests workflow polish */
.mgmt-filter-card{
  margin:0 0 14px;
  padding:14px;
  border:1px solid var(--mg-border, #d9dee7);
  border-radius:16px;
  background:var(--mg-panel-2, #f8fafc);
}
.mgmt-card--nested{
  box-shadow:none;
  margin-top:14px;
}
.mgmt-attention-panel .mgmt-mini-record{
  align-items:center;
}
.mgmt-subscriptions-overview{
  margin:0;
}
.mgmt-subscription-card.is-legacy{
  border-left:4px solid #f59e0b;
}
.mgmt-request-card.is-pending{
  border-left:4px solid #f59e0b;
}
.mgmt-request-card__note{
  margin-top:8px;
}
.mgmt-sticky-save{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  position:sticky;
  bottom:12px;
  z-index:5;
  margin-top:14px;
  padding:12px;
  border:1px solid var(--mg-border, #d9dee7);
  border-radius:16px;
  background:rgba(255,255,255,.94);
  box-shadow:0 12px 28px rgba(16,24,40,.08);
  backdrop-filter:blur(8px);
}
@media(max-width:760px){
  .mgmt-sticky-save{
    display:grid;
    bottom:8px;
  }
  .mgmt-sticky-save .mgmt-btn{
    justify-content:center;
  }
}

/* Stage 11: content and communication tidy */
.mgmt-content-stats{
  margin-bottom:16px;
}
.mgmt-content-tools{
  margin-bottom:16px;
}
.mgmt-tool-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.mgmt-tool-card{
  display:grid;
  gap:7px;
  align-content:start;
  min-height:132px;
  padding:16px;
  border:1px solid var(--mg-border, #d9dee7);
  border-radius:16px;
  background:var(--mg-panel-2, #f8fafc);
  color:inherit;
  text-decoration:none;
}
.mgmt-tool-card:hover{
  background:#fff;
  border-color:rgba(37,99,235,.28);
  box-shadow:0 12px 28px rgba(16,24,40,.07);
  transform:translateY(-1px);
}
.mgmt-tool-card i{
  width:38px;
  height:38px;
  display:inline-grid;
  place-items:center;
  border-radius:12px;
  background:#eef4ff;
  color:#155eef;
  font-size:1.05rem;
}
.mgmt-tool-card strong{
  font-size:1rem;
  color:var(--mg-text, #182230);
}
.mgmt-tool-card span{
  color:var(--mg-muted, #667085);
  line-height:1.45;
  font-size:.9rem;
}
.mgmt-content-record-title{
  display:flex;
  gap:8px;
  align-items:flex-start;
}
@media(max-width:920px){
  .mgmt-tool-grid{grid-template-columns:1fr;}
}

/* Stage 13: Uploaded Images filter and hover polish */
.mgmt-tabs .mgmt-tab.is-active,
.mgmt-tabs .mgmt-tab.active,
.mgmt-subpage-nav a.is-active {
  background:#eef4ff !important;
  color:#155eef !important;
  border-color:#c7d7fe !important;
}
.mgmt-tabs .mgmt-tab.is-active:hover,
.mgmt-tabs .mgmt-tab.active:hover,
.mgmt-subpage-nav a.is-active:hover {
  background:#e6efff !important;
  color:#155eef !important;
}
.mgmt-subpage-nav a:hover,
.mgmt-tabs .mgmt-tab:hover {
  background:#f8fbff;
  color:#155eef;
}
.mgmt-image-card {
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.mgmt-image-card:hover {
  border-color:#c7d7fe;
  box-shadow:0 14px 34px rgba(16,24,40,.10);
  transform:translateY(-1px);
}
.mgmt-image-card:hover .mgmt-image-card__body,
.mgmt-image-card:hover .mgmt-image-card__footer,
.mgmt-image-card:hover .mgmt-image-card__meta {
  background:transparent !important;
}
.mgmt-image-card__footer .mgmt-btn--soft:hover,
.mgmt-image-card__footer .mgmt-iconbtn:hover {
  background:#eef4ff !important;
  color:#155eef !important;
  border-color:#b2ccff !important;
}
.mgmt-filterbar {
  width:100%;
  display:grid;
  grid-template-columns:minmax(250px,1.35fr) minmax(150px,.75fr) minmax(145px,.65fr) minmax(145px,.65fr) minmax(145px,.65fr) auto;
  gap:10px;
  align-items:end;
  padding:12px;
  border:1px solid var(--mg-border);
  border-radius:18px;
  background:linear-gradient(180deg,#fff,#f8fafc);
  box-shadow:0 8px 22px rgba(16,24,40,.045);
}
.mgmt-filterbar label {
  display:grid;
  gap:5px;
  position:relative;
  min-width:0;
}
.mgmt-filterbar label > span {
  color:var(--mg-muted);
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.01em;
}
.mgmt-filterbar input,
.mgmt-filterbar select {
  width:100%;
  min-height:42px;
  border:1px solid var(--mg-border);
  border-radius:13px;
  background:#fff;
  color:var(--mg-text);
  font-weight:750;
  padding:9px 11px;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.mgmt-filterbar input:focus,
.mgmt-filterbar select:focus {
  border-color:#84adff;
  box-shadow:0 0 0 4px rgba(21,94,239,.10);
  outline:none;
}
.mgmt-filterbar__search i {
  position:absolute;
  left:13px;
  bottom:12px;
  color:var(--mg-muted);
  pointer-events:none;
}
.mgmt-filterbar__search input {
  padding-left:38px;
}
.mgmt-filterbar__actions {
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
}
.mgmt-filterbar__actions .mgmt-btn {
  min-height:42px;
  white-space:nowrap;
}
@media (max-width: 1280px) {
  .mgmt-filterbar {grid-template-columns:1fr 1fr 1fr;}
  .mgmt-filterbar__search {grid-column:1 / -1;}
  .mgmt-filterbar__actions {justify-content:flex-start;}
}
@media (max-width: 720px) {
  .mgmt-filterbar {grid-template-columns:1fr;padding:10px;}
  .mgmt-filterbar__actions {flex-direction:column;align-items:stretch;}
  .mgmt-filterbar__actions .mgmt-btn {width:100%;}
}

/* Stage 14: Control centre and system page polish */
.mgmt-control-kpis,
.mgmt-system-kpis{
  margin-bottom:16px;
}
.mgmt-control-kpis .mgmt-kpi,
.mgmt-system-kpis .mgmt-kpi{
  min-height:104px;
}
.mgmt-card > h2:first-child,
.mgmt-card .mgmt-section-head h2{
  letter-spacing:-.01em;
}
.mgmt-danger-zone{
  border:1px solid rgba(220,38,38,.18);
  background:linear-gradient(180deg,#fff7f7,#fff);
  border-radius:18px;
  padding:14px;
}
.mgmt-danger-zone .mgmt-btn--danger:hover{
  background:#b42318 !important;
  border-color:#b42318 !important;
  color:#fff !important;
}
.mgmt-health-grid{
  gap:12px;
}
.mgmt-health{
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.mgmt-health:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 28px rgba(16,24,40,.07);
}
.mgmt-card code,
.mgmt-table code{
  background:#f2f4f7;
  border:1px solid #eaecf0;
  border-radius:8px;
  padding:2px 6px;
  color:#344054;
  word-break:break-all;
}
.mgmt-table .mgmt-actions-inline,
.mgmt-actions-inline{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.mgmt-search .mgmt-btn,
.mgmt-form-grid .mgmt-btn{
  min-height:42px;
}
@media(max-width:900px){
  .mgmt-control-kpis,
  .mgmt-system-kpis{grid-template-columns:1fr;}
}

/* Stage 16: global search suggestions */
.mgmt-global-search{position:relative;z-index:25}
.mgmt-global-search:focus-within{border-color:#9bbcff;box-shadow:0 0 0 4px rgba(21,94,239,.10), var(--mg-soft-shadow)}
.mgmt-search-suggest{
  position:absolute;left:0;right:0;top:calc(100% + 8px);z-index:80;
  background:var(--mg-panel);border:1px solid var(--mg-border);border-radius:16px;
  box-shadow:0 18px 42px rgba(16,24,40,.16);padding:8px;max-height:420px;overflow:auto;
}
.mgmt-search-suggest[hidden]{display:none!important}
.mgmt-search-suggest__item,
.mgmt-search-suggest__all{
  width:100%;display:flex;align-items:center;gap:10px;border:0;background:transparent;color:var(--mg-text);
  text-decoration:none;text-align:left;border-radius:12px;padding:10px;cursor:pointer;font:inherit;
}
.mgmt-search-suggest__item:hover,
.mgmt-search-suggest__item.is-active,
.mgmt-search-suggest__all:hover{background:#eef4ff;color:#155eef;text-decoration:none}
.mgmt-search-suggest__icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#eef4ff;color:#155eef;flex:0 0 auto}
.mgmt-search-suggest__text{min-width:0;display:block;line-height:1.22}
.mgmt-search-suggest__text strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.92rem}
.mgmt-search-suggest__text small{display:block;margin-top:3px;color:var(--mg-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.78rem}
.mgmt-search-suggest__item:hover small,
.mgmt-search-suggest__item.is-active small{color:#3b63c7}
.mgmt-search-suggest__all{justify-content:center;margin-top:4px;border-top:1px solid var(--mg-border);border-radius:0 0 12px 12px;font-weight:800;color:#155eef}
.mgmt-search-suggest__empty{padding:14px;color:var(--mg-muted);font-size:.9rem;text-align:center}
@media (max-width:700px){.mgmt-search-suggest{position:fixed;left:12px;right:12px;top:86px;max-height:70vh}}

/* Stage 17: top-bar search reliability + compact submit button */
.mgmt-global-search__submit{
  width:32px;height:32px;display:grid;place-items:center;flex:0 0 32px;
  border:0;border-radius:10px;background:#eef4ff;color:#155eef;cursor:pointer;
}
.mgmt-global-search__submit:hover,
.mgmt-global-search__submit:focus{background:#dbeafe;color:#0b5cab;outline:0;box-shadow:0 0 0 3px rgba(21,94,239,.12)}
.mgmt-global-search__submit i{color:inherit!important;font-size:.9rem}
.mgmt-global-search.has-suggestions{z-index:95}
@media(max-width:700px){.mgmt-global-search__submit{width:30px;height:30px}}


/* Stage 18: keep User Management action panels above the members card/table. */
.mgmt-user-management-card,
.mgmt-card.mgmt-user-management-card,
.mgmt-user-management-card .mgmt-table-wrap,
.mgmt-user-management-card .mgmt-table,
.mgmt-user-management-card .mgmt-table tbody,
.mgmt-user-management-card .mgmt-table tr,
.mgmt-user-management-card .mgmt-table td{
  overflow:visible!important;
}
.mgmt-user-management-card{
  position:relative;
  z-index:3;
}
.mgmt-user-management-card .mgmt-table-wrap{
  isolation:isolate;
}
.mgmt-user-management-card .mgmt-table tr:has(.mgmt-user-action-panel[open]){
  position:relative;
  z-index:300!important;
}
.mgmt-user-management-card .mgmt-user-action-panel{
  position:relative;
  z-index:20;
}
.mgmt-user-management-card .mgmt-user-action-panel[open]{
  z-index:350;
}
.mgmt-user-management-card .mgmt-user-action-panel .mgmt-user-actions{
  z-index:400!important;
  max-height:min(72vh,680px);
  overflow:auto;
}
.mgmt-user-management-card .mgmt-user-action-panel.is-drop-up .mgmt-user-actions{
  top:auto;
  bottom:calc(100% + 8px);
}
@media (min-width:761px){
  .mgmt-user-management-card .mgmt-user-action-panel .mgmt-user-actions{
    right:0;
  }
}

/* Stage 19 repair: keep the redesigned shell CSS, then add only the Online/IP polish safely. */
.mgmt-live-note{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.mgmt-live-note p{margin:.35rem 0 0}
.mgmt-search--polished{align-items:end;background:var(--mg-panel-2);border:1px solid var(--mg-border);border-radius:18px;padding:12px}
.mgmt-search--polished label{min-width:190px;flex:1}
.mgmt-online-table tbody tr:hover td{background:rgba(21,94,239,.04)!important}
.mgmt-online-status{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border-radius:999px;border:1px solid var(--mg-border);font-weight:800;font-size:.84rem;background:var(--mg-panel-2)}
.mgmt-online-status.is-online{color:var(--mg-success,#067647);background:var(--mg-success-bg,#ecfdf3);border-color:rgba(6,118,71,.22)}
.mgmt-online-status.is-recent{color:var(--mg-warning,#b54708);background:var(--mg-warning-bg,#fffaeb);border-color:rgba(181,71,8,.2)}
.mgmt-online-dot{width:8px;height:8px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px rgba(21,94,239,.08)}
.mgmt-disclosure{border:0}
.mgmt-disclosure>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer}
.mgmt-disclosure>summary::-webkit-details-marker{display:none}
.mgmt-disclosure>summary strong{display:block;font-size:1.05rem}
.mgmt-disclosure>summary small{display:block;color:var(--mg-muted);font-weight:600;margin-top:3px}
.mgmt-disclosure[open]>summary{padding-bottom:14px;border-bottom:1px solid var(--mg-border);margin-bottom:14px}
.mgmt-disclosure__body{padding-top:2px}
@media (max-width:760px){.mgmt-live-note{align-items:flex-start}.mgmt-search--polished label{min-width:100%;}.mgmt-disclosure>summary{align-items:flex-start;flex-direction:column}.mgmt-disclosure>summary .mgmt-btn{width:100%;justify-content:center}}

/* Stage 20: Privacy/Data and Send Notice polish */
.mgmt-privacy-summary .mgmt-stat-card{
  text-decoration:none;
  color:inherit;
  transition:transform .14s ease, border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.mgmt-privacy-summary .mgmt-stat-card:hover,
.mgmt-privacy-summary .mgmt-stat-card.is-selected{
  transform:translateY(-1px);
  border-color:#b2ccff;
  box-shadow:0 12px 28px rgba(21,94,239,.10);
  background:linear-gradient(180deg,#ffffff,#f8fbff);
}
.mgmt-privacy-summary .mgmt-stat-card.is-selected span,
.mgmt-privacy-summary .mgmt-stat-card.is-selected strong{color:#155eef;}
.mgmt-filterbar--notice{
  margin:12px 0;
  grid-template-columns:minmax(260px,1fr) auto;
}
.mgmt-notice-recipient-search{display:grid;gap:12px;}
.mgmt-recipient-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.mgmt-recipient-card{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  gap:11px;
  align-items:center;
  padding:12px;
  border:1px solid var(--mg-border);
  border-radius:16px;
  background:var(--mg-panel);
  text-decoration:none;
  color:var(--mg-text);
  transition:background .14s ease,border-color .14s ease,transform .14s ease,box-shadow .14s ease;
}
.mgmt-recipient-card:hover{
  transform:translateY(-1px);
  border-color:#b2ccff;
  background:#f8fbff;
  box-shadow:0 12px 24px rgba(16,24,40,.07);
}
.mgmt-recipient-card__icon{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  background:#eef4ff;color:#155eef;
}
.mgmt-recipient-card strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mgmt-recipient-card small{display:block;color:var(--mg-muted);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px;}
.mgmt-notice-preview{
  display:flex;align-items:center;gap:12px;
  padding:13px 14px;
  border:1px dashed #b2ccff;
  border-radius:16px;
  background:#f8fbff;
}
.mgmt-notice-preview__icon{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  background:#eef4ff;color:#155eef;
  flex:0 0 auto;
}
@media (max-width:760px){
  .mgmt-filterbar--notice{grid-template-columns:1fr;}
  .mgmt-recipient-grid{grid-template-columns:1fr;}
  .mgmt-recipient-card{grid-template-columns:38px minmax(0,1fr);}
  .mgmt-recipient-card .mgmt-badge{grid-column:2;justify-self:start;}
}

/* Stage 21: Uploaded Images moderation queue/checkpoint polish */
.mgmt-image-moderation-card,
.mgmt-image-moderation-card .mgmt-image-grid,
.mgmt-image-moderation-card .mgmt-image-card,
.mgmt-image-moderation-card .mgmt-image-card__body,
.mgmt-image-moderation-card .mgmt-image-card__footer{
  overflow:visible!important;
}
.mgmt-image-moderation-card .mgmt-image-card{
  position:relative;
  isolation:isolate;
}
.mgmt-image-moderation-card .mgmt-image-card:has(.mgmt-pop[open]){
  z-index:80;
}
.mgmt-image-moderation-card .mgmt-pop[open]{
  z-index:90;
}
.mgmt-image-moderation-card .mgmt-pop__panel{
  z-index:100;
  max-height:min(70vh,520px);
  overflow:auto;
}
.mgmt-image-moderation-card .mgmt-pop__panel.is-above{
  top:auto;
  bottom:46px;
}
.mgmt-mark-checked-form{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.mgmt-mark-checked-form .mgmt-mini{
  flex:1 0 100%;
  text-align:right;
}
@media(max-width:760px){
  .mgmt-mark-checked-form{justify-content:stretch;align-items:stretch;width:100%;}
  .mgmt-mark-checked-form .mgmt-btn{justify-content:center;}
  .mgmt-mark-checked-form .mgmt-mini{text-align:left;}
}


/* Stage 22: FAQ and announcement management polish */
.mgmt-faq-summary,
.mgmt-announcement-summary{margin-bottom:16px}
.mgmt-faq-summary .mgmt-stat-card,
.mgmt-announcement-summary .mgmt-stat-card{text-decoration:none;color:inherit;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.mgmt-faq-summary .mgmt-stat-card:hover,
.mgmt-announcement-summary .mgmt-stat-card:hover{transform:translateY(-1px);border-color:#b2ccff;box-shadow:0 14px 32px rgba(21,94,239,.08)}
.mgmt-faq-summary .mgmt-stat-card small,
.mgmt-announcement-summary .mgmt-stat-card small{display:block;margin-top:6px;color:var(--mg-muted,#667085);font-size:.84rem;font-weight:700;line-height:1.35}
#faq-questions .mgmt-table-wrap,
#faq-categories .mgmt-table-wrap,
#announcement-history .mgmt-table-wrap{overflow:visible}
#faq-questions .mgmt-actions-inline,
#faq-categories .mgmt-actions-inline,
#announcement-history .mgmt-actions-inline{position:relative;z-index:2}
#faq-questions tr:hover td,
#faq-categories tr:hover td,
#announcement-history tr:hover td{background:rgba(21,94,239,.035)}
.faq-management-search{margin-top:14px;max-width:680px}
.faq-management-search .mgmt-field{height:44px;border-radius:14px;background:#fff}
.mgmt-current-announcement{border-radius:16px}
.mgmt-ann-icon-cell i{width:34px;height:34px;border-radius:12px;display:inline-grid;place-items:center;background:#eef4ff;color:#155eef}
@media(max-width:760px){.mgmt-faq-summary,.mgmt-announcement-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Stage 25: live/scheduled announcement indicator in management top bar */
.mgmt-announcement-live-link{
  position:relative;
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border:1px solid rgba(245,158,11,.32);
  border-radius:13px;
  background:linear-gradient(180deg,rgba(255,251,235,.96),rgba(254,243,199,.86));
  color:#b45309;
  text-decoration:none;
  box-shadow:var(--mg-soft-shadow,0 10px 25px rgba(15,23,42,.08));
}
.mgmt-announcement-live-link:hover,
.mgmt-announcement-live-link:focus-visible{
  color:#92400e;
  border-color:rgba(245,158,11,.55);
  background:#fffbeb;
  transform:translateY(-1px);
}

.mgmt-announcement-live-link.is-scheduled{
  border-color:rgba(245,158,11,.34);
  background:linear-gradient(180deg,rgba(255,251,235,.96),rgba(254,243,199,.9));
  color:#b45309;
}
.mgmt-announcement-live-link.is-live{
  border-color:rgba(22,163,74,.28);
  background:linear-gradient(180deg,rgba(240,253,244,.96),rgba(220,252,231,.88));
  color:#15803d;
}
.mgmt-announcement-live-link.is-live:hover,
.mgmt-announcement-live-link.is-live:focus-visible{
  color:#166534;
  border-color:rgba(22,163,74,.5);
  background:#f0fdf4;
}
.mgmt-announcement-live-link i{font-size:1.05rem;line-height:1}
.mgmt-announcement-live-dot{
  position:absolute;
  top:-4px;
  right:-4px;
  width:13px;
  height:13px;
  border-radius:999px;
  background:#16a34a;
  border:2px solid var(--mg-panel,#fff);
  box-shadow:0 0 0 4px rgba(22,163,74,.14);
}
.mgmt-announcement-live-link.is-scheduled .mgmt-announcement-live-dot{
  background:#f59e0b;
  box-shadow:0 0 0 4px rgba(245,158,11,.16);
}
@media (max-width:700px){.mgmt-announcement-live-link{width:40px;height:40px}}

/* Stage 36: grouped feature catalogue */
.mgmt-grouped-list {
  display: grid;
  gap: 16px;
}
.mgmt-feature-group {
  border: 1px solid var(--mgmt-border, #d9e2ef);
  border-radius: 18px;
  background: var(--mgmt-surface, #fff);
  overflow: visible;
}
.mgmt-feature-group .mgmt-table-wrap {
  border-top: 1px solid var(--mgmt-border, #d9e2ef);
  border-radius: 0 0 18px 18px;
}
.mgmt-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}
.mgmt-section-heading h3 {
  margin: 0;
  font-size: 1rem;
}

/* Stage 38: keep the user dropdown above the responsive search bar */
.mgmt-topbar{
  isolation:isolate;
}
.mgmt-top-actions{
  position:relative;
  z-index:120;
}
.mgmt-user-menu{
  position:relative;
  z-index:121;
}
.mgmt-user-menu[open]{
  z-index:160;
}
.mgmt-user-menu__panel{
  z-index:170;
}
.mgmt-global-search{
  z-index:20;
}
.mgmt-global-search.has-suggestions,
.mgmt-global-search:focus-within{
  z-index:95;
}
@media (max-width:1180px){
  .mgmt-top-actions{
    align-self:start;
  }
  .mgmt-user-menu__panel{
    top:calc(100% + 8px);
  }
}
@media (max-width:700px){
  .mgmt-user-menu__panel{
    right:0;
    max-height:min(70vh, 420px);
    overflow:auto;
  }
}

/* Stage 39: League Management overview */
.mgmt-league-list{display:grid;gap:12px;margin-top:14px;}
.mgmt-league-card{border:1px solid var(--mgmt-border,#dfe7f3);border-radius:18px;background:var(--mgmt-card,#fff);padding:16px;box-shadow:0 12px 30px rgba(15,23,42,.04);}
.mgmt-league-card:hover{border-color:rgba(37,99,235,.28);box-shadow:0 16px 36px rgba(15,23,42,.07);}
.mgmt-league-card__main{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;}
.mgmt-league-card h3{margin:0 0 4px;font-size:1.05rem;}
.mgmt-league-card__badges,.mgmt-league-card__meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.mgmt-league-card__meta{margin-top:12px;color:var(--mgmt-muted,#64748b);font-size:.9rem;}
.mgmt-league-card__meta span{background:rgba(15,23,42,.04);border:1px solid rgba(148,163,184,.25);border-radius:999px;padding:5px 9px;}
.mgmt-pill.is-ok{background:#dcfce7;color:#166534;border-color:#bbf7d0;}
.mgmt-pill.is-warn{background:#fef3c7;color:#92400e;border-color:#fde68a;}
.mgmt-pill.is-muted{background:#f1f5f9;color:#475569;border-color:#e2e8f0;}
@media (max-width: 760px){.mgmt-league-card__main{display:block}.mgmt-league-card__badges{margin-top:10px}}

/* Stage 40: league plan assignment */
.mgmt-league-list--manage { gap: 14px; }
.mgmt-league-card--editable { overflow: visible; }
.mgmt-inline-details { margin-top: 14px; border-top: 1px solid var(--mgmt-border, #e5eaf3); padding-top: 12px; }
.mgmt-inline-details > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border: 1px solid var(--mgmt-border, #d8e0ef); border-radius: 12px; background: #f8fbff; color: var(--mgmt-primary, #0b63ce); font-weight: 700; list-style: none; user-select: none; }
.mgmt-inline-details > summary::-webkit-details-marker { display: none; }
.mgmt-inline-details[open] > summary { background: #eef5ff; border-color: rgba(37,99,235,.28); }
.mgmt-league-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 18px; margin-top: 14px; align-items: start; }
.mgmt-league-editor { min-width: 0; }
.mgmt-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mgmt-form-grid label { display: grid; gap: 6px; font-weight: 700; color: #101827; }
.mgmt-form-grid label > span { font-size: .9rem; }
.mgmt-form-grid__wide { grid-column: 1 / -1; }
.mgmt-feature-access-card { border: 1px solid var(--mgmt-border, #e5eaf3); border-radius: 16px; background: #fbfdff; padding: 16px; box-shadow: 0 10px 24px rgba(15,23,42,.04); }
.mgmt-feature-access-card h4 { margin: 0 0 10px; font-size: 1rem; }
.mgmt-feature-access-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mgmt-feature-access-card li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(148,163,184,.18); }
.mgmt-feature-access-card li:last-child { border-bottom: 0; }
.mgmt-feature-access-card li span { font-weight: 700; }
.mgmt-feature-access-card li em { font-style: normal; color: #64748b; white-space: nowrap; }
.mgmt-actions-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
@media (max-width: 900px) {
  .mgmt-league-detail-grid { grid-template-columns: 1fr; }
  .mgmt-form-grid { grid-template-columns: 1fr; }
}

/* Stage 41 cleanup audit */
.mgmt-cleanup-group{margin-top:1.25rem;padding-top:1rem;border-top:1px solid var(--mgmt-border, rgba(148,163,184,.25));}
.mgmt-cleanup-group:first-of-type{border-top:0;padding-top:0;}
.mgmt-cleanup-group h3{margin:.15rem 0 .7rem;font-size:1rem;}
.mgmt-cleanup-list{display:grid;gap:.6rem;}
.mgmt-cleanup-row{display:grid;grid-template-columns:auto 1fr;gap:.75rem;align-items:flex-start;padding:.75rem;border:1px solid var(--mgmt-border, rgba(148,163,184,.25));border-radius:14px;background:var(--mgmt-card-bg, #fff);}
.mgmt-cleanup-row__icon{width:2rem;height:2rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:rgba(148,163,184,.14);}
.mgmt-cleanup-row.is-ok .mgmt-cleanup-row__icon{color:#15803d;background:rgba(34,197,94,.13);}
.mgmt-cleanup-row.is-warn .mgmt-cleanup-row__icon{color:#b45309;background:rgba(245,158,11,.16);}
.mgmt-cleanup-counts{display:grid;gap:.65rem;}
.mgmt-cleanup-count{display:grid;grid-template-columns:1fr auto;gap:.25rem .75rem;align-items:center;padding:.75rem;border:1px solid var(--mgmt-border, rgba(148,163,184,.25));border-radius:14px;background:rgba(148,163,184,.06);}
.mgmt-cleanup-count strong{font-size:1.1rem;}
.mgmt-cleanup-count small{grid-column:1/-1;color:var(--mgmt-muted, #64748b);}
.mgmt-cleanup-file{padding:.75rem;border:1px solid var(--mgmt-border, rgba(148,163,184,.25));border-radius:14px;background:rgba(148,163,184,.06);}
.mgmt-cleanup-file code{display:block;white-space:normal;word-break:break-word;}
.mgmt-stack{display:grid;gap:.65rem;}
.mgmt-mini-card{padding:1rem;border:1px solid var(--mgmt-border, rgba(148,163,184,.25));border-radius:16px;background:rgba(148,163,184,.06);}
.mgmt-mini-card p{margin:.35rem 0 0;color:var(--mgmt-muted, #64748b);}

/* Stage 42 signup foundation */
.mgmt-flow-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-top:1rem}
.mgmt-flow-step{background:var(--panel-soft,#f8fafc);border:1px solid var(--border,#dbe3ef);border-radius:16px;padding:1rem;min-height:140px}
.mgmt-flow-step>span{display:inline-grid;place-items:center;width:2rem;height:2rem;border-radius:999px;background:var(--accent,#3157d5);color:#fff;font-weight:800;margin-bottom:.65rem}
.mgmt-flow-step strong{display:block;margin-bottom:.35rem;color:var(--text,#122033)}
.mgmt-flow-step p{margin:0;color:var(--muted,#68758a);font-size:.92rem;line-height:1.45}
.mgmt-check-list{display:grid;gap:.75rem}
.mgmt-check-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:.8rem;align-items:start;border:1px solid var(--border,#dbe3ef);border-radius:14px;padding:.85rem;background:var(--panel,#fff)}
.mgmt-check-row.is-ok .mgmt-check-row__icon{color:#16834a}
.mgmt-check-row.is-missing .mgmt-check-row__icon{color:#b7791f}
.mgmt-check-row strong{display:block;margin-bottom:.15rem;color:var(--text,#122033)}
.mgmt-check-row p{margin:0;color:var(--muted,#68758a);font-size:.9rem;line-height:1.35}
.mgmt-compact-list{display:grid;gap:.65rem}
.mgmt-compact-row{display:flex;justify-content:space-between;gap:1rem;align-items:center;border:1px solid var(--border,#dbe3ef);border-radius:14px;padding:.85rem;background:var(--panel,#fff)}
.mgmt-compact-row strong{display:block;color:var(--text,#122033)}
.mgmt-compact-row span{color:var(--muted,#68758a);font-size:.9rem}
.mgmt-compact-row__meta{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;justify-content:flex-end}
.mgmt-money{font-weight:800;color:var(--text,#122033)!important}
.mgmt-empty-state{border:1px dashed var(--border,#dbe3ef);border-radius:16px;padding:1.3rem;text-align:center;color:var(--muted,#68758a);background:var(--panel-soft,#f8fafc)}
.mgmt-empty-state i{font-size:1.8rem;margin-bottom:.5rem;color:var(--accent,#3157d5)}
.mgmt-empty-state strong{display:block;color:var(--text,#122033);margin-bottom:.25rem}
.mgmt-empty-state p{margin:0}
.mgmt-code{white-space:pre-wrap;word-break:break-word;background:var(--code-bg,#0f172a);color:#e5e7eb;border-radius:14px;padding:1rem;overflow:auto}
@media (max-width:1100px){.mgmt-flow-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:720px){.mgmt-flow-list{grid-template-columns:1fr}.mgmt-check-row{grid-template-columns:auto minmax(0,1fr)}.mgmt-check-row>.mgmt-pill{grid-column:2}.mgmt-compact-row{align-items:flex-start;flex-direction:column}.mgmt-compact-row__meta{justify-content:flex-start}}

/* Stage 44: scope role foundation */
.mgmt-flow-list--compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.mgmt-role-map {
  display: grid;
  gap: .85rem;
}
.mgmt-role-map__group {
  padding: .85rem;
  border: 1px solid var(--mgmt-border, #d9e2ef);
  border-radius: 16px;
  background: var(--mgmt-soft, #f8fafc);
}
.mgmt-role-map__group h3 {
  margin: 0 0 .55rem;
  font-size: .95rem;
}
.mgmt-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

/* Stage 46: restore proper grid widths for foundation pages */
.mgmt-grid.mgmt-grid--2,
.mgmt-grid.mgmt-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mgmt-grid.mgmt-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mgmt-grid.mgmt-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mgmt-grid.mgmt-grid--2 > *,
.mgmt-grid.mgmt-grid--3 > *,
.mgmt-grid.mgmt-grid--4 > * {
  min-width: 0;
}

@media (max-width: 1180px) {
  .mgmt-grid.mgmt-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mgmt-grid.mgmt-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .mgmt-grid.mgmt-grid--2,
  .mgmt-grid.mgmt-grid--two,
  .mgmt-grid.mgmt-grid--3,
  .mgmt-grid.mgmt-grid--4 { grid-template-columns: 1fr; }
}

/* Keep foundation check/status rows readable inside normal-width cards */
.mgmt-check-list { display: grid; gap: .75rem; }
.mgmt-check-row { min-width: 0; }
.mgmt-check-row > div { min-width: 0; }
.mgmt-check-row strong,
.mgmt-check-row p { overflow-wrap: anywhere; }
.mgmt-flow-list--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .mgmt-flow-list--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .mgmt-flow-list--compact { grid-template-columns: 1fr; } }

/* Stage 47: Roles & Access manager polish */
.mgmt-filter-bar--stacked{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end;margin:0 0 12px;}
.mgmt-filter-bar--stacked label{display:grid;gap:6px;font-weight:700;color:var(--mg-muted);font-size:.85rem;}
.mgmt-role-admin-row .mgmt-compact-row__meta{align-items:center;}
.mgmt-muted{display:block;color:var(--mg-muted);font-size:.86rem;margin-top:2px;}
.mgmt-mt{margin-top:12px;}
.mgmt-empty-state--small{padding:18px;min-height:auto;}
.mgmt-section-kicker{font-size:.82rem;text-transform:uppercase;letter-spacing:.08em;color:var(--mg-muted);margin:0 0 10px;}
@media (max-width: 760px){.mgmt-filter-bar--stacked{grid-template-columns:1fr}.mgmt-role-admin-row .mgmt-compact-row__meta{align-items:flex-start}}

/* Stage 49: setup queue */
.mgmt-setup-queue .mgmt-list-card { overflow: visible; }
.mgmt-list-card__main { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.mgmt-list-card__meta { text-align: right; min-width: 9rem; }
.mgmt-list-card__meta strong { display: block; font-size: 1.35rem; color: var(--mgmt-text, #0f172a); }
.mgmt-list-card__meta span { display: block; color: var(--mgmt-muted, #64748b); font-size: .85rem; }
.mgmt-inline-editor { margin-top: 1rem; border-top: 1px solid var(--mgmt-border, #e2e8f0); padding-top: .85rem; }
.mgmt-inline-editor > summary { cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; color: var(--mgmt-primary, #2563eb); }
.mgmt-inline-editor[open] > summary { margin-bottom: .85rem; }
.mgmt-inline-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.mgmt-empty-state--small { padding: 1rem; }
.mgmt-pill--success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.mgmt-pill--warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.mgmt-pill--neutral { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
@media (max-width: 760px) {
  .mgmt-list-card__main { display: block; }
  .mgmt-list-card__meta { text-align: left; margin-top: .75rem; }
  .mgmt-inline-form { justify-content: flex-start; }
}

/* Stage 50: organisation management tidy-ups */
.mgmt-separator{border:0;border-top:1px solid var(--mgmt-border,#e5e7eb);margin:18px 0}
.mgmt-list-stack--compact{gap:8px}
.mgmt-list-stack--compact .mgmt-mini-record{padding:10px 12px}

/* Stage 51: Organisations practical manager */
.mgmt-org-card .mgmt-card-actions form { display: inline-flex; margin: 0; }
.mgmt-linked-list { display: grid; gap: .5rem; margin: 1rem 0; }
.mgmt-linked-list__item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem .75rem; border: 1px solid var(--mgmt-border, #d8e0ea); border-radius: 14px; background: var(--mgmt-surface-soft, #f8fafc); }
.mgmt-linked-list__item span { min-width: 0; }
.mgmt-linked-list__item strong { display: block; color: var(--mgmt-text, #172033); }
.mgmt-linked-list__item small { display: block; color: var(--mgmt-muted, #65758b); overflow-wrap: anywhere; }
.mgmt-empty--compact { padding: .75rem; }
.mgmt-checkbox-list { display: grid; gap: .45rem; max-height: 380px; overflow: auto; padding: .35rem; border: 1px solid var(--mgmt-border, #d8e0ea); border-radius: 16px; background: var(--mgmt-surface-soft, #f8fafc); }
.mgmt-check-row { display: flex; align-items: flex-start; gap: .65rem; padding: .6rem .65rem; border-radius: 12px; cursor: pointer; }
.mgmt-check-row:hover { background: var(--mgmt-surface, #fff); }
.mgmt-check-row input { margin-top: .2rem; width: auto; min-width: 1rem; }
.mgmt-check-row strong { display: block; }
.mgmt-check-row small { display: block; color: var(--mgmt-muted, #65758b); }
.mgmt-sticky-side { align-self: start; position: sticky; top: 92px; }
.mgmt-pill.is-info { background: #e8f1ff; color: #1d4ed8; border-color: #bfd7ff; }
@media (max-width: 920px) {
  .mgmt-sticky-side { position: static; }
  .mgmt-linked-list__item { align-items: stretch; flex-direction: column; }
}

/* Stage 54: New League Signup wizard */
.mgmt-grid--signup {
  align-items: start;
}
.mgmt-stack-form {
  display: grid;
  gap: 1rem;
}
.mgmt-fieldset {
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,255,255,.7);
}
.mgmt-fieldset > legend {
  padding: 0 .45rem;
  font-weight: 800;
  color: var(--mgmt-text, #0f172a);
}
.mgmt-choice-list {
  display: grid;
  gap: .65rem;
}
.mgmt-choice-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 16px;
  padding: .75rem .85rem;
  background: rgba(248, 250, 252, .78);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mgmt-choice-card:hover {
  border-color: rgba(79, 70, 229, .35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}
.mgmt-choice-card input[type="radio"],
.mgmt-choice-card input[type="checkbox"] {
  inline-size: 1.05rem;
  block-size: 1.05rem;
}
.mgmt-choice-card strong,
.mgmt-choice-card small {
  display: block;
}
.mgmt-choice-card small {
  color: var(--mgmt-muted, #64748b);
  margin-top: .15rem;
}
.mgmt-choice-card--addon {
  grid-template-columns: auto 1fr minmax(4.5rem, 5.5rem);
}
.mgmt-field--tiny {
  max-width: 5.5rem;
  text-align: center;
}
.mgmt-signup-preview {
  position: sticky;
  top: 1rem;
}
.mgmt-plan-preview-card {
  border-radius: 18px;
  padding: 1rem;
  border: 1px solid rgba(79, 70, 229, .20);
  background: linear-gradient(135deg, rgba(79,70,229,.10), rgba(14,165,233,.08));
  margin-bottom: 1rem;
}
.mgmt-plan-preview-card h3 {
  margin: 0 0 .25rem;
}
.mgmt-plan-preview-card p {
  color: var(--mgmt-muted, #64748b);
  margin: 0 0 .75rem;
}
.mgmt-h3 {
  margin: 1rem 0 .65rem;
  font-size: 1rem;
}
.mgmt-note-panel {
  border-radius: 16px;
  background: rgba(245, 158, 11, .10);
  border: 1px solid rgba(245, 158, 11, .25);
  padding: .9rem 1rem;
}
.mgmt-note-panel ul {
  margin: .5rem 0 0 1.1rem;
  padding: 0;
}
.mgmt-mt { margin-top: 1rem; }
@media (max-width: 980px) {
  .mgmt-signup-preview { position: static; }
  .mgmt-choice-card--addon { grid-template-columns: auto 1fr; }
  .mgmt-choice-card--addon .mgmt-field--tiny { grid-column: 2; }
}

/* Stage 55: New League Signup wizard polish */
.mgmt-wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.mgmt-wizard-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--mgmt-border, rgba(148,163,184,.28));
  border-radius: 18px;
  background: var(--mgmt-surface, #fff);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}
.mgmt-wizard-step.is-active {
  border-color: rgba(37,99,235,.35);
  background: linear-gradient(180deg, rgba(37,99,235,.08), rgba(255,255,255,.95));
}
.mgmt-wizard-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  line-height: 1;
}
.mgmt-wizard-step strong { display:block; color: var(--mgmt-text, #0f172a); }
.mgmt-wizard-step small { display:block; margin-top:.2rem; color: var(--mgmt-muted, #64748b); line-height:1.35; }
.mgmt-grid--signup { align-items:start; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); }
.mgmt-signup-preview { position: sticky; top: 5.5rem; }
.mgmt-price-estimate {
  border: 1px solid rgba(37,99,235,.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(37,99,235,.08), rgba(255,255,255,.98));
  padding: 1rem;
}
.mgmt-price-estimate__head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:.75rem;
}
.mgmt-price-estimate__head strong { display:block; }
.mgmt-price-estimate__head small { display:block; color:var(--mgmt-muted,#64748b); margin-top:.2rem; line-height:1.35; }
.mgmt-price-estimate__total { font-size:1.65rem; font-weight:800; color:#1d4ed8; white-space:nowrap; }
.mgmt-price-lines { display:grid; gap:.45rem; }
.mgmt-price-lines > div {
  display:flex;
  justify-content:space-between;
  gap:1rem;
  padding:.55rem .65rem;
  border-radius:12px;
  background:rgba(255,255,255,.72);
  border:1px solid rgba(148,163,184,.18);
}
.mgmt-price-lines span { color:var(--mgmt-muted,#64748b); }
.mgmt-price-lines strong { color:var(--mgmt-text,#0f172a); text-align:right; }
.mgmt-choice-card input[type="radio"], .mgmt-choice-card input[type="checkbox"] { margin-top:.25rem; }
.mgmt-choice-card small { line-height:1.35; }
@media (max-width: 1100px) {
  .mgmt-wizard-steps { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mgmt-grid--signup { grid-template-columns: 1fr; }
  .mgmt-signup-preview { position: static; }
}
@media (max-width: 640px) {
  .mgmt-wizard-steps { grid-template-columns: 1fr; }
  .mgmt-price-estimate__head { display:block; }
  .mgmt-price-estimate__total { display:block; margin-top:.5rem; }
}

/* Stage 56: seasons */
.mgmt-list-table--season-templates .mgmt-list-row{
  grid-template-columns: minmax(220px, 1.5fr) auto minmax(160px,.8fr) auto;
}
.mgmt-info-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1rem;
}
.mgmt-info-box{
  border:1px solid var(--mgmt-border, rgba(148,163,184,.28));
  border-radius:18px;
  padding:1rem;
  background:rgba(255,255,255,.65);
  display:flex;
  flex-direction:column;
  gap:.35rem;
}
.mgmt-info-box span{color:var(--mgmt-muted,#64748b);font-size:.92rem;line-height:1.4;}
.mgmt-chip-row{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.7rem;}
.mgmt-chip{display:inline-flex;align-items:center;gap:.35rem;border:1px solid var(--mgmt-border,rgba(148,163,184,.28));border-radius:999px;padding:.45rem .7rem;background:rgba(248,250,252,.9);font-weight:700;}
.mgmt-chip small{font-weight:500;color:var(--mgmt-muted,#64748b);}
.mgmt-mini-preview{margin-top:1rem;padding-top:1rem;border-top:1px dashed var(--mgmt-border,rgba(148,163,184,.35));}
@media (max-width: 900px){
  .mgmt-info-grid{grid-template-columns:1fr;}
  .mgmt-list-table--season-templates .mgmt-list-row{grid-template-columns:1fr;align-items:start;}
}

/* Stage 57: setup queue payment/setup workflow */
.mgmt-grid--5{grid-template-columns:repeat(5,minmax(0,1fr));}
.mgmt-filter-bar--queue{display:grid;grid-template-columns:minmax(220px,1.4fr) repeat(4,minmax(150px,1fr)) auto;gap:12px;align-items:end;}
.mgmt-filter-field{display:grid;gap:6px;font-size:.82rem;font-weight:800;color:var(--mg-muted);}
.mgmt-filter-field--search{min-width:220px;}
.mgmt-filter-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;}
.mgmt-queue-card{border-left:4px solid transparent;}
.mgmt-queue-card--ready{border-left-color:var(--mg-success,#16a34a);box-shadow:0 16px 35px rgba(22,163,74,.10);}
.mgmt-queue-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid var(--mg-border);}
.mgmt-queue-actions form{margin:0;}
.mgmt-setup-queue .mgmt-inline-editor{margin-top:12px;}
@media (max-width:1180px){.mgmt-grid--5{grid-template-columns:repeat(3,minmax(0,1fr));}.mgmt-filter-bar--queue{grid-template-columns:repeat(2,minmax(0,1fr));}.mgmt-filter-field--search{grid-column:1/-1;}.mgmt-filter-actions{justify-content:flex-start;}}
@media (max-width:760px){.mgmt-grid--5{grid-template-columns:1fr;}.mgmt-filter-bar--queue{grid-template-columns:1fr;}.mgmt-filter-actions{flex-direction:column;align-items:stretch}.mgmt-filter-actions .mgmt-btn{width:100%;}.mgmt-queue-actions{flex-direction:column}.mgmt-queue-actions .mgmt-btn{width:100%;}}

/* Stage 58: Renewal workflow */
.mgmt-list-table--renewals .mgmt-list-row {
  grid-template-columns: minmax(260px, 1fr) 150px 160px auto;
}
.mgmt-card-grid--renewal-quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.mgmt-quote-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: .85rem 0;
}
.mgmt-quote-totals > div {
  border: 1px solid var(--mgmt-border, rgba(148,163,184,.28));
  background: var(--mgmt-soft, rgba(148,163,184,.08));
  border-radius: 14px;
  padding: .75rem;
}
.mgmt-quote-totals span {
  display: block;
  color: var(--mgmt-muted, #64748b);
  font-size: .78rem;
  margin-bottom: .25rem;
}
.mgmt-text-warn { color: #b45309; }
.mgmt-text-success { color: #15803d; }
.mgmt-section-head--compact { gap: .75rem; margin-bottom: .25rem; }
@media (max-width: 760px) {
  .mgmt-list-table--renewals .mgmt-list-row { grid-template-columns: 1fr; }
  .mgmt-quote-totals { grid-template-columns: 1fr; }
}

/* Stage 59: role request workflow polish */
.mgmt-actions-stack {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  align-items: flex-end;
}
.mgmt-role-request-row {
  align-items: flex-start;
}
.mgmt-mt-xs {
  margin-top: .35rem;
}
@media (max-width: 720px) {
  .mgmt-actions-stack {
    align-items: stretch;
    width: 100%;
  }
  .mgmt-actions-stack .mgmt-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Stage 60: QA & Security checkpoint */
.mgmt-qa-table .mgmt-pill,
.mgmt-check-row .mgmt-pill {
  white-space: nowrap;
}
.mgmt-check-row {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .85rem .95rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
}
.mgmt-check-row > span {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  flex: 0 0 auto;
}
.mgmt-check-row.is-ok > span {
  color: #168a45;
  background: rgba(22, 138, 69, .12);
}
.mgmt-check-row.is-warn > span {
  color: #b45309;
  background: rgba(245, 158, 11, .16);
}
.mgmt-pill.is-neutral {
  background: rgba(100, 116, 139, .12);
  color: var(--mgmt-muted, #64748b);
}

/* Stage 63: public plans check */
.mgmt-check-list {
  display: grid;
  gap: .7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mgmt-check-list li {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  color: var(--mgmt-text, #172033);
}
.mgmt-check-list i {
  margin-top: .18rem;
  color: var(--mgmt-success, #16a34a);
}

/* Stage 67 setup task workflow polish */
.mgmt-task-row{
  align-items:flex-start;
}
.mgmt-task-actions{
  align-items:center;
  gap:.45rem;
}
.mgmt-inline-form--note{
  gap:.45rem;
}
@media (max-width:760px){
  .mgmt-task-actions,
  .mgmt-inline-form--note{
    width:100%;
    justify-content:flex-start;
  }
  .mgmt-inline-form--note .mgmt-field{
    max-width:none !important;
    flex:1 1 180px;
  }
}

/* Final Fix Pack 12: setup queue workflow clarity */
.mgmt-workflow-list{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.75rem;
  margin:.75rem 0 0;
  padding:0;
  list-style:none;
  counter-reset:workflow;
}
.mgmt-workflow-list li{
  counter-increment:workflow;
  border:1px solid var(--mgmt-border,rgba(148,163,184,.28));
  border-radius:14px;
  padding:.85rem;
  background:var(--mgmt-soft,rgba(148,163,184,.08));
}
.mgmt-workflow-list li::before{
  content:counter(workflow);
  width:1.65rem;
  height:1.65rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  margin-bottom:.55rem;
  font-weight:800;
  color:#fff;
  background:var(--mgmt-primary,#0f6ab7);
}
.mgmt-workflow-list strong,
.mgmt-workflow-list span{
  display:block;
}
.mgmt-workflow-list span{
  margin-top:.25rem;
  color:var(--mgmt-muted,#64748b);
  line-height:1.35;
}
@media (max-width:980px){
  .mgmt-workflow-list{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:620px){
  .mgmt-workflow-list{grid-template-columns:1fr;}
}

/* Stage 65: user actions expand below the selected user instead of opening as a floating pop-up. */
.mgmt-user-actions-toggle{width:100%;justify-content:center;white-space:nowrap}
.mgmt-user-actions-row[hidden]{display:none!important}
.mgmt-user-actions-row td{padding:0 10px 14px!important;background:transparent!important;border-top:0!important}
.mgmt-user-actions-panel{display:grid;gap:12px;margin-top:-2px;padding:14px;background:var(--mg-panel-2);border:1px solid var(--mg-border);border-radius:18px;box-shadow:none}
.mgmt-user-settings-form{display:grid;grid-template-columns:repeat(3,minmax(130px,1fr)) auto auto;gap:10px;align-items:end}
.mgmt-user-settings-form label{display:grid;gap:5px;margin:0;font-size:.82rem;font-weight:800;color:var(--mg-muted)}
.mgmt-user-settings-form select,.mgmt-user-settings-form input[type="number"]{width:100%;min-width:0;padding:9px 10px;border-radius:12px;border:1px solid var(--mg-border);background:var(--mg-panel);color:var(--mg-text)}
.mgmt-live-save-status{min-width:88px;font-size:.85rem;font-weight:800;color:var(--mg-muted)}
.mgmt-user-action-buttons,.mgmt-user-danger-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.mgmt-user-danger-row{justify-content:flex-end;padding-top:10px;border-top:1px solid var(--mg-border)}
.mgmt-user-danger-row form,.mgmt-user-action-buttons form{display:inline-flex;margin:0}
.mgmt-user-danger-row .mgmt-btn--danger{min-width:118px;justify-content:center}
.mgmt-user-management-card .mgmt-table-wrap{overflow-x:auto!important;overflow-y:visible!important}
.mgmt-user-management-card .mgmt-table tr:has(.mgmt-user-action-panel[open]),
.mgmt-user-management-card .mgmt-user-action-panel,
.mgmt-user-management-card .mgmt-user-action-panel[open]{z-index:auto!important}
@media (max-width:980px){
  .mgmt-user-settings-form{grid-template-columns:1fr 1fr}
  .mgmt-user-settings-form .mgmt-live-save-status{grid-column:1 / -1}
}
@media (max-width:700px){
  .mgmt-user-settings-form{grid-template-columns:1fr}
  .mgmt-user-action-buttons,.mgmt-user-danger-row{flex-direction:column;align-items:stretch}
  .mgmt-user-action-buttons .mgmt-btn,.mgmt-user-danger-row .mgmt-btn,.mgmt-user-action-buttons form,.mgmt-user-danger-row form{width:100%;justify-content:center}
}

/* Stage 66: live moderator note edit/delete controls. */
.mgmt-note-item__actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:8px}
.mgmt-note-item__actions form{display:inline-flex;margin:0}
.mgmt-btn--tiny{padding:6px 9px!important;border-radius:10px!important;font-size:.82rem!important;min-height:0!important}
.mgmt-note-edit-form{display:grid;gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid var(--mg-border)}
.mgmt-note-edit-form[hidden]{display:none!important}
.mgmt-note-edit-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.mgmt-note-item__body{white-space:normal;line-height:1.45}

/* Online Members compact layout refinements */
.mgmt-online-kpis--compact{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:10px;
}
.mgmt-online-kpis--compact .mgmt-span-4{grid-column:span 1!important;}
.mgmt-online-kpis--compact .mgmt-kpi{padding:9px 11px;border-radius:14px;min-width:0;}
.mgmt-online-kpis--compact .mgmt-kpi__label{font-size:.78rem;margin-bottom:3px;line-height:1.15;}
.mgmt-online-kpis--compact .mgmt-kpi__value{font-size:1.35rem;line-height:1.05;}
.mgmt-online-kpis--compact .mgmt-kpi__value--small{font-size:1.05rem;letter-spacing:-.02em;}
.mgmt-online-filter-card{margin-top:10px;padding:12px;}
.mgmt-search--compact{padding:10px;gap:8px;}
.mgmt-search--compact label{min-width:160px;}
.mgmt-search--compact .mgmt-label{font-size:.84rem;margin-bottom:4px;}
.mgmt-search--compact .mgmt-field{padding:9px 10px;border-radius:11px;}
.mgmt-search--compact .mgmt-btn{min-height:38px;padding:9px 12px;border-radius:11px;}
.mgmt-online-members-card{margin-top:10px;}
.mgmt-section-head--compact{margin-bottom:10px;}
.mgmt-section-head--compact h2{margin-bottom:2px;}
.mgmt-online-help{margin:.25rem 0 0;}
@media (max-width:760px){
  .mgmt-online-kpis--compact{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px;}
  .mgmt-online-kpis--compact .mgmt-kpi{padding:8px 7px;}
  .mgmt-online-kpis--compact .mgmt-kpi__label{font-size:.69rem;}
  .mgmt-online-kpis--compact .mgmt-kpi__value{font-size:1.12rem;}
  .mgmt-online-kpis--compact .mgmt-kpi__value--small{font-size:.82rem;}
  .mgmt-search--polished.mgmt-search--compact label{min-width:0;flex:1 1 145px;}
  .mgmt-search--compact .mgmt-btn{width:100%;justify-content:center;}
}
@media (max-width:430px){
  .mgmt-online-kpis--compact{gap:5px;}
  .mgmt-online-kpis--compact .mgmt-kpi{padding:7px 6px;border-radius:12px;}
  .mgmt-online-kpis--compact .mgmt-kpi__label{font-size:.64rem;}
  .mgmt-online-kpis--compact .mgmt-kpi__value{font-size:1rem;}
  .mgmt-online-kpis--compact .mgmt-kpi__value--small{font-size:.74rem;}
}

/* Compact Roles & Access refresh */
.mgmt-panel__head--compact{margin-bottom:12px}
.mgmt-roles-overview .mgmt-stat-card{padding:14px 16px}
.mgmt-roles-two-col{align-items:start}
.mgmt-filter-bar--inline{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end}
.mgmt-btn--small{padding:8px 12px;font-size:.9rem;border-radius:12px}
.mgmt-role-scope-list{display:grid;gap:10px}
.mgmt-role-scope-list>div{display:flex;justify-content:space-between;gap:14px;padding:12px 0;border-top:1px solid var(--mg-border)}
.mgmt-role-scope-list>div:first-child{border-top:0;padding-top:0}
.mgmt-role-scope-list span{color:var(--mg-muted);text-align:right}
.mgmt-compact-list--tight{gap:6px}
.mgmt-btn--notice-back{color:#fff !important}
.mgmt-btn--notice-back:hover{color:#fff !important}
@media (max-width:760px){.mgmt-filter-bar--inline{grid-template-columns:1fr}.mgmt-role-scope-list>div{display:block}.mgmt-role-scope-list span{display:block;text-align:left;margin-top:3px}}


/* IP Bans: compact KPI row, matching the tighter Online Members summary cards.
   Force the cards themselves, and their contents, to stay narrow so all four
   remain side-by-side on smaller screens. */
.mgmt-ipban-kpis--compact{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:8px;
  margin-bottom:12px;
}
.mgmt-ipban-kpis--compact > .mgmt-kpi,
.mgmt-ipban-kpis--compact > .mgmt-span-3{
  grid-column:auto !important;
  min-width:0;
}
.mgmt-ipban-kpis--compact .mgmt-kpi{
  padding:8px 9px;
  border-radius:14px;
  min-width:0;
  overflow:hidden;
}
.mgmt-ipban-kpis--compact .mgmt-kpi__label{
  font-size:.74rem;
  line-height:1.1;
  margin-bottom:3px;
  max-width:100%;
}
.mgmt-ipban-kpis--compact .mgmt-kpi__value{
  font-size:1.25rem;
  line-height:1.05;
}
@media (max-width:760px){
  .mgmt-ipban-kpis--compact{gap:6px;}
  .mgmt-ipban-kpis--compact .mgmt-kpi{padding:7px 6px;border-radius:12px;}
  .mgmt-ipban-kpis--compact .mgmt-kpi__label{font-size:.61rem;letter-spacing:-.01em;}
  .mgmt-ipban-kpis--compact .mgmt-kpi__value{font-size:1rem;}
}
@media (max-width:380px){
  .mgmt-ipban-kpis--compact{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
  .mgmt-ipban-kpis--compact .mgmt-kpi__label{font-size:.68rem;}
}
