.menu-link {
    display: grid;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.menu-link.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #dce8ff;
}

.report-export-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.native-grid-shell {
    min-height: calc(100vh - 150px);
}

.splitter-dragging {
    cursor: col-resize;
    user-select: none;
}

@media (min-width: 900px) {
    .dashboard-detail-grid,
    .cve-detail-grid {
        display: grid;
        grid-template-columns: minmax(0, var(--dashboard-summary-width, 64%)) 10px minmax(260px, 1fr);
    }

    .dashboard-splitter {
        display: block;
    }
}

.dashboard-soc-panel .native-grid-shell {
    gap: 0;
    height: 100%;
    min-height: 0;
}

.native-grid-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.native-grid-toolbar,
.native-grid-pager {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.native-grid-search input,
.native-grid-pager select {
    border: 1px solid #c8d5e3;
    border-radius: 6px;
    min-height: 34px;
    padding: 6px 10px;
}

.native-grid-search input {
    min-width: 260px;
}

.native-grid-toolbar button,
.native-grid-pager button,
.native-grid-export,
.native-grid-download,
.native-grid-column-menu summary {
    align-items: center;
    background: #ffffff;
    border: 1px solid #c8d5e3;
    border-radius: 6px;
    color: #1d3557;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    font-weight: 600;
    min-height: 34px;
    padding: 6px 12px;
    text-decoration: none;
}

.native-grid-export {
    font-weight: 800;
}

.native-grid-export .dx-icon {
    font-size: 18px;
}

.native-grid-export-excel,
.native-grid-export-excel .dx-icon,
.native-grid-export-csv,
.native-grid-export-csv .dx-icon {
    color: #1f8f43;
}

.native-grid-export-pdf,
.native-grid-export-pdf .dx-icon {
    color: #d14b4b;
}

.native-grid-export-text,
.native-grid-export-text .dx-icon {
    color: #111827;
}

.native-grid-export-html,
.native-grid-export-html .dx-icon {
    color: #1d5fd1;
}

.native-grid-legend-button,
.native-grid-legend-button .dx-icon {
    color: #1d5fd1;
}

.native-grid-export-excel:hover,
.native-grid-export-csv:hover {
    background: #f0fff4;
    border-color: #b7e3c4;
}

.native-grid-export-pdf:hover {
    background: #fff5f5;
    border-color: #efcaca;
}

.native-grid-export-text:hover {
    background: #f8fafc;
    border-color: #d5dae2;
}

.native-grid-export-html:hover {
    background: #f2f7ff;
    border-color: #b9d0ff;
}

.native-grid-primary {
    align-items: center;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    font-weight: 700;
    min-height: 34px;
    padding: 6px 12px;
}

.native-grid-danger {
    background: #dc2626;
    border-color: #dc2626;
}

.native-grid-toolbar button:hover,
.native-grid-pager button:hover,
.native-grid-download:hover,
.native-grid-column-menu summary:hover {
    background: #eef6ff;
    border-color: #6aa9ff;
}

.native-grid-toolbar button.native-grid-export-excel:hover,
.native-grid-toolbar button.native-grid-export-csv:hover {
    background: #f0fff4;
    border-color: #b7e3c4;
}

.native-grid-toolbar button.native-grid-export-pdf:hover {
    background: #fff5f5;
    border-color: #efcaca;
}

.native-grid-toolbar button.native-grid-export-text:hover {
    background: #f8fafc;
    border-color: #d5dae2;
}

.native-grid-toolbar button.native-grid-export-html:hover {
    background: #f2f7ff;
    border-color: #b9d0ff;
}

.native-grid-toolbar button:disabled,
.native-grid-pager button:disabled {
    cursor: default;
    opacity: .55;
}

.native-grid-column-menu {
    position: relative;
}

.native-grid-column-list {
    background: #ffffff;
    border: 1px solid #c8d5e3;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(38, 65, 92, .16);
    direction: ltr;
    display: grid;
    gap: 6px;
    left: 0;
    max-height: 320px;
    min-width: 210px;
    overflow: auto;
    padding: 10px;
    position: absolute;
    top: calc(100% + 6px);
    z-index: 20;
}

.native-grid-column-list label {
    align-items: center;
    color: #64748b;
    direction: ltr;
    display: grid;
    font-size: 12px;
    font-weight: 800;
    gap: 8px;
    grid-template-columns: 18px minmax(0, 1fr);
    justify-content: start;
    justify-items: start;
    letter-spacing: .04em;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
    unicode-bidi: normal;
    white-space: nowrap;
}

.native-grid-column-list input[type="checkbox"] {
    margin: 0;
}

.native-grid-column-list span {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
}

.native-grid-frame {
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
}

.native-grid {
    border-collapse: collapse;
    direction: ltr;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

.native-grid th,
.native-grid td {
    border-bottom: 1px solid #e1eaf3;
    direction: ltr;
    padding: 8px 10px;
    text-align: left;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;
    vertical-align: top;
    white-space: nowrap;
    overflow: hidden;
    overflow-wrap: normal;
    word-break: normal;
}

.native-grid-actions-header,
.native-grid-actions-cell,
.native-grid-bool {
    text-align: center;
    unicode-bidi: normal;
}

.native-grid-actions-header,
.native-grid-actions-cell {
    max-width: 124px;
    width: 124px;
}

.native-grid-actions-cell {
    white-space: nowrap;
    unicode-bidi: normal;
}

.native-grid-icon-button {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d6e2ef;
    border-radius: 6px;
    color: #2563eb;
    cursor: pointer;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    margin: 0 2px;
    width: 30px;
}

.native-grid-icon-button:hover {
    background: #eef6ff;
    border-color: #93c5fd;
}

.native-grid-icon-button-danger {
    color: #dc2626;
}

.native-grid-icon-button-info {
    color: #1d5fd1;
}

.native-grid-icon-button-permissions {
    color: #0f766e;
}

.native-grid-icon-button-permissions:hover {
    background: #ecfdf5;
    border-color: #99f6e4;
}

.status-bool-icon {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.status-bool-icon-on {
    background: #dcfce7;
    color: #15803d;
}

.status-bool-icon-off {
    background: #fee2e2;
    color: #b91c1c;
}

.status-bool-icon-admin {
    background: transparent;
    color: #1d5fd1;
}

.status-bool-icon-alarm {
    background: #ffe8e8;
    color: #d82727;
}

.event-color-dot {
    border: 1px solid rgba(15, 23, 42, .18);
    border-radius: 999px;
    display: inline-block;
    height: 18px;
    width: 18px;
}

.ml-indicator {
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

.ml-indicator-dot {
    border-radius: 999px;
    height: 14px;
    width: 14px;
}

.ml-indicator-clock {
    border: 2px solid currentColor;
    border-radius: 999px;
    box-sizing: border-box;
    height: 16px;
    width: 16px;
}

.ml-indicator-clock::before,
.ml-indicator-clock::after {
    background: currentColor;
    content: "";
    left: 50%;
    position: absolute;
    top: 50%;
    transform-origin: center bottom;
}

.ml-indicator-clock::before {
    height: 5px;
    margin-left: -.75px;
    margin-top: -5px;
    transform: rotate(0deg);
    width: 1.5px;
}

.ml-indicator-clock::after {
    height: 4px;
    margin-left: -.75px;
    margin-top: -4px;
    transform: rotate(55deg);
    width: 1.5px;
}

.ml-indicator-green {
    background: #15803d;
    color: #15803d;
}

.ml-indicator-yellow {
    background: #f59e0b;
    color: #f59e0b;
}

.ml-indicator-red {
    background: #991b1b;
    color: #991b1b;
}

.ml-indicator-blue {
    background: transparent;
    color: #2563eb;
}

.ml-indicator-clock.ml-indicator-red,
.ml-indicator-clock.ml-indicator-blue {
    background: transparent;
}

.native-grid th {
    background: #f4f8fc;
    color: #263f5c;
    cursor: pointer;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}

.native-grid-header-cell {
    position: relative;
    user-select: none;
}

.native-grid-filter-row th {
    background: #f8fbff;
    cursor: default;
    padding: 6px 8px;
}

.native-grid-filter-cell input,
.native-grid-filter-cell select {
    background: #ffffff;
    border: 1px solid #c8d5e3;
    border-radius: 6px;
    color: #1d3557;
    min-height: 30px;
    padding: 4px 8px;
    width: 100%;
}

.native-grid-header-title {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    min-width: 0;
    padding-left: 18px;
    padding-right: 16px;
}

.native-grid-column-drag-handle {
    align-items: center;
    cursor: grab;
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(3, 3px);
    height: 22px;
    justify-content: center;
    left: 7px;
    opacity: .42;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity .12s ease;
    width: 16px;
    z-index: 2;
}

.native-grid-column-drag-handle span {
    background: #64748b;
    border-radius: 999px;
    height: 3px;
    width: 3px;
}

.native-grid-header-cell:hover .native-grid-column-drag-handle,
.native-grid-header-dragging .native-grid-column-drag-handle {
    opacity: 1;
}

.native-grid-column-drag-handle:active {
    cursor: grabbing;
}

.native-grid-header-dragging {
    opacity: .62;
}

.native-grid-header-drop-target {
    box-shadow: inset 3px 0 0 #2563eb;
}

.native-grid-resize-handle {
    bottom: 0;
    cursor: col-resize;
    position: absolute;
    right: -4px;
    top: 0;
    width: 8px;
    z-index: 3;
}

.native-grid-resize-handle:hover,
.native-grid-resizing .native-grid-resize-handle {
    background: rgba(47, 111, 237, .16);
}

.native-grid-resizing {
    cursor: col-resize;
    user-select: none;
}

.native-grid-actions-col {
    max-width: 124px;
    min-width: 0;
    width: 124px;
}

.native-grid tbody tr:nth-child(even) {
    background: #fbfdff;
}

.native-grid tbody tr:hover {
    background: #eef6ff;
}

.native-grid-modal-backdrop {
    align-items: center;
    background: rgba(15, 23, 42, .36);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 1000;
}

.native-grid-modal {
    background: #ffffff;
    border: 1px solid #d7e3ef;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
    max-width: 720px;
    overflow: hidden;
    width: min(720px, 100%);
}

.native-grid-confirm-modal {
    max-width: 420px;
}

.native-grid-message-modal {
    max-width: 780px;
}

.native-grid-permissions-modal {
    max-width: 1180px;
    width: min(1180px, calc(100vw - 24px));
}

.native-grid-legend-modal {
    max-width: 420px;
}

.native-grid-modal-header,
.native-grid-modal-footer {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

.native-grid-modal-header {
    border-bottom: 1px solid #e7eef8;
    font-weight: 800;
}

.native-grid-modal-footer {
    border-top: 1px solid #e7eef8;
    justify-content: flex-end;
}

.native-grid-edit-form {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
}

.native-grid-edit-field {
    display: grid;
    gap: 6px;
}

.native-grid-edit-field span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.native-grid-edit-field input:not([type="checkbox"]) {
    border: 1px solid #c8d5e3;
    border-radius: 6px;
    min-height: 36px;
    padding: 7px 10px;
}

.native-grid-edit-field input[type="checkbox"] {
    height: 22px;
    width: 22px;
}

.native-grid-confirm-body {
    padding: 18px 16px;
}

.native-grid-legend-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.native-grid-legend-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 24px minmax(0, 1fr);
}

.native-grid-message-meta {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.native-grid-message-body {
    background: #f8fafc;
    border: 0;
    color: #0f172a;
    font: inherit;
    line-height: 1.45;
    margin: 0;
    max-height: 62vh;
    overflow: auto;
    padding: 16px;
    white-space: pre-wrap;
    word-break: break-word;
}

.native-grid-permissions-error {
    padding: 12px 16px 0;
}

.native-grid-permissions-body {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    align-items: start;
    display: grid;
    gap: 12px;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(66vh, 720px);
    overflow: auto;
    padding: 12px;
}

.native-grid-permissions-column {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.native-grid-permission-section {
    align-self: start;
    background: #ffffff;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
}

.native-grid-permission-section-title {
    align-items: center;
    background: #f4f8fc;
    border-bottom: 1px solid #e1eaf3;
    color: #263f5c;
    display: flex;
    font-size: 12px;
    font-weight: 800;
    gap: 8px;
    letter-spacing: .06em;
    padding: 10px 12px;
    text-transform: uppercase;
}

.native-grid-permission-section-title .dx-icon {
    color: #2563eb;
    font-size: 16px;
}

.native-grid-permission-rows {
    display: grid;
}

.native-grid-permission-row {
    align-items: center;
    border-bottom: 1px solid #edf2f7;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    padding: 8px 18px 8px 10px;
}

.native-grid-permission-row:last-child {
    border-bottom: 0;
}

.native-grid-permission-label {
    color: #122033;
    font-size: 13px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.native-grid-permission-options {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    min-width: max-content;
}

.native-grid-permission-option {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d7e3ef;
    border-radius: 6px;
    color: #607188;
    cursor: pointer;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    gap: 5px;
    justify-content: center;
    min-height: 32px;
    min-width: 104px;
    overflow: hidden;
    padding: 5px 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.native-grid-permission-option.permission-state-1 {
    min-width: 132px;
}

.native-grid-permission-option span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.native-grid-permission-option:hover {
    background: #eef6ff;
    border-color: #93c5fd;
}

.native-grid-permission-option.selected {
    color: #ffffff;
}

.native-grid-permission-option.permission-state-0.selected {
    background: #b91c1c;
    border-color: #b91c1c;
}

.native-grid-permission-option.permission-state-1.selected {
    background: #15803d;
    border-color: #15803d;
}

.native-grid-permission-option.permission-state-2.selected {
    background: #2563eb;
    border-color: #2563eb;
}

.energy-consumption-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(520px, 42%) minmax(0, 1fr);
    min-height: calc(100vh - 140px);
}

.energy-grid-panel,
.energy-chart-card {
    background: #ffffff;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(31, 54, 88, .05);
    min-width: 0;
    overflow: hidden;
}

.energy-grid-panel {
    padding: 12px;
}

.energy-grid-panel .native-grid-shell {
    height: 100%;
    min-height: 0;
}

.energy-chart-stack {
    display: grid;
    gap: 16px;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 0;
}

.energy-chart-card {
    align-items: stretch;
    display: grid;
    min-height: 300px;
    padding: 14px 16px;
}

.energy-chart-placeholder {
    align-self: center;
    color: #64748b;
    justify-self: center;
}

.energy-chart-svg {
    display: block;
    height: 100%;
    min-height: 270px;
    width: 100%;
}

.energy-chart-gridline {
    stroke: #d6d6d6;
    stroke-width: 1;
}

.energy-chart-axis {
    stroke: #6f7177;
    stroke-width: 1;
}

.energy-chart-axis-label,
.energy-chart-axis-title,
.energy-chart-legend {
    fill: #667085;
    font-size: 12px;
}

.energy-chart-axis-title {
    font-size: 13px;
}

.energy-line-series {
    fill: none;
    stroke: #2d91ad;
    stroke-width: 2;
}

.energy-line-point,
.energy-legend-swatch,
.energy-bar-series {
    fill: #2d91ad;
}

@media (max-width: 1180px) {
    .energy-consumption-layout {
        grid-template-columns: 1fr;
    }

    .energy-chart-stack {
        grid-template-rows: minmax(300px, auto) minmax(300px, auto);
    }
}

@media (max-width: 900px) {
    .native-grid-permissions-body {
        grid-template-columns: 1fr;
    }

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

    .native-grid-permission-options {
        justify-content: stretch;
        min-width: 0;
    }

    .native-grid-permission-option,
    .native-grid-permission-option.permission-state-1 {
        flex: 1 1 0;
        min-width: 0;
    }
}

.dashboard-soc-panel .native-grid-frame {
    border: 0;
    border-radius: 0;
}

.dashboard-soc-panel .native-grid {
    table-layout: fixed;
}

.dashboard-soc-panel .native-grid th,
.dashboard-soc-panel .native-grid td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
}

.dashboard-soc-panel .native-grid th:nth-child(2),
.dashboard-soc-panel .native-grid td:nth-child(2) {
    overflow-wrap: anywhere;
    text-align: justify;
    text-overflow: clip;
    white-space: normal;
}

.dashboard-soc-panel .native-grid th:first-child,
.dashboard-soc-panel .native-grid td:first-child {
    white-space: nowrap;
    width: 145px;
}

.native-grid-number {
    text-align: right;
    unicode-bidi: normal;
}

.native-grid-message-justified {
    line-height: 1.45;
    overflow-wrap: anywhere !important;
    text-align: justify !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: break-word;
}

.native-grid-sort-icon {
    display: inline-block;
    height: 0;
    margin-left: 2px;
    width: 0;
}

.native-grid-sort-asc {
    border-bottom: 8px solid #3b82f6;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.native-grid-sort-desc {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid #3b82f6;
}

.blazor-table-host {
    overflow: auto;
}

.blazor-table-host table {
    width: 100%;
    border-collapse: collapse;
}

.blazor-table-host th,
.blazor-table-host td {
    border-bottom: 1px solid #d9e2ec;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: 8px 16px;
    position: fixed;
    right: 0;
    z-index: 10000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
}
