
: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{
    /* Keep mobile suggestions directly under the search box.
       The previous fixed top:86px could sit over the input once the
       browser address bar/keyboard changed the viewport height. */
    position:absolute;
    left:0;
    right:0;
    top:calc(100% + 8px);
    max-height:min(52dvh, 360px);
  }
}

/* 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;}
}

/* League Management shell additions
   Keeps League Management assets separate while matching Site Management layout. */
.lm-top-context{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:46px;
  padding:0 12px;
  border:1px solid var(--mg-border);
  background:var(--mg-panel);
  border-radius:16px;
  box-shadow:var(--mg-shadow);
  color:var(--mg-muted);
  font-weight:800;
}
.lm-top-context i{color:var(--mg-accent)}
.lm-top-context__text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lm-admin-pill{display:inline-flex;align-items:center;gap:8px;margin-top:8px}
.lm-setup-hero{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap}
.lm-setup-hero h2{margin:4px 0 6px}
.lm-setup-statuses{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.lm-setup-list .mgmt-list__item{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr) auto;gap:12px;align-items:center}
.lm-setup-list .mgmt-list__item span{color:var(--mg-muted)}
@media (max-width:980px){
  .lm-top-context{grid-column:1 / -1;order:3;min-height:auto;padding:10px 12px}
}
@media (max-width:780px){
  .lm-setup-list .mgmt-list__item{grid-template-columns:1fr}
  .lm-setup-statuses{justify-content:flex-start}
}

/* League Management: Manage Clubs */
.lm-compact-selector{margin-bottom:16px}
.lm-league-summary-card{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap;margin-bottom:16px}
.lm-league-summary-card h2{margin:.15rem 0 .25rem}
.lm-feature-strip{display:flex;gap:8px;flex-wrap:wrap;align-items:center;max-width:760px}
.lm-pill-locked{background:var(--mg-warning-bg);color:var(--mg-warning)}
.lm-club-form{display:grid;gap:12px}
.lm-club-form select[size]{min-height:190px;background:var(--mg-panel-2);color:var(--mg-text);border:1px solid var(--mg-border);border-radius:14px;padding:8px}
.lm-club-cards{display:grid;gap:12px}
.lm-club-card{border:1px solid var(--mg-border);background:var(--mg-panel-2);border-radius:18px;overflow:hidden}
.lm-club-card > summary{list-style:none;display:flex;justify-content:space-between;gap:12px;align-items:center;padding:14px 16px;cursor:pointer}
.lm-club-card > summary::-webkit-details-marker{display:none}
.lm-club-card > summary span{display:grid;gap:3px}
.lm-club-card > summary small{color:var(--mg-muted);font-weight:600}
.lm-club-card[open] > summary{border-bottom:1px solid var(--mg-border);background:rgba(11,92,171,.06)}
.lm-club-edit-form{padding:16px}
.lm-club-remove{padding:0 16px 16px;display:flex;justify-content:flex-end}
.lm-club-card .mgmt-field{background:var(--mg-panel)}
.lm-club-card textarea,.lm-club-card input,.lm-club-card select,.lm-compact-selector select,.lm-club-form input,.lm-club-form select,.lm-club-form textarea{background:var(--mg-panel-2);color:var(--mg-text);border:1px solid var(--mg-border);border-radius:12px;padding:9px 10px;width:100%}
.lm-club-card .mgmt-field span,.lm-club-form .mgmt-field span,.lm-compact-selector .mgmt-field span{display:block;font-weight:800;margin-bottom:6px}
@media (max-width:760px){.lm-league-summary-card{display:block}.lm-feature-strip{margin-top:12px}.lm-club-remove{justify-content:flex-start}}

/* League Management: manage divisions */
.lm-divisions-table input,
.lm-divisions-table select{width:100%;min-width:120px}
.lm-division-order{max-width:92px}
.lm-division-inline-form{display:contents}
.lm-divisions-table .mgmt-actions-cell{display:flex!important;gap:8px;align-items:center;flex-wrap:wrap;white-space:normal}
.lm-divisions-table .mgmt-actions-cell form{margin:0}
@media (max-width:760px){
  .lm-divisions-table{min-width:760px}
}

