* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #172033;
    background: #f4f6f8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

a {
    color: #2457c5;
    text-decoration: none;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.panel {
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(28, 36, 55, .07);
}

.auth-wrap .panel {
    width: min(460px, 100%);
}

h1,
h2 {
    margin: 0 0 14px;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 20px;
}

.muted {
    color: #687384;
    margin-top: -4px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

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

label {
    display: grid;
    gap: 6px;
    color: #485568;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 0 12px;
    color: #172033;
    background: #fff;
    border: 1px solid #cdd5df;
    border-radius: 6px;
    font: inherit;
}

input,
select {
    height: 42px;
}

textarea {
    min-height: 92px;
    padding-top: 10px;
    resize: vertical;
}

.wide {
    grid-column: 1 / -1;
}

.check {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
}

.check input {
    width: auto;
    height: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: #2457c5;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.btn.secondary {
    background: #e8edf6;
    color: #243149;
}

.btn.full {
    width: 100%;
}

.btn.large {
    min-width: 180px;
    min-height: 50px;
    font-size: 18px;
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 18px 0;
}

.tabs a {
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    background: #edf1f7;
    color: #566174;
}

.tabs a.active {
    background: #2457c5;
    color: #fff;
}

.alert {
    margin: 14px 0;
    padding: 12px 14px;
    border-radius: 6px;
    background: #e8f6ee;
    color: #17633a;
}

.alert.error {
    background: #fdeaea;
    color: #a12a2a;
}

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

.topbar nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 48px;
}

.container.narrow {
    width: min(720px, calc(100% - 32px));
}

.grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

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

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

.stats div {
    padding: 18px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e1e6ef;
}

.stats span {
    display: block;
    color: #687384;
    margin-bottom: 8px;
}

.stats strong {
    font-size: 30px;
}

.inline-form,
.filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

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

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e1e6ef;
    border-radius: 6px;
}

.link {
    border: 0;
    padding: 0;
    background: none;
    color: #2457c5;
    cursor: pointer;
    font: inherit;
}

.danger {
    color: #b83232;
}

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

.missing-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    background: #fff8e7;
    border: 1px solid #f1d99b;
    border-radius: 8px;
}

.missing-box span {
    padding: 6px 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ead7a6;
}

.mini-form {
    display: inline-flex;
    align-items: center;
}

.ad-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.ad-card {
    display: grid;
    gap: 8px;
    min-height: 96px;
    padding: 14px;
    color: #172033;
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 8px;
    overflow: hidden;
}

.ad-card img {
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: 6px;
    background: #edf1f7;
}

.ad-card span {
    color: #687384;
    font-size: 14px;
    line-height: 1.5;
}

.notice-list {
    display: grid;
    gap: 12px;
}

.notice-list article {
    padding: 12px;
    border: 1px solid #e7ecf3;
    border-radius: 6px;
    background: #fbfcfe;
}

.notice-list p {
    margin: 8px 0 0;
    color: #485568;
    line-height: 1.6;
}

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

th,
td {
    padding: 11px 8px;
    border-bottom: 1px solid #e7ecf3;
    text-align: left;
}

th {
    color: #687384;
    font-weight: 600;
}

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

.center {
    text-align: center;
}

.status {
    display: inline-block;
    margin: 14px 0 20px;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 700;
}

.status.ok {
    background: #e8f6ee;
    color: #17633a;
}

.status.wait {
    background: #fdeaea;
    color: #a12a2a;
}

code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #eef2f7;
}

@media (max-width: 800px) {
    .grid.two,
    .stats,
    .form-grid.compact {
        grid-template-columns: 1fr;
    }

    .section-head,
    .inline-form,
    .filters {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        padding: 0 16px;
    }
}
