/* MetaMethod dashboard theme (dark Sneat look), FR-UI-001 tokens with the documented contrast deviations.
   Fonts are bundled (no CDN, MV3). */
@font-face { font-family: 'Public Sans'; font-weight: 300; src: url('../assets/fonts/PublicSans-Light.ttf') format('truetype'); }
@font-face { font-family: 'Public Sans'; font-weight: 400; src: url('../assets/fonts/PublicSans-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Public Sans'; font-weight: 600; src: url('../assets/fonts/PublicSans-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Public Sans'; font-weight: 700; src: url('../assets/fonts/PublicSans-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; src: url('../assets/fonts/Montserrat-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; src: url('../assets/fonts/Montserrat-ExtraBold.ttf') format('truetype'); }

:root {
  --mm-bg: #2b2d31;
  --mm-surface: #1e1f22;
  --mm-border: #393a5a;
  --mm-accent-dark: #35365f;
  --mm-text: #b2b2c4;
  --mm-text-strong: #ffffff;
  --mm-muted: #94a0b0;          /* deviation: #8592a3 → #94a0b0 for 4.5:1 */
  --mm-secondary: #8592a3;
  --mm-primary: #7eb5ee;
  --mm-primary-hover: #5f61e6;
  --mm-navy: #2B4161;
  --mm-discord: #5865F2;
  --mm-success: rgba(40, 167, 69, .7);
  --mm-info: #03c3ec;
  --mm-danger: #ff3e1d;
  --mm-input-border: #6b6d8a;   /* deviation: non-text contrast 3:1 */
  --mm-radius: 6px;
  --mm-shadow: 0 2px 6px 0 rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--mm-bg); color: var(--mm-text); font-family: 'Public Sans', sans-serif; font-size: 0.9375rem; line-height: 1.47; font-weight: 400; }
h1, h2, h3, h4 { color: var(--mm-text-strong); font-weight: 600; margin: 0 0 .75rem; }
h1 { font-size: 22px; line-height: 30px; } h2 { font-size: 17px; line-height: 24px; } h3 { font-size: 15px; }
a { color: var(--mm-primary); }
code, .mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 12px; }
.muted { color: var(--mm-muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* layout — mirrors dashboard.metamethod.pt (Sneat vertical menu, detached navbar, content footer); sizes measured from the live dashboard */

:root { --menu-w: 260px; --mm-menu-text: #d5d5e2; }
html.menu-collapsed { --menu-w: 84px; }
.layout-wrapper { min-height: 100vh; }
.layout-menu { position: fixed; inset: 0 auto 0 0; width: var(--menu-w); background: var(--mm-surface); color: var(--mm-menu-text); box-shadow: 0 2px 6px 0 rgba(20, 20, 29, .2); z-index: 20; display: flex; flex-direction: column; transition: width .2s; }
.layout-menu .logo { height: 64px; margin-top: 16px; padding: 0 32px; display: flex; align-items: center; justify-content: center; position: relative; }
.layout-menu .logo-link { display: flex; width: 40px; height: 40px; }
.layout-menu .logo-link img { width: 40px; height: 40px; }
.layout-menu-toggle { position: absolute; right: -18px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border-radius: 50%; border: 7px solid var(--mm-bg); background: var(--mm-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; padding: 0; transition: rotate .2s; }
html.menu-collapsed .layout-menu-toggle { rotate: 180deg; }
.menu-inner { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
.menu-item { margin: 2px 0; position: relative; }
.menu-link { display: flex; align-items: center; height: 42px; padding: 5px 15px; margin: 0 16px; border-radius: 6px; color: var(--mm-menu-text); text-decoration: none; font-size: 15px; white-space: nowrap; overflow: hidden; transition: background-color .15s; }
.menu-link:hover { background: rgba(213, 213, 226, .06); color: #fff; }
.menu-icon { font-size: 22px; width: 24px; margin-right: 8px; flex: none; color: inherit; }
.menu-item.active > .menu-link { background: var(--mm-primary); color: #fff; }
.menu-item.active::before { content: ""; position: absolute; right: 0; top: 0; width: 4px; height: 42px; border-radius: 4px 0 0 4px; background: var(--mm-primary); }
.menu-link .count { margin-left: auto; background: var(--mm-danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 700; line-height: 18px; }
html.menu-collapsed .menu-link .text-truncate, html.menu-collapsed .menu-link .count { display: none; }

.layout-page { padding: 74px 0 0 var(--menu-w); min-height: 100vh; display: flex; flex-direction: column; transition: padding-left .2s; }
.layout-navbar { position: fixed; top: 16px; left: calc(var(--menu-w) + 26px); right: 26px; height: 62px; padding: 0 24px; display: flex; align-items: center; gap: 14px; background: var(--mm-surface); border-radius: 6px; box-shadow: 0 2px 6px 0 rgba(20, 20, 29, .2); z-index: 15; transition: left .2s; }
.layout-navbar::before { content: ""; position: fixed; top: 0; left: var(--menu-w); right: 0; height: 16px; background: linear-gradient(var(--mm-bg) 60%, transparent); z-index: -1; }
.navbar-search { display: flex; align-items: center; flex: 1; min-width: 0; gap: 8px; color: var(--mm-menu-text); }
.navbar-search .bx { font-size: 22px; }
.navbar-search input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; font-size: 18px; color: #fff; box-shadow: none; }
.navbar-search input:hover, .navbar-search input:focus { border: 0; box-shadow: none; }
.navbar-right { display: flex; align-items: center; gap: 12px; }
.btn-icon { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; font-size: 20px; color: var(--mm-menu-text); }
.btn-icon:hover { background: rgba(213, 213, 226, .08); color: #fff; }

/* avatar + user dropdown (native <details>) */
.dropdown-user { position: relative; }
.dropdown-user > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.dropdown-user > summary::-webkit-details-marker { display: none; }
.avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(126, 181, 238, .16); color: var(--mm-primary); font-weight: 600; font-size: 15px; text-transform: uppercase; }
.avatar-online::after { content: ""; position: absolute; right: 0; bottom: 0; width: 8px; height: 8px; border-radius: 50%; background: #71dd37; box-shadow: 0 0 0 2px var(--mm-surface); }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; list-style: none; margin: 0; padding: 8px 0; background: var(--mm-surface); border-radius: 6px; box-shadow: 0 4px 12px 0 rgba(20, 20, 29, .24), 0 0 0 1px rgba(78, 79, 108, .35); z-index: 30; }
.dropdown-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8.7px 20px; color: var(--mm-menu-text); text-decoration: none; background: none; border: 0; font: inherit; font-size: 15px; cursor: pointer; text-align: left; }
.dropdown-item .bx { font-size: 22px; }
.dropdown-item:hover { background: rgba(213, 213, 226, .06); color: #fff; }
.dropdown-header { display: flex; align-items: center; gap: 12px; padding: 8px 20px; }
.dropdown-header b { display: block; color: #fff; font-weight: 600; }
.dropdown-divider { height: 1px; margin: 8px 0; background: var(--mm-border); }

.content-wrapper { flex: 1; display: flex; flex-direction: column; }
.container-p { padding: 28px 26px 24px; flex: 1; min-width: 0; }
.content-footer { padding: 16px 26px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--mm-text); }
.footer-link { color: var(--mm-primary); text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-links { display: flex; gap: 24px; }

/* setup / unlock brand block */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 40px; height: 40px; }
.brand .t { font-family: 'Montserrat', sans-serif; font-weight: 800; color: #fff; letter-spacing: .02em; line-height: 1.1; }
.brand .t small { display: block; font-family: 'Public Sans'; font-weight: 400; color: var(--mm-muted); font-size: 12px; letter-spacing: 0; }

/* components */
.card { background: var(--mm-surface); border-radius: var(--mm-radius); box-shadow: 0 3px 8px 0 rgba(20, 20, 29, .22); padding: 24px; margin-bottom: 24px; }
.card > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.stat-card .label { color: var(--mm-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { color: #fff; font-size: 26px; font-weight: 600; margin-top: 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: var(--mm-radius); padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; background: transparent; color: var(--mm-text); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--mm-primary); outline-offset: 2px; }
.btn-primary { background: var(--mm-primary); color: var(--mm-surface); font-weight: 600; }  /* deviation: dark text on primary */
.btn-primary:hover { background: var(--mm-primary-hover); color: #ffffff; }
.btn-outline { border-color: var(--mm-input-border); color: var(--mm-text); }
.btn-outline:hover { border-color: var(--mm-primary); color: #fff; }
.btn-danger { background: var(--mm-danger); color: var(--mm-surface); font-weight: 600; }
.btn-discord { background: var(--mm-discord); color: #fff; font-weight: 700; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.badge.draft { background: #3a3b45; color: var(--mm-muted); }
.badge.approved { background: rgba(3,195,236,.16); color: var(--mm-info); }
.badge.partially_paid { background: rgba(3,195,236,.16); color: var(--mm-info); }
.badge.paid { background: rgba(40,167,69,.2); color: #71dd8a; }
.badge.void { background: rgba(255,62,29,.16); color: #ff7a63; }
.badge.flag { background: rgba(255,171,0,.16); color: #ffc557; text-transform: none; font-weight: 600; }
.badge.flag.block { background: rgba(255,62,29,.16); color: #ff8f7d; }

table.table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; }
.table th { text-align: left; color: #fff; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 9px 10px; border-bottom: 1px solid var(--mm-border); position: sticky; top: 0; background: var(--mm-surface); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--mm-border); vertical-align: top; }
.table tbody tr:nth-child(even) td { background: rgba(255,255,255,.015); }
.table-wrap { overflow-x: auto; }

form.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); align-items: end; }
form.form .full { grid-column: 1 / -1; }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--mm-text); }
input, select, textarea { background: var(--mm-bg); color: #fff; border: 1px solid var(--mm-input-border); border-radius: var(--mm-radius); padding: 7px 10px; font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--mm-primary); }
input:focus, select:focus, textarea:focus { border-color: var(--mm-primary); box-shadow: 0 0 0 3px rgba(126, 181, 238, .2); outline: none; }
input::placeholder, textarea::placeholder { color: var(--mm-muted); }
input[disabled], select[disabled], textarea[disabled] { opacity: .5; cursor: not-allowed; }
textarea { min-height: 70px; resize: vertical; }
:root { color-scheme: dark; accent-color: var(--mm-primary); } /* native popups (date picker, scrollbars) follow the dark theme */

/* select: custom arrow everywhere; fully custom dropdown list on Chrome 135+ (customizable select), native list before that */
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%237eb5ee' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; background-image: none; }
  select::picker-icon { content: ''; width: 12px; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%237eb5ee' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; transition: rotate .15s; }
  select:open::picker-icon { rotate: 180deg; }
  ::picker(select) { background: var(--mm-surface); border: 1px solid var(--mm-border); border-radius: var(--mm-radius); padding: 4px; margin-top: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
  option { padding: 7px 10px; border-radius: 4px; color: var(--mm-text); cursor: pointer; }
  option:hover, option:focus-visible { background: var(--mm-accent-dark); color: #fff; outline: none; }
  option:checked { background: rgba(126, 181, 238, .16); color: var(--mm-primary); font-weight: 600; }
  option::checkmark { content: '✓'; color: var(--mm-primary); }
}

/* checkbox + radio */
input[type=checkbox], input[type=radio] { appearance: none; width: 18px; height: 18px; padding: 0; flex: none; margin: 0; background: var(--mm-bg); border: 1.5px solid var(--mm-input-border); cursor: pointer; display: inline-grid; place-content: center; }
input[type=checkbox] { border-radius: 4px; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:checked { background: var(--mm-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 5' fill='none' stroke='%231e1f22' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--mm-primary); }
input[type=radio]:checked { border-color: var(--mm-primary); background: radial-gradient(var(--mm-primary) 0 4px, var(--mm-bg) 5px); }
.check { cursor: pointer; }

/* date / month pickers */
input[type=date], input[type=month] { cursor: pointer; }
input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; filter: invert(72%) sepia(35%) saturate(700%) hue-rotate(185deg); }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* number: hide native spinners */
input[type=number] { appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { appearance: none; margin: 0; }

/* file: styled like .btn-outline */
input[type=file] { padding: 5px; cursor: pointer; color: var(--mm-muted); }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; margin-right: 10px; padding: 5px 12px; border-radius: 4px; border: 1px solid var(--mm-input-border); background: transparent; color: var(--mm-text); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--mm-primary); color: #fff; }
.check { display: flex; gap: 8px; align-items: center; }
.alert { border-radius: var(--mm-radius); padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.alert.warn { background: rgba(255,171,0,.1); border-color: rgba(255,171,0,.4); color: #ffd27a; }
.alert.danger { background: rgba(255,62,29,.1); border-color: rgba(255,62,29,.4); color: #ff9d8c; }
.alert.info { background: rgba(3,195,236,.08); border-color: rgba(3,195,236,.35); color: #8fe3f5; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.empty-state { text-align: center; padding: 30px; color: var(--mm-muted); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; font-size: 14px; }
.kv dd { overflow-wrap: anywhere; }
.kv dt { color: var(--mm-muted); } .kv dd { margin: 0; color: #fff; }
pre.explain { background: var(--mm-bg); padding: 12px; border-radius: var(--mm-radius); white-space: pre-wrap; font-size: 12px; color: var(--mm-text); }

/* dialog */
dialog.modal { background: var(--mm-surface); color: var(--mm-text); border: 1px solid var(--mm-border); border-radius: 8px; padding: 0; width: min(560px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
dialog.modal::backdrop { background: rgba(0,0,0,.55); }
dialog.modal .hd { padding: 16px 20px; border-bottom: 1px solid var(--mm-border); color: #fff; font-weight: 600; font-size: 17px; }
dialog.modal .bd { padding: 16px 20px; }
dialog.modal .ft { padding: 12px 20px; border-top: 1px solid var(--mm-border); display: flex; justify-content: flex-end; gap: 10px; }

/* toast */
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
/* whole card tinted with the status colour over a translucent surface */
.toast { --tint: 126, 181, 238; background: linear-gradient(rgba(var(--tint), .22), rgba(var(--tint), .22)), rgba(30, 31, 34, .78);
  border: 1px solid rgba(var(--tint), .5); backdrop-filter: blur(8px); padding: 10px 14px; border-radius: var(--mm-radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); color: #fff; max-width: 420px; }
.toast.err { --tint: 255, 62, 29; }

/* hero (onboarding / unlock) */
.hero { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.77)), var(--mm-bg); }
.hero .card { width: min(620px, 94vw); }
.hero .brand .t { font-size: 20px; }

/* side panel */
body.panel { font-size: 14px; }
body.panel main { padding: 12px; }
.side-panel-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--mm-surface); box-shadow: var(--mm-shadow); }
.side-panel-header img { width: 24px; height: 24px; }
.side-panel-header .t { font-family: 'Montserrat'; font-weight: 800; color: #fff; }

/* tabs (Sneat nav-pills / nav-tabs) */
.tabs-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs-row .sort { margin-left: auto; min-width: 170px; }
.nav-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-pill { border: 0; background: transparent; color: var(--mm-menu-text); font: inherit; font-size: 14px; padding: 7px 16px; border-radius: 6px; cursor: pointer; }
.nav-pill:hover { background: rgba(213, 213, 226, .06); color: #fff; }
.nav-pill.active { background: var(--mm-primary); color: #fff; box-shadow: 0 2px 4px rgba(126, 181, 238, .4); }
.nav-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--mm-border); margin-bottom: 18px; overflow-x: auto; }
.nav-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--mm-menu-text); font: inherit; font-size: 15px; padding: 10px 16px; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.nav-tab:hover { color: #fff; }
.nav-tab.active { color: var(--mm-primary); border-bottom-color: var(--mm-primary); }
.tab-count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 10px; font-size: 12px; line-height: 18px; text-align: center; background: rgba(213, 213, 226, .1); }
.nav-tab.active .tab-count { background: rgba(126, 181, 238, .18); }
.stats-row { margin-bottom: 18px; }
.stats-row .stat-card { background: var(--mm-bg); border-radius: 6px; padding: 12px 16px; }
label.btn { cursor: pointer; }

/* Discord avatar */
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* spacing inside cards: a form followed by results (run summary, filtered table) gets room to breathe */
.card > form + *, .card > .form + * { margin-top: 20px; }
.run-summary:empty { display: none; }
.run-summary .alert { margin-bottom: 0; }
.card > h2 + form, .card > h2 + .form { margin-top: 4px; }

/* buttons shared with the dashboard */
.btn-dark { background: #494a5d; border-color: #494a5d; color: #fff; font-weight: 500; box-shadow: 0 2px 4px 0 rgba(73, 74, 93, .4); }
.btn-dark:hover { background: #5b5c72; color: #fff; }
.btn-block { display: flex; width: 100%; justify-content: center; padding: 8px 20px; font-size: 15px; font-weight: 500; text-decoration: none; }
.btn-primary.btn-block { color: #fff; box-shadow: 0 2px 4px 0 rgba(126, 181, 238, .4); }
.btn .bx { font-size: 18px; }

/* sign-in pages: dashboard.metamethod.pt authentication-basic layout */
body.auth-body { background: var(--mm-surface); }
.authentication-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.authentication-inner { width: 100%; max-width: 460px; }
.auth-card { padding: 24px; margin: 0; box-shadow: 0 2px 16px 0 rgba(0, 0, 0, .35); }
.auth-card .card-body { padding: 24px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-logo img { width: 48px; height: 48px; }
.auth-title { color: var(--mm-menu-text); font-size: 18px; font-weight: 500; text-align: center; margin: 0 0 6px; }
.auth-text { text-align: center; color: var(--mm-text); margin: 0 0 24px; }
.auth-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 24px; }
.auth-alert .bx { font-size: 20px; flex: none; }
.auth-actions { display: grid; gap: 16px; }
.auth-links { display: flex; justify-content: center; gap: 10px; margin-top: 16px; font-size: 14px; color: var(--mm-muted); }
.auth-links a { color: var(--mm-muted); text-decoration: none; }
.auth-links a:hover { color: var(--mm-primary); }

/* policy pages: dashboard docs layout */
body.doc-body { background: var(--mm-bg); }
.doc-navbar { position: fixed; inset: 0 0 auto 0; height: 62px; padding: 0 24px; display: flex; align-items: center; background: var(--mm-surface); z-index: 20; box-shadow: 0 2px 6px 0 rgba(20, 20, 29, .2); }
.doc-brand img { width: 36px; height: 36px; display: block; }
.doc-menu { position: fixed; top: 62px; bottom: 0; left: 0; width: 260px; background: var(--mm-bg); box-shadow: 0 0 0 1px #494c52; padding-top: 8px; z-index: 10; }
.doc-menu .menu-link { height: auto; padding: 5.6px 32px; color: #a1a1ab; }
.doc-menu .menu-item.active > .menu-link { background: rgba(105, 108, 255, .16); color: #e0e1ff; }
.doc-menu .menu-item.active::before { height: 100%; background: #7cafe1; }
.doc-page { padding: 62px 0 0 260px; min-height: 100vh; display: flex; flex-direction: column; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 192px; gap: 0; flex: 1; }
.doc-content { padding: 28px 26px 24px; min-width: 0; }
.doc-title { font-size: 38px; line-height: 56px; font-weight: 500; color: var(--mm-menu-text); margin: 0 0 24px; }
.doc-content .lead { font-size: 16.875px; line-height: 23.2px; margin: 0 0 16px; }
.doc-content hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .15); margin: 8px 0 24px; }
.doc-content h4 { font-size: 24px; line-height: 38px; font-weight: 700; color: var(--mm-menu-text); margin: 28px 0 12px; scroll-margin-top: 80px; }
.doc-content p, .doc-content li { max-width: 75ch; }
.doc-content ul { padding-left: 1.4em; margin: 0 0 16px; }
.doc-content a { color: #7cafe1; }
.doc-toc { position: sticky; top: 62px; align-self: start; padding: 28px 13px 24px; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid #494c52; }
.doc-toc a { display: block; padding: 2px 24px; color: #7e8792; text-decoration: none; font-size: 14px; }
.doc-toc a:hover { color: var(--mm-primary); }
@media (max-width: 1100px) { .doc-layout { grid-template-columns: minmax(0, 1fr); } .doc-toc { display: none; } }
@media (max-width: 760px) { .doc-menu { display: none; } .doc-page { padding-left: 0; } .doc-title { font-size: 30px; line-height: 42px; } }
.page-head { gap: 12px; margin-bottom: 8px; }
.page-head h1 { margin: 0; }

/* ---------------------------------------------------------------- layout fixes (npm run audit:layout) */
/* form controls fill their grid column and may shrink below their intrinsic width instead of poking out */
label.f { min-width: 0; }
label.f > input, label.f > select, label.f > textarea { width: 100%; min-width: 0; }
td.mono, .table .mono { overflow-wrap: anywhere; }
.auth-alert span { min-width: 0; overflow-wrap: anywhere; }
.dropdown-menu { max-width: calc(100vw - 24px); }
/* collapsed menu: icons centred, nothing clipped */
html.menu-collapsed .menu-link { padding: 5px 0; justify-content: center; }
html.menu-collapsed .menu-icon { margin-right: 0; }
/* drawer controls, hidden on wide screens */
.menu-open-btn { display: none; flex: none; }
.layout-overlay { display: none; }

/* < 1200px: the menu becomes a drawer (as on dashboard.metamethod.pt), the page uses the full width */
@media (max-width: 1199.98px) {
  :root, html.menu-collapsed { --menu-w: 0px; }
  .layout-menu { width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: none; z-index: 30; }
  html.menu-open .layout-menu { transform: none; box-shadow: 0 0 50px rgba(0, 0, 0, .5); }
  html.menu-collapsed .menu-link { padding: 5px 15px; justify-content: flex-start; }
  html.menu-collapsed .menu-link .text-truncate, html.menu-collapsed .menu-link .count { display: inline; }
  html.menu-collapsed .menu-icon { margin-right: 8px; }
  .layout-menu-toggle { right: 12px; rotate: 0deg; }
  html.menu-collapsed .layout-menu-toggle { rotate: 0deg; }
  .layout-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  html.menu-open .layout-overlay { display: block; }
  .menu-open-btn { display: inline-flex; }
}

/* phones */
@media (max-width: 767.98px) {
  .layout-navbar { top: 12px; left: 12px; right: 12px; padding: 0 10px; gap: 8px; }
  .layout-navbar::before { height: 12px; }
  .layout-page { padding-top: 74px; }
  .container-p { padding: 16px 12px 20px; }
  .content-footer { padding: 16px 12px; }
  .navbar-search input { font-size: 15px; }
  .card { padding: 16px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; overflow-wrap: anywhere; }
  .page-head { flex-wrap: wrap; }
  .tabs-row .sort { margin-left: 0; width: 100%; }
  h1 { overflow-wrap: anywhere; }
  .toast { max-width: calc(100vw - 24px); }
  #toasts { right: 12px; left: 12px; bottom: 12px; }
}
.table td.title-cell { min-width: 260px; }

/* visual review fixes */
.table th.num { text-align: right; }
/* controls share the dashboard's 38px height so labels and boxes line up across a row */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { height: 38px; }
/* dropdowns stay on one line; long choices end with an ellipsis */
select { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@supports (appearance: base-select) { select { overflow: hidden; } select > button, select selectedcontent { overflow: hidden; text-overflow: ellipsis; min-width: 0; } }
/* a form's closing button row sits in the last column, right-aligned, unless it spans the full width */
form.form > .row:last-child:not(.full) { grid-column: -2 / -1; justify-content: flex-end; }
@media (max-width: 767.98px) {
  .nav-tabs { flex-wrap: wrap; overflow-x: visible; }
  .grid.cols-4.stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats-row .stat-card .value { font-size: 20px; }
}

/* ---------------------------------------------------------------- profiles (dashboard /profile layout) */
.profile-card { padding: 0; overflow: hidden; }
.profile-banner img { display: block; width: 100%; height: 250px; object-fit: cover; }
.profile-header { display: flex; align-items: flex-end; gap: 20px; margin-top: -32px; padding: 0 24px 24px; flex-wrap: wrap; }
.profile-avatar { width: 120px; height: 120px; border-radius: 8px; border: 3.5px solid var(--mm-surface); object-fit: cover; background: var(--mm-bg); flex: none; position: relative; }
.profile-avatar.active { border-color: #1f904f; }
.profile-avatar.initials { display: grid; place-items: center; font-size: 40px; font-weight: 600; color: var(--mm-primary); background: #26344a; }
.profile-info { flex: 1; min-width: 200px; }
.profile-info h4 { font-size: 24px; line-height: 38px; font-weight: 500; color: var(--mm-menu-text); margin: 0 0 6px; overflow-wrap: anywhere; }
.profile-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.profile-meta li { display: flex; align-items: center; gap: 4px; }
.profile-meta .bx { font-size: 20px; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 8px 32px; }
.section-label { display: block; color: #7e7f96; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; margin: 4px 0 12px; }
.info-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.info-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.info-list .bx { font-size: 20px; flex: none; }
.info-label { font-weight: 500; color: var(--mm-text); }
.info-value { min-width: 0; overflow-wrap: anywhere; }
.text-success { color: #71dd37; font-weight: 500; }
.badge.role { background: rgba(126, 181, 238, .14); color: var(--mm-primary); }
/* user cell (dashboard /profile/search) */
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.user-cell .avatar { width: 38px; height: 38px; flex: none; }
.user-cell .avatar img { border-radius: 50%; }
.user-cell b { display: block; color: var(--mm-menu-text); font-weight: 500; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: rgba(213, 213, 226, .04); }
.stat-card .caption { color: var(--mm-muted); font-size: 12px; margin-top: 2px; }
.role-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
@media (max-width: 767.98px) { .profile-banner img { height: 140px; } .profile-avatar { width: 88px; height: 88px; } .profile-header { padding: 0 16px 16px; } }
@media (max-width: 767.98px) { .profile-header { flex-direction: column; align-items: flex-start; gap: 12px; } .profile-info { min-width: 0; width: 100%; } }

/* account settings (dashboard /manager/*) */
.account-tabs { margin-bottom: 24px; }
.account-tabs .nav-pill { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.account-tabs .nav-pill .bx { font-size: 20px; }
.account-avatar { display: flex; align-items: center; gap: 24px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--mm-border); }
.account-avatar img, .account-avatar .initials { width: 100px; height: 100px; border-radius: 6px; object-fit: cover; flex: none; }
.account-avatar .initials { display: grid; place-items: center; font-size: 34px; font-weight: 600; color: var(--mm-primary); background: #26344a; }
.account-avatar b { color: var(--mm-menu-text); font-size: 18px; font-weight: 500; }
.connections { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 16px; }
.connections li { display: flex; align-items: center; gap: 14px; }
.conn-icon { font-size: 30px; width: 38px; text-align: center; flex: none; }
.conn-icon.discord { color: var(--mm-discord); }
.wallpapers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; margin-top: 8px; }
.wallpaper { padding: 8px; border: 1px solid var(--mm-border); border-radius: 6px; background: transparent; cursor: pointer; }
.wallpaper img { display: block; width: 100%; aspect-ratio: 1675 / 371; object-fit: cover; border-radius: 4px; }
.wallpaper:hover { border-color: var(--mm-primary); }
.wallpaper.selected { border: 3px solid var(--mm-primary); padding: 6px; }
.profile-banner.empty { height: 120px; background: linear-gradient(135deg, #26344a, var(--mm-surface)); }
.grow { flex: 1; min-width: 0; }
