.monitor-page {
    min-height: 100vh;
    padding: 22px;
    background: #eef3f1;
    color: #24313d;
}

.monitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 46px;
    height: 46px;
}

.brand p {
    color: #0b8f5a;
    font-weight: 700;
}

.brand h1 {
    font-size: 28px;
    line-height: 36px;
}

.back-link,
.monitor-side button {
    height: 38px;
    border: 0;
    border-radius: 7px;
    padding: 0 16px;
    background: #12875a;
    color: #fff;
    font-weight: 700;
    line-height: 38px;
}

.monitor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
}

.monitor-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

.video-panel,
.monitor-side section {
    border: 1px solid #dde8e3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(32, 48, 42, 0.06);
}

.video-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 70px;
    padding: 14px 18px;
    border-bottom: 1px solid #e7efeb;
}

.video-toolbar strong,
.video-toolbar span {
    display: block;
}

.video-toolbar span {
    margin-top: 4px;
    color: #6c7884;
    font-size: 13px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 94px;
    color: #64727d;
    font-size: 13px;
}

.live-badge i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a9b6bf;
}

.live-badge.online i {
    background: #13ad6c;
}

.preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 620px;
    overflow: hidden;
    background: #0d151c;
}

.preview img {
    display: none;
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
}

.preview video {
    display: none;
    width: 100%;
    max-height: 78vh;
    background: #000;
}

.preview.has-image img {
    display: block;
}

.preview.has-image #emptyState {
    display: none;
}

#emptyState {
    display: grid;
    gap: 10px;
    max-width: 430px;
    color: #d9e6ef;
    text-align: center;
    line-height: 26px;
}

#emptyState b {
    font-size: 20px;
    color: #fff;
}

.monitor-side {
    display: grid;
    gap: 14px;
    align-content: start;
}

.monitor-side section {
    padding: 18px;
}

.monitor-side h2 {
    margin-bottom: 14px;
    font-size: 17px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: #65727d;
    font-size: 13px;
}

.control-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
}

.control-row #stopCameraBtn {
    grid-column: 1 / -1;
    background: #5f6e79;
}

.monitor-side input[type="number"] {
    width: 100%;
    height: 38px;
    border: 1px solid #d8e4df;
    border-radius: 7px;
    padding: 0 10px;
    background: #fbfdfc;
}

.upload-box {
    display: grid;
    gap: 8px;
    min-height: 104px;
    margin-bottom: 12px;
    border: 1px dashed #92b8a8;
    border-radius: 8px;
    padding: 16px;
    background: #f6fbf8;
    color: #42515b;
    cursor: pointer;
}

.upload-box input {
    width: 100%;
}

.upload-box span {
    font-weight: 700;
}

.upload-box b {
    color: #6d7a84;
    font-size: 13px;
    word-break: break-all;
}

#uploadBtn {
    width: 100%;
}

#uploadBtn:disabled {
    background: #8fa29a;
    cursor: not-allowed;
}

.range-row {
    display: grid;
    grid-template-columns: 58px 1fr 44px;
    align-items: center;
    gap: 10px;
    color: #65727d;
}

.detect-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.detect-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 7px;
    background: #f3f7f5;
    color: #4f5f68;
}

.detect-list b {
    color: #12875a;
}

.hint-text {
    color: #64727d;
    font-size: 13px;
    line-height: 22px;
}

@media (max-width: 980px) {
    .monitor-layout {
        grid-template-columns: 1fr;
    }

    .preview {
        min-height: 420px;
    }
}

@media (max-width: 560px) {
    .monitor-page {
        padding: 14px;
    }

    .monitor-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .control-row,
    .range-row {
        grid-template-columns: 1fr;
    }
}