/* League Management: drag/drop divisions and cleaner controls */
.lm-divisions-page select,
.lm-divisions-page input[type="text"],
.lm-divisions-page input:not([type]),
.lm-divisions-page .lm-divisions-table input,
.lm-divisions-page .lm-divisions-table select{
  width:100%;
  min-height:42px;
  padding:9px 38px 9px 12px;
  border:1px solid var(--mg-border);
  border-radius:14px;
  background:var(--mg-panel-2);
  color:var(--mg-text);
  font:inherit;
  font-weight:700;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.lm-divisions-page select{
  appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 18px) 18px,calc(100% - 13px) 18px;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
}
.lm-divisions-page select:focus,
.lm-divisions-page input:focus{
  outline:0;
  border-color:#155eef;
  box-shadow:0 0 0 4px rgba(21,94,239,.12);
}
.lm-divisions-table .lm-drag-col{
  width:58px;
  min-width:58px;
  text-align:center;
  vertical-align:middle;
}
.lm-division-drag-handle{
  width:38px;
  height:38px;
  display:inline-grid;
  place-items:center;
  border:1px solid var(--mg-border);
  border-radius:12px;
  background:var(--mg-panel-2);
  color:var(--mg-muted);
  cursor:grab;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.lm-division-drag-handle:hover,
.lm-division-drag-handle:focus-visible{
  color:#155eef;
  border-color:#b2ccff;
  background:#eef4ff;
  outline:0;
}
.lm-division-drag-handle:active{cursor:grabbing}
.lm-division-row.is-dragging{
  opacity:.45;
}
.lm-division-row.is-dragging td{
  background:#eef4ff!important;
}
.lm-division-sort-status{
  margin-top:10px;
  min-height:20px;
  font-weight:800;
  font-size:.9rem;
}
.lm-division-sort-status.is-saving{color:#155eef}
.lm-division-sort-status.is-error{color:#b42318}
.lm-divisions-table .mgmt-actions-cell{
  align-items:center;
}
@media (max-width:760px){
  .lm-divisions-table{min-width:700px}
  .lm-divisions-table .lm-drag-col{width:50px;min-width:50px}
  .lm-division-drag-handle{width:34px;height:34px}
}

/* Current league selector in left menu */
.lm-sidebar-league{margin:10px 12px 18px;padding:10px;border:1px solid var(--mg-border);border-radius:16px;background:rgba(255,255,255,.045);display:grid;gap:7px}
.lm-sidebar-league label{font-size:.72rem;text-transform:uppercase;letter-spacing:.055em;font-weight:900;color:var(--mg-muted)}
.lm-sidebar-league select{width:100%;min-width:0;border:1px solid var(--mg-border);border-radius:12px;background:var(--mg-panel-2);color:var(--mg-text);padding:8px 9px;font-weight:800;font-size:.86rem;line-height:1.2}
.lm-sidebar-league select:focus{outline:2px solid rgba(59,130,246,.28);outline-offset:2px}

/* League Management: club counties and live club lookup */
.lm-league-regions-card{margin-bottom:16px}
.lm-region-picker{display:grid;gap:12px}
.lm-region-picker__list{display:flex;flex-wrap:wrap;gap:8px}
.lm-region-chip{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--mg-border);background:var(--mg-panel-2);color:var(--mg-text);border-radius:999px;padding:7px 11px;font-weight:800;font-size:.88rem;cursor:pointer;user-select:none}
.lm-region-chip input{width:auto;margin:0;accent-color:#155eef}
.lm-region-chip.is-selected,.lm-region-chip:has(input:checked){border-color:#b2ccff;background:#eef4ff;color:#155eef}
.lm-club-live-search{min-height:44px}
.lm-club-live-results{display:grid;gap:8px;max-height:290px;overflow:auto;padding:2px}
.lm-club-result{width:100%;display:flex;justify-content:space-between;gap:10px;text-align:left;border:1px solid var(--mg-border);background:var(--mg-panel-2);color:var(--mg-text);border-radius:14px;padding:10px 12px;cursor:pointer}
.lm-club-result span{display:grid;gap:3px}
.lm-club-result strong{font-size:.95rem}
.lm-club-result small{color:var(--mg-muted);font-weight:700}
.lm-club-result:hover,.lm-club-result.is-selected{border-color:#b2ccff;background:#eef4ff;color:#155eef}
.lm-club-result.is-out-of-area{background:rgba(148,163,184,.12);color:var(--mg-muted)}
.lm-club-result.is-out-of-area:hover,.lm-club-result.is-out-of-area.is-selected{border-color:rgba(148,163,184,.65);background:rgba(148,163,184,.18);color:var(--mg-text)}
.lm-club-search-empty,.lm-club-no-results,.lm-club-selected{border:1px dashed var(--mg-border);border-radius:14px;padding:11px 12px;background:var(--mg-panel-2);color:var(--mg-muted);font-weight:700}
.lm-club-no-results{display:grid;gap:8px;color:var(--mg-text)}
.lm-club-no-results span{color:var(--mg-muted)}
.lm-club-selected{border-style:solid;color:var(--mg-text)}
@media(max-width:760px){.lm-region-picker__list{max-height:180px;overflow:auto}.lm-region-chip{font-size:.82rem;padding:6px 9px}.lm-club-live-results{max-height:230px}}

/* League Management: cleaner hidden add-club form */
.lm-club-lookup-grid{align-items:start}
.lm-club-lookup-card .mgmt-section-head,
.lm-add-club-card .mgmt-section-head{margin-bottom:12px}
.lm-add-club-card[hidden]{display:none!important}
.lm-add-club-card{border-color:#b2ccff;box-shadow:0 18px 44px rgba(21,94,239,.10)}
.lm-add-club-form{gap:12px}
.lm-form-section{font-size:.76rem;text-transform:uppercase;letter-spacing:.06em;font-weight:900;color:#155eef;border-bottom:1px solid var(--mg-border);padding:4px 0 8px;margin-top:4px}
.lm-add-club-form .mgmt-field,
.lm-search-field{border:1px solid var(--mg-border);border-radius:16px;background:var(--mg-panel);padding:10px 12px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.lm-add-club-form .mgmt-field span,
.lm-search-field span{font-size:.78rem;text-transform:uppercase;letter-spacing:.045em;color:var(--mg-muted);font-weight:900}
.lm-add-club-form input,
.lm-add-club-form select,
.lm-add-club-form textarea{margin-top:6px}
.lm-club-no-results .mgmt-btn{justify-self:start}
@media(max-width:900px){.lm-club-lookup-grid{grid-template-columns:1fr}.lm-club-lookup-grid .mgmt-span-5,.lm-club-lookup-grid .mgmt-span-7{grid-column:1/-1}}

/* League Management: Manage Teams */
.lm-teams-page .lm-teams-table input,
.lm-teams-page .lm-teams-table select,
.lm-add-team-card input,
.lm-add-team-card select{
  width:100%;
  min-height:42px;
  padding:9px 38px 9px 12px;
  border:1px solid var(--mg-border);
  border-radius:14px;
  background:var(--mg-panel-2);
  color:var(--mg-text);
  font:inherit;
  font-weight:700;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.lm-teams-page select{
  appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 18px) 18px,calc(100% - 13px) 18px;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
}
.lm-teams-page input:focus,
.lm-teams-page select:focus{
  outline:0;
  border-color:#155eef;
  box-shadow:0 0 0 4px rgba(21,94,239,.12);
}
.lm-team-inline-form{margin:0}
.lm-teams-table .mgmt-actions-cell{align-items:center;gap:8px;white-space:nowrap}
.lm-add-team-card .mgmt-field{border:1px solid var(--mg-border);border-radius:16px;background:var(--mg-panel);padding:10px 12px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.lm-add-team-card .mgmt-field span{font-size:.78rem;text-transform:uppercase;letter-spacing:.045em;color:var(--mg-muted);font-weight:900}
.lm-add-team-card input,
.lm-add-team-card select{margin-top:6px}
.lm-add-team-card small{display:block;margin-top:6px;line-height:1.35}
@media(max-width:900px){.lm-teams-table{min-width:920px}.lm-add-team-card{grid-column:1/-1}}

/* League Management: Role Admin */
.lm-role-admin-page{display:grid;gap:16px;}
.lm-role-admin-intro .mgmt-form-grid{position:relative;}
.lm-role-search-results{align-self:end;border:1px solid var(--border);background:var(--card);border-radius:16px;box-shadow:var(--shadow);max-height:280px;overflow:auto;padding:8px;}
.lm-role-search-item{width:100%;display:grid;grid-template-columns:1fr;gap:2px;text-align:left;border:1px solid transparent;background:transparent;border-radius:12px;padding:9px 10px;color:var(--text);cursor:pointer;}
.lm-role-search-item:hover,.lm-role-search-item:focus{border-color:var(--primary);background:rgba(80,120,255,.08);outline:none;}
.lm-role-search-item span{font-size:.82rem;color:var(--muted);}
.lm-role-search-item em{font-style:normal;font-size:.75rem;color:var(--success,#198754);}
.lm-role-search-item.is-outside{opacity:.62;background:rgba(120,120,120,.06);}
.lm-role-search-item.is-outside em{color:var(--muted);}
.lm-role-search-empty{padding:12px;color:var(--muted);font-size:.9rem;}
.lm-role-assignment-list{display:grid;gap:10px;}
.lm-role-assignment{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;border:1px solid var(--border);border-radius:16px;padding:11px 12px;background:var(--surface,#fff);}
.lm-role-assignment strong{display:block;}
.lm-role-assignment span{display:block;color:var(--muted);font-size:.88rem;margin-top:2px;}
.lm-role-assignment em{font-style:normal;font-size:.74rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:5px 9px;background:rgba(80,120,255,.12);color:var(--primary);}
@media (max-width: 760px){.lm-role-assignment{grid-template-columns:1fr;align-items:stretch}.lm-role-search-results{max-height:240px}}

/* League Management: Committee */
.lm-committee-page .mgmt-form-grid{position:relative;}
.lm-committee-member{grid-template-columns:minmax(0,1fr) auto;}
@media (max-width: 760px){.lm-committee-member{grid-template-columns:1fr;align-items:stretch}}

/* League Management: shared tidy form styling for Role Admin, Committee and Billing */
.lm-role-admin-page .mgmt-card,
.lm-committee-page .mgmt-card,
.lm-billing-page .mgmt-card{
  overflow:visible;
}
.lm-role-admin-page .mgmt-form-grid,
.lm-committee-page .mgmt-form-grid,
.lm-billing-page .mgmt-form-grid{
  align-items:start;
}
.lm-role-admin-page .mgmt-field,
.lm-committee-page .mgmt-field,
.lm-billing-page .mgmt-field{
  display:grid;
  gap:7px;
  width:100%;
  min-width:0;
  padding:11px 12px;
  border:1px solid var(--mg-border);
  border-radius:18px;
  background:linear-gradient(180deg,var(--mg-panel),var(--mg-panel-2));
  color:var(--mg-text);
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.lm-role-admin-page .mgmt-field > span,
.lm-committee-page .mgmt-field > span,
.lm-billing-page .mgmt-field > span{
  display:block;
  font-size:.76rem;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.055em;
  color:var(--mg-muted);
  font-weight:900;
}
.lm-role-admin-page .mgmt-field input,
.lm-role-admin-page .mgmt-field select,
.lm-role-admin-page .mgmt-field textarea,
.lm-committee-page .mgmt-field input,
.lm-committee-page .mgmt-field select,
.lm-committee-page .mgmt-field textarea,
.lm-billing-page .mgmt-field input,
.lm-billing-page .mgmt-field select,
.lm-billing-page .mgmt-field textarea{
  width:100%;
  min-width:0;
  min-height:42px;
  margin:0;
  padding:9px 12px;
  border:1px solid var(--mg-border);
  border-radius:14px;
  background:var(--mg-panel-2);
  color:var(--mg-text);
  font:inherit;
  font-weight:700;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.lm-role-admin-page .mgmt-field textarea,
.lm-committee-page .mgmt-field textarea,
.lm-billing-page .mgmt-field textarea{
  min-height:110px;
  resize:vertical;
  line-height:1.45;
}
.lm-role-admin-page .mgmt-field select,
.lm-committee-page .mgmt-field select,
.lm-billing-page .mgmt-field select{
  appearance:none;
  padding-right:38px;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 18px) 18px,calc(100% - 13px) 18px;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
}
.lm-role-admin-page .mgmt-field input:focus,
.lm-role-admin-page .mgmt-field select:focus,
.lm-role-admin-page .mgmt-field textarea:focus,
.lm-committee-page .mgmt-field input:focus,
.lm-committee-page .mgmt-field select:focus,
.lm-committee-page .mgmt-field textarea:focus,
.lm-billing-page .mgmt-field input:focus,
.lm-billing-page .mgmt-field select:focus,
.lm-billing-page .mgmt-field textarea:focus{
  outline:0;
  border-color:var(--mg-accent);
  box-shadow:0 0 0 4px rgba(11,92,171,.14);
}
.lm-role-admin-page .mgmt-field small,
.lm-committee-page .mgmt-field small,
.lm-billing-page .mgmt-field small{
  display:block;
  margin:0;
  line-height:1.35;
  font-weight:700;
}
.lm-role-admin-intro .mgmt-section-head,
.lm-billing-page .mgmt-section-head{
  padding-bottom:12px;
  margin-bottom:14px;
  border-bottom:1px solid var(--mg-border);
}
.lm-role-search-results{
  align-self:stretch;
  border:1px solid var(--mg-border);
  background:var(--mg-panel-2);
  border-radius:18px;
  box-shadow:0 12px 30px rgba(15,23,42,.08);
  max-height:280px;
  overflow:auto;
  padding:8px;
}
.lm-role-search-item{
  width:100%;
  display:grid;
  grid-template-columns:1fr;
  gap:2px;
  text-align:left;
  border:1px solid transparent;
  background:transparent;
  border-radius:14px;
  padding:10px 11px;
  color:var(--mg-text);
  cursor:pointer;
}
.lm-role-search-item:hover,
.lm-role-search-item:focus{
  border-color:rgba(11,92,171,.28);
  background:rgba(11,92,171,.08);
  outline:none;
}
.lm-role-search-item span{font-size:.82rem;color:var(--mg-muted);font-weight:700}
.lm-role-search-item em{font-style:normal;font-size:.75rem;color:var(--mg-success);font-weight:800}
.lm-role-search-item.is-outside{opacity:.64;background:rgba(100,116,139,.08)}
.lm-role-search-item.is-outside em{color:var(--mg-muted)}
.lm-role-search-empty{padding:12px;color:var(--mg-muted);font-size:.9rem;font-weight:700}
.lm-role-assignment-list{display:grid;gap:10px}
.lm-role-assignment{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:10px;
  align-items:center;
  border:1px solid var(--mg-border);
  border-radius:18px;
  padding:12px;
  background:linear-gradient(180deg,var(--mg-panel),var(--mg-panel-2));
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.lm-role-assignment strong{display:block;font-size:1rem}
.lm-role-assignment span{display:block;color:var(--mg-muted);font-size:.88rem;margin-top:2px;font-weight:700}
.lm-role-assignment em{
  font-style:normal;
  font-size:.74rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  border-radius:999px;
  padding:5px 9px;
  background:rgba(11,92,171,.12);
  color:var(--mg-accent);
}
.lm-billing-page{display:grid;gap:16px}
.lm-billing-summary .league_quickgrid,
.lm-billing-features .league_quickgrid,
.lm-billing-addons .league_quickgrid{margin-top:12px}
.lm-billing-page .mgmt-card{margin-bottom:0!important}
.lm-billing-page .mgmt-table-wrap{border:1px solid var(--mg-border);border-radius:18px;background:var(--mg-panel-2)}
.lm-billing-page .mgmt-table tr:first-child td{border-top:1px solid var(--mg-border)}
.lm-billing-page .mgmt-actions{padding-top:2px}
@media (max-width: 760px){
  .lm-role-assignment,
  .lm-committee-member{grid-template-columns:1fr;align-items:stretch}
  .lm-role-search-results{max-height:240px}
  .lm-role-admin-page .mgmt-col-6,
  .lm-role-admin-page .mgmt-col-4,
  .lm-committee-page .mgmt-col-6,
  .lm-committee-page .mgmt-col-4,
  .lm-billing-page .mgmt-col-6,
  .lm-billing-page .mgmt-col-4{grid-column:1/-1}
}

/* League setup country/county picker */
.lm-country-filter-row{
  display:grid;
  gap:7px;
  max-width:360px;
}
.lm-country-filter-label,
.lm-region-picker__head strong{
  font-size:.82rem;
  font-weight:900;
  color:var(--mg-text);
}
.lm-country-select{
  width:100%;
  appearance:none;
  -webkit-appearance:none;
  border:1px solid var(--mg-border);
  border-radius:14px;
  background:
    linear-gradient(45deg, transparent 50%, var(--mg-muted) 50%) calc(100% - 18px) 50%/6px 6px no-repeat,
    linear-gradient(135deg, var(--mg-muted) 50%, transparent 50%) calc(100% - 13px) 50%/6px 6px no-repeat,
    var(--mg-panel-2);
  color:var(--mg-text);
  padding:11px 38px 11px 13px;
  font-weight:800;
  line-height:1.2;
  box-shadow:0 1px 0 rgba(15,23,42,.03);
}
.lm-country-select:focus{
  outline:none;
  border-color:#93b4ff;
  box-shadow:0 0 0 4px rgba(21,94,239,.12);
}
.lm-region-picker__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:2px;
}
.lm-region-empty{
  border:1px dashed var(--mg-border);
  border-radius:14px;
  padding:12px 14px;
  background:var(--mg-panel-2);
}
.lm-region-chip[hidden]{display:none!important}

@media(max-width:620px){
  .lm-country-filter-row{max-width:none}
  .lm-region-picker__head{align-items:flex-start;flex-direction:column;gap:3px}
  .lm-country-select{font-size:.92rem;padding-top:10px;padding-bottom:10px}
}

/* League Management Documents */
.lm-documents-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,280px);gap:16px;align-items:center}
.lm-documents-hero h2{margin:.15rem 0 .35rem;font-size:1.45rem;line-height:1.2}
.lm-document-limit{border:1px solid var(--mg-border);background:linear-gradient(180deg,rgba(248,250,252,.95),rgba(255,255,255,.98));border-radius:18px;padding:14px 16px;display:grid;gap:4px;box-shadow:0 8px 24px rgba(16,24,40,.045)}
.lm-document-limit span{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--mg-muted);font-weight:900}
.lm-document-limit strong{font-size:1.25rem;color:var(--mg-text)}
.lm-document-limit small{color:var(--mg-muted);font-weight:700}
.lm-document-form .mgmt-textarea{min-height:74px}
.lm-document-form__actions{display:flex;justify-content:flex-end}
.lm-document-list{display:grid;gap:12px}
.lm-document-card{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:14px;border:1px solid var(--mg-border);background:var(--mg-panel);border-radius:18px;padding:14px;box-shadow:0 8px 22px rgba(16,24,40,.045)}
.lm-document-card__icon{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:#eef4ff;color:#155eef;font-size:1.25rem}
.lm-document-card__body{min-width:0;display:grid;gap:10px}
.lm-document-card__top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.lm-document-card h3{margin:0;font-size:1.05rem;color:var(--mg-text)}
.lm-document-card p{margin:0;color:var(--mg-muted);line-height:1.5}
.lm-document-card__link{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;background:var(--mg-panel-2);border:1px solid var(--mg-border);border-radius:14px;padding:8px}
.lm-document-card__link span{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--mg-muted);font-weight:900}
.lm-document-card__link input{width:100%;min-width:0;border:0;background:transparent;color:var(--mg-text);font-weight:700;padding:6px 4px;outline:0}
.lm-document-edit{border-top:1px solid var(--mg-border);padding-top:8px}
.lm-document-edit summary{cursor:pointer;font-weight:900;color:#155eef;display:inline-flex;align-items:center;gap:6px}
.lm-document-edit form{margin-top:12px;background:var(--mg-panel-2);border:1px solid var(--mg-border);border-radius:16px;padding:12px}
.lm-document-card__actions{display:flex;justify-content:flex-end;gap:8px}
.lm-document-delete{display:flex;align-items:flex-start}
.lm-document-delete .mgmt-btn{white-space:nowrap}
@media (max-width:760px){
  .lm-documents-hero{grid-template-columns:1fr}
  .lm-document-card{grid-template-columns:42px minmax(0,1fr);gap:12px}
  .lm-document-card__icon{width:42px;height:42px;border-radius:14px}
  .lm-document-delete{grid-column:1 / -1;justify-content:flex-end}
  .lm-document-card__link{grid-template-columns:1fr}
  .lm-document-card__top{display:grid}
}

/* League Management: Documents page polish */
.lm-documents-page{
  display:grid;
  gap:16px;
}
.lm-documents-page .mgmt-card{
  margin-top:0!important;
}
.lm-documents-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(190px,260px);
  gap:16px;
  align-items:center;
  padding:18px 20px;
}
.lm-documents-hero h2{
  margin:.1rem 0 .3rem;
  font-size:1.45rem;
  line-height:1.15;
}
.lm-document-limit{
  align-self:stretch;
  border:1px solid var(--mg-border);
  background:linear-gradient(180deg,var(--mg-panel-2),var(--mg-panel));
  border-radius:18px;
  padding:13px 15px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  box-shadow:none;
}
.lm-document-limit span{
  font-size:.74rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--mg-muted);
  font-weight:900;
}
.lm-document-limit strong{
  font-size:1.18rem;
  color:var(--mg-text);
  line-height:1.15;
}
.lm-document-limit small{
  color:var(--mg-muted);
  font-weight:700;
  line-height:1.35;
}
.lm-document-upload,
.lm-document-library{
  padding:18px 20px;
}
.lm-document-upload .mgmt-section-head,
.lm-document-library .mgmt-section-head{
  margin-bottom:12px;
}
.lm-document-upload .mgmt-section-head h2,
.lm-document-library .mgmt-section-head h2{
  margin-bottom:4px;
}
.lm-document-form,
.lm-document-edit .mgmt-form-grid{
  gap:12px;
}
.lm-document-form .mgmt-field,
.lm-document-edit .mgmt-field{
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:0;
  border:0;
  background:transparent;
  border-radius:0;
}
.lm-document-form .mgmt-field > span,
.lm-document-edit .mgmt-field > span{
  font-size:.82rem;
  font-weight:900;
  color:var(--mg-text);
}
.lm-document-form input[type="text"],
.lm-document-form input[type="file"],
.lm-document-form select,
.lm-document-form textarea,
.lm-document-edit input[type="text"],
.lm-document-edit select,
.lm-document-edit textarea{
  width:100%;
  min-height:44px;
  border:1px solid var(--mg-border);
  background:var(--mg-panel-2);
  color:var(--mg-text);
  border-radius:14px;
  padding:10px 12px;
  font:inherit;
  outline:0;
}
.lm-document-form input[type="file"]{
  padding:8px 10px;
}
.lm-document-form textarea,
.lm-document-edit textarea{
  min-height:78px;
  resize:vertical;
}
.lm-document-form input:focus,
.lm-document-form select:focus,
.lm-document-form textarea:focus,
.lm-document-edit input:focus,
.lm-document-edit select:focus,
.lm-document-edit textarea:focus{
  border-color:var(--mg-accent);
  box-shadow:0 0 0 3px rgba(11,92,171,.12);
}
.lm-document-form__actions{
  display:flex;
  justify-content:flex-end;
  padding-top:2px;
}
.lm-document-list{
  display:grid;
  gap:12px;
}
.lm-document-card{
  display:grid;
  grid-template-columns:46px minmax(0,1fr) auto;
  gap:14px;
  align-items:start;
  border:1px solid var(--mg-border);
  background:linear-gradient(180deg,var(--mg-panel),var(--mg-panel-2));
  border-radius:20px;
  padding:14px;
  box-shadow:none;
}
.lm-document-card__icon{
  width:46px;
  height:46px;
  border-radius:15px;
  display:grid;
  place-items:center;
  background:rgba(11,92,171,.1);
  color:var(--mg-accent);
  font-size:1.25rem;
  border:1px solid rgba(11,92,171,.14);
}
.lm-document-card__body{
  min-width:0;
  display:grid;
  gap:10px;
}
.lm-document-card__top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.lm-document-card h3{
  margin:0 0 4px;
  font-size:1.02rem;
  line-height:1.25;
  color:var(--mg-text);
}
.lm-document-card p{
  margin:0;
  color:var(--mg-muted);
  line-height:1.45;
}
.lm-document-card__link{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  background:var(--mg-panel);
  border:1px solid var(--mg-border);
  border-radius:15px;
  padding:8px;
}
.lm-document-card__link span{
  font-size:.74rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--mg-muted);
  font-weight:900;
  padding-left:4px;
}
.lm-document-card__link input{
  width:100%;
  min-width:0;
  border:0;
  background:transparent;
  color:var(--mg-text);
  font-weight:700;
  padding:7px 4px;
  outline:0;
}
.lm-document-edit{
  border-top:1px solid var(--mg-border);
  padding-top:9px;
}
.lm-document-edit summary{
  width:max-content;
  cursor:pointer;
  font-weight:900;
  color:var(--mg-accent);
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
}
.lm-document-edit summary:hover{
  text-decoration:underline;
}
.lm-document-edit form{
  margin-top:12px;
  background:var(--mg-panel);
  border:1px solid var(--mg-border);
  border-radius:16px;
  padding:12px;
}
.lm-document-card__actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
}
.lm-document-delete{
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
}
.lm-document-delete .mgmt-btn{
  white-space:nowrap;
}
.lm-document-delete .mgmt-btn.is-confirming{
  background:var(--mg-warning);
  color:#fff;
}
@media (max-width: 900px){
  .lm-documents-hero{
    grid-template-columns:1fr;
  }
  .lm-document-card{
    grid-template-columns:42px minmax(0,1fr);
  }
  .lm-document-card__icon{
    width:42px;
    height:42px;
    border-radius:14px;
  }
  .lm-document-delete{
    grid-column:1 / -1;
    justify-content:flex-end;
  }
  .lm-document-card__top{
    display:grid;
  }
  .lm-document-card__link{
    grid-template-columns:1fr;
  }
  .lm-document-card__link span{
    padding-left:0;
  }
}
@media (max-width: 760px){
  .lm-document-form .mgmt-col-6,
  .lm-document-form .mgmt-col-3,
  .lm-document-edit .mgmt-col-6,
  .lm-document-edit .mgmt-col-3{
    grid-column:1 / -1;
  }
  .lm-document-form__actions,
  .lm-document-card__actions{
    justify-content:stretch;
  }
  .lm-document-form__actions .mgmt-btn,
  .lm-document-card__actions .mgmt-btn,
  .lm-document-card__link .mgmt-btn,
  .lm-document-delete .mgmt-btn{
    width:100%;
    justify-content:center;
  }
}

/* Restored League Management Rules styles */
/* League Management: Rules */
.lm-rules-hero{
  display:grid;
  grid-template-columns:minmax(240px,1fr) minmax(360px,1.4fr);
  gap:16px;
  align-items:start;
  margin-bottom:16px;
}
.lm-rules-hero h2{margin:.15rem 0 .25rem;}
.lm-rules-doc-form{
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto auto;
  gap:10px;
  align-items:end;
}
.lm-rules-field,
.lm-rules-import-preview label,
.lm-rules-file{
  display:grid;
  gap:6px;
  min-width:0;
}
.lm-rules-field > span,
.lm-rules-import-preview label > span,
.lm-rules-file > span{
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--mg-muted);
  font-weight:900;
}
.lm-rules-field input,
.lm-rules-field textarea,
.lm-rules-doc-form input[type="text"],
.lm-rules-import-preview textarea,
.lm-rules-file input[type="file"],
.lm-rules-filter input{
  width:100%;
  border:1px solid var(--mg-border);
  border-radius:14px;
  background:var(--mg-panel-2);
  color:var(--mg-text);
  padding:10px 12px;
  font:inherit;
  font-weight:800;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.lm-rules-field textarea,
.lm-rules-import-preview textarea{
  min-height:96px;
  line-height:1.45;
  font-weight:700;
  resize:vertical;
}
.lm-toggle-line{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--mg-border);
  background:var(--mg-panel-2);
  border-radius:14px;
  min-height:42px;
  padding:0 12px;
  font-weight:900;
  white-space:nowrap;
}
.lm-toggle-line input{accent-color:#155eef;}
.lm-rules-import-card,
.lm-rules-editor-card,
.lm-rules-list-card{margin-bottom:16px;}
.lm-rules-import-form{
  display:grid;
  grid-template-columns:minmax(240px,1fr) auto;
  gap:10px;
  align-items:end;
}
.lm-rules-import-preview{margin-top:14px;display:grid;gap:10px;}
.lm-rules-import-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
}
.lm-rules-import-actions label{display:inline-flex;gap:7px;align-items:center;font-weight:800;color:var(--mg-muted);}
.lm-rules-edit-grid{
  display:grid;
  grid-template-columns:150px minmax(220px,1fr) auto;
  gap:10px;
  align-items:end;
}
.lm-rules-edit-grid .lm-rules-text-field{grid-column:1 / -1;}
.lm-rules-edit-grid > .mgmt-btn{justify-self:start;}
.lm-rules-edit-existing{
  grid-template-columns:120px minmax(220px,1fr) 100px;
  margin-top:12px;
}
.lm-rules-row-actions{grid-column:1 / -1;display:flex;justify-content:flex-end;}
.lm-rules-filter{min-width:min(360px,100%);}
.lm-rules-list{display:grid;gap:10px;}
.lm-rule-item{
  border:1px solid var(--mg-border);
  border-radius:16px;
  background:var(--mg-panel);
  overflow:hidden;
}
.lm-rule-item[hidden]{display:none!important;}
.lm-rule-item summary{
  list-style:none;
  display:grid;
  grid-template-columns:minmax(58px,auto) minmax(160px,.55fr) minmax(220px,1fr);
  gap:12px;
  align-items:start;
  padding:13px 14px;
  cursor:pointer;
}
.lm-rule-item summary::-webkit-details-marker{display:none;}
.lm-rule-number{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  padding:5px 9px;
  border-radius:999px;
  background:#eef4ff;
  border:1px solid #c7d7fe;
  color:#155eef;
  font-weight:950;
  font-size:.86rem;
  white-space:nowrap;
}
.lm-rule-heading{font-weight:950;color:var(--mg-text);}
.lm-rule-preview{color:var(--mg-muted);font-size:.9rem;line-height:1.35;}
.lm-rule-body-preview{
  border-top:1px solid var(--mg-border);
  padding:14px 16px;
  color:var(--mg-text);
  line-height:1.55;
  background:var(--mg-panel-2);
  white-space:normal;
}
.lm-rule-item > form{padding:14px 16px;border-top:1px solid var(--mg-border);}
.lm-rules-delete-form{display:flex;justify-content:flex-end;background:var(--mg-panel);}
.lm-rules-no-match{margin-top:10px;}
@media(max-width:980px){
  .lm-rules-hero{grid-template-columns:1fr;}
  .lm-rules-doc-form{grid-template-columns:1fr;}
  .lm-rules-import-form{grid-template-columns:1fr;}
}
@media(max-width:760px){
  .lm-rules-edit-grid,
  .lm-rules-edit-existing{grid-template-columns:1fr;}
  .lm-rule-item summary{grid-template-columns:auto 1fr;}
  .lm-rule-preview{grid-column:2;}
  .lm-rules-import-actions{justify-content:flex-start;}
}

/* Rules live ordering/delete refinements */
.lm-rule-item{position:relative;}
.lm-rule-row{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px 14px;}
.lm-rule-drag{width:34px;height:34px;border:1px solid var(--mg-border);border-radius:12px;background:var(--mg-panel-2);color:var(--mg-muted);display:inline-grid;place-items:center;cursor:grab;}
.lm-rule-drag:active{cursor:grabbing;}
.lm-rule-inline-delete{display:inline-flex;gap:6px;align-items:center;white-space:nowrap;}
.lm-rule-inline-delete.is-confirming{background:#fee2e2;border-color:#fecaca;color:#991b1b;}
.lm-rule-status{margin:0 0 10px;color:var(--mg-muted);font-size:.9rem;}
.lm-rule-status.is-error{color:#b42318;font-weight:800;}
.lm-rule-item.is-dragging{opacity:.6;}
.lm-rule-item.is-deleting{opacity:.55;pointer-events:none;}
@media (max-width: 760px){.lm-rule-row{grid-template-columns:auto minmax(0,1fr);}.lm-rule-inline-delete{grid-column:1 / -1;justify-content:center}.lm-rule-preview{grid-column:1 / -1!important;}}

/* ------------------------------------------------------------
   Restore overrides after Rules inline patch
   Keeps League Setup county pills and League Preferences layout
   ------------------------------------------------------------ */
.lm-preferences-page{display:grid;gap:16px;}
.lm-preferences-savebar{position:sticky;top:76px;z-index:12;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border:1px solid var(--mg-border);border-radius:18px;background:rgba(255,255,255,.94);box-shadow:0 10px 26px rgba(15,23,42,.08);backdrop-filter:blur(10px);}
[data-theme="dark"] .lm-preferences-savebar{background:rgba(15,23,42,.92);}
.lm-preferences-savebar>div{display:grid;gap:2px;min-width:0;}
.lm-preferences-savebar code{font-weight:900;color:var(--mg-accent);}
.lm-preferences-savebar--bottom{position:static;margin-top:2px;}
.lm-pref-card{overflow:visible;}
.lm-pref-card .mgmt-section-head{padding-bottom:12px;margin-bottom:14px;border-bottom:1px solid var(--mg-border);}
.lm-preferences-page .mgmt-form-grid{align-items:start;}
.lm-preferences-page .mgmt-field{display:grid;gap:7px;width:100%;min-width:0;padding:11px 12px;border:1px solid var(--mg-border);border-radius:18px;background:linear-gradient(180deg,var(--mg-panel),var(--mg-panel-2));color:var(--mg-text);box-shadow:0 1px 2px rgba(16,24,40,.04);}
.lm-preferences-page .mgmt-field>span{display:block;font-size:.76rem;line-height:1.2;text-transform:uppercase;letter-spacing:.055em;color:var(--mg-muted);font-weight:900;}
.lm-preferences-page .mgmt-field input,.lm-preferences-page .mgmt-field select,.lm-preferences-page .mgmt-field textarea{width:100%;min-width:0;min-height:42px;margin:0;padding:9px 12px;border:1px solid var(--mg-border);border-radius:14px;background:var(--mg-panel-2);color:var(--mg-text);font:inherit;font-weight:700;box-shadow:inset 0 1px 0 rgba(255,255,255,.03);}
.lm-preferences-page .mgmt-field textarea{min-height:110px;resize:vertical;line-height:1.45;}
.lm-preferences-page .mgmt-field select{appearance:none;padding-right:38px;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 18px) 18px,calc(100% - 13px) 18px;background-size:5px 5px,5px 5px;background-repeat:no-repeat;}
.lm-preferences-page .mgmt-field input:focus,.lm-preferences-page .mgmt-field select:focus,.lm-preferences-page .mgmt-field textarea:focus{outline:0;border-color:var(--mg-accent);box-shadow:0 0 0 4px rgba(11,92,171,.14);}
.lm-preferences-page .mgmt-field small{display:block;margin:0;line-height:1.35;font-weight:700;color:var(--mg-muted);}
.lm-toggle{display:grid;grid-template-columns:auto minmax(0,1fr);gap:3px 10px;align-items:start;padding:13px 14px;border:1px solid var(--mg-border);border-radius:18px;background:linear-gradient(180deg,var(--mg-panel),var(--mg-panel-2));box-shadow:0 1px 2px rgba(16,24,40,.04);font-weight:900;}
.lm-toggle input{width:18px;height:18px;margin-top:2px;accent-color:var(--mg-accent);}
.lm-toggle span{line-height:1.25;}
.lm-toggle small{grid-column:2;color:var(--mg-muted);font-weight:700;line-height:1.35;}
.lm-toggle:has(input:disabled){opacity:.65;}
.lm-logo-preview{display:flex;align-items:center;gap:12px;min-height:72px;padding:11px 12px;border:1px dashed var(--mg-border);border-radius:18px;background:var(--mg-panel-2);}
.lm-logo-preview img{width:58px;height:58px;object-fit:contain;border-radius:14px;border:1px solid var(--mg-border);background:#fff;}
.lm-pref-advanced{padding:0;overflow:hidden;}
.lm-pref-advanced>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 18px;background:var(--mg-panel);}
.lm-pref-advanced>summary::-webkit-details-marker{display:none;}
.lm-pref-advanced>summary span{display:grid;gap:4px;}
.lm-pref-advanced>summary small{color:var(--mg-muted);font-weight:700;}
.lm-pref-advanced[open]>summary{border-bottom:1px solid var(--mg-border);}
.lm-pref-advanced-grid{padding:16px 18px 18px;}
@media (max-width:760px){.lm-preferences-savebar{position:static;align-items:stretch;flex-direction:column}.lm-preferences-savebar .mgmt-btn{width:100%;justify-content:center}.lm-logo-preview{align-items:flex-start}.lm-toggle{grid-column:span 12!important}}

/* Compact League Preferences refresh */
.lm-preferences-page--compact{gap:12px;max-width:1500px}
.lm-preferences-savebar--compact{top:72px;padding:10px 12px;border-radius:16px}
.lm-preferences-savebar--compact code{word-break:break-word}
.lm-slug-status{display:inline-flex;margin-top:3px;font-size:.78rem;font-weight:900;color:var(--mg-muted)}
.lm-slug-status.is-available{color:var(--mg-success)}
.lm-slug-status.is-taken{color:var(--mg-danger)}
.lm-slug-status.is-checking{color:var(--mg-muted)}
.lm-pref-card--compact{padding:14px!important}
.lm-pref-card--compact .mgmt-section-head{padding-bottom:8px!important;margin-bottom:10px!important}
.lm-pref-card--compact .mgmt-section-head h2{font-size:1rem;margin:0}
.lm-pref-card--compact .mgmt-section-head .mgmt-muted{font-size:.82rem}
.lm-compact-grid{gap:9px!important}
.lm-preferences-page--compact .mgmt-field{padding:8px 10px;border-radius:14px;gap:5px}
.lm-preferences-page--compact .mgmt-field>span{font-size:.68rem;letter-spacing:.045em;display:flex;align-items:center;gap:5px;line-height:1.1}
.lm-preferences-page--compact .mgmt-field input,
.lm-preferences-page--compact .mgmt-field select,
.lm-preferences-page--compact .mgmt-field textarea{min-height:36px;padding:7px 10px;border-radius:11px;font-size:.9rem}
.lm-preferences-page--compact .mgmt-field textarea{min-height:90px}
.lm-preferences-page--compact .mgmt-field small{font-size:.74rem;line-height:1.25}
.lm-field--league-name{grid-column:span 4!important}
.lm-field--public-name{grid-column:span 5!important}
.lm-field--abbr{grid-column:span 1!important;min-width:110px}
.lm-field--abbr input{text-transform:uppercase;text-align:center;letter-spacing:.08em}
.lm-logo-preview--compact{min-height:auto;padding:8px 10px;border-radius:14px;display:flex;align-items:center;gap:10px}
.lm-logo-preview--compact img{width:44px;height:44px;border-radius:10px}
.lm-help{display:inline-grid;place-items:center;width:15px;height:15px;border-radius:999px;border:1px solid var(--mg-border);background:var(--mg-panel-2);color:var(--mg-muted);font-size:.65rem;font-weight:900;line-height:1;text-transform:none;letter-spacing:0;cursor:help;vertical-align:middle;flex:0 0 auto}
.lm-help:hover,.lm-help:focus{color:var(--mg-accent);border-color:rgba(11,92,171,.35);box-shadow:0 0 0 3px rgba(11,92,171,.1);outline:0}
.lm-switch{display:grid;grid-template-columns:38px minmax(0,1fr);grid-template-rows:auto auto;column-gap:9px;row-gap:1px;align-items:center;padding:9px 10px;border:1px solid var(--mg-border);border-radius:14px;background:linear-gradient(180deg,var(--mg-panel),var(--mg-panel-2));box-shadow:0 1px 2px rgba(16,24,40,.04);min-width:0}
.lm-switch input{position:absolute;opacity:0;pointer-events:none}
.lm-switch>span{grid-row:1 / span 2;position:relative;width:38px;height:22px;border-radius:999px;background:rgba(100,116,139,.28);box-shadow:inset 0 1px 2px rgba(15,23,42,.18);transition:.18s ease}
.lm-switch>span::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:999px;background:#fff;box-shadow:0 1px 4px rgba(15,23,42,.24);transition:.18s ease}
.lm-switch input:checked+span{background:var(--mg-accent)}
.lm-switch input:checked+span::after{transform:translateX(16px)}
.lm-switch input:focus+span{box-shadow:0 0 0 4px rgba(11,92,171,.14), inset 0 1px 2px rgba(15,23,42,.18)}
.lm-switch input:disabled+span{opacity:.5}
.lm-switch em{font-style:normal;font-weight:900;font-size:.86rem;line-height:1.15;color:var(--mg-text);display:flex;align-items:center;gap:5px;min-width:0}
.lm-switch small{grid-column:2;color:var(--mg-muted);font-weight:700;font-size:.74rem;line-height:1.2}
.lm-switch:has(input:disabled){opacity:.7}
.lm-pref-advanced.lm-pref-card--compact>summary{padding:12px 14px}
.lm-pref-advanced.lm-pref-card--compact .lm-pref-advanced-grid{padding:12px 14px 14px}
@media(max-width:1100px){
  .lm-field--league-name,.lm-field--public-name,.lm-field--abbr{grid-column:span 12!important}
  .lm-preferences-page--compact .mgmt-col-2,
  .lm-preferences-page--compact .mgmt-col-3,
  .lm-preferences-page--compact .mgmt-col-4,
  .lm-preferences-page--compact .mgmt-col-5,
  .lm-preferences-page--compact .mgmt-col-6{grid-column:span 6!important}
}
@media(max-width:700px){
  .lm-preferences-page--compact .mgmt-col-2,
  .lm-preferences-page--compact .mgmt-col-3,
  .lm-preferences-page--compact .mgmt-col-4,
  .lm-preferences-page--compact .mgmt-col-5,
  .lm-preferences-page--compact .mgmt-col-6{grid-column:span 12!important}
  .lm-switch{grid-column:span 12!important}
  .lm-preferences-savebar--compact{position:static;align-items:stretch;flex-direction:column}
}

/* League Preferences tidy refinements */
.lm-preferences-page--compact .mgmt-col-1{grid-column:span 1!important}
.lm-preferences-page--compact .mgmt-col-5{grid-column:span 5!important}
.lm-preferences-page--compact .lm-field--public-name input{min-width:0}
.lm-preferences-page--compact .lm-field--abbr input{text-align:center;letter-spacing:.04em;font-size:.92rem}
.lm-preferences-page--compact .lm-pricing-info{appearance:none;border:0;background:transparent;color:var(--mg-muted);cursor:help;margin-left:4px;padding:1px;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1}
.lm-preferences-page--compact .lm-pricing-info:hover,.lm-preferences-page--compact .lm-pricing-info:focus{color:var(--mg-accent);outline:0}
.lm-global-tip,.pricing_global_tip.lm-global-tip{position:absolute;z-index:100000;width:min(320px,calc(100vw - 24px));padding:11px 13px;border-radius:13px;background:#111827;color:#fff;font-size:.88rem;line-height:1.36;box-shadow:0 16px 34px rgba(0,0,0,.26);pointer-events:none}
.lm-switch.is-locked{opacity:.55;filter:saturate(.75)}
.lm-switch.is-locked em{color:var(--mg-muted)}
.lm-preferences-page--compact .lm-logo-preview img[hidden]{display:none!important}
.lm-preferences-page--compact .lm-logo-preview img{background:#fff}
.lm-preferences-page--compact option:disabled{color:#9ca3af;background:#f3f4f6}
@media (max-width:980px){
  .lm-preferences-page--compact .mgmt-col-1,
  .lm-preferences-page--compact .mgmt-col-2,
  .lm-preferences-page--compact .mgmt-col-3,
  .lm-preferences-page--compact .mgmt-col-4,
  .lm-preferences-page--compact .mgmt-col-5,
  .lm-preferences-page--compact .mgmt-col-6{grid-column:span 6!important}
}
@media (max-width:640px){
  .lm-preferences-page--compact .mgmt-col-1,
  .lm-preferences-page--compact .mgmt-col-2,
  .lm-preferences-page--compact .mgmt-col-3,
  .lm-preferences-page--compact .mgmt-col-4,
  .lm-preferences-page--compact .mgmt-col-5,
  .lm-preferences-page--compact .mgmt-col-6{grid-column:span 12!important}
}

/* League Preferences equal layout refinement */
.lm-preferences-page .mgmt-form-grid,
.lm-preferences-page .lm-compact-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:10px;
  align-items:stretch;
}
.lm-preferences-page .mgmt-field,
.lm-preferences-page .lm-switch{
  height:100%;
}
.lm-preferences-page .mgmt-col-12{grid-column:span 12!important;}
.lm-preferences-page .mgmt-col-8{grid-column:span 8!important;}
.lm-preferences-page .mgmt-col-6{grid-column:span 6!important;}
.lm-preferences-page .mgmt-col-5{grid-column:span 5!important;}
.lm-preferences-page .mgmt-col-4{grid-column:span 4!important;}
.lm-preferences-page .mgmt-col-3{grid-column:span 3!important;}
.lm-preferences-page .mgmt-col-2{grid-column:span 2!important;}
.lm-preferences-page .mgmt-col-1{grid-column:span 1!important;}
@media (max-width:1100px){
  .lm-preferences-page .mgmt-col-1,
  .lm-preferences-page .mgmt-col-2,
  .lm-preferences-page .mgmt-col-3,
  .lm-preferences-page .mgmt-col-4,
  .lm-preferences-page .mgmt-col-5,
  .lm-preferences-page .mgmt-col-6{grid-column:span 6!important;}
}
@media (max-width:680px){
  .lm-preferences-page .mgmt-form-grid,
  .lm-preferences-page .lm-compact-grid{grid-template-columns:1fr;}
  .lm-preferences-page .mgmt-col-1,
  .lm-preferences-page .mgmt-col-2,
  .lm-preferences-page .mgmt-col-3,
  .lm-preferences-page .mgmt-col-4,
  .lm-preferences-page .mgmt-col-5,
  .lm-preferences-page .mgmt-col-6,
  .lm-preferences-page .mgmt-col-8,
  .lm-preferences-page .mgmt-col-12{grid-column:1/-1!important;}
}

/* League Preferences behaviour fixes */
.lm-preferences-page--compact .pricing_info{appearance:none;border:0;background:transparent;color:var(--mg-muted);cursor:help;margin-left:6px;padding:2px;display:inline-flex;vertical-align:middle;position:relative;align-items:center;justify-content:center;line-height:1;}
.lm-preferences-page--compact .pricing_info::before,
.lm-preferences-page--compact .pricing_info::after{display:none!important;}
.lm-preferences-page--compact .pricing_info:hover,
.lm-preferences-page--compact .pricing_info:focus-visible{color:var(--mg-accent);outline:0;}
.pricing_global_tip.lm-global-tip{position:absolute;z-index:100000;width:min(320px,calc(100vw - 24px));padding:11px 13px;border-radius:13px;background:#111827;color:#fff;font-size:.88rem;line-height:1.36;box-shadow:0 16px 34px rgba(0,0,0,.26);pointer-events:none;}
.lm-preferences-page .mgmt-field.is-locked,
.lm-preferences-page .lm-switch.is-locked{opacity:.56;filter:saturate(.7);}
.lm-preferences-page .mgmt-field.is-locked select,
.lm-preferences-page .mgmt-field.is-locked input,
.lm-preferences-page .lm-switch.is-locked input+span{cursor:not-allowed;}

/* League Preferences behaviour fixes */
.lm-preferences-page--compact .pricing_info{
  appearance:none;
  border:0;
  background:transparent;
  color:var(--mg-muted);
  cursor:help;
  margin-left:6px;
  padding:2px;
  display:inline-flex;
  vertical-align:middle;
  position:relative;
  align-items:center;
  justify-content:center;
  line-height:1;
  overflow:visible;
}
.lm-preferences-page--compact .pricing_info::after{
  content:attr(data-info);
  position:absolute;
  left:50%;
  bottom:calc(100% + 10px);
  transform:translateX(-50%);
  width:min(320px,70vw);
  padding:11px 13px;
  border-radius:13px;
  background:#111827;
  color:#fff;
  font-size:.88rem;
  font-weight:500;
  line-height:1.36;
  text-align:left;
  box-shadow:0 16px 34px rgba(0,0,0,.26);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  z-index:100000;
  white-space:normal;
}
.lm-preferences-page--compact .pricing_info::before{
  content:"";
  position:absolute;
  left:50%;
  bottom:calc(100% + 4px);
  transform:translateX(-50%);
  border:6px solid transparent;
  border-top-color:#111827;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  z-index:100001;
}
.lm-preferences-page--compact .pricing_info:hover::after,
.lm-preferences-page--compact .pricing_info:hover::before,
.lm-preferences-page--compact .pricing_info:focus-visible::after,
.lm-preferences-page--compact .pricing_info:focus-visible::before{
  opacity:1;
  visibility:visible;
}
.lm-preferences-page--compact .pricing_info:hover,
.lm-preferences-page--compact .pricing_info:focus-visible{color:var(--mg-accent);outline:0;}
.lm-preferences-page--compact .is-locked{
  opacity:.55;
  filter:grayscale(.15);
}
.lm-preferences-page--compact .is-locked input,
.lm-preferences-page--compact .is-locked select,
.lm-preferences-page--compact .is-locked textarea,
.lm-preferences-page--compact select option:disabled{
  cursor:not-allowed;
}

/* League Preferences deep fix: pricing-style tooltips and locked dependent fields */
.lm-preferences-page .pricing_info{
  appearance:none;
  border:0;
  background:transparent;
  color:var(--mg-muted, #64748b);
  cursor:help;
  margin-left:6px;
  padding:2px;
  display:inline-flex;
  vertical-align:middle;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.lm-preferences-page .pricing_info:hover,
.lm-preferences-page .pricing_info:focus-visible{color:var(--mg-accent, #2563eb);outline:0;}
.lm-preferences-page .pricing_info::before,
.lm-preferences-page .pricing_info::after{display:none!important;content:none!important;}
.pricing_global_tip{
  position:absolute;
  z-index:100000;
  width:min(320px,calc(100vw - 24px));
  padding:11px 13px;
  border-radius:13px;
  background:#111827;
  color:#fff;
  font-size:.88rem;
  font-weight:500;
  line-height:1.36;
  text-align:left;
  box-shadow:0 16px 34px rgba(0,0,0,.26);
  pointer-events:none;
}
.lm-preferences-page .lm-js-lock.is-locked,
.lm-preferences-page [data-lm-lock-if-unchecked].is-locked{
  opacity:.56;
  filter:grayscale(.12) saturate(.75);
}
.lm-preferences-page .lm-js-lock.is-locked input,
.lm-preferences-page .lm-js-lock.is-locked select,
.lm-preferences-page [data-lm-lock-if-unchecked].is-locked input,
.lm-preferences-page [data-lm-lock-if-unchecked].is-locked select{
  cursor:not-allowed!important;
}
.lm-preferences-page .lm-tie-break-select option:disabled{color:#94a3b8;background:#f1f5f9;}

/* League Preferences identity polish */
.lm-preferences-page .lm-identity-card{overflow:visible;}
.lm-preferences-page .lm-identity-grid{
  grid-template-columns:repeat(12,minmax(0,1fr));
  align-items:stretch;
}
.lm-preferences-page .lm-identity-grid .lm-field--league-name{grid-column:span 4!important;}
.lm-preferences-page .lm-identity-grid .lm-field--public-name{grid-column:span 4!important;}
.lm-preferences-page .lm-identity-grid .lm-field--abbr{grid-column:span 2!important;min-width:0;}
.lm-preferences-page .lm-identity-grid .lm-field--logo{grid-column:span 2!important;min-width:0;}
.lm-preferences-page .lm-identity-grid .lm-field--logo-preview{grid-column:1/-1!important;}
.lm-preferences-page .lm-field--abbr input{text-align:center;text-transform:uppercase;letter-spacing:.07em;font-weight:900;}
.lm-preferences-page .lm-field--logo input[type="file"]{width:100%;max-width:100%;font-size:.82rem;}
.lm-preferences-page .lm-logo-picker-row{display:flex;align-items:center;min-width:0;}
.lm-preferences-page .lm-logo-preview--compact{border-style:dashed;background:var(--mg-panel-2,#f8fafc);}
.lm-preferences-page .lm-logo-preview--compact img{width:52px;height:52px;object-fit:contain;}
.lm-preferences-page .mgmt-field.is-error{border-color:#ef4444!important;box-shadow:0 0 0 3px rgba(239,68,68,.11);}
.lm-preferences-page .mgmt-field.is-error input{border-color:#ef4444!important;}
.lm-preferences-page .lm-field-error{display:block;color:#dc2626!important;font-weight:800;font-size:.76rem;line-height:1.25;margin-top:2px;}
.lm-preferences-page .lm-field-error[hidden]{display:none!important;}
.lm-preferences-page .lm-slug-status.is-taken{color:#dc2626;font-weight:900;}
.lm-preferences-page .lm-slug-status.is-available{color:#15803d;font-weight:900;}
@media (max-width:1180px){
  .lm-preferences-page .lm-identity-grid .lm-field--league-name,
  .lm-preferences-page .lm-identity-grid .lm-field--public-name{grid-column:span 6!important;}
  .lm-preferences-page .lm-identity-grid .lm-field--abbr,
  .lm-preferences-page .lm-identity-grid .lm-field--logo{grid-column:span 6!important;}
}
@media (max-width:720px){
  .lm-preferences-page .lm-identity-grid .lm-field--league-name,
  .lm-preferences-page .lm-identity-grid .lm-field--public-name,
  .lm-preferences-page .lm-identity-grid .lm-field--abbr,
  .lm-preferences-page .lm-identity-grid .lm-field--logo{grid-column:1/-1!important;}
}

/* League setup selected county builder - restored pill styling */
.lm-region-builder{gap:14px}
.lm-region-builder__controls{
  display:grid;
  grid-template-columns:minmax(170px, 1fr) minmax(210px, 1.35fr) auto;
  gap:12px;
  align-items:end;
}
.lm-form-field{display:grid;gap:7px;min-width:0}
.lm-form-field label{
  font-size:.82rem;
  font-weight:900;
  color:var(--mg-text);
}
.lm-region-builder__add-field .mgmt-btn{height:43px;white-space:nowrap}
.lm-region-selected-panel{
  border:1px solid var(--mg-border);
  border-radius:18px;
  background:var(--mg-panel-2);
  padding:13px;
}
.lm-selected-region-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.lm-selected-region{
  display:inline-flex!important;
  align-items:center;
  gap:7px;
  border:1px solid #b2ccff;
  background:#eef4ff;
  color:#155eef;
  border-radius:999px;
  padding:7px 8px 7px 12px;
  font-weight:900;
  max-width:100%;
  line-height:1.1;
}
.lm-selected-region__name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.lm-selected-region__country{
  color:#526071;
  font-size:.76rem;
  font-weight:800;
  border-left:1px solid rgba(21,94,239,.18);
  padding-left:7px;
}
.lm-selected-region__remove{
  width:24px;
  height:24px;
  border:0;
  border-radius:999px;
  background:rgba(21,94,239,.12);
  color:#155eef;
  font-size:1.1rem;
  font-weight:900;
  line-height:1;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  padding:0;
}
.lm-selected-region__remove:hover{background:rgba(21,94,239,.2)}
.lm-selected-region-empty{margin:10px 0 0}
.lm-selected-region-empty[hidden],
.lm-region-empty[hidden]{display:none!important}
.lm-country-select option[hidden]{display:none}
@media(max-width:760px){
  .lm-region-builder__controls{grid-template-columns:1fr;align-items:stretch}
  .lm-region-builder__add-field label{display:none}
  .lm-region-builder__add-field .mgmt-btn{width:100%}
}


/* League Management menu categories and Fixtures polish */
.mgmt-nav-group{margin-top:14px;}
.mgmt-nav-label{
  color:var(--mg-muted);
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.09em;
  text-transform:uppercase;
  padding:0 12px 6px;
}
.mgmt-nav-group + .mgmt-nav-group{border-top:1px solid rgba(148,163,184,.16);padding-top:12px;}
.lm-fixtures-page{display:grid;gap:16px;}
.lm-fixture-card{overflow:visible;}
.lm-fixture-card .mgmt-section-head{align-items:flex-start;gap:12px;margin-bottom:14px;}
.lm-fixture-form{align-items:end;}
.lm-fixture-form .mgmt-field{
  background:var(--mg-panel-2,#f8fafc);
  border:1px solid var(--mg-border,#d8e0eb);
  border-radius:16px;
  padding:10px 12px;
  box-shadow:0 8px 20px rgba(16,24,40,.035);
}
.lm-fixture-form .mgmt-field > span{
  color:var(--mg-muted,#64748b);
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.02em;
}
.lm-fixture-form input,
.lm-fixture-form select,
.lm-fixture-form textarea{
  width:100%;
  min-height:40px;
  border:1px solid var(--mg-border,#d8e0eb);
  border-radius:12px;
  background:var(--mg-panel,#fff);
}
.lm-fixture-form textarea{min-height:72px;resize:vertical;}
.lm-fixture-filter-form{grid-template-columns:repeat(12,minmax(0,1fr));}
.lm-fixture-list-card .mgmt-list{display:grid;gap:10px;}
.lm-fixture-item{
  display:block!important;
  border:1px solid var(--mg-border,#d8e0eb);
  border-radius:18px;
  background:var(--mg-panel,#fff);
  box-shadow:0 10px 24px rgba(16,24,40,.045);
  padding:0;
  overflow:hidden;
}
.lm-fixture-summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  padding:14px 16px;
}
.lm-fixture-summary::-webkit-details-marker{display:none;}
.lm-fixture-summary > span:first-child{display:grid;gap:4px;min-width:0;}
.lm-fixture-summary strong{color:var(--mg-text);font-size:1rem;line-height:1.25;}
.lm-fixture-summary strong + span{color:var(--mg-muted);font-size:.86rem;font-weight:700;}
.lm-fixture-summary .mgmt-pill{white-space:nowrap;}
.lm-fixture-edit-form{margin:0 16px 14px!important;padding-top:14px;border-top:1px solid rgba(148,163,184,.2);}
.lm-fixture-actions{display:flex;gap:8px;flex-wrap:wrap;}
.lm-fixture-remove-form{margin:0 16px 16px;}
.lm-fixture-remove-form .mgmt-btn{width:auto;}
@media(max-width:980px){
  .lm-fixture-form .mgmt-span-4,
  .lm-fixture-form .mgmt-span-3,
  .lm-fixture-filter-form .mgmt-span-2{grid-column:span 6!important;}
}
@media(max-width:680px){
  .lm-fixture-form .mgmt-span-4,
  .lm-fixture-form .mgmt-span-3,
  .lm-fixture-filter-form .mgmt-span-2{grid-column:1/-1!important;}
  .lm-fixture-summary{display:grid;}
  .lm-fixture-summary .mgmt-pill{justify-self:start;}
}

/* Fixtures page final layout polish + live filter states */
.lm-fixtures-page{display:grid;gap:14px;}
.lm-fixture-card{padding:16px 18px;border-radius:18px;}
.lm-fixture-card .mgmt-section-head{margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid rgba(148,163,184,.18);}
.lm-fixture-card .mgmt-section-head h2{margin:0 0 3px;font-size:1.05rem;letter-spacing:-.015em;}
.lm-fixture-card .mgmt-muted{font-size:.88rem;line-height:1.35;}
.lm-fixture-form{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:10px;align-items:end;}
.lm-fixture-form .mgmt-field{display:grid;gap:6px;min-width:0;width:100%;padding:9px 10px;border:1px solid var(--mg-border,#d8e0eb);border-radius:14px;background:linear-gradient(180deg,var(--mg-panel,#fff),var(--mg-panel-2,#f8fafc));box-shadow:0 1px 2px rgba(16,24,40,.04);}
.lm-fixture-form .mgmt-field > span{display:block;margin:0;color:var(--mg-muted,#64748b);font-size:.7rem;line-height:1.1;font-weight:900;letter-spacing:.055em;text-transform:uppercase;}
.lm-fixture-form input,.lm-fixture-form select,.lm-fixture-form textarea{width:100%;min-width:0;min-height:38px;margin:0;padding:8px 10px;border:1px solid var(--mg-border,#d8e0eb);border-radius:11px;background:var(--mg-panel-2,#f8fafc);color:var(--mg-text,#101828);font:inherit;font-weight:700;box-shadow:inset 0 1px 0 rgba(255,255,255,.04);}
.lm-fixture-form select{appearance:none;padding-right:34px;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 17px) 17px,calc(100% - 12px) 17px;background-size:5px 5px,5px 5px;background-repeat:no-repeat;}
.lm-fixture-form textarea{min-height:64px;resize:vertical;line-height:1.45;}
.lm-fixture-form input:focus,.lm-fixture-form select:focus,.lm-fixture-form textarea:focus{outline:0;border-color:var(--mg-accent,#155eef);box-shadow:0 0 0 4px rgba(21,94,239,.12);}
.lm-fixture-add .lm-fixture-form .mgmt-span-4{grid-column:span 4;}
.lm-fixture-add .lm-fixture-form .mgmt-span-3{grid-column:span 3;}
.lm-fixture-add .lm-fixture-form .mgmt-span-12{grid-column:1/-1;}
.lm-fixture-filter-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;align-items:end;}
.lm-fixture-filter-form .mgmt-field,.lm-fixture-filter-form .mgmt-span-2{grid-column:auto!important;}
.lm-fixture-filter-actions{display:flex;gap:8px;align-items:end;flex-wrap:wrap;grid-column:1/-1;}
.lm-fixture-filter-status{font-size:.82rem;font-weight:800;color:var(--mg-muted,#64748b);min-height:20px;display:flex;align-items:center;}
.lm-fixture-filter.is-loading{position:relative;}
.lm-fixture-filter.is-loading::after{content:'Updating fixtures…';position:absolute;right:18px;top:18px;padding:6px 10px;border-radius:999px;background:#eef4ff;color:#155eef;border:1px solid #c7d7fe;font-size:.78rem;font-weight:900;}
.lm-fixture-list-card.is-updating{opacity:.58;transition:opacity .16s ease;}
.lm-fixture-list-card .mgmt-list{display:grid;gap:10px;}
.lm-fixture-item{display:block!important;border:1px solid var(--mg-border,#d8e0eb);border-radius:16px;background:var(--mg-panel,#fff);box-shadow:0 8px 22px rgba(16,24,40,.04);padding:0;overflow:hidden;}
.lm-fixture-summary{cursor:pointer;list-style:none;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;padding:13px 14px;}
.lm-fixture-summary::-webkit-details-marker{display:none;}
.lm-fixture-summary > span:first-child{display:grid;gap:4px;min-width:0;}
.lm-fixture-summary strong{color:var(--mg-text,#101828);font-size:.98rem;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lm-fixture-summary strong + span{color:var(--mg-muted,#64748b);font-size:.84rem;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lm-fixture-summary .mgmt-pill{white-space:nowrap;justify-self:end;}
.lm-fixture-edit-form{margin:0 14px 12px!important;padding-top:12px;border-top:1px solid rgba(148,163,184,.2);}
.lm-fixture-edit-form .mgmt-span-4{grid-column:span 4;}
.lm-fixture-edit-form .mgmt-span-3{grid-column:span 3;}
.lm-fixture-edit-form .mgmt-span-12{grid-column:1/-1;}
.lm-fixture-actions{display:flex;gap:8px;flex-wrap:wrap;}
.lm-fixture-remove-form{margin:0 14px 14px;}
.lm-fixture-remove-form .mgmt-btn{width:auto;}
@media(max-width:1100px){.lm-fixture-add .lm-fixture-form .mgmt-span-4,.lm-fixture-edit-form .mgmt-span-4{grid-column:span 6;}.lm-fixture-add .lm-fixture-form .mgmt-span-3,.lm-fixture-edit-form .mgmt-span-3{grid-column:span 6;}}
@media(max-width:720px){.lm-fixture-card{padding:14px;}.lm-fixture-add .lm-fixture-form .mgmt-span-4,.lm-fixture-add .lm-fixture-form .mgmt-span-3,.lm-fixture-edit-form .mgmt-span-4,.lm-fixture-edit-form .mgmt-span-3{grid-column:1/-1;}.lm-fixture-summary{grid-template-columns:1fr;}.lm-fixture-summary strong,.lm-fixture-summary strong + span{white-space:normal;}.lm-fixture-summary .mgmt-pill{justify-self:start;}.lm-fixture-filter-form{grid-template-columns:1fr;}.lm-fixture-filter.is-loading::after{position:static;display:inline-flex;margin-top:8px;}}


/* 2026-05-25: League Management mobile management layout polish
   Converts dense edit tables into stacked cards on small screens and stops
   club-edit grids from overflowing the phone viewport. */
@media (max-width:760px){
  .lm-divisions-page .mgmt-table-wrap,
  .lm-teams-page .mgmt-table-wrap{
    overflow:visible;
    border:0;
    background:transparent;
    box-shadow:none;
  }

  .lm-divisions-table,
  .lm-teams-table{
    min-width:0!important;
    width:100%;
    display:block;
    border-collapse:separate;
  }
  .lm-divisions-table thead,
  .lm-teams-table thead{display:none;}
  .lm-divisions-table tbody,
  .lm-teams-table tbody{display:grid;gap:12px;}
  .lm-divisions-table tr,
  .lm-teams-table tr{
    display:grid;
    gap:10px;
    padding:14px;
    border:1px solid var(--mg-border);
    border-radius:18px;
    background:var(--mg-panel-2);
    box-shadow:0 8px 24px rgba(16,24,40,.06);
  }
  .lm-divisions-table td,
  .lm-teams-table td{
    display:grid;
    grid-template-columns:88px minmax(0,1fr);
    gap:8px;
    align-items:center;
    border:0!important;
    padding:0!important;
    min-width:0;
  }
  .lm-divisions-table td::before,
  .lm-teams-table td::before{
    color:var(--mg-muted);
    font-size:.76rem;
    font-weight:900;
    letter-spacing:.045em;
    text-transform:uppercase;
  }
  .lm-divisions-table td:nth-child(1)::before{content:'Move';}
  .lm-divisions-table td:nth-child(2)::before{content:'Division';}
  .lm-divisions-table td:nth-child(3)::before{content:'Status';}
  .lm-divisions-table td:nth-child(4)::before{content:'Teams';}
  .lm-teams-table td:nth-child(1)::before{content:'Team';}
  .lm-teams-table td:nth-child(2)::before{content:'Club';}
  .lm-teams-table td:nth-child(3)::before{content:'Division';}
  .lm-teams-table td:nth-child(4)::before{content:'Status';}

  .lm-divisions-table .mgmt-actions-cell,
  .lm-teams-table .mgmt-actions-cell{
    display:flex!important;
    grid-template-columns:none;
    gap:8px;
    padding-top:10px!important;
    margin-top:2px;
    border-top:1px solid var(--mg-border)!important;
    white-space:normal;
  }
  .lm-divisions-table .mgmt-actions-cell::before,
  .lm-teams-table .mgmt-actions-cell::before{display:none;}
  .lm-divisions-table .mgmt-actions-cell form,
  .lm-teams-table .mgmt-actions-cell form{flex:1 1 0;margin:0;}
  .lm-divisions-table .mgmt-actions-cell .mgmt-btn,
  .lm-teams-table .mgmt-actions-cell .mgmt-btn{width:100%;justify-content:center;}
  .lm-divisions-table input,
  .lm-divisions-table select,
  .lm-teams-table input,
  .lm-teams-table select{min-width:0!important;}
  .lm-division-drag-handle{justify-self:start;}
}

@media (max-width:760px){
  .lm-club-card{overflow:visible;}
  .lm-club-card > summary{
    align-items:flex-start;
    padding:14px;
  }
  .lm-club-card > summary span{min-width:0;}
  .lm-club-card > summary strong,
  .lm-club-card > summary small{
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .lm-club-edit-form{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    padding:14px!important;
  }
  .lm-club-edit-form .mgmt-field{
    grid-column:auto!important;
    min-width:0;
    padding:10px!important;
    border-radius:14px;
  }
  .lm-club-edit-form .mgmt-field:has(textarea),
  .lm-club-edit-form .mgmt-col-6:has(textarea),
  .lm-club-edit-form .mgmt-col-12{
    grid-column:1 / -1!important;
  }
  .lm-club-edit-form input,
  .lm-club-edit-form select,
  .lm-club-edit-form textarea{
    min-width:0!important;
    width:100%!important;
    font-size:16px;
  }
  .lm-club-remove{
    padding:0 14px 14px!important;
    justify-content:stretch!important;
  }
  .lm-club-remove .mgmt-btn{width:100%;justify-content:center;}
}
@media (max-width:520px){
  .lm-club-edit-form{grid-template-columns:1fr!important;}
  .lm-club-edit-form .mgmt-field{grid-column:1 / -1!important;}
}

/* 2026-05-25: Manage Teams sort control polish */
.lm-team-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin:0 0 14px;
  padding:12px;
  border:1px solid var(--mg-border);
  border-radius:16px;
  background:var(--mg-panel-2);
}
.lm-team-toolbar__text{
  display:grid;
  gap:2px;
  min-width:180px;
}
.lm-team-toolbar__text strong{
  color:var(--mg-text);
  font-size:.98rem;
  line-height:1.2;
}
.lm-team-toolbar__text span{
  color:var(--mg-muted);
  font-size:.88rem;
  font-weight:700;
}
.lm-team-sort-form{
  display:flex;
  align-items:end;
  gap:8px;
  margin:0;
}
.lm-team-sort-control{
  display:grid;
  gap:6px;
  min-width:210px;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}
.lm-team-sort-control span{
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.045em;
  color:var(--mg-muted);
  font-weight:900;
}
.lm-team-sort-control select{
  width:100%;
  min-height:42px;
  padding:9px 38px 9px 12px;
  border:1px solid var(--mg-border);
  border-radius:14px;
  background-color:var(--mg-panel);
  color:var(--mg-text);
  font:inherit;
  font-weight:800;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
@media(max-width:700px){
  .lm-team-toolbar{
    align-items:stretch;
    padding:11px;
  }
  .lm-team-toolbar__text,
  .lm-team-sort-form,
  .lm-team-sort-control{
    width:100%;
    min-width:0;
  }
}

/* Division Active / Archived tabs */
.lm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 6px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  background: var(--surface-soft, #f8fafc);
}

.lm-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 14px;
  color: var(--muted, #667085);
  font-weight: 800;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.lm-tab:hover {
  transform: translateY(-1px);
  color: var(--text, #111827);
  background: rgba(255,255,255,.72);
}

.lm-tab.is-active {
  color: var(--primary, #2563eb);
  background: var(--surface, #fff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.lm-tab span {
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .10);
  color: inherit;
  font-size: .82em;
  text-align: center;
}

.lm-division-row--archived {
  opacity: .92;
}

@media (max-width: 720px) {
  .lm-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .lm-tab {
    width: 100%;
    padding-inline: 10px;
  }
}

/* League Management dashboard accuracy refresh */
.lm-dashboard-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.lm-dashboard-kpis .mgmt-kpi{
  position:relative;
  overflow:hidden;
  min-height:96px;
}
.lm-dashboard-kpis .mgmt-kpi__label{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
}
.lm-dashboard-kpis .mgmt-kpi__label i{
  width:26px;
  height:26px;
  border-radius:9px;
  display:inline-grid;
  place-items:center;
  background:#eef4ff;
  color:#155eef;
  flex:0 0 auto;
}
.lm-dashboard-overview{
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:18px;
  align-items:start;
}
.lm-dashboard-overview h2{
  margin:5px 0 5px;
}
.lm-dashboard-mini-stats{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.lm-dashboard-mini-stats a{
  text-decoration:none;
  color:inherit;
  border:1px solid var(--mg-border);
  background:var(--mg-panel-2);
  border-radius:15px;
  padding:11px 10px;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.lm-dashboard-mini-stats a:hover{
  transform:translateY(-1px);
  border-color:#b2ccff;
  box-shadow:0 12px 24px rgba(21,94,239,.08);
}
.lm-dashboard-mini-stats strong{
  display:block;
  font-size:1.28rem;
  line-height:1.1;
}
.lm-dashboard-mini-stats span{
  display:block;
  color:var(--mg-muted);
  font-size:.82rem;
  font-weight:800;
  margin-top:3px;
}
.lm-dashboard-billing-card{
  border:1px solid var(--mg-border);
  background:var(--mg-panel-2);
  border-radius:18px;
  padding:15px;
  display:grid;
  gap:10px;
}
.lm-dashboard-billing-card__status{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.lm-dashboard-invoice-line{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  border-top:1px solid var(--mg-border);
  padding-top:10px;
}
.lm-dashboard-leagues tr.is-selected td{
  background:#eef4ff;
}
.lm-dashboard-leagues td,
.lm-dashboard-leagues th{
  white-space:nowrap;
}
.lm-dashboard-leagues td:nth-child(2),
.lm-dashboard-leagues th:nth-child(2){
  min-width:180px;
  white-space:normal;
}
@media (max-width:1180px){
  .lm-dashboard-mini-stats{grid-template-columns:repeat(4,minmax(0,1fr));}
  .lm-dashboard-overview{grid-template-columns:1fr;}
}
@media (max-width:760px){
  .lm-dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .lm-dashboard-kpis .mgmt-kpi{min-height:82px;padding:10px 11px;}
  .lm-dashboard-kpis .mgmt-kpi__label{font-size:.78rem;line-height:1.15;}
  .lm-dashboard-kpis .mgmt-kpi__value{font-size:1.45rem;}
  .lm-dashboard-mini-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
  .lm-dashboard-billing-card{padding:12px;}
}

/* League Management dashboard simplified overview */
.lm-home-hero{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(320px,.95fr);
  gap:18px;
  align-items:stretch;
  margin-top:8px;
}
.lm-home-identity,
.lm-home-alert{
  border:1px solid var(--mg-border);
  border-radius:22px;
  background:var(--mg-panel);
  box-shadow:0 16px 36px rgba(15,23,42,.06);
}
.lm-home-identity{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:22px;
  align-items:center;
  padding:23px 26px;
}
.lm-home-crest{
  width:72px;
  height:72px;
  border-radius:24px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#eef4ff,#fff);
  color:#155eef;
  border:1px solid #d6e4ff;
  font-size:2rem;
}
.lm-home-title-wrap h1{
  margin:0 0 20px;
  font-size:1.72rem;
  letter-spacing:-.03em;
}
.lm-home-meta{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0;
  border-top:1px solid var(--mg-border);
  padding-top:16px;
}
.lm-home-meta span{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  column-gap:9px;
  row-gap:2px;
  align-items:center;
  min-width:0;
  padding:0 16px;
  border-right:1px solid var(--mg-border);
}
.lm-home-meta span:first-child{padding-left:0;}
.lm-home-meta span:last-child{border-right:0;padding-right:0;}
.lm-home-meta i{color:#155eef;font-size:1.05rem;grid-row:1 / span 2;}
.lm-home-meta small{
  display:block;
  color:var(--mg-muted);
  font-weight:800;
  font-size:.76rem;
}
.lm-home-meta strong{
  display:block;
  color:var(--mg-text);
  font-size:.92rem;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.lm-home-alert{
  padding:20px 22px;
  display:grid;
  gap:18px;
  background:linear-gradient(135deg,#fff7ed,#fff);
  border-color:#fed7aa;
}
.lm-home-alert__text{
  display:flex;
  gap:14px;
  align-items:flex-start;
}
.lm-home-alert__text > i{
  width:42px;
  height:42px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#ffedd5;
  color:#ea580c;
  flex:0 0 auto;
}
.lm-home-alert__text strong{
  display:block;
  color:#c2410c;
  font-size:1.05rem;
  margin-bottom:4px;
}
.lm-home-alert__text span{display:block;color:#6b7280;line-height:1.45;}
.lm-home-alert__actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.lm-home-stats{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}
.lm-home-stats a{
  min-height:112px;
  display:grid;
  align-content:center;
  gap:7px;
  padding:18px;
  border:1px solid var(--mg-border);
  border-radius:20px;
  background:var(--mg-panel);
  text-decoration:none;
  color:var(--mg-text);
  box-shadow:0 12px 28px rgba(15,23,42,.05);
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.lm-home-stats a:hover{
  transform:translateY(-2px);
  border-color:#b2ccff;
  box-shadow:0 18px 34px rgba(21,94,239,.10);
}
.lm-home-stats i{
  width:44px;
  height:44px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#eef4ff;
  color:#155eef;
  font-size:1.2rem;
}
.lm-home-stats span{
  color:var(--mg-muted);
  font-weight:800;
  font-size:.86rem;
}
.lm-home-stats strong{
  font-size:1.8rem;
  line-height:1;
  letter-spacing:-.04em;
}
.lm-home-stats a:last-child i{background:#ecfdf3;color:#079455;}
.lm-home-panels{
  display:grid;
  grid-template-columns:minmax(330px,.95fr) minmax(300px,.9fr) minmax(360px,1.15fr);
  gap:18px;
  margin-top:18px;
  align-items:stretch;
}
.lm-home-panels .mgmt-card{margin:0;}
.lm-home-panels h2{
  margin:0 0 18px;
  font-size:1.08rem;
}
.lm-home-progress{
  display:grid;
  grid-template-rows:auto 1fr auto;
}
.lm-home-progress__body{
  display:grid;
  grid-template-columns:170px minmax(0,1fr);
  gap:20px;
  align-items:center;
}
.lm-home-ring{
  width:148px;
  height:148px;
  border-radius:50%;
  background:var(--lm-ring,#e5e7eb);
  display:grid;
  place-items:center;
  position:relative;
  margin:auto;
}
.lm-home-ring::after{
  content:"";
  position:absolute;
  inset:18px;
  border-radius:50%;
  background:var(--mg-panel);
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.04);
}
.lm-home-ring strong{
  position:relative;
  z-index:1;
  font-size:1.9rem;
  letter-spacing:-.04em;
}
.lm-home-checks{display:grid;gap:13px;}
.lm-home-check{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight:800;
  color:#475467;
}
.lm-home-check span{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  color:#98a2b3;
}
.lm-home-check.is-done span{
  background:#dcfae6;
  color:#079455;
  border-radius:50%;
}
.lm-home-progress__footer{
  border-top:1px solid var(--mg-border);
  margin-top:22px;
  padding-top:16px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  color:var(--mg-muted);
  font-weight:800;
}
.lm-home-list{display:grid;gap:0;}
.lm-home-list__row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  text-decoration:none;
  color:inherit;
  padding:12px 0;
  border-bottom:1px solid var(--mg-border);
}
.lm-home-list__row:first-child{padding-top:0;}
.lm-home-list__row:last-child{border-bottom:0;}
.lm-home-list__row > i{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#eef4ff;
  color:#155eef;
}
.lm-home-list__row strong,
.lm-home-list__row small{display:block;}
.lm-home-list__row small{color:var(--mg-muted);font-weight:600;margin-top:2px;}
.lm-home-list__row em{font-style:normal;color:var(--mg-muted);font-size:.82rem;white-space:nowrap;}
.lm-home-panel-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top:16px;
  font-weight:900;
  color:#155eef;
  text-decoration:none;
}
.lm-home-status__rows{display:grid;}
.lm-home-status__rows > div{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:13px;
  align-items:center;
  padding:14px 0;
  border-bottom:1px solid var(--mg-border);
}
.lm-home-status__rows > div:first-child{padding-top:0;}
.lm-home-status__rows > div:last-child{border-bottom:0;}
.lm-home-status__rows i{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#f2f4f7;
  color:#667085;
}
.lm-home-status__rows strong,
.lm-home-status__rows small{display:block;}
.lm-home-status__rows small{color:var(--mg-muted);font-weight:600;margin-top:2px;}
.lm-home-status__rows a{
  color:#155eef;
  text-decoration:none;
  font-weight:900;
  white-space:nowrap;
}
.lm-home-status__rows em{
  color:#344054;
  font-style:normal;
  font-weight:800;
  max-width:230px;
  text-align:right;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media (max-width:1250px){
  .lm-home-hero{grid-template-columns:1fr;}
  .lm-home-panels{grid-template-columns:1fr 1fr;}
  .lm-home-status{grid-column:1/-1;}
  .lm-home-stats{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width:860px){
  .lm-home-identity{grid-template-columns:1fr;gap:14px;padding:18px;}
  .lm-home-meta{grid-template-columns:1fr 1fr;gap:12px;border-top:0;padding-top:0;}
  .lm-home-meta span{border:1px solid var(--mg-border);border-radius:14px;padding:10px!important;}
  .lm-home-alert__actions{grid-template-columns:1fr;}
  .lm-home-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
  .lm-home-panels{grid-template-columns:1fr;}
  .lm-home-progress__body{grid-template-columns:1fr;}
  .lm-home-status__rows > div{grid-template-columns:auto minmax(0,1fr);}
  .lm-home-status__rows a,
  .lm-home-status__rows em{grid-column:2;text-align:left;max-width:none;}
}
@media (max-width:520px){
  .lm-home-stats{grid-template-columns:1fr;}
  .lm-home-title-wrap h1{font-size:1.45rem;}
  .lm-home-meta{grid-template-columns:1fr;}
  .lm-home-crest{width:60px;height:60px;border-radius:20px;}
}

/* 2026-06-02 dashboard polish */
.lm-home-crest--logo{
  overflow:hidden;
  background:#fff;
  padding:7px;
}
.lm-home-crest--logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  border-radius:16px;
}
.lm-home-stats{
  gap:10px;
}
.lm-home-stats a{
  min-height:78px;
  grid-template-columns:auto minmax(0,1fr);
  grid-template-rows:auto auto;
  align-items:center;
  align-content:center;
  column-gap:12px;
  row-gap:2px;
  padding:13px 15px;
  border-radius:18px;
}
.lm-home-stats i{
  width:38px;
  height:38px;
  border-radius:14px;
  grid-row:1 / span 2;
  font-size:1.05rem;
}
.lm-home-stats span{
  font-size:.8rem;
  line-height:1.1;
}
.lm-home-stats strong{
  font-size:1.48rem;
}
.lm-home-alert__actions .mgmt-btn,
.lm-home-alert__actions a.mgmt-btn{
  justify-content:center;
  min-height:44px;
  font-weight:900;
}
.lm-home-alert__actions .mgmt-btn--primary,
.lm-home-alert__actions a.mgmt-btn--primary{
  color:#fff!important;
  background:#155eef!important;
  border-color:#155eef!important;
}
.lm-home-alert__actions .mgmt-btn--primary:hover,
.lm-home-alert__actions a.mgmt-btn--primary:hover{
  color:#fff!important;
  background:#004eeb!important;
  border-color:#004eeb!important;
}
.lm-home-alert__actions .mgmt-btn--soft,
.lm-home-alert__actions a.mgmt-btn--soft{
  color:#344054!important;
  background:#fff!important;
  border-color:#fed7aa!important;
}
.lm-home-alert__actions .mgmt-btn--soft:hover,
.lm-home-alert__actions a.mgmt-btn--soft:hover{
  color:#155eef!important;
  background:#fff7ed!important;
  border-color:#fdba74!important;
}
.lm-home-status__rows em{
  white-space:normal;
}
.lm-home-status__rows > div:first-child a:hover,
.lm-home-panel-link:hover,
.lm-home-list__row:hover{
  color:#155eef!important;
}
.lm-activity-page{max-width:980px;}
.lm-activity-timeline{display:grid;gap:0;margin-top:14px;}
.lm-activity-timeline__item{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:14px 0;
  border-bottom:1px solid var(--mg-border);
  text-decoration:none;
  color:inherit;
}
.lm-activity-timeline__item:last-child{border-bottom:0;}
.lm-activity-timeline__item:hover{color:inherit;background:rgba(21,94,239,.025);}
.lm-activity-timeline__item > i{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:#eef4ff;
  color:#155eef;
}
.lm-activity-timeline__item strong,
.lm-activity-timeline__item small{display:block;}
.lm-activity-timeline__item small{color:var(--mg-muted);font-weight:600;margin-top:2px;}
.lm-activity-timeline__item em{font-style:normal;color:var(--mg-muted);font-size:.86rem;white-space:nowrap;}
@media(max-width:760px){
  .lm-home-stats a{min-height:74px;padding:12px;}
  .lm-activity-timeline__item{grid-template-columns:auto minmax(0,1fr);}
  .lm-activity-timeline__item em{grid-column:2;}
}

/* League Management Results */
.lm-results-page{display:grid;gap:14px;}
.lm-result-card{padding:16px 18px;border-radius:18px;}
.lm-result-card .mgmt-section-head{margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid rgba(148,163,184,.18);}
.lm-result-card .mgmt-section-head h2{margin:0 0 3px;font-size:1.05rem;letter-spacing:-.015em;}
.lm-result-card .mgmt-muted{font-size:.88rem;line-height:1.35;}
.lm-result-form{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:10px;align-items:end;}
.lm-result-form .mgmt-field{display:grid;gap:6px;min-width:0;width:100%;padding:9px 10px;border:1px solid var(--mg-border,#d8e0eb);border-radius:14px;background:linear-gradient(180deg,var(--mg-panel,#fff),var(--mg-panel-2,#f8fafc));box-shadow:0 1px 2px rgba(16,24,40,.04);}
.lm-result-form .mgmt-field > span{display:block;margin:0;color:var(--mg-muted,#64748b);font-size:.7rem;line-height:1.1;font-weight:900;letter-spacing:.055em;text-transform:uppercase;}
.lm-result-form input,.lm-result-form select,.lm-result-form textarea{width:100%;min-width:0;min-height:38px;margin:0;padding:8px 10px;border:1px solid var(--mg-border,#d8e0eb);border-radius:11px;background:var(--mg-panel-2,#f8fafc);color:var(--mg-text,#101828);font:inherit;font-weight:700;box-shadow:inset 0 1px 0 rgba(255,255,255,.04);}
.lm-result-form select{appearance:none;padding-right:34px;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 17px) 17px,calc(100% - 12px) 17px;background-size:5px 5px,5px 5px;background-repeat:no-repeat;}
.lm-result-form textarea{min-height:74px;resize:vertical;line-height:1.45;}
.lm-result-form input:focus,.lm-result-form select:focus,.lm-result-form textarea:focus{outline:0;border-color:var(--mg-accent,#155eef);box-shadow:0 0 0 4px rgba(21,94,239,.12);}
.lm-result-filter-form{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;align-items:end;}
.lm-result-filter-form .mgmt-field,.lm-result-filter-form .mgmt-span-2{grid-column:auto!important;}
.lm-result-filter-actions{display:flex;gap:8px;align-items:end;flex-wrap:wrap;grid-column:1/-1;}
.lm-result-filter-status{font-size:.82rem;font-weight:800;color:var(--mg-muted,#64748b);min-height:20px;display:flex;align-items:center;}
.lm-result-filter.is-loading{position:relative;}
.lm-result-filter.is-loading::after{content:'Updating results…';position:absolute;right:18px;top:18px;padding:6px 10px;border-radius:999px;background:#eef4ff;color:#155eef;border:1px solid #c7d7fe;font-size:.78rem;font-weight:900;}
.lm-result-list-card.is-updating{opacity:.58;transition:opacity .16s ease;}
.lm-result-list{display:grid;gap:10px;}
.lm-result-item{display:block!important;border:1px solid var(--mg-border,#d8e0eb);border-radius:16px;background:var(--mg-panel,#fff);box-shadow:0 8px 22px rgba(16,24,40,.04);padding:0;overflow:hidden;}
.lm-result-summary{cursor:pointer;list-style:none;display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:13px 14px;}
.lm-result-summary::-webkit-details-marker{display:none;}
.lm-result-match{display:grid;gap:4px;min-width:0;}
.lm-result-match strong{color:var(--mg-text,#101828);font-size:.98rem;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lm-result-match strong + span{color:var(--mg-muted,#64748b);font-size:.84rem;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lm-result-score{font-size:1rem;font-weight:950;white-space:nowrap;color:var(--mg-text,#101828);background:#f8fafc;border:1px solid rgba(148,163,184,.2);border-radius:999px;padding:6px 10px;}
.lm-result-status{white-space:nowrap;justify-self:end;}
.lm-result-status--completed{background:#ecfdf3;color:#027a48;border-color:#abefc6;}
.lm-result-status--walkover{background:#f4f3ff;color:#5925dc;border-color:#d9d6fe;}
.lm-result-status--postponed{background:#fffaeb;color:#b54708;border-color:#fedf89;}
.lm-result-status--abandoned,.lm-result-status--cancelled{background:#fff1f3;color:#c01048;border-color:#fecdd6;}
.lm-result-meta{display:flex;gap:10px 16px;flex-wrap:wrap;margin:0 14px 10px;padding:10px 12px;border-radius:14px;background:#f8fafc;border:1px solid rgba(148,163,184,.18);color:var(--mg-muted,#64748b);font-size:.84rem;font-weight:800;}
.lm-result-meta span{display:inline-flex;gap:7px;align-items:center;}
.lm-result-edit-form{margin:0 14px 12px!important;padding-top:12px;border-top:1px solid rgba(148,163,184,.2);}
.lm-result-edit-form .mgmt-span-2{grid-column:span 2;}
.lm-result-edit-form .mgmt-span-3{grid-column:span 3;}
.lm-result-edit-form .mgmt-span-5{grid-column:span 5;}
.lm-result-edit-form .mgmt-span-12{grid-column:1/-1;}
.lm-result-actions{display:flex;gap:8px;flex-wrap:wrap;}
.lm-result-restricted{margin:0 14px 14px;padding:10px 12px;border-radius:14px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412!important;font-weight:800;}
.lm-result-form .mgmt-field[hidden]{display:none!important;}
.lm-result-actions .mgmt-btn:hover,.lm-result-filter-actions .mgmt-btn:hover{color:var(--mg-btn-hover-color,#fff);}
.lm-result-filter-actions .mgmt-btn:not(.mgmt-btn--primary):hover{color:var(--mg-text,#101828);background:#f8fafc;}
@media(max-width:1100px){.lm-result-edit-form .mgmt-span-2,.lm-result-edit-form .mgmt-span-3,.lm-result-edit-form .mgmt-span-5{grid-column:span 6;}.lm-result-summary{grid-template-columns:minmax(0,1fr) auto;}.lm-result-score{justify-self:start;}.lm-result-status{justify-self:end;}}
@media(max-width:720px){.lm-result-card{padding:14px;}.lm-result-filter-form{grid-template-columns:1fr;}.lm-result-edit-form .mgmt-span-2,.lm-result-edit-form .mgmt-span-3,.lm-result-edit-form .mgmt-span-5{grid-column:1/-1;}.lm-result-summary{grid-template-columns:1fr;}.lm-result-match strong,.lm-result-match strong + span{white-space:normal;}.lm-result-score,.lm-result-status{justify-self:start;}.lm-result-filter.is-loading::after{position:static;display:inline-flex;margin-top:8px;}.lm-result-meta{display:grid;}}

/* Results confirmation workflow */
.lm-result-pills{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.lm-result-confirm{white-space:nowrap;font-size:.72rem;}
.lm-result-confirm--pending{background:#fffaeb;color:#b54708;border-color:#fedf89;}
.lm-result-confirm--confirmed{background:#ecfdf3;color:#027a48;border-color:#abefc6;}
.lm-result-confirm--not_required{background:#eef4ff;color:#155eef;border-color:#c7d7fe;}
.lm-result-confirm-form{margin:0 14px 12px;padding:12px;border-radius:14px;border:1px solid #fedf89;background:#fffaeb;display:flex;align-items:center;justify-content:space-between;gap:12px;}
.lm-result-confirm-form div{display:grid;gap:2px;color:#92400e;font-size:.88rem;line-height:1.35;}
.lm-result-confirm-form div span{font-weight:750;color:#b45309;}
.lm-result-confirm-form .mgmt-btn:hover{color:#fff!important;}
@media(max-width:720px){.lm-result-confirm-form{display:grid;}.lm-result-pills{justify-content:flex-start;}}

/* Results page styling polish - match League Management cards/forms */
.lm-results-page{
  display:grid;
  gap:16px;
}
.lm-results-page .mgmt-card{
  overflow:visible;
}
.lm-result-card{
  padding:18px;
  border-radius:18px;
  border:1px solid var(--mg-border,#d8e0eb);
  background:var(--mg-panel,#fff);
  box-shadow:var(--mg-soft-shadow,0 10px 24px rgba(16,24,40,.045));
}
.lm-result-card .mgmt-section-head{
  align-items:flex-start;
  gap:12px;
  margin:0 0 14px;
  padding:0 0 12px;
  border-bottom:1px solid rgba(148,163,184,.18);
}
.lm-result-card .mgmt-section-head h2{
  margin:0 0 4px;
  font-size:1.08rem;
  line-height:1.2;
  letter-spacing:-.018em;
}
.lm-result-card .mgmt-section-head .mgmt-muted{
  margin:0;
  font-size:.9rem;
  line-height:1.4;
}
.lm-result-form{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:10px;
  align-items:end;
}
.lm-result-form .mgmt-field{
  display:grid;
  gap:6px;
  min-width:0;
  width:100%;
  margin:0;
  padding:10px 12px;
  border:1px solid var(--mg-border,#d8e0eb);
  border-radius:14px;
  background:var(--mg-panel-2,#f8fafc);
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.lm-result-form .mgmt-field > span{
  display:block;
  margin:0;
  color:var(--mg-muted,#64748b);
  font-size:.74rem;
  line-height:1.1;
  font-weight:900;
  letter-spacing:.035em;
  text-transform:none;
}
.lm-result-form input,
.lm-result-form select,
.lm-result-form textarea{
  width:100%;
  min-width:0;
  min-height:40px;
  margin:0;
  padding:8px 10px;
  border:1px solid var(--mg-border,#d8e0eb);
  border-radius:12px;
  background:var(--mg-panel,#fff);
  color:var(--mg-text,#101828);
  font:inherit;
  font-weight:700;
}
.lm-result-form select{
  appearance:none;
  padding-right:34px;
  background-color:var(--mg-panel,#fff);
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 17px) 18px,calc(100% - 12px) 18px;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
}
.lm-result-form textarea{
  min-height:74px;
  resize:vertical;
  line-height:1.45;
}
.lm-result-form input:focus,
.lm-result-form select:focus,
.lm-result-form textarea:focus{
  outline:0;
  border-color:var(--mg-accent,#155eef);
  box-shadow:0 0 0 4px rgba(21,94,239,.12);
}
.lm-result-filter-form{
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
}
.lm-result-filter-form .mgmt-field,
.lm-result-filter-form .mgmt-span-2{
  grid-column:auto!important;
}
.lm-result-filter-actions{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding-top:2px;
}
.lm-result-filter-status{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  color:var(--mg-muted,#64748b);
  font-size:.82rem;
  font-weight:800;
}
.lm-result-list-card .mgmt-empty{
  margin:0;
}
.lm-result-list{
  display:grid;
  gap:10px;
}
.lm-result-item{
  display:block!important;
  border:1px solid var(--mg-border,#d8e0eb);
  border-radius:16px;
  background:var(--mg-panel,#fff);
  box-shadow:0 8px 22px rgba(16,24,40,.04);
  padding:0;
  overflow:hidden;
}
.lm-result-item[open]{
  border-color:#bfd0f8;
  box-shadow:0 12px 30px rgba(21,94,239,.08);
}
.lm-result-summary{
  cursor:pointer;
  list-style:none;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:12px;
  align-items:center;
  padding:14px 15px;
}
.lm-result-summary:hover{
  background:var(--mg-panel-2,#f8fafc);
}
.lm-result-summary::-webkit-details-marker{display:none;}
.lm-result-match{
  display:grid;
  gap:4px;
  min-width:0;
}
.lm-result-match strong{
  color:var(--mg-text,#101828);
  font-size:.98rem;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.lm-result-match strong + span{
  color:var(--mg-muted,#64748b);
  font-size:.84rem;
  font-weight:750;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.lm-result-score{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:64px;
  min-height:34px;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.24);
  background:var(--mg-panel-2,#f8fafc);
  color:var(--mg-text,#101828);
  font-size:1rem;
  font-weight:950;
  white-space:nowrap;
}
.lm-result-pills{
  display:flex;
  gap:6px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.lm-result-status,
.lm-result-confirm{
  white-space:nowrap;
  font-size:.74rem;
  line-height:1.1;
}
.lm-result-status--completed{background:#ecfdf3;color:#027a48;border-color:#abefc6;}
.lm-result-status--walkover{background:#f4f3ff;color:#5925dc;border-color:#d9d6fe;}
.lm-result-status--postponed{background:#fffaeb;color:#b54708;border-color:#fedf89;}
.lm-result-status--abandoned,
.lm-result-status--cancelled{background:#fff1f3;color:#c01048;border-color:#fecdd6;}
.lm-result-confirm--pending{background:#fffaeb;color:#b54708;border-color:#fedf89;}
.lm-result-confirm--confirmed{background:#ecfdf3;color:#027a48;border-color:#abefc6;}
.lm-result-confirm--not_required{background:#eef4ff;color:#155eef;border-color:#c7d7fe;}
.lm-result-meta{
  display:flex;
  gap:8px 14px;
  flex-wrap:wrap;
  margin:0 14px 12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.18);
  background:var(--mg-panel-2,#f8fafc);
  color:var(--mg-muted,#64748b);
  font-size:.84rem;
  font-weight:800;
}
.lm-result-meta span{
  display:inline-flex;
  align-items:center;
  gap:7px;
}
.lm-result-edit-form{
  margin:0 14px 14px!important;
  padding-top:14px;
  border-top:1px solid rgba(148,163,184,.2);
}
.lm-result-edit-form .mgmt-span-2{grid-column:span 2;}
.lm-result-edit-form .mgmt-span-3{grid-column:span 3;}
.lm-result-edit-form .mgmt-span-5{grid-column:span 5;}
.lm-result-edit-form .mgmt-span-12{grid-column:1/-1;}
.lm-result-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.lm-result-confirm-form{
  margin:0 14px 12px;
  padding:12px 13px;
  border-radius:14px;
  border:1px solid #fedf89;
  background:#fffaeb;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.lm-result-confirm-form div{
  display:grid;
  gap:2px;
  color:#92400e;
  font-size:.88rem;
  line-height:1.35;
}
.lm-result-confirm-form div strong{color:#92400e;}
.lm-result-confirm-form div span{font-weight:750;color:#b45309;}
.lm-result-restricted{
  margin:0 14px 14px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid #fed7aa;
  background:#fff7ed;
  color:#9a3412!important;
  font-weight:800;
}
.lm-result-actions .mgmt-btn,
.lm-result-filter-actions .mgmt-btn,
.lm-result-confirm-form .mgmt-btn{
  color:inherit;
}
.lm-result-actions .mgmt-btn--primary,
.lm-result-filter-actions .mgmt-btn--primary,
.lm-result-confirm-form .mgmt-btn--primary{
  color:#fff!important;
}
.lm-result-actions .mgmt-btn:hover,
.lm-result-filter-actions .mgmt-btn:hover,
.lm-result-confirm-form .mgmt-btn:hover{
  color:var(--mg-text,#101828)!important;
  background:var(--mg-panel-2,#f8fafc);
}
.lm-result-actions .mgmt-btn--primary:hover,
.lm-result-filter-actions .mgmt-btn--primary:hover,
.lm-result-confirm-form .mgmt-btn--primary:hover{
  color:#fff!important;
  background:var(--mg-accent,#155eef);
}
.lm-result-filter.is-loading{position:relative;}
.lm-result-filter.is-loading::after{
  content:'Updating results…';
  position:absolute;
  right:18px;
  top:18px;
  padding:6px 10px;
  border-radius:999px;
  background:#eef4ff;
  color:#155eef;
  border:1px solid #c7d7fe;
  font-size:.78rem;
  font-weight:900;
}
.lm-result-list-card.is-updating{opacity:.6;transition:opacity .16s ease;}
@media(max-width:1100px){
  .lm-result-summary{grid-template-columns:minmax(0,1fr) auto;}
  .lm-result-score{justify-self:start;}
  .lm-result-pills{justify-content:flex-start;grid-column:1/-1;}
  .lm-result-edit-form .mgmt-span-2,
  .lm-result-edit-form .mgmt-span-3,
  .lm-result-edit-form .mgmt-span-5{grid-column:span 6;}
}
@media(max-width:720px){
  .lm-result-card{padding:14px;border-radius:16px;}
  .lm-result-filter-form{grid-template-columns:1fr;}
  .lm-result-edit-form .mgmt-span-2,
  .lm-result-edit-form .mgmt-span-3,
  .lm-result-edit-form .mgmt-span-5{grid-column:1/-1;}
  .lm-result-summary{grid-template-columns:1fr;gap:9px;}
  .lm-result-match strong,
  .lm-result-match strong + span{white-space:normal;}
  .lm-result-score,
  .lm-result-pills{justify-self:start;}
  .lm-result-meta{display:grid;}
  .lm-result-confirm-form{display:grid;}
  .lm-result-filter.is-loading::after{position:static;display:inline-flex;margin-top:8px;}
}

/* Results sport-format polish */
.lm-result-format-note{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;margin:.1rem 0 .25rem;}
.lm-tennis-pairs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin:.25rem 0 .75rem;}
.lm-tennis-pair-card{border:1px solid var(--line, #dfe5ef);border-radius:18px;background:rgba(255,255,255,.72);padding:1rem;}
.lm-tennis-pair-card h3{margin:0 0 .75rem;font-size:1rem;color:var(--text, #101827);}
.lm-tennis-pair-row{display:grid;grid-template-columns:2.5rem minmax(0,1fr) minmax(0,1fr);gap:.65rem;align-items:center;margin:.55rem 0;}
.lm-tennis-pair-row strong{display:flex;align-items:center;justify-content:center;border-radius:999px;background:#eef4ff;color:#155eef;min-height:2.2rem;}
.lm-tennis-pair-row select{width:100%;min-width:0;}
.lm-tennis-rubbers{border:1px solid var(--line, #dfe5ef);border-radius:18px;background:#fff;padding:1rem;margin:.25rem 0 .75rem;}
.lm-tennis-rubber-head,.lm-tennis-rubber-row{display:grid;grid-template-columns:1.2fr repeat(3,minmax(9.5rem,.8fr));gap:.75rem;align-items:center;}
.lm-tennis-rubber-head{font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#627084;padding:0 0 .5rem;border-bottom:1px solid var(--line, #dfe5ef);}
.lm-tennis-rubber-row{padding:.7rem 0;border-bottom:1px solid rgba(223,229,239,.75);}
.lm-tennis-rubber-row:last-of-type{border-bottom:0;}
.lm-tennis-rubber-row span{display:flex;gap:.35rem;align-items:center;}
.lm-tennis-rubber-row input{width:4.25rem;text-align:center;}
.lm-tennis-rubber-row b{color:#718096;font-weight:800;}
@media (max-width: 900px){
  .lm-tennis-pairs{grid-template-columns:1fr;}
  .lm-tennis-rubber-head{display:none;}
  .lm-tennis-rubber-row{grid-template-columns:1fr;gap:.45rem;}
  .lm-tennis-rubber-row span::before{min-width:4.2rem;color:#627084;font-weight:800;font-size:.8rem;}
  .lm-tennis-rubber-row span:nth-child(2)::before{content:'Set 1';}
  .lm-tennis-rubber-row span:nth-child(3)::before{content:'Set 2';}
  .lm-tennis-rubber-row span:nth-child(4)::before{content:'CTB';}
}

/* Results: tennis entry visibility and player notice polish */
.lm-tennis-pairs[hidden],
.lm-tennis-rubbers[hidden],
.lm-result-tennis-notice[hidden],
.lm-result-form [data-lm-score-field][hidden],
.lm-result-form [data-lm-walkover-field][hidden]{display:none!important;}
.lm-result-tennis-notice{
  display:grid;
  gap:.25rem;
  padding:.9rem 1rem;
  border:1px solid #fedf89;
  border-radius:16px;
  background:#fffaeb;
  color:#93370d;
  margin:.25rem 0 .75rem;
}
.lm-result-tennis-notice strong{font-weight:900;color:#7a2e0e;}
.lm-result-tennis-notice span{font-weight:700;line-height:1.45;}
.lm-result-format-note{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;}
.lm-result-edit-form .mgmt-btn:hover,
.lm-result-edit-form .mgmt-btn:focus{color:#fff!important;}
.lm-result-edit-form .mgmt-btn:not(.mgmt-btn--primary):hover,
.lm-result-edit-form .mgmt-btn:not(.mgmt-btn--primary):focus{color:#155eef!important;background:#eef4ff!important;border-color:#b2ccff!important;}

/* Tennis results: compact pair labels and score dropdowns */
.lm-tennis-pair-row{
  align-items:center;
  gap:.7rem;
}
.lm-tennis-pair-summary{
  min-width:10rem;
  color:var(--mgmt-text, #111827);
  font-weight:700;
  background:rgba(37,99,235,.06);
  border:1px solid rgba(37,99,235,.14);
  border-radius:999px;
  padding:.42rem .7rem;
  line-height:1.15;
}
.lm-tennis-rubber-row > strong{
  display:flex;
  flex-direction:column;
  gap:.24rem;
  line-height:1.15;
}
.lm-tennis-rubber-row > strong small{
  color:var(--mgmt-muted, #64748b);
  font-size:.78rem;
  font-weight:700;
}
.lm-tennis-score-select{
  width:4.75rem;
  min-width:4.75rem;
  height:2.5rem;
  border:1px solid var(--mgmt-border, #dbe3ef);
  border-radius:.7rem;
  background:#fff;
  color:var(--mgmt-text, #111827);
  font-weight:800;
  text-align:center;
  padding:.25rem .55rem;
}
.lm-tennis-rubber-row span:has(.lm-tennis-score-select){
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
}
@media (max-width: 760px){
  .lm-tennis-pair-summary{min-width:100%;}
  .lm-tennis-score-select{width:4.25rem;min-width:4.25rem;}
}

/* Tennis results: improved pair layout and live totals */
.lm-tennis-pair-row{
  grid-template-columns:2.75rem minmax(0,1fr)!important;
  align-items:start!important;
  gap:.55rem .75rem!important;
  padding:.65rem 0;
  border-bottom:1px solid rgba(223,229,239,.65);
}
.lm-tennis-pair-row:last-child{border-bottom:0;}
.lm-tennis-pair-row > strong{grid-row:1 / span 2;min-height:2.35rem;}
.lm-tennis-pair-summary{
  min-width:0!important;
  width:100%;
  border-radius:12px;
  padding:.56rem .75rem;
}
.lm-tennis-pair-players{
  grid-column:2;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.55rem;
}
.lm-tennis-pair-players select{width:100%;min-width:0;}
.lm-tennis-rubber-head,
.lm-tennis-rubber-row{
  grid-template-columns:minmax(13rem,1.25fr) repeat(3,minmax(10.5rem,.95fr)) repeat(3,minmax(4.75rem,.45fr))!important;
}
.lm-tennis-rubber-head{
  background:#f8fafc;
  border:1px solid rgba(223,229,239,.85);
  border-radius:14px;
  padding:.65rem .75rem!important;
}
.lm-tennis-rubber-row{
  border:1px solid rgba(223,229,239,.78);
  border-radius:14px;
  padding:.65rem .75rem!important;
  margin:.5rem 0;
  background:#fff;
}
.lm-tennis-rubber-row:last-of-type{border-bottom:1px solid rgba(223,229,239,.78)!important;}
.lm-tennis-score-cell{
  background:#f8fafc;
  border:1px solid rgba(223,229,239,.78);
  border-radius:12px;
  min-height:3rem;
}
.lm-tennis-total-cell{
  justify-content:center;
  font-weight:900;
  color:#111827;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  border-radius:12px;
  min-height:3rem;
}
.lm-tennis-rubber-totals{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:.65rem;
  flex-wrap:wrap;
  margin:.85rem 0 .35rem;
  padding:.8rem .9rem;
  border-top:1px solid rgba(223,229,239,.9);
  font-weight:800;
}
.lm-tennis-rubber-totals > strong{margin-right:auto;color:#111827;}
.lm-tennis-rubber-totals span{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.45rem .7rem;
  border:1px solid #dbe3ef;
  background:#f8fafc;
  border-radius:999px;
  color:#475569;
}
.lm-tennis-rubber-totals b{color:#111827;}
@media (max-width: 1180px){
  .lm-tennis-rubber-head{display:none!important;}
  .lm-tennis-rubber-row{grid-template-columns:1fr!important;gap:.55rem!important;}
  .lm-tennis-rubber-row > span::before{min-width:5rem;color:#627084;font-weight:800;font-size:.8rem;}
  .lm-tennis-rubber-row > span:nth-child(2)::before{content:'Set 1';}
  .lm-tennis-rubber-row > span:nth-child(3)::before{content:'Set 2';}
  .lm-tennis-rubber-row > span:nth-child(4)::before{content:'CTB';}
  .lm-tennis-rubber-row > span:nth-child(5)::before{content:'Rubbers';}
  .lm-tennis-rubber-row > span:nth-child(6)::before{content:'Sets';}
  .lm-tennis-rubber-row > span:nth-child(7)::before{content:'Games';}
}
@media (max-width: 760px){
  .lm-tennis-pair-players{grid-template-columns:1fr;}
}

/* Dashboard grace/billing clarity */
.lm-home-alert.is-grace{background:linear-gradient(135deg,#eff6ff,#fff);border-color:#bfdbfe;}
.lm-home-alert.is-grace .lm-home-alert__text > i{background:#dbeafe;color:#155eef;}
.lm-home-alert.is-grace .lm-home-alert__text strong{color:#1d4ed8;}
.lm-home-alert.is-due{background:linear-gradient(135deg,#fffbeb,#fff);border-color:#fedf89;}
.lm-home-alert.is-due .lm-home-alert__text > i{background:#fef3c7;color:#d97706;}
.lm-home-alert.is-due .lm-home-alert__text strong{color:#b45309;}
.lm-home-alert.is-overdue{background:linear-gradient(135deg,#fff7ed,#fff);border-color:#fed7aa;}
.lm-home-alert.is-overdue .lm-home-alert__text > i{background:#ffedd5;color:#ea580c;}
.lm-home-alert.is-overdue .lm-home-alert__text strong{color:#c2410c;}
.lm-home-alert .mgmt-btn:hover,.lm-home-alert .mgmt-btn:focus{color:#fff!important;background:#0b5ed7!important;border-color:#0b5ed7!important;}
.lm-home-alert .mgmt-btn--soft:hover,.lm-home-alert .mgmt-btn--soft:focus{color:#155eef!important;background:#dbeafe!important;border-color:#b2ccff!important;}

/* Match format/template preference polish */
.lm-template-overrides{background:#f8fafc;border:1px solid rgba(223,229,239,.9);border-radius:16px;padding:.8rem}.lm-template-overrides-head{display:flex;gap:.65rem;align-items:baseline;margin-bottom:.65rem;flex-wrap:wrap}.lm-template-overrides-head strong{color:#111827}.lm-result-format-note .mgmt-pill{margin-right:.5rem}.lm-tennis-rubber-head,.lm-tennis-rubber-row{grid-template-columns:minmax(160px,1.5fr) repeat(3,minmax(92px,1fr)) minmax(82px,.8fr) minmax(82px,.8fr) minmax(82px,.8fr)}
@media(max-width:900px){.lm-tennis-rubber-head{display:none!important}.lm-tennis-rubber-row{grid-template-columns:1fr!important}}



/* Result template/match-card template preview */
.lm-result-template-summary{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}
.lm-result-template-summary span{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--lm-border, rgba(148,163,184,.35));
  background:var(--lm-soft, rgba(15,23,42,.04));
  border-radius:999px;
  padding:5px 9px;
  font-size:.84rem;
  font-weight:800;
}
.lm-tennis-slots .lm-tennis-pair-card{
  align-content:start;
}
.lm-tennis-slot-row{
  display:grid;
  grid-template-columns:62px minmax(0,1fr);
  gap:10px;
  align-items:center;
  padding:9px 0;
  border-top:1px solid var(--lm-border, rgba(148,163,184,.22));
}
.lm-tennis-slot-row:first-of-type{border-top:0}
.lm-tennis-slot-row strong{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  border-radius:12px;
  background:rgba(11,92,171,.09);
  color:var(--lm-accent, #0b5cab);
}
.lm-tennis-slot-row select{
  width:100%;
}



/* Template-driven result player slot selection */
.lm-tennis-pair-card h3{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.lm-tennis-pair-players{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;}
.lm-tennis-slot-inline{display:grid;gap:5px;min-width:0;}
.lm-tennis-slot-inline span{
  display:inline-flex;align-items:center;justify-content:center;justify-self:start;
  min-width:42px;padding:3px 8px;border-radius:999px;
  font-size:.78rem;font-weight:900;background:rgba(11,92,171,.09);color:var(--lm-accent,#0b5cab);
}
.lm-tennis-slot-inline select{width:100%;min-width:0;}
.lm-tennis-slots .lm-tennis-pair-card h3::after,
.lm-tennis-pairs:not(.lm-tennis-slots) .lm-tennis-pair-card h3::after{
  content:'from selected match template';font-size:.78rem;font-weight:700;color:var(--lm-muted,#64748b);
}
@media(max-width:720px){.lm-tennis-pair-players{grid-template-columns:1fr;}}



/* Results: rubber rows generated from selected template */
.lm-template-generated-note{
  display:grid;
  gap:5px;
  margin-bottom:10px;
  padding:12px 14px;
  border:1px solid var(--lm-border, rgba(148,163,184,.32));
  border-radius:16px;
  background:linear-gradient(180deg, rgba(11,92,171,.07), rgba(11,92,171,.03));
}
.lm-template-generated-note strong{
  display:flex;
  align-items:center;
  gap:8px;
}
.lm-template-generated-note span{
  color:var(--lm-muted, #64748b);
  font-size:.92rem;
}
.lm-template-rubber-order{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  margin-right:8px;
  border-radius:999px;
  background:rgba(11,92,171,.12);
  color:var(--lm-accent, #0b5cab);
  font-weight:900;
  font-size:.86rem;
}
.lm-template-rubber-label{
  font-weight:900;
}
@media(max-width:760px){
  .lm-template-generated-note{padding:10px 12px}
  .lm-template-rubber-order{width:24px;height:24px;margin-right:6px}
}



.lm-template-validation-note{
  font-size:.88rem;
  color:var(--lm-muted, #64748b);
}



/* League Tables calculated from saved result/template data */
.lm-tables-page{align-items:start}
.lm-table-filter{margin-top:12px}
.lm-table-intro-card .mgmt-section-head{align-items:flex-start}
.lm-table-wrap{overflow:auto;border:1px solid var(--lm-border, rgba(148,163,184,.32));border-radius:18px;background:var(--lm-panel, #fff)}
.lm-league-table{width:100%;border-collapse:separate;border-spacing:0;min-width:880px;font-size:.93rem}
.lm-league-table th,.lm-league-table td{padding:11px 10px;border-bottom:1px solid var(--lm-border, rgba(148,163,184,.22));text-align:center;white-space:nowrap}
.lm-league-table th{position:sticky;top:0;background:var(--lm-panel-2, #f8fafc);color:var(--lm-muted, #64748b);font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;z-index:1}
.lm-league-table th:nth-child(2),.lm-league-table td:nth-child(2){text-align:left;min-width:220px}
.lm-league-table tbody tr:last-child td{border-bottom:0}
.lm-league-table tbody tr:nth-child(even) td{background:rgba(15,23,42,.025)}
.lm-league-table td:last-child{font-weight:900;color:var(--lm-accent, #0b5cab)}
.lm-table-note{margin:10px 0 0;font-size:.88rem}
@media(max-width:760px){.lm-league-table{font-size:.86rem}.lm-league-table th,.lm-league-table td{padding:9px 8px}.lm-table-wrap{margin-left:-4px;margin-right:-4px}}

/* League Tables polish + unconfirmed markers */
.lm-tables-page{
  gap:18px;
}
.lm-table-intro-card{
  overflow:hidden;
  background:linear-gradient(180deg, var(--lm-panel, #fff), rgba(11,92,171,.025));
}
.lm-table-intro-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}
.lm-league-table-card{
  padding:0;
  overflow:hidden;
}
.lm-league-table-card > .mgmt-section-head{
  padding:18px 20px 12px;
  margin:0;
  border-bottom:1px solid var(--lm-border, rgba(148,163,184,.26));
  background:linear-gradient(180deg, rgba(15,23,42,.025), transparent);
}
.lm-table-wrap{
  margin:0 16px 0;
  border-radius:18px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);
}
.lm-league-table{
  border-collapse:separate;
  border-spacing:0;
}
.lm-league-table thead th{
  font-weight:900;
  background:linear-gradient(180deg, var(--lm-panel-2, #f8fafc), rgba(241,245,249,.96));
}
.lm-league-table tbody tr{
  transition:background .16s ease, transform .16s ease;
}
.lm-league-table tbody tr:hover td{
  background:rgba(11,92,171,.055);
}
.lm-league-table tbody tr:first-child td:first-child{
  font-weight:900;
  color:var(--lm-accent, #0b5cab);
}
.lm-league-table tbody tr.has-unconfirmed td{
  font-style:italic;
  background:rgba(245,158,11,.055);
}
.lm-table-unconfirmed-mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-left:4px;
  color:#b45309;
  font-weight:1000;
  font-style:normal;
}
.lm-table-note{
  padding:0 18px 16px;
}
@media(max-width:760px){
  .lm-table-intro-actions{justify-content:flex-start}
  .lm-table-wrap{margin:0 10px}
  .lm-league-table-card > .mgmt-section-head{padding:14px 14px 10px}
}

/* Players live search */
.lm-player-card[hidden],
.lm-player-card.is-search-hidden,
.lm-player-live-empty[hidden]{
  display:none!important;
}
