:root {
    --bg: #f7f1ec;
    --panel: #ffffff;
    --line: #e7dcd1;
    --text: #2a1f1b;
    --muted: #6c5f55;
    --primary: #c76b3b;
    --primary-dark: #9f4b26;
    --danger: #b9484b;
    --ok: #2f7d57;
    --shadow: 0 14px 30px rgba(65, 37, 21, 0.12);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, #fff7ed, #f7f1ec 55%, #efe5dc 100%);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }
.row { display: flex; gap: 16px; }
.between { justify-content: space-between; }
.center { align-items: center; }

.topbar {
    background: linear-gradient(90deg, #2a1f1b, #4a2b20);
    color: #fff;
    padding: 16px 0;
    box-shadow: 0 8px 18px rgba(42, 31, 27, 0.4);
}

.brand {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.nav { display: flex; flex-wrap: wrap; gap: 14px; }
.nav a {
    color: #ffe9dc;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.page { padding: 28px 0 48px; }

.card,
.topic-card,
.post,
.form-card,
.sidebar-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.card,
.form-card,
.sidebar-box { padding: 18px; }

.grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.topic-list { display: grid; gap: 16px; }
.topic-card { padding: 18px; display: grid; gap: 10px; }
.meta { color: var(--muted); font-size: 14px; }

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

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fff1e6;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
}

.flash {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.flash-success { background: #eaf6ef; color: var(--ok); border: 1px solid #bfe4cf; }
.flash-error { background: #fdecec; color: var(--danger); border: 1px solid #f3c6c6; }

form { display: grid; gap: 12px; }
input[type=text],
input[type=password],
textarea,
input[type=file] {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    background: #fffdfb;
}

textarea { min-height: 140px; resize: vertical; }

button,
.button {
    display: inline-block;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    padding: 11px 18px;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(199, 107, 59, 0.25);
}

button.danger,
.button.danger { background: var(--danger); }
button.secondary,
.button.secondary { background: #7d6e63; }

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

.post {
    display: grid;
    grid-template-columns: 220px 1fr;
    overflow: hidden;
}

.post-author {
    background: #fff6ef;
    padding: 16px;
    border-right: 1px solid var(--line);
}

.post-content { padding: 16px; }
.post-content p { white-space: pre-wrap; margin-top: 0; line-height: 1.55; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.empty { color: var(--muted); font-style: italic; }
.small { font-size: 13px; color: var(--muted); }

.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi .card strong { display: block; font-size: 28px; margin-top: 8px; color: var(--primary-dark); }

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.table th { background: #fff1e6; }

@media (max-width: 800px) {
    .grid { grid-template-columns: 1fr; }
    .post { grid-template-columns: 1fr; }
    .post-author { border-right: none; border-bottom: 1px solid var(--line); }
}
