:root {
    --bg: #f4f5f2;
    --panel: #ffffff;
    --text: #202622;
    --muted: #69736d;
    --line: #dce1dd;
    --accent: #2364aa;
    --danger: #a33d32;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px clamp(16px, 4vw, 42px);
    background: #17202a;
    color: white;
}
.admin-header a { color: white; }
.brand { font-weight: 700; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
.admin-container { width: min(1160px, calc(100% - 32px)); margin: 28px auto; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.muted { color: var(--muted); }
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stats article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}
.stats strong { display: block; font-size: 34px; }
.stats span { color: var(--muted); }
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef1f4; }
.actions { display: flex; gap: 12px; align-items: center; }
.actions form { margin: 0; }
.publish-form { margin: 0; }
.publish-toggle {
    min-width: 110px;
    border-radius: 999px;
}
.publish-toggle.is-on { background: #1c7c54; }
.publish-toggle.is-off { background: #75808a; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.button.secondary { background: #e5e9ed; color: var(--text); }
.link { background: transparent; color: var(--accent); padding: 0; min-height: auto; font-weight: 400; }
.link.danger { color: var(--danger); }
.form {
    display: grid;
    gap: 16px;
    max-width: 760px;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}
label { display: grid; gap: 6px; font-weight: 600; }
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 22px; }
.photo-grid figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-grid figcaption { padding: 8px; color: var(--muted); }
.detail {
    max-width: 760px;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 20px;
}
.detail h2 { margin-top: 0; }
.reply-log {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}
.reply-log:first-of-type { border-top: 0; }
.reply-log strong, .reply-log span { display: block; }
.reply-log span { color: var(--muted); font-size: 14px; margin-top: 4px; }
.reply-log p { white-space: normal; }
.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; }
.alert.success { background: #e3f5eb; color: #135536; }
.alert.error { background: #fde8e5; color: var(--danger); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: min(420px, 100%); }
@media (max-width: 760px) {
    .admin-header, .page-title { align-items: flex-start; flex-direction: column; }
    table { display: block; overflow-x: auto; }
}
