﻿.blurry-background {
    backdrop-filter: blur(10px);
}

td.actions, th.actions {
    text-align: center;
    width: 1%;
    white-space: nowrap;
}

.no-wrap {
    white-space: nowrap;
}

.cursor-pointer tbody tr {
    cursor: pointer;
}

td.hex-cell {
    width: 1%;
    white-space: nowrap;
}

.hex-dump {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    color: var(--mud-palette-success);
    background-color: var(--mud-palette-background-grey);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.context-menu {
    opacity: 0.1;
}

[data-hovering] .context-menu {
    opacity: 1;
}

.device-image-dialog__img {
    max-height: 70vh;
}

.device-image-tile__preview {
    cursor: pointer;
}

.position-picker-map {
    height: 320px;
    width: 100%;
    border-radius: 4px;
    /* stacking context so Leaflet's high z-index panes stay below the MudBlazor appbar/drawer */
    position: relative;
    z-index: 0;
}

/* ── Device list ── */

/* A device that has not reported in a week: the whole row reads muted-warning, including the
   caption, so a stale entry is visible without opening it. */
.device-stale {
    color: var(--mud-palette-warning);
}

.filter-select {
    max-width: 220px;
}

.filter-search {
    max-width: 280px;
}

/* MudTable reserves a column for the group expander and then pads it three times over: the header
   holds an empty `ml-4 mr-5` div (36px), every data row an empty `d-flex` div with an inline
   `padding-left: 34px`, and each cell carries the table's own 16px/24px. The column can never be
   narrower than about 76px, which is the empty gap between the chevron and the group heading it
   belongs to — the chevron itself needs none of it.

   Both spacers have to be neutralised, not just the cell: the header's is a margin and the data
   row's an inline style, so a width on the cell alone is overruled by either. */
.grouped-table .mud-table-root tr > :first-child {
    width: 1px;
    padding-inline-start: 8px;
    padding-inline-end: 0;
}

.grouped-table .mud-table-root tr > :first-child > .ml-4,
.grouped-table .mud-table-root tr > :first-child > .d-flex {
    margin-inline: 0 !important;
    padding-left: 0 !important;
}

.device-group {
    font-weight: 500;
}

.device-group--area-group {
    background-color: var(--mud-palette-background-grey);
}

/* Indents the area row under its group without MudTable's own indentation, which also shifts
   the data rows and knocks the columns out of alignment. */
.device-group--area {
    padding-left: 32px;
}

/* Expanded uplink payload: wrap long single-line JSON instead of scrolling the table sideways. */
.json-dump {
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    font-size: 0.8rem;
}

/* ── Device message log ── */

/* Time, direction and status shrink to their content so the message column absorbs the slack
   instead of pushing the status chips off the right edge. */
td.log-narrow, th.log-narrow {
    width: 1%;
    white-space: nowrap;
}

/* The payload preview would otherwise stretch the row to the width of one long JSON line. */
td.log-message {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-time {
    font-variant-numeric: tabular-nums;
}

/* ── Notification log ── */

.notification-detail {
    word-break: break-word;
}

.notification-email-preview {
    width: 100%;
    height: 420px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: var(--mud-palette-surface);
}

.notification-sms-text {
    white-space: pre-wrap;
    margin: 0;
    font-family: inherit;
    font-size: 0.875rem;
}

.alarm-level-select {
    min-width: 140px;
}

.duration-unit-select {
    max-width: 140px;
}

/* ── Uplink timeline ── */

/* One cell per expected reporting cycle, so a dropout reads as a run of red rather than as a
   chart that silently stopped moving. */
.uplink-timeline {
    display: flex;
    gap: 2px;
    height: 28px;
}

/* MudTooltip wraps each cell in its own element, which becomes the flex item — the cells only
   share the width evenly if that wrapper stretches too. */
.uplink-timeline > .mud-tooltip-root {
    flex: 1 1 0;
    min-width: 0;
}

.uplink-slot {
    height: 100%;
    border-radius: 2px;
    background-color: var(--mud-palette-success);
}

.uplink-slot--missed {
    background-color: var(--mud-palette-error);
}
