/* WireMap Studio RC22 — dashboard layout, navigation & crisp cable-only view */
:root{--wm22-primary:#1d4ed8;--wm22-navy:#142437;--wm22-text:#14283d;--wm22-sub:#65778e;--wm22-line:#e2eaf3;--wm22-bg:#f4f7fb;--wm22-radius:14px}
body{background:var(--wm22-bg)}
.app{padding:16px;gap:16px;align-items:flex-start}
.sidebar{width:268px!important;min-width:268px!important;top:16px;height:calc(100vh - 32px);position:sticky;border-radius:17px;background:#122238!important;border:1px solid #223852;box-shadow:0 14px 30px #182b4814}
.brand{padding:16px 17px;border-bottom:1px solid #2a3e56;height:auto}.brand-icon{background:#2563eb;border-radius:11px}
.brand strong{font-size:17px}.brand small{font-size:10px;color:#9fb2cb;letter-spacing:0}
.sidebar-scroll{padding:8px 12px 16px}.side-section{padding:12px 3px;border-color:#2a3e56}
.building-block{margin-bottom:9px;padding:10px;border-radius:11px}.building-block strong{font-size:13px}
.new-project-btn{min-height:39px}.floor-line select,.small-square{min-height:40px}
.quick-section{padding:8px 10px;margin:10px 0 8px;border-radius:10px}.quick-section summary{font-size:11px;color:#a9bfd8}
.nav-category{border-bottom:1px solid #283c53!important;margin:2px 0}
.nav-category>summary{display:grid!important;grid-template-columns:minmax(0,1fr) 18px!important;grid-template-rows:auto auto;align-items:center!important;gap:2px 9px!important;padding:13px 11px!important;min-height:60px!important;border-radius:10px!important;cursor:pointer}
.nav-category>summary>.category-label{grid-column:1;grid-row:1;display:block;font-size:13px;line-height:1.35;font-weight:800;color:#eaf1fb}
.nav-category>summary>small{grid-column:1;grid-row:2;display:block!important;color:#8da3bf;font-size:11px;line-height:1.3;margin:0}
.nav-category>summary>.category-arrow{grid-column:2;grid-row:1 / 3;margin:auto!important;font-size:16px;color:#9eb0c6}
.nav-category>summary:hover{background:#1d324d!important}.nav-category[open]>summary{background:#244362!important;box-shadow:inset 3px 0 0 #6fa8ff}
.nav-category>.category-body{padding:8px 5px 16px!important}.category-subheading{padding:9px 2px 7px;color:#9db2cc;font-size:11px;letter-spacing:0;margin:0}
.tool-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.tool{min-height:62px;border-radius:10px;gap:5px}.tool span{font-size:20px}
.device-types{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.device-type{min-height:42px;padding:9px 8px;font-size:11px}
.side-action{width:100%;padding:10px 9px;min-height:39px;line-height:1.35;font-size:12px;border-radius:9px}.side-action>span{font-size:16px;flex:0 0 22px}
.sidebar-foot{padding:12px 14px;font-size:11px;min-height:54px}.sidebar-foot small{font-size:10px}
.workspace{min-width:0;gap:12px!important}
.header,.building-dashboard,.workflow-toolbar,.stats,.cable-visibility,.editor-zone,.footer{margin:0!important;border:1px solid var(--wm22-line);background:#fff;box-shadow:0 3px 14px #203b5909;border-radius:15px}
.header{padding:16px 18px;min-height:76px;align-items:center;flex-wrap:wrap}
.breadcrumb{font-size:11px;color:#8594a8;margin-bottom:6px}
.header h1{font-size:21px;letter-spacing:-.65px;color:var(--wm22-text)}
.header .proto{background:#eaf1ff;color:#245cc2;border-radius:7px;font-size:10px;padding:5px 7px}
.header-actions{gap:8px;flex-wrap:wrap}.search{width:min(310px,23vw);min-width:205px;min-height:40px;border-radius:10px}
.header .btn,.top-overflow>summary{min-height:40px;border-radius:10px;padding:8px 12px}.btn.primary{background:#2563eb;color:#fff;border-color:#2563eb}
#btn-ui-mode{white-space:nowrap}
.building-dashboard{padding:14px 17px!important}
.dash-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.dash-title strong{font-size:14px;color:var(--wm22-text)}.dash-title small{display:inline!important;font-size:11px;color:#7c8ca2;margin-left:8px}
.dash-controls{display:grid!important;grid-template-columns:minmax(120px,1.25fr) minmax(95px,1fr) minmax(120px,1.25fr) auto auto auto!important;gap:8px;align-items:end!important}
.dash-controls label{min-width:0;gap:5px;font-size:11px;color:#6b7f97;font-weight:700}
.dash-controls select{width:100%;min-width:0;min-height:39px!important;font-size:12px;border-radius:10px;padding:0 10px}
.dash-controls button{white-space:nowrap;min-height:39px!important;font-size:12px}
.dash-metadata{margin-top:8px!important;background:#f8fafd;border-color:#ebf0f6;padding:8px 12px!important;border-radius:9px;font-size:11px;line-height:1.45}
.workflow-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 16px!important;min-height:56px}
.workflow-caption{margin:0!important;min-width:155px}.workflow-caption strong{font-size:13px;color:#263e5a}.workflow-caption span{margin-top:2px;font-size:11px}
.workflow-actions{display:flex;flex-wrap:wrap;gap:7px}
.flow-btn{border-radius:9px;min-height:37px!important;padding:8px 12px;font-size:12px;font-weight:750}
.flow-help{border-radius:9px;min-height:37px!important;font-size:12px}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:10px!important}
.wm22-stats-heading{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap}
.stat{padding:9px 13px;border:1px solid #edf1f6;border-radius:11px;box-shadow:none;min-height:66px;gap:11px;justify-content:flex-start}
.stat-ico{width:39px;height:39px;min-width:39px;border-radius:10px;font-size:19px}.stat strong{font-size:23px;line-height:1.15;color:#223b57}.stat small{font-size:11px;margin-bottom:2px}
.cable-visibility{padding:12px 14px!important;display:block!important}
.cable-vis-head{display:flex;align-items:center;justify-content:space-between;gap:7px;margin:0 0 9px!important}
.cable-vis-head strong{font-size:13px;color:#273e5b}.cable-vis-head small{display:inline;font-size:11px;color:#78899d;margin-left:9px}
.cable-vis-head>div{min-width:0}.cable-vis-list-btn{min-height:33px!important;padding:6px 10px!important;font-size:11px}
.cable-vis-options{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:7px;margin:0!important;padding:1px 0 8px;scrollbar-width:thin}
.cable-vis-chip{flex:0 0 auto;min-height:36px!important;border-radius:9px;padding:6px 10px!important;gap:6px;font-size:11px;border-left-width:3px}
.cable-vis-chip.active{background:#e8f1ff;border-color:#93b4f0;box-shadow:none}
.cable-vis-chip .cable-count{height:19px;min-width:20px;font-size:10px}
.cable-vis-foot{margin:3px 0 0!important;padding-top:8px!important;line-height:1.4}
.cable-vis-foot strong{font-size:11px}.cable-vis-note{font-size:10px;color:#7b8da4}
.cable-vis-empty{margin:8px 0 0!important;font-size:11px}
.wm22-editor-label{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:2px 3px 0;color:#3f546d}
.wm22-editor-label>div{display:flex;align-items:center;gap:8px}.wm22-editor-label strong{font-size:13px}.wm22-editor-label small,.wm22-drawing-tip{font-size:11px;color:#8b9ab0}
.wm22-workspace-dot{width:8px;height:8px;border-radius:50%;background:#2467db}
.editor-zone{margin:0!important;min-height:560px;overflow:hidden}
.canvas-bar{padding:12px 14px;gap:12px;align-items:center}.canvas-heading{gap:9px}.canvas-heading strong{font-size:13px}.canvas-heading small{font-size:11px;color:#6c8099}
.canvas-bar-right{gap:6px;font-size:11px}.precision-toolbar{gap:7px}.precision-toolbar select{min-height:34px!important;border-radius:9px}
.canvas-bar .btn.tiny{min-height:33px;padding:6px 9px;font-size:11px}.edit-mode,#zoom-value{min-height:32px;padding:0 8px}
.canvas-wrap{min-height:510px;background:#f9fbff}.canvas-hint{border-radius:9px;font-size:10px;max-width:min(640px,calc(100% - 24px));pointer-events:none}
.canvas-footer{padding:10px 14px;gap:10px;flex-wrap:wrap}
.footer{border:0;background:transparent;box-shadow:none;padding:3px 0 8px!important;border-radius:0;color:#8191a7;font-size:11px}
/* Even in simple mode, users must be able to find the categorized menu and cable filter. */
body.wm-simple-mode #category-network,body.wm-simple-mode #category-backup,
body.wm-simple-mode .nav-category,body.wm-simple-mode .cable-visibility{display:block!important}
body.wm-simple-mode .dash-controls{grid-template-columns:minmax(120px,1.25fr) minmax(95px,1fr) minmax(120px,1.25fr) auto auto auto!important}
body.wm-simple-mode .stats{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.wm-simple-mode .sidebar{width:268px!important;min-width:268px!important}
/* Surface advanced functions via full mode, retaining straightforward entry points. */
body.wm-simple-mode #category-network .side-action{display:flex!important}
body.wm-simple-mode #category-backup .side-action{display:flex!important}
/* Make key settings obvious in both modes; advanced tools still appear on full mode. */
.nav-category .category-body .side-action:focus-visible,.tool:focus-visible,.flow-btn:focus-visible,.cable-vis-chip:focus-visible{outline:3px solid #92bcff;outline-offset:2px}
/* Admin/Login: one consistent design system instead of inherited conflicting overrides. */
.admin-body{background:var(--wm22-bg)}.admin-nav{background:#fff!important;color:#20344d!important;width:252px!important;min-width:252px!important}
.admin-nav .nav-item{color:#36516d}.admin-nav .nav-item.active,.admin-nav .nav-item:hover{background:#e8f1ff;color:#184e9c}
.admin-main{gap:12px}.admin-head,.admin-content,.admin-local-notice{border:1px solid var(--wm22-line);border-radius:15px;background:#fff;box-shadow:0 3px 14px #203b5909}
.admin-head{padding:18px 22px}.admin-head h1{font-size:22px}.admin-content{padding:20px}
.admin-content .panel,.admin-content .kpi{border-radius:13px}.login-card{border-radius:18px!important;border:1px solid var(--wm22-line);box-shadow:0 16px 36px #203b591a}
/* dark theme retains contrast for tool chrome, 2D map stays light */
html[data-theme="dark"] .header,html[data-theme="dark"] .building-dashboard,html[data-theme="dark"] .workflow-toolbar,html[data-theme="dark"] .stats,html[data-theme="dark"] .cable-visibility,html[data-theme="dark"] .editor-zone{background:#17212d;color:#e7eef9;border-color:#314257}
html[data-theme="dark"] .dash-title strong,html[data-theme="dark"] .cable-vis-head strong,html[data-theme="dark"] .stat strong,html[data-theme="dark"] .workflow-caption strong,html[data-theme="dark"] .header h1{color:#e7eef9}
html[data-theme="dark"] .stat{background:#1b2938;border-color:#30445a}
html[data-theme="dark"] .cable-vis-chip{background:#24344a;color:#dbeafe;border-color:#3d5473}
html[data-theme="dark"] .cable-vis-chip.active{background:#244573;border-color:#6ea2ed;color:#fff}
@media (max-width:1420px){
 .dash-controls,body.wm-simple-mode .dash-controls{grid-template-columns:repeat(3,minmax(0,1fr)) repeat(3,auto)!important}
 .workflow-toolbar{align-items:flex-start;flex-direction:column;gap:8px}
 .header-actions .search{width:min(310px,28vw)}
}
@media (max-width:1160px){
 .app{padding:10px;gap:10px}
 .sidebar,body.wm-simple-mode .sidebar{width:245px!important;min-width:245px!important}
 .dash-controls,body.wm-simple-mode .dash-controls{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 .dash-controls button{width:100%}
 .stats,body.wm-simple-mode .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .canvas-bar-right{justify-content:flex-start}
}
@media (max-width:900px){
 .app{display:block;padding:10px}
 .sidebar,body.wm-simple-mode .sidebar{position:relative;width:100%!important;min-width:0!important;height:auto;top:0;margin-bottom:12px}
 .sidebar-scroll{max-height:none}
 .nav-category>summary{min-height:52px!important}
 .workspace{gap:10px}.header{padding:14px 16px}.header-actions{width:100%;justify-content:flex-start}
 .header-actions .search{width:min(450px,100%)}
 .dash-title small{display:block!important;margin:4px 0 0}
 .canvas-wrap{min-height:420px}
 .admin-nav{position:relative;width:100%!important;min-width:0!important;min-height:auto}
}
@media (max-width:650px){
 .header h1{font-size:19px}
 .dash-controls,body.wm-simple-mode .dash-controls{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .dash-controls label:nth-child(3){grid-column:1/-1}
 .workflow-actions{width:100%}.flow-btn{flex:1 1 calc(50% - 5px)}
 .stats,body.wm-simple-mode .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .stat{padding:9px;min-height:60px;gap:8px}.stat-ico{width:32px;height:32px;min-width:32px;font-size:16px}
 .stat strong{font-size:20px}.stat small{font-size:10px}
 .cable-vis-head{align-items:flex-start}.cable-vis-head small{display:block;margin:3px 0 0}
 .cable-vis-list-btn{width:auto!important}.cable-vis-foot{display:block}
 .wm22-editor-label small,.wm22-drawing-tip{display:none}
 .canvas-heading{min-width:0}.canvas-heading small{display:none}
 .canvas-hint{font-size:10px}
}
