/* MML v4.10.1 — Global UI System
   One visual and responsive language for every application module. */
:root{
  --ui-bg:var(--mml-bg,#050908);--ui-card:var(--mml-surface,#0b1210);--ui-card-2:var(--mml-surface-2,#101916);
  --ui-text:var(--mml-text,#f7fbf8);--ui-muted:var(--mml-muted,#9aa9a1);--ui-line:var(--mml-border,#26352e);
  --ui-accent:var(--mml-green,#2fd45f);--ui-danger:var(--mml-red,#ff4e5b);--ui-warning:var(--mml-amber,#f2ad19);
  --ui-info:var(--mml-blue,#3a8cff);--ui-radius:12px;--ui-radius-sm:8px;--ui-page-gap:12px;
}
*{box-sizing:border-box}
html{background:var(--ui-bg)}
body{overflow-x:hidden}
.beta-main{min-width:0}
.beta-content{width:100%;max-width:1920px;margin:0 auto;padding:14px!important}
#page{display:block;min-width:0}

/* Shared page rhythm */
#page>section,#page>.panel,#page>.card,#page>[class$="-page"],#page>[class*="-shell"],#page>[class*="-center"]{margin-bottom:var(--ui-page-gap)}
.section-title,.section-head,.section-heading,.page-heading,.v410-head,.admin-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 18px!important;margin:0 0 12px!important;background:var(--ui-card)!important;border:1px solid var(--ui-line)!important;border-radius:var(--ui-radius)!important}
.section-title h2,.section-head h2,.section-heading h2,.page-heading h1,.v410-head h2{margin:0 0 4px!important;font-size:clamp(20px,2vw,28px)!important;line-height:1.15!important}
.section-title p,.section-head p,.section-heading p,.page-heading p,.v410-head p{margin:0!important;max-width:860px}

/* Every card has the same visual weight. */
.panel,.card,.admin-section,.planner-shell-v491,.transfer-shell-v450,.v410-center,.competition-page-v440>section,.commercial-operations-v463>section,.stadium-page>section,.squad-page>section,.statistics-v482>section,.info-directory-v482>section{
  border-radius:var(--ui-radius)!important;border:1px solid var(--ui-line)!important;background:var(--ui-card)!important;box-shadow:none!important
}
.panel,.card,.admin-section{padding:14px!important}

/* Unified card grids */
.form-grid,.metrics-grid,.dashboard-grid,.v482-grid,.admin-grid,.competition-grid,.transfer-grid{gap:12px!important}
.form-grid>*,.metrics-grid>*,.dashboard-grid>*,.v482-grid>*,.admin-grid>*,.competition-grid>*,.transfer-grid>*{min-width:0}

/* Modern module navigation tabs */
.tabs,.subtabs,.transfer-tabs-v450,.competition-tabs-v440,.v482-tabs,.planner-tabs,.admin-tabs{display:flex!important;gap:4px!important;align-items:center;overflow-x:auto;scrollbar-width:thin;padding:5px!important;background:var(--ui-card-2)!important;border:1px solid var(--ui-line)!important;border-radius:10px!important}
.tabs button,.subtabs button,.transfer-tabs-v450 button,.competition-tabs-v440 button,.v482-tabs button,.planner-tabs button,.admin-tabs button{min-height:34px!important;padding:7px 12px!important;border:0!important;border-radius:7px!important;background:transparent!important;color:var(--ui-muted)!important;white-space:nowrap}
.tabs button.active,.subtabs button.active,.transfer-tabs-v450 button.active,.competition-tabs-v440 button.active,.v482-tabs button.active,.planner-tabs button.active,.admin-tabs button.active{background:color-mix(in srgb,var(--ui-accent) 17%,transparent)!important;color:var(--ui-accent)!important}

/* Toolbars remain dense. */
.toolbar,.v482-toolbar,.planner-toolbar-v491,.v410-actions,.transfer-toolbar,.competition-toolbar{display:flex!important;flex-wrap:wrap!important;align-items:end!important;gap:9px!important;padding:10px!important;background:var(--ui-card)!important;border:1px solid var(--ui-line)!important;border-radius:10px!important}
.toolbar label,.v482-toolbar label,.planner-toolbar-v491 label{display:grid;gap:4px;min-width:140px;flex:1 1 150px}

/* Tables use dashboard density and retain usability. */
.table-wrap,.v482-table-wrap,.planner-table-wrap-v491,.squad-table-wrap,.competition-table-wrap{width:100%;max-width:100%;overflow:auto;border:1px solid var(--ui-line)!important;border-radius:10px!important;background:var(--ui-card)!important}
table{font-variant-numeric:tabular-nums}
thead th{position:sticky;top:0;z-index:2;white-space:nowrap;font-size:10px!important;line-height:1.2!important;padding:9px 10px!important}
tbody td{padding:9px 10px!important;line-height:1.25!important}
tbody tr:last-child td{border-bottom:0!important}

/* Inputs and buttons match the dashboard controls. */
input,select,textarea{min-height:36px!important;padding:7px 10px!important;border-radius:7px!important;font-size:13px!important}
textarea{min-height:84px!important}
button,.button,a.button{min-height:35px;padding:7px 12px!important;border-radius:7px!important}
button:disabled{opacity:.52!important;cursor:not-allowed!important}

/* Status and monetary language */
.money-positive,.positive,.amount-positive,[data-tone="positive"]{color:var(--ui-accent)!important}
.money-negative,.negative,.amount-negative,[data-tone="negative"]{color:var(--ui-danger)!important}
.status-pill,.badge,.pill{border-radius:999px!important;padding:4px 8px!important;font-size:10px!important;font-weight:800!important}
.notice,.alert,.v410-alert{border-radius:9px!important;padding:10px 12px!important}

/* Dashboard toolbar becomes a narrow final row. */
.dashboard-view-toolbar,.dashboard-view-toolbar--bottom,.dashboard-view-toolbar--bottom-v41006{min-height:52px!important;height:auto!important;padding:7px 10px!important;margin-top:10px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;border-radius:9px!important}
.dashboard-view-toolbar>div:first-child{display:flex!important;align-items:center!important;gap:8px!important}
.dashboard-view-toolbar>div:first-child small{margin:0!important;display:inline!important}
.dashboard-profile-switch{display:flex!important;gap:5px!important;align-items:center!important}
.dashboard-profile-switch button{min-height:32px!important;padding:5px 10px!important}

/* Keep desktop sidebar fixed and allow content to shrink without overflow. */
.beta-shell{min-height:100dvh;display:grid!important;grid-template-columns:252px minmax(0,1fr)!important}
.beta-sidebar{position:sticky!important;top:0;height:100dvh!important;min-height:100dvh;overflow:hidden!important}
.beta-nav{overflow-y:auto!important;overscroll-behavior:contain}
.beta-topbar{position:sticky!important;top:0;z-index:50;padding:9px 14px!important;min-height:58px!important}
.mobile-menu{display:none!important}

/* Light and dark remain structurally identical. */
html[data-theme="light"],body.theme-light{--mml-bg:#f3f5f7;--mml-surface:#fff;--mml-surface-2:#f5f7f9;--mml-surface-3:#e9edf1;--mml-text:#11151a;--mml-muted:#606b78;--mml-border:#dce2e8;--mml-green:#18a94f;--mml-red:#d93443;--mml-amber:#b87900;--mml-blue:#1769d2}
html[data-theme="dark"],body.theme-dark{--mml-bg:#050908;--mml-surface:#09110e;--mml-surface-2:#0e1814;--mml-surface-3:#14211b;--mml-text:#f5faf7;--mml-muted:#9baaa1;--mml-border:#26362e;--mml-green:#2fd45f;--mml-red:#ff5360;--mml-amber:#f3ad16;--mml-blue:#3d91ff}
html[data-theme="slate"],body.theme-slate{--mml-bg:#0e1622;--mml-surface:#152131;--mml-surface-2:#1b2a3e;--mml-surface-3:#25364d;--mml-text:#f5f8fc;--mml-muted:#a9b7cb;--mml-border:#34465f;--mml-green:#30d68d;--mml-red:#ff6475;--mml-amber:#f5b949;--mml-blue:#6ba9ff}

/* Tablet */
@media(max-width:1100px){
 .beta-shell{grid-template-columns:220px minmax(0,1fr)!important}.beta-sidebar{width:220px!important;min-width:220px!important}
 .beta-content{padding:10px!important}.section-title,.section-head,.section-heading,.page-heading,.v410-head{padding:13px!important}
 .dashboard-view-toolbar>div:first-child small{display:none!important}
}

/* Mobile app layout */
@media(max-width:760px){
 html,body{overflow-x:hidden}.beta-shell{display:block!important}.beta-main{width:100%;min-height:100dvh}
 .beta-sidebar{position:fixed!important;inset:0 auto 0 0!important;width:min(86vw,320px)!important;min-width:0!important;height:100dvh!important;z-index:1001!important;transform:translateX(-103%);transition:transform .2s ease!important;box-shadow:14px 0 40px rgba(0,0,0,.35)!important}
 .beta-shell.nav-open .beta-sidebar{transform:translateX(0)}
 .sidebar-backdrop{position:fixed!important;inset:0!important;display:block!important;z-index:1000!important;background:rgba(0,0,0,.58)!important;opacity:0;pointer-events:none;transition:opacity .2s}
 .beta-shell.nav-open .sidebar-backdrop{opacity:1;pointer-events:auto}
 .mobile-menu{display:grid!important;place-items:center;width:38px;height:38px;padding:0!important}
 .beta-topbar{min-height:58px!important;padding:8px 10px!important}.topbar-kicker{display:none!important}.beta-topbar h1{font-size:18px!important;margin:0!important}
 .beta-tools{gap:4px!important}.language-control select{width:58px!important}.user-chip{display:none!important}.logout-button{font-size:0!important;width:38px!important;padding:0!important}.logout-button:after{content:'↪';font-size:18px}
 .beta-content{padding:8px!important}.section-title,.section-head,.section-heading,.page-heading,.v410-head{display:block!important;padding:12px!important}.section-title h2,.section-head h2,.section-heading h2,.page-heading h1,.v410-head h2{font-size:20px!important}
 .panel,.card,.admin-section{padding:11px!important;border-radius:10px!important}
 .form-grid,.metrics-grid,.dashboard-grid,.v482-grid,.admin-grid,.competition-grid,.transfer-grid{grid-template-columns:1fr!important}
 .toolbar,.v482-toolbar,.planner-toolbar-v491,.v410-actions{display:grid!important;grid-template-columns:1fr!important;align-items:stretch!important}.toolbar label,.v482-toolbar label,.planner-toolbar-v491 label{min-width:0!important}
 .table-wrap,.v482-table-wrap,.planner-table-wrap-v491,.squad-table-wrap,.competition-table-wrap{max-height:68dvh}
 thead th,tbody td{padding:8px!important;font-size:11px!important}
 .dashboard-view-toolbar,.dashboard-view-toolbar--bottom,.dashboard-view-toolbar--bottom-v41006{align-items:stretch!important;flex-direction:column!important;min-height:0!important;padding:7px!important}
 .dashboard-view-toolbar>div:first-child{display:none!important}.dashboard-profile-switch{width:100%;display:grid!important;grid-template-columns:1fr 1fr auto!important}.dashboard-profile-switch button{width:100%!important}
}

@media(max-width:430px){
 .beta-tools .language-control span{display:none!important}.beta-topbar{gap:5px!important}.beta-content{padding:6px!important}
 .tabs,.subtabs,.transfer-tabs-v450,.competition-tabs-v440,.v482-tabs{margin-inline:-2px}
}
.ui-table-scroll{width:100%;max-width:100%;overflow:auto;border:1px solid var(--ui-line);border-radius:10px}
.ui-section-block{min-width:0}
