/* IT Ops: map, drawer, detail pages. Palette from app.css. */
.wrap.full { max-width: none; margin: 0; padding: 0; }
.flash { margin: 14px 28px 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.flash.error { border-color: #e3c4b9; background: #fbf1ed; color: var(--danger); }
.flash.ok { border-color: #cfdccf; background: #f1f6f0; color: var(--sage-dk); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.btn { display: inline-block; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
       background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--sage); border-color: var(--sage); color: #fff; }
.btn.primary:hover { background: var(--sage-dk); }
.btn.danger { color: var(--danger); }
.btn.vault { border-color: #cdd7e2; color: var(--blue); }
.btn.big { padding: 10px 18px; font-size: 15px; }

/* map toolbar */
.mapbar { display: flex; gap: 10px; align-items: center; padding: 12px 28px; border-bottom: 1px solid var(--line);
          background: var(--surface); flex-wrap: wrap; }
.mapbar input[type=search] { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit;
                             width: 280px; background: var(--bg); }
.legend { display: flex; gap: 14px; margin-left: auto; color: var(--ink-soft); font-size: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--ink-soft); }
.legend i.tailnet { border-top: 2px dashed var(--blue); }
.legend i.app { border-top: 2px dotted var(--amber); }
.legend i.vm { border-top: 1.5px solid #b9b5ab; }
.legend b { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.legend b.needs { background: var(--amber); }

.mapwrap { position: relative; height: calc(100vh - 56px - 58px); overflow: hidden; background: var(--bg); }
#map { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
#map:active { cursor: grabbing; }

.lane { stroke: var(--line); }
.lane-0 { fill: #fbfaf7; } .lane-1 { fill: #f4f3ef; }
.lane-label { fill: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.edge line { stroke: #8f8b82; stroke-width: 1.4; opacity: .55; }
.edge.k-tailnet line { stroke: var(--blue); stroke-dasharray: 6 4; }
.edge.k-app line { stroke: var(--amber); stroke-dasharray: 2 4; stroke-width: 1.8; }
.edge.k-vm line { stroke: #b9b5ab; stroke-width: 1.1; }
.edge.k-internet line { stroke: #a7a399; }
.edge-label { fill: var(--ink-soft); font-size: 10px; text-anchor: middle; opacity: 0; }
.focusing .edge { opacity: .25; }
.focusing .edge.hot { opacity: 1; }
.focusing .edge.hot line { opacity: 1; stroke-width: 2.2; }
.focusing .edge.hot .edge-label { opacity: 1; }

.node { cursor: pointer; }
.node .box { fill: var(--surface); stroke: var(--line); stroke-width: 1;
             filter: drop-shadow(0 1px 2px rgba(31,35,48,.07)); transition: stroke .12s; }
.node:hover .box, .node:focus .box { stroke: var(--blue); stroke-width: 1.6; }
.node:focus { outline: none; }
.node .stripe { fill: var(--muted); }
.node.st-ok .stripe { fill: var(--sage); }
.node.st-watch .stripe { fill: var(--amber); }
.node.st-down .stripe { fill: var(--danger); }
.node.st-planned .box { stroke-dasharray: 5 3; stroke: var(--blue); }
.node.st-planned .stripe { fill: var(--blue); }
.node.st-offline .box { fill: #f1efea; }
.node.kind-container .box { fill: #fcfbf8; }
.n-kind { fill: var(--muted); font-size: 8.5px; font-weight: 600; letter-spacing: .06em; }
.n-name { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.needs { fill: var(--amber); }
.lock { fill: var(--blue); font-size: 9px; }
.node.dim { opacity: .2; }
.node.match .box { stroke: var(--sage-dk); stroke-width: 2.2; }

/* hover card */
.tip { position: absolute; z-index: 5; width: 310px; background: var(--surface); border: 1px solid var(--line);
       border-radius: 12px; box-shadow: 0 6px 28px rgba(31,35,48,.12); padding: 12px 14px; pointer-events: none; font-size: 12.5px; }
.tip-kind { color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tip-name { font-weight: 600; font-size: 14px; margin: 2px 0 4px; }
.tip-role { color: var(--ink-soft); margin-bottom: 6px; }
.tip dl, .drawer dl { display: grid; grid-template-columns: 74px 1fr; gap: 3px 10px; margin: 6px 0; }
.tip dt, .drawer dt { color: var(--muted); }
.tip dd, .drawer dd { margin: 0; word-break: break-word; }
.tip-needs { margin-top: 6px; color: #8a6a32; background: #faf4e8; border-radius: 6px; padding: 6px 8px; }
.tip-hint { margin-top: 8px; color: var(--muted); font-size: 11px; }

/* drawer */
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100%; background: var(--surface);
          border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(31,35,48,.08); z-index: 6; overflow-y: auto; }
.drawer-close { position: absolute; top: 12px; right: 12px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.drawer-body { padding: 22px 22px 30px; }
.drawer h2 { font-size: 18px; margin: 4px 0 6px; }
.drawer h3 { margin-top: 18px; }
.drawer .role { color: var(--ink-soft); margin: 0 0 8px; }
.drawer .acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.drawer .notes { white-space: pre-wrap; margin: 0; }
.drawer .needs-text { background: #faf4e8; color: #8a6a32; padding: 8px 10px; border-radius: 8px; margin: 0; }
.drawer .nbrs { padding-left: 18px; margin: 0 0 16px; }
.drawer .src { margin-top: 14px; }
.sensitive { background: #f2f5f8; border: 1px solid #dde4ec; border-radius: 8px; padding: 10px; }

/* detail page */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid2 .wide { grid-column: 1 / -1; }
label { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 500; margin-bottom: 4px; }
input[type=text], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
                                      font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 80px; resize: vertical; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline select, .inline input[type=text] { width: auto; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #eef1ec; color: var(--sage-dk); }
.pill.watch { background: #faf4e8; color: #8a6a32; } .pill.down { background: #fbf1ed; color: var(--danger); }
.pill.planned { background: #edf1f5; color: var(--blue); } .pill.unknown, .pill.offline { background: #f1efea; color: var(--muted); }
.login-card { text-align: center; margin-top: 80px; }

@media screen and (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .mapbar input[type=search] { width: 100%; }
  .legend { margin-left: 0; }
}

.node.live-down .box { stroke: var(--danger); stroke-width: 2.2; }
.node.live-down .n-name { fill: var(--danger); }
.steps { margin: 0; padding-left: 22px; } .steps li { margin-bottom: 8px; }
details > summary { list-style: none; cursor: pointer; } details > summary::-webkit-details-marker { display: none; }
.nav { flex-wrap: wrap; }
