:root {
    /* Тёплая, приглушённая палитра: крем, глубокий зелёный, терракота */
    --bg: #f9f8f5;
    --bg-alt: #efeeeb;
    --surface: #ffffff;
    --ink: #22261f;
    --muted: #736f66;
    --border: #e4e1d8;
    --green-deep: #26392f;
    --green-mid: #37544a;
    --sage: #a7b4a6;
    --sage-light: #e3e7e0;
    --terracotta: #bd5a30;
    --terracotta-light: #f3ded3;
    --danger: #a33d2c;
    --danger-light: #f6e1da;

    --font-display: 'Cormorant SC', 'Times New Roman', Georgia, serif;
    --font-body: 'Ysabeau', 'Segoe UI', -apple-system, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-size: 16px;
}

a { color: var(--green-deep); text-decoration: none; }
a:hover { color: var(--terracotta); text-decoration: underline; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--green-deep);
    line-height: 1.25;
}

h1 { font-size: 2rem; margin: 0 0 8px; }
h2 { font-size: 1.4rem; margin: 0 0 12px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: 0.06em;
    color: var(--green-deep);
}
.brand:hover { color: var(--terracotta); text-decoration: none; }

.nav {
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.nav a { color: var(--ink); }
.nav a:hover { color: var(--terracotta); }

.badge {
    background: var(--terracotta);
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.72rem;
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
}

.container {
    max-width: 740px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(34, 38, 31, 0.03), 0 10px 28px rgba(34, 38, 31, 0.04);
}

.centered { text-align: center; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.button, button, input[type=submit] {
    display: inline-block;
    background: var(--green-deep);
    color: #fdfcf9;
    border: none;
    border-radius: 999px;
    padding: 11px 26px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.button:hover, button:hover { background: var(--terracotta); color: #fff; text-decoration: none; }

.button.secondary, button.secondary {
    background: transparent;
    color: var(--green-deep);
    border: 1px solid var(--green-deep);
}
.button.secondary:hover { background: var(--green-deep); color: #fdfcf9; border-color: var(--green-deep); }

.button.danger, button.danger { background: var(--danger); }
.button.danger:hover { background: var(--terracotta); }

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: underline;
    border-radius: 0;
}
.link-button:hover { color: var(--terracotta); background: none; }

.inline-form { display: inline; }

form.stack { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }

label {
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--green-mid);
    display: block;
    margin-bottom: 6px;
}

input[type=text], input[type=email], input[type=password], input[type=number],
textarea, select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px var(--sage-light);
}

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

.field-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }

.error-banner {
    background: var(--danger-light);
    border: 1px solid #e3b7a7;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 18px;
}

.success-banner {
    background: var(--sage-light);
    border: 1px solid var(--sage);
    color: var(--green-deep);
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 18px;
}

.notice-banner {
    background: var(--terracotta-light);
    border: 1px solid #e1b699;
    color: #7a3a1c;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 18px;
}

.post {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}
.post:last-child { border-bottom: none; }

.post-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; letter-spacing: 0.01em; }
.post-text { white-space: pre-wrap; }
.post-actions { display: flex; gap: 18px; margin-top: 10px; font-size: 0.88rem; align-items: center; color: var(--muted); }
.post-actions a { color: var(--muted); }
.post-actions a:hover { color: var(--terracotta); }

.status-pill {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--sage-light);
    color: var(--green-mid);
}
.status-pill.approved { background: var(--sage-light); color: var(--green-deep); }
.status-pill.pending, .status-pill.re_review { background: var(--terracotta-light); color: #8a4a26; }
.status-pill.needs_revision { background: var(--terracotta-light); color: #8a4a26; }
.status-pill.rejected, .status-pill.blocked { background: var(--danger-light); color: var(--danger); }
.status-pill.draft { background: var(--bg-alt); color: var(--muted); }

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.catalog-card {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px 16px;
    background: var(--surface);
    text-align: center;
}

.catalog-card img, .avatar {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
    background: var(--bg-alt);
}

.catalog-card.blurred img { filter: blur(6px); }
.catalog-card.blurred .catalog-name { filter: blur(4px); }

.catalog-name { font-family: var(--font-display); font-size: 1.05rem; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filters select, .filters input[type=text] { width: auto; min-width: 160px; }

.dialog-list-item, .notification-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.dialog-list-item:last-child, .notification-item:last-child { border-bottom: none; }

.notification-item.unread { background: var(--terracotta-light); border-radius: 4px; padding: 14px; }

.message-row { margin-bottom: 12px; max-width: 75%; }
.message-row.mine { margin-left: auto; text-align: right; }
.message-bubble {
    display: inline-block;
    background: var(--bg-alt);
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 14px;
}
.message-row.mine .message-bubble { background: var(--green-deep); color: #fdfcf9; }

.checklist { list-style: none; padding: 0; }
.checklist li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: none; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }

table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table td, table.admin-table th {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.92rem;
}

.photo-editor { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.photo-editor #photo-current { margin-bottom: 4px; }
#photo-canvas {
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    touch-action: none;
}
.photo-editor-zoom { display: flex; align-items: center; gap: 8px; width: 320px; max-width: 100%; }
.photo-editor-zoom input[type=range] { width: 100%; }
.photo-editor-zoom label { margin-bottom: 0; }

.compose-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.compose-actions label {
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
    color: var(--muted);
}
