/* RackMap — interfață */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --accent: #0e7490;
  --accent-2: #155e75;
  --accent-soft: #e0f2f7;
  --ok: #15803d; --ok-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #b91c1c; --bad-soft: #fee2e2;
  --info: #1d4ed8; --info-soft: #dbeafe;
  --end-a: #2563eb; --end-a-soft: #dbeafe;
  --end-b: #16a34a; --end-b-soft: #dcfce7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .14);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --top: 56px;
  --side: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #111a2b; --surface-2: #0f1727; --line: #1f2b40; --line-strong: #2c3b55;
    --text: #e5edf7; --text-2: #b6c3d6; --muted: #8394ad;
    --accent: #22a6c3; --accent-2: #4cc3dc; --accent-soft: #0d2f3b;
    --ok: #4ade80; --ok-soft: #0f2e1d; --warn: #fbbf24; --warn-soft: #33270b; --bad: #f87171; --bad-soft: #3a1414; --info: #93c5fd; --info-soft: #132544;
    --end-a: #60a5fa; --end-a-soft: #132544; --end-b: #4ade80; --end-b-soft: #0f2e1d;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3em; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ico-sm { width: 14px; height: 14px; vertical-align: -2px; }
.ico.warn { color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Structură ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 1.02rem; min-width: calc(var(--side) - 28px); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-mark .ico { width: 18px; height: 18px; }
.brand-mark.big { width: 46px; height: 46px; border-radius: 12px; }
.brand-mark.big .ico { width: 26px; height: 26px; }
.topsearch { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.topsearch .ico { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.topsearch input { width: 100%; padding-left: 36px; background: var(--surface-2); border-radius: 999px; }
.userchip { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--text); padding: 4px 8px 4px 4px; border-radius: 999px; }
.userchip:hover { background: var(--surface-2); text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.userchip-text { display: flex; flex-direction: column; line-height: 1.2; }
.userchip-text small { color: var(--muted); font-size: .76rem; }
.icon-btn { background: none; border: 0; color: var(--text); padding: 8px; border-radius: 8px; cursor: pointer; display: none; }
.icon-btn .ico { width: 22px; height: 22px; }

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.sidebar a, .sidebar .linklike { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.sidebar a:hover, .sidebar .linklike:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-foot small { display: block; color: var(--muted); padding: 6px 12px 0; font-size: .75rem; }
.linklike { background: none; border: 0; width: 100%; font: inherit; cursor: pointer; text-align: left; }
.scrim { display: none; }
.main { padding: 22px 28px 60px; max-width: 1480px; width: 100%; }
.main-bare { margin: 0 auto; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs .here { color: var(--text-2); font-weight: 500; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.page-title { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.page-title h1 { margin: 0; word-break: break-word; }
.page-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.page-ico .ico { width: 22px; height: 22px; }
.sub { color: var(--muted); margin: 3px 0 0; }
.page-actions, .btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.section-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.section-head h2 { margin: 0; }
section { scroll-margin-top: calc(var(--top) + 12px); }

/* ---------- Butoane ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; min-height: 38px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 500 .92rem var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--bad); }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: .86rem; }
.btn-xs { min-height: 28px; padding: 3px 8px; font-size: .8rem; gap: 5px; }
.btn-xs .ico { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn span:empty { display: none; }
.inline-form { display: inline; }

/* ---------- Mesaje ---------- */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; }
.flash > span { flex: 1; }
.flash-success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash-error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.flash-info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.flash-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; opacity: .7; }

/* ---------- Carduri și grile ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-top h3, .card-top h2 { margin: 0; }
.card-h { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 12px; }
.card-h .ico { color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cards .card { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card { margin: 0 0 16px; }
.site-card { color: var(--text); display: block; transition: border-color .15s, transform .15s; }
.site-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.site-card h3 { margin: 0; }
.site-card p { margin: 2px 0; }
.minis { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; color: var(--muted); font-size: .85rem; }
.minis b { color: var(--text); font-size: 1rem; }
.minis.big b { font-size: 1.3rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); box-shadow: var(--shadow); }
a.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile > .ico { width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.tile b { display: block; font-size: 1.35rem; line-height: 1.1; }
.tile span { color: var(--muted); font-size: .82rem; }
.tile-warn > .ico { background: var(--warn-soft); color: var(--warn); }
.tiles-sm .tile b { font-size: 1.15rem; }
.alerts { display: grid; gap: 8px; margin-bottom: 8px; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.alert-row:hover { text-decoration: none; filter: brightness(.98); }
.alert-row .chev { margin-left: auto; }
.empty { text-align: center; padding: 38px 18px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--text-2); margin-bottom: 16px; }
.empty h2, .empty h3 { margin: 8px 0 4px; color: var(--text); }
.empty-ico { width: 40px; height: 40px; color: var(--muted); }
.note { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin: 0 0 14px; color: var(--text-2); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed li > div { display: flex; flex-direction: column; min-width: 0; }
.feed small { color: var(--muted); }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; margin-top: 6px; display: inline-block; }
.a-create { background: var(--ok); } .a-update { background: var(--info); } .a-delete { background: var(--bad); } .a-export { background: var(--accent); } .a-lock { background: var(--warn); }

/* ---------- Badge-uri ---------- */
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; vertical-align: 1px; }
.b-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.b-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.b-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.b-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.b-muted { color: var(--muted); }
.tbadge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 6px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; --c: #6b7280; }
.tbadge::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.t-server { --c: #2563eb; } .t-switch { --c: #16a34a; } .t-router { --c: #7c3aed; } .t-firewall { --c: #dc2626; }
.t-patch_panel { --c: #475569; } .t-pdu { --c: #ea580c; } .t-ups { --c: #a16207; } .t-storage { --c: #0891b2; }
.t-kvm { --c: #c026d3; } .t-cable_mgmt { --c: #94a3b8; } .t-other { --c: #6b7280; }
.cdot { width: 11px; height: 11px; vertical-align: -1px; }
.cchip { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-family: var(--mono); padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.cchip:hover { border-color: var(--accent); text-decoration: none; }
.ok-mark { color: var(--ok); }

/* ---------- Formulare ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 11px; min-height: 38px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; accent-color: var(--accent); flex: none; }
input[type=file] { padding: 6px; }
select:disabled, input:disabled { opacity: .6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.form-grid h3 { margin: 10px 0 -4px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--text-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.form-grid h3:first-child, .form-grid > input[type=hidden] + h3, .form-grid > div:first-of-type + h3 { border-top: 0; padding-top: 0; }
.form-grid.narrow { max-width: 720px; }
.span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lbl { font-weight: 600; font-size: .84rem; color: var(--text-2); }
.hint { color: var(--muted); font-size: .8rem; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check.field { flex-direction: row; padding-top: 24px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-form input:not([type=hidden]), .row-form select { width: auto; flex: 1 1 180px; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 6px; }
.danger-zone { border-color: var(--bad-soft); }
.danger-zone h3 { color: var(--bad); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px; }
.filters .field { flex: 0 1 190px; }
.filters .field.grow { flex: 1 1 220px; }
.filters .check { padding-bottom: 9px; }
.filter-input { width: 220px; min-height: 34px; padding: 5px 11px; }
.role-help { line-height: 1.7; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl thead th { background: var(--surface-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .grp th { text-align: center; padding: 5px; border-bottom: 0; }
.tbl th.end-a { background: var(--end-a-soft); color: var(--end-a); border-radius: 6px 6px 0 0; }
.tbl th.end-b { background: var(--end-b-soft); color: var(--end-b); border-radius: 6px 6px 0 0; }
.tbl td.x, .tbl th.x { text-align: center; color: var(--muted); padding-left: 4px; padding-right: 4px; }
.tbl .chk { width: 34px; }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl tr.st-inactive td { color: var(--muted); }
.tbl tr.st-in_progress td { background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--info-soft) 8px 9px); }
.tbl tr.st-decommissioned td { opacity: .55; }
.tbl tr.free td { color: var(--muted); }
.tbl tr.row-bad td { background: var(--bad-soft); }
.tbl tr.is-hidden { display: none; }
.bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; }

/* ---------- Meniu dropdown, segment ---------- */
.dropdown { position: relative; }
.dropdown .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.dropdown.open .menu { display: block; }
.dropdown .menu a, .dropdown .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 7px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown .menu a:hover, .dropdown .menu button:hover { background: var(--surface-2); text-decoration: none; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg a { padding: 5px 13px; border-radius: 7px; color: var(--text-2); font-weight: 500; }
.seg a.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; }
.port-menu { display: inline-block; position: relative; }
.port-menu summary { list-style: none; }
.port-menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px; display: grid; gap: 8px; text-align: left; }

/* ---------- Locație ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .86rem; }
.kv dd { margin: 0; word-break: break-word; }
.kv-tight { gap: 3px 12px; }
.card-urgent { border-color: var(--bad-soft); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--bad-soft); }
.card-urgent .card-h .ico { color: var(--bad); }
.urgent-list { margin: 0; padding: 0; list-style: none; }
.urgent-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-weight: 500; }
.urgent-list li:last-child { border-bottom: 0; }
.urgent-list a { font-weight: 700; }
.room-card h3 { display: flex; align-items: center; gap: 8px; }
.rack-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rack-tile { display: flex; gap: 11px; align-items: center; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-2); }
.rack-tile:hover { border-color: var(--accent); text-decoration: none; }
.rack-tile > .ico { width: 30px; height: 30px; color: var(--accent); }
.rt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rt-body small { color: var(--muted); }
.bar svg { width: 100%; height: 6px; display: block; margin-top: 5px; }
.bar-bg { fill: var(--line); }
.bar-fg { fill: var(--accent); }
.bar-fg.hot { fill: var(--warn); }

/* ---------- Rack ---------- */
.anchors { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; position: sticky; top: var(--top); z-index: 10; background: var(--bg); padding: 8px 0; }
.anchors a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: .86rem; font-weight: 500; }
.anchors a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.elev-pair { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.elev-col { flex: 0 1 auto; max-width: 100%; }
.rack-svg { max-width: 100%; height: auto; display: block; }
.rack-svg a:hover rect:first-of-type { stroke-width: 2.5; filter: brightness(1.04); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 16px; font-size: .8rem; color: var(--text-2); align-items: center; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.legend svg { width: 13px; height: 13px; }
.chips { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; display: inline-flex; gap: 6px; align-items: center; }
.room-racks { display: flex; gap: 16px; overflow-x: auto; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; align-items: flex-start; }
.room-rack { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.psu-list { margin: 0; padding: 0; list-style: none; }
.psu-list li { padding: 2px 0; }
.outlets { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.outlet { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 5px 7px; display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); min-width: 0; }
.outlet b { font-family: var(--mono); color: var(--text-2); }
.outlet small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outlet.on { border-style: solid; border-color: var(--warn); background: var(--warn-soft); color: var(--text); }
.outlet.on:hover { text-decoration: none; filter: brightness(.97); }

/* ---------- Echipament ---------- */
.map-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; }
.map-svg { display: block; }
.map-svg a, .rack-svg a { text-decoration: none; }
.map-svg a:hover rect { filter: brightness(1.05); stroke-width: 2.2; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.photos figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.photos img { width: 100%; height: 130px; object-fit: cover; display: block; }
.photos figcaption { padding: 7px 9px; font-size: .82rem; display: grid; gap: 4px; }
.photos figcaption small { color: var(--muted); }
.upload-form input[type=file] { flex: 1 1 220px; }

/* ---------- Formular conexiune ---------- */
.ends { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 16px; }
.ends .card { margin: 0; }
fieldset.end { border: 1px solid var(--line); display: grid; gap: 12px; min-width: 0; }
fieldset.end-a { border-top: 4px solid var(--end-a); }
fieldset.end-b { border-top: 4px solid var(--end-b); }
fieldset.end legend { font-weight: 700; display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.end-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: #fff; font-weight: 800; background: var(--end-a); font-size: .9rem; }
.end-b .end-badge { background: var(--end-b); }
.swap-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-size: 1.2rem; cursor: pointer; color: var(--text-2); box-shadow: var(--shadow); }
.swap-btn:hover { border-color: var(--accent); color: var(--accent); }
.preview-ports #ports-preview { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-height: 120px; overflow: auto; }

/* ---------- Pagina cablu ---------- */
.ends-view { display: grid; grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); align-items: center; gap: 4px; margin-bottom: 16px; }
.ends-view .card { margin: 0; }
.end-card.end-a { border-top: 4px solid var(--end-a); }
.end-card.end-b { border-top: 4px solid var(--end-b); }
.end-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 1.1rem; }
.ends-link svg { width: 100%; height: 12px; }
.trace { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.trace-node a { display: flex; flex-direction: column; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.trace-node a:hover { border-color: var(--accent); text-decoration: none; }
.trace-node small { color: var(--muted); }
.trace-cable { display: flex; align-items: center; gap: 4px; }
.trace-cable::before, .trace-cable::after { content: ""; width: 14px; height: 3px; background: var(--line-strong); border-radius: 2px; }
.trace-cable.current .cchip { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Etichete ---------- */
.label-pair { display: flex; flex-wrap: wrap; gap: 18px; }
.label-demo { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.label-box { background: #fff; color: #000; border: 1px solid #94a3b8; border-radius: 6px; padding: 8px 12px; min-width: 240px; box-shadow: var(--shadow); }
.label-lines { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1; gap: .15em; }
.label-lines .l1 { font-weight: 800; border-bottom: .14em solid #000; padding-bottom: .12em; }
.label-lines .l2 { font-weight: 500; }
.label-tools .card { margin-bottom: 10px; }
.ls-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ls-row .field { flex: 0 1 170px; }
.ls-row .field.xs { flex: 0 1 92px; }
.label-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.labels { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 0; }
.labels .label { background: #fff; color: #000; border: 1px solid #94a3b8; border-radius: 4px; display: flex; align-items: center; gap: 1.6mm; padding: 1.4mm 2mm; overflow: hidden; position: relative; line-height: 1.18; font-family: Arial, Helvetica, sans-serif; box-shadow: var(--shadow); }
.labels .label .label-lines { word-break: break-word; }
.labels .label .label-qr { flex: none; display: grid; place-items: center; }
.labels .label .label-qr svg, .labels .label .label-qr img { display: block; }
.label-tools-row { position: absolute; right: 2px; top: 2px; display: none; gap: 2px; background: rgba(255, 255, 255, .92); border-radius: 6px; }
.labels .label:hover .label-tools-row, .labels .label:focus-within .label-tools-row { display: flex; }
.label-tools-row .btn { color: #0f172a; }

/* ---------- Autentificare, instalare ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card.wide { max-width: 760px; margin: 30px auto; }
.auth-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.auth-brand h1 { margin: 0; }
.checklist { list-style: none; padding: 0; columns: 2; font-size: .9rem; }
.checklist .ok { color: var(--ok); } .checklist .bad { color: var(--bad); font-weight: 600; }
textarea.mono { font-family: var(--mono); font-size: .82rem; }
.search-big { display: flex; gap: 10px; align-items: center; }
.search-big > .ico { color: var(--muted); }
.search-big input { flex: 1; }
.show-mobile { display: none; }
.diff ul { margin: 4px 0 0; padding-left: 16px; }

/* ---------- Raport print ---------- */
.page-print { background: #fff; color: #000; }
.print-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.report { background: #fff; color: #0f172a; max-width: 1100px; }
.report-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #0f172a; padding-bottom: 10px; margin-bottom: 10px; }
.report-head h1 { font-size: 1.3rem; }
.report-head p { margin: 0; color: #475569; }
.report-meta { text-align: right; font-size: .85rem; color: #475569; }
.report-urgent { background: #fee2e2; padding: 6px 10px; border-radius: 6px; font-size: .88rem; }
.report-elev { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 10px 0 18px; }
.report h2 { margin-top: 18px; font-size: 1.05rem; border-bottom: 1px solid #cbd5e1; padding-bottom: 4px; }
.tbl-print { font-size: .8rem; }
.tbl-print th, .tbl-print td { padding: 4px 6px; border: 1px solid #cbd5e1; color: #0f172a; }
.tbl-print thead th { background: #f1f5f9; color: #334155; position: static; }

/* ---------- Mobil ---------- */
@media (max-width: 960px) {
  :root { --side: 270px; }
  .icon-btn { display: inline-flex; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: var(--top); bottom: 0; height: auto; width: var(--side); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(15, 23, 42, .4); z-index: 45; }
  .brand { min-width: 0; }
  .brand span:last-child { display: none; }
  .userchip-text { display: none; }
  .main { padding: 16px 14px 70px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .ends { grid-template-columns: minmax(0, 1fr); }
  .swap-btn { justify-self: center; transform: rotate(90deg); }
  .ends-view { grid-template-columns: minmax(0, 1fr); }
  .ends-link { height: 26px; display: grid; place-items: center; }
  .ends-link svg { width: 12px; height: 26px; transform: rotate(90deg); }
  .show-mobile { display: block; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .check.field { padding-top: 0; }
  .page-head { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > .dropdown { flex: 1 1 auto; }
  .page-actions .dropdown .btn { width: 100%; }
  .dropdown .menu { left: 0; right: auto; min-width: min(300px, 92vw); }
  .topsearch input { font-size: 16px; }
  input, select, textarea { font-size: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 12px; }
  .tile > .ico { display: none; }
  .filter-input { width: 100%; }
  .anchors { flex-wrap: nowrap; overflow-x: auto; margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .anchors a { flex: none; }
  .section-head .btn-row { width: 100%; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { margin-top: 8px; }
  .checklist { columns: 1; }
  .card { padding: 14px; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .topbar, .sidebar, .crumbs, .flash, .no-print, .page-head, .print-bar, .anchors, .scrim, .label-tools-row { display: none !important; }
  .shell { display: block; }
  .main { padding: 0 !important; max-width: none; }
  .card, .table-wrap { box-shadow: none; border-color: #cbd5e1; }
  .page-labels .labels { padding: 0; gap: 0; }
  .page-labels .label { box-shadow: none; }
  .report-elev svg { max-height: 80vh; width: auto; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; font-weight: 500; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media print { .toast { display: none; } }
@media screen { .page-labels .labels .label { zoom: 1.6; } }

.input-group { display: flex; flex-wrap: wrap; gap: 6px; }
.input-group input { flex: 1 1 110px; min-width: 0; }
.input-group select { width: auto; flex: none; }
#cf-type-other { margin-top: 6px; }
.config { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: .85rem/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; margin: 10px 0 0; }

/* matrice distanțe */
.matrix th, .matrix td { text-align: center; padding: 6px; white-space: nowrap; }
.matrix tbody th { text-align: left; background: var(--surface-2); position: sticky; left: 0; }
.matrix input { width: 74px; min-height: 32px; padding: 4px 6px; text-align: center; }
.matrix .diag { background: var(--surface-2); color: var(--muted); }
.matrix .mirror { color: var(--text-2); }

/* statistici */
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.status-cell { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); background: var(--surface-2); }
.status-cell:hover { border-color: var(--accent); text-decoration: none; }
.status-cell b { font-size: 1.4rem; line-height: 1.1; }
.status-cell span { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--text-2); }
.status-cell small { color: var(--muted); }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--c); }
.s-active { --c: var(--ok); } .s-inactive { --c: var(--warn); } .s-in_progress { --c: var(--info); } .s-decommissioned { --c: var(--muted); }
.stackbar { width: 100%; height: 14px; display: block; margin-bottom: 8px; }
.stackbar.mini { height: 8px; min-width: 120px; margin: 4px 0 0; }
.stackbar .seg { fill: var(--c); }
.dist-cell { min-width: 130px; vertical-align: middle; }
.hbars { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 7px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 36px; gap: 10px; align-items: center; font-size: .86rem; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hb-track svg { width: 100%; height: 10px; display: block; }
.hb-bar { fill: var(--accent); }
.hb-val { text-align: right; font-variant-numeric: tabular-nums; }
.small-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; }
@media (max-width: 640px) { .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
