.dcim {
    --dcim-line: #dce3ef;
    --dcim-ink: #243b56;
}
.dcim-head,
.dcim-actions,
.dcim-tabs,
.dcim-metrics {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.dcim-head {
    justify-content: space-between;
    margin: 8px 0 22px;
}
.dcim-head h3 {
    margin: 0;
    color: var(--dcim-ink);
}
.dcim-head p {
    margin: 7px 0 0;
}
.dcim-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.dcim-tree,
.dcim-panel {
    background: white;
    border: 1px solid var(--dcim-line);
    border-radius: 9px;
    padding: 20px;
    margin-bottom: 18px;
}
.dcim-tree {
    padding: 16px;
    position: sticky;
    top: 85px;
    max-height: 75vh;
    overflow: auto;
}
.dcim-tree h5 {
    margin: 0 0 16px;
}
.dcim-tree ul {
    list-style: none;
    padding-left: 14px;
    margin: 4px 0;
}
.dcim-tree > ul {
    padding: 0;
}
.dcim-tree button {
    width: 100%;
    text-align: left;
    padding: 9px 8px;
    border: 0;
    background: none;
    border-radius: 5px;
    color: #51637b;
    overflow-wrap: anywhere;
}
.dcim-tree button:hover {
    background: #f0f2ff;
}
.dcim-tree button[aria-current='true'] {
    background: #e9e8ff;
    color: #554bd0;
    font-weight: 700;
}
.dcim-tree small {
    display: block;
    opacity: 0.7;
}
.dcim-metrics {
    gap: 10px;
    margin: 0 0 18px;
}
.dcim-metric {
    background: #f1f4f9;
    border-radius: 7px;
    padding: 12px 18px;
    flex: 1;
    min-width: 100px;
}
.dcim-metric strong {
    display: block;
    font-size: 23px;
    color: var(--dcim-ink);
}
.dcim-tabs {
    border-bottom: 1px solid var(--dcim-line);
    margin-bottom: 18px;
}
.dcim-tabs button {
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 12px;
    background: none;
    color: #52637b;
}
.dcim-tabs button[aria-selected='true'] {
    border-color: #726cf8;
    color: #554bd0;
}
.dcim-search {
    max-width: 320px;
}
.dcim-racks {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 24px;
    margin: 20px auto;
    max-width: 950px;
}
.dcim-rack-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
    color: #243b56;
}
.dcim-elevation {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr);
    gap: 1px;
    background: #1f2c3b;
    border: 7px solid #263747;
    border-radius: 5px;
    padding: 8px;
    position: relative;
}
.dcim-u {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b5c9db;
    font: 11px monospace;
}
.dcim-slot {
    border: 1px solid #405064;
    background: #303f50;
    color: #8fa0b6;
    font-size: 11px;
    text-align: left;
    padding: 0 9px;
}
.dcim-slot:hover {
    background: #4b527d;
    color: white;
}
.dcim-device {
    z-index: 1;
    border: 1px solid #b5c6d9;
    background: #dce9f5;
    color: #203c57;
    text-align: left;
    padding: 3px 9px;
    border-radius: 3px;
    overflow: hidden;
    line-height: 1.15;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}
.dcim-device[data-kind='switch'],
.dcim-device[data-kind='router'] {
    background: #1e6273;
    color: white;
    border-color: #318295;
}
.dcim-device[data-kind='patch'] {
    background: #576a7d;
    color: white;
}
.dcim-device[data-kind='pdu'] {
    background: #685996;
    color: white;
}
.dcim-device[data-status='planned'] {
    border: 2px dashed #e2a121;
}
.dcim-device[data-status='offline'] {
    opacity: 0.65;
}
.dcim-device strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dcim-device small {
    font-size: 10px;
    flex-shrink: 0;
}
.dcim-legend {
    font-size: 12px;
}
.dcim-note {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.dcim-table-wrap {
    overflow: auto;
}
.dcim table {
    width: 100%;
    border-collapse: collapse;
}
.dcim th,
.dcim td {
    padding: 12px 9px;
    border-bottom: 1px solid #e7ebf3;
    text-align: left;
    vertical-align: middle;
}
.dcim th {
    font-weight: 600;
    font-size: 12px;
    color: #65768b;
}
.dcim td small {
    display: block;
}
.dcim-link {
    border: 0;
    background: none;
    color: #635bf0;
    padding: 0;
    text-align: left;
}
.dcim-empty {
    padding: 30px;
    color: #728198;
    text-align: center;
}
.dcim-ports {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 7px;
    margin: 16px 0;
}
.dcim-port {
    border: 1px solid #d1d9e6;
    background: #f6f8fc;
    border-radius: 5px;
    padding: 9px;
    text-align: left;
    color: #4f627b;
    overflow-wrap: anywhere;
}
.dcim-port.connected {
    background: #e6f6f0;
    border-color: #92d1ba;
}
.dcim-port strong,
.dcim-port small {
    display: block;
}
.dcim-port small {
    font-size: 10px;
    margin-top: 4px;
}
.dcim-details dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px;
}
.dcim-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.dcim-details dt {
    font-weight: 500;
}
.dcim-topology {
    overflow: auto;
    margin-bottom: 14px;
}
.dcim-topology svg {
    display: block;
    background: #f8faff;
    border: 1px solid #e5ebf3;
    border-radius: 6px;
    max-width: 100%;
    height: auto;
}
.dcim-topology text {
    font-family: inherit;
    fill: #30445f;
    font-size: 12px;
}
.dcim-comment {
    padding: 12px 0;
    border-bottom: 1px solid #e9edf4;
}
.dcim-comment small {
    display: block;
    margin-bottom: 4px;
}
.dcim-dialog {
    border: 0;
    border-radius: 10px;
    box-shadow: 0 24px 80px #18263d55;
    width: 760px;
    max-width: 94vw;
    max-height: 90vh;
    padding: 24px;
    color: #52647c;
    background: #fff;
}
.dcim-dialog::backdrop {
    background: #1a263766;
}
.dcim-dialog h4 {
    color: #243b56;
    margin-top: 0;
}
.dcim-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.dcim-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 12px;
}
.dcim-field.wide {
    grid-column: 1/-1;
}
.dcim-dialog .dcim-actions {
    justify-content: flex-end;
    margin: 20px 0;
}
.dcim-dialog textarea {
    min-height: 90px;
}
.dcim-error:empty {
    display: none;
}
.dcim-comment-form {
    margin-top: 12px;
}
.dcim-breadcrumb {
    font-size: 12px;
    margin: 6px 0 15px;
    color: #77879b;
}
@media (max-width: 1000px) {
    .dcim-layout {
        grid-template-columns: 1fr;
    }
    .dcim-tree {
        position: static;
        max-height: 230px;
    }
    .dcim-racks {
        gap: 10px;
    }
    .dcim-device {
        padding: 3px;
        font-size: 11px;
    }
    .dcim-device small {
        display: none;
    }
}
@media (max-width: 600px) {
    .dcim-racks,
    .dcim-form-grid {
        grid-template-columns: 1fr;
    }
    .dcim-head {
        align-items: flex-start;
    }
    .dcim-panel {
        padding: 13px;
    }
    .dcim-metric {
        min-width: 90px;
    }
    .dcim-details dl {
        grid-template-columns: 100px 1fr;
    }
}
