:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #1a2633;
    --muted: #5b6b7d;
    --line: #d8e0ea;
    --accent: #0a7d5e;
    --danger: #b03737;
    --warn: #9a6a00;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(160deg, #f5f8ff 0%, #edf4ef 100%);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

.site-header {
    background: #0f1f2f;
    color: #fff;
    padding: 14px 0;
    margin-bottom: 24px;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.08em;
}

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

.nav a {
    color: #dce7f5;
    text-decoration: none;
    font-size: 14px;
}

h1 {
    margin: 0 0 16px;
    font-size: 28px;
}

h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

h3 {
    margin: 0;
    font-size: 17px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.narrow {
    max-width: 720px;
}

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

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

.stat h2 {
    margin: 0;
    font-size: 28px;
}

.stat p {
    margin: 8px 0 0;
    color: var(--muted);
}

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

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

.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

input,
select,
button,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
}

button {
    border: 0;
    border-radius: 8px;
    padding: 9px 12px;
    background: #0f3f68;
    color: #fff;
    cursor: pointer;
}

button:hover {
    opacity: 0.92;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox input {
    width: auto;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

thead th {
    background: #f3f8ff;
}

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

.alert {
    border-radius: 9px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.alert.ok {
    background: #e8f8f1;
    border: 1px solid #b5e8d2;
    color: #145f43;
}

.alert.err {
    background: #fbecec;
    border: 1px solid #efc3c3;
    color: #7c2525;
}

.badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    display: inline-block;
}

.badge.ok {
    background: #e8f8f1;
    color: var(--accent);
}

.badge.err {
    background: #fdecec;
    color: var(--danger);
}

.badge.warn {
    background: #fff2d9;
    color: var(--warn);
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-block {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.copy-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fbfdff;
    margin-bottom: 10px;
    word-break: break-all;
}

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

