:root {
    --green: #2f6f4f;
    --green-dark: #1f4d36;
    --cream: #fbf7ef;
    --ink: #2a2a2a;
    --muted: #6b6b6b;
    --border: #e4ddcf;
    --card: #ffffff;
    --amber: #b8860b;
    --red: #a83232;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.5;
}
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { background: var(--green); color: #fff; padding: 16px 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.site-header .brand { color: #fff; font-size: 1.3rem; font-weight: 700; }
.site-header nav a { color: #eafaf0; margin-left: 18px; font-weight: 500; }
.site-header nav a:first-child { margin-left: 0; }

main.wrap { padding: 30px 20px 60px; min-height: 60vh; }

h1 { color: var(--green-dark); margin-top: 0; }
h2 { color: var(--green-dark); }

.search-bar { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.search-bar input[type=text] {
    flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 1rem;
}
.search-bar select {
    padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; background: #fff;
}
.search-bar button {
    padding: 10px 20px; background: var(--green); color: #fff; border: none;
    border-radius: 8px; font-size: 1rem; cursor: pointer;
}
.search-bar button:hover { background: var(--green-dark); }

.browse-layout { display: flex; gap: 32px; align-items: flex-start; }
.category-sidebar {
    flex: 0 0 220px; background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 18px;
}
.category-sidebar h2 { margin: 0 0 12px; font-size: 1rem; }
.browse-main { flex: 1; min-width: 0; }

.category-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.category-list li a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
    background: #fff; color: var(--ink); font-size: 0.92rem;
}
.category-list li a:hover { border-color: var(--green); text-decoration: none; }
.category-list li a.active { background: var(--green); border-color: var(--green); color: #fff; }
.category-list li a .count { font-size: 0.8rem; opacity: 0.75; }
.category-list li a.active .count { opacity: 0.9; }

@media (max-width: 700px) {
    .browse-layout { flex-direction: column; }
    .category-sidebar { flex: 1 1 auto; width: 100%; }
}

.recipe-card .category-tag { color: var(--green-dark); font-weight: 600; }
.recipe-card .category-tag:hover { text-decoration: underline; }
.recipe-card a.card-link { color: inherit; }
.recipe-card a.card-link:hover { text-decoration: none; }
.recipe-card a.card-link:hover h3 { text-decoration: underline; }
.recipe-card a.card-link img { display: block; }

.recipe-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px;
}
.recipe-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s;
}
.recipe-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.recipe-card img { width: 100%; height: 150px; object-fit: cover; background: #eee; }
.recipe-card .no-image { width: 100%; height: 150px; background: var(--green-dark, #2f6f4f); }
.recipe-card .body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.recipe-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.recipe-card .meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.recipe-card p { font-size: 0.9rem; color: var(--muted); flex: 1; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge.pending { background: #fdf0d5; color: var(--amber); }
.badge.approved { background: #e3f3e8; color: var(--green-dark); }
.badge.rejected { background: #f8e0e0; color: var(--red); }

.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; }
.muted { color: var(--muted); font-size: 0.85rem; }

form.stacked label { display: block; margin: 16px 0 6px; font-weight: 600; }
form.stacked input[type=text],
form.stacked input[type=number],
form.stacked input[type=email],
form.stacked input[type=file],
form.stacked select,
form.stacked textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; font-family: inherit;
}
form.stacked textarea { min-height: 120px; resize: vertical; }
form.stacked .row { display: flex; gap: 16px; flex-wrap: wrap; }
form.stacked .row > div { flex: 1; min-width: 140px; }
.btn {
    display: inline-block; padding: 10px 22px; background: var(--green); color: #fff;
    border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; margin-top: 20px;
    font-family: inherit; line-height: 1.4; vertical-align: middle; text-align: center;
    box-sizing: border-box;
}
.btn:hover { background: var(--green-dark); color: #fff; text-decoration: none; }
.btn.reject { background: var(--red); }
.btn.reject:hover { background: #7f2323; }
.btn.small { padding: 6px 14px; font-size: 0.85rem; margin-top: 0; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.alert.success { background: #e3f3e8; color: var(--green-dark); border: 1px solid #b9dfc6; }
.alert.error { background: #f8e0e0; color: var(--red); border: 1px solid #eab8b8; }
.alert.info { background: #eaf1fb; color: #2b5a9c; border: 1px solid #c7dcf5; }

.recipe-detail img { width: 100%; max-height: 380px; object-fit: cover; border-radius: 12px; margin-bottom: 20px; }
.recipe-detail .meta-bar { color: var(--muted); margin-bottom: 20px; font-size: 0.95rem; }
.recipe-detail .meta-bar span { margin-right: 18px; }
.recipe-detail pre { white-space: pre-wrap; font-family: inherit; font-size: 1rem; }
.two-col { display: flex; gap: 40px; flex-wrap: wrap; }
.two-col > div { flex: 1; min-width: 250px; }

.recipe-title-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.recipe-title-row h1 { margin-bottom: 0; }
.print-btn { margin-top: 0; background: #fff; color: var(--green-dark); border: 1px solid var(--green); white-space: nowrap; }
.print-btn:hover { background: var(--green); color: #fff; }

table.admin-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.admin-table th, table.admin-table td {
    text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 0.92rem;
}
table.admin-table th { color: var(--muted); font-weight: 600; }
.pagination { margin-top: 30px; display: flex; gap: 8px; }
.pagination a, .pagination span {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem;
}
.pagination .current { background: var(--green); color: #fff; }

.login-box { max-width: 380px; margin: 40px auto; background: #fff; padding: 30px; border-radius: 12px; border: 1px solid var(--border); }

.static-page-content { max-width: 700px; line-height: 1.7; }

@media print {
    .site-header, .site-footer, .no-print { display: none !important; }
    body { background: #fff; }
    main.wrap { padding: 0; min-height: 0; }
    .wrap { max-width: 100%; padding: 0; }
    .recipe-detail img { max-height: 260px; }
    .recipe-detail pre { white-space: pre-wrap; }
    a { color: inherit; text-decoration: none; }
    .two-col { gap: 24px; }
}
