* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: #172033;
    background: #f5f7fb;
}

body {
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    background: #f5f7fb;
}


/* =========================
   Header
   ========================= */

.topbar {
    background: #ffffff;

    border-bottom: 1px solid #e5e9f2;

    padding: 22px 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.brand h1 {
    font-size: 25px;
    font-weight: 750;

    letter-spacing: -0.5px;
}

.brand p {
    margin-top: 5px;

    color: #687386;

    font-size: 13px;
}

.overall-status {
    display: flex;
    align-items: center;

    gap: 9px;

    font-size: 14px;
    font-weight: 650;

    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #f0ad00;

    box-shadow:
        0 0 0 4px rgba(240, 173, 0, 0.12);
}


/* =========================
   Main
   ========================= */

.container {
    width: min(
        1100px,
        calc(100% - 40px)
    );

    margin: 40px auto;

    flex: 1;
}


/* =========================
   Summary Cards
   ========================= */

.summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 32px;
}

.summary-card {
    background: #ffffff;

    border: 1px solid #e5e9f2;

    border-radius: 13px;

    padding: 22px;

    display: flex;
    flex-direction: column;

    gap: 8px;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.summary-card:hover {
    transform: translateY(-1px);

    box-shadow:
        0 8px 25px rgba(23, 32, 51, 0.06);
}

.summary-label {
    color: #687386;

    font-size: 13px;
}

.summary-card strong {
    font-size: 30px;

    line-height: 1;

    font-weight: 750;
}


/* =========================
   Services
   ========================= */

.services-section {
    background: #ffffff;

    border: 1px solid #e5e9f2;

    border-radius: 14px;

    overflow: hidden;

    box-shadow:
        0 2px 8px rgba(23, 32, 51, 0.025);
}

.section-header {
    padding: 22px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-bottom: 1px solid #e5e9f2;
}

.section-header h2 {
    font-size: 19px;

    font-weight: 700;
}

.section-header p {
    margin-top: 4px;

    color: #687386;

    font-size: 13px;
}


/* =========================
   Buttons
   ========================= */

button {
    border: none;

    border-radius: 8px;

    padding: 10px 15px;

    font-family: inherit;

    font-size: 13px;

    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.15s ease,
        opacity 0.15s ease,
        transform 0.1s ease;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    cursor: not-allowed;

    opacity: 0.55;
}

.primary-btn {
    background: #172033;

    color: #ffffff;
}

.primary-btn:hover {
    background: #27334a;
}

.secondary-btn {
    background: #eef1f5;

    color: #344054;
}

.secondary-btn:hover {
    background: #e2e6ec;
}


/* =========================
   Service List
   ========================= */

.services-list {
    display: flex;
    flex-direction: column;
}

.service-card {
    padding: 20px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-bottom: 1px solid #edf0f5;

    transition:
        background 0.15s ease;
}

.service-card:last-child {
    border-bottom: none;
}

.service-card:hover {
    background: #fafbfc;
}

.service-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 5px;
}

.service-name {
    font-size: 15px;

    font-weight: 650;
}

.service-url {
    color: #7b8494;

    font-size: 12px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.service-actions {
    display: flex;

    align-items: center;

    gap: 16px;

    flex-shrink: 0;
}

.service-status {
    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 13px;

    font-weight: 650;
}

.service-status-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    flex-shrink: 0;
}

.check-service-btn {
    background: #eef1f5;

    color: #344054;

    padding: 8px 12px;

    font-size: 12px;
}

.check-service-btn:hover {
    background: #e2e6ec;
}


/* =========================
   Details Button
   ========================= */

.view-details-btn {
    background: transparent;

    color: #475467;

    border: 1px solid #d9dee8;

    padding: 7px 11px;

    font-size: 12px;
}

.view-details-btn:hover {
    background: #f7f8fa;
}


/* =========================
   Loading / Empty
   ========================= */

.loading {
    padding: 40px;

    text-align: center;

    color: #687386;

    font-size: 14px;
}

.empty-state {
    padding: 50px 24px;

    text-align: center;

    color: #687386;
}

.empty-state strong {
    display: block;

    margin-bottom: 6px;

    color: #344054;

    font-size: 15px;
}


/* =========================
   Modal
   ========================= */

.modal {
    position: fixed;

    inset: 0;

    background: rgba(
        20,
        27,
        40,
        0.48
    );

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 100;

    overflow-y: auto;
}

.hidden {
    display: none !important;
}

.modal-content {
    width: min(
        440px,
        100%
    );

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    background: #ffffff;

    border-radius: 14px;

    padding: 24px;

    box-shadow:
        0 20px 60px rgba(
            20,
            27,
            40,
            0.2
        );
}

.details-modal-content {
    width: min(
        760px,
        100%
    );
}

.modal-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 20px;

    font-weight: 700;
}

