* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fa;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 224px;
    background: #101827;
    color: #d9e2f1;
}

.brand {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    color: #fff;
    font-size: 18px;
    font-weight: 650;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar nav {
    padding: 16px 12px;
}

.sidebar a {
    display: block;
    padding: 12px 14px;
    color: #b8c3d6;
    text-decoration: none;
    border-radius: 6px;
}

.sidebar a.active,
.sidebar a:hover {
    color: #fff;
    background: #1890ff;
}

.main {
    margin-left: 224px;
    min-height: 100vh;
}

.topbar {
    height: 76px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 20px;
    font-weight: 650;
}

.topbar p {
    margin-top: 6px;
    color: #6b7280;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 126px;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #4b5563;
    white-space: nowrap;
}

.status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

.status.ok span {
    background: #16a34a;
}

.panel,
.alert {
    margin: 24px 28px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.alert {
    padding: 12px 16px;
}

.alert.success {
    color: #166534;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.alert.error {
    color: #991b1b;
    border-color: #fecaca;
    background: #fef2f2;
}

.panel-head {
    min-height: 56px;
    padding: 0 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-head h2 {
    font-size: 16px;
    font-weight: 650;
}

.panel-head span {
    color: #6b7280;
}

.form-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.field,
.check {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field span {
    color: #374151;
    font-weight: 500;
}

input,
select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    outline: none;
}

input:focus,
select:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.12);
}

input[type="file"] {
    padding: 7px 10px;
}

.wide {
    grid-column: span 2;
}

.check {
    height: 38px;
    flex-direction: row;
    align-items: center;
    align-self: end;
    color: #374151;
}

.check input {
    width: 16px;
    height: 16px;
}

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

button {
    height: 38px;
    min-width: 96px;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 600;
}

.primary {
    color: #fff;
    background: #1890ff;
}

.secondary {
    color: #374151;
    background: #f3f4f6;
    border-color: #d1d5db;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    height: 48px;
    padding: 0 16px;
    text-align: left;
    border-bottom: 1px solid #eef0f3;
    white-space: nowrap;
}

th {
    background: #fafafa;
    color: #4b5563;
    font-weight: 650;
}

.empty {
    text-align: center;
    color: #9ca3af;
}

.download {
    color: #1890ff;
    text-decoration: none;
    font-weight: 600;
}

.pager {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 20px;
}

.pager a,
.pager span {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    background: #fff;
}

.pager .disabled {
    color: #9ca3af;
    pointer-events: none;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        height: auto;
        padding: 18px;
        align-items: flex-start;
        flex-direction: column;
    }

    .panel,
    .alert {
        margin: 16px;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .wide {
        grid-column: auto;
    }
}
