
/* WireMap Studio RC21 - simplified workspace & clean alignment */
:root{
  --wm21-bg:#f5f7fb;
  --wm21-surface:#ffffff;
  --wm21-border:#dfe7f0;
  --wm21-muted:#6d8096;
  --wm21-ink:#15263b;
  --wm21-accent:#2563eb;
  --wm21-accent-soft:#eaf1ff;
  --wm21-shadow:0 10px 28px rgba(15,35,64,.06);
  --wm21-radius:14px;
}
body{background:var(--wm21-bg);color:var(--wm21-ink)}
/* Editor */
.app{gap:18px;padding:18px;align-items:flex-start}
.sidebar{position:sticky;top:18px;height:calc(100vh - 36px);border-radius:20px;box-shadow:var(--wm21-shadow);overflow:hidden;background:linear-gradient(180deg,#112238 0%,#182b43 100%);width:292px;min-width:292px}
.brand{height:auto;padding:20px 18px 18px}
.brand strong{font-size:18px}.brand small{font-size:10px;line-height:1.5}
.sidebar-scroll{padding:8px 14px 18px}
.side-section,.nav-category{border-bottom:1px solid rgba(255,255,255,.08)}
.nav-category{padding:0}
.nav-category>summary{padding:14px 4px;list-style:none;display:flex;align-items:flex-start;gap:10px;cursor:pointer;color:#e9f0fa}
.nav-category>summary::-webkit-details-marker{display:none}
.nav-category>summary .category-label{font-weight:800;font-size:13px}
.nav-category>summary small{display:block;color:#8ea3bf;font-size:11px;margin-top:2px}
.nav-category>summary .category-arrow{margin-left:auto;color:#8ea3bf;transition:transform .2s ease}
.nav-category[open]>summary .category-arrow{transform:rotate(180deg)}
.category-body{padding:0 0 14px}
.category-subheading{font-size:11px;font-weight:800;color:#90a4bd;margin:10px 0 10px}
.tool-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.tool,.device-type,.side-action,.quick-link,.new-project-btn{border-radius:10px}
.tool{min-height:64px;padding:8px 6px}
.tool span{font-size:21px}
.device-types{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.side-action{padding:10px 8px;line-height:1.35}
.toggle-row{margin:10px 0 0;line-height:1.45}
.rc20-locks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.rc20-lock{min-height:36px;border-radius:9px}
.sidebar-hint,.rc20-lock-hint{margin-top:10px;padding:10px;border-radius:10px;background:rgba(255,255,255,.05);color:#9eb0c5;font-size:11px;line-height:1.6}
.quick-section{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);padding:10px 12px;border-radius:14px;margin:10px 0 14px}
.quick-section summary{cursor:pointer;color:#e6eef8;font-weight:700;list-style:none}
.quick-section summary::-webkit-details-marker{display:none}
.quick-label{display:inline-flex;align-items:center;padding:2px 8px;background:#264c80;color:#fff;border-radius:999px;font-size:10px}
.quick-link{padding:10px 12px;margin-top:8px;background:#192d45;border:1px solid #324964}
.quick-link strong{font-size:13px}.quick-link small{font-size:11px;color:#9ab0c9}
.quick-help{width:100%;margin-top:10px;border-radius:10px;border:1px dashed #5878a2;background:transparent;color:#dbe7f7;padding:10px 12px}
.sidebar-foot{height:auto;min-height:54px;padding:14px 16px;background:rgba(0,0,0,.12)}
.workspace{display:flex;flex-direction:column;gap:14px}
.header,.building-dashboard,.cable-visibility,.workflow-toolbar,.stats,.editor-zone,.footer{border-radius:18px;box-shadow:var(--wm21-shadow);border:1px solid var(--wm21-border);background:var(--wm21-surface)}
.header{padding:18px 20px;gap:16px;flex-wrap:wrap}
.title-area h1{font-size:24px;letter-spacing:-.9px}
.breadcrumb{font-size:12px}
.header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:auto}
.search{width:min(360px,100%);min-width:250px;border-radius:12px;min-height:46px}
.search input{font-size:13px}
.btn,.flow-btn,.primary-btn{border-radius:11px;min-height:42px;padding:10px 14px}
.btn.tiny{min-height:34px;padding:6px 10px;border-radius:10px}
.btn.line{background:#fff}
#btn-ui-mode{background:#f8fbff;border-color:#d7e2f2;color:#214d90}
.top-overflow{position:relative}
.top-overflow>summary{list-style:none;display:flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:0 14px;border:1px solid #dce5ef;border-radius:11px;background:#fff;cursor:pointer;font-weight:700;color:#38506b}
.top-overflow>summary::-webkit-details-marker{display:none}
.top-overflow-body{right:0;top:calc(100% + 8px);min-width:290px;border:1px solid var(--wm21-border);border-radius:14px;box-shadow:0 18px 40px rgba(14,31,53,.12)}
.overflow-group+.overflow-group{margin-top:14px;padding-top:14px;border-top:1px solid #edf2f8}
.overflow-label{font-size:11px;font-weight:800;color:#7a8da5;margin-bottom:8px}
.building-dashboard,.cable-visibility,.workflow-toolbar{padding:16px 18px}
.dash-title,.cable-vis-head,.workflow-caption{margin-bottom:12px}
.dash-title strong,.cable-vis-head strong,.workflow-caption strong{font-size:15px}
.dash-title small,.cable-vis-head small,.workflow-caption span{display:block;color:var(--wm21-muted);font-size:12px;line-height:1.5;margin-top:4px}
.dash-controls{display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr)) auto auto auto;gap:10px;align-items:end}
.dash-controls label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#566c86;font-weight:700}
.dash-controls select,.cable-vis-select select,#selection-filter{min-height:42px;border:1px solid #d7e0ea;border-radius:11px;padding:0 12px;background:#fff}
.dash-metadata{margin-top:12px;padding:12px 14px;border-radius:12px;background:#f8fbff;border:1px solid #e6edf6;color:#56718f;font-size:12px}
.cable-vis-options{display:flex;flex-wrap:wrap;gap:8px}
.cable-vis-chip{border-radius:999px;padding:8px 12px;min-height:40px}
.cable-vis-foot{margin-top:12px;padding-top:10px;border-top:1px solid #edf2f8}
.workflow-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.workflow-actions{display:flex;flex-wrap:wrap;gap:8px}
.flow-btn{background:#fff;border:1px solid #dce5ef;color:#355171;font-weight:700}
.flow-btn.flow-select,.flow-btn:hover{background:#eef5ff;border-color:#cbdcf8}
.flow-help{min-height:42px;padding:0 14px;border-radius:11px;border:1px solid #dce5ef;background:#fff}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:14px}
.stat{border-radius:14px;padding:16px 18px;box-shadow:none;border:1px solid #edf2f7}
.stat strong{font-size:24px}
.editor-zone{margin:0;overflow:hidden}
.canvas-bar{padding:14px 16px;gap:12px;flex-wrap:wrap}
.canvas-heading{min-width:280px;flex:1}
.canvas-heading strong{font-size:14px}
.canvas-bar-right{display:flex;flex-wrap:wrap;align-items:center;gap:8px;justify-content:flex-end}
.precision-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.precision-toolbar label{display:flex;align-items:center;gap:6px;font-size:12px;color:#61758e}
.edit-mode,.group-selection-state,#zoom-value{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 10px;border-radius:10px;background:#f1f6ff;color:#3562a4;font-size:12px}
.canvas-wrap{background:#f7fafe;min-height:520px}
.canvas-hint,.trace-bar{border-radius:10px}
.canvas-footer{padding:12px 16px;gap:10px;flex-wrap:wrap}
.legend{flex-wrap:wrap;row-gap:6px}
.footer{padding:14px 18px;box-shadow:none;font-size:12px;flex-wrap:wrap}
.user-chip-sm{display:inline-flex;align-items:center;padding:8px 10px;border-radius:10px;background:#f6f9fd;color:#4a6482;border:1px solid #e5edf6}
/* Simple mode hides advanced clutter */
body.wm-simple-mode #category-network,
body.wm-simple-mode #category-backup,
body.wm-simple-mode #btn-trace,
body.wm-simple-mode #btn-export-svg,
body.wm-simple-mode #btn-local-draft,
body.wm-simple-mode #btn-assets,
body.wm-simple-mode #btn-asset-health,
body.wm-simple-mode #btn-pathways,
body.wm-simple-mode #btn-shafts,
body.wm-simple-mode #btn-risers,
body.wm-simple-mode #btn-networks,
body.wm-simple-mode #btn-global-trace,
body.wm-simple-mode #btn-trace-side,
body.wm-simple-mode #btn-pdf,
body.wm-simple-mode #btn-scale,
body.wm-simple-mode #btn-bg-align,
body.wm-simple-mode #btn-bg-drag,
body.wm-simple-mode #btn-remove-image,
body.wm-simple-mode #rc20-rectangle,
body.wm-simple-mode #rc20-wall-exact,
body.wm-simple-mode #rc20-duplicate,
body.wm-simple-mode #rc20-legend,
body.wm-simple-mode [data-tool="roompoly"],
body.wm-simple-mode [data-tool="wallchain"],
body.wm-simple-mode [data-tool="dimension"],
body.wm-simple-mode [data-tool="pillar"],
body.wm-simple-mode [data-tool="stairs"],
body.wm-simple-mode [data-tool="elevator"],
body.wm-simple-mode .rc20-lock-hint,
body.wm-simple-mode .sidebar-hint,
body.wm-simple-mode .cable-visibility,
body.wm-simple-mode #btn-align,
body.wm-simple-mode #selection-filter,
body.wm-simple-mode label[for="selection-filter"]{
  display:none !important;
}
body.wm-simple-mode .tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
body.wm-simple-mode #category-view .rc20-locks,
body.wm-simple-mode #category-view .category-subheading:nth-of-type(2),
body.wm-simple-mode #category-view .editor-grid-spacing,
body.wm-simple-mode #category-view .control-label[for="grid-spacing"]{display:none}
body.wm-simple-mode .workflow-toolbar{padding-block:14px}
body.wm-simple-mode .dash-controls{grid-template-columns:repeat(2,minmax(0,1fr)) auto;}
body.wm-simple-mode .dash-controls .btn:not(.primary){display:none}
body.wm-simple-mode .canvas-heading small{font-size:12px}
body.wm-simple-mode .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
body.wm-simple-mode .nav-category:not(#category-drawing):not(#category-devices):not(#category-cables):not(#category-view){display:none}
body.wm-simple-mode .quick-section{display:block}
body.wm-simple-mode .sidebar{width:284px;min-width:284px}
body.wm-simple-mode .building-dashboard{padding:14px 16px}
/* Admin clean layout */
.admin-body{background:var(--wm21-bg);gap:18px;padding:18px;align-items:flex-start}
.admin-nav{width:276px;min-width:276px;border-radius:20px;box-shadow:var(--wm21-shadow);background:#fff;color:#203349;padding:18px;border:1px solid var(--wm21-border);min-height:calc(100vh - 36px);position:sticky;top:18px}
.nav-brand{padding:0 4px 16px;border-bottom:1px solid #ebf0f5}.nav-brand small{color:#7890aa}
.nav-caption{margin:18px 8px 8px;color:#7d91a8;font-size:11px;font-weight:800}
.nav-item{color:#36516d;background:#f8fbff;border:1px solid transparent;padding:12px 13px;border-radius:12px;margin:4px 0}
.nav-item.active,.nav-item:hover{background:#eaf2ff;color:#17458b;border-color:#d7e4fa}
.nav-bottom{border-top:1px solid #ebf0f5;padding:16px 8px 0;color:#4f6a88}.nav-bottom a,.nav-bottom button{color:#44627f}
.admin-main{display:flex;flex-direction:column;gap:14px}
.admin-head,.admin-local-notice,.admin-content{border:1px solid var(--wm21-border);border-radius:18px;background:#fff;box-shadow:var(--wm21-shadow)}
.admin-head{padding:20px 22px}.admin-head h1{font-size:24px}.admin-local-notice{padding:14px 18px;color:#5d7290;background:#f8fbff}
.admin-content{padding:22px}
.cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.kpi,.panel{border-radius:16px;border:1px solid #eaf0f5;box-shadow:none}
.panel-head{margin-bottom:16px}
.message{border-radius:12px}
.dialog{border-radius:18px}
/* Login clean layout */
.auth-body{background:radial-gradient(circle at top,#dfe9ff,transparent 34%),linear-gradient(180deg,#f6f9ff 0%,#f1f5fa 100%)}
.login-card{border-radius:22px;box-shadow:0 22px 50px rgba(26,55,108,.12);padding:34px;border:1px solid #e6edf6}
.login-card h1{font-size:28px}.login-card>.muted{font-size:14px;line-height:1.6}
.login-card input{min-height:46px;border-radius:12px}.primary-btn{min-height:46px;border-radius:12px}
.notice{font-size:12px;line-height:1.8}
/* Responsive */
@media (max-width:1320px){
  .dash-controls{grid-template-columns:repeat(2,minmax(0,1fr)) auto auto;}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1100px){
  .app,.admin-body{display:block;padding:12px}
  .sidebar,.admin-nav{position:relative;top:0;height:auto;width:100%;min-width:0;margin-bottom:12px}
  .header-actions{width:100%;justify-content:flex-start}
  .building-dashboard,.workflow-toolbar,.cable-visibility,.editor-zone,.stats,.footer,.admin-head,.admin-content,.admin-local-notice{border-radius:16px}
}
@media (max-width:760px){
  .dash-controls{grid-template-columns:1fr !important}
  .workflow-toolbar{align-items:flex-start}
  .stats{grid-template-columns:1fr 1fr}
  .canvas-bar-right{justify-content:flex-start}
  .canvas-wrap{min-height:420px}
  .search{min-width:0;width:100%}
}
@media (max-width:520px){
  .stats{grid-template-columns:1fr}
  .tool-grid,.device-types{grid-template-columns:1fr 1fr}
  .canvas-footer,.footer{flex-direction:column;align-items:flex-start}
}
