@import url("../../share/colors.css");

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.monitor-matters__header {
    margin-bottom: 40px;
}

.monitor-matters__heading {
    color: var(--Text-Primary, #202D4E);
    text-align: center;

    font-size: 56px;
    font-style: normal;
    font-weight: 700;
    line-height: 114%;
    letter-spacing: -0.56px;
    margin-bottom: 16px;
}

.monitor-matters__heading-accent {
    color: var(--Brand-Primary-100, #112AD4);
}

.monitor-matters__note {
    color: var(--Extended-Muted-Blue-Gray, #41537A);
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    line-height: 150%;
}

.monitor-matters__body {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}




.monitor-matters-card {
    flex: 1;
    min-width: 420px;
    border-radius: 28px;
    background: var(--Brand-Primary-Lighter, #F6F7FF);
    padding: 38px 16px 16px 16px;
}

.monitor-matters-card__eyebrow {
    display: flex;
    padding: 8px 16px;
    align-items: center;
    gap: 8px;
    border-radius: 50px;
    background: var(--Brand-Primary-5, rgba(17, 42, 212, 0.05));
    width: fit-content;
    color: var(--Brand-Primary-100, #112AD4);
    font-size: 11px;
    font-weight: 700;
    line-height: 130%;
    letter-spacing: 0.055px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.monitor-matters-card__eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--Brand-Primary-100, #112AD4);
    flex-shrink: 0;
}

.monitor-matters-card__title {
    color: var(--Text-Primary, #202D4E);
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: 118%;
    letter-spacing: -0.16px;
    margin-bottom: 10px;
}

.monitor-matters-card__description {
    color: var(--Text-Primary-70, rgba(32, 45, 78, 0.70));
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 150%;
    max-width: 30ch;
    margin-bottom: 14px;
}

.monitor-matters-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

@media (min-width: 1025px) {
    .monitor-matters-card__tags {
        flex-wrap: nowrap;
    }
}

.monitor-matters-tag {
    display: flex;
    padding: 10px 14px;
    align-items: center;
    gap: 8px;
    border-radius: 48px;
    background: var(--Brand-Primary-5, rgba(17, 42, 212, 0.05));
    white-space: nowrap;
}

.monitor-matters-tag__icon {
    display: flex;
    width: 18px;
    height: 18px;
    padding: 4px;
    justify-content: center;
    align-items: center;
    border-radius: 9px;
    background: var(--Brand-Primary-20, rgba(17, 42, 212, 0.20));
    flex-shrink: 0;
}

.monitor-matters-tag__icon svg {
    width: 9px;
    height: 9px;
}

.monitor-matters-card__media {
    display: flex;
    height: 260px;
    padding: 16px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    align-self: stretch;
    border-radius: 16px;
    background: var(--BG-White, #FFF);
    position: relative;
}

.device-illustration {
    display: block;
    height: auto;
}

.device-illustration--photo {
    width: auto;
    height: 227px;
    object-fit: contain;
}

.reading-badge {
    position: absolute;
    z-index: 10;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 40px;
    background: var(--Brand-Primary-Light, #EFF1FF);
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 12px;
    font-weight: 500;
    line-height: 150%;
}

.reading-badge__icon {
    color: var(--color-primary);
    display: inline-flex;
    margin-right: 7px;
}

.reading-badge__icon svg {
    width: 16px;
    height: 16px;
}

.reading-badge__value {
    color: var(--Brand-Primary, #112AD4);
    font-size: 12px;
    font-weight: 700;
    line-height: 130%;
    letter-spacing: 0.12px;
    margin-left: 4px;
}

.reading-sublabel {
    position: absolute;
    z-index: 10;
    top: 19px;
    right: 14px;
    color: var(--Text-Secondary, #8893A8);
    font-size: 10px;
    font-weight: 500;
    line-height: 140%;
}

.error {
    color: var(--Status-Error, #D92D20);
}

.monitor-matters_device-activity {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    padding: 0 50px;
}

.monitor-matters_device-activity-title {
    width: 100%;
    color: var(--Text-Secondary, #8893A8);
    font-size: 10px;
    font-weight: 500;
    line-height: 140%;
    margin: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-align: center;
}

.monitor-matters_device-activity-dot {
    position: relative;
    border-radius: 50%;
    border: 3px solid var(--Brand-Primary);
    width: 12px;
    height: 12px;

}

.monitor-matters_device-activity-label {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translate(-50%, 0);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.monitor-matters_device-activity-status {
    color: var(--Text-Primary-90, rgba(32, 45, 78, 0.90));
    font-size: 12px;
    font-weight: 700;
    line-height: 130%;
    letter-spacing: 0.12px;
    text-align: center;
    white-space: nowrap;
}

.monitor-matters_device-activity-dot.activity-dot_open {
    border-color: var(--Status-Error, #D92D20);
}

.monitor-matters_device-activity-time {
    color: var(--Text-Secondary, #8893A8);
    font-size: 10px;
    font-weight: 500;
    line-height: 140%;
    text-align: center;
}

.monitor-matters_device-activity-line {
    flex: 1;
    height: 1px;
    background: var(--Brand-Primary);
}

.monitor-matters-card__humidity-level {
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/*humidity chart*/

.stat-card {
    width: 100%;
    max-width: 480px;
    border-radius: 24px;
    padding: clamp(20px, 4vw, 32px);
}

/* ---------- top summary row ---------- */
.stat-card__summary {
    display: flex;
    align-items: start;
    gap: clamp(16px, 4vw, 32px);
    width: 100%;
    margin-bottom: 32px;
}

.stat-card__col {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    position: relative;
}

.stat-card__col + .stat-card__col {
    padding-left: 22px;
    border-left: 1px solid var(--Border-Dark, #D7DEE3);
}

.stat-card__label {
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 12px;
    font-weight: 500;
    line-height: 150%;
}

.stat-card__value {
    color: var(--Status-Success, #009C5B);
    font-size: 38px;
    font-weight: 700;
    line-height: normal;
}

.stat-card__range {
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 16px;
    font-weight: 700;
    line-height: 150%;
    margin: 4px 0;
}

.stat-card__status {
    color: var(--Status-Success, #009C5B);
    font-size: 10px;
    font-weight: 500;
    line-height: 140%;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-card__status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--Status-Success);
    flex-shrink: 0;
}

/* ---------- chart section ---------- */
.stat-card__chart {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: clamp(6px, 1.5vw, 12px);
    width: 100%;
    height: 113px;
}

.chart-yaxis {
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
    line-height: 140%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: right;
}

.chart-plot {
    position: relative;
    width: 100%;
    min-width: 0;
    border-radius: 8px;
    background-size: 100% 100%, 100% 100%;
    overflow: hidden;
}
.chart-plot__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 720 / 190;
    object-fit: fill;
}

.chart-xaxis {
    color: var(--Extended-Dark-Graphite, #101727);
    text-align: right;
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
    line-height: 140%;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.chart-xaxis span {
    display: inline-flex;
    width: 16px;
    white-space: nowrap;
    text-align: center;

}
.chart-xaxis span:first-child { text-align: left;
    margin-left: -8px;
}
.chart-xaxis span:last-child { text-align: right;
    margin-right: -8px;
}

@media (max-width: 360px) {
    .stat-card__summary {
        flex-direction: column;
    }
    .stat-card__col + .stat-card__col {
        padding-left: 0;
        border-left: none;
        padding-top: 16px;
        border-top: 1px solid var(--color-divider);
    }
    .stat-card__col:first-child::before {
        display: none;
    }
}

.monitor-matters-card__humidity-level-data {
    padding: 22px;
}

.monitor-matters-card__alert-data {
    padding: 0;
    height: 100%;
    justify-content: flex-end;
    gap: 0;
}

.monitor-matters-card__alert-data .stat-card__summary {
    border-bottom: 1px solid var(--Border-Default, #E9EBF3);
    margin-bottom: 16px;
    padding-bottom: 16px;
    display: flex;
    gap: 0;
}

.monitor-matters-card__alert-data .stat-card__summary .stat-card__col {
    padding: 8px 12px;
}

.monitor-matters-card__alert-data .stat-card__summary .stat-card__col:last-child {
    padding: 8px 12px 8px 16px;
}

.monitor-matters-card__alert-data .stat-card__summary .stat-card__label {
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: 150%;
}

.monitor-matters-card__alert-data .stat-card__summary .current .stat-card__value {
    color: var(--Brand-Primary, #112AD4);
}

.monitor-matters-card__alert-data .stat-card__summary .stat-card__value {
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: 120%;
    letter-spacing: -0.064px;
}

.alert-block_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 0 12px;
    width: 100%;
}

.alert-block_header-right {
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 150%;
}

.alert-block_header-left {
    color: var(--Chart-Orange, #D0691F);
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 155%;
    display: flex;
    align-items: center;
    gap: 7px;
}

.monitor-matters-card__alert-block {
    display: flex;
    align-items: center;
    justify-content: start;
    width: 100%;
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 155%;
    padding-left: 12px;
}


/*Fleet view table*/
.table-container {
    padding: 0;
}


.table-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 0 16px;
    width: 100%;
    overflow-x: auto; /* Горизонтальна прокрутка на мобілках */
}

/* Головний Flex-контейнер таблиці */
.flex-table {
    display: flex;
    flex-direction: column;
    color: var(--Extended-Dark-Graphite, #101727);
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: 150%;
}

/* Рядки таблиці */
.table-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f2f5;
    height: 50px;
}

.table-row:last-child {
    border-bottom: none;
}

/* Заголовок */
.table-row.header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
    font-weight: 500;
    color: #4a5568;
}

/* Колонки */
.col {
    display: flex;
    align-items: center;
    padding: 0;
    font-size: 15px;
    color: #1a202c;
    justify-content: center;
}

.col.col-trailer {
    justify-content: start;
}

/* Пропорції колонок */
.col-trailer  { flex: 1; }
.col-temp     { flex: 1.2; }
.col-target   { flex: 1.2; }
.col-humidity { flex: 1; }
.col-door     { flex: 1; }
.col-chart    { flex: 2.5; }

/* Стилізація конкретних елементів */
.status-dot {
    width: 8px;
    height: 8px;
    background-color: #00b074;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.text-green {
    color: #00b074;
    font-weight: 500;
}

.reading-time {
    position: absolute;
    top: 20px;
    right: 14px;
    color: var(--Text-Secondary, #8893A8);
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
    line-height: 140%; /* 14px */
}

/* Обгортка графіка та осі Y */
.chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 10px;
}

.chart-img {
    width: 170px;
    height: 40px;
    object-fit: contain;
}

.table-row.mobile {
    display: none;
}

.y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 42px;
    font-size: 12px;
    color: #a0aec0;
    white-space: nowrap;
}

.timeline {
    color: var(--Text-Secondary, #8893A8);
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
    line-height: 140%; /* 14px */
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    padding-top: 7px;
    padding-right: 25px;
}

@media (max-width: 1024px) {
    .monitor-matters-card__description {
        max-width: 100%;
    }
    .monitor-matters_device-activity-line {
        margin: 0 24px;
    }
}

@media (max-width: 576px) {
    .monitor-matters__header {
        margin-bottom: 32px;
    }
    .monitor-matters__heading {
        font-size: 32px;
        font-weight: 700;
        line-height: 118%;
        letter-spacing: -0.16px;
        margin-bottom: 6px;
    }
    .monitor-matters__note {
        font-size: 14px;
        font-weight: 500;
        line-height: 150%;
    }
    .monitor-matters-card__description {
        max-width: 200px;
        font-size: 13px;
        font-style: normal;
        font-weight: 500;
        line-height: 154%; /* 20.02px */
    }
    .monitor-matters-card {
        padding: 24px 16px 16px 16px;
        min-width: auto;
        border-radius: 16px;
    }
    .monitor-matters-card__eyebrow {
        font-size: 8px;
        font-weight: 700;
        line-height: normal;
        letter-spacing: 0.785px;
    }
    .monitor-matters-card__title {
        font-size: 24px;
        font-style: normal;
        font-weight: 700;
        line-height: 124%; /* 29.76px */
        letter-spacing: -0.072px;
        margin-bottom: 8px;
    }

    .monitor-matters-card__tags .monitor-matters-tag {
        font-size: 12px;
        font-style: normal;
        font-weight: 500;
        line-height: 150%; /* 18px */
    }

    .monitor-matters-card__tags .monitor-matters-tag__icon {
 width: 12px;
        height: 12px;
        padding: 2px;
    }

    .reading-badge {
        padding: 8px 8px 8px 10px;
        font-size: 10px;
        font-style: normal;
        font-weight: 500;
        line-height: 140%; /* 14px */
    }
    .reading-badge__icon {
        margin-right: 4px;
    }
    .reading-badge__icon svg {
        width: 12px;
        height: 12px;
    }
    .monitor-matters_device-activity-line {
        margin: 0 7px;
    }
    .monitor-matters_device-activity-status {
        font-size: 11px;
        font-style: normal;
        font-weight: 700;
        line-height: 130%; /* 14.3px */
        letter-spacing: 0.055px;
        text-transform: uppercase;
    }
    .monitor-matters_device-activity-time {
        font-size: 9px;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
    }
    .stat-card__label {
        font-size: 10px;
        font-style: normal;
        font-weight: 500;
        line-height: 140%; /* 14px */
    }
    .stat-card__value {
        font-size: 28px;
        font-style: normal;
        font-weight: 700;
        line-height: 120%; /* 33.6px */
        letter-spacing: -0.084px;
    }
    .stat-card__range {
        font-size: 16px;
        font-style: normal;
        font-weight: 700;
        line-height: 137%; /* 21.92px */
        margin: 0;
    }
    .stat-card__summary {
        margin-bottom: 0;
    }
    .alert-block_header-left {
        font-size: 12px;
        font-style: normal;
        font-weight: 500;
        line-height: 150%; /* 18px */
    }
    .alert-block_header-left svg {
        width: 14px;
        height: 14px;
    }
    .alert-block_header-right {
        font-size: 14px;
        font-style: normal;
        font-weight: 500;
        line-height: 150%; /* 21px */
    }
    .table-row .header .col {
        text-align: center;
        font-size: 7px;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
    }
    .table-row .col {
        font-size: 7px;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
    }

    .chart-img {
        width: 75px;
        height: 22px;
    }
    .y-axis {
        font-size: 5.547px;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
        height: 22px;
    }
    .timeline {
        font-size: 5.547px;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
        gap: 10px;
        padding-top: 3px;
        padding-right: 10px;
    }
    .table-row {
        height: 30px;
    }
    .table-row.mobile {
        display: flex;
    }

    .monitor-matters-card__media.table-container {
        height: 200px;
    }

    .monitor-matters_device-activity {
        padding: 0 27px;
    }

    .monitor-matters-card__alert-data .stat-card__summary .stat-card__value
    {
        font-size: 26px;
        font-style: normal;
        font-weight: 700;
        line-height: 123%; /* 31.98px */
        letter-spacing: -0.052px;
    }

    .alert-block_header {
        padding: 0;
    }

    .monitor-matters-card.threshold-alerts .monitor-matters-card__media {
        height: 200px;
    }

    .monitor-matters-card.threshold-alerts .monitor-matters-card__alert-block {
        padding: 0;
    }

    .monitor-matters-card.threshold-alerts .monitor-matters-card__eyebrow-dot {
        margin-right: 7px;
    }

    .monitor-matters-card__tags {
        gap: 8px;
    }

    .status-dot {
        width: 3px;
        height: 3px;
        margin-right: 3px;
    }
}

