[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;
  }
}
