:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --line: #e3e6eb;
    --text: #252b33;
    --muted: #737b88;
    --green: #45ad62;
    --orange: #ef9637;
    --red: #e35656;
    --blue: #3377d6;
    --shadow: 0 14px 36px rgba(29, 37, 51, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
    letter-spacing: 0;
}

button,
input,
select {
    font: inherit;
}

.topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: block;
    object-fit: cover;
    background: #ffffff;
    border: 1px solid var(--line);
}

.brand strong,
.brand span {
    display: block;
}

.brand span,
.muted {
    color: var(--muted);
    font-size: 13px;
}

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

.shell {
    width: min(1180px, calc(100% - 40px));
    margin: 38px auto;
}

.login-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: stretch;
}

.intro,
.login-box,
.status-card,
.workbench {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.intro {
    padding: 44px 48px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff3e4;
    color: #b85f13;
    font-size: 13px;
    font-weight: 700;
}

h1,
h2 {
    margin: 18px 0 10px;
    line-height: 1.22;
}

h1 {
    max-width: 720px;
    font-size: 38px;
}

h2 {
    font-size: 28px;
}

p {
    margin: 0;
    color: var(--muted);
}

.login-box {
    padding: 28px;
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: #f8f9fb;
    color: var(--text);
}

select {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: #f8f9fb;
    color: var(--text);
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.primary-button {
    height: 50px;
    background: var(--orange);
    color: #ffffff;
}

.secondary-button,
.ghost-button,
.danger-button {
    height: 42px;
    padding: 0 16px;
    background: #eef4ff;
    color: var(--blue);
}

.danger-button {
    background: #fdecec;
    color: var(--red);
}

.secondary-button:disabled,
.primary-button:disabled,
.danger-button:disabled {
    cursor: not-allowed;
    background: #e1e5eb;
    color: #8b94a3;
}

.icon-button {
    width: 36px;
    height: 36px;
    background: #f2f4f7;
    color: var(--text);
}

.form-message {
    min-height: 20px;
    font-size: 13px;
    color: var(--red);
}

.workspace {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
}

.side-panel {
    display: grid;
    align-content: start;
    gap: 18px;
}

.status-card,
.workbench {
    padding: 22px;
}

.card-head,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-head span {
    font-weight: 800;
}

.status-badge {
    width: 100%;
    min-height: 44px;
    display: grid;
    place-items: center;
    margin: 18px 0;
    border-radius: 8px;
    font-weight: 900;
}

.status-badge.neutral {
    background: #f0f2f5;
    color: var(--muted);
}

.status-badge.good {
    background: #e9f7ed;
    color: var(--green);
}

.status-badge.warn {
    background: #fff3e4;
    color: var(--orange);
}

.status-badge.bad {
    background: #fdecec;
    color: var(--red);
}

.meta-list {
    margin: 0;
    display: grid;
    gap: 12px;
}

.meta-list div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
}

.meta-list dt {
    color: var(--muted);
    font-size: 12px;
}

.meta-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.download-link {
    display: grid;
    place-items: center;
    min-height: 42px;
    margin-top: 16px;
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.stat-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.stat-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #f8f9fb;
    border: 1px solid var(--line);
}

.stat-box span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-box strong {
    font-size: 22px;
}

.stat-box.danger {
    background: #fdecec;
    border-color: #f5c8c8;
}

.stat-box.danger strong,
.stat-box.danger span {
    color: var(--red);
}

.menu-list {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.menu-button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    text-align: left;
    padding: 0 14px;
}

.menu-button.active {
    background: #eef4ff;
    border-color: #cfe0ff;
    color: var(--blue);
}

.notice {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 8px;
    background: #f8f9fb;
    border: 1px solid var(--line);
    color: var(--muted);
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    height: 54px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    background: #f4f6f8;
    font-size: 13px;
}

tr:last-child td {
    border-bottom: 0;
}

tr.today-ip td {
    background: #e9f7ed;
}

tr.ip-change-pending td {
    background: #fff1f1;
}

.empty-cell {
    color: var(--muted);
    text-align: center;
}

.muted-cell {
    color: var(--muted);
}

.inline-status {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.line-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.line-status.available,
.line-status.in-use {
    background: #e9f7ed;
    color: var(--green);
}

.line-status.locked,
.line-status.disabled,
.line-status.pending {
    background: #fdecec;
    color: var(--red);
}

.line-status.neutral {
    background: #f0f2f5;
    color: var(--muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(37, 43, 51, 0.28);
}

.modal {
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

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

.modal h3 {
    margin: 12px 0 0;
    font-size: 24px;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.profile-filter {
    max-width: 360px;
    margin: 16px 0;
}

.profile-list {
    display: grid;
    gap: 10px;
}

.profile-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.profile-item strong,
.profile-item span {
    display: block;
}

.profile-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.hidden {
    display: none !important;
}

@media (max-width: 860px) {
    .topbar {
        height: auto;
        padding: 16px 18px;
        align-items: flex-start;
    }

    .shell {
        width: min(100% - 24px, 1180px);
        margin: 22px auto;
    }

    .login-section,
    .workspace {
        grid-template-columns: 1fr;
    }

    .intro {
        padding: 30px 24px;
    }

    h1 {
        font-size: 30px;
    }

    .inline-form,
    .profile-item {
        grid-template-columns: 1fr;
    }
}
