:root {
    color-scheme: light;
    --bg: #f7f4ee;
    --bg-2: #eee8dc;
    --panel: rgba(255, 255, 255, 0.78);
    --text: #26231f;
    --muted: #777166;
    --accent: #a77b3f;
    --accent-hover: #816033;
    --accent-2: #d9bd83;
    --border: rgba(84, 68, 45, 0.14);
    --field: #fffdf9;
    --shadow: rgba(54, 43, 27, 0.1);
    --danger-bg: #fff1f2;
    --danger-text: #9f1239;
    --success-bg: #ecfdf5;
    --success-text: #166534;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background:
        radial-gradient(circle at top left, rgba(217, 189, 131, 0.2), transparent 32%),
        radial-gradient(circle at bottom right, rgba(167, 123, 63, 0.1), transparent 28%),
        linear-gradient(135deg, var(--bg), var(--bg-2));
}
.orb {
    position: fixed;
    width: min(420px, 80vw);
    height: 420px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}
.orb.one { top: -120px; left: -80px; background: rgba(217, 189, 131, 0.35); }
.orb.two { bottom: -100px; right: -70px; background: rgba(167, 123, 63, 0.18); }
a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.site-header, main {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 24px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 36px var(--shadow);
    backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--text); }
.brand:hover { color: var(--text); text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #bd9558, #8d6533);
    box-shadow: 0 10px 22px rgba(141, 101, 51, 0.22);
}
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 28px; font-size: 0.96rem; }
.site-header nav a { color: var(--muted); }
.site-header nav a:hover { color: var(--accent); }
main { margin-top: 40px; margin-bottom: 64px; }
.card {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px;
    margin-bottom: 22px;
    box-shadow: 0 18px 40px var(--shadow);
}
.card .card { background: rgba(255, 255, 255, 0.72); box-shadow: none; border-radius: 16px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.03em; overflow-wrap: anywhere; }
h1 { margin: 0 0 18px; font-size: clamp(1.75rem, 3vw, 2.6rem); letter-spacing: -0.05em; }
h2 { margin: 0 0 20px; font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 0.9rem; }
code { background: var(--bg-2); padding: 0.15rem 0.4rem; border-radius: 6px; font-size: 0.9em; }
form { margin: 0; }
label { display: block; margin-bottom: 0.4rem; font-weight: 600; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    margin-bottom: 1rem;
    font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { min-height: 7rem; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; flex-shrink: 0; margin: 0.35rem 0.6rem 0 0; accent-color: var(--accent); }
.choice-label { display: flex; align-items: flex-start; font-weight: 400; margin: 0.65rem 0; }
button, .btn-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #a77b3f, #c19a5c);
    color: #fff;
    box-shadow: 0 12px 24px rgba(141, 101, 51, 0.18);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
button:hover, .btn-new:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(141, 101, 51, 0.26); }
button:disabled { background: var(--bg-2); color: var(--muted); cursor: not-allowed; box-shadow: none; transform: none; }
.inline { display: inline; }
.inline button, .add-row { background: rgba(255, 255, 255, 0.7); color: var(--accent-hover); border-color: var(--border); box-shadow: none; }
td .inline button { padding: 6px 12px; font-size: 0.9rem; }
.error, .success, .warning { border: 1px solid; border-radius: 12px; padding: 12px 16px; margin-bottom: 1rem; }
.error { border-color: #e0a8b3; background: var(--danger-bg); color: var(--danger-text); }
.success { border-color: #a5d2b5; background: var(--success-bg); color: var(--success-text); }
.warning { border-color: #dfc58c; background: #fffbeb; color: #92400e; }
.field-error { color: var(--danger-text); margin-top: -0.75rem; }
.wide-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 0.85rem; background: rgba(217, 189, 131, 0.12); font-weight: 600; }
tbody tr:hover { background: rgba(217, 189, 131, 0.08); }
.status-blocked { color: var(--danger-text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.actions h1 { margin-bottom: 0; margin-right: auto; }
form.actions { margin-block: 18px; }
form.actions select, form.actions input:not([type="hidden"]) { width: auto; max-width: 100%; margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.badge { display: inline-block; border: 1px solid var(--border); border-radius: 999px; background: rgba(217, 189, 131, 0.16); color: var(--accent-hover); padding: 4px 12px; font-size: 0.8rem; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success { background: #dcfce7; color: #166534; }
.auth-card { max-width: 560px; margin: 60px auto; padding: 36px; }
.auth-card button { width: 100%; }
.welcome-card { padding: 36px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(217, 189, 131, 0.16)); }
.welcome-card h1 { color: var(--accent-hover); }
.section-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.section-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    font-weight: 600;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.section-link span { color: var(--accent); font-size: 1.3rem; }
.section-link:hover { border-color: var(--accent-2); transform: translateY(-2px); text-decoration: none; }
ul.posts { list-style: none; padding: 0; margin: 0; }
ul.posts li { padding: 12px 0; border-bottom: 1px solid var(--border); }
ul.posts li:last-child { border-bottom: none; }
@media (max-width: 900px) {
    .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .site-header { padding: 16px; gap: 16px; }
    .site-header nav { width: 100%; gap: 16px; }
    main { margin-top: 24px; }
    .card, .welcome-card, .auth-card { padding: 20px; border-radius: 18px; }
    .auth-card { margin-top: 32px; }
    .section-grid { grid-template-columns: 1fr; }
    th, td { min-width: 8rem; padding: 12px 10px; }
    form.actions select, form.actions input:not([type="hidden"]) { width: 100%; }
    .actions > button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    button:hover, .btn-new:hover, .section-link:hover { transform: none; }
}
