:root {
    --farm-bg-top: #eef8ef;
    --farm-bg-bottom: #cfe7d2;
    --farm-card: #f7fcf7;
    --farm-text: #1f2937;
    --farm-muted: #4b6353;
    --farm-line: #bfd6c4;
    --farm-primary: #2a7a45;
    --farm-primary-dark: #1f5f35;
    --farm-secondary: #4f7d5d;
    --farm-danger: #b42318;
    --farm-warning: #9a6700;
}

body {
    background:
        radial-gradient(circle at 22% 8%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, var(--farm-bg-top) 0%, var(--farm-bg-bottom) 88%) !important;
    color: var(--farm-text) !important;
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif !important;
}

.app {
    width: min(1400px, 100%);
    margin: 0 auto;
    min-height: 100vh !important;
    background: rgba(237, 248, 237, 0.55);
    backdrop-filter: blur(2px);
}

header {
    background: linear-gradient(180deg, #f5fbf5, #e9f4ea) !important;
    border-bottom: 1px solid var(--farm-line) !important;
    box-shadow: 0 10px 25px rgba(39, 58, 31, 0.08);
}

.logo .mark,
.post-avatar {
    background: linear-gradient(155deg, #49a761, var(--farm-primary-dark)) !important;
}

.site-name {
    color: #1b3c28;
    letter-spacing: 0.02em;
}

.section-note {
    color: var(--farm-muted) !important;
}

nav.sidebar {
    background: #e7f3e8 !important;
    border-right: 1px solid #c4dbc8 !important;
}

nav.sidebar a {
    color: #355642 !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

nav.sidebar a:hover {
    background: #dbeedc;
    color: #244b33 !important;
}

nav.sidebar a.active {
    background: #cde8d2 !important;
    color: #1d5c35 !important;
}

main {
    padding: 24px !important;
}

#app .main-content {
    background: transparent !important;
}

#app .main-content .panel {
    background: var(--farm-card) !important;
    border-color: var(--farm-line) !important;
}

.panel,
.post,
.modal,
.search-box {
    background: var(--farm-card) !important;
    border-color: var(--farm-line) !important;
}

.panel,
.post {
    border: 1px solid var(--farm-line);
    border-radius: 12px !important;
    box-shadow: 0 10px 28px rgba(34, 49, 28, 0.08) !important;
}

h1,
h2,
h3 {
    color: #1f3a29;
}

.create-post-btn,
.action-btn,
.post-action-btn:hover,
.modal-actions .primary,
button.primary {
    background: linear-gradient(180deg, #3f9a58, var(--farm-primary)) !important;
    border-color: var(--farm-primary-dark) !important;
    color: #f4fff6 !important;
}

.login-btn,
button.muted,
.action-btn.delete,
#reg-cancel,
#guest-btn {
    background: #e8f4ea !important;
    border: 1px solid #c5ddca !important;
    color: #335942 !important;
}

button,
.action-btn,
.filter-select,
.search-input,
.search-box,
input,
textarea,
select {
    border-radius: 10px !important;
}

button,
.action-btn,
.create-post-btn,
.logout-btn,
.login-btn {
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

button:hover,
.action-btn:hover,
.create-post-btn:hover,
.logout-btn:hover,
.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(36, 58, 31, 0.18);
}

input,
select,
textarea {
    border: 1px solid var(--farm-line) !important;
    color: #1f2937 !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(47, 111, 63, 0.68) !important;
    box-shadow: 0 0 0 4px rgba(47, 111, 63, 0.14);
}

.post-badge {
    background: linear-gradient(180deg, #3b834d, #28633a) !important;
}

.post-meta,
.pager-note,
.notice,
.small {
    color: var(--farm-muted) !important;
}

.status-msg.error,
.notice.error {
    color: var(--farm-danger) !important;
}

.status-msg.success,
.notice.success {
    color: #0f7a3e !important;
}

.users-table th,
.users-table td {
    border-bottom: 1px solid #d3e2d6 !important;
}

.summary-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid #d6c49f !important;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(61, 49, 35, 0.1) !important;
}

.summary-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -48px;
    top: -60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(214, 196, 159, 0.35), transparent 72%);
    pointer-events: none;
}

.summary-card .summary-label {
    background: rgba(214, 196, 159, 0.24);
    border: 1px solid rgba(214, 196, 159, 0.45);
    border-radius: 999px;
    padding: 4px 10px;
}

.summary-card .summary-value {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(191, 214, 196, 0.65);
    border-radius: 12px;
    padding: 6px 14px;
}

.summary-card .summary-sub {
    background: rgba(191, 214, 196, 0.3);
    border-radius: 999px;
    padding: 3px 10px;
}

/* Form styling with green farm theme */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--farm-text) !important;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--farm-line) !important;
    border-radius: 10px !important;
    font-family: inherit;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--farm-text) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--farm-primary) !important;
    box-shadow: 0 0 0 3px rgba(47, 111, 63, 0.15) !important;
    background: #ffffff !important;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-group select::placeholder {
    color: var(--farm-muted) !important;
}

button[type="submit"],
input[type="submit"],
.btn.primary,
.btn.btn-primary,
.modal-actions .primary {
    background: linear-gradient(180deg, #3f9a58, var(--farm-primary)) !important;
    border: 1px solid var(--farm-primary-dark) !important;
    color: #f4fff6 !important;
    padding: 10px 16px;
    border-radius: 10px !important;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button[type="submit"]:hover,
input[type="submit"]:hover,
.btn.primary:hover,
.btn.btn-primary:hover,
.modal-actions .primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(36, 58, 31, 0.18);
    background: linear-gradient(180deg, #49a761, var(--farm-primary-dark)) !important;
}

.btn.secondary,
.btn.btn-secondary,
button[type="button"],
.modal-actions .secondary {
    background: #e8f4ea !important;
    border: 1px solid #c5ddca !important;
    color: #335942 !important;
    padding: 10px 16px;
    border-radius: 10px !important;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.secondary:hover,
.btn.btn-secondary:hover,
button[type="button"]:hover,
.modal-actions .secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(36, 58, 31, 0.12);
    background: #d7ebdc !important;
}

/* Pending page fallback styling */
body > h1:first-of-type {
    margin: 0;
    text-align: center;
    padding-top: 90px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 5vw, 48px);
}

body > p:first-of-type {
    margin: 14px auto 0;
    width: min(680px, 92%);
    text-align: center;
    font-size: 16px;
    color: #4f5e4a;
}

@media (max-width: 900px) {
    .app {
        min-height: auto !important;
    }

    main {
        padding: 16px !important;
    }
}