* {
    box-sizing: border-box;
}

:root {
    --navy: #071b36;
    --blue: #0878ff;
    --cyan: #15c8f4;
    --green: #1fbf75;
    --red: #e24a4a;
    --background: #f3f6fa;
    --card: #ffffff;
    --text: #10243f;
    --muted: #728197;
    --border: #dce4ee;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 26px;
    background: var(--navy);
    border-radius: 18px;
    color: white;
    box-shadow: 0 16px 36px rgba(7, 27, 54, 0.16);
}

.brand {
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -2px;
}

.brand span {
    color: var(--blue);
}

.tagline {
    margin-top: 4px;
    font-size: 11px;
    letter-spacing: 4px;
    color: #b9d7ff;
}

.environment {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.intro {
    margin: 34px 0 20px;
}

.intro h1 {
    margin: 0;
    font-size: 30px;
}

.intro p {
    margin: 7px 0 0;
    color: var(--muted);
}

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

.room-card {
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(16, 36, 63, 0.07);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.room-card.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.room-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.room-card h2 {
    margin: 0;
    font-size: 22px;
}

.room-card p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.status--on {
    color: #087445;
    background: #e5f8ef;
}

.status--on .status__dot {
    background: var(--green);
}

.status--off {
    color: #9b3131;
    background: #fdeaea;
}

.status--off .status__dot {
    background: var(--red);
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.button {
    border: 0;
    border-radius: 13px;
    padding: 17px 16px;
    color: white;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.button--on {
    background: linear-gradient(135deg, #0ba962, var(--green));
}

.button--off {
    background: linear-gradient(135deg, #c93838, var(--red));
}

.last-update {
    margin-top: 15px;
    color: var(--muted);
    font-size: 12px;
}

.message {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 700;
}

.message--success {
    color: #087445;
    background: #e5f8ef;
    border: 1px solid #b9ead3;
}

.message--error {
    color: #9b3131;
    background: #fdeaea;
    border: 1px solid #f1c4c4;
}

@media (max-width: 760px) {
    .rooms-grid {
        grid-template-columns: 1fr;
    }

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

    .room-card__top {
        flex-direction: column;
    }
}
