:root {
    --adm-bg: #f2f2f2;
    --adm-surface: #ffffff;
    --adm-border: #eeeeee;
    --adm-text: #333333;
    --adm-muted: #666666;
    --adm-primary: #1e9fff;
    --adm-primary-strong: #0b79d0;
    --adm-success: #16a34a;
    --adm-warning: #d97706;
    --adm-danger: #dc2626;
    --adm-sidebar: #28333e;
    --adm-sidebar-strong: #192027;
    --adm-radius: 5px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--adm-text);
    background: var(--adm-bg);
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

button,
input {
    font: inherit;
}

.adm-public-page {
    background: #e9eef3;
}

.adm-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #e9eef3;
}

.adm-login-panel {
    width: min(390px, 100%);
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    background: var(--adm-surface);
    box-shadow: 0 12px 32px rgba(25, 32, 39, 0.12);
    padding: 28px;
}

.adm-login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.adm-login-brand__mark,
.adm-brand__mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: var(--adm-primary);
    font-weight: 700;
}

.adm-login-brand__mark {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    font-size: 25px;
}

.adm-login-brand h1 {
    margin: 0 0 5px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
}

.adm-login-brand p,
.adm-page-heading p {
    margin: 0;
    color: var(--adm-muted);
    font-size: 13px;
}

.adm-alert {
    margin-bottom: 16px;
    border: 1px solid #fecaca;
    border-radius: var(--adm-radius);
    color: #991b1b;
    background: #fef2f2;
    padding: 10px 12px;
    font-size: 13px;
}

.adm-field-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.adm-input-with-icon {
    position: relative;
}

.adm-input-with-icon > .layui-icon:first-child {
    position: absolute;
    left: 11px;
    top: 50%;
    color: #7a8794;
    transform: translateY(-50%);
    z-index: 1;
}

.adm-input-with-icon .layui-input {
    height: 40px;
    padding-left: 36px;
    border-radius: 4px;
}

.adm-password-field .layui-input {
    padding-right: 42px;
}

.adm-password-toggle,
.adm-icon-button {
    display: inline-grid;
    place-items: center;
    border: 0;
    color: var(--adm-muted);
    background: transparent;
    cursor: pointer;
}

.adm-password-toggle {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 34px;
    height: 34px;
}

.adm-password-toggle:hover,
.adm-icon-button:hover {
    color: var(--adm-primary);
    background: #eef7ff;
}

.adm-login-submit {
    height: 40px;
    margin-top: 4px;
    border-radius: 4px;
    background: var(--adm-primary);
}

.adm-login-submit:hover {
    background: var(--adm-primary-strong);
}

.adm-admin-page {
    overflow: hidden;
}

.adm-shell {
    min-height: 100vh;
    display: flex;
}

.adm-sidebar {
    width: 220px;
    flex: 0 0 220px;
    min-height: 100vh;
    color: #c8d0d8;
    background: var(--adm-sidebar);
    transition: width 0.18s ease, transform 0.18s ease;
}

.adm-brand {
    height: 58px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    background: var(--adm-sidebar-strong);
    padding: 0 14px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.adm-brand:hover {
    color: #fff;
}

.adm-brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    font-size: 18px;
}

.adm-brand__text {
    font-size: 15px;
    font-weight: 700;
}

.adm-navigation {
    padding: 8px 0;
}

.adm-navigation__item {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c8d0d8;
    padding: 0 17px;
    border-left: 3px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.adm-navigation__item:hover,
.adm-navigation__item.is-active {
    color: #fff;
    background: #34414d;
    border-left-color: var(--adm-primary);
}

.adm-navigation__item .layui-icon {
    width: 22px;
    font-size: 18px;
    text-align: center;
}

.adm-main {
    min-width: 0;
    flex: 1;
}

.adm-header {
    height: 58px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--adm-border);
    background: var(--adm-surface);
    padding: 0 18px;
}

.adm-icon-button {
    width: 36px;
    height: 36px;
    border-radius: 4px;
}

.adm-header__title {
    margin-left: 12px;
    font-weight: 600;
}

.adm-header__account {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.adm-header__user {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--adm-muted);
}

.adm-command-button {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d4dbe2;
    border-radius: 4px;
    color: var(--adm-text);
    background: #fff;
    padding: 0 11px;
    cursor: pointer;
}

.adm-command-button:hover {
    color: var(--adm-primary);
    border-color: var(--adm-primary);
}

.adm-content {
    height: calc(100vh - 58px);
    overflow: auto;
    padding: 18px;
}

.adm-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.adm-page-heading h1 {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.3;
}

.adm-environment-badge {
    border: 1px solid #fed7aa;
    border-radius: 4px;
    color: #9a3412;
    background: #fff7ed;
    padding: 4px 8px;
    font-size: 12px;
}

.adm-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.adm-stat-card {
    min-height: 104px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    background: var(--adm-surface);
    padding: 16px;
}

.adm-stat-card__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    font-size: 21px;
}

.adm-stat-card--users .adm-stat-card__icon {
    color: #075985;
    background: #e0f2fe;
}

.adm-stat-card--equipment .adm-stat-card__icon {
    color: #5b21b6;
    background: #ede9fe;
}

.adm-stat-card--online .adm-stat-card__icon {
    color: #166534;
    background: #dcfce7;
}

.adm-stat-card--alarm .adm-stat-card__icon {
    color: #991b1b;
    background: #fee2e2;
}

.adm-stat-card__label {
    color: var(--adm-muted);
    font-size: 13px;
}

.adm-stat-card__value {
    margin-top: 5px;
    font-size: 26px;
    line-height: 1;
    font-weight: 700;
}

.adm-status-panel {
    margin-top: 14px;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    background: var(--adm-surface);
}

.adm-status-panel__header {
    height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--adm-border);
    padding: 0 14px;
}

.adm-status-panel__header h2 {
    margin: 0;
    font-size: 14px;
}

.adm-status-row {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.adm-status-row strong,
.adm-status-row span {
    display: block;
}

.adm-status-row span {
    margin-top: 3px;
    color: var(--adm-muted);
    font-size: 12px;
}

.adm-status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--adm-success);
}

.adm-sidebar-mask {
    display: none;
}

.sidebar-collapsed .adm-sidebar {
    width: 64px;
    flex-basis: 64px;
}

.sidebar-collapsed .adm-brand__text,
.sidebar-collapsed .adm-navigation__item span {
    display: none;
}

@media (max-width: 980px) {
    .adm-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .adm-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: 220px;
        transform: translateX(-100%);
    }

    .sidebar-open .adm-sidebar {
        transform: translateX(0);
    }

    .sidebar-open .adm-sidebar-mask {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: block;
        background: rgba(15, 23, 42, 0.38);
    }

    .adm-header {
        padding: 0 12px;
    }

    .adm-header__title {
        margin-left: 8px;
    }

    .adm-header__user {
        max-width: 92px;
    }

    .adm-content {
        padding: 12px;
    }

    .adm-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .adm-login-shell {
        padding: 14px;
    }

    .adm-login-panel {
        padding: 22px 18px;
    }

    .adm-header__user {
        display: none;
    }

    .adm-command-button span {
        display: none;
    }

    .adm-command-button {
        width: 34px;
        justify-content: center;
        padding: 0;
    }
}