.modal-subtitle {
    margin-top: 5px;

    color: #687386;

    font-size: 13px;

    word-break: break-all;
}

.close-btn {
    background: transparent;

    color: #687386;

    padding: 2px 8px;

    font-size: 25px;

    line-height: 1;
}

.close-btn:hover {
    background: #f1f3f6;
}


/* =========================
   Form
   ========================= */

.form-group {
    display: flex;

    flex-direction: column;

    gap: 7px;

    margin-bottom: 18px;
}

.form-group label {
    font-size: 13px;

    font-weight: 650;
}

.form-group input {
    width: 100%;

    padding: 11px 12px;

    border: 1px solid #d9dee8;

    border-radius: 8px;

    outline: none;

    font-family: inherit;

    font-size: 14px;

    color: #172033;

    background: #ffffff;
}

.form-group input:focus {
    border-color: #7c8799;

    box-shadow:
        0 0 0 3px rgba(
            107,
            114,
            128,
            0.1
        );
}

.form-error {
    background: #fff1f1;

    border: 1px solid #ffd0d0;

    color: #b42318;

    border-radius: 8px;

    padding: 10px 12px;

    font-size: 13px;

    margin-bottom: 16px;
}

.form-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 24px;
}


/* =========================
   Details Status
   ========================= */

.details-status {
    display: flex;

    align-items: center;

    gap: 9px;

    padding: 14px 16px;

    margin-bottom: 20px;

    background: #f8fafc;

    border: 1px solid #e8ecf2;

    border-radius: 10px;
}

.details-status strong {
    font-size: 14px;
}


/* =========================
   Analytics
   ========================= */

.analytics-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;

    margin-bottom: 26px;
}

.analytics-card {
    padding: 14px;

    background: #f8fafc;

    border: 1px solid #e8ecf2;

    border-radius: 9px;

    display: flex;

    flex-direction: column;

    gap: 7px;
}

.analytics-card span {
    color: #687386;

    font-size: 11px;

    font-weight: 550;
}

.analytics-card strong {
    font-size: 18px;

    font-weight: 700;
}


/* =========================
   Detail Sections
   ========================= */

.details-section {
    margin-top: 24px;

    border-top: 1px solid #e8ecf2;

    padding-top: 20px;
}

.details-section-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 12px;
}

.details-section h3 {
    font-size: 15px;

    font-weight: 700;
}

.details-period {
    color: #8992a2;

    font-size: 11px;
}


/* =========================
   Check History
   ========================= */

.check-list {
    display: flex;

    flex-direction: column;

    gap: 7px;
}

.check-row {
    display: grid;

    grid-template-columns:
        90px
        70px
        1fr
        130px;

    align-items: center;

    gap: 12px;

    padding: 10px 12px;

    border: 1px solid #edf0f5;

    border-radius: 8px;

    font-size: 12px;
}

.check-status {
    font-weight: 700;
}

.check-up {
    color: #15803d;
}

.check-down {
    color: #b42318;
}

.check-time {
    color: #687386;
}

.check-code {
    color: #475467;
}

.check-response {
    text-align: right;

    color: #475467;
}


/* =========================
   Incidents
   ========================= */

.incident-list {
    display: flex;

    flex-direction: column;

    gap: 9px;
}

.incident-row {
    padding: 12px;

    border: 1px solid #edf0f5;

    border-radius: 8px;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 16px;
}

.incident-reason {
    font-size: 12px;

    font-weight: 600;

    color: #344054;
}

.incident-time {
    margin-top: 4px;

    color: #8992a2;

    font-size: 11px;
}

.incident-status {
    font-size: 11px;

    font-weight: 700;

    white-space: nowrap;
}

.incident-open {
    color: #b42318;
}

.incident-resolved {
    color: #15803d;
}


/* =========================
   Footer
   ========================= */

.footer {
    padding: 24px;

    text-align: center;

    color: #8992a2;

    font-size: 12px;
}


/* =========================
   Responsive
   ========================= */

@media (max-width: 900px) {

    .analytics-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


@media (max-width: 800px) {

    .topbar {
        padding: 18px 20px;

        align-items: flex-start;
    }

    .summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .container {
        width: min(
            calc(100% - 24px),
            1100px
        );

        margin: 24px auto;
    }

    .service-card {
        align-items: flex-start;
    }

    .service-actions {
        flex-wrap: wrap;

        justify-content: flex-end;
    }

}


@media (max-width: 650px) {

    .topbar {
        flex-direction: column;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .service-card {
        flex-direction: column;

        align-items: stretch;
    }

    .service-actions {
        justify-content: space-between;
    }

    .analytics-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .check-row {
        grid-template-columns:
            1fr 1fr;

        gap: 7px;
    }

    .check-response {
        text-align: left;
    }

}


@media (max-width: 420px) {

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .service-actions {
        align-items: stretch;

        flex-direction: column;
    }

    .service-actions button {
        width: 100%;
    }

}