:root {
    /* Color system */
    --bg: #f5f0e6;          /* beige background */
    --card: #ffffff;
    --accent: #2b7a78;      /* your existing green */
    --muted: #666666;
    --border-soft: rgba(15, 23, 42, 0.10);
}

/* Global reset */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--bg);
    color: #111;
    -webkit-font-smoothing: antialiased;
}

/* Typography weights */
h1, h2, h3 {
    font-weight: 700; /* bold headings */
}

.site-footer {
    font-weight: 500; /* slightly less bold than headings */
}

body,
p,
span,
li,
td,
th,
label,
input,
select,
textarea,
button {
    font-weight: 400; /* regular text */
}

/* Header + nav */

.site-header {
    max-width: 980px;
    margin: 16px auto 8px;
    padding: 16px 12px 8px;
    text-align: center;
}

.site-header h1 {
    margin: 0 0 6px;
    font-size: clamp(1.8rem, 2.4vw + 1rem, 2.4rem);
}

.lead {
    margin: 0;
    color: var(--muted);
    font-size: 0.97rem;
}

.site-nav {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.site-nav .nav-link {
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    border: 1px solid var(--accent);
    color: #111;
    background: var(--bg); /* beige buttons by default */
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.site-nav .nav-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.site-nav .nav-link.is-current {
    background: var(--accent); /* keep current tab green */
    border-color: var(--accent);
    color: #fff;
}

/* Layout */

main {
    max-width: 980px;
    margin: 0 auto 24px;
    padding: 0 12px 24px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* 5 cards per row on wide screens */
@media (min-width: 1100px) {
    .grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Card / box style */

.box {
    background: var(--card);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    /* no shadow; flat design */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
    min-height: 230px; /* a bit taller overall */
}

.box:focus,
.box:hover {
    /* subtle hover without shadow */
    border-color: var(--accent);
    transform: translateY(-2px);
    outline: none;
}

.box img {
    width: 100%;
    height: 150px; /* taller image area */
    object-fit: cover;
    border-radius: 8px;
}

.box h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700; /* bold titles on cards */
}

.box p {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

/* Make anchor boxes behave like cards */

a.box {
    text-decoration: none;
    color: inherit;
}

/* Detail panel used on home page */

.detail {
    max-width: 800px;
    margin: 24px auto 0;
    padding: 20px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    /* no shadow */
}

.detail .back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    margin-bottom: 8px;
}

.detail .back span {
    font-size: 1.2rem;
}

.detail img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 12px;
}

.detail h2 {
    margin: 12px 0 6px;
}

.detail p {
    color: var(--muted);
}

/* Footer */

.site-footer {
    text-align: center;
    padding: 12px;
    color: var(--muted);
    font-size: .9rem;
    border-top: 1px solid rgba(15,23,42,0.10);
}

/* Plant page layout */

body.plant-page main {
    max-width: 980px;
    margin: 0 auto 24px;
    padding: 0 12px 24px;
}

.breadcrumb {
    margin: 0 0 8px;
    font-size: .9rem;
    color: var(--muted);
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.plant-card {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-soft);
    /* no shadow */
}

.plant-card h2 {
    margin: 0 0 4px;
    font-weight: 700; /* bold plant titles */
}

.plant-subtitle {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: .95rem;
}

.plant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 10px 0 4px;
    font-size: .93rem;
}

.plant-meta-item {
    display: flex;
    flex-direction: column;
}

.plant-meta-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
}

.plant-meta-value {
    font-size: .94rem;
}

/* Sections inside plant page */

.plant-sections {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: 18px;
}

.plant-section h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(15,23,42,0.08);
    padding-bottom: 4px;
}

.plant-field {
    margin-bottom: 6px;
    font-size: .95rem;
}

.field-label {
    display: block;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.field-value {
    font-size: .95rem;
}

.plant-notes {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(15,23,42,0.08);
    font-size: .95rem;
}

/* Plants list page */

.plants-intro {
    margin: 12px 0 6px;
    color: var(--muted);
    font-size: .95rem;
}

/* --- Modern table styling (stock & exchange, trade, profile) --- */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
}

thead {
    background: #111; /* black header band */
    color: #ffffff;
}

thead th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid rgba(15,23,42,0.06);
}

tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02); /* subtle zebra */
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 7px 10px;
    vertical-align: top;
}

th {
    font-weight: 600;
}

/* Optional: highlight important rows */
tbody tr:hover {
    background: rgba(43, 122, 120, 0.06);
}

/* --- Form & button polish --- */

.form-row label {
    font-weight: 500;
}

.form-row input,
.form-row select,
.form-row textarea {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(15,23,42,0.15);
    font: inherit;
    background: #fff;
}

.form-row textarea {
    resize: vertical;
}

.required {
    color: #c0392b;
    margin-left: 3px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

button,
.button {
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    padding: 6px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: background .12s ease, color .12s ease, border-color .12s ease, opacity .12s ease;
}

button:hover,
.button:hover {
    opacity: 0.9;
}

.form-secondary {
    background: var(--bg);
    color: #111;
    border-color: rgba(15,23,42,0.18);
}

.form-danger {
    background: #fee;
    color: #900;
    border-color: #e08a8a;
}

.small-button {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* --- Trade Space layout & styling --- */

.trade-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
    margin-top: 16px;
}

.trade-form-section {
    flex: 1 1 260px;
}

.trade-list-section {
    flex: 2 1 320px;
}

.section-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 700; /* bold section titles */
}

.section-subtitle {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--muted);
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.form-row.inline {
    margin-bottom: 0;
}

.trade-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.trade-list-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.trade-card {
    cursor: default;
}

.trade-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.trade-desc {
    margin-top: 4px;
    font-size: 0.9rem;
}

.trade-contact {
    margin-top: 6px;
    font-size: 0.9rem;
    font-weight: 500; /* emphasize contact info slightly */
}

.trade-card-footer {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.8rem;
    color: var(--muted);
}

.trade-card-actions {
    display: flex;
    gap: 8px;
}

.small-link {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.small-link.danger {
    color: #b23a2c;
}

.empty-state {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--muted);
}

/* --- Profile layout & styling --- */

.profile-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
    margin-top: 16px;
}

.profile-form-section {
    flex: 1 1 320px;
}

.profile-preview-section {
    flex: 1 1 280px;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 16px;
    margin-bottom: 10px;
}

.profile-preview h3 {
    margin-top: 0;
    font-weight: 700;
}

.profile-meta {
    margin: 4px 0 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

.profile-bio {
    margin: 4px 0;
    font-size: 0.9rem;
}

.profile-contact {
    margin: 6px 0 0;
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* Tabs (admin etc.) */

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-button {
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(15,23,42,0.18);
    background: var(--bg);
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 999px;
}

.tab-button.active {
    background: #e0ffe0;
    border-color: #8bc48b;
}

.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
}

/* Responsive tweaks */

@media (max-width: 800px) {
    .plant-sections {
        grid-template-columns: minmax(0, 1fr);
    }

    .trade-layout,
    .profile-layout {
        flex-direction: column;
    }

    .profile-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 420px) {
    .box img {
        height: 120px;
    }
}