body.ipam-view .summary { display: none; }
.ipam [hidden] { display:none!important; }
.ipam-database-note { margin:16px 0; font-size:13px; color:var(--muted); line-height:1.6; }
.ipam { grid-column: 1 / -1; min-width: 0; color: var(--text); }
.ipam-heading, .ipam-tools, .ipam-pagination, .ipam-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ipam h2 { margin: 0; font-size: 22px; }
.ipam-heading small, .ipam-muted { color: var(--muted); }
.ipam-heading small { display: block; margin-top: 6px; }
.ipam button, .ipam-dialog button { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 5px; height: 36px; font-size: 13px; }
.ipam button:disabled { opacity: .5; cursor: not-allowed; }
.ipam button:focus-visible, .ipam input:focus-visible, .ipam select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ipam .ipam-primary, .ipam-dialog .ipam-primary { background: var(--nav-active); color: #fff; border-color: var(--nav-active); }
.ipam-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ipam-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); margin-top: 22px; padding-block: 18px; gap: 16px; }
.ipam-stat { padding-inline: 16px; border-left: 3px solid var(--accent); min-width: 0; }
.ipam-stat:nth-child(2) { border-color: var(--up); }
.ipam-stat:nth-child(3) { border-color: var(--warn); }
.ipam-stat:nth-child(4) { border-color: var(--muted); }
.ipam-stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.ipam-stat strong { font-size: 23px; overflow-wrap: anywhere; }
.ipam-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-top: 12px; max-width:100%; overflow-x:auto; }
.ipam-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; height: 45px; background: transparent; padding-inline: 0; flex-shrink:0; }
.ipam-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.ipam-tools { padding-block: 16px; justify-content: flex-start; }
.ipam-tools label { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.ipam-tools input { min-width: 0; width: 250px; }
.ipam-tools select { min-width: 0; max-width: 280px; }
.ipam-message { color: var(--up); min-height: 20px; margin: 8px 0; font-size: 13px; overflow-wrap: anywhere; }
.ipam-message[data-error="true"], .ipam-dialog-error { color: var(--down); }
.ipam-table-wrap { width: 100%; overflow-x: auto; border-block: 1px solid var(--line); }
.ipam table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 13px; }
.ipam-table-wrap[data-kind="subnets"] table, .ipam-table-wrap[data-kind="database"] table { min-width: 900px; }
.ipam-table-wrap[data-kind="addresses"] table { min-width: 1350px; }
.ipam-sync-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; font-size: 13px; }
.ipam-sync-tools label { display: flex; align-items: center; gap: 8px; }
.ipam-sync-tools input:not([type="checkbox"]) { width: 150px; min-width: 0; }
.ipam-sync-tools input[type="checkbox"] { width: 16px; height: 16px; min-width: 0; accent-color: var(--accent); }
.ipam-sync-status { margin-top: 10px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ipam-sync-status[data-error="true"] { color: var(--warn); }
.ipam-table-wrap[data-kind="audit"] table { min-width: 650px; }
.ipam td:first-child { white-space: nowrap; }
.ipam th { text-align: left; color: var(--muted); background: var(--panel-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0; white-space: nowrap; }
.ipam th, .ipam td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 260px; overflow-wrap: anywhere; }
.ipam tr:last-child td { border-bottom: 0; }
.ipam tbody tr:hover { background: var(--panel-2); }
.ipam .ipam-link { color: var(--accent); border: 0; background: transparent; padding: 0; height: auto; text-align: left; white-space: nowrap; }
.ipam td small { display: block; color: var(--muted); margin-top: 4px; }
.ipam-badge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; }
.ipam-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ipam-badge[data-status="available"]::before { background: var(--up); }
.ipam-badge[data-status="reserved"]::before { background: var(--warn); }
.ipam-badge[data-status="excluded"]::before { background: var(--down); }
.ipam-badge[data-status="dhcp"]::before { background: var(--muted); }
.ipam-usage { min-width: 120px; }
.ipam-usage progress { display: block; width: 120px; max-width: 100%; height: 6px; accent-color: var(--accent); margin-bottom: 6px; }
.ipam-usage[data-full="true"] progress { accent-color: var(--down); }
.ipam-pagination { padding-block: 14px; font-size: 12px; color: var(--muted); }
.ipam-blocks details { margin-block: 16px; border-block: 1px solid var(--line); }
.ipam-blocks summary { padding-block: 12px; color: var(--muted); cursor: pointer; font-size: 13px; }
.ipam .ipam-empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.ipam-dialog { width: min(660px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.ipam-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.ipam-dialog h3 { margin: 0 0 20px; font-size: 19px; }
.ipam-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ipam-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; min-width: 0; }
.ipam-dialog input, .ipam-dialog select, .ipam-dialog textarea { width: 100%; min-width: 0; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 14px; padding: 8px; }
.ipam-dialog textarea { min-height: 72px; resize: vertical; }
.ipam-form-wide { grid-column: 1 / -1; }
.ipam-dialog-actions { justify-content: flex-end; margin-top: 18px; }
.ipam-dialog-error { font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .ipam-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ipam-stat strong { font-size: 20px; }
  .ipam-tools { align-items: stretch; }
  .ipam-tools label { width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr); }
  .ipam-tools input, .ipam-tools select { width: 100%; max-width: none; }
  .ipam-tabs { gap: 18px; }
  .ipam-form-grid { grid-template-columns: minmax(0, 1fr); }
}
