/* Workspace v2: a shared navigation spine, with the network map as work area. */
:root { --sm-shell-height: 64px; }
.sm-appbar { position:fixed; inset:0 0 auto; height:var(--sm-shell-height); z-index:2600; display:flex; align-items:center; gap:24px; padding:0 24px; background:#10212b; border-bottom:1px solid #35505e; box-shadow:0 3px 12px #0002; }
.sm-appbar[hidden] { display:none; }
.sm-brand { display:flex; align-items:center; gap:10px; min-height:44px; color:var(--text); font-size:16px; font-weight:700; text-decoration:none; white-space:nowrap; }
.sm-brand img { width:88px; height:auto; border-radius:4px; background:#eff6fa; padding:4px 6px; }
.sm-global-nav { display:flex; align-items:center; gap:4px; flex:1; }
.sm-nav-link { display:flex; align-items:center; gap:7px; min-height:40px; padding:8px 10px; color:var(--muted); text-decoration:none; border-radius:7px; font-size:12px; white-space:nowrap; }
.sm-nav-link .sm-icon { width:16px; height:16px; }
.sm-nav-link:hover { background:#203540; color:var(--text); }
.sm-nav-link[aria-current="page"] { background:#263e49; color:#edf4f6; box-shadow:inset 0 -2px #8edaf2; }
.sm-current-screen { display:none; font-size:13px; color:var(--muted); min-width:0; }
.sm-appbar .sm-switcher { width:auto; flex:none; display:flex; align-items:center; gap:8px; border:1px solid #45606d; background:transparent; color:var(--text); min-height:38px; padding:7px 12px; cursor:pointer; white-space:nowrap; font:600 12px var(--sm-font); }
.sm-switcher kbd { font:11px var(--sm-font); color:var(--muted); border:1px solid #405863; border-radius:4px; padding:1px 4px; margin-left:3px; }
body.sm-workspace { padding-top:var(--sm-shell-height); }
body.sm-workspace #app { height:calc(100vh - var(--sm-shell-height)); height:calc(100dvh - var(--sm-shell-height)); }
body.sm-workspace #map-search { top:calc(var(--sm-shell-height) + 18px); }
@media(min-width:821px){body.sm-workspace #cluster-btn{left:calc(var(--sm-sidebar-width) + 14px)}}
@media(min-width:821px){body.sm-workspace[data-sm-page="radio"] #status-msg{bottom:62px}}
body.sm-workspace[data-sm-layout="report"] > header { top:var(--sm-shell-height); padding:24px 32px; gap:12px; border-bottom:0; background:var(--bg); }
body.sm-workspace[data-sm-layout="report"] > header h1 { font-size:26px; letter-spacing:-.025em; }
body.sm-workspace[data-sm-layout="report"] > header h1 small { font-size:13px; font-weight:400; letter-spacing:0; margin-top:8px; }
body.sm-workspace > header > a.hbtn { display:none; }
body.sm-workspace[data-sm-layout="report"] main { padding:4px 32px 40px; }
body.denied > header > button, body.denied > header > .seg { display:none; }
body.sm-workspace .sm-map-nav, body.sm-workspace #btn-back { display:none; }
body.sm-workspace .topbar .brand-badge, body.sm-workspace #sidebar-head .brand-badge { display:none; }
body.sm-workspace .topbar, body.sm-workspace #sidebar-head { background:#172a35; padding:16px 18px; }
body.sm-workspace .topbar h1, body.sm-workspace #sidebar-head h1 { letter-spacing:0; font-size:18px; }
body.sm-workspace #sidebar-scroll { gap:16px; }
.sm-section-title { margin:8px 0 10px; display:flex; align-items:center; justify-content:space-between; gap:8px; color:var(--text); font-size:13px; font-weight:650; }
.sm-summary-block { padding:0 0 14px; border-bottom:1px solid var(--line2); }
.sm-summary-block #summary { gap:6px; }
.sm-summary-block .stat { padding:10px; }
.sm-summary-block .stat b { font-size:21px; }
.sm-summary-block .stat span { font-size:10.5px; }
.sm-summary-more { grid-column:1/-1; margin-top:2px; }
.sm-summary-more > summary { cursor:pointer; padding:10px 0 2px; color:var(--muted); font-size:12px; }
.sm-summary-more > div { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding-top:10px; }
button.stat, button.card, button.qcard { width:100%; color:var(--text); text-align:left; font:inherit; appearance:none; }
.card > .n, .card > .l { display:block; }
body[data-sm-layout="report"] #cards button:focus-visible { outline-offset:-4px; }
button.stat:hover, button.card:hover, button.qcard:hover { border-color:var(--sm-focus); }
button.stat .c-green, button.card .c-green { color:var(--green); }
.sm-context { border:1px solid var(--line2); border-radius:8px; padding:10px 12px; font-size:12px; color:var(--muted); }
.sm-context summary { color:var(--text); cursor:pointer; font-weight:600; }
.sm-context p { margin:8px 0 0; }
.sm-report-intro { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 12px; }
body[data-sm-layout="report"] #cards { margin:8px 0 24px; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:0; border:1px solid var(--line2); border-radius:12px; overflow:hidden; }
body[data-sm-layout="report"] #cards > .card, body[data-sm-layout="report"] #cards > .qcard { border:0; border-right:1px solid var(--line2); border-bottom:1px solid var(--line2); border-radius:0; background:var(--panel); padding:16px; min-height:90px; }
body[data-sm-layout="report"] #cards > .qcard.on { background:#2b2641; box-shadow:inset 0 -3px var(--accent-hi); }
body[data-sm-layout="report"] #cards > .qcard span { text-transform:none; letter-spacing:0; }
body[data-sm-page="quality"] #cards { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
body[data-sm-layout="report"] #tabs { padding-bottom:0; gap:6px; }
body[data-sm-layout="report"] #tabs button { padding:11px 16px; min-height:44px; border-radius:7px 7px 0 0; }
body[data-sm-layout="report"] #tabs button.on { background:var(--panel2); }
body[data-sm-layout="report"] #controls, body[data-sm-layout="report"] .filters { background:var(--panel); border:1px solid var(--line2); padding:14px; border-radius:10px; gap:12px; margin:14px 0; }
body[data-sm-layout="report"] .filters label { display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
body[data-sm-layout="report"] .filters select { min-width:130px; }
body[data-sm-layout="report"] .filters input[type="search"] { flex:1; min-width:160px; }
.sm-clear-filters { margin-left:auto; }
.sm-row-open, .sm-sort { appearance:none; border:0; background:transparent; color:var(--text); text-align:left; cursor:pointer; font:inherit; padding:4px 0; text-decoration:underline; text-decoration-color:#53717e; text-underline-offset:4px; }
.sm-row-open:hover { color:var(--sm-focus); }
.sm-sort { color:inherit; text-decoration:none; }
.sm-empty { padding:32px 20px!important; white-space:normal; text-align:center; color:var(--muted); }
.sm-empty strong { display:block; color:var(--text); font-weight:600; font-size:15px; margin-bottom:6px; }
.sm-empty span { display:block; max-width:60ch; margin:auto; line-height:1.6; }
.twrap { scrollbar-color:#52707e var(--panel); }
.twrap:focus-visible { outline-offset:4px; }
body[data-sm-layout="report"] h3 { text-transform:none; letter-spacing:0; font-size:14px; color:var(--text); }
body[data-sm-page="alerts"] #shadow-banner { background:#2a2440; border-color:#61537e; border-left:4px solid #b89dde; box-shadow:none; }
#drawer { box-shadow:-16px 0 48px #0004; }
body.sm-workspace #drawer { z-index:4000; }
body.sm-workspace #backdrop { z-index:3900; }
body.sm-workspace #modal { z-index:4500; }
#dhead { min-height:72px; padding:18px 20px; }
#dhead b { font-size:16px; }
#dclose { min-width:44px; min-height:44px; background:var(--panel2)!important; border:1px solid var(--line2)!important; border-radius:8px; }
#dbody { padding:20px; }
#modalbox { padding:26px; }
#modalbox h3 { font-size:20px; text-transform:none; margin-bottom:20px!important; }
#modalbox label { margin-top:14px; font-size:12px; }
#modalbox input, #modalbox select, #modalbox textarea { min-height:42px; font-size:14px; }
#modalbox .dactions button { min-height:42px; font-size:13px; padding:10px 16px; }
#m-save { background:var(--sm-action)!important; color:#fff; }
#m-err { font-size:13px; color:#ffb2ac!important; }
.sm-screen-dialog { width:min(560px,calc(100vw - 32px)); max-height:min(730px,calc(100dvh - 40px)); padding:0; border:1px solid #4a6776; border-radius:16px; color:var(--text); background:var(--panel); box-shadow:0 24px 100px #0008; overflow:auto; }
.sm-screen-dialog::backdrop { background:#041018bb; }
.sm-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 20px 10px; }
.sm-dialog-head h2 { margin:0; font-size:19px; }
.sm-icon-button { width:44px; min-height:44px; cursor:pointer; font-size:24px; background:var(--panel2); color:var(--text); border:1px solid var(--line2); }
.sm-screen-search { display:flex; align-items:center; gap:10px; margin:0 20px 8px; padding:0 12px; background:#0d1c25; border:1px solid var(--line2); border-radius:9px; }
.sm-screen-search input { width:100%; padding:14px 0; font:16px var(--sm-font); color:var(--text); border:0; outline:0; background:transparent; }
.sm-screen-search:focus-within { outline:3px solid var(--sm-focus); outline-offset:2px; }
.sm-screen-search input:focus-visible { outline:0; }
.sm-screen-results { padding:2px 10px 12px; }
.sm-route-group { font-size:12px; color:var(--muted); margin:12px 12px 6px; font-weight:500; }
.sm-route { display:flex; align-items:center; gap:14px; padding:12px; border-radius:8px; color:var(--text); text-decoration:none; }
.sm-route .sm-icon { width:22px; height:22px; color:#9ac8db; }
.sm-route > span { font-size:14px; font-weight:600; }
.sm-route small { display:block; margin-top:2px; font-size:12px; color:var(--muted); font-weight:400; }
.sm-route:hover, .sm-route:focus-visible { background:var(--panel2); }
.sm-route[aria-current="page"] { box-shadow:inset 3px 0 #8edaf2; background:#203541; }
.sm-dialog-note { font-size:11px; color:var(--muted); margin:0; padding:12px 20px; border-top:1px solid var(--line2); }
.sm-no-results { padding:24px; color:var(--muted); font-size:14px; }
.sm-panel-toggle { display:none; }
@media(max-width:1350px){.sm-appbar{gap:16px}.sm-brand span{display:none}.sm-nav-link{padding-inline:8px;gap:5px}.sm-switcher kbd{display:none}}
@media(max-width:1120px){.sm-global-nav{display:none}.sm-current-screen{display:block;flex:1}.sm-brand span{display:block}}
@media(max-width:820px){
  :root{--sm-shell-height:60px}
  .sm-appbar{padding:0 16px;gap:12px}.sm-brand img{width:72px}.sm-brand span{display:none}.sm-appbar .sm-switcher{min-height:44px;padding:8px 10px}.sm-switcher .sm-icon{width:17px}
  .sm-current-screen{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.sm-workspace[data-sm-layout="report"] > header{padding:20px 16px 14px;position:static}
  body.sm-workspace[data-sm-layout="report"] > header h1{font-size:24px;flex-basis:100%;min-width:0}
  body.sm-workspace[data-sm-layout="report"] main{padding:0 16px 32px}
  body[data-sm-layout="report"] #cards,body[data-sm-page="quality"] #cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  body[data-sm-layout="report"] #cards>.card,body[data-sm-layout="report"] #cards>.qcard{padding:14px;min-height:86px}
  body[data-sm-layout="report"] #controls,body[data-sm-layout="report"] .filters{gap:10px;padding:12px}
  body[data-sm-layout="report"] .filters label{flex:1;min-width:110px}.filters select{width:100%}
  .sm-clear-filters{margin-left:0;min-height:44px}.sm-row-open{min-height:44px}
  body.sm-workspace #mobile-menu-btn,body.sm-workspace #map-search{top:calc(var(--sm-shell-height) + 12px)}
  body.sm-workspace[data-sm-page="radio"] #sidebar{top:0;height:100dvh}
  body.sm-workspace[data-sm-page="fiber"] #sidebar{top:0;height:100dvh}
  body.sm-workspace[data-sm-page="concentrators"] > header{padding:12px 16px;gap:8px}
  body.sm-workspace[data-sm-page="concentrators"] > header h1{font-size:18px;min-width:0;flex-basis:100%}
  body.sm-workspace[data-sm-page="concentrators"] > header h1 small{font-size:11px}
  body.sm-workspace[data-sm-page="concentrators"] #side{display:none;max-height:none;height:100%;inset:0;z-index:1500;padding-bottom:28px}
  body.sm-workspace[data-sm-page="concentrators"].sm-panel-open #side{display:block}
  body.sm-workspace[data-sm-page="concentrators"].sm-panel-open #cmap-search,body.sm-workspace[data-sm-page="concentrators"].sm-panel-open #c-search-count{display:none}
  .sm-panel-toggle{display:inline-block}
  #modalbox{padding:20px}#modalbox input,#modalbox select,#modalbox textarea{font-size:16px}
}
@media print{.sm-appbar,.sm-screen-dialog{display:none!important}body.sm-workspace{padding-top:0}body.sm-workspace[data-sm-layout="report"] > header{position:static}.twrap{outline:none}}

/* Operational forms inherit the reviewed Cartografia operacional tokens. */
.sm-action-form { margin:16px 0; padding:20px; background:var(--panel2,#1b2e39); border:1px solid var(--line2,#304954); border-left:3px solid #8edaf2; border-radius:10px; }
.sm-action-form h3 { margin:0 0 8px; font-size:20px; }
.sm-action-context { color:var(--text,#edf4f6); font-weight:600; overflow-wrap:anywhere; }
.sm-action-help,.sm-action-form small { color:var(--muted,#afc1cc); font-size:13px; line-height:1.5; }
.sm-action-form label { display:block; margin:18px 0 6px; font-size:14px; font-weight:600; }
.sm-action-form input,.sm-action-form textarea,.sm-action-form select { display:block; box-sizing:border-box; width:100%; min-width:0; padding:12px; border:1px solid var(--line2,#304954); border-radius:8px; background:#0d171f; color:#edf4f6; font:16px var(--sm-font,system-ui); }
.sm-action-form textarea { resize:vertical; }
.sm-action-form small { display:block; margin-top:6px; }
.sm-action-buttons { display:flex; flex-wrap:wrap; gap:10px; margin-top:16px; }
.sm-action-buttons button { min-height:44px; padding:10px 14px; border:1px solid #496371; border-radius:8px; background:#14242e; color:#edf4f6; cursor:pointer; font:inherit; }
.sm-action-buttons button[type=submit] { background:#18623f; border-color:#408b62; }
.sm-action-buttons button:disabled { cursor:default; opacity:.65; }
.sm-action-form :focus-visible { outline:3px solid #8edaf2; outline-offset:3px; }
.sm-action-error { color:#ffb3ab; font-size:14px; line-height:1.5; }
.sm-action-error:empty { display:none; }
.dactions[hidden] { display:none!important; }
#modalbox .sm-shadow-confirm { display:flex; align-items:flex-start; gap:10px; margin:14px 0; line-height:1.5; }
#modalbox .sm-shadow-confirm input { width:20px; height:20px; flex:0 0 20px; margin:2px 0; }
@media(max-width:480px){.sm-action-form{padding:14px}.sm-action-buttons{flex-direction:column}.sm-action-buttons button{width:100%}}
@media print{.sm-action-form{display:none}}
