
/* =====================================================
   FOOD SAVER - SENSOR DATA
   All information visible in sensor cards
   ===================================================== */

.sensor-data-page {
    width: 100%;
    min-width: 0;
    padding: clamp(12px, 1.3vw, 20px);
    color: #eaf4f7;
    background: #000;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

.sensor-data-page *,
.sensor-data-page *::before,
.sensor-data-page *::after {
    box-sizing: border-box;
}

.sd-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sd-page-header h1 {
    margin: 0 0 5px;
    color: #f4fbff;
    font-size: clamp(22px, 1.8vw, 28px);
}

.sd-page-header p,
.sd-panel-header p {
    margin: 0;
    color: #8fa9b5;
    font-size: 12px;
    line-height: 1.5;
}

.sd-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 7px 10px;
    color: #00e6a0;
    background: #05251e;
    border: 1px solid #17694f;
    border-radius: 20px;
    font-size: 11px;
}

.sd-live-indicator > span:first-child {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #00e6a0;
}

.sd-live-indicator.offline {
    color: #ff7777;
    background: #2b1115;
    border-color: #743d43;
}

.sd-live-indicator.offline > span:first-child {
    background: #ff7777;
}

/* Main panel */

.sd-panel {
    min-width: 0;
    overflow: hidden;
    background: #04131b;
    border: 1px solid #006a86;
    border-radius: 9px;
}

.sd-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #061a24;
    border-bottom: 1px solid #164455;
}

.sd-panel-header h2 {
    margin: 0 0 5px;
    color: #f4fbff;
    font-size: 16px;
}

.sd-count {
    flex-shrink: 0;
    padding: 6px 9px;
    color: #75d9ff;
    background: #082532;
    border: 1px solid #16566b;
    border-radius: 6px;
    font-size: 11px;
}

/* Sensor cards */

.sd-sensor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    padding: 12px;
}

.sd-sensor-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #061a24;
    border: 1px solid #16566b;
    border-radius: 8px;
    overflow: hidden;
}

.sd-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-height: 62px;
    padding: 12px;
    border-bottom: 1px solid #163744;
}

.sd-card-heading {
    min-width: 0;
}

.sd-card-heading h3 {
    margin: 0;
    color: #f4fbff;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.sd-card-heading p {
    margin: 4px 0 0;
    color: #7899a7;
    font-size: 10px;
    overflow-wrap: anywhere;
}

.sd-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    max-width: 48%;
    padding: 4px 7px;
    color: #00e6a0;
    background: #05291f;
    border: 1px solid #28644f;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.sd-status::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: currentColor;
}

.sd-status.warning {
    color: #ffc857;
    background: #2a210a;
    border-color: #80632a;
}

.sd-status.error {
    color: #ff7777;
    background: #2b1115;
    border-color: #743d43;
}

.sd-status.unknown {
    color: #b5c2c8;
    background: #152126;
    border-color: #42545b;
}

.sd-status.normal {
    color: #00e6a0;
    background: #05291f;
    border-color: #28644f;
}

/* Main reading */

.sd-card-value-area {
    padding: 13px 12px 10px;
}

.sd-card-value-label {
    color: #8fa9b5;
    font-size: 10px;
}

.sd-card-value {
    margin-top: 5px;
    color: #00e6a0;
    font-size: clamp(24px, 2vw, 30px);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.sd-card-unit {
    margin-left: 3px;
    color: #b9dce8;
    font-size: 12px;
    font-weight: 400;
}

.sd-card-raw {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin-top: 10px;
    padding-top: 8px;
    color: #a8cbd8;
    border-top: 1px solid #163744;
    font-size: 10px;
}

.sd-card-raw span {
    overflow-wrap: anywhere;
}

/* All details visible */

.sd-detail-content {
    display: block;
    margin-top: auto;
    padding: 0 10px 10px;
}

.sd-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.sd-detail-item {
    min-width: 0;
    padding: 8px;
    background: #04131b;
    border: 1px solid #123440;
    border-radius: 5px;
}

.sd-detail-item span {
    display: block;
    color: #7899a7;
    font-size: 9px;
    line-height: 1.4;
}

.sd-detail-item strong {
    display: block;
    margin-top: 4px;
    color: #eaf4f7;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.sd-card-updated {
    margin-top: 9px;
    color: #7899a7;
    font-size: 9px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.sd-empty {
    grid-column: 1 / -1;
    padding: 30px 12px;
    color: #7899a7;
    text-align: center;
    font-size: 12px;
}

/* Tablet */

@media (max-width: 1100px) {
    .sd-sensor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */

@media (max-width: 600px) {
    .sensor-data-page {
        padding: 10px;
    }

    .sd-page-header {
        margin-bottom: 12px;
    }

    .sd-page-header h1 {
        font-size: 23px;
    }

    .sd-live-indicator {
        padding: 6px 8px;
        font-size: 10px;
    }

    .sd-panel-header {
        padding: 12px;
    }

    .sd-panel-header h2 {
        font-size: 15px;
    }

    .sd-sensor-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .sd-card-header {
        min-height: 58px;
        padding: 12px;
    }

    .sd-card-heading h3 {
        font-size: 15px;
    }

    .sd-card-value-area {
        padding: 12px;
    }

    .sd-card-value {
        font-size: 30px;
    }

    .sd-detail-content {
        padding: 0 12px 12px;
    }

    .sd-detail-grid {
        gap: 8px;
    }

    .sd-detail-item {
        padding: 10px;
    }

    .sd-detail-item span {
        font-size: 10px;
    }

    .sd-detail-item strong {
        font-size: 12px;
    }

    .sd-card-updated {
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    .sensor-data-page {
        padding: 7px;
    }

    .sd-sensor-grid {
        padding: 7px;
    }

    .sd-card-header {
        padding: 10px;
    }

    .sd-status {
        padding: 4px 6px;
        font-size: 9px;
    }
}
