:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --text: #17191c;
    --muted: #6c737f;
    --border: #d9dde3;
    --accent: #111827;
    --accent-soft: #eef0f3;
    --danger: #b42318;
    --success: #067647;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: inherit; }

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.02em;
}

nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 14px;
}

nav a {
    text-decoration: none;
    color: var(--muted);
}

nav a:hover { color: var(--text); }

main { padding: 32px 0; }

.hero {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 20px;
}

.hero h1,
.panel h1,
.panel h2 {
    margin-top: 0;
    letter-spacing: -0.04em;
}

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

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }

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

.news-item {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}

.summary-link {
    display: inline-block;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 8px;
}

.summary-link:hover { text-decoration: underline; }

.meta,
.muted {
    color: var(--muted);
    font-size: 14px;
}

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

label {
    display: grid;
    gap: 6px;
    font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    background: var(--accent-soft);
    color: var(--text);
}

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

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

.button-row form {
    display: inline-flex;
    gap: 0;
}

.dashboard-actions {
    width: 100%;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-actions form:last-child {
    margin-left: auto;
}

@media (max-width: 560px) {
    .dashboard-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-actions form:last-child {
        margin-left: 0;
    }
}

.link-button {
    background: transparent;
    color: var(--danger);
    padding: 0;
    border-radius: 0;
    font-weight: 500;
    text-decoration: underline;
}

.flash {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #ecfdf3;
    color: var(--success);
    border: 1px solid #abefc6;
}

.flash-error {
    background: #fef3f2;
    color: var(--danger);
    border-color: #fecdca;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.stat strong {
    display: block;
    font-size: 28px;
    line-height: 1;
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

th {
    color: var(--muted);
    font-weight: 700;
}

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

.actions form { display: inline; }

.error-cell {
    max-width: 280px;
    overflow-wrap: anywhere;
    color: var(--danger);
}

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
}
.status-done { background: #ecfdf3; color: var(--success); }
.status-pending { background: #fffaeb; color: #b54708; }
.status-error { background: #fef3f2; color: var(--danger); }

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 14px;
    align-items: center;
    margin-top: 20px;
}

pre {
    background: #0b1020;
    color: #f8fafc;
    padding: 14px;
    border-radius: 12px;
    overflow-x: auto;
}

.key-status {
    color: var(--muted);
    background: var(--accent-soft);
    padding: 10px 12px;
    border-radius: 10px;
}

.site-footer {
    padding: 30px 0;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 800px) {
    .header-inner { align-items: flex-start; flex-direction: column; padding: 14px 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-link { font-size: 17px; }
}
