:root {
    color-scheme: light;
    --bg: #e6efdf;
    --bg-glow: #f4f8ee;
    --panel: rgba(255, 252, 247, 0.94);
    --panel-solid: #fffcf7;
    --panel-muted: #eef5e8;
    --border: rgba(90, 110, 80, 0.14);
    --text: #2f382c;
    --text-soft: #6d7a68;
    --accent: #4f7a55;
    --accent-soft: #e5f0e2;
    --shadow: 0 14px 40px rgba(55, 70, 45, 0.1);
    --shadow-sm: 0 4px 16px rgba(55, 70, 45, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --font-display: "Quicksand", "Nunito", system-ui, sans-serif;
    --font-body: "Nunito", "Quicksand", system-ui, sans-serif;
}

body[data-theme='dark'] {
    --bg: #1e2a22;
    --bg-glow: #24332a;
    --panel: rgba(32, 42, 35, 0.94);
    --panel-solid: #24332a;
    --panel-muted: #2c3b32;
    --border: rgba(180, 200, 170, 0.12);
    --text: #eef4ea;
    --text-soft: #a7b5a6;
    --accent: #8fbf8f;
    --accent-soft: #2c3b32;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body,
body.app-body {
    margin: 0;
    font-family: var(--font-body);
    background:
        radial-gradient(1000px 500px at 10% -10%, var(--bg-glow), transparent 55%),
        radial-gradient(800px 400px at 100% 0%, #dde9d4, transparent 45%),
        var(--bg);
    color: var(--text);
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    padding: 28px 22px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: var(--shadow-sm);
}

.brand-block {
    margin-bottom: 28px;
}

.brand-kicker,
.eyebrow,
.card-label {
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
}

.brand-name {
    display: inline-block;
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.03em;
}

.nav-list {
    display: grid;
    gap: 10px;
}

.nav-link {
    padding: 14px 16px;
    border-radius: 999px;
    color: var(--text-soft);
    background: transparent;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.nav-link.is-active,
.nav-link:hover {
    background: var(--panel-solid);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.app-content {
    padding: 28px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 8px 0 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.8rem);
    letter-spacing: -0.03em;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--panel-solid);
    color: var(--text);
    border-radius: 999px;
    padding: 12px 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.page-content {
    display: grid;
    gap: 24px;
}

.grid-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.content-grid > .card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(55, 70, 45, 0.14);
}

.stat-card h2 {
    margin: 10px 0 0;
    font-size: 2rem;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.section-heading p,
.empty-state,
.page-footer p {
    margin: 0;
    color: var(--text-soft);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--text-soft);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.metric-list {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.metric-list li {
    background: var(--panel-muted);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.page-footer {
    padding-top: 4px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.button-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(79, 122, 85, 0.28);
}

.button-secondary {
    background: var(--panel-muted);
    color: var(--text);
}

.button:hover,
.text-link:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.text-link {
    color: var(--text-soft);
    font-weight: 600;
}

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

.plant-card {
    display: grid;
    gap: 18px;
}

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

.plant-card h3 {
    margin: 6px 0 4px;
    font-size: 1.35rem;
}

.plant-card__scientific {
    margin: 0;
    color: var(--text-soft);
    font-style: italic;
}

.plant-card__meta,
.detail-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.plant-card__meta li,
.detail-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--panel-muted);
    border-radius: var(--radius-md);
}

.plant-card__meta span,
.detail-list span {
    color: var(--text-soft);
}

.plant-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--panel-muted);
    color: var(--text-soft);
}

.status-badge--active {
    background: #e8f5e9;
    color: #1b5e20;
}

body[data-theme='dark'] .status-badge--active {
    background: #1f3b2d;
    color: #b7f0c6;
}

.plant-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.plant-hero__title {
    margin: 8px 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.plant-hero__scientific {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-style: italic;
}

.plant-hero__summary {
    margin: 0;
    color: var(--text-soft);
    max-width: 60ch;
    line-height: 1.6;
}

.plant-stats h2 {
    font-size: 1.35rem;
}

.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--panel-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.plan-toolbar {
    margin-bottom: -8px;
}

.master-plan-hero {
    display: grid;
    gap: 24px;
}

.master-plan-hero__title {
    margin: 8px 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.master-plan-hero__goal {
    margin: 0;
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 65ch;
}

.master-plan-hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.hero-stat {
    background: var(--panel-muted);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: grid;
    gap: 8px;
}

.hero-stat span {
    color: var(--text-soft);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-stat strong {
    font-size: 1.05rem;
}

.plan-toc {
    position: sticky;
    top: 18px;
    z-index: 2;
}

.plan-toc__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.plan-toc__nav a {
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--panel-muted);
    color: var(--text-soft);
    font-size: 0.92rem;
}

.plan-toc__nav a:hover {
    color: var(--accent);
}

.plan-sections {
    display: grid;
    gap: 18px;
}

.plan-section .section-heading h2 {
    font-size: 1.15rem;
}

.plan-table tbody tr.is-total td {
    font-weight: 700;
}

.plan-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text);
    line-height: 1.7;
}

.plan-list--spaced {
    margin-top: 18px;
}

.rotation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.rotation-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rotation-card {
    background: var(--panel-muted);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: grid;
    gap: 6px;
    border: 1px solid transparent;
}

.rotation-card.harvest_and_sow {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.rotation-week {
    color: var(--text-soft);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rotation-action {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.rotation-card p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.5;
    white-space: normal;
}

.plan-note .section-heading p {
    max-width: 70ch;
    line-height: 1.6;
}

@media (max-width: 1080px) {
    .master-plan-hero__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plant-hero {
        flex-direction: column;
    }
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .grid-summary,
    .content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .app-content,
    .sidebar {
        padding: 18px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .grid-summary,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .metric-list li {
        border-radius: 18px;
    }
}
