:root{--navy:#071b39;--blue:#073c8c;--royal:#0751b7;--accent:#ff6a00;--ink:#142740;--muted:#5b6d83;--line:#d9e2ed;--light:#f2f6fb;--white:#fff;--ok:#16a34a;--warn:#d97706;--bad:#dc2626;--radius:14px;--shadow:0 1px 2px rgba(7,27,57,.06),0 4px 16px rgba(7,27,57,.06)}
*{box-sizing:border-box}html,body{margin:0}body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);background:var(--light);font-size:15px;line-height:1.45}
a{color:var(--royal);text-decoration:none}a:hover{text-decoration:underline}
.app{display:flex;min-height:100vh}
.sidebar{width:248px;background:var(--navy);color:#cfdaea;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;z-index:30;transition:transform .2s}
.sidebar .brand{padding:18px 18px 14px;border-bottom:1px solid rgba(255,255,255,.08)}
.sidebar .brand .logo-wrap{background:#fff;border-radius:10px;padding:8px 10px;display:flex;align-items:center;justify-content:center}
.sidebar .brand img{max-width:100%;max-height:44px;display:block}
.sidebar .brand small{display:block;margin-top:8px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#8fa6c6}
.nav{padding:10px;flex:1;overflow:auto}.nav a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;color:#cfdaea;font-weight:500;margin-bottom:2px}
.nav a:hover{background:rgba(255,255,255,.06);text-decoration:none;color:#fff}.nav a.active{background:var(--blue);color:#fff;box-shadow:inset 3px 0 0 var(--accent)}
.nav .ico{width:20px;text-align:center;opacity:.9}.nav .sep{height:1px;background:rgba(255,255,255,.08);margin:10px 6px}
.sidebar .me{padding:14px 16px;border-top:1px solid rgba(255,255,255,.08);font-size:13px}.sidebar .me b{color:#fff;display:block}
.main{margin-left:248px;flex:1;min-width:0}
.topbar{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:10px 24px}
.topbar form.search{flex:1;max-width:560px;position:relative}.topbar input.search{width:100%;padding:10px 14px 10px 38px;border:1px solid var(--line);border-radius:999px;background:var(--light)}
.topbar .search .si{position:absolute;left:14px;top:9px;color:var(--muted)}
.topbar .grow{flex:1}.menu-btn{display:none;background:none;border:0;font-size:22px;cursor:pointer;color:var(--navy)}
.pill{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:600;background:var(--light);border:1px solid var(--line);white-space:nowrap}
.pill.ok{background:#e9f8ef;color:#166534;border-color:#bbe5c9}.pill.off{background:#fff3e8;color:#9a3d00;border-color:#ffd2b0}.pill.bad{background:#fdecec;color:#991b1b;border-color:#f5c2c2}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:currentColor}
.content{padding:24px;max-width:1400px}
h1{font-size:24px;margin:0 0 4px;color:var(--navy)}h2{font-size:17px;margin:0 0 12px;color:var(--navy)}h3{font-size:15px;margin:0 0 8px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}.page-head p{margin:0;color:var(--muted)}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}.card+.card{margin-top:16px}
.card.flush{padding:0}.card .card-head{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid var(--line)}.card .card-head h2{margin:0}
.grid{display:grid;gap:16px}.g2{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(3,minmax(0,1fr))}.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.cols{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;align-items:start}
.stat{position:relative;overflow:hidden}.stat .label{color:var(--muted);font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}.stat .value{font-size:30px;font-weight:800;color:var(--navy);margin-top:4px}
.stat .sub{color:var(--muted);font-size:13px}.stat:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--c,var(--royal))}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 14px;border-radius:10px;border:1px solid var(--line);background:#fff;color:var(--ink);font-weight:600;font-size:14px;cursor:pointer;text-decoration:none!important;white-space:nowrap}
.btn:hover{border-color:#b9c7d9;background:#f8fafc}.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.primary:hover{background:var(--royal)}
.btn.accent{background:var(--accent);border-color:var(--accent);color:#fff}.btn.danger{color:var(--bad);border-color:#f3c4c4}.btn.sm{padding:5px 10px;font-size:13px;border-radius:8px}.btn.block{width:100%}
.btns{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:top}th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);background:#f8fafc;font-weight:700}
tr:last-child td{border-bottom:0}tbody tr:hover{background:#fafcff}td.num,th.num{text-align:right}.table-wrap{overflow-x:auto}
.badge{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;color:#fff;background:var(--c,#64748b);white-space:nowrap}
.badge.soft{background:color-mix(in srgb,var(--c,#64748b) 14%,#fff);color:color-mix(in srgb,var(--c,#64748b) 80%,#000)}
.tag{display:inline-block;font-size:11px;font-weight:700;padding:2px 7px;border-radius:6px;background:#eef2ff;color:#3730a3;text-transform:uppercase;letter-spacing:.03em}.tag.demo{background:#fff3e8;color:#9a3d00}
label{display:block;font-weight:600;font-size:13px;margin-bottom:4px;color:var(--ink)}.field{margin-bottom:12px}.hint{color:var(--muted);font-size:12px;font-weight:400}
input[type=text],input[type=email],input[type=tel],input[type=number],input[type=password],input[type=date],input[type=time],input[type=search],select,textarea{width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:10px;font:inherit;background:#fff;color:var(--ink)}
input:focus,select:focus,textarea:focus{outline:2px solid color-mix(in srgb,var(--royal) 35%,transparent);border-color:var(--royal)}
textarea{min-height:80px;resize:vertical}.check{display:flex;align-items:center;gap:8px;font-weight:500}.check input{width:18px;height:18px}
.row{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.alert{padding:12px 14px;border-radius:12px;margin-bottom:16px;border:1px solid;font-weight:500}.alert.success{background:#ecfdf3;border-color:#bbe5c9;color:#14532d}
.alert.error{background:#fdecec;border-color:#f5c2c2;color:#7f1d1d}.alert.warning{background:#fff7ed;border-color:#fed7aa;color:#7c2d12}.alert.info{background:#eef5ff;border-color:#c7dafa;color:#123a7a}
.muted{color:var(--muted)}.small{font-size:13px}.right{text-align:right}.mt{margin-top:16px}.mb0{margin-bottom:0}.nowrap{white-space:nowrap}.strong{font-weight:700}
.list{list-style:none;margin:0;padding:0}.list li{padding:10px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;align-items:center}.list li:last-child{border-bottom:0}
.status-strip{display:flex;gap:8px;flex-wrap:wrap}.status-strip a{flex:1 1 140px;padding:12px 14px;border-radius:12px;background:#fff;border:1px solid var(--line);text-decoration:none;color:var(--ink);border-top:4px solid var(--c)}
.status-strip a:hover{box-shadow:var(--shadow)}.status-strip .n{font-size:24px;font-weight:800;color:var(--navy)}.status-strip .l{font-size:12px;color:var(--muted);font-weight:600}
.timeline{list-style:none;padding:0;margin:0}.timeline li{position:relative;padding:0 0 14px 22px;border-left:2px solid var(--line);margin-left:6px}.timeline li:before{content:"";position:absolute;left:-7px;top:3px;width:12px;height:12px;border-radius:50%;background:#fff;border:3px solid var(--royal)}
.timeline li.offsite:before{border-color:var(--accent)}.timeline li.payment:before{border-color:var(--ok)}.timeline li.security:before{border-color:var(--bad)}.timeline .when{font-size:12px;color:var(--muted)}
.kv{display:grid;grid-template-columns:140px 1fr;gap:6px 12px;font-size:14px}.kv dt{color:var(--muted)}.kv dd{margin:0;font-weight:500;word-break:break-word}
.masked{font-family:ui-monospace,monospace;letter-spacing:.15em}
.sig-pad{border:2px dashed var(--line);border-radius:12px;background:#fcfdff;touch-action:none;width:100%;height:170px;display:block;cursor:crosshair}
.terms-box{max-height:240px;overflow:auto;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:12px;white-space:pre-wrap;font-size:13px}
.tabs{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:16px}.tabs a{padding:8px 12px;border-radius:999px;background:#fff;border:1px solid var(--line);color:var(--ink);font-weight:600;font-size:13px}.tabs a.active{background:var(--navy);color:#fff;border-color:var(--navy)}
.settings{display:grid;grid-template-columns:240px minmax(0,1fr);gap:16px;align-items:start}.settings nav{position:sticky;top:76px}.settings nav a{display:block;padding:9px 12px;border-radius:10px;color:var(--ink);font-weight:500}
.settings nav a.active{background:#fff;border:1px solid var(--line);color:var(--blue);font-weight:700;box-shadow:var(--shadow)}
.repeater .rrow{display:grid;gap:8px;align-items:center;padding:8px;border:1px solid var(--line);border-radius:10px;margin-bottom:8px;background:#fff}
.repeater .rrow .ctl{display:flex;gap:4px}.repeater .rrow .btn{padding:4px 8px}
.empty{padding:28px;text-align:center;color:var(--muted)}
.swatch{width:36px;height:36px;border-radius:8px;border:1px solid var(--line);padding:0}input[type=color]{width:52px;height:38px;border:1px solid var(--line);border-radius:8px;padding:2px;background:#fff}
.login{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 20% 10%,var(--royal),var(--navy) 60%)}.login .card{width:min(420px,92vw);padding:28px}
.login .logo-wrap{text-align:center;margin-bottom:16px}.login img{max-width:240px}
.ticket-hero{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap}.ticket-hero .num{font-family:ui-monospace,monospace;font-size:13px;color:var(--muted)}
.totals td{border:0;padding:4px 12px}.totals tr.grand td{font-size:18px;font-weight:800;color:var(--navy);border-top:2px solid var(--line);padding-top:8px}
.scrim{display:none}
@media (max-width:1100px){.g4{grid-template-columns:repeat(2,minmax(0,1fr))}.cols{grid-template-columns:1fr}.settings{grid-template-columns:1fr}.settings nav{position:static;display:flex;flex-wrap:wrap;gap:4px}}
@media (max-width:760px){.sidebar{transform:translateX(-100%)}.sidebar.open{transform:none}.scrim.open{display:block;position:fixed;inset:0;background:rgba(7,27,57,.4);z-index:25}
.main{margin-left:0}.menu-btn{display:block}.content{padding:14px}.topbar{padding:10px 14px}.g2,.g3,.g4{grid-template-columns:1fr}.kv{grid-template-columns:110px 1fr}.hide-sm{display:none}h1{font-size:20px}}
@media print{.sidebar,.topbar,.no-print{display:none!important}.main{margin:0}.content{padding:0}.card{box-shadow:none;border:0}body{background:#fff}}
@media (min-width:761px){.app{background:linear-gradient(to right,var(--navy) 248px,transparent 248px)}}
.grid>.card+.card{margin-top:0}
@media (max-width:760px){.topbar .grow{display:none}.topbar form.search{flex:1;min-width:0}.topbar .pill{font-size:11px;padding:3px 8px}}
/* typeahead */
.typeahead{position:absolute;top:44px;left:0;right:0;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 32px rgba(7,27,57,.18);max-height:70vh;overflow:auto;z-index:50;padding:6px}
.typeahead .grp{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700;padding:8px 10px 4px}
.typeahead a{display:block;padding:8px 10px;border-radius:10px;color:var(--ink);text-decoration:none}.typeahead a:hover,.typeahead a.sel{background:var(--light)}
.typeahead a .s{display:block;font-size:12px;color:var(--muted)}.typeahead .exact{background:#ecfdf3;border:1px solid #bbe5c9}
.typeahead .all{border-top:1px solid var(--line);margin-top:4px;font-weight:600;color:var(--royal)}
mark{background:#fff1b8;color:inherit;border-radius:3px;padding:0 1px}
.scanbar{display:flex;gap:8px;align-items:center;background:linear-gradient(90deg,#eef5ff,#fff);border:1px dashed var(--royal);border-radius:12px;padding:10px 12px;margin:0 18px 14px}
.scanbar input{font-family:ui-monospace,monospace;font-size:16px}.scanbar .ico{font-size:20px}
.bc-preview{background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px;display:inline-block;max-width:100%}
.bc-status{font-size:12px;margin-top:4px}.bc-status.ok{color:var(--ok)}.bc-status.bad{color:var(--bad)}
.match{font-size:10px;font-weight:700;text-transform:uppercase;background:#eef2ff;color:#3730a3;padding:1px 6px;border-radius:5px;margin-left:4px}
.CodeMirror{border:1px solid var(--line);border-radius:10px;height:auto;min-height:160px;max-height:420px;font-size:12.5px}
.CodeMirror-scroll{min-height:160px;max-height:420px}
.visual-area{border:1px solid var(--line);border-radius:10px;min-height:180px;max-height:460px;overflow:auto;padding:12px;background:#fff}
.visual-toolbar{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:6px}
.seg{display:flex}.seg .btn{border-radius:0}.seg .btn:first-child{border-radius:8px 0 0 8px}.seg .btn:last-child{border-radius:0 8px 8px 0}.seg .btn.active{background:var(--navy);color:#fff;border-color:var(--navy)}
.tag-picker .tags{display:flex;flex-wrap:wrap;gap:4px;max-height:150px;overflow:auto}
.chip{font:12px ui-monospace,monospace;background:#eef5ff;border:1px solid #c7dafa;color:#123a7a;border-radius:999px;padding:3px 8px;cursor:pointer}.chip:hover{background:#dbe9ff}
.email-preview{width:100%;height:640px;border:1px solid var(--line);border-radius:12px;background:#fff}
.sms-bubble{background:#e9f2ff;border-radius:16px 16px 16px 4px;padding:10px 14px;white-space:pre-wrap;font-size:14px;max-width:340px}
.matrix td,.matrix th{padding:6px 8px}.matrix .grp-row td{background:#f2f6fb;font-size:13px}.matrix th{position:sticky;top:0;z-index:1}
.status-sent{color:var(--ok)}.status-failed{color:var(--bad)}.status-not_sent{color:var(--warn)}.status-queued{color:var(--royal)}.status-skipped{color:var(--muted)}
.avatar{width:38px;height:38px;border-radius:50%;background:var(--navy);color:#fff;display:inline-grid;place-items:center;font-weight:700;font-size:13px;overflow:hidden;flex:none}
.avatar img{width:100%;height:100%;object-fit:cover}.avatar.lg{width:96px;height:96px;font-size:30px}
.locswitch{display:flex;align-items:center;gap:6px}.locswitch select{width:auto;padding:6px 10px;border-radius:999px;font-weight:600}
.perm-grid{columns:2 320px;column-gap:24px}.perm-grid .grp{break-inside:avoid;margin-bottom:14px}.perm-grid label.check{display:flex;font-size:13px;margin:3px 0}
.perm-grid .from-role{color:var(--muted)}.perm-grid .granted{color:var(--ok);font-weight:600}.perm-grid .revoked{color:var(--bad);text-decoration:line-through}
.ovr{border:1px dashed var(--warn);border-radius:10px;padding:8px 10px;background:#fff8eb}
.doc-body{max-width:780px}.doc-body h2{margin-top:0}.sig-block{border-top:1px dashed var(--line);margin-top:16px;padding-top:10px}
.kv{display:grid;grid-template-columns:110px 1fr;gap:4px 10px;margin:0}.kv dt{color:var(--muted)}.kv dd{margin:0}
.pill.warn{background:#fff4e0;color:#9a5b00}
.pos{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:16px;align-items:start}
@media (max-width:980px){.pos{grid-template-columns:1fr}}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}.tile{border:1px solid var(--line);background:#f8fbff;border-radius:12px;padding:10px;text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:4px;font:inherit}
.tile:hover{border-color:var(--royal);background:#eef5ff}.tile span{color:var(--muted);font-size:13px}
.methods{display:flex;flex-wrap:wrap;gap:8px}.method input{display:none}.method span{display:inline-block;padding:10px 14px;border:1px solid var(--line);border-radius:10px;cursor:pointer;font-weight:600}
.method input:checked+span{background:var(--navy);color:#fff;border-color:var(--navy)}
.cart-table input{padding:6px 8px}
.receipt-like{font-family:ui-monospace,Menlo,Consolas,monospace}.receipt-like hr{border:0;border-top:1px dashed #94a3b8}
.typeahead a{display:flex;flex-direction:column}
/* customer portal */
.portal-body{background:var(--light,#f4f7fb);min-height:100vh;display:flex;flex-direction:column}
.portal-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 24px;background:var(--navy);color:#fff}
.portal-brand{display:flex;align-items:center;gap:12px;color:#fff;font-weight:700;font-size:17px;text-decoration:none}.portal-brand img{height:36px;background:#fff;border-radius:8px;padding:3px}
.portal-nav{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.portal-nav a{color:#fff;font-weight:600}.portal-nav .muted{color:#c9d6ee}.portal-nav .btn.ghost{color:#fff;border-color:rgba(255,255,255,.4);background:transparent}
.portal-main{width:min(1080px,100%);margin:0 auto;padding:24px 16px;flex:1}.portal-foot{text-align:center;padding:18px}
.portal-login{max-width:420px;margin:30px auto}.portal-or{text-align:center;margin:14px 0;color:#8a97ad;font-size:13px}
.portal-matrix th span{display:inline-block;max-width:90px;white-space:normal;font-size:11px;line-height:1.2}.portal-matrix td.c{text-align:center}.nowrap{white-space:nowrap}
.portal-matrix td.actions{display:flex;flex-direction:column;gap:4px;align-items:stretch;min-width:96px}.portal-matrix td.actions form{display:block!important}.portal-matrix td.actions .btn{width:100%}
/* variables */
.var-picker{margin:10px 0}.var-picker .vp-list,.vp-pop .vp-list{max-height:260px;overflow:auto;border:1px solid var(--line);border-radius:10px;padding:8px;background:#fff}
.vp-group{margin-bottom:6px}.vp-group.off{opacity:.45}.vp-gh{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#64748b;margin:2px 0 4px}
.chip[data-var]{font-family:ui-monospace,Menlo,monospace;font-size:12px;margin:0 4px 4px 0;cursor:pointer}.chip.sm{font-size:11px;padding:2px 7px;margin:1px 3px 1px 0}
.vars-wrap{position:relative}.vars-wrap input,.vars-wrap textarea{padding-right:44px}.vp-btn{position:absolute;right:6px;top:6px;border:1px solid var(--line);background:#f4f7fb;border-radius:7px;font:600 11px ui-monospace,monospace;padding:3px 6px;cursor:pointer;color:var(--royal)}
.vp-pop{position:absolute;z-index:200;width:360px;padding:10px;box-shadow:0 14px 40px rgba(7,27,57,.22)}.vp-pop .vp-search{margin-bottom:6px}
.var-preview{margin-top:4px;color:#334155;white-space:pre-wrap}.var-preview:empty{display:none}.var-issues{color:#9a3d00;font-weight:600}
mark.var-flag{background:#fff1d6;color:#9a3d00;border:1px dashed #f59e0b;border-radius:4px;padding:0 3px}
.var-syntax{background:#f4f7fb;border:1px solid var(--line);border-radius:10px;padding:10px 12px;line-height:1.9}.var-ref tr.grp td{background:#f4f7fb}.cv-key{display:flex;align-items:center;gap:2px;font-family:ui-monospace,monospace}.cv-table input{min-width:120px}
/* reports */
.reports-layout{display:grid;grid-template-columns:220px 1fr;gap:16px;align-items:start}
.report-nav{display:flex;flex-direction:column;gap:2px;position:sticky;top:76px;padding:12px}
.report-nav a{padding:6px 10px;border-radius:8px;color:inherit;text-decoration:none;font-size:14px}.report-nav a:hover{background:var(--bg,#f3f5f9)}.report-nav a.active{background:var(--blue);color:#fff}
.report-nav .vp-gh{margin-top:8px}
.grid-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}.report-card{display:flex;flex-direction:column;gap:4px;text-decoration:none;color:inherit}.report-card:hover{border-color:var(--royal)}
.report-table td.num,.report-table th.num,.dr-table .num{text-align:right;white-space:nowrap}.report-table tfoot th{border-top:2px solid var(--line,#ddd)}
.table-wrap{overflow-x:auto}
.dr15 .dr-head{display:flex;gap:24px;flex-wrap:wrap;margin-bottom:12px}.dr15 .dr-head div{display:flex;flex-direction:column}
.dr-table{width:100%}.dr-table th{font-weight:600;text-align:left}.dr-table td.na{background:repeating-linear-gradient(45deg,#f3f3f3,#f3f3f3 4px,#fafafa 4px,#fafafa 8px)}
.dr-in{width:120px;text-align:right;padding:4px 6px}.dr-cols{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:12px}.dr-total th,.dr-total td{border-top:2px solid #111;font-size:16px}
.alert.warn{background:#fff7e6;border-color:#f0b44c;color:#7a4b00}
@media (max-width:900px){.reports-layout,.dr-cols{grid-template-columns:1fr}.report-nav{position:static}}
.dr-table th{text-transform:none;letter-spacing:0;font-size:13px;color:var(--ink,#1b2433);background:none}.dr-table thead th{font-weight:700}.dr-table th .hint{font-weight:400}
/* repair extras */
.due-over{color:#dc2626!important;font-weight:700}.due-today{color:#d97706!important;font-weight:600}.tag.warranty{background:#ecfdf5;color:#047857;border-color:#a7f3d0}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}.photo-grid figure{margin:0;position:relative}.photo-grid img{width:100%;height:110px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.photo-grid figcaption{font-size:12px;color:var(--muted,#667);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.photo-grid .del{position:absolute;top:4px;right:4px}
.file-list li{display:flex;justify-content:space-between;gap:8px}.cam-btn{display:inline-flex;align-items:center;gap:6px;cursor:pointer}.cam-btn input{display:none}
.warranty-box{border:1px solid #a7f3d0;background:#f0fdf4;border-radius:10px;padding:10px 12px;margin-top:10px}.warranty-box.none{border-color:var(--line);background:none}
/* two-way sms */
.sms-thread{max-height:360px;overflow:auto;display:flex;flex-direction:column;gap:8px;padding:6px 2px;margin:8px 0}
.sms{display:flex;flex-direction:column;max-width:82%}.sms.in{align-self:flex-start}.sms.out{align-self:flex-end;align-items:flex-end}
.sms .bubble{padding:8px 12px;border-radius:16px;white-space:pre-wrap;word-break:break-word;font-size:14px}.sms.in .bubble{background:#eef2f7;color:#142740;border-bottom-left-radius:4px}
.sms.out .bubble{background:#0751b7;color:#fff;border-bottom-right-radius:4px}.sms.out.auto .bubble{background:#dbe7f8;color:#142740}.sms .meta{font-size:11px;color:#667;margin-top:2px}
.st-logged,.st-not_sent{color:#d97706}.st-failed{color:#dc2626}.sms-compose textarea{width:100%}
.nav-badge{background:#dc2626;color:#fff;border-radius:10px;padding:0 7px;font-size:11px;margin-left:auto;font-weight:700}
/* time clock */
.tc-state{font-size:28px;font-weight:800;margin:4px 0 8px}.tc-in{color:#047857}.tc-break{color:#d97706}.tc-out{color:#64748b}.btn.big{padding:16px 26px;font-size:18px}
.ts-edit input[type=datetime-local]{width:190px}
.tag.po-draft,.tag.tr-requested{background:#f1f5f9}.tag.po-sent,.tag.tr-in_transit{background:#eff6ff;color:#1d4ed8}.tag.po-partial{background:#fffbeb;color:#b45309}.tag.po-received,.tag.tr-received{background:#ecfdf5;color:#047857}.tag.po-cancelled,.tag.tr-cancelled{background:#fef2f2;color:#b91c1c}
.sq-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:6px 0 10px}.sq-stats div{background:#f6f8fb;border-radius:10px;padding:10px;text-align:center}.sq-stats b{display:block;font-size:22px}.sq-stats span{font-size:12px;color:#667}
/* ---------- dark mode (per user: Account → Appearance; html[data-theme=dark]) ---------- */
html[data-theme=dark]{color-scheme:dark;--ink:#dbe5f3;--muted:#93a4bb;--line:#26354d;--light:#0b1322;--white:#111b2d;--card:#111b2d;--card2:#16223a;--shadow:0 1px 2px rgba(0,0,0,.4),0 4px 16px rgba(0,0,0,.25)}
html[data-theme=dark] body{background:var(--light);color:var(--ink)}
html[data-theme=dark] a{color:#7fb0ff}
html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3,html[data-theme=dark] .stat .value,html[data-theme=dark] .menu-btn{color:#eef3fb}
html[data-theme=dark] .topbar{background:rgba(13,22,38,.92)}
html[data-theme=dark] .card,html[data-theme=dark] .btn,html[data-theme=dark] .status-strip a,html[data-theme=dark] .tabs a,html[data-theme=dark] .settings nav a.active,html[data-theme=dark] .repeater .rrow,html[data-theme=dark] .typeahead,html[data-theme=dark] .visual-area,html[data-theme=dark] .email-preview,html[data-theme=dark] .var-picker .vp-list,html[data-theme=dark] .vp-pop .vp-list,html[data-theme=dark] .timeline li:before,html[data-theme=dark] .modal-box{background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] input[type=text],html[data-theme=dark] input[type=email],html[data-theme=dark] input[type=tel],html[data-theme=dark] input[type=number],html[data-theme=dark] input[type=password],html[data-theme=dark] input[type=date],html[data-theme=dark] input[type=time],html[data-theme=dark] input[type=search],html[data-theme=dark] input[type=datetime-local],html[data-theme=dark] input[type=color],html[data-theme=dark] select,html[data-theme=dark] textarea,html[data-theme=dark] input:not([type]){background:#0d1628;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .btn:hover,html[data-theme=dark] th,html[data-theme=dark] tbody tr:hover,html[data-theme=dark] .terms-box,html[data-theme=dark] .sig-pad,html[data-theme=dark] .tile,html[data-theme=dark] .sq-stats div,html[data-theme=dark] .vp-btn,html[data-theme=dark] .var-syntax,html[data-theme=dark] .var-ref tr.grp td,html[data-theme=dark] .matrix .grp-row td{background:var(--card2);color:var(--ink)}
html[data-theme=dark] .tile:hover,html[data-theme=dark] .chip:hover{background:#1c2b47}
html[data-theme=dark] .btn.primary{background:var(--royal);border-color:var(--royal);color:#fff}html[data-theme=dark] .btn.accent{background:var(--accent);border-color:var(--accent);color:#fff}
html[data-theme=dark] .btn.danger{color:#ff8a8a;border-color:#5b2730}
html[data-theme=dark] .pill{background:var(--card2);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] .pill.ok,html[data-theme=dark] .alert.success,html[data-theme=dark] .typeahead .exact,html[data-theme=dark] .tag.warranty,html[data-theme=dark] .warranty-box,html[data-theme=dark] .tag.po-received,html[data-theme=dark] .tag.tr-received{background:#0f2a1c;color:#86efac;border-color:#1f5135}
html[data-theme=dark] .pill.off,html[data-theme=dark] .pill.warn,html[data-theme=dark] .alert.warning,html[data-theme=dark] .alert.warn,html[data-theme=dark] .tag.demo,html[data-theme=dark] .ovr,html[data-theme=dark] .tag.po-partial{background:#2e1f0c;color:#fdba74;border-color:#5c3a12}
html[data-theme=dark] .pill.bad,html[data-theme=dark] .alert.error,html[data-theme=dark] .tag.po-cancelled,html[data-theme=dark] .tag.tr-cancelled{background:#321317;color:#fca5a5;border-color:#5b2730}
html[data-theme=dark] .alert.info,html[data-theme=dark] .chip,html[data-theme=dark] .tag,html[data-theme=dark] .match,html[data-theme=dark] .sms-bubble,html[data-theme=dark] .sms.out.auto .bubble,html[data-theme=dark] .tag.po-sent,html[data-theme=dark] .tag.tr-in_transit{background:#13254a;color:#b9d2ff;border-color:#25406f}
html[data-theme=dark] .sms.in .bubble,html[data-theme=dark] .tag.po-draft,html[data-theme=dark] .tag.tr-requested{background:#1b2638;color:var(--ink)}
html[data-theme=dark] mark,html[data-theme=dark] mark.var-flag{background:#4a3b0c;color:#fde68a}
html[data-theme=dark] .badge.soft{background:color-mix(in srgb,var(--c,#64748b) 26%,#111b2d);color:color-mix(in srgb,var(--c,#64748b) 45%,#fff)}
html[data-theme=dark] .bc-preview,html[data-theme=dark] .portal-brand img{background:#fff}
html[data-theme=dark] [style*="background:#fff"],html[data-theme=dark] [style*="background: #fff"],html[data-theme=dark] [style*="background:#f"]{background:var(--card2)!important}
html[data-theme=dark] .hint,html[data-theme=dark] .muted{color:var(--muted)}
html[data-theme=dark] code{background:#0d1628;color:#c7d8f3}
@media print{html[data-theme=dark]{color-scheme:light}}
/* theme toggle + keyboard cheat sheet */
.theme-btn{background:none;border:1px solid var(--line);border-radius:999px;width:32px;height:32px;cursor:pointer;color:var(--ink);display:inline-flex;align-items:center;justify-content:center;font-size:15px}
.kbd-btn{font:600 12px ui-monospace,monospace}
kbd{display:inline-block;min-width:22px;padding:2px 6px;border:1px solid var(--line);border-bottom-width:2px;border-radius:6px;font:600 12px ui-monospace,monospace;background:var(--light);color:var(--ink);text-align:center}
.modal{position:fixed;inset:0;background:rgba(7,15,30,.55);display:flex;align-items:flex-start;justify-content:center;z-index:100;padding:60px 16px;overflow:auto}.modal[hidden]{display:none}
.modal-box{background:#fff;border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.3);max-width:720px;width:100%;padding:20px 22px}
.kb-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 24px}.kb-grid h3{grid-column:1/-1;margin:12px 0 4px;font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.kb-row{display:flex;justify-content:space-between;gap:12px;padding:5px 0;border-bottom:1px dashed var(--line);font-size:14px}
.kb-go{position:fixed;bottom:18px;right:18px;background:var(--navy);color:#fff;padding:6px 12px;border-radius:10px;font:600 13px ui-monospace,monospace;z-index:99}
@media (max-width:640px){.kb-grid{grid-template-columns:1fr}}
.kb-sel td{background:color-mix(in srgb,var(--royal) 12%,transparent)!important}.kb-sel td:first-child{box-shadow:inset 3px 0 0 var(--accent)}
html[data-theme=dark] .status-strip .n,html[data-theme=dark] .totals tr.grand td,html[data-theme=dark] [style*="color:var(--navy)"]{color:#eef3fb!important}
html[data-theme=dark] svg.barcode{background:#fff;border-radius:6px;padding:2px}
html[data-theme=dark] .scanbar{background:linear-gradient(90deg,#13254a,var(--card))}
html[data-theme=dark] .tabs a.active,html[data-theme=dark] .seg .btn.active,html[data-theme=dark] .method input:checked+span{background:var(--royal);color:#fff;border-color:var(--royal)}
/* appointments & booking */
.tag.appt-requested{background:#fff7ed;color:#9a3d00}.tag.appt-confirmed{background:#ecfdf5;color:#166534}.tag.appt-declined,.tag.appt-cancelled,.tag.appt-no_show{background:#fef2f2;color:#991b1b}.tag.appt-completed{background:#f1f5f9;color:#334155}
html[data-theme=dark] .tag.appt-requested{background:#2e1f0c;color:#fdba74}html[data-theme=dark] .tag.appt-confirmed{background:#0f2a1c;color:#86efac}html[data-theme=dark] .tag.appt-declined,html[data-theme=dark] .tag.appt-cancelled,html[data-theme=dark] .tag.appt-no_show{background:#321317;color:#fca5a5}html[data-theme=dark] .tag.appt-completed{background:#1b2638;color:var(--ink)}
.slot-days{display:grid;gap:14px}.slot-day h3{margin:0 0 6px;font-size:14px}.slot-grid{display:flex;flex-wrap:wrap;gap:8px}
.slot{position:relative}.slot input{position:absolute;opacity:0;pointer-events:none}.slot span{display:inline-block;padding:8px 12px;border:1px solid var(--line);border-radius:10px;font-weight:600;font-size:14px;cursor:pointer;background:var(--white,#fff);min-width:92px;text-align:center}
.slot input:checked+span{background:var(--blue);border-color:var(--blue);color:#fff}.slot input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}.slot.full span{opacity:.4;text-decoration:line-through;cursor:not-allowed}
.loc-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}.loc-pick a{display:block;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--white,#fff);color:var(--ink);text-decoration:none}.loc-pick a.on{border-color:var(--blue);box-shadow:inset 0 0 0 2px var(--blue)}
.appt-row.focus td{background:color-mix(in srgb,var(--accent) 10%,transparent)}
.appt-actions details summary{cursor:pointer;list-style:none}.appt-actions details[open]{background:var(--light);border-radius:10px;padding:8px;margin-top:6px}
