* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Malgun Gothic", Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

.top-header {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: #1f2937;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.system-title {
    font-size: 23px;
    font-weight: 700;
}

.system-subtitle {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.7;
}

.header-right a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 25px;
    cursor: pointer;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 68px;
}

.sidebar {
    width: 235px;
    flex: 0 0 235px;
    background: #fff;
    border-right: 1px solid #e1e5e9;
    min-height: calc(100vh - 68px);
}

.sidebar-nav {
    padding: 15px 0 30px;
}

.menu-group {
    border-bottom: 1px solid #f0f0f0;
}

.menu-group-title {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
}

.menu-toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.arrow {
    font-size: 14px;
    color: #777;
}

.menu-item,
.submenu-item {
    display: block;
    text-decoration: none;
}

.menu-item {
    padding: 11px 20px 13px 28px;
    color: #333;
    font-size: 14px;
}

.submenu {
    display: none;
    padding-bottom: 8px;
}

.menu-group.open .submenu {
    display: block;
}

.submenu-item {
    padding: 10px 18px 10px 36px;
    color: #555;
    font-size: 14px;
}

.submenu-item.active {
    background: #eef4ff;
    color: #1d4ed8;
    font-weight: 700;
    border-right: 3px solid #1d4ed8;
}

.submenu-item.disabled {
    color: #a0a0a0;
    cursor: default;
}

.menu-item:hover,
.submenu-item:not(.disabled):hover {
    background: #f5f7fa;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 22px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
}

.page-description {
    margin-top: 6px;
    color: #777;
    font-size: 13px;
}

.page-time {
    color: #777;
    font-size: 13px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.summary-card {
    background: #fff;
    border-radius: 8px;
    padding: 17px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.summary-title {
    color: #666;
    font-size: 13px;
}

.summary-value {
    margin-top: 7px;
    font-size: 28px;
    font-weight: 700;
}

.content-panel {
    background: #fff;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.data-table th {
    background: #f1f3f5;
    padding: 11px 8px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    white-space: nowrap;
    font-size: 13px;
}

.data-table td {
    padding: 11px 8px;
    border-bottom: 1px solid #eee;
    text-align: center;
    white-space: nowrap;
    font-size: 13px;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.status-badge {
    display: inline-block;
    min-width: 72px;
    padding: 5px 9px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
}

.status-online {
    background: #dcfce7;
    color: #166534;
}

.status-offline {
    background: #fee2e2;
    color: #991b1b;
}

.status-alarm {
    background: #ffedd5;
    color: #9a3412;
}

.loading-cell {
    padding: 35px !important;
    color: #777;
}

@media (max-width: 900px) {

    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 68px;
        left: -250px;
        bottom: 0;
        z-index: 900;
        transition: left 0.2s ease;
        box-shadow: 3px 0 8px rgba(0, 0, 0, 0.12);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .main-content {
        width: 100%;
        padding: 12px;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-right {
        display: none;
    }
}

@media (max-width: 520px) {

    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }

    .system-title {
        font-size: 19px;
    }

    .page-header {
        display: block;
    }

    .page-time {
        margin-top: 8px;
    }
}