/* Shared FxIoT UI components. Product version is intentionally not encoded in this filename. */

.fx-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

.fx-page-header-copy {
    min-width: 0;
}

.fx-page-header-kicker {
    margin-bottom: 3px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.fx-page-header h1 {
    margin: 0;
    color: var(--fx-text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.25px;
}

.fx-page-header p {
    margin: 4px 0 0;
    color: var(--fx-text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.fx-page-header-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--fx-text-muted);
}

.fx-page-header-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
    min-height: 34px;
}

.fx-page-header-status,
.fx-page-header-actions,
.fx-page-header-secondary-actions,
.fx-page-header-primary-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.fx-live-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--fx-text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.fx-live-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fx-success);
    box-shadow: 0 0 0 3px var(--fx-success-soft);
}

.fx-attention-strip {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin-bottom: 12px;
    padding: 9px 12px;
    border: 1px solid var(--fx-border);
    border-left-width: 3px;
    border-radius: var(--fx-radius-lg);
    background: var(--fx-panel);
}

.fx-attention-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 15px;
}

.fx-attention-copy {
    min-width: 0;
}

.fx-attention-copy strong,
.fx-attention-copy span {
    display: block;
}

.fx-attention-copy strong {
    color: var(--fx-text);
    font-size: 13px;
}

.fx-attention-copy span {
    margin-top: 2px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.fx-attention-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fx-attention-info {
    border-left-color: var(--fx-primary);
    background: var(--fx-primary-soft);
}

.fx-attention-info .fx-attention-icon {
    color: var(--fx-primary);
    background: var(--fx-panel);
}

.fx-attention-success {
    border-left-color: var(--fx-success);
    background: var(--fx-success-soft);
}

.fx-attention-success .fx-attention-icon {
    color: var(--fx-success);
    background: var(--fx-panel);
}

.fx-attention-warning {
    border-left-color: var(--fx-warning);
    background: var(--fx-warning-soft);
}

.fx-attention-warning .fx-attention-icon {
    color: var(--fx-warning);
    background: var(--fx-panel);
}

.fx-attention-error {
    border-left-color: var(--fx-error);
    background: var(--fx-error-soft);
}

.fx-attention-error .fx-attention-icon {
    color: var(--fx-error);
    background: var(--fx-panel);
}

.fx-entity-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 9px 12px;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-lg);
    background: var(--fx-panel);
}

.fx-entity-context-main,
.fx-entity-context-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.fx-entity-code {
    color: var(--fx-text);
    font-weight: 650;
}

.fx-entity-meta {
    color: var(--fx-text-muted);
}

.fx-metric-card-clickable {
    cursor: pointer;
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.fx-metric-card-clickable:hover {
    border-color: var(--fx-border-strong);
    transform: translateY(-1px);
}

.fx-quick-start-flow,
.fx-tcp-status-flow {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-lg);
    background: var(--fx-panel);
}

.fx-quick-start-heading,
.fx-tcp-status-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.fx-quick-start-heading > div,
.fx-tcp-status-heading > div {
    min-width: 0;
}

.fx-quick-start-heading strong,
.fx-quick-start-heading span,
.fx-tcp-status-heading strong,
.fx-tcp-status-heading span {
    display: block;
}

.fx-quick-start-heading strong,
.fx-tcp-status-heading strong {
    color: var(--fx-text);
    font-size: 14px;
}

.fx-quick-start-heading > div > span,
.fx-tcp-status-heading > div > span,
.fx-quick-start-hint,
.fx-tcp-status-heading > span {
    margin-top: 2px;
    color: var(--fx-text-muted);
    font-size: 11px;
}

.fx-quick-start-steps,
.fx-tcp-status-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.fx-quick-start-step {
    position: relative;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    color: inherit;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-md);
    background: var(--fx-panel-muted);
    text-decoration: none;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.fx-quick-start-step:not(:last-child)::after {
    position: absolute;
    z-index: 1;
    right: -7px;
    content: "›";
    color: var(--fx-text-muted);
    font-size: 14px;
    line-height: 1;
}

.fx-quick-start-step:hover {
    border-color: color-mix(in srgb, var(--fx-primary) 55%, var(--fx-border));
    background: var(--fx-primary-soft);
    transform: translateY(-1px);
}

.fx-quick-start-step > span:last-child,
.fx-quick-start-step strong,
.fx-quick-start-step small {
    display: block;
    min-width: 0;
}

.fx-quick-start-step strong {
    color: var(--fx-text);
    font-size: 12px;
    line-height: 1.35;
}

.fx-quick-start-step small {
    margin-top: 2px;
    color: var(--fx-text-muted);
    font-size: 10px;
    line-height: 1.35;
}

.fx-quick-start-index {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: var(--fx-primary);
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    background: var(--fx-primary-soft);
}

.fx-guided-empty-state {
    display: grid;
    justify-items: center;
    padding: 28px 16px 32px;
    text-align: center;
}

.fx-guided-empty-state .ant-empty {
    padding: 0 !important;
}

.fx-guided-empty-state p {
    max-width: 560px;
    margin: 8px 0 0;
    color: var(--fx-text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.fx-guided-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.fx-tcp-status-flow {
    margin-top: 4px;
    background: var(--fx-panel-muted);
}

.fx-tcp-status-step {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-md);
    background: var(--fx-panel);
}

.fx-tcp-status-step strong {
    overflow: hidden;
    color: var(--fx-text);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fx-tcp-status-step small {
    color: var(--fx-text-muted);
    font-size: 10px;
    white-space: nowrap;
}

.fx-tcp-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fx-border-strong);
}

.fx-tcp-status-step.is-ready {
    border-color: color-mix(in srgb, var(--fx-success) 35%, var(--fx-border));
}

.fx-tcp-status-step.is-ready .fx-tcp-status-dot {
    background: var(--fx-success);
    box-shadow: 0 0 0 3px var(--fx-success-soft);
}


@media (max-width: 1180px) {
    .fx-page-header {
        flex-direction: column;
        gap: 10px;
    }

    .fx-page-header-side {
        width: 100%;
        justify-content: space-between;
    }

    .fx-quick-start-steps,
    .fx-tcp-status-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fx-quick-start-step::after {
        display: none;
    }

}

@media (max-width: 900px) {
    .fx-page-header-side,
    .fx-entity-context-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .fx-quick-start-heading,
    .fx-tcp-status-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .fx-quick-start-steps,
    .fx-tcp-status-steps {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 640px) {
    .fx-page-header-actions,
    .fx-page-header-actions .ant-space,
    .fx-attention-actions {
        width: 100%;
    }

    .fx-attention-strip {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .fx-attention-actions {
        grid-column: 1 / -1;
    }

}
/* Thing/device scoped raw measurement export */
.raw-export-drawer {
    display: grid;
    gap: 16px;
}

.raw-export-scope,
.raw-export-filter,
.raw-export-preview {
    border: 1px solid var(--fx-border-color, #e5e7eb);
    border-radius: 8px;
    background: var(--fx-panel-background, #fff);
}

.raw-export-scope {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.raw-export-scope div,
.raw-export-preview-heading > div {
    display: grid;
    gap: 3px;
}

.raw-export-scope span,
.raw-export-scope small,
.raw-export-preview-heading small,
.raw-export-table small {
    color: var(--fx-text-secondary, #64748b);
}

.raw-export-filter {
    padding: 14px 16px 16px;
}

.raw-export-filter-heading,
.raw-export-preview-heading,
.raw-export-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.raw-export-filter-heading {
    justify-content: flex-start;
    margin-bottom: 10px;
}

.raw-export-text-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ant-primary-color, #1677ff);
    cursor: pointer;
}

.raw-export-device-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    max-height: 148px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--fx-page-background, #f8fafc);
}

.raw-export-device-list label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.raw-export-device-list small,
.raw-export-table td small {
    display: block;
    font-size: 12px;
}

.raw-export-date-row {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-top: 14px;
}

.raw-export-date-row label {
    display: grid;
    gap: 6px;
}

.raw-export-date-row .ant-picker {
    min-width: 170px;
}

.raw-export-preview-heading {
    padding: 12px 16px;
    border-bottom: 1px solid var(--fx-border-color, #e5e7eb);
}

.raw-export-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
}

.raw-export-table-wrap {
    max-height: 310px;
    overflow: auto;
}

.raw-export-table {
    width: 100%;
    border-collapse: collapse;
}

.raw-export-table th,
.raw-export-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--fx-border-color, #eef0f3);
    text-align: left;
    white-space: nowrap;
}

.raw-export-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--fx-page-background, #f8fafc);
    color: var(--fx-text-secondary, #64748b);
    font-weight: 500;
}

.raw-export-row-unavailable {
    opacity: .62;
}

.raw-export-empty-inline {
    padding: 14px;
    color: var(--fx-text-secondary, #64748b);
    background: var(--fx-page-background, #f8fafc);
    border-radius: 6px;
}

.raw-export-actions {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    background: var(--fx-panel-background, #fff);
}

.raw-export-actions > div {
    display: flex;
    gap: 8px;
}

@media (max-width: 720px) {
    .raw-export-device-list {
        grid-template-columns: 1fr;
    }

    .raw-export-date-row,
    .raw-export-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
