:root {
  --bg: #d7dadd;
  --panel: #f4f4f4;
  --ink: #1c1c1c;
  --muted: #666;
  --line: #b9b9b9;
  --line-soft: #d3d2d2;
  --chrome: #444;
  --chrome-dark: #303030;
  --blue: #1195d2;
  --blue-bright: #0099ff;
  --green: #00a400;
  --red: #cc2222;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 44px 1fr;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}

.sidebar {
  position: sticky;
  top: 0;
  background: #333;
  color: white;
  min-height: 100vh;
  border-right: 1px solid #222;
  z-index: 10;
}

.brand {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: #181818;
  border-bottom: 1px solid #555;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
}

.brand-mark path:first-child {
  fill: #0f6e94;
  stroke: #35c3ff;
  stroke-width: 1.4;
}

.brand-mark circle {
  fill: #e9f8ff;
  stroke: #06374e;
  stroke-width: 1.2;
}

.brand-mark path:last-child {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
}

.module-title {
  padding: 5px 0;
  background: #3e3e3e;
  border-bottom: 1px solid #252525;
  color: #ddd;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

nav {
  display: grid;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.nav {
  position: relative;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid #4b4b4b;
  border-left: 0;
  color: #eee;
  background: #333;
  text-align: center;
  padding: 0;
  font-weight: 700;
  font-size: 0;
}

.nav::before {
  content: attr(data-icon);
  display: grid;
  place-items: center;
  width: 100%;
  height: 42px;
  color: #f7f7f7;
  font-size: 11px;
  letter-spacing: 0;
}

.nav:hover {
  background: #454545;
}

.nav.active {
  background: #111;
  color: #fff;
  box-shadow: inset 4px 0 0 #1195d2;
}

.appliance-status {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 44px;
  display: grid;
  place-items: center;
  padding: 10px 0;
  background: #333;
  border-top: 1px solid #555;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

main {
  padding: 0 0 18px;
  min-width: 0;
}

.product-strip {
  min-height: 40px;
  margin: 0 0 0;
  padding: 0 8px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: #363636;
  border-bottom: 1px solid #202020;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wordmark strong {
  color: #d8f4ff;
  font-size: 13px;
}

.wordmark span,
.session-user {
  color: #cfcfcf;
}

.global-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chrome-button {
  min-height: 28px;
  border: 1px solid #aaa;
  background: linear-gradient(#fff, #d8d8d8);
  color: #111;
  font-weight: 700;
  padding: 3px 9px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #b9b9b9;
}

.top-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.searchbox {
  min-width: 315px;
  color: #eee;
  gap: 2px;
}

.searchbox span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.searchbox input {
  min-height: 30px;
  border-color: #1b1b1b;
  font-size: 16px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: 20px;
  font-weight: 400;
}

h2 {
  font-size: 14px;
  margin-bottom: 0;
  font-weight: 700;
}

h3 {
  font-size: 12px;
  margin-bottom: 4px;
}

.muted,
.topbar p {
  color: var(--muted);
}

.tab {
  display: none;
}

.tab.active {
  display: block;
  padding: 10px 12px 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metrics article,
.panel,
.eip-workbench {
  background: var(--panel);
  border: 1px solid #aaa;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 9px 10px;
  border-top: 3px solid var(--blue);
}

.metrics span {
  display: block;
  font-size: 23px;
  font-weight: 700;
}

.metrics small {
  color: #555;
  text-transform: uppercase;
  font-size: 10px;
}

.panel {
  margin-bottom: 10px;
}

.panel-head,
.eip-titlebar {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  background: linear-gradient(#f9f9f9, #d3d2d2);
  border-bottom: 1px solid #aaa;
}

.panel > p,
.panel > .split,
.panel > form,
.panel > .table,
.panel > pre,
.search-results {
  margin: 10px;
}

.eip-workbench {
  margin-bottom: 10px;
}

.eip-breadcrumbs {
  min-height: 40px;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid #b9b9b9;
}

.eip-breadcrumbs button {
  min-width: max-content;
  border: 0;
  border-right: 1px solid #b9b9b9;
  background: linear-gradient(#595959, #3e3e3e);
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
}

.eip-breadcrumbs button.active {
  background: #fff;
  color: #1195d2;
}

.eip-titlebar {
  color: #111;
}

.eip-titlebar span {
  color: #555;
}

.eip-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 5px 6px;
  background: #ededed;
  border-bottom: 1px solid #b9b9b9;
}

.eip-toolbar button,
.secondary,
button[type="submit"] {
  min-height: 27px;
  border: 1px solid #9d9d9d;
  background: linear-gradient(#fff, #dcdcdc);
  color: #222;
  padding: 4px 9px;
  font-weight: 700;
}

.eip-toolbar button {
  margin-right: 4px;
}

.eip-toolbar button:hover,
.secondary:hover {
  background: linear-gradient(#fff, #cfcfcf);
}

.eip-toolbar button:disabled {
  color: #888;
  cursor: default;
}

.eip-content {
  display: grid;
  grid-template-columns: 184px 1fr;
  min-height: 0;
}

.eip-tree {
  background: #efefef;
  border-right: 1px solid #b9b9b9;
  padding: 6px;
}

.tree-row {
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  color: #222;
  text-align: left;
  padding: 7px 8px 7px 24px;
  position: relative;
}

.tree-row::before {
  content: "";
  width: 12px;
  height: 12px;
  position: absolute;
  left: 7px;
  top: 7px;
  background: #1195d2;
  border: 1px solid #087eb8;
}

.tree-row.on {
  background: #dceefa;
  color: #000;
  font-weight: 700;
}

.eip-list {
  min-width: 0;
  background: white;
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.address-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: 420px;
}

.address-inspector {
  border-left: 1px solid #b9b9b9;
  background: #f4f4f4;
  padding: 10px;
  overflow: auto;
}

.inspector-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d3d2d2;
}

.inspector-head h3 {
  margin: 0;
  font-size: 16px;
}

.inspector-head small {
  color: #666;
}

.address-inspector dl {
  margin: 10px 0;
}

.address-inspector dt {
  color: #555;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 8px;
}

.address-inspector dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
}

.inspector-actions button {
  min-height: 27px;
  border: 1px solid #9d9d9d;
  background: linear-gradient(#fff, #dcdcdc);
  font-weight: 700;
}

.inspector-actions button:disabled {
  color: #888;
  cursor: default;
}

.eip-filter {
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 7px 8px;
  background: #f6f6f6;
  border-bottom: 1px solid #d3d2d2;
}

.eip-filter label {
  min-width: 250px;
}

.pill {
  border: 1px solid #b9b9b9;
  color: #075f8c;
  background: #eaf6ff;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
}

.split,
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 8px;
  align-items: end;
}

label {
  display: grid;
  gap: 4px;
  color: #333;
  font-size: 11px;
  font-weight: 700;
}

input,
select {
  min-height: 27px;
  width: 100%;
  border: 1px solid #aaa;
  background: #fff;
  color: #111;
  padding: 4px 6px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(0, 153, 255, 0.25);
  border-color: var(--blue-bright);
}

button[type="submit"] {
  color: white;
  border-color: #0570a4;
  background: linear-gradient(#129bd9, #087eb8);
}

.table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 12px;
}

th {
  color: #111;
  text-align: left;
  border: 1px solid #c6c6c6;
  padding: 6px 7px;
  background: linear-gradient(#fafafa, #dddddd);
  white-space: nowrap;
}

td {
  border: 1px solid #e0e0e0;
  padding: 6px 7px;
  vertical-align: top;
}

tr:nth-child(even) td {
  background: #f7f7f7;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #dceefa;
}

.selected-row td,
.selected-row:nth-child(even) td {
  background: #c7e6fa;
}

.eip-icon {
  width: 12px;
  height: 12px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
  border: 1px solid #087eb8;
  background: #1195d2;
}

.eip-icon.address {
  background: #fff;
}

.eip-icon.address.available {
  border-color: #b9b9b9;
}

.eip-icon.address.non_assignable {
  background: #cc2222;
  border-color: #9c1717;
}

.eip-icon.address.assigned,
.eip-icon.address.reserved {
  background: #1195d2;
}

.eip-icon.address.dhcp {
  background: #00a400;
  border-color: #007900;
}

.eip-icon.address.dns {
  background: #0099ff;
}

.eip-icon.address.deprecated {
  background: #cc2222;
  border-color: #9c1717;
}

.delete {
  border: 1px solid #d0a0a0;
  background: #fff1f1;
  color: var(--red);
  padding: 3px 7px;
  font-weight: 700;
}

.alert {
  padding: 9px 10px;
  margin: 10px 12px;
  background: #fff7e6;
  border: 1px solid #e4b866;
  color: #784d00;
}

.search-results {
  padding: 0;
  margin: 10px 12px;
}

.result-row {
  display: grid;
  grid-template-columns: 130px 1.2fr 1.5fr 1fr;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #ddd;
  padding: 7px 9px;
}

.result-row:last-child {
  border-bottom: 0;
}

.result-row small {
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
}

.wizard-modal {
  width: min(560px, calc(100vw - 24px));
  min-height: 320px;
  background: #fff;
  border: 1px solid #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
}

.wizard-title {
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 28px;
  color: #fff;
  background: #444;
  border-bottom: 1px solid #222;
  font-size: 16px;
}

.modal-x {
  width: 19px;
  height: 19px;
  min-height: 0;
  padding: 0;
  border: 1px solid #aaa;
  color: #fff;
  background: #666;
  font-weight: 700;
}

.wizard-body {
  padding: 20px 28px 8px;
  min-height: 292px;
}

.wizard-note {
  margin-bottom: 12px;
  padding: 6px 9px;
  background: #e8e8e8;
}

.wizard-body label {
  grid-template-columns: 105px 1fr;
  align-items: center;
  margin-bottom: 7px;
}

.wizard-body fieldset {
  border: 1px solid #bdbdbd;
  margin: 8px 0;
  padding: 10px;
}

.wizard-body textarea {
  min-height: 120px;
  resize: vertical;
}

.wizard-buttons {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.wizard-buttons button {
  min-height: 22px;
  border: 1px solid #aaa;
  background: linear-gradient(#fff, #ddd);
  padding: 2px 6px;
  font-weight: 700;
}

pre {
  min-height: 360px;
  overflow: auto;
  white-space: pre;
  background: #333;
  color: white;
  border: 1px solid #222;
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
}

code {
  background: #eee;
  border: 1px solid #ccc;
  padding: 1px 4px;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 44px 1fr;
  }

  .eip-content {
    grid-template-columns: 1fr;
  }

  .product-strip {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 7px 8px;
  }

  .global-tools {
    flex-wrap: wrap;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .wordmark {
    flex-direction: column;
    gap: 1px;
  }

  .searchbox,
  .eip-filter label {
    width: 100%;
    min-width: 0;
  }

  .eip-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .eip-tree {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    border-right: 0;
    border-bottom: 1px solid #b9b9b9;
  }

  .tree-row {
    min-width: max-content;
  }

  .eip-list {
    max-height: none;
  }

  .address-layout {
    grid-template-columns: 1fr;
  }

  .address-inspector {
    grid-row: 1;
    border-left: 0;
    border-bottom: 1px solid #b9b9b9;
  }

  .metrics,
  .grid-form,
  .split,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .result-row {
    grid-template-columns: 1fr;
  }

  .wizard-body {
    padding: 14px;
  }

  .wizard-body label {
    grid-template-columns: 1fr;
  }
}
