[hidden]{display:none!important}
:root{--navy:#071a3d;--blue:#1464f4;--bg:#f3f6fb;--line:#dfe6f0;--text:#10213d;--muted:#68758a}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}.screen{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,var(--navy),#103979)}.login-card{width:min(410px,calc(100% - 28px));background:white;border-radius:20px;padding:28px;box-shadow:0 30px 80px #0005}.logo{width:64px;height:64px;border-radius:15px;background:var(--navy);color:#fff;display:grid;place-items:center;font-weight:900}.login-card h1{margin-bottom:2px}.login-card p{color:var(--muted)}label{display:flex;flex-direction:column;gap:6px;font-weight:700;font-size:.86rem;margin-top:12px}input,select,textarea{padding:11px;border:1px solid var(--line);border-radius:9px;width:100%}textarea{min-height:85px}button{background:var(--blue);color:white;border:0;border-radius:9px;padding:10px 13px;font-weight:800;cursor:pointer}.login-card>button,.modal>button{width:100%;margin-top:18px;padding:12px}.secondary{background:#e8eef8;color:var(--navy)}header{background:var(--navy);color:#fff;padding:16px max(16px,calc((100vw - 1180px)/2));display:flex;justify-content:space-between;align-items:center}header strong{display:block;font-size:1.2rem}header span{font-size:.85rem;color:#bfd2f4;margin-right:10px}nav{display:flex;gap:8px;padding:12px max(16px,calc((100vw - 1180px)/2));background:white;border-bottom:1px solid var(--line)}nav button{background:transparent;color:#40516c}nav button.active{background:#e8f0ff;color:#0d47b8}main{max-width:1180px;margin:auto;padding:22px 16px 50px}.view{display:none}.view.active{display:block}.title{display:flex;justify-content:space-between;align-items:center;gap:15px}.title h1{margin-bottom:0}.title p{margin-top:4px;color:var(--muted)}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:18px 0}.stat,.card{background:#fff;border:1px solid var(--line);border-radius:15px;padding:17px;box-shadow:0 10px 30px #10213d12}.stat strong{font-size:1.7rem;display:block}.stat span{color:var(--muted)}.row{padding:13px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:16px}.row:last-child{border:0}.meta{color:var(--muted);font-size:.88rem}.pill{display:inline-block;background:#e8eef8;padding:4px 8px;border-radius:99px;font-size:.76rem;font-weight:800}.filters{display:grid;grid-template-columns:1fr 220px;gap:10px;margin-bottom:12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.full{grid-column:1/-1}dialog{border:0;border-radius:18px;padding:0;width:min(720px,calc(100% - 24px));box-shadow:0 30px 90px #0006}.modal{padding:20px}.modal-head{display:flex;justify-content:space-between;align-items:center}.icon{background:#edf1f7;color:#22344f;width:36px;height:36px;border-radius:50%;font-size:1.4rem;padding:0}.error{color:#b4233c;margin-top:10px}.empty{padding:25px;text-align:center;color:var(--muted)}@media(max-width:700px){.stats{grid-template-columns:1fr 1fr}.grid,.filters{grid-template-columns:1fr}.title{align-items:flex-start}.row{flex-direction:column}} 
.clickable{cursor:pointer}.clickable:hover{background:#f5f8fc}.wide{width:min(940px,94vw)}.detail-actions,.actions,.uploadbar,.notebar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.detail-grid .card{margin:0}dl{display:grid;grid-template-columns:120px 1fr;gap:8px;margin:0}dt{font-weight:700;color:#53627a}dd{margin:0}.files{display:flex;flex-direction:column;gap:8px}.files a{padding:10px;background:#eef4ff;border-radius:8px;text-decoration:none;color:#0b4fb3}.notebar textarea{flex:1;min-height:70px}.timeline>div{border-left:3px solid #0b66ff;padding:4px 0 10px 14px;margin:10px 0}.timeline span{display:block;color:#69768b;font-size:.82rem}.timeline p{margin:4px 0}.danger{background:#b42318}.secondary{background:#e9eef6;color:#16345e}.modal-head p{margin:2px 0;color:#69768b}@media(max-width:720px){.detail-grid{grid-template-columns:1fr}.uploadbar>*{width:100%}dl{grid-template-columns:95px 1fr}}

/* v2.1.1 session and navigation polish */
body.app-ready{overflow-x:hidden}
body.auth-pending #loginForm{opacity:.72;pointer-events:none}
.login-card button[disabled]{opacity:.65;cursor:wait}
@media(max-width:700px){header{gap:12px;align-items:flex-start}header>div:last-child{display:flex;align-items:center;gap:7px}header span{margin-right:0;max-width:150px}nav{position:sticky;top:0;z-index:20;overflow-x:auto}nav button{white-space:nowrap}}

.app-error{position:relative;z-index:9999;margin:12px auto;padding:12px 16px;max-width:1180px;background:#fff1f0;border:1px solid #f2b8b5;border-radius:10px;color:#8a1c13;font-weight:700}

.row-actions{display:flex;gap:8px;align-items:center}.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;padding:10px 14px;border-radius:9px;font-weight:700}.small-btn{padding:9px 12px}code{background:#eef2f7;padding:2px 6px;border-radius:5px}

#manufacturerSelect,#modelSelect{width:100%} select:disabled{opacity:.65;cursor:not-allowed}.meta+button{margin-left:.5rem}

/* v3.1.1 searchable device selector */
#manufacturerSearch,#modelSearch{margin-bottom:6px;background:#fff}.device-search-hint{font-size:.78rem;color:var(--muted);font-weight:500}

/* v3.1.2 autocomplete-only device selector */
.autocomplete{position:relative}.autocomplete-results{position:absolute;z-index:50;left:0;right:0;top:calc(100% + 4px);max-height:280px;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 16px 40px #10213d2b;padding:6px}.autocomplete-option,.autocomplete-add{display:flex;width:100%;text-align:left;border-radius:7px;padding:10px;background:#fff;color:var(--text);font-weight:600}.autocomplete-option{flex-direction:column;gap:2px}.autocomplete-option span{font-size:.76rem;color:var(--muted);font-weight:500}.autocomplete-option:hover,.autocomplete-option:focus{background:#eef4ff}.autocomplete-add{margin-top:5px;background:#e8f0ff;color:#0d47b8}.autocomplete-empty{padding:10px;color:var(--muted);font-size:.86rem}#manufacturerSearch,#modelSearch{margin-bottom:0}
#faultSearch{margin-bottom:0}.fault-option{display:flex;width:100%;text-align:left;border-radius:7px;padding:10px;background:#fff;color:var(--text);font-weight:600}.fault-option:hover,.fault-option:focus{background:#eef4ff}

/* v3.1.4 PIN and Android pattern capture */
.access-code{border:1px solid var(--line);border-radius:12px;padding:14px;margin:0;min-width:0}.access-code legend{font-weight:700;padding:0 6px}.access-choice{display:flex;gap:10px;flex-wrap:wrap}.access-choice label{display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:9px;padding:9px 11px;background:#fff;cursor:pointer}.access-choice input{width:auto;margin:0}.access-panel{margin-top:14px}.pattern-lock{position:relative;width:min(280px,100%);aspect-ratio:1;margin:10px auto;display:grid;grid-template-columns:repeat(3,1fr);gap:28px;padding:28px;touch-action:none;user-select:none}.pattern-lock svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.pattern-lock line{stroke:var(--primary);stroke-width:8;stroke-linecap:round;opacity:.75}.pattern-lock button{position:relative;z-index:2;width:42px;height:42px;padding:0;border-radius:50%;justify-self:center;align-self:center;background:#fff;border:4px solid #8090a8;box-shadow:0 0 0 8px #eef3fb;color:transparent}.pattern-lock button.selected{background:var(--primary);border-color:var(--primary);box-shadow:0 0 0 8px #dce9ff}.pattern-actions{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}.pattern-actions span{font-size:.86rem;color:var(--muted);font-weight:600}@media(max-width:520px){.access-choice{display:grid}.pattern-lock{gap:20px;padding:22px}}


/* v3.2.0 Technician Workspace */
.workspace-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px;padding:6px;background:#eef3f9;border-radius:14px}.workspace-tabs button{background:transparent;color:#18324d;border:0}.workspace-tabs button.active{background:#fff;color:#071a3d;box-shadow:0 2px 10px #071a3d1a}.workspace-panel{display:none}.workspace-panel.active{display:block}.diagnostic-shell{display:grid;gap:16px}.diagnostic-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;padding:18px;border-radius:16px;background:linear-gradient(135deg,#071a3d,#124f91);color:#fff}.diagnostic-header h3{font-size:1.4rem;margin:3px 0}.diagnostic-header p{margin:0;color:#dcecff}.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-size:.72rem;font-weight:800}.diagnostic-status{background:#ffffff1f;border:1px solid #ffffff38;padding:7px 10px;border-radius:999px;font-size:.78rem;white-space:nowrap}.diagnostic-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr);gap:16px}.diagnostic-step{display:grid;grid-template-columns:minmax(0,1fr) 145px;gap:10px;padding:13px 0;border-bottom:1px solid #e5ebf2}.diagnostic-step>div span{display:block;color:#62758a;font-size:.84rem;margin-top:3px}.diagnostic-step textarea{grid-column:1/-1;min-height:58px}.diagnostic-grid label{display:grid;gap:5px;margin-bottom:10px}@media(max-width:800px){.diagnostic-grid{grid-template-columns:1fr}.diagnostic-step{grid-template-columns:1fr}.diagnostic-header{display:block}.diagnostic-status{display:inline-block;margin-top:12px}}

/* v3.2.1 unified intelligent device search */
#deviceSearch{margin-bottom:0}.device-smart-search .autocomplete-results{max-height:360px}.device-result strong{font-size:.94rem}.device-result span{line-height:1.35}.device-result span:empty{display:none}#selectedManufacturer,#selectedModel,#deviceCategory{background:#f5f7fb;color:var(--text)}

/* v3.2.3 business-portal style device picker */
.device-picker-label{font-size:1rem}.device-search-input-wrap{position:relative}.device-search-icon{position:absolute;left:15px;top:50%;transform:translateY(-50%);font-size:1.35rem;color:#61728b;pointer-events:none}.device-smart-search #deviceSearch{height:58px;padding:14px 48px;font-size:1rem;font-weight:650;border:2px solid #cbd6e5;border-radius:14px;background:#fff;transition:border-color .15s,box-shadow .15s}.device-smart-search #deviceSearch:focus{outline:0;border-color:var(--blue);box-shadow:0 0 0 4px #1464f425}.device-smart-search #deviceSearch::-webkit-search-cancel-button{cursor:pointer}.device-picker-results{top:calc(100% + 8px);max-height:430px;padding:0;border-radius:14px;border:1px solid #bfd0e6;overflow:auto;box-shadow:0 22px 55px #071a3d35}.device-picker-results .device-result{display:grid;grid-template-columns:52px minmax(0,1fr);gap:14px;align-items:center;padding:16px 18px;border-radius:0;border-bottom:1px solid var(--line);min-height:78px}.device-picker-results .device-result:last-of-type{border-bottom:0}.device-picker-results .device-result:hover,.device-picker-results .device-result:focus,.device-picker-results .device-result.active{background:#eef5ff;outline:0}.device-result-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:10px;background:#eaf1fa;font-size:1.7rem}.device-result-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.device-result-copy strong{font-size:1rem;line-height:1.2;color:var(--text)}.device-result-copy>span{font-size:.86rem;color:var(--muted);font-weight:600}.device-result-copy small{font-size:.75rem;color:#41638e;font-weight:650}.device-picker-results .autocomplete-add{margin:0;border-radius:0;padding:15px 18px;gap:8px;border-top:1px solid var(--line);background:#f4f8ff}.device-picker-results .autocomplete-empty{padding:22px 18px}.selected-device-summary{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:13px;align-items:center;padding:13px 15px;border:1px solid #b8cceb;border-radius:12px;background:#f1f7ff;margin-top:4px}.selected-device-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;background:#fff;font-size:1.6rem}.selected-device-summary div{display:flex;flex-direction:column;gap:3px}.selected-device-summary strong{font-size:.96rem}.selected-device-summary span:not(.selected-device-icon){font-size:.8rem;color:var(--muted);font-weight:600}.selected-device-summary button{white-space:nowrap}@media(max-width:520px){.device-smart-search #deviceSearch{height:54px;padding-left:44px;font-size:.94rem}.device-picker-results .device-result{grid-template-columns:44px minmax(0,1fr);padding:13px}.device-result-icon{width:38px;height:38px;font-size:1.4rem}.selected-device-summary{grid-template-columns:42px minmax(0,1fr)}.selected-device-summary button{grid-column:1/-1;width:100%}}

/* v3.2.6 CCUS Scotland branding and persistent themes */
:root{
 --surface:#fff;--surface-soft:#f7f9fc;--surface-raised:#fff;--header:#071a3d;
 --button-secondary:#e9eef6;--button-secondary-text:#16345e;--input-bg:#fff;
 --shadow:16,33,61;--overlay:0,0,0;--accent-soft:#e8f0ff;--accent-text:#0d47b8;
}
html[data-theme="dark"]{
 --navy:#071426;--blue:#2f80ff;--bg:#081321;--line:#26384d;--text:#edf5ff;--muted:#9cafc4;
 --surface:#0e1d2e;--surface-soft:#122338;--surface-raised:#13253a;--header:#06111f;
 --button-secondary:#20344b;--button-secondary-text:#e4efff;--input-bg:#091727;
 --shadow:0,0,0;--overlay:0,0,0;--accent-soft:#173b69;--accent-text:#acd0ff;
}
body,.card,.stat,nav,input,select,textarea,dialog,.login-card,.autocomplete-results,.autocomplete-option,.access-choice label,.pattern-lock button,.workspace-tabs,.workspace-tabs button.active{transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease}
body{background:var(--bg);color:var(--text)}
.screen{position:relative;background:radial-gradient(circle at 20% 15%,#1767b666,transparent 32%),linear-gradient(135deg,var(--navy),#103979)}
html[data-theme="dark"] .screen{background:radial-gradient(circle at 20% 15%,#1464f433,transparent 32%),linear-gradient(135deg,#030a12,#0b213d)}
.login-card,.card,.stat,dialog{background:var(--surface);color:var(--text);border-color:var(--line)}
.login-card{width:min(440px,calc(100% - 28px));padding:30px}.login-card h1{margin-top:24px}
.brand-lockup,.header-brand{display:flex;align-items:center;gap:13px}.brand-name{font-size:1.15rem;font-weight:900;letter-spacing:.01em}.brand-subtitle{text-transform:uppercase;letter-spacing:.16em;font-size:.68rem;font-weight:800;color:var(--blue);margin-top:2px}
.brand-mark{position:relative;width:72px;height:72px;display:grid;place-items:center;border-radius:18px;background:linear-gradient(145deg,#1464f4,#071a3d);color:#fff;box-shadow:0 12px 28px #071a3d45;overflow:hidden}.brand-mark strong{position:relative;font-size:.9rem;letter-spacing:.05em;margin-top:21px}.power-ring{position:absolute;width:28px;height:28px;border:4px solid #fff;border-top-color:transparent;border-radius:50%;top:10px}.power-ring:before{content:"";position:absolute;width:4px;height:15px;background:#fff;border-radius:4px;left:8px;top:-8px}.brand-mark-small{width:48px;height:48px;border-radius:12px;box-shadow:none;flex:none}.brand-mark-small .power-ring{width:20px;height:20px;border-width:3px;top:6px}.brand-mark-small .power-ring:before{width:3px;height:11px;left:6px;top:-6px}.brand-mark-small strong{font-size:.62rem;margin-top:16px}
header{background:var(--header)}header .header-brand>div:last-child>strong{font-size:1.05rem}.header-actions{display:flex;align-items:center;gap:9px}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:auto;background:#ffffff18;color:#fff;border:1px solid #ffffff32;padding:9px 11px}.theme-toggle:hover{background:#ffffff27}.login-theme-toggle{position:absolute;right:18px;top:18px;z-index:2;background:#071a3dcc}.login-theme-toggle span:first-child{font-size:1.08rem}
nav{background:var(--surface);border-color:var(--line)}nav button{color:var(--muted)}nav button.active{background:var(--accent-soft);color:var(--accent-text)}
input,select,textarea{background:var(--input-bg);color:var(--text);border-color:var(--line)}input::placeholder,textarea::placeholder{color:var(--muted)}
.secondary{background:var(--button-secondary);color:var(--button-secondary-text)}.icon{background:var(--button-secondary);color:var(--button-secondary-text)}
.row{border-color:var(--line)}.clickable:hover{background:var(--surface-soft)}.pill{background:var(--button-secondary);color:var(--button-secondary-text)}code{background:var(--surface-soft);color:var(--text)}
.autocomplete-results,.autocomplete-option,.fault-option{background:var(--surface-raised);color:var(--text);border-color:var(--line)}.autocomplete-option:hover,.autocomplete-option:focus,.fault-option:hover,.fault-option:focus{background:var(--accent-soft)}
.access-choice label,.pattern-lock button{background:var(--surface);border-color:var(--line)}.workspace-tabs{background:var(--surface-soft)}.workspace-tabs button{color:var(--muted)}.workspace-tabs button.active{background:var(--surface-raised);color:var(--text)}
.files a{background:var(--accent-soft);color:var(--accent-text)}dt{color:var(--muted)}.timeline span,.modal-head p{color:var(--muted)}
html[data-theme="dark"] dialog::backdrop{background:#000a}html[data-theme="dark"] .diagnostic-step{border-color:var(--line)}html[data-theme="dark"] .diagnostic-step>div span{color:var(--muted)}
@media(max-width:700px){.header-brand .brand-mark-small{display:none}.header-actions{flex-wrap:wrap;justify-content:flex-end}.theme-toggle [data-theme-label]{display:none}.theme-toggle{width:40px}.login-theme-toggle{width:auto}.login-theme-toggle [data-theme-label]{display:inline}}

/* v3.2.7 CCUS executive dashboard */
.app-shell{min-height:100vh;display:grid;grid-template-columns:252px minmax(0,1fr);background:var(--bg)}
.app-sidebar{position:fixed;inset:0 auto 0 0;width:252px;z-index:60;display:flex;flex-direction:column;background:linear-gradient(180deg,#06152a,#071b32 65%,#061426);color:#fff;border-right:1px solid #ffffff12;overflow-y:auto}
.sidebar-brand{display:flex;align-items:center;gap:12px;padding:18px 16px 16px;border-bottom:1px solid #ffffff12}.sidebar-brand img{width:66px;height:66px;border-radius:50%;object-fit:cover;box-shadow:0 0 24px #17a8ff55}.sidebar-brand strong,.sidebar-brand span{display:block}.sidebar-brand strong{font-size:1.05rem;text-transform:uppercase;letter-spacing:.035em}.sidebar-brand span{font-size:.78rem;text-transform:uppercase;letter-spacing:.12em;color:#26a9ff;font-weight:900;margin-top:3px}
.sidebar-nav{display:flex;flex-direction:column;gap:4px;padding:15px 10px;background:transparent;border:0}.sidebar-nav button{display:flex;align-items:center;gap:11px;width:100%;text-align:left;background:transparent;color:#d8e6f7;padding:10px 12px;border-radius:8px;font-weight:650}.sidebar-nav button:hover{background:#ffffff0d}.sidebar-nav button.active{background:linear-gradient(90deg,#1556ba,#1767cf);color:#fff;box-shadow:0 6px 18px #0003}.nav-icon{width:22px;text-align:center;font-size:1.08rem}.nav-heading{padding:13px 12px 5px;color:#8ea3bd;font-size:.68rem;letter-spacing:.09em;text-transform:uppercase;font-weight:800}
.sidebar-footer{margin-top:auto;padding:16px;border-top:1px solid #ffffff18;display:flex;gap:10px;align-items:flex-start}.sidebar-footer img{width:46px;height:46px;border-radius:50%;object-fit:cover}.sidebar-footer strong,.sidebar-footer span{display:block}.sidebar-footer strong{font-size:.78rem;text-transform:uppercase}.sidebar-footer span{font-size:.69rem;color:#bdcce0;margin-top:4px;line-height:1.35}
.app-content{min-width:0;margin-left:252px}.topbar{position:sticky;top:0;z-index:50;min-height:76px;padding:12px 24px;background:var(--header);border-bottom:1px solid #ffffff10}.menu-toggle{display:none;background:#ffffff12;color:#fff;font-size:1.2rem}.topbar-title strong,.topbar-title span{display:block}.topbar-title strong{font-size:1rem}.topbar-title span{font-size:.75rem;color:#8fb0d3;margin:3px 0 0}.user-chip{display:flex;align-items:center;gap:9px;padding-left:10px;border-left:1px solid #ffffff1c}.user-chip>div strong,.user-chip>div span{display:block}.user-chip>div strong{font-size:.86rem}.user-chip>div span{font-size:.72rem;color:#a9bdd5;margin:2px 0 0;text-transform:capitalize}.user-avatar{display:grid!important;place-items:center;width:34px;height:34px;border-radius:50%;background:#e6edf7;color:#8999ad!important;margin:0!important}.signout-button{padding:8px 10px}
.app-content main{max-width:none;padding:28px 34px 50px}.dashboard-welcome{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:18px}.dashboard-welcome h1{margin:0;font-size:1.8rem}.dashboard-welcome p{margin:7px 0 0;color:var(--muted)}.welcome-actions{display:flex;gap:10px}.dashboard-stats{margin:0 0 18px}.dashboard-stats .stat{display:grid;grid-template-columns:52px 1fr;gap:13px;align-items:center;padding:20px}.stat-icon{grid-row:1/3;display:grid;place-items:center;width:52px;height:52px;border-radius:12px;background:var(--accent-soft);color:var(--blue);font-size:1.45rem}.dashboard-stats .stat strong{font-size:1.65rem;color:var(--blue)}.dashboard-stats .stat span{font-size:.86rem}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr);gap:18px}.dashboard-side{display:grid;gap:18px;align-content:start}.card-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}.card-heading h2,.dashboard-search h2{margin:0;font-size:1.04rem}.text-button{background:transparent;color:var(--blue);padding:6px}.dashboard-recent .row{padding:15px 4px}.dashboard-search-wrap{position:relative;margin-top:16px}.dashboard-search-wrap span{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:1.25rem}.dashboard-search-wrap input{padding-left:44px;height:48px}.quick-action-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:14px}.quick-action-grid button{min-height:58px}
html[data-theme="dark"] .app-sidebar{background:linear-gradient(180deg,#030b15,#071727 70%,#030b15)}
@media(max-width:980px){.app-shell{display:block}.app-sidebar{transform:translateX(-100%);transition:transform .2s ease;box-shadow:20px 0 50px #0007}.app-shell.sidebar-open .app-sidebar{transform:translateX(0)}.app-content{margin-left:0}.menu-toggle{display:inline-flex}.topbar-title{display:none}.dashboard-grid{grid-template-columns:1fr}.app-content main{padding:22px 18px 44px}}
@media(max-width:700px){.dashboard-welcome{align-items:flex-start;flex-direction:column}.welcome-actions{width:100%}.welcome-actions button{flex:1}.dashboard-stats{grid-template-columns:1fr 1fr}.quick-action-grid{grid-template-columns:1fr}.app-content main{padding:18px 13px 40px}.user-chip{display:none}.topbar{padding:10px 13px}.sidebar-footer{display:none}}
@media(max-width:480px){.dashboard-stats{grid-template-columns:1fr}.welcome-actions{flex-direction:column}}


/* v3.2.8 navigation and repair workspace usability hotfix */
#detailDialog{width:min(1180px,calc(100vw - 32px));max-width:none;height:min(900px,calc(100vh - 32px));max-height:calc(100vh - 32px);overflow:hidden}
#detailDialog>.modal.wide{width:100%;height:100%;max-width:none;display:flex;flex-direction:column;padding:22px}
#detailDialog .modal-head{flex:0 0 auto;padding-bottom:12px;border-bottom:1px solid var(--line)}
#detailBody{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 5px 8px 0}
#detailBody>.card{margin-top:16px}
#detailBody .detail-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
@media(max-width:720px){#detailDialog{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}#detailDialog>.modal.wide{padding:14px}#detailBody{padding-right:0}#detailBody .detail-grid{grid-template-columns:1fr}.detail-actions{position:sticky;top:-16px;z-index:4;background:var(--surface);padding:10px 0;border-bottom:1px solid var(--line)}}

/* Workshop Pro 4.0 staff accounts */
.staff-modal{width:min(860px,calc(100vw - 28px))}.permission-panel{margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}.permission-panel h3{margin:0 0 5px}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:14px}.permission-item,.check-line{display:flex;align-items:center;gap:10px;padding:11px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}.permission-item input,.check-line input{width:auto;margin:0}.permissions-disabled{opacity:.55}.staff-modal .meta{display:block;margin-top:5px}@media(max-width:650px){.permission-grid{grid-template-columns:1fr}}


/* Workshop Pro 4.0.1 staff-dialog viewport fix */
#staffDialog{
  width:min(900px,calc(100vw - 28px));
  max-width:900px;
  max-height:calc(100dvh - 28px);
  overflow:hidden;
}
#staffDialog>.staff-modal{
  width:100%;
  max-height:calc(100dvh - 28px);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  padding:0 20px 20px;
}
#staffDialog .modal-head{
  position:sticky;
  top:0;
  z-index:5;
  margin:0 -20px 16px;
  padding:18px 20px 14px;
  background:var(--surface);
  border-bottom:1px solid var(--line);
}
#staffDialog .actions{
  position:sticky;
  bottom:0;
  z-index:5;
  margin:18px -20px -20px;
  padding:14px 20px 18px;
  background:var(--surface);
  border-top:1px solid var(--line);
}
#staffDialog .actions button{min-width:140px}
@media(max-width:700px){
  #staffDialog{
    width:100vw;
    max-width:none;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }
  #staffDialog>.staff-modal{
    max-height:100dvh;
    padding:0 14px 16px;
  }
  #staffDialog .modal-head{
    margin:0 -14px 14px;
    padding:14px;
  }
  #staffDialog .actions{
    margin:16px -14px -16px;
    padding:12px 14px calc(12px + env(safe-area-inset-bottom));
  }
  #staffDialog .actions button{flex:1;min-width:0}
}

/* Workshop Pro 4.0.3 RC1 administrator tools */
.admin-mode-banner{position:fixed;z-index:1200;top:0;left:0;right:0;display:flex;align-items:center;justify-content:center;gap:14px;padding:10px 16px;background:#f59e0b;color:#1f2937;box-shadow:0 2px 12px rgba(0,0,0,.25)}
.admin-mode-banner[hidden]{display:none}.admin-mode-banner button{padding:7px 12px;background:#1f2937;color:#fff}.is-impersonating .app-sidebar,.is-impersonating .app-content{padding-top:48px}
.permission-inspector{display:grid;gap:8px}.permission-inspector-row{display:grid;grid-template-columns:28px 1fr auto;align-items:center;gap:10px;padding:12px;border:1px solid var(--border,#dbe3ef);border-radius:10px}.permission-inspector-row small{display:block;opacity:.65}.permission-inspector-row b{font-size:.85rem}.audit-details{margin-top:5px;font-size:.82rem;opacity:.75}.update-form{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.notice.success{border-color:#22c55e;background:rgba(34,197,94,.12)}
@media(max-width:700px){.admin-mode-banner{align-items:flex-start;flex-wrap:wrap;font-size:.85rem}.is-impersonating .app-sidebar,.is-impersonating .app-content{padding-top:78px}}

/* Workshop Pro 4.0.4 secure Update Centre */
.stat-warning{outline:1px solid rgba(245,158,11,.55)}
.update-progress{margin-top:16px;display:grid;gap:9px}
.update-progress[hidden]{display:none}
.update-progress-bar{height:9px;border-radius:999px;overflow:hidden;background:var(--surface-soft);border:1px solid var(--line)}
.update-progress-bar span{display:block;width:36%;height:100%;border-radius:inherit;background:currentColor;animation:update-centre-progress 1.25s ease-in-out infinite}
@keyframes update-centre-progress{0%{transform:translateX(-110%)}100%{transform:translateX(310%)}}
.update-history-row{align-items:flex-start;gap:16px}.update-history-actions{display:flex;align-items:flex-end;gap:9px;flex-direction:column}.title.compact{margin-bottom:12px}.title.compact h2{margin-bottom:3px}
@media(max-width:700px){.update-history-row{display:grid}.update-history-actions{align-items:flex-start;flex-direction:row;flex-wrap:wrap}.update-form input{width:100%}}

/* Workshop Pro 5.0 RC1 */
.v5-commandbar{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:16px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(135deg,var(--surface),var(--surface-soft));margin-bottom:14px}.v5-commandbar>div{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.v5-commandbar strong{font-size:1.15rem}.work-timer{font-variant-numeric:tabular-nums;font-weight:800;font-size:1.05rem;padding:8px 12px;border-radius:10px;background:var(--surface-soft)}.v5-tabs{overflow:auto;white-space:nowrap}.v5-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}.v5-kpis>div{padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.v5-kpis span{display:block;font-size:.78rem;opacity:.7}.v5-kpis strong{display:block;margin-top:4px;font-size:1.08rem}.v5-fault{font-size:1.08rem;line-height:1.55}.sticky-card{position:sticky;top:12px;align-self:start}.mini-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.measurement-list{display:grid;gap:9px}.measurement-list>div{display:grid;grid-template-columns:1fr auto;gap:4px 12px;padding:12px;border:1px solid var(--line);border-radius:12px}.measurement-list small{grid-column:1/-1;opacity:.65}.v5-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;margin-top:12px}.v5-gallery a{display:grid;gap:4px;padding:13px;border:1px solid var(--line);border-radius:12px;text-decoration:none;color:inherit}.v5-gallery span{font-size:.82rem;opacity:.7;overflow-wrap:anywhere}.qc-head{display:flex;justify-content:space-between;align-items:center}.qc-head>strong{font-size:1.5rem}.qc-list{display:grid;gap:8px}.qc-list>div{display:grid;grid-template-columns:1fr 170px;gap:8px 14px;align-items:center;padding:11px;border:1px solid var(--line);border-radius:12px}.qc-list small{grid-column:1/-1;opacity:.65}.memory-match{padding:12px 0;border-bottom:1px solid var(--line)}.memory-match>div{display:flex;justify-content:space-between;gap:10px}.memory-match p{margin:6px 0}.diagnostic-shell details{padding:10px 0;border-bottom:1px solid var(--line)}.diagnostic-shell summary{cursor:pointer}.card output{display:inline-block;margin-left:8px;font-weight:800}
@media(max-width:900px){.v5-kpis{grid-template-columns:1fr 1fr}.v5-commandbar{align-items:flex-start}.diagnostic-grid{grid-template-columns:1fr}.sticky-card{position:static}}
@media(max-width:620px){.v5-commandbar{display:grid}.v5-kpis{grid-template-columns:1fr 1fr}.mini-grid{grid-template-columns:1fr}.qc-list>div{grid-template-columns:1fr}.qc-list small{grid-column:1}.v5-gallery{grid-template-columns:1fr}}

/* v5.0.0 RC1.1 device selector contrast hotfix */
.device-smart-search #deviceSearch{
 background:#0b1d31;
 color:#f5f9ff;
 border-color:#35516f;
 caret-color:#fff;
}
.device-smart-search #deviceSearch::placeholder{color:#aebed1;opacity:1}
.device-smart-search #deviceSearch:focus{
 background:#0b1d31;
 color:#fff;
 border-color:#4b95ff;
 box-shadow:0 0 0 4px #2f80ff33;
}
.device-search-icon{color:#b9c9dc}
.device-picker-results{
 background:#0e2035;
 border-color:#35516f;
 color:#f2f7ff;
}
.device-picker-results .device-result{
 background:#0e2035;
 border-bottom-color:#263f5b;
 color:#f2f7ff;
}
.device-picker-results .device-result:hover,
.device-picker-results .device-result:focus,
.device-picker-results .device-result.active{background:#183a61}
.device-result-icon{background:#173553;color:#fff}
.device-result-copy strong{color:#f5f9ff}
.device-result-copy>span{color:#b8c8da}
.device-result-copy small{color:#8fc1ff}
.device-picker-results .autocomplete-add{background:#142f4e;color:#cfe3ff;border-top-color:#35516f}
.device-picker-results .autocomplete-empty{color:#b8c8da}
.selected-device-summary{
 background:#0d2239;
 border-color:#355a80;
 color:#f5f9ff;
}
.selected-device-icon{background:#173553;color:#fff}
.selected-device-summary strong{color:#f5f9ff}
.selected-device-summary span:not(.selected-device-icon){color:#b9c9dc}

/* v5.1 CCUS CRM */
.crm-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}.crm-badge{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:.72rem;font-weight:800;background:var(--surface-2,#173451);color:var(--text,#fff)}.crm-badge.vip{background:#5b4300;color:#ffe49a}.crm-badge.trade{background:#123e31;color:#9ce8cb}.crm-badge.inactive{background:#4b2730;color:#ffc0cb}.crm-modal{width:min(820px,calc(100vw - 28px));max-height:calc(100vh - 36px);overflow:auto}.customer-workspace{width:100%;min-height:calc(100dvh - 120px)}.customer-workspace-head{position:sticky;top:0;z-index:8;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px;padding:16px 0 18px;background:var(--bg,#071a2d);border-bottom:1px solid var(--border,#29445f);margin-bottom:18px}.customer-workspace-title h1{margin:0}.customer-workspace-title p{margin:4px 0 0;color:var(--muted,#9db0c5)}.customer-workspace-body{display:grid;gap:16px;padding-bottom:32px}.customer-back{white-space:nowrap}.customer-profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.crm-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.crm-metrics>div{padding:16px;border-radius:12px;background:var(--surface-2,#122c48);text-align:center}.crm-metrics strong{display:block;font-size:1.5rem}.crm-metrics span,.crm-device span{display:block;color:var(--muted,#9db0c5);font-size:.85rem}.crm-device{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--border,#29445f)}.selected-customer-panel{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:14px;border:1px solid #2f6ca7;border-radius:14px;background:#092440;color:#eef8ff}.selected-customer-panel strong,.selected-customer-panel span{display:block}.selected-customer-panel span{color:#aac6de;font-size:.86rem}.customer-device-choices{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px}.customer-device-choice,.customer-result{background:#0e2d4b!important;color:#eef8ff!important;border:1px solid #315f86!important;text-align:left}.customer-device-choice{padding:8px 10px;border-radius:10px}.customer-device-choice small,.customer-result span{display:block;color:#afc8dc}.customer-result{width:100%;padding:12px}.customer-picker-label .autocomplete-results{max-height:300px;overflow:auto;background:#081f36;border-color:#315f86}@media(max-width:760px){.crm-stats{grid-template-columns:1fr 1fr}.customer-profile-grid{grid-template-columns:1fr}.crm-modal{width:100vw;height:100dvh;max-height:none;border-radius:0}.customer-workspace-head{grid-template-columns:1fr auto;gap:10px}.customer-back{grid-column:1/-1;justify-self:start}.customer-workspace-title h1{font-size:1.45rem}.selected-customer-panel{grid-template-columns:1fr}}

/* v5.1.0 RC1.2 CRM theme contrast hotfix */
#customerDirectoryView,
#customerWorkspace,
.customer-workspace,
.customer-workspace-body,
.crm-customer-row,
.crm-device{
  color:var(--text);
}
#customerDirectoryView .card,
#customerDirectoryView .stat,
#customerWorkspace .card{
  background:var(--surface);
  color:var(--text);
  border-color:var(--line);
}
.customer-workspace-head{
  background:var(--bg);
  color:var(--text);
  border-color:var(--line);
}
.customer-workspace-title h1,
.customer-workspace h2,
.customer-workspace h3,
.crm-customer-row strong,
.crm-device strong,
.crm-metrics strong,
.customer-workspace dd,
.customer-workspace p{
  color:var(--text);
}
.customer-workspace-title p,
.crm-customer-row .meta,
.customer-workspace .meta,
.crm-device span,
.crm-metrics span,
.customer-workspace dt,
.customer-workspace .empty{
  color:var(--muted);
}
.crm-metrics>div{
  background:var(--surface-soft);
  color:var(--text);
  border:1px solid var(--line);
}
.crm-badge{
  background:var(--accent-soft);
  color:var(--accent-text);
  border:1px solid var(--line);
}
.crm-badge.active{background:var(--accent-soft);color:var(--accent-text)}
.crm-customer-row.clickable:hover,
#customerWorkspace .row.clickable:hover{
  background:var(--surface-soft);
}
#customerWorkspace .pill{
  background:var(--button-secondary);
  color:var(--button-secondary-text);
}
html[data-theme="dark"] .crm-badge.vip{background:#5b4300;color:#ffe49a;border-color:#8a6a0a}
html[data-theme="dark"] .crm-badge.trade{background:#123e31;color:#9ce8cb;border-color:#24664f}
html[data-theme="dark"] .crm-badge.inactive{background:#4b2730;color:#ffc0cb;border-color:#75404c}
html:not([data-theme="dark"]) .crm-badge.vip{background:#fff2bd;color:#624700;border-color:#dfbd43}
html:not([data-theme="dark"]) .crm-badge.trade{background:#dff8ee;color:#15543f;border-color:#89cdb4}
html:not([data-theme="dark"]) .crm-badge.inactive{background:#ffe8ec;color:#842839;border-color:#eab0bc}

/* v5.1.0 RC1.3 — Customer editor sizing and scrolling */
#customerDialog{
  width:min(980px,calc(100vw - 32px));
  max-width:980px;
  height:min(880px,calc(100dvh - 32px));
  max-height:calc(100dvh - 32px);
  overflow:hidden;
}
#customerDialog>.crm-modal{
  width:100%;
  height:100%;
  max-height:none;
  padding:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--surface,#fff);
  color:var(--text,#10213d);
}
#customerDialog .modal-head{
  flex:0 0 auto;
  position:sticky;
  top:0;
  z-index:5;
  padding:18px 20px 14px;
  background:var(--surface,#fff);
  border-bottom:1px solid var(--line,#dfe6f0);
}
#customerDialog .crm-modal>.grid{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:6px 20px 20px;
  align-content:start;
}
#customerDialog .crm-modal>.actions{
  flex:0 0 auto;
  position:sticky;
  bottom:0;
  z-index:5;
  margin:0;
  padding:14px 20px;
  background:var(--surface,#fff);
  border-top:1px solid var(--line,#dfe6f0);
}
#customerDialog .crm-modal>.actions button{
  min-width:180px;
}
#customerDialog #customerError{
  flex:0 0 auto;
  margin:0;
  padding:0 20px 12px;
  background:var(--surface,#fff);
}

@media(max-width:760px){
  #customerDialog{
    width:100vw;
    max-width:none;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
    margin:0;
  }
  #customerDialog .modal-head{padding:14px 16px 12px}
  #customerDialog .crm-modal>.grid{padding:4px 16px 18px}
  #customerDialog .crm-modal>.actions{padding:12px 16px}
  #customerDialog .crm-modal>.actions button{width:100%;min-width:0}
  #customerDialog #customerError{padding:0 16px 10px}
}


/* v5.1.1 CRM device workspaces, timelines and merge tools */
.crm-panel{display:none}.crm-panel.active{display:block}.crm-tabs{margin-bottom:16px;overflow-x:auto}.crm-tabs button{white-space:nowrap}.crm-timeline{display:grid;gap:0}.crm-timeline-item{position:relative;display:grid;grid-template-columns:22px 1fr;gap:10px;padding:0 0 20px}.crm-timeline-item:before{content:"";position:absolute;left:7px;top:15px;bottom:-2px;width:2px;background:var(--border)}.crm-timeline-item:last-child:before{display:none}.crm-timeline-dot{width:16px;height:16px;border-radius:50%;background:var(--accent);margin-top:3px;z-index:1;border:3px solid var(--bg)}.crm-timeline-item p{margin:4px 0;color:var(--text)}.crm-timeline-item small{color:var(--muted)}.link-button{display:block;background:transparent!important;color:var(--accent-text)!important;padding:5px 0!important;margin-top:3px;text-align:left}.warranty-banner{display:flex;justify-content:space-between;gap:12px;padding:14px 16px;border-radius:12px;border:1px solid}.warranty-banner strong,.warranty-banner span{display:block}.warranty-banner.active{background:#123e31;color:#baf4dc;border-color:#2f8165}.warranty-banner.expired{background:#4b2730;color:#ffd4dc;border-color:#8b4e5b}.merge-results{display:grid;gap:8px;max-height:270px;overflow:auto;margin:12px 0}.merge-results button{display:flex;flex-direction:column;align-items:flex-start;background:var(--surface-2);color:var(--text);border:1px solid var(--border);padding:12px}.merge-results button span{color:var(--muted);font-size:.86rem}#deviceEditorDialog,#mergeCustomerDialog{padding:0;border:0;background:transparent}#deviceEditorDialog>.crm-modal,#mergeCustomerDialog>.crm-modal{width:min(900px,calc(100vw - 28px));max-height:calc(100dvh - 32px);overflow:auto}.customer-device-choice small{line-height:1.35}@media(max-width:760px){#deviceEditorDialog,#mergeCustomerDialog{width:100vw;height:100dvh;max-width:none;max-height:none}#deviceEditorDialog>.crm-modal,#mergeCustomerDialog>.crm-modal{width:100vw;height:100dvh;max-height:none;border-radius:0}.warranty-banner{flex-direction:column}}

/* v5.1.1 RC1.2 — Find or add customer during repair booking */
.customer-create-result{border-top:1px solid var(--border,#2b4774)!important;background:linear-gradient(135deg,rgba(23,99,255,.18),rgba(21,193,161,.12))!important}
.customer-create-result strong{color:var(--text,#f4f8ff)!important}
.customer-create-result span{color:var(--muted,#b8c7df)!important}
body.light-theme .customer-create-result{background:#edf5ff!important}
body.light-theme .customer-create-result strong{color:#10284f!important}
body.light-theme .customer-create-result span{color:#53647d!important}
.repair-customer-create-note{margin:0 0 12px}


/* v5.1.1 RC1.3 — single customer entry and accessible booking search */
.customer-picker-label #repairCustomerSearch{background:#fff!important;color:#10213d!important;-webkit-text-fill-color:#10213d!important;border:1px solid #9eabc0!important;caret-color:#10213d!important;box-shadow:0 0 0 1px transparent}
.customer-picker-label #repairCustomerSearch::placeholder{color:#59677c!important;opacity:1}
.customer-picker-label #repairCustomerSearch:focus{border-color:#1464f4!important;box-shadow:0 0 0 3px #1464f426!important;outline:none}
.customer-picker-label .autocomplete-results{background:#fff!important;color:#10213d!important;border-color:#9eabc0!important}
.customer-picker-label .customer-result{display:block;background:#fff!important;color:#10213d!important;border:1px solid #d2dae6!important;margin:0 0 6px;border-radius:10px}
.customer-picker-label .customer-result strong{display:block;color:#10213d!important;font-size:.94rem;margin-bottom:3px}
.customer-picker-label .customer-result span{display:block;color:#59677c!important;line-height:1.35;margin-top:1px}
.customer-picker-label .customer-result:hover,.customer-picker-label .customer-result:focus{background:#eaf2ff!important;border-color:#6a9be7!important}
.customer-picker-label .customer-create-result{background:#e5efff!important;color:#0b438f!important;border-color:#83a9df!important}
.customer-picker-label .customer-create-result strong{color:#0b438f!important}
.customer-picker-label .customer-create-result span{color:#315f91!important}
.customer-picker-label .autocomplete-empty{color:#59677c!important}
html[data-theme="dark"] .customer-picker-label #repairCustomerSearch{background:#081f36!important;color:#f1f7ff!important;-webkit-text-fill-color:#f1f7ff!important;border-color:#4a6f91!important;caret-color:#fff!important}
html[data-theme="dark"] .customer-picker-label #repairCustomerSearch::placeholder{color:#aec2d6!important}
html[data-theme="dark"] .customer-picker-label .autocomplete-results{background:#071a2d!important;color:#f1f7ff!important;border-color:#4a6f91!important}
html[data-theme="dark"] .customer-picker-label .customer-result{background:#0d2944!important;color:#f1f7ff!important;border-color:#315f86!important}
html[data-theme="dark"] .customer-picker-label .customer-result strong{color:#fff!important}
html[data-theme="dark"] .customer-picker-label .customer-result span{color:#b5cadc!important}
html[data-theme="dark"] .customer-picker-label .customer-result:hover,html[data-theme="dark"] .customer-picker-label .customer-result:focus{background:#143b60!important;border-color:#5e91bd!important}
html[data-theme="dark"] .customer-picker-label .customer-create-result{background:#123b67!important;color:#fff!important;border-color:#4f88bb!important}
html[data-theme="dark"] .customer-picker-label .customer-create-result strong{color:#fff!important}
html[data-theme="dark"] .customer-picker-label .customer-create-result span{color:#c2d8eb!important}
html[data-theme="dark"] .customer-picker-label .autocomplete-empty{color:#b5cadc!important}

/* Workshop Pro v5.1.2 CRM communications, warranties and documents */
.crm-section-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px}.crm-section-head h3{margin-bottom:4px}.crm-record-list{display:grid;gap:12px}.crm-record{background:var(--card,#102b46);color:var(--text,#eef8ff);border:1px solid var(--border,#284761);border-radius:14px;padding:16px}.crm-record p{color:inherit;opacity:.9;white-space:pre-wrap}.crm-record small,.crm-record span{color:var(--muted,#a9bfd2)}.crm-record-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.crm-record-head>div{display:grid;gap:3px}.crm-visibility{display:inline-flex!important;align-items:center;padding:5px 9px;border-radius:999px;font-size:.76rem;font-weight:750;white-space:nowrap}.crm-visibility.customer{background:#0e6b53;color:#eafff8!important}.crm-visibility.internal{background:#5a3440;color:#fff1f4!important}.warranty-record.active{border-left:4px solid #31c48d}.warranty-record.expired{border-left:4px solid #e59a42}.button-link{display:inline-flex;margin:6px 0;padding:8px 11px;border-radius:9px;background:var(--accent,#1677ff);color:#fff!important;text-decoration:none;font-weight:700}
body.light .crm-record{background:#fff;color:#142235;border-color:#ccd7e2}body.light .crm-record small,body.light .crm-record span{color:#52677b}body.light .crm-visibility.customer{background:#dff8ee;color:#07533f!important}body.light .crm-visibility.internal{background:#fae3e8;color:#6b2332!important}
@media(max-width:800px){.crm-section-head,.crm-record-head{align-items:stretch;flex-direction:column}.crm-section-head button{width:100%}.crm-record-head .crm-visibility{align-self:flex-start}}


/* Workshop Pro v5.1.2 RC1.1 — communication editor and warranty automation */
#communicationDialog{width:min(980px,calc(100vw - 28px));max-width:none;max-height:calc(100dvh - 28px);padding:0;background:transparent;overflow:hidden}
#communicationDialog>.crm-modal{width:100%;max-height:calc(100dvh - 28px);overflow:auto;padding:22px;background:var(--surface);color:var(--text);border-radius:18px}
#communicationDialog .modal-head{position:sticky;top:-22px;z-index:3;background:var(--surface);padding:22px 0 14px;border-bottom:1px solid var(--line)}
#communicationDialog .actions{position:sticky;bottom:-22px;z-index:3;background:var(--surface);padding:14px 0 22px;border-top:1px solid var(--line)}
#communicationDialog textarea[name="message"]{min-height:240px;resize:vertical}
@media(max-width:760px){#communicationDialog{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border-radius:0}#communicationDialog>.crm-modal{height:100dvh;max-height:none;border-radius:0;padding:18px}#communicationDialog .modal-head{top:-18px;padding-top:18px}#communicationDialog .actions{bottom:-18px;padding-bottom:18px}#communicationDialog textarea[name="message"]{min-height:32vh}}

/* Workshop Pro v5.1.2 RC1.2 — consistent CRM dialog sizing */
#customerDialog,
#deviceEditorDialog,
#mergeCustomerDialog,
#communicationDialog,
#warrantyDialog,
#customerDocumentDialog{
  width:min(980px,calc(100vw - 28px));
  max-width:none;
  max-height:calc(100dvh - 28px);
  padding:0;
  background:transparent;
  overflow:hidden;
}
#customerDialog>.crm-modal,
#deviceEditorDialog>.crm-modal,
#mergeCustomerDialog>.crm-modal,
#communicationDialog>.crm-modal,
#warrantyDialog>.crm-modal,
#customerDocumentDialog>.crm-modal{
  box-sizing:border-box;
  width:100%;
  max-height:calc(100dvh - 28px);
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding:22px;
  background:var(--surface);
  color:var(--text);
  border-radius:18px;
}
#customerDialog .modal-head,
#deviceEditorDialog .modal-head,
#mergeCustomerDialog .modal-head,
#communicationDialog .modal-head,
#warrantyDialog .modal-head,
#customerDocumentDialog .modal-head{
  position:sticky;
  top:-22px;
  z-index:4;
  background:var(--surface);
  padding:22px 0 14px;
  border-bottom:1px solid var(--line);
}
#customerDialog .actions,
#deviceEditorDialog .actions,
#mergeCustomerDialog .actions,
#communicationDialog .actions,
#warrantyDialog .actions,
#customerDocumentDialog .actions{
  position:sticky;
  bottom:-22px;
  z-index:4;
  background:var(--surface);
  padding:14px 0 22px;
  border-top:1px solid var(--line);
}
#warrantyDialog textarea[name="notes"],
#customerDocumentDialog textarea,
#deviceEditorDialog textarea,
#customerDialog textarea{
  min-height:150px;
  resize:vertical;
}
@media(max-width:760px){
  #customerDialog,
  #deviceEditorDialog,
  #mergeCustomerDialog,
  #communicationDialog,
  #warrantyDialog,
  #customerDocumentDialog{
    width:100vw;
    height:100dvh;
    max-width:none;
    max-height:none;
    margin:0;
    border:0;
    border-radius:0;
  }
  #customerDialog>.crm-modal,
  #deviceEditorDialog>.crm-modal,
  #mergeCustomerDialog>.crm-modal,
  #communicationDialog>.crm-modal,
  #warrantyDialog>.crm-modal,
  #customerDocumentDialog>.crm-modal{
    height:100dvh;
    max-height:none;
    border-radius:0;
    padding:18px;
  }
  #customerDialog .modal-head,
  #deviceEditorDialog .modal-head,
  #mergeCustomerDialog .modal-head,
  #communicationDialog .modal-head,
  #warrantyDialog .modal-head,
  #customerDocumentDialog .modal-head{
    top:-18px;
    padding-top:18px;
  }
  #customerDialog .actions,
  #deviceEditorDialog .actions,
  #mergeCustomerDialog .actions,
  #communicationDialog .actions,
  #warrantyDialog .actions,
  #customerDocumentDialog .actions{
    bottom:-18px;
    padding-bottom:18px;
  }
}

.crm-inline-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.crm-inline-actions button{padding:7px 11px}.warranty-rule{display:grid;grid-template-columns:minmax(180px,1fr) 120px auto auto;gap:12px;align-items:end}.warranty-rule>div span{display:block;color:var(--muted)}.warranty-rule input[type=number]{width:100%}@media(max-width:760px){.warranty-rule{grid-template-columns:1fr 1fr}.warranty-rule>div{grid-column:1/-1}}

/* Workshop Pro v5.1.3 RC1.3 — Warranty Defaults dialog layout */
#warrantyRulesDialog{
  width:min(1050px,calc(100vw - 28px));
  max-width:none;
  max-height:calc(100dvh - 28px);
  padding:0;
  background:transparent;
  overflow:hidden;
}
#warrantyRulesDialog>.crm-modal{
  box-sizing:border-box;
  width:100%;
  max-height:calc(100dvh - 28px);
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding:22px;
  background:var(--surface);
  color:var(--text);
  border-radius:18px;
}
#warrantyRulesDialog .modal-head{
  position:sticky;
  top:-22px;
  z-index:4;
  background:var(--surface);
  padding:22px 0 14px;
  border-bottom:1px solid var(--line);
}
#warrantyRulesDialog .actions{
  position:sticky;
  bottom:-22px;
  z-index:4;
  background:var(--surface);
  padding:14px 0 22px;
  border-top:1px solid var(--line);
}
#warrantyRulesDialog #warrantyRulesList{
  display:grid;
  gap:12px;
  padding:14px 0;
}
@media(max-width:760px){
  #warrantyRulesDialog{
    width:100vw;
    height:100dvh;
    max-width:none;
    max-height:none;
    margin:0;
    border:0;
    border-radius:0;
  }
  #warrantyRulesDialog>.crm-modal{
    height:100dvh;
    max-height:none;
    border-radius:0;
    padding:18px;
  }
  #warrantyRulesDialog .modal-head{
    top:-18px;
    padding-top:18px;
  }
  #warrantyRulesDialog .actions{
    bottom:-18px;
    padding-bottom:18px;
  }
  #warrantyRulesDialog .warranty-rule{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  #warrantyRulesDialog .warranty-rule>div{
    grid-column:auto;
  }
  #warrantyRulesDialog .warranty-rule button{
    width:100%;
  }
}

/* Workshop Pro v5.1.4 — full-screen Repair Workspace */
#detailDialog.repair-workspace-dialog{
  width:100vw;
  height:100dvh;
  max-width:none;
  max-height:none;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  overflow:hidden;
  background:var(--surface);
}
#detailDialog.repair-workspace-dialog::backdrop{background:rgba(3,12,28,.72);backdrop-filter:blur(4px)}
#detailDialog .repair-workspace-shell{
  width:100%;height:100%;max-width:none;padding:0;
  display:grid;grid-template-rows:auto minmax(0,1fr);background:var(--surface);
}
#detailDialog .repair-workspace-head{
  position:relative;z-index:20;display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:16px;padding:14px 20px;border-bottom:1px solid var(--line);
  background:var(--surface-raised);box-shadow:0 5px 18px rgba(7,26,61,.08);
}
.repair-workspace-heading{min-width:0}.repair-workspace-heading h2{margin:2px 0;font-size:1.35rem}.repair-workspace-heading p{margin:0;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.repair-workspace-back{white-space:nowrap}.repair-workspace-close{display:none}
#detailBody.repair-workspace-body{min-height:0;overflow:auto;padding:18px 22px 36px;overscroll-behavior:contain}
#detailBody .v5-commandbar{position:sticky;top:-18px;z-index:12;margin:-18px -22px 14px;padding:14px 22px;border-radius:0;border-width:0 0 1px;background:var(--surface)}
#detailBody .v5-tabs{position:sticky;top:64px;z-index:11;padding:8px;margin:0 0 16px;box-shadow:0 6px 14px rgba(7,26,61,.07)}
#detailBody .workspace-panel{max-width:1500px;margin:0 auto}
.repair-context-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:0 0 14px}
.repair-context-strip>div{padding:11px 13px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft);min-width:0}
.repair-context-strip span{display:block;font-size:.72rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.repair-context-strip strong{display:block;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:900px){
 #detailDialog .repair-workspace-head{grid-template-columns:auto minmax(0,1fr);padding:12px 14px}
 .repair-workspace-close{display:none}.repair-workspace-heading h2{font-size:1.15rem}
 #detailBody.repair-workspace-body{padding:14px 14px 30px}
 #detailBody .v5-commandbar{top:-14px;margin:-14px -14px 12px;padding:12px 14px}
 #detailBody .v5-tabs{top:60px;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .repair-context-strip{grid-template-columns:1fr 1fr}
}
@media(max-width:560px){
 #detailDialog .repair-workspace-head{grid-template-columns:1fr auto;gap:8px}
 .repair-workspace-back{grid-column:1/-1;justify-self:start}
 .repair-workspace-close{display:block}
 .repair-context-strip{grid-template-columns:1fr}
 #detailBody .v5-tabs{top:103px}
}


/* Workshop Pro v5.2.0 — POS Foundation */
.pos-view{padding-bottom:20px}.pos-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px}.pos-head h1{margin:0}.pos-head p{margin:3px 0 0;color:var(--muted)}.pos-head-actions{display:flex;gap:8px;flex-wrap:wrap}.pos-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(340px,.8fr);gap:16px;min-height:calc(100dvh - 170px)}.pos-catalog,.pos-checkout{margin:0;min-height:0}.pos-catalog{display:flex;flex-direction:column}.pos-search{display:grid;grid-template-columns:1fr auto;gap:10px}.pos-search input{font-size:1.05rem}.pos-category-chips{display:flex;gap:7px;overflow-x:auto;padding:12px 0}.pos-category-chips button{white-space:nowrap;background:var(--surface-soft);color:var(--text);border:1px solid var(--line)}.pos-category-chips button.active{background:var(--brand);color:#fff}.pos-product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;overflow:auto;padding:2px}.pos-product{min-height:125px;text-align:left;display:flex;flex-direction:column;align-items:flex-start;background:var(--surface-soft);color:var(--text);border:1px solid var(--line);padding:13px}.pos-product:hover{border-color:var(--brand);transform:translateY(-1px)}.pos-product span,.pos-product small{color:var(--muted);font-size:.75rem}.pos-product strong{margin:6px 0;line-height:1.25}.pos-product b{margin-top:auto;font-size:1.05rem;color:var(--brand)}.pos-checkout{display:flex;flex-direction:column;max-height:calc(100dvh - 170px);position:sticky;top:90px}.pos-customer-block{position:relative}.pos-customer-block label{display:block}.pos-customer-results{position:absolute;z-index:30;left:0;right:0;top:66px;background:var(--surface-raised);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);max-height:280px;overflow:auto}.pos-customer-results button{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--text)}.pos-customer-results button span{display:block;color:var(--muted);font-size:.82rem}.pos-selected-customer{display:flex;align-items:center;gap:8px;padding:10px;margin-top:8px;background:var(--surface-soft);border-radius:10px}.pos-selected-customer span{color:var(--muted)}.pos-selected-customer button{margin-left:auto}.pos-basket-head{display:flex;justify-content:space-between;align-items:center;margin-top:10px}.pos-basket{flex:1;min-height:100px;overflow:auto;border-block:1px solid var(--line)}.pos-basket-item{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}.pos-basket-item span{display:block;color:var(--muted);font-size:.78rem}.pos-qty{display:flex;align-items:center;gap:6px}.pos-qty button{padding:5px 9px}.pos-discount-row{display:grid;grid-template-columns:1fr auto;gap:8px;padding-top:10px}.pos-totals{padding:10px 0}.pos-totals>div{display:flex;justify-content:space-between;padding:3px 0;color:var(--muted)}.pos-totals .grand{font-size:1.25rem;color:var(--text);border-top:1px solid var(--line);margin-top:6px;padding-top:10px}.pos-pay-button{width:100%;font-size:1.08rem;padding:14px}.pos-modal,.pos-history-modal,.pos-receipt-modal{width:min(760px,92vw);max-height:90dvh;overflow:auto}.pos-payment-rows{display:grid;gap:8px;margin:12px 0}.pos-payment-row{display:grid;grid-template-columns:1fr 1fr auto;gap:8px}.pos-history-modal{width:min(920px,94vw)}.pos-history-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:12px;border-bottom:1px solid var(--line)}.pos-history-row span{display:block;color:var(--muted)}.pos-receipt{max-width:420px;margin:auto;padding:18px;background:#fff;color:#111;border-radius:10px}.receipt-brand{text-align:center;margin-bottom:14px}.receipt-brand span{display:block;font-size:.8rem}.receipt-meta,.receipt-line,.receipt-total{display:flex;justify-content:space-between;gap:10px;padding:5px 0}.receipt-total{font-size:1.2rem;border-top:1px dashed;margin-top:8px}.receipt-payments{display:flex;gap:10px;justify-content:flex-end;font-size:.85rem}.pos-history-row button+button{margin-left:6px}
@media(max-width:1000px){.pos-layout{grid-template-columns:1fr}.pos-checkout{position:static;max-height:none}.pos-product-grid{max-height:42dvh}.pos-view{padding-bottom:90px}}
@media(max-width:700px){.pos-head{align-items:flex-start;flex-direction:column}.pos-search{grid-template-columns:1fr}.pos-layout{min-height:auto}.pos-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pos-basket-item{grid-template-columns:minmax(0,1fr) auto auto}.pos-basket-item>.icon{grid-column:3}.pos-modal,.pos-history-modal,.pos-receipt-modal{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border-radius:0}.pos-history-row{grid-template-columns:1fr auto}.pos-history-row>div:last-child{grid-column:1/-1}}


/* Workshop Pro v5.2.1 Platform Edition */
.platform-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.platform-row{display:flex;justify-content:space-between;gap:18px;padding:11px 0;border-bottom:1px solid var(--line,#2b3b50)}.platform-row:last-child{border-bottom:0}.platform-row span{color:var(--muted,#9eb0c7)}.platform-row strong{color:var(--text,#edf5ff);text-align:right}.platform-row strong.ok{color:#70dfa5}.warning-text{color:#ffb4a8!important}.fingerprint{display:block;overflow-wrap:anywhere;margin:14px 0;padding:12px;border-radius:10px;background:#07111f;color:#bfe2ff}.module-manager-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}.module-card{display:flex;justify-content:space-between;gap:18px;min-height:190px;padding:20px;border:1px solid var(--line,#2b3b50);border-radius:16px;background:var(--card,#122238)}.module-card h2{margin:10px 0 6px}.module-card p{color:var(--muted,#9eb0c7)}.module-toggle{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:90px}.module-toggle input{width:28px;height:28px}@media(max-width:800px){.platform-grid{grid-template-columns:1fr}.module-card{min-height:0}}


/* Workshop Pro v5.2.1 RC1.1 — Update Centre MariaDB and System Health workspace hotfix */
main:has(#platformHealth.view.active){max-width:none;width:100%;padding-top:0}
#platformHealth.view.active{
  display:flex;
  flex-direction:column;
  min-height:calc(100dvh - 34px);
  width:100%;
  max-width:1600px;
  margin:0 auto;
  padding:0 4px 40px;
}
#platformHealth>.title{
  position:sticky;
  top:0;
  z-index:24;
  margin:0 -4px 16px;
  padding:18px 14px 14px;
  background:var(--bg);
  border-bottom:1px solid var(--line);
}
#platformHealthSummary{flex:0 0 auto}
#platformHealth .platform-grid{flex:1;align-content:start}
#platformHealth .card{min-width:0;overflow:auto}
#platformHealth .platform-row{align-items:flex-start}
#platformHealth .platform-row strong{overflow-wrap:anywhere;word-break:break-word}
@media(max-width:900px){
 main:has(#platformHealth.view.active){padding-left:10px;padding-right:10px}
 #platformHealth.view.active{min-height:100dvh;padding-bottom:30px}
 #platformHealth>.title{top:0;align-items:flex-start;flex-wrap:wrap;padding:14px 10px}
 #platformHealth>.title button{width:100%}
 #platformHealth .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 #platformHealth .platform-grid{grid-template-columns:1fr}
}
@media(max-width:560px){
 #platformHealth .stats{grid-template-columns:1fr}
 #platformHealth .platform-row{flex-direction:column;gap:4px}
 #platformHealth .platform-row strong{text-align:left}
}

/* Workshop Pro v5.2.1 RC1.2 — balanced Platform workspace sizing */
main:has(#platformHealth.view.active),
main:has(#modules.view.active){
  max-width:1280px;
  width:min(100%,1280px);
  margin:0 auto;
  padding-top:18px;
}
#platformHealth.view.active,
#modules.view.active{
  width:100%;
  max-width:1180px;
  min-height:auto;
  margin:0 auto;
  padding:0 0 36px;
}
#platformHealth>.title,
#modules>.title{
  position:static;
  margin:0 0 14px;
  padding:0;
  border-bottom:0;
  background:transparent;
}
#platformHealthSummary.stats{
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
  margin-bottom:14px;
}
#platformHealthSummary .stat{padding:14px;min-height:82px}
#platformHealth .platform-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
#platformHealth .card{
  padding:16px;
  overflow:visible;
}
#platformHealth .card h2{font-size:1.05rem;margin:0 0 8px}
#platformHealth .platform-row{padding:8px 0;gap:12px}
#platformHealth .platform-row strong{max-width:60%}
#modules .module-manager-grid{
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:12px;
}
#modules .module-card{
  min-height:130px;
  padding:15px;
  border-radius:14px;
  gap:12px;
}
#modules .module-card h2{font-size:1.08rem;margin:7px 0 4px}
#modules .module-card p{margin:0;font-size:.9rem;line-height:1.35}
#modules .module-toggle{min-width:72px}
#modules .module-toggle input{width:24px;height:24px}
@media(max-width:900px){
  main:has(#platformHealth.view.active),
  main:has(#modules.view.active){
    width:100%;
    max-width:none;
    padding:14px 12px 24px;
  }
  #platformHealth.view.active,
  #modules.view.active{max-width:760px;padding-bottom:28px}
  #platformHealth>.title,
  #modules>.title{align-items:center;flex-wrap:wrap}
  #platformHealth>.title button,
  #modules>.title button{width:auto}
  #platformHealth .platform-grid{grid-template-columns:1fr}
  #platformHealth .platform-row strong{max-width:58%}
  #modules .module-manager-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  #platformHealthSummary.stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  #modules .module-manager-grid{grid-template-columns:1fr}
  #modules .module-card{min-height:0}
}
@media(max-width:460px){
  #platformHealthSummary.stats{grid-template-columns:1fr}
  #platformHealth .platform-row{flex-direction:column;gap:3px}
  #platformHealth .platform-row strong{max-width:none;text-align:left}
}

/* Workshop Pro v5.2.1 RC1.3 — application shell and Platform workspace correction */
@media (min-width:981px){
  .app-shell{
    display:block;
    min-height:100dvh;
  }
  .app-content{
    margin-left:252px;
    width:calc(100% - 252px);
    min-height:100dvh;
  }
}
.app-content main{
  width:100%;
  margin:0;
}
main:has(#platformHealth.view.active),
main:has(#modules.view.active){
  width:100%!important;
  max-width:none!important;
  min-height:0!important;
  margin:0!important;
  padding:22px 28px 44px!important;
  overflow:visible;
}
#platformHealth.view.active,
#modules.view.active{
  display:block!important;
  position:relative;
  inset:auto;
  width:100%;
  max-width:1180px;
  min-height:0;
  margin:0 auto;
  padding:0 0 30px;
  transform:none;
}
#platformHealth>.title,
#modules>.title{
  margin:0 0 14px;
  padding:0;
}
#platformHealthSummary.stats{margin-top:0}
@media (max-width:980px){
  .app-content{width:100%}
  main:has(#platformHealth.view.active),
  main:has(#modules.view.active){padding:18px 16px 36px!important}
  #platformHealth.view.active,
  #modules.view.active{max-width:760px}
}

/* Workshop Pro v5.2.1 RC1.4 — Platform sections restored to main workspace */
@media (min-width:981px){
  .app-shell{display:grid;grid-template-columns:252px minmax(0,1fr);min-height:100dvh}
  .app-content{margin-left:0!important;width:auto!important;min-width:0;min-height:100dvh}
}
.app-content main{width:100%;max-width:1180px;margin:0 auto;padding:22px 16px 50px}
main:has(#platformHealth.view.active),
main:has(#modules.view.active){max-width:1180px!important;width:100%!important;margin:0 auto!important;padding:22px 16px 50px!important;overflow:visible}
#platformHealth.view.active,
#modules.view.active{position:static!important;inset:auto!important;width:auto!important;max-width:none!important;margin:0!important;padding:0!important;transform:none!important}
#platformHealth>.title,
#modules>.title{position:static!important;top:auto!important;margin:0 0 14px!important;padding:0!important;background:transparent!important;box-shadow:none!important}
#platformHealthSummary.stats{margin:18px 0!important}
#platformHealth .platform-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
#modules .module-manager-grid{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
@media(max-width:980px){
  .app-content{width:100%!important;margin-left:0!important}
  .app-content main,
  main:has(#platformHealth.view.active),
  main:has(#modules.view.active){max-width:none!important;padding:18px 16px 36px!important}
}
@media(max-width:760px){
  #platformHealth .platform-grid{grid-template-columns:1fr}
  #modules .module-manager-grid{grid-template-columns:1fr}
}

/* Workshop Pro v5.2.1 RC1.5 — fixed sidebar/content alignment */
@media (min-width:981px){
  .app-shell{
    display:block!important;
    min-height:100dvh;
  }
  .app-sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:252px;
  }
  .app-content{
    display:block;
    margin-left:252px!important;
    width:calc(100% - 252px)!important;
    min-width:0;
    min-height:100dvh;
  }
  .app-content main,
  main:has(#platformHealth.view.active),
  main:has(#modules.view.active){
    width:auto!important;
    max-width:1180px!important;
    margin:0 auto!important;
    padding:22px 24px 50px!important;
  }
}
@media (max-width:980px){
  .app-shell{display:block!important}
  .app-content{
    margin-left:0!important;
    width:100%!important;
  }
}

/* Workshop Pro v5.2.1 RC1.6 — unified workspace UI framework */
:root{
  --workspace-max:1180px;
  --workspace-gap:16px;
  --workspace-radius:14px;
  --workspace-shadow:0 8px 24px rgba(16,33,61,.08);
}

/* Major page container: one consistent shell for every module */
.app-content main{
  width:auto!important;
  max-width:var(--workspace-max)!important;
  margin:0 auto!important;
  padding:22px 24px 52px!important;
}
.view.active{
  width:100%;
  min-width:0;
}

/* Page headers */
.view>.title,
#customerDirectoryView>.title,
.pos-head,
.dashboard-welcome{
  min-height:66px;
  margin:0 0 16px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.view>.title h1,
#customerDirectoryView>.title h1,
.pos-head h1,
.dashboard-welcome h1{
  margin:0;
  line-height:1.15;
  font-size:clamp(1.45rem,2vw,1.85rem);
}
.view>.title p,
#customerDirectoryView>.title p,
.pos-head p,
.dashboard-welcome p{
  margin:5px 0 0;
  color:var(--muted);
  line-height:1.4;
}
.view>.title>.actions,
#customerDirectoryView>.title>.actions,
.pos-head-actions,
.welcome-actions{
  margin:0;
  justify-content:flex-end;
}

/* Cards and statistics */
.card,.stat,.module-card{
  border-radius:var(--workspace-radius);
  box-shadow:var(--workspace-shadow);
}
.card{padding:16px}
.stats,.crm-stats{gap:12px;margin:16px 0}
.stat{min-height:88px;padding:15px}
.stat strong{font-size:1.55rem;line-height:1.1}
.card h2{margin-top:0}
.card+.card{margin-top:14px}

/* Compact, predictable data rows */
.row,.platform-row{
  min-width:0;
  padding:10px 0;
  align-items:center;
}
.row>* ,.platform-row>*{min-width:0}
.row strong,.platform-row strong{overflow-wrap:anywhere}

/* Tables and long lists */
table{width:100%;border-collapse:separate;border-spacing:0}
th,td{padding:11px 12px;text-align:left;border-bottom:1px solid var(--line);vertical-align:middle}
th{position:sticky;top:0;z-index:2;background:#f8fafe;color:#42536d;font-size:.82rem;text-transform:uppercase;letter-spacing:.03em}
tbody tr:hover{background:#f7faff}
.card:has(table){overflow:auto}

/* Filters and controls */
.filters{align-items:end;margin-bottom:14px}
input,select,textarea{background:#fff;color:var(--text)}
button{min-height:40px}
.actions button,.title button,.pos-head-actions button,.welcome-actions button{white-space:nowrap}

/* Platform pages use the exact same workspace dimensions */
main:has(#platformHealth.view.active),
main:has(#modules.view.active){
  width:auto!important;
  max-width:var(--workspace-max)!important;
  margin:0 auto!important;
  padding:22px 24px 52px!important;
}
#platformHealth.view.active,
#modules.view.active{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
}
#platformHealth .platform-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
#platformHealth .card{min-height:0;padding:16px}
#platformHealthSummary.stats{margin:16px 0}
#modules .module-manager-grid{
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:14px;
}
#modules .module-card{min-height:0;padding:16px}

/* CRM, POS and dashboard alignment */
.crm-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.pos-layout{gap:16px}
.dashboard-grid{gap:16px}
.customer-workspace,
.repair-workspace-shell{max-width:var(--workspace-max)}

/* Tablet and mobile */
@media(max-width:980px){
  .app-content main,
  main:has(#platformHealth.view.active),
  main:has(#modules.view.active){
    max-width:none!important;
    padding:18px 16px 40px!important;
  }
  .view>.title,
  #customerDirectoryView>.title,
  .pos-head,
  .dashboard-welcome{
    align-items:flex-start;
    flex-wrap:wrap;
    min-height:0;
  }
  .view>.title>.actions,
  #customerDirectoryView>.title>.actions,
  .pos-head-actions,
  .welcome-actions{width:100%;justify-content:flex-start}
  #platformHealth .platform-grid{grid-template-columns:1fr}
  #modules .module-manager-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .app-content main,
  main:has(#platformHealth.view.active),
  main:has(#modules.view.active){padding:14px 12px 32px!important}
  .view>.title button,
  #customerDirectoryView>.title button,
  .pos-head-actions button,
  .welcome-actions button{flex:1 1 auto}
  #modules .module-manager-grid{grid-template-columns:1fr}
  .stats,.crm-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .card{padding:14px}
}
@media(max-width:440px){
  .stats,.crm-stats{grid-template-columns:1fr}
}


/* v5.3.1 API & Integrations Manager */
.integration-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);gap:18px;align-items:start}.integration-client-row,.integration-log-row{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:14px 0;border-bottom:1px solid var(--border)}.integration-client-row:last-child,.integration-log-row:last-child{border-bottom:0}.integration-client-title{display:flex;align-items:center;gap:9px;margin-bottom:5px}.integration-modal{width:min(760px,calc(100vw - 32px));max-height:min(88vh,820px);overflow:auto}.integration-token-modal{width:min(660px,calc(100vw - 32px))}.integration-token-modal textarea{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;word-break:break-all}.integration-scopes{border:1px solid var(--border);border-radius:12px;padding:14px;margin:16px 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.integration-scopes legend{font-weight:700;padding:0 6px}.integration-scopes label{display:flex;align-items:center;gap:8px}.selected-customer{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);margin-top:8px}.selected-customer span{color:var(--muted)}.selected-customer .text-button{margin-left:auto}.autocomplete-list button span{display:block;font-size:.84rem;color:var(--muted);margin-top:3px}@media(max-width:900px){.integration-layout{grid-template-columns:1fr}}@media(max-width:700px){.integration-scopes{grid-template-columns:1fr}.integration-client-row{align-items:flex-start;flex-direction:column}.integration-client-row .row-actions{width:100%;justify-content:flex-end}.integration-modal,.integration-token-modal{width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0}}

/* v5.3.1 RC1.1 — API & Integrations layout correction */
#integrations{width:100%;max-width:1180px;margin:0 auto}
#integrations>.title{margin-bottom:16px}
#integrations .stats{margin-bottom:16px}
#integrations .integration-layout{grid-template-columns:minmax(0,1fr) minmax(300px,380px);gap:16px}
#integrations .card{min-width:0}
#integrations .integration-client-row,#integrations .integration-log-row{min-width:0}
#integrations .integration-client-row>div:first-child,#integrations .integration-log-row>div:first-child{min-width:0}
#integrations .meta{overflow-wrap:anywhere}

dialog#apiClientDialog,dialog#apiTokenDialog{
  width:min(720px,calc(100vw - 40px));
  max-width:720px;
  max-height:calc(100dvh - 40px);
  padding:0;
  border:0;
  border-radius:16px;
  background:transparent;
  overflow:hidden;
}
dialog#apiTokenDialog{width:min(620px,calc(100vw - 40px));max-width:620px}
dialog#apiClientDialog::backdrop,dialog#apiTokenDialog::backdrop{background:rgba(4,15,35,.64);backdrop-filter:blur(2px)}
dialog#apiClientDialog .integration-modal,dialog#apiTokenDialog .integration-token-modal{
  box-sizing:border-box;
  width:100%;
  max-width:none;
  height:auto;
  max-height:calc(100dvh - 40px);
  margin:0;
  display:flex;
  flex-direction:column;
  overflow:auto;
  overscroll-behavior:contain;
  border-radius:16px;
}
dialog#apiClientDialog .modal-head,dialog#apiTokenDialog .modal-head{
  position:sticky;
  top:0;
  z-index:3;
  background:var(--surface);
  padding-top:2px;
}
dialog#apiClientDialog .actions,dialog#apiTokenDialog .actions{
  position:sticky;
  bottom:0;
  z-index:3;
  margin-top:16px;
  padding-top:14px;
  padding-bottom:2px;
  background:var(--surface);
  border-top:1px solid var(--border);
}
dialog#apiClientDialog label,dialog#apiTokenDialog label{min-width:0}
dialog#apiClientDialog input,dialog#apiClientDialog textarea,dialog#apiTokenDialog textarea{max-width:100%;box-sizing:border-box}

@media(max-width:980px){
  #integrations{max-width:none}
  #integrations .integration-layout{grid-template-columns:1fr}
}
@media(max-width:700px){
  dialog#apiClientDialog,dialog#apiTokenDialog{width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0}
  dialog#apiClientDialog .integration-modal,dialog#apiTokenDialog .integration-token-modal{height:100dvh;max-height:none;border-radius:0;padding:16px}
  dialog#apiClientDialog .modal-head,dialog#apiTokenDialog .modal-head{margin:-16px -16px 12px;padding:16px}
  dialog#apiClientDialog .actions,dialog#apiTokenDialog .actions{margin:16px -16px -16px;padding:14px 16px calc(16px + env(safe-area-inset-bottom))}
}

/* v5.3.1 RC1.2 — API & Integrations contrast correction */
#integrations,
#integrations .card,
#integrations .stat,
#integrations .integration-client-row,
#integrations .integration-log-row{
  color:var(--text,#14213a);
}
#integrations .card,
#integrations .stat{
  background:var(--surface,#fff);
  border-color:var(--border,#d9e1ee);
}
#integrations h1,
#integrations h2,
#integrations h3,
#integrations strong,
#integrations .integration-client-title{
  color:var(--text,#14213a);
}
#integrations p,
#integrations .meta,
#integrations small,
#integrations .integration-log-row span,
#integrations .integration-client-row span{
  color:var(--muted,#5d6b82);
}
#integrations code,
#integrations .badge,
#integrations .pill,
#integrations .status-badge{
  color:var(--text,#14213a);
  background:var(--surface-2,#eef3fa);
  border-color:var(--border,#d9e1ee);
}
#integrations table,
#integrations th,
#integrations td{
  color:var(--text,#14213a);
}
#integrations th{
  background:var(--surface-2,#f3f6fb);
}
#integrations tbody tr:hover{
  background:var(--surface-2,#f3f6fb);
}

dialog#apiClientDialog .integration-modal,
dialog#apiTokenDialog .integration-token-modal,
dialog#apiClientDialog .modal-head,
dialog#apiTokenDialog .modal-head,
dialog#apiClientDialog .actions,
dialog#apiTokenDialog .actions{
  background:var(--surface,#fff);
  color:var(--text,#14213a);
}
dialog#apiClientDialog h2,
dialog#apiTokenDialog h2,
dialog#apiClientDialog legend,
dialog#apiClientDialog label,
dialog#apiTokenDialog label{
  color:var(--text,#14213a);
}
dialog#apiClientDialog p,
dialog#apiTokenDialog p,
dialog#apiClientDialog .meta,
dialog#apiTokenDialog .meta{
  color:var(--muted,#5d6b82);
}
dialog#apiClientDialog input,
dialog#apiClientDialog select,
dialog#apiClientDialog textarea,
dialog#apiTokenDialog textarea{
  background:#fff!important;
  color:#14213a!important;
  border-color:#b9c6d8!important;
  caret-color:#14213a;
}
dialog#apiClientDialog input::placeholder,
dialog#apiClientDialog textarea::placeholder,
dialog#apiTokenDialog textarea::placeholder{
  color:#6b778b!important;
  opacity:1;
}
dialog#apiClientDialog .integration-scopes,
dialog#apiClientDialog .selected-customer,
dialog#apiClientDialog .notice,
dialog#apiTokenDialog .notice{
  background:var(--surface-2,#f3f6fb);
  color:var(--text,#14213a);
  border-color:var(--border,#d9e1ee);
}
dialog#apiClientDialog .autocomplete-list{
  background:#fff;
  color:#14213a;
  border-color:#b9c6d8;
}
dialog#apiClientDialog .autocomplete-list button{
  background:#fff;
  color:#14213a;
}
dialog#apiClientDialog .autocomplete-list button:hover,
dialog#apiClientDialog .autocomplete-list button:focus{
  background:#eaf2ff;
  color:#0f2748;
}
dialog#apiClientDialog .autocomplete-list button span{
  color:#5d6b82;
}

[data-theme="dark"] #integrations .card,
[data-theme="dark"] #integrations .stat,
body.dark #integrations .card,
body.dark #integrations .stat,
[data-theme="dark"] dialog#apiClientDialog .integration-modal,
[data-theme="dark"] dialog#apiTokenDialog .integration-token-modal,
body.dark dialog#apiClientDialog .integration-modal,
body.dark dialog#apiTokenDialog .integration-token-modal{
  background:var(--surface,#10213b);
  color:var(--text,#f3f7ff);
}
[data-theme="dark"] #integrations h1,
[data-theme="dark"] #integrations h2,
[data-theme="dark"] #integrations h3,
[data-theme="dark"] #integrations strong,
body.dark #integrations h1,
body.dark #integrations h2,
body.dark #integrations h3,
body.dark #integrations strong,
[data-theme="dark"] dialog#apiClientDialog h2,
[data-theme="dark"] dialog#apiTokenDialog h2,
body.dark dialog#apiClientDialog h2,
body.dark dialog#apiTokenDialog h2{
  color:var(--text,#f3f7ff);
}
/* v5.3.1 RC1.3 — dark, high-contrast API permission cards */
dialog#apiClientDialog .integration-scopes{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  padding:14px;
  background:#071a33!important;
  border:1px solid #24476f!important;
  border-radius:14px;
}
dialog#apiClientDialog .integration-scopes legend{
  color:#f4f8ff!important;
  background:#071a33;
  padding:0 8px;
  font-weight:800;
}
dialog#apiClientDialog .integration-scopes label{
  position:relative;
  display:flex;
  align-items:center;
  min-height:54px;
  gap:11px;
  padding:12px 14px;
  margin:0;
  border:1px solid #31577f;
  border-radius:11px;
  background:#102b4d!important;
  color:#f4f8ff!important;
  font-weight:700;
  line-height:1.25;
  cursor:pointer;
  user-select:none;
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease,transform .08s ease;
}
dialog#apiClientDialog .integration-scopes label:hover,
dialog#apiClientDialog .integration-scopes label:focus-within{
  background:#15375f!important;
  border-color:#65a7ff;
  box-shadow:0 0 0 3px rgba(57,139,255,.18);
}
dialog#apiClientDialog .integration-scopes label:active{transform:translateY(1px)}
dialog#apiClientDialog .integration-scopes label:has(input:checked){
  background:#123f70!important;
  border-color:#55a1ff;
  box-shadow:inset 4px 0 0 #39d98a,0 0 0 1px rgba(85,161,255,.16);
  color:#fff!important;
}
dialog#apiClientDialog .integration-scopes input[type="checkbox"]{
  flex:0 0 auto;
  width:21px;
  height:21px;
  margin:0;
  accent-color:#39d98a;
  cursor:pointer;
}
dialog#apiClientDialog .integration-scopes input[type="checkbox"]:focus-visible{
  outline:3px solid rgba(101,167,255,.55);
  outline-offset:3px;
}
@media(max-width:700px){
  dialog#apiClientDialog .integration-scopes{grid-template-columns:1fr;padding:12px}
  dialog#apiClientDialog .integration-scopes label{min-height:56px;padding:13px 14px}
}

/* v5.3.1 RC1.4 — readable API customer-portal security notice */
dialog#apiClientDialog .integration-security-notice{
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:start;
  gap:4px 12px;
  margin-top:14px;
  padding:14px 16px;
  border:1px solid #31577f!important;
  border-left:4px solid #55a1ff!important;
  border-radius:12px;
  background:#0d2948!important;
  color:#f4f8ff!important;
  box-shadow:0 8px 22px rgba(3,18,38,.16);
}
dialog#apiClientDialog .integration-security-notice::before{
  content:"i";
  grid-row:1 / span 2;
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#55a1ff;
  color:#06182e;
  font-weight:900;
  font-family:Georgia,serif;
}
dialog#apiClientDialog .integration-security-notice strong{
  display:block;
  color:#fff!important;
  font-size:.96rem;
  line-height:1.25;
}
dialog#apiClientDialog .integration-security-notice span{
  display:block;
  color:#c9daf0!important;
  font-size:.88rem;
  line-height:1.45;
}
@media(max-width:700px){
  dialog#apiClientDialog .integration-security-notice{padding:13px 14px;gap:4px 10px}
}


/* v5.4 Device Intelligence */
.device-intelligence-view{max-width:1180px;margin:0 auto}.device-provider-card{margin-top:18px}.imei-entry-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}.imei-entry-row button{white-space:nowrap}.imei-lookup-result{margin-top:10px;padding:12px 14px;border-radius:12px;display:flex;flex-direction:column;gap:4px;background:#0d213b;color:#eaf2ff;border:1px solid #24486f}.imei-lookup-result.success-state{border-color:#24a36a;background:#0b2d25}.imei-lookup-result.error-state{border-color:#d65c65;background:#36191e}.imei-lookup-result.unknown-state{border-color:#d39a3b;background:#352817}.tac-mapping-row .actions{display:flex;gap:8px}.device-intelligence-view .stats{grid-template-columns:repeat(3,minmax(0,1fr))}.device-intelligence-view .stats .card strong{font-size:1.5rem}.device-provider-card input{min-width:0}@media(max-width:800px){.imei-entry-row{grid-template-columns:1fr}.device-intelligence-view .stats{grid-template-columns:1fr}.tac-mapping-row{align-items:flex-start}.tac-mapping-row .actions{width:100%;margin-top:8px}}

/* v5.4.1 RC1 — stability and contrast */
#login.screen{background:#06152f!important;color:#f8fbff!important}.login-card{background:#0d2448!important;color:#f8fbff!important;border:1px solid #315783!important}.login-card h1,.login-card label,.login-card p,.login-card .brand-name,.login-card .brand-subtitle{color:#f8fbff!important}.login-card input{background:#071a36!important;color:#fff!important;border-color:#416b9c!important}.login-card input::placeholder{color:#aebfd6!important}
#updates .card,#updates .notice,#updates .update-progress,#updateHistory .row{color:var(--text)!important}#updates input[type=file]{background:#0b2346!important;color:#f5f9ff!important;border:1px solid #416b9c!important;padding:12px;border-radius:10px}#updates code{color:#d8e8ff!important;background:#102b52!important}
#repairDialog .modal,#repairDialog fieldset,#repairDialog .selected-customer-panel,#repairDialog .selected-device-summary,#repairDialog .notice,#repairDialog .autocomplete-results{background:#0d2448!important;color:#f8fbff!important;border-color:#315783!important}#repairDialog label,#repairDialog legend,#repairDialog strong,#repairDialog .meta,#repairDialog .device-search-hint{color:#e7f0ff!important}#repairDialog input,#repairDialog select,#repairDialog textarea{background:#071a36!important;color:#fff!important;border-color:#416b9c!important}#repairDialog input::placeholder,#repairDialog textarea::placeholder{color:#aebfd6!important}#repairDialog .autocomplete-results button{background:#0b2141!important;color:#fff!important;border-color:#315783!important}
.part-modal{width:min(760px,calc(100vw - 32px));max-height:90dvh;overflow:auto}.part-row-actions{display:flex;align-items:center;gap:10px}.inventory-receipt-option{padding:12px 14px;border-radius:10px;background:#0b2346;color:#f5f9ff!important;border:1px solid #315783}.inventory-receipt-option input{width:auto!important}
.provider-settings-form input,.provider-settings-form select{background:#071a36!important;color:#fff!important;border-color:#416b9c!important}.provider-settings-form label{color:var(--text)!important}.provider-enable{align-self:end;padding:12px;background:#0b2346;color:#fff!important;border-radius:10px}.provider-enable input{width:auto!important}
@media(max-width:700px){.part-modal{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0}}


/* v5.5.0 — Parts & Inventory workspace */
.parts-workspace{max-width:1180px;margin:0 auto}.parts-stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:16px}.parts-list-card{padding:0;overflow:hidden}.parts-filters{padding:16px;border-bottom:1px solid var(--border)}.part-card{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;border-bottom:1px solid var(--border);background:var(--panel)}.part-card:hover{background:var(--panel-hover)}.part-card-main{min-width:0;flex:1}.part-card-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.part-card-title strong{font-size:1rem;color:var(--text)}.part-card-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:7px}.part-card-meta span{padding:3px 8px;border-radius:999px;background:#102b4d;color:#dceaff;font-size:.78rem}.part-card-detail{margin-top:7px;color:var(--muted);font-size:.86rem}.part-status-required{background:#5b3a12!important;color:#ffd99a!important}.part-status-ordered,.part-status-dispatched{background:#123f70!important;color:#dcebff!important}.part-status-arrived{background:#123f2d!important;color:#bff5d5!important}.part-status-allocated-to-repair{background:#3c2768!important;color:#e4d8ff!important}.part-status-fitted{background:#1f5136!important;color:#d8ffe8!important}.part-status-returned,.part-status-cancelled{background:#5a2029!important;color:#ffd7dc!important}
.parts-editor-dialog{width:min(980px,calc(100vw - 32px));max-width:980px}.parts-editor{width:100%;max-width:none;max-height:92dvh;display:flex;flex-direction:column;overflow:hidden;background:#081b36!important;color:#f5f9ff!important}.parts-editor-body{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:16px;overflow:auto}.parts-editor-panel{padding:16px;border:1px solid #315783;border-radius:14px;background:#0d2948}.parts-editor-panel h3{margin:0 0 14px;color:#fff}.parts-editor label{color:#eaf2ff!important}.parts-editor input,.parts-editor select,.parts-editor textarea{background:#06182f!important;color:#fff!important;border-color:#416b9c!important}.parts-editor input::placeholder,.parts-editor textarea::placeholder{color:#9fb2cc!important}.parts-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border-top:1px solid #315783;background:#07172f}.parts-inventory-hint{color:#c7d8ed;font-size:.86rem}.inventory-receipt-option{display:flex!important;align-items:flex-start;gap:11px}.inventory-receipt-option span{display:flex;flex-direction:column;gap:3px}.inventory-receipt-option small{color:#b9cbe0}.inventory-receipt-option[hidden]{display:none!important}
.tac-import-dialog{width:min(760px,calc(100vw - 32px))}.tac-import-dialog .modal{width:100%;max-width:none;max-height:90dvh;overflow:auto;background:#081b36!important;color:#f5f9ff!important}.tac-import-dialog textarea{min-height:280px;background:#06182f!important;color:#fff!important;border-color:#416b9c!important;font-family:ui-monospace,monospace}.tac-import-dialog label{color:#fff!important}
@media(max-width:820px){.parts-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.parts-editor-body{grid-template-columns:1fr}.parts-editor-dialog{width:100vw;max-width:none;height:100dvh;max-height:none}.parts-editor{height:100dvh;max-height:none;border-radius:0}.parts-editor-footer{position:sticky;bottom:0;flex-direction:column;align-items:stretch}.parts-editor-footer .actions{justify-content:flex-end}.part-card{align-items:flex-start}}
@media(max-width:520px){.parts-stats{grid-template-columns:1fr}.part-card{flex-direction:column}.part-card>button{width:100%}}


/* v5.5.1 Device Intelligence Manager and Parts editor refinement */
.device-intelligence-view .stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.unknown-tac-card{margin-top:18px}.unknown-tac-card .card-heading{align-items:flex-start}.unknown-tac-row{gap:14px}.unknown-tac-row button{min-width:100px}.success-empty{color:#b9f3d2}
.device-intelligence-dialog{width:min(620px,calc(100vw - 32px));max-width:620px}.unknown-tac-summary{display:flex;align-items:baseline;gap:12px;padding:14px;margin-bottom:16px;border-radius:12px;background:#0d2948;border:1px solid #315783;color:#eaf2ff}.unknown-tac-summary span,.unknown-tac-summary small{color:#b9cbe0}.unknown-tac-summary strong{font-size:1.25rem;color:#fff}
.repair-imei-field{padding:14px;border:1px solid #315783;border-radius:13px;background:#0d2948;color:#eaf2ff!important}.repair-imei-field input{background:#06182f!important;color:#fff!important;border-color:#416b9c!important}.repair-imei-field input::placeholder{color:#9fb2cc!important}
.parts-editor-dialog{inset:0;margin:auto;width:min(1060px,calc(100vw - 32px));max-width:1060px;max-height:calc(100dvh - 32px);padding:0;background:transparent;border:0}.parts-editor-dialog::backdrop{background:rgba(0,8,20,.72)}.parts-editor{max-height:calc(100dvh - 32px);border:1px solid #315783;box-shadow:0 24px 70px rgba(0,0,0,.55)}.parts-editor .modal-head{flex:0 0 auto;background:#0a2240;border-bottom:1px solid #315783;padding:16px 18px}.parts-editor-body{min-height:0;overscroll-behavior:contain}.parts-editor-panel .grid{align-items:start}.parts-editor select option{background:#06182f;color:#fff}.parts-editor input[type=date]{color-scheme:dark}.parts-editor-footer{flex:0 0 auto}.parts-editor .error{padding:0 16px 12px;color:#ffb4bb}
@media(max-width:900px){.device-intelligence-view .stats{grid-template-columns:repeat(2,minmax(0,1fr))}.parts-editor-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.parts-editor{max-height:calc(100dvh - 16px)}}
@media(max-width:620px){.device-intelligence-view .stats{grid-template-columns:1fr}.device-intelligence-dialog{width:100vw;max-width:none;height:100dvh;max-height:none}.device-intelligence-dialog .modal{height:100dvh;max-height:none;border-radius:0}.parts-editor-dialog{width:100vw;max-height:100dvh}.parts-editor{max-height:100dvh}}

/* v5.6.0 inventory allocation & purchasing */
.parts-actions{display:flex;gap:10px;justify-content:flex-end;margin:0 0 12px}.inventory-dialog{width:min(980px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;background:#101b2d;color:#eef5ff}.inventory-dialog label,.inventory-dialog h2,.inventory-dialog h3{color:#f5f8ff}.inventory-dialog input,.inventory-dialog select,.inventory-dialog textarea{background:#17263d!important;color:#f5f8ff!important;border-color:#38506f!important}.inventory-rule-list{margin-top:18px;display:grid;gap:10px}.rule-row,.requirement-card{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:14px 16px;border:1px solid #314763;border-radius:12px;background:#142238;color:#f4f8ff}.rule-row>div:first-child{display:grid;gap:4px}.rule-row span,.requirement-card .meta{color:#b8c7da}.requirements-list{display:grid;gap:12px}.requirement-card .part-card-meta{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0}.requirement-card .part-card-meta span{background:#203451;color:#dce8f8;padding:4px 8px;border-radius:999px}.danger{background:#7f1d1d!important;color:white!important}.inventory-dialog .check{display:flex;align-items:center;gap:10px}.inventory-dialog .check input{width:20px;height:20px}@media(max-width:760px){.parts-actions{justify-content:stretch;flex-direction:column}.parts-actions button{width:100%}.rule-row,.requirement-card{align-items:stretch;flex-direction:column}.inventory-dialog{width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0;margin:0}}

/* Workshop Pro v5.6.0 RC1.3 — verified authentication and Parts Rules layout */
#partRuleDialog.part-rule-dialog,
#requirementsDialog.requirements-dialog{
  inset:0;
  margin:auto;
  padding:0;
  border:0;
  background:transparent;
  width:min(860px,calc(100vw - 32px));
  max-width:860px;
  max-height:calc(100dvh - 32px);
}
#requirementsDialog.requirements-dialog{width:min(980px,calc(100vw - 32px));max-width:980px}
#partRuleDialog::backdrop,#requirementsDialog::backdrop{background:rgba(0,8,20,.72);backdrop-filter:blur(3px)}
#partRuleDialog .part-rule-modal,
#requirementsDialog .requirements-modal{
  width:100%;
  max-width:none;
  max-height:calc(100dvh - 32px);
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  overflow:auto;
  border:1px solid #315783;
  border-radius:16px;
  box-shadow:0 24px 70px rgba(0,0,0,.55);
}
#partRuleDialog .modal-head,#requirementsDialog .modal-head{
  position:sticky;top:0;z-index:3;
  padding:16px 18px;
  background:#0a2240;
  border-bottom:1px solid #315783;
}
#partRuleDialog .grid{padding:4px 18px 12px;grid-template-columns:1fr 1fr}
#partRuleDialog .inventory-rule-list{padding:0 18px 8px;margin-top:8px}
#partRuleDialog .actions{
  position:sticky;bottom:0;z-index:3;
  margin:0;padding:14px 18px;
  background:#0a2240;border-top:1px solid #315783;
}
#partRuleDialog .error{padding:0 18px 14px;margin:0;background:#0a2240}
#requirementsDialog .requirements-list{padding:16px 18px 20px;overflow:auto}
#partRuleDialog select option{background:#17263d;color:#f5f8ff}
@media(max-width:760px){
  #partRuleDialog.part-rule-dialog,#requirementsDialog.requirements-dialog{
    width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;
  }
  #partRuleDialog .part-rule-modal,#requirementsDialog .requirements-modal{
    height:100dvh;max-height:none;border-radius:0;border:0;
  }
  #partRuleDialog .grid{grid-template-columns:1fr;padding:4px 14px 12px}
  #partRuleDialog .inventory-rule-list{padding:0 14px 8px}
  #partRuleDialog .actions{padding:14px calc(14px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left))}
}


/* Workshop Pro v5.6.0 RC1.4 — compact Parts Rules dialog */
#partRuleDialog.part-rule-dialog{
  width:min(760px,calc(100vw - 40px));
  max-width:760px;
  max-height:min(82dvh,760px);
}
#partRuleDialog .part-rule-modal{
  max-height:min(82dvh,760px);
  overflow:auto;
}
#partRuleDialog .grid{gap:12px;padding-top:12px}
#partRuleDialog .inventory-rule-list{max-height:260px;overflow:auto;overscroll-behavior:contain}
#partRuleDialog .error:not(:empty){color:#ffd0d5;background:#3a1420;padding:10px 18px;margin:0;border-top:1px solid #6d2637}
@media (min-width:761px) and (max-width:1100px){
  #partRuleDialog.part-rule-dialog{width:min(720px,calc(100vw - 28px));max-height:86dvh}
  #partRuleDialog .part-rule-modal{max-height:86dvh}
}
@media(max-width:760px){
  #partRuleDialog.part-rule-dialog{width:100vw;max-width:none;height:100dvh;max-height:none}
  #partRuleDialog .part-rule-modal{height:100dvh;max-height:none}
  #partRuleDialog .inventory-rule-list{max-height:none}
}

/* v5.6.1 Repair Workflow Engine */
.part-rule-modal .span-2{grid-column:1/-1}.part-rule-modal small{color:#b9c7d8}.part-rule-modal .autocomplete{position:relative;max-height:220px;overflow:auto;background:#111c2b;border:1px solid #36506d;border-radius:10px;margin-top:6px;padding:6px;z-index:4}.part-rule-modal .autocomplete button{display:block;width:100%;text-align:left;background:#17263a;color:#f4f8ff;border:0;border-radius:8px;padding:10px;margin:2px 0}.rule-group{background:#111c2b;border:1px solid #2e435e;border-radius:12px;padding:10px;margin:10px 0}.rule-group h4{margin:0 0 8px;color:#fff}.part-rule-dialog .part-rule-modal{width:min(880px,calc(100vw - 32px));max-height:min(86vh,820px)}

/* v5.6.1 RC1.1 Parts & Inventory controls */
.requirement-edit-modal{width:min(760px,calc(100vw - 32px));max-height:min(82vh,760px);overflow:auto}.inventory-controls-modal{width:min(940px,calc(100vw - 32px));max-height:min(86vh,820px);overflow:auto}.requirement-card.is-archived{opacity:.72}.danger{background:#7f1d1d!important;color:#fff!important;border-color:#b91c1c!important}@media(max-width:820px){.requirement-edit-modal,.inventory-controls-modal{width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0;margin:0}}


/* v5.6.1 RC1.2: Inventory List sizing and Repair Rule device-search contrast/selection */
#inventoryControlsDialog.requirements-dialog {
  width: min(900px, calc(100vw - 40px)) !important;
  max-width: 900px !important;
  height: auto !important;
  max-height: min(84dvh, 760px) !important;
  padding: 0 !important;
  overflow: hidden !important;
}
#inventoryControlsDialog .inventory-controls-modal {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: min(84dvh, 760px) !important;
  margin: 0 !important;
  overflow: auto !important;
}
#partRuleDeviceResults {
  position: relative;
  z-index: 30;
  display: block;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 7px;
  padding: 6px;
  border: 1px solid #47698f !important;
  border-radius: 11px;
  background: #071a2d !important;
  color: #f4f8ff !important;
  box-shadow: 0 16px 36px rgba(0,0,0,.32);
}
#partRuleDeviceResults[hidden] { display: none !important; }
#partRuleDeviceResults .part-rule-device-result {
  display: grid !important;
  grid-template-columns: minmax(110px,.42fr) minmax(0,1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin: 2px 0;
  padding: 11px 13px;
  border: 1px solid transparent !important;
  border-radius: 9px;
  background: #102b48 !important;
  color: #f7fbff !important;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#partRuleDeviceResults .part-rule-device-result strong { color: #ffffff !important; }
#partRuleDeviceResults .part-rule-device-result span { color: #c6d9ec !important; }
#partRuleDeviceResults .part-rule-device-result:hover,
#partRuleDeviceResults .part-rule-device-result:focus,
#partRuleDeviceResults .part-rule-device-result:active {
  border-color: #66a8f5 !important;
  background: #17406a !important;
  outline: none;
}
#partRuleDeviceSelected { display:block; margin-top:7px; color:#c8d9ea !important; font-weight:650; }
@media (max-width: 820px) {
  #inventoryControlsDialog.requirements-dialog {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  #inventoryControlsDialog .inventory-controls-modal {
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
  }
  #partRuleDeviceResults .part-rule-device-result { grid-template-columns: 1fr; gap: 3px; }
}

/* v5.6.1 RC1.3: readable Parts status selection and bulk import */
#partStatusFilter{background:#0b2442!important;color:#f5f9ff!important;border-color:#3c638f!important;color-scheme:dark}
#partStatusFilter option{background:#0b2442!important;color:#f5f9ff!important}
#partStatusFilter:focus{outline:2px solid #62a9ff;outline-offset:1px}
.bulk-import-modal{width:min(700px,calc(100vw - 32px));max-width:700px;max-height:calc(100dvh - 32px);overflow:auto}
.bulk-import-modal input[type=file]{background:#0b2442!important;color:#f5f9ff!important;border:1px solid #3c638f!important;padding:12px}
.import-result{margin-top:14px;padding:12px;border-radius:10px;background:#0b2442;color:#dcecff;white-space:normal;overflow-wrap:anywhere}
@media(max-width:760px){.bulk-import-modal{width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0}}

/* v5.6.2 RC1: Catalogue Builder */
.catalogue-builder-modal{width:min(1050px,calc(100vw - 32px));max-width:1050px;max-height:calc(100dvh - 32px);overflow:auto;background:#071a2d!important;color:#eef6ff!important}
.catalogue-builder-grid{display:grid;grid-template-columns:minmax(300px,.85fr) minmax(360px,1.15fr);gap:18px}
.catalogue-model-list{max-height:430px;overflow:auto;padding:8px;border:1px solid #365b82;border-radius:12px;background:#091f36}
.catalogue-model-list label,.catalogue-options label{display:flex;gap:10px;align-items:flex-start;padding:10px;border-radius:9px;background:#102b48;color:#f5f9ff;margin:5px 0;cursor:pointer}
.catalogue-model-list label:hover,.catalogue-options label:hover{background:#17406a}.catalogue-options label input,.catalogue-model-list label input{margin-top:3px}.catalogue-options small{display:block;color:#bdd1e5;margin-top:3px}.catalogue-select-actions{display:flex;gap:8px;margin:8px 0}.catalogue-defaults{margin-top:14px}
@media(max-width:820px){.catalogue-builder-modal{width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0}.catalogue-builder-grid{grid-template-columns:1fr}.catalogue-model-list{max-height:36dvh}}


/* v5.6.2 RC2 — module framework, Catalogue Builder hardening and diagnostics */
#catalogueBuilderDialog{inset:0;margin:auto;padding:0;border:0;background:transparent;max-width:none;max-height:none}
#catalogueBuilderDialog[open]{display:block}
#catalogueBuilderDialog::backdrop{background:rgba(0,8,20,.76);backdrop-filter:blur(3px)}
#catalogueBuilderDialog .catalogue-builder-modal{margin:auto;width:min(1050px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #365b82;box-shadow:0 24px 70px rgba(0,0,0,.58)}
.diagnostics-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}.diagnostic-card{padding:16px;border-radius:13px;border:1px solid #36506d;background:#101f33}.diagnostic-card.is-ok{border-color:#287a59}.diagnostic-card.is-error{border-color:#a63e4a}.diagnostic-title,.diagnostic-check{display:flex;justify-content:space-between;gap:14px;align-items:center}.diagnostic-title{margin-bottom:10px}.diagnostic-check{padding:7px 0;border-top:1px solid rgba(255,255,255,.08);color:#c7d6e8}.diagnostic-check strong{color:#f7fbff;text-align:right}
@media(max-width:820px){#catalogueBuilderDialog{width:100vw;height:100dvh;margin:0}#catalogueBuilderDialog .catalogue-builder-modal{width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0}}

/* v5.7 shared identity */
.shared-identity-card{grid-column:1/-1}.shared-identity-card .stats{margin:12px 0}.shared-identity-card .integration-client-row{margin-top:8px}
