:root{--ms-midnight:#0f0f3b;--ms-blue:#11beff;--ms-ink:#20283e;--ms-muted:#626e82;--ms-line:#dce3ed;--ms-bg:#f3f6fa;--ms-white:#fff;--ms-action:#075d8c;--ms-focus:#087eaf;--header:64px;--sidebar:252px}
*{box-sizing:border-box}html{scroll-padding-top:80px}body{margin:0;background:var(--ms-bg);color:var(--ms-ink);font:14px/1.55 system-ui,"Leelawadee UI",Tahoma,sans-serif}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button,a,summary{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid transparent;border-radius:6px;background:var(--ms-midnight);color:white;font-weight:650;padding:10px 16px;min-height:40px}button:hover{background:#242454}button:disabled{opacity:.5;cursor:not-allowed}a:focus,button:focus,summary:focus,input:focus,select:focus{outline:2px solid var(--ms-focus);outline-offset:2px}header{position:sticky;top:0;z-index:30;height:var(--header);display:flex;align-items:center;gap:16px;padding:0 24px;background:var(--ms-midnight);color:white;border-bottom:1px solid #ffffff24}header>div{margin-left:auto;display:flex;align-items:center;gap:12px;font-size:13px}header button:not(.menu-toggle){background:transparent;border-color:#ffffff45;font-size:13px;min-height:36px;padding:7px 12px}header button:not(.menu-toggle):hover{background:#ffffff16}.brand{font-size:24px;font-weight:800;letter-spacing:-.7px;white-space:nowrap;line-height:1.1}.brand span{color:var(--ms-blue);margin-left:4px}.shell{display:grid;grid-template-columns:var(--sidebar) minmax(0,1fr);min-height:calc(100vh - var(--header))}aside{position:sticky;top:var(--header);height:calc(100vh - var(--header));overflow-y:auto;overscroll-behavior:contain;background:var(--ms-midnight);color:#e0e6f4;padding:18px 12px;scrollbar-width:thin;scrollbar-color:#454568 transparent}nav a,summary{display:block;padding:10px 12px;border-radius:5px;cursor:pointer;overflow-wrap:anywhere}nav a:hover,summary:hover{background:#ffffff10;color:white}nav a.active{background:#11beff19;color:#b5eaff;box-shadow:inset 3px 0 var(--ms-blue);font-weight:650}nav details{margin-top:12px}details a{padding-left:25px;font-size:13px}details summary{font-size:11px;font-weight:750;letter-spacing:.065em;color:#aab6d3;list-style:none}details summary::-webkit-details-marker{display:none}details summary::before{content:'›';display:inline-block;margin-right:9px;color:var(--ms-blue);font-size:15px;line-height:1}details[open] summary::before{transform:rotate(90deg)}.content{padding:28px 32px 48px;min-width:0;max-width:1800px;width:100%}.content>p.muted{margin:0 0 9px;font-size:12px}.muted,small{color:var(--ms-muted)}h1{font-size:27px;line-height:1.25;letter-spacing:-.025em;color:var(--ms-midnight);margin:0 0 24px}h2{font-size:19px;line-height:1.4;color:var(--ms-midnight);margin:0 0 16px}h2 small{font-size:12px;font-weight:500;margin-left:8px}.panel,.loginbox{background:white;border:1px solid var(--ms-line);border-radius:9px;padding:24px;min-width:0}.panel{box-shadow:0 2px 5px #0f0f3b05}.panel>p:last-child{margin-bottom:0}.inline{display:inline;margin:0}label{display:block;margin:15px 0 6px;font-weight:600;color:var(--ms-ink)}input:not([type=hidden]):not([type=checkbox]),select{display:block;width:100%;min-width:0;padding:10px 12px;min-height:42px;margin-top:7px;border:1px solid #c4cfdd;border-radius:6px;background:white;color:var(--ms-ink)}input[readonly]{background:#f0f3f7!important;color:#586478}select:disabled{background:#f0f3f7}input::placeholder{color:#758094}.menu-search{margin:0 4px 16px;font-size:11px;color:#bbc6e1;letter-spacing:.025em}.menu-search input:not([type=hidden]){background:#ffffff0b;color:white;border-color:#ffffff30;font-size:13px}.menu-search input::placeholder{color:#a5b0cc}.toolbar,.actions,.searchform{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.toolbar{justify-content:space-between;margin-bottom:18px}.toolbar h2{margin:0}.searchform input:not([type=hidden]){width:290px;margin:0}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 24px}.actions{margin-top:24px;justify-content:flex-end}.actionlink,.backlink{color:var(--ms-action);font-weight:650}.actionlink:hover,.backlink:hover{text-decoration:underline}.backlink{display:inline-block;margin-bottom:16px}.table-scroll{overflow-x:auto;max-width:100%;border:1px solid var(--ms-line);border-radius:7px;overscroll-behavior-x:contain}table{border-collapse:separate;border-spacing:0;width:100%;text-align:left;font-size:13px}th,td{padding:12px 14px;border-bottom:1px solid var(--ms-line);white-space:nowrap}th{background:#eef3f9;color:#34445f;font-size:12px;font-weight:750}tbody tr:nth-child(even){background:#f9fbfd}tbody tr:hover{background:#eaf7fd}tbody tr:last-child td{border-bottom:0}.matrix td:not(:first-child),.matrix th:not(:first-child){text-align:center}.matrix input[type=checkbox]{width:18px;height:18px;accent-color:#087eaf;margin:0;vertical-align:middle}.matrix td:first-child,.matrix th:first-child{position:sticky;left:0;background:white;box-shadow:1px 0 var(--ms-line)}.matrix th:first-child{background:#eef3f9}.state{display:inline-block;padding:3px 9px;border-radius:4px;background:#edf0f5;color:#46536a;font-size:12px;font-weight:600}.state.s1{background:#e6f4ed;color:#176344}.state.s2{background:#fff1df;color:#86520f}.notice,.error{padding:12px 15px;border:1px solid #b9dfef;background:#edf9ff;border-radius:6px;color:#145575}.error{background:#fff2f3;border-color:#f1c4ca;color:#a21c27}dt{color:var(--ms-muted);font-size:12px}dd{margin:4px 0 18px;font-weight:650}.login{min-height:100vh;background:var(--ms-midnight);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 24px}.login-shell{display:grid;grid-template-columns:1fr 420px;width:100%;max-width:930px;min-height:490px;border:1px solid #ffffff26;border-radius:12px;overflow:hidden;box-shadow:0 18px 55px #0003}.login-identity{position:relative;overflow:hidden;background:#141444;display:flex;align-items:flex-end;padding:44px;color:white;min-width:0}.identity-copy{position:relative;z-index:1}.identity-copy .brand{font-size:46px}.identity-kicker{font-size:11px;letter-spacing:.22em;color:#aebed9;margin-top:12px;font-weight:700}.identity-copy h1{font-size:32px;color:white;margin:34px 0 10px}.identity-copy p{color:#c2cce4;margin:0}.identity-pattern{position:absolute;inset:0;background:repeating-linear-gradient(135deg,transparent 0,transparent 42px,#11beff0d 43px,#11beff0d 44px);pointer-events:none}.identity-pattern:after{content:'';position:absolute;right:38px;top:38px;width:74px;height:3px;background:var(--ms-blue)}.loginbox{border:0;border-radius:0;padding:46px 38px;display:flex;flex-direction:column;justify-content:center}.login-kicker{color:var(--ms-action);font-size:11px;letter-spacing:.14em;font-weight:800}.loginbox h2{font-size:29px;margin:12px 0 7px}.loginbox .muted{margin:0 0 20px}.loginbox label{margin-top:16px}.loginbox input:not([type=hidden]){min-height:46px;margin:0}.loginbox button{width:100%;margin-top:24px;min-height:46px;display:flex;justify-content:center;align-items:center;gap:12px}.login-footer{color:#aebed9;font-size:12px;margin-top:22px}.menu-toggle,.nav-overlay{display:none}[hidden]{display:none!important}
@media(max-width:900px){:root{--header:60px}.shell{grid-template-columns:minmax(0,1fr)}header{padding:0 14px;gap:12px}.menu-toggle{display:flex;flex-direction:column;justify-content:center;gap:4px;padding:10px;background:transparent;border:1px solid #ffffff35;min-width:40px}.menu-toggle span{display:block;width:18px;height:2px;background:white}header .brand{font-size:21px}header>div{gap:7px}header button:not(.menu-toggle){font-size:12px;padding:6px 8px}aside{position:fixed;z-index:25;left:0;top:var(--header);bottom:0;height:auto;width:min(300px,85vw);transform:translateX(-100%);visibility:hidden;transition:transform .18s ease,visibility .18s}.nav-open aside{transform:translateX(0);visibility:visible}.nav-open .nav-overlay{display:block;position:fixed;inset:var(--header) 0 0;z-index:24;background:#0f0f3b66;border:0;border-radius:0;width:100%;height:calc(100% - var(--header))}.nav-open{overflow:hidden}.content{padding:22px 16px 36px}.panel{padding:18px}h1{font-size:24px;margin-bottom:18px}.formgrid{grid-template-columns:1fr}.searchform{width:100%}.searchform input:not([type=hidden]){flex:1;width:auto;min-width:100px}.table-scroll{margin-top:8px}th,td{padding:11px 12px}.matrix input[type=checkbox]{width:22px;height:22px}input:not([type=hidden]):not([type=checkbox]),select{font-size:16px}}
@media(max-width:720px){.login{padding:20px 15px}.login-shell{grid-template-columns:1fr;max-width:460px;min-height:0}.login-identity{padding:28px;min-height:180px}.identity-copy .brand{font-size:35px}.identity-copy h1{font-size:23px;margin-top:18px}.loginbox{padding:30px 26px}.loginbox h2{font-size:26px}.login-footer{margin-top:16px}}
@media(prefers-reduced-motion:reduce){aside{transition:none}}

.admin-back{display:inline-flex;align-items:center;justify-content:center;padding:9px 14px;border:1px solid #cbd5e1;border-radius:6px;color:#0f0f3b;background:#fff;text-decoration:none;font-weight:600;min-height:36px;box-sizing:border-box}.admin-back:hover{background:#eaf6fc;border-color:#11beff}.admin-password{margin-top:18px}.forgot-link{text-align:center;margin-top:20px}.forgot-link a{color:#075b91;font-weight:600}.actions{flex-wrap:wrap;gap:10px}

/* Compact account administration; role matrix unchanged. */
.user-compact{max-width:820px;margin-bottom:14px;padding:18px 22px}.user-compact h2{font-size:17px;margin:12px 0}.user-compact .formgrid{gap:4px 16px}.user-compact label{font-size:13px;margin:8px 0 3px}.user-compact input:not([type=hidden]):not([type=checkbox]),.user-compact select{min-height:36px;padding:7px 10px;margin-top:4px}.user-compact .actions{margin-top:16px}.user-compact .backlink{margin-bottom:5px}.user-compact.admin-password{margin-top:0}.user-add{background:var(--ms-midnight);color:white;border-color:var(--ms-midnight)}.user-add:hover{background:#242454;color:white}.user-compact .muted{font-size:12px}@media(max-width:900px){.user-compact{max-width:100%;padding:16px}.user-compact .formgrid{grid-template-columns:1fr}.user-compact input:not([type=hidden]):not([type=checkbox]),.user-compact select{min-height:42px}}

/* CORE compact user forms */
.user-compact{max-width:760px;padding:16px 20px}.user-compact h2{margin:8px 0 12px}.user-compact .formgrid{gap:2px 14px}.user-compact .actions{margin-top:12px}.state.s9{background:#fff1df;color:#86520f}.state.s0{background:#eef1f5;color:#526075}.affiliate-categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 16px}.affiliate-categories label{display:flex;align-items:flex-start;gap:8px;margin:0;padding:7px 8px;border:1px solid #dbe3ed;border-radius:5px}.affiliate-categories input[type=checkbox]{flex:none;margin:3px 0 0}.affiliate-categories small{color:#526075}@media(max-width:650px){.user-compact{padding:14px}.affiliate-categories{grid-template-columns:1fr}}

/* MS CORE global action standard */
:root { --ms-button-bg:#000; --ms-button-fg:#fff; }
html body button:not(.nav-overlay),html body input[type="submit"],html body input[type="button"],html body input[type="reset"],html body a.admin-back,html body a.actionlink,html body a.pi-back,html body a.pi-view,html body a.pi-edit,html body a[role="button"],html body .pi-pagination a,html body .pi-pages a {background:var(--ms-button-bg)!important;color:var(--ms-button-fg)!important;border-color:#000!important;font-size:13px!important;font-family:inherit!important;font-weight:600!important;text-transform:uppercase!important;box-shadow:none!important;text-decoration:none!important;}
html body a.admin-back,html body a.actionlink,html body a.pi-back,html body a.pi-view,html body a.pi-edit,html body a[role="button"] {display:inline-flex;align-items:center;justify-content:center;padding:6px 12px;min-height:32px;border-radius:5px;border:1px solid #000;}
html body button:not(.nav-overlay):hover,html body a.admin-back:hover,html body a.actionlink:hover,html body a.pi-back:hover,html body a.pi-view:hover,html body a.pi-edit:hover {background:#242424!important;color:#fff!important;}
html body button:disabled {opacity:.5;cursor:not-allowed;}
