/* ===========================================================================
   Farm Manager: design system
   Theme: a working farm in a warm morning. Paper-cream surfaces, leaf greens,
   marigold and clay accents, soft shadows, a gently serif display face.
   Variable names (--line, --accent, --panel-soft …) are shared with every view,
   so a change here restyles the whole app.
   =========================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-wght.woff2") format("woff2"); }

:root {
    --bg: #ffffff;
    --bg-deep: #e6e9eb;
    --panel: #ffffff;
    --panel-soft: #f6f7f8;
    --panel-tint: #edf6e6;
    --line: #eceef0;
    --line-strong: #dde1e3;
    --text: #111411;
    --muted: #6e757b;
    --faint: #9ca2a7;

    --accent: #3f9a17;
    --accent-strong: #2f7d0f;
    --accent-soft: #e4f3d9;
    --accent-glow: rgba(63, 154, 23, .17);

    --forest: #141714;
    --forest-2: #22261f;
    --forest-3: #343a30;
    --leaf: #8fdc66;
    --lime: #b2e88d;
    --marigold: #f2d640;
    --marigold-soft: #fbf3bd;
    --clay: #c26238;
    --clay-soft: #f6dcc9;
    --soil: #8a5c37;
    --water: #3a8db3;
    --water-soft: #d7ecf5;
    --sky: #9fd0e0;

    --warn: #935e12;
    --danger: #b4412f;
    --danger-soft: #f8ddd6;

    --shadow-sm: 0 1px 2px rgba(20, 23, 20, .06), 0 4px 14px rgba(20, 23, 20, .05);
    --shadow: 0 12px 36px rgba(20, 23, 20, .10);
    --shadow-lg: 0 24px 60px rgba(20, 23, 20, .18);
    --radius: 22px;
    --radius-sm: 14px;

    --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", "Noto Sans Tamil", "Tamil Sangam MN", sans-serif;
    --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", "Noto Sans Tamil", "Tamil Sangam MN", sans-serif;
    --sidebar-w: 268px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14.5px;
    line-height: 1.5;
    letter-spacing: -0.003em;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(900px 420px at 92% -8%, #e4efcf 0%, transparent 62%),
        radial-gradient(700px 380px at -6% 108%, #f3e5c4 0%, transparent 60%),
        var(--bg);
    background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; }
::selection { background: var(--accent-soft); }

.icon { flex: none; vertical-align: -0.18em; }

/* ---------------------------------------------------------------- shell */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
    display: flex; flex-direction: column; gap: 4px;
    padding: 20px 14px 16px;
    color: #dbe8cf;
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(143, 220, 102, .18), transparent 65%),
        linear-gradient(180deg, var(--forest) 0%, #0f110f 100%);
}
.sidebar::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 170px; pointer-events: none; opacity: .5;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 268 170' preserveAspectRatio='none'%3E%3Cpath d='M0 118C50 96 96 104 140 120S226 130 268 104V170H0z' fill='%231d4a2c'/%3E%3Cpath d='M0 140C60 122 120 132 170 146S238 150 268 134V170H0z' fill='%23265a3b'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.sidebar > * { position: relative; z-index: 1; }

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 10px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { display: block; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
.brand h1 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.brand p { margin: 3px 0 0; color: #9fc08f; font-size: 11.5px; letter-spacing: .02em; }

.nav { display: grid; gap: 2px; }
.nav-group { margin: 10px 10px 3px; color: #7fa56f; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav a {
    position: relative; display: flex; align-items: center; gap: 11px;
    padding: 6px 12px; border-radius: 11px; color: #c9dbbd; font-weight: 500; font-size: 14px; line-height: 1.35;
    transition: background .15s, color .15s, transform .15s;
}
.nav a .icon { color: #8fb57f; transition: color .15s, transform .2s; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a:hover .icon { color: var(--lime); transform: scale(1.1); }
.nav a.active { background: linear-gradient(90deg, rgba(143, 220, 102, .20), rgba(143, 220, 102, .06)); color: #fff; font-weight: 600; }
.nav a.active .icon { color: var(--lime); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--marigold); }

.sidebar-foot { position: sticky; bottom: 0; margin-top: auto; padding: 16px 0 2px; display: grid; gap: 10px; background: linear-gradient(0deg, #0f110f 72%, rgba(13, 37, 22, 0)); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 12.5px; color: #dbe8cf; }
.sidebar-user .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--marigold); color: #3b2a07; flex: none; }
.sidebar-user small { display: block; color: #8fb57f; font-size: 11px; }
.btn.ghost-light { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #dbe8cf; box-shadow: none; width: 100%; }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .3); transform: none; }

.main { padding: 30px 38px 70px; min-width: 0; max-width: 1560px; }

.mobile-bar { display: none; }
.nav-scrim { display: none; }

.topbar {
    position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
    margin-bottom: 26px; padding-bottom: 4px;
}
.topbar > * { position: relative; z-index: 1; }
.topbar::after {
    content: ""; position: absolute; right: -10px; top: -22px; width: 420px; height: 120px; z-index: 0; pointer-events: none; opacity: .6;
    -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%); mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 120'%3E%3Ccircle cx='350' cy='38' r='20' fill='%23ffd36a'/%3E%3Cpath d='M0 96C60 62 120 66 180 84S300 104 420 70V120H0z' fill='%23cfe5b4'/%3E%3Cpath d='M70 120C130 92 200 98 260 108S360 112 420 96V120z' fill='%23b2d78d'/%3E%3Cg stroke='%238a5c37' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M300 100c2-14 0-26 4-38'/%3E%3C/g%3E%3Cg fill='%232f7d3e'%3E%3Cpath d='M304 62c-10-9-24-8-32 3 12-4 22-4 32-3zM304 62c10-9 24-8 32 3-12-4-22-4-32-3zM304 62c-4-14-16-20-26-14 10 0 20 4 26 14zM304 62c4-14 16-20 26-14-10 0-20 4-26 14z'/%3E%3C/g%3E%3C/svg%3E") right top / contain no-repeat;
}
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-weight: 700; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--leaf), var(--marigold)); }
h2 { margin: 6px 0 0; font-family: var(--font-display); font-size: 34px; line-height: 1.12; font-weight: 800; letter-spacing: -0.018em; }
.subtle { color: var(--muted); margin: 8px 0 0; line-height: 1.55; max-width: 62ch; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* -------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 8px 16px; border-radius: 12px;
    border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
    font-weight: 600; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .2s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 6px 18px rgba(20, 23, 20, .10); color: var(--accent-strong); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; }
.btn.primary { color: #fff; border-color: #27693b; background: linear-gradient(180deg, #3f9a17, #2b7642); box-shadow: 0 6px 18px rgba(63, 154, 23, .30); }
.btn.primary:hover { color: #fff; background: linear-gradient(180deg, #43a05b, #2f8048); border-color: #2f7d0f; }
.btn.danger { color: #fff; border-color: #9c3524; background: linear-gradient(180deg, #c14b37, #a63b29); box-shadow: 0 4px 14px rgba(180, 65, 47, .25); }
.btn.danger:hover { color: #fff; border-color: #7e2a1c; }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 12.5px; border-radius: 10px; }

/* ---------------------------------------------------------------- panels */
.grid { display: grid; gap: 18px; }
.grid.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); }

.panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.panel-header {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-title { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.panel-body { padding: 20px; }

.stat { position: relative; overflow: hidden; padding: 18px 20px; }
.stat::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--leaf), var(--marigold)); }
.stat span { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.stat strong { display: block; margin-top: 8px; font-family: var(--font-display); font-size: 27px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; background: var(--panel-soft); white-space: nowrap; }
.table th:first-child { border-top-left-radius: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(223, 236, 211, .35); }
.table tr:last-child td { border-bottom: 0; }

.pill {
    display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px;
    background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 650; white-space: nowrap;
}
.pill.status-planned { background: #eceef0; color: #6f6338; }
.pill.status-planted { background: #e4f3d9; color: #476b17; }
.pill.status-growing { background: #d4ebc6; color: #1f6a30; }
.pill.status-ready { background: var(--marigold-soft); color: #8a5a07; }
.pill.status-harvested { background: var(--water-soft); color: #1f5f7d; }
.pill.status-sold { background: #cfe9d6; color: #1b5c3a; }
.pill.status-fallow { background: #ece9e0; color: #6d6a5e; }

.muted { color: var(--muted); }
.compact { font-size: 13px; }
.profit-positive { color: var(--accent-strong); }
.profit-negative { color: var(--danger); }

.empty {
    position: relative; border: 1.5px dashed var(--line-strong); border-radius: 16px; padding: 78px 24px 26px; text-align: center;
    color: var(--muted); background: var(--panel-soft);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 64'%3E%3Cpath d='M8 54c18-6 34-6 52 0s34 6 52 0' stroke='%23c9bf9e' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3Cpath d='M60 52V30' stroke='%236aa84f' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M60 34c-10 0-15-6-15-14 10 0 15 5 15 14z' fill='%236fb552'/%3E%3Cpath d='M60 30c0-9 5-14 15-14 0 8-5 14-15 14z' fill='%2394cf6e'/%3E%3Ccircle cx='92' cy='16' r='8' fill='%23f5c453' opacity='.8'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center 14px; background-size: 112px auto;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field.full { grid-column: 1 / -1; }
label { display: block; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .01em; margin-bottom: 6px; }
input, select, textarea {
    width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; background: #fffefb;
    padding: 10px 12px; color: var(--text); outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: #bdb393; }
input::placeholder, textarea::placeholder { color: #aaa58f; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; flex: none; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); background: #fff; }
textarea { min-height: 92px; resize: vertical; }
.error { color: var(--danger); margin-top: 5px; font-size: 12.5px; font-weight: 500; }

.flash {
    display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 12px 16px; border-radius: 14px;
    border: 1px solid #c7e0b4; background: linear-gradient(90deg, #eaf5dd, #f3f9ec); color: #1f4d2a;
}
.flash::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e7d46' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.flash.error { border-color: #ecc3b8; background: linear-gradient(90deg, #fbe8e2, #fdf1ed); color: #8a3223; }
.flash.error::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4412f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m10.3 3.9-8.4 14.5A2 2 0 0 0 3.6 21.4h16.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }

.illustration svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.main > .topbar, .main > .panel, .main > section.panel, .main > .grid { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.main > .panel:nth-child(3), .main > .grid:nth-child(3) { animation-delay: .06s; }
.main > .panel:nth-child(4), .main > .grid:nth-child(4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* --------------------------------------------------------- responsive */
@media (max-width: 1280px) { .grid.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 70; width: min(300px, 86vw); height: 100dvh;
        transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .7, .2, 1); box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: none; }
    .nav-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(15, 17, 15, .5); opacity: 0; pointer-events: none; transition: opacity .25s; backdrop-filter: blur(2px); }
    body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
    .mobile-bar {
        position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
        background: rgba(255, 253, 246, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
    }
    .mobile-bar .brand-mark { width: 32px; height: 32px; }
    .mobile-bar strong { font-family: var(--font-display); font-size: 17px; font-weight: 800; }
    .mobile-bar button { margin-left: auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel); display: grid; place-items: center; cursor: pointer; color: var(--text); }
    .main { padding: 22px 18px 60px; }
    .grid.stats, .grid.two { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; }
    .topbar::after { opacity: .35; width: 300px; }
}
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    h2 { font-size: 27px; }
    .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat strong { font-size: 22px; }
    .panel-header, .panel-body { padding-left: 16px; padding-right: 16px; }
}

/* =========================================================================
   Dashboard widgets carried over from the first design, re-themed below
   ========================================================================= */
.timeline { display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; }
.dot { width: 10px; height: 10px; background: var(--accent); border-radius: 99px; margin-top: 6px; }
.lifecycle-bar { display: flex; gap: 4px; }
.lifecycle-step { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.lifecycle-step.done { background: var(--accent); }
.lifecycle-track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.lifecycle-node { text-align: center; position: relative; padding-top: 14px; }
.lifecycle-node::before {
                content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
                width: 10px; height: 10px; border-radius: 99px; background: var(--line);
            }
.lifecycle-node.done::before, .lifecycle-node.current::before { background: var(--accent); }
.lifecycle-label { font-size: 11px; color: var(--muted); }
.lifecycle-node.current .lifecycle-label { color: var(--accent-strong); font-weight: 700; }
.alert-strip { display: grid; gap: 8px; margin-bottom: 16px; }
.alert-item {
                display: flex; align-items: center; gap: 10px;
                border: 1px solid #efd49a; background: var(--marigold-soft); color: var(--warn);
                border-radius: 8px; padding: 10px 14px; font-weight: 600; font-size: 13px;
            }
.alert-item.overdue { border-color: #ecc3b8; background: var(--danger-soft); color: var(--danger); }
.alert-item .pill { flex: none; }
.parcel-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plantation-row {
                display: flex; align-items: center; gap: 14px;
                padding: 12px 0; border-top: 1px solid var(--line);
            }
.plantation-row:first-of-type { border-top: 0; padding-top: 4px; }
.plantation-main { flex: 1; min-width: 0; }
.water-dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; flex: none; }
.water-dot.ok { background: var(--accent); }
.water-dot.warn { background: var(--marigold); }
.water-dot.late, .water-dot.never { background: var(--danger); }
.water-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.donut { flex: none; }
.donut-legend { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-fill { width: 100%; max-width: 34px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; opacity: .85; }
.bar-fill.zero { background: var(--line); }
.bar-value { font-size: 11px; font-weight: 700; color: var(--accent-strong); }
.bar-label { font-size: 10px; color: var(--muted); white-space: nowrap; transform: rotate(-40deg); transform-origin: top center; height: 26px; margin-top: 4px; }
.note-item {
                display: flex; gap: 10px; align-items: flex-start;
                border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel);
            }
.note-item.flagged { border-color: #e8c988; background: #fdf9ef; }
.note-item.done { opacity: .55; }
.note-item.done .note-body { text-decoration: line-through; }
.note-body { flex: 1; min-width: 0; word-break: break-word; }
.note-actions { display: flex; gap: 4px; flex: none; }
.note-actions form { margin: 0; }
.icon-btn {
                border: 0; background: none; cursor: pointer; padding: 2px 4px;
                font-size: 14px; line-height: 1; color: var(--muted); border-radius: 6px;
            }
.icon-btn:hover { background: var(--panel-soft); color: var(--text); }
.icon-btn.active { color: var(--marigold); }
.reminder-badge {
                display: inline-flex; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700;
                background: var(--marigold-soft); color: var(--warn); border: 1px solid #efd49a; margin-top: 4px;
            }
.reminder-badge.due { background: var(--danger-soft); color: var(--danger); border-color: #ecc3b8; }
.badge-reminder {
                position: relative; display: inline-flex; align-items: center; gap: 4px;
                border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
                background: var(--marigold-soft); color: var(--warn); border: 1px solid #efd49a; cursor: default;
            }
.badge-reminder.due { background: var(--danger-soft); color: var(--danger); border-color: #ecc3b8; }
.badge-reminder .tooltip {
                display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
                min-width: 240px; max-width: 320px;
                background: var(--forest); color: #f4f8f1; border-radius: 10px; padding: 12px 14px;
                font-size: 12px; font-weight: 400; box-shadow: 0 14px 40px rgba(16, 24, 17, .35);
            }
.badge-reminder .tooltip::before {
                content: ""; position: absolute; top: -5px; right: 18px;
                width: 10px; height: 10px; transform: rotate(45deg); background: var(--forest);
            }
.badge-reminder:hover .tooltip, .badge-reminder:focus .tooltip, .badge-reminder:focus-within .tooltip { display: block; }
.tooltip-row { display: flex; gap: 8px; padding: 4px 0; align-items: baseline; }
.tooltip-row.due .tooltip-date { color: #ffb3a7; }
.tooltip-date { flex: none; font-weight: 700; color: var(--lime); min-width: 44px; }
.dashboard-filter {
                display: flex; align-items: center; gap: 10px;
                margin-bottom: 16px; padding: 12px 14px;
                background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
            }
.dashboard-filter label { font-size: 12px; font-weight: 700; color: var(--muted); }
.parcel-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.parcel-card-head {
                display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
                padding: 16px 18px 10px;
            }
.parcel-card-title { font-size: 17px; font-weight: 700; }
.parcel-card-body {
                display: grid; grid-template-columns: minmax(0, 1fr) 250px;
                gap: 18px; padding: 6px 18px 16px; align-items: start;
            }
.parcel-card-crops { display: grid; }
.crop-line { padding: 12px 0; border-top: 1px solid var(--line); }
.crop-line:first-child { border-top: 0; padding-top: 4px; }
.coverage-tile {
                position: relative; border-radius: 12px; padding: 18px 16px 16px; color: #f4f8f1;
                background: linear-gradient(150deg, var(--forest-3) 0%, var(--accent-strong) 55%, var(--forest-2) 100%);
                box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(22, 52, 31, .22);
            }
.coverage-tile.over { background: linear-gradient(150deg, #6b3a31 0%, var(--danger) 55%, #5e221a 100%); }
.live-badge {
                position: absolute; top: 12px; right: 12px;
                display: inline-flex; align-items: center; gap: 6px;
                font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
                color: rgba(255,255,255,.85); background: rgba(255,255,255,.12);
                border-radius: 999px; padding: 4px 9px;
            }
.live-badge::before {
                content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--lime);
                animation: live-pulse 1.6s ease-in-out infinite;
            }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.coverage-tile-metrics { display: flex; gap: 22px; align-items: flex-end; margin-top: 18px; flex-wrap: wrap; }
.coverage-tile-label {
                display: block; font-size: 10px; font-weight: 700; text-transform: uppercase;
                letter-spacing: .08em; color: rgba(255,255,255,.65); margin-bottom: 4px;
            }
.coverage-tile-value { font-size: 30px; line-height: 1; font-weight: 750; }
.coverage-tile-sub { font-size: 16px; line-height: 1.3; font-weight: 650; }
.coverage-tile-track {
                position: relative; height: 8px; border-radius: 999px; margin-top: 14px;
                background: rgba(255,255,255,.16); overflow: hidden;
            }
.coverage-tile-track .coverage-fill { background-color: var(--lime); }
.coverage-tile-track .coverage-fill.over { background-color: #ffb3a7; }
.parcel-card-foot {
                display: flex; justify-content: space-between; gap: 12px;
                border-top: 1px solid var(--line); padding: 11px 18px;
                font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
                color: var(--muted); background: var(--panel-soft);
            }
.parcel-card-foot strong { color: var(--text); font-size: 13px; letter-spacing: 0; }
.coverage-row { display: grid; gap: 6px; }
.coverage-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.coverage-track {
                position: relative; height: 22px; border-radius: 999px;
                background: var(--panel-soft); border: 1px solid var(--line); overflow: hidden;
            }
.coverage-fill {
                position: absolute; inset: 0 auto 0 0; width: var(--target, 0%);
                border-radius: 999px;
                background-color: var(--accent);
                background-size: 28px 28px;
                background-image: linear-gradient(135deg, rgba(255,255,255,.14) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.14) 50%, rgba(255,255,255,.14) 75%, transparent 75%, transparent);
                animation: coverage-grow 900ms cubic-bezier(.25,.7,.3,1) both, coverage-stripes 1.6s linear infinite;
            }
.coverage-fill.over { background-color: var(--danger); }
.coverage-fill.unknown { background-color: var(--line-strong); animation: coverage-grow 900ms cubic-bezier(.25,.7,.3,1) both; }
.coverage-percent {
                position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
                font-size: 11px; font-weight: 700; color: var(--accent-strong);
            }
@keyframes coverage-grow { from { width: 0; } to { width: var(--target, 0%); } }
@keyframes coverage-stripes { from { background-position: 0 0; } to { background-position: 28px 0; } }
.timeline-day { margin-bottom: 14px; }
.timeline-day:last-child { margin-bottom: 0; }
.timeline-date {
                font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted);
                margin-bottom: 8px; letter-spacing: .04em;
            }
.timeline-entry { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; }
.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail::before {
                content: ""; position: absolute; top: 4px; bottom: -10px; width: 2px;
                background: var(--line); left: 50%; transform: translateX(-50%);
            }
.timeline-entry:last-child .timeline-rail::before { bottom: auto; height: 14px; }
.timeline-rail .dot { position: relative; z-index: 1; margin-top: 5px; }
.timeline-card {
                border: 1px solid var(--line); border-radius: 8px;
                background: var(--panel); padding: 10px 12px; margin-bottom: 10px;
            }
.timeline-entry:last-child .timeline-card { margin-bottom: 0; }
.viz-tip {
                position: fixed; z-index: 100; pointer-events: none; display: none; max-width: 280px;
                background: var(--forest); color: #f4f8f1; border-radius: 8px; padding: 9px 12px; font-size: 12px;
                box-shadow: 0 10px 30px rgba(16, 24, 17, .35);
            }
.viz-tip .t { color: #c3c2b7; margin-bottom: 4px; }
.viz-tip .r { display: flex; gap: 8px; align-items: center; padding: 1px 0; }
.viz-tip .r i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.viz-tip .r b { font-size: 13px; }
.viz-tip .r span { color: #c3c2b7; }

@media (max-width: 1280px) { .parcel-board { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .parcel-card-body { grid-template-columns: 1fr; } }

/* ======================================================================
   Solid buttons and tables (override the first pass above)
   ====================================================================== */
button, .btn { -webkit-tap-highlight-color: transparent; }
.btn {
    min-height: 40px; padding: 9px 18px; border-radius: 10px; gap: 8px;
    border: 1.5px solid #dde1e3; background: #fff; color: var(--text);
    font-weight: 700; font-size: 14px; letter-spacing: .005em; line-height: 1.2; white-space: nowrap; text-decoration: none;
    box-shadow: 0 1px 0 rgba(20, 23, 20, .06);
    transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .06s;
}
.btn:hover { transform: none; background: #f3f4f5; border-color: #b9bec2; color: var(--text); box-shadow: 0 1px 0 rgba(20, 23, 20, .08); }
.btn:active { transform: scale(.97); box-shadow: none; }
.btn svg { flex: none; }
.btn.primary { background: #3f9a17; border-color: #2f7d0f; color: #fff; box-shadow: 0 1px 0 rgba(10, 40, 20, .35), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.primary:hover { background: #2f7d0f; border-color: #145028; color: #fff; }
.btn.primary:active { background: #2f7d0f; }
.btn.danger { background: #fff; border-color: #e3b3a8; color: #b03a26; box-shadow: none; }
.btn.danger:hover { background: #b03a26; border-color: #b03a26; color: #fff; }
.btn.sm { min-height: 34px; padding: 6px 13px; font-size: 13px; border-radius: 9px; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--accent-strong); }
.btn.ghost:hover { background: rgba(63, 154, 23, .1); border-color: transparent; }
.btn:disabled, .btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; }
.btn.block { width: 100%; }

.row-actions { text-align: right; white-space: nowrap; width: 1%; }
.row-actions > div { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; display: inline-flex; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th {
    padding: 12px 16px; background: #eceef0; color: #4c5744; border-bottom: 2px solid #dde1e3;
    font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; text-align: left;
    position: sticky; top: 0; z-index: 1;
}
.table td { padding: 14px 16px; border-bottom: 1px solid #eceef0; vertical-align: middle; color: var(--text); }
.table tbody tr { transition: background .1s; }
.table tbody tr:nth-child(even) td { background: rgba(246, 242, 228, .55); }
.table tbody tr:hover td { background: #e6f0d8; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td:first-child, .table th:first-child { padding-left: 20px; }
.table td:last-child, .table th:last-child { padding-right: 20px; }
.table td strong { font-weight: 700; }
.table td a:not(.btn) { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.table td a:not(.btn):hover { text-decoration: underline; }
.table td .muted, .table td .compact { font-weight: 500; }
.table th.num, .table td.num { text-align: right; }
.table tfoot td { background: #eceef0; font-weight: 800; border-top: 2px solid #dde1e3; border-bottom: 0; }
.table.dense td { padding-top: 9px; padding-bottom: 9px; }
.table tr.is-off td { opacity: .55; }
.panel > .table-wrap { border-top: 0; }
.panel > .table-wrap .table th:first-child { border-top-left-radius: 0; }

/* list on the left, add-form on the right: give the table the room */
.grid.two.list-form { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: start; }
@media (max-width: 1560px) { .grid.two.list-form { grid-template-columns: 1fr; } }
.table td:first-child { min-width: 120px; }

/* ---- activity form: flat sections instead of boxes inside boxes ---- */
.fs-title { grid-column: 1 / -1; margin: 10px 0 0; padding-bottom: 8px; border-bottom: 2px solid var(--line); font: 800 13px var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-strong); display: flex; align-items: baseline; gap: 10px; }
.fs-title:first-child { margin-top: 0; }
.fs-title .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
[data-group][hidden] { display: none !important; }
.fsec { display: grid; gap: 12px; }
.fsec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fsec-head h5 { margin: 0; font: 800 15px var(--font-ui); color: var(--forest); }
.frow { position: relative; padding: 16px 16px 12px; border: 1.5px solid var(--line); border-left: 4px solid var(--leaf); border-radius: 12px; background: #fff; display: grid; gap: 10px; }
.frow-x { justify-self: end; }
.form-actions { grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; margin: 8px -20px -20px; padding: 14px 20px; background: linear-gradient(180deg, rgba(255, 253, 246, 0), var(--panel) 30%); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- filters, pagination and long tables ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 18px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-bar .field { min-width: 150px; margin: 0; }
.filter-bar .field.grow { flex: 1 1 220px; }
.filter-bar .field label { display: block; margin-bottom: 5px; }
.filter-actions { display: flex; gap: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-soft); }
.pager-info { color: var(--muted); font-size: 13px; font-weight: 600; }
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pager-btn { min-width: 36px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1.5px solid #dde1e3; background: #fff; color: var(--text); font-weight: 700; font-size: 13px; text-decoration: none; }
a.pager-btn:hover { background: #f3f4f5; border-color: #b9bec2; }
.pager-btn.is-current { background: var(--forest); border-color: var(--forest); color: #fff; }
.pager-btn.is-off { opacity: .45; }
.pager-gap { align-self: center; color: var(--muted); }
.table-wrap.is-long { max-height: 620px; overflow: auto; }
.table-wrap.is-long .table th { box-shadow: 0 2px 0 #dde1e3; }
.table-tools { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.table-tools input { max-width: 280px; padding: 8px 12px; border-radius: 9px; font-size: 13.5px; }
.table-tools .count { margin-left: auto; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.table tr.is-filtered-out { display: none; }

.filter-bar { align-items: end; }
.filter-bar .field { flex: 0 1 160px; min-width: 140px; }
.filter-bar .field.grow { flex: 1 1 240px; }
.filter-bar .field label { margin: 0 0 5px; line-height: 1.2; }
.filter-bar input, .filter-bar select { height: 42px; padding-top: 0; padding-bottom: 0; }
.filter-actions { margin-left: auto; }

/* ---- Jarvis ---- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--marigold); color: #3b2a05; font: 800 11px var(--font-ui); }
.tabs { display: flex; gap: 6px; margin: 0 0 16px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 16px; font: 700 14px var(--font-ui); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab:hover { color: var(--accent-strong); }
.tab.active { color: var(--forest); border-bottom-color: var(--accent); }
.tab-count { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--marigold); color: #3b2a05; font-size: 11.5px; }
.alert-row { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; padding: 16px 20px; border-top: 1px solid var(--line); border-left: 5px solid var(--leaf); }
.alert-row:first-child { border-top: 0; }
.alert-row.u3 { border-left-color: #d2572f; background: rgba(210, 87, 47, .05); }
.alert-row.u2 { border-left-color: var(--marigold); }
.alert-title { font-weight: 800; font-size: 15px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.alert-main p { margin: 4px 0 6px; }
.urgency { font: 800 10.5px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: #e4f3d9; color: #476b17; }
.urgency.u2 { background: var(--marigold-soft); color: #8a5a07; }
.urgency.u3 { background: #f6d9c9; color: #a8381f; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 330px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; cursor: pointer; margin: 0; }
.switch input { width: auto; }
@media (max-width: 900px) { .alert-row { flex-direction: column; } .alert-actions { justify-content: flex-start; max-width: none; } }

.briefing { white-space: pre-line; font-size: 15.5px; line-height: 1.65; max-width: 70ch; }
.chat { display: grid; gap: 12px; margin-bottom: 14px; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.jarvis { align-self: flex-start; }
.bubble { padding: 11px 16px; border-radius: 16px; background: var(--panel-soft); border: 1px solid var(--line); white-space: pre-line; line-height: 1.55; font-size: 14.5px; }
.msg.user .bubble { background: var(--forest); border-color: var(--forest); color: #f6f7f8; border-bottom-right-radius: 4px; }
.msg.jarvis .bubble { border-bottom-left-radius: 4px; }
.bubble.thinking { color: var(--muted); font-style: italic; }
.msg-tools { margin: 4px 6px 0; }
.chat-form { display: flex; gap: 10px; }
.chat-form input { flex: 1; height: 46px; border-radius: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1.5px solid #dde1e3; background: #fff; border-radius: 999px; padding: 8px 14px; font: 600 13px var(--font-ui); cursor: pointer; color: var(--text); }
.chip-btn:hover { background: #f3f4f5; border-color: var(--accent); color: var(--accent-strong); }
.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 10px; }
.usage-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); display: grid; gap: 6px; }
.meter { height: 8px; border-radius: 999px; background: #e6e9eb; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* the Jarvis nav badge pulses while something needs you */
.nav-badge { animation: nav-pulse 2.4s ease-in-out infinite; }
@keyframes nav-pulse { 50% { box-shadow: 0 0 0 5px rgba(242, 214, 64, 0); } 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 214, 64, .55); } }
@media (prefers-reduced-motion: reduce) { .nav-badge { animation: none; } }


/* ======================================================================
   Clean light theme: soft grey-green canvas, white cards, one bright green,
   near-black for primary actions and the active menu item.
   ====================================================================== */
body { background: #fff; }
.main { padding: 30px 40px 72px; }

/* sidebar: white, quiet, with a black pill on the current page */
.sidebar { color: var(--text); background: #fff; border-right: 1px solid var(--line); scrollbar-color: #dde1e3 transparent; padding: 22px 16px 16px; }
.sidebar::after { display: none; }
.brand { color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { filter: none; }
.brand p { color: var(--faint); }
.nav-group { color: var(--faint); }
.nav a { color: #4a5056; font-weight: 600; padding: 8px 12px; }
.nav a .icon { color: #8e9499; }
.nav a:hover { background: #f3f4f5; color: var(--text); }
.nav a:hover .icon { color: var(--accent); transform: none; }
.nav a.active { background: var(--forest); color: #fff; font-weight: 700; box-shadow: 0 8px 18px -10px rgba(20, 23, 20, .6); }
.nav a.active .icon { color: var(--leaf); }
.nav a.active::before { display: none; }
.sidebar-foot { background: linear-gradient(0deg, #fff 72%, rgba(255, 255, 255, 0)); }
.sidebar-user { background: #f6f7f8; color: var(--text); }
.sidebar-user small { color: var(--faint); }
.sidebar-user .avatar { background: var(--marigold); color: #3b3305; }
.btn.ghost-light { background: #fff; border-color: var(--line-strong); color: #4a5056; }
.btn.ghost-light:hover { background: #f3f4f5; color: var(--text); border-color: #b9bec2; }
.nav-badge { background: var(--marigold); color: #3b3305; }

/* header: no illustration, just the title */
.topbar::after { display: none; }
.eyebrow { color: var(--accent-strong); }
.eyebrow::before { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
h2, .panel-title, .brand h1 { color: var(--text); }

/* cards */
.panel { border-color: var(--line); box-shadow: 0 1px 2px rgba(20, 23, 20, .03); }
.panel-header { border-bottom-color: var(--line); }
.stat::before { background: var(--accent); width: 3px; }
.stat strong { color: var(--text); }

/* buttons: black primary like the reference, green stays for status and highlights */
.btn { border-color: var(--line-strong); background: #fff; }
.btn:hover { background: #f3f4f5; border-color: #b9bec2; }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #2a2e28; border-color: #2a2e28; color: #fff; }
.btn.primary:active { background: #000; }
.btn.danger { border-color: #efc7bd; color: #b03a26; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: var(--accent-glow); }

/* tables */
.table th { background: #f6f7f8; color: #6e757b; border-bottom: 1px solid var(--line-strong); }
.table tbody tr:nth-child(even) td { background: transparent; }
.table tbody tr:hover td { background: #f3f8ee; }
.table td { border-bottom-color: var(--line); }
.table tfoot td { background: #f6f7f8; border-top-color: var(--line-strong); }
.table td a:not(.btn) { color: var(--accent-strong); }

/* forms */
input, select, textarea { border-color: var(--line-strong); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.fs-title { border-bottom-color: var(--line); color: var(--text); }
.frow { border-color: var(--line); border-left-color: var(--leaf); }
.pager { background: #f6f7f8; }
.pager-btn { border-color: var(--line-strong); }
.pager-btn.is-current { background: var(--forest); border-color: var(--forest); }
.filter-bar { background: #fff; }

/* mobile top bar */
.mobile-bar { background: #fff; border-bottom: 1px solid var(--line); color: var(--text); }

/* ======================================================================
   Overview panels, white canvas
   ====================================================================== */
.panel, .ov-card, .kpi-strip, .filter-bar { border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(20, 23, 20, .03); }
.stat { background: var(--panel-soft); border-color: transparent; box-shadow: none; }

.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 18px; background: #fff; border-radius: var(--radius); }
.kpi { padding: 22px 26px; display: grid; gap: 6px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi-label { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.kpi-value { font: 800 clamp(24px, 2.4vw, 32px)/1.1 var(--font-display); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-delta.good { color: #2f8a12; } .kpi-delta.bad { color: #d4552c; }

.ov-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.ov-stack { display: grid; gap: 18px; }
.ov-card { background: #fff; border-radius: var(--radius); padding: 22px 24px; }
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ov-head h3 { margin: 0; font: 800 16px var(--font-display); color: var(--text); }
.ov-head a { font-size: 13px; font-weight: 700; color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.ov-head a:hover { text-decoration-color: var(--accent); }
.ov-chip { padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ov-empty { margin: 8px 0 4px; color: var(--muted); font-size: 14px; }

.usage-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; padding-top: 6px; }
.usage-col { --c: #3f9a17; display: grid; gap: 4px; align-content: start; }
.usage-col.amber { --c: #f59e0b; } .usage-col.blue { --c: #3b9de0; } .usage-col.green { --c: #3f9a17; }
.usage-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--text); }
.usage-label svg { color: var(--c); }
.usage-num { margin-top: 8px; font: 800 26px/1.1 var(--font-display); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.usage-num small { font: 600 13px var(--font-ui); letter-spacing: 0; color: var(--muted); }
.usage-delta { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.usage-delta.up { color: #2f8a12; } .usage-delta.down { color: #d4552c; }
.usage-bar { height: 5px; margin: 10px 0 18px; border-radius: 5px; background: #eceef0; overflow: hidden; }
.usage-bar i { display: block; height: 100%; border-radius: 5px; background: var(--c); }
.usage-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 112px; border-top: 1px solid var(--line); padding-top: 12px; }
.usage-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; height: 100%; cursor: default; }
.usage-day i { display: block; width: 8px; min-height: 3px; border-radius: 4px; background: var(--c); opacity: .9; transition: opacity .15s, transform .15s; flex: none; }
.usage-day:hover i { opacity: 1; transform: scaleX(1.25); }
.usage-day em { font-style: normal; font-size: 11px; color: var(--faint); }
.usage-bars .usage-day { position: relative; }
.usage-bars { align-items: end; }

.tl-row, .mc-row { display: grid; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.tl-row { grid-template-columns: 62px 10px 34px minmax(0, 1fr) auto; }
.tl-row:hover { background: #fafbfa; }
.mc-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
.tl-when { font-size: 13px; font-weight: 700; color: var(--text); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: #f2d640; position: relative; }
.tl-dot.late { background: #d4552c; } .tl-dot.plan { background: #3b9de0; } .tl-dot.due { background: #f2d640; }
.tl-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eaf5ff; color: #2b7fc4; }
.tl-ico.late { background: #fdeae4; color: #d4552c; } .tl-ico.due { background: #fdf6d4; color: #9a7d00; } .tl-ico.idle { background: #f1f2f3; color: #7a8187; }
.tl-text { min-width: 0; display: grid; }
.tl-text strong { font-size: 14px; font-weight: 700; line-height: 1.3; }
.tl-text small { color: var(--muted); font-size: 12.5px; }
.tl-pill { padding: 4px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; background: #e6f1fb; color: #2b7fc4; white-space: nowrap; }
.tl-pill.late { background: #fdeae4; color: #c4431b; } .tl-pill.due { background: #fdf3c0; color: #8a6d00; }
.mc-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: #7a8187; white-space: nowrap; }
.mc-status i { width: 8px; height: 8px; border-radius: 50%; background: #c3c8cc; }
.mc-status.work { color: #2b7fc4; } .mc-status.work i { background: #3b9de0; }

@media (max-width: 1100px) { .ov-grid { grid-template-columns: 1fr; } .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(3) { border-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 720px) { .usage-cols { grid-template-columns: 1fr; } .tl-row { grid-template-columns: 56px 34px minmax(0, 1fr); } .tl-dot, .tl-pill { display: none; } }

.ov-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 14px; }
.ov-titlebar .section-title { margin: 0; }
.ov-filter { display: flex; align-items: center; gap: 10px; margin: 0; }
.ov-filter label { margin: 0; color: var(--muted); font-weight: 600; }
.ov-filter select { width: auto; min-width: 220px; height: 40px; border-radius: 12px; }

/* ---- live weather ---- */
.wx { display: grid; grid-template-columns: auto 1fr; gap: 18px 28px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 18px 0; }
.wx-now { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wx-sky { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; flex: none; }
.wx-sky.is-day { background: linear-gradient(160deg, #fff4c2, #ffe27a); color: #b07d00; }
.wx-sky.is-night { background: linear-gradient(160deg, #2a3f63, #46608f); color: #e9efff; }
.wx-sky.is-rain { background: linear-gradient(160deg, #dbe9f3, #b4cde0); color: #3b6a8c; }
.wx-ico { display: grid; animation: wx-float 5s ease-in-out infinite; }
.wx-place { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #6b7280; font-weight: 600; }
.wx-place em { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.wx-place em i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: wx-pulse 1.8s ease-out infinite; }
.wx-temp { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.03em; margin-top: 2px; }
.wx-temp sup { font-size: 16px; font-weight: 700; color: #6b7280; margin-left: 2px; vertical-align: top; position: relative; top: 4px; }
.wx-label { font-size: 13px; color: #6b7280; margin-top: 4px; }
.wx-facts { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 22px; margin: 0 0 0 10px; }
.wx-facts div { min-width: 0; }
.wx-facts dt { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #8a909a; }
.wx-facts dd { margin: 1px 0 0; font-weight: 700; font-size: 14px; }
.wx-days { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.wx-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 16px; background: var(--panel-soft); color: #3a4a3a; transition: transform .2s ease; }
.wx-day:hover { transform: translateY(-2px); }
.wx-day.is-today { background: var(--forest); color: #fff; }
.wx-dname { font-size: 11.5px; font-weight: 600; opacity: .75; }
.wx-day b { font-size: 15px; }
.wx-day small { font-size: 11.5px; opacity: .6; margin-top: -3px; }
.wx-rain { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; opacity: .8; }
.wx-rain.is-wet { color: #2b78b5; opacity: 1; }
.wx-day.is-today .wx-rain.is-wet { color: #8cc8f4; }
.wx-advice { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 600; }
.wx-advice.good { background: #eef7e6; color: #2f6d12; }
.wx-advice.warn { background: #fff4d6; color: #8a5a00; }
@keyframes wx-float { 50% { transform: translateY(-3px) rotate(-3deg); } }
@keyframes wx-pulse { 0% { box-shadow: 0 0 0 0 rgba(63,154,23,.45); } 100% { box-shadow: 0 0 0 7px rgba(63,154,23,0); } }
@media (max-width: 1100px) { .wx { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .wx { padding: 16px; } .wx-days { grid-template-columns: repeat(3, 1fr); } .wx-temp { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { .wx-ico, .wx-place em i { animation: none; } }

/* a list beside a form needs room: stack them until the screen is wide, instead of clipping the table's last columns */
.grid.two:has(> * > .table-wrap, > * > .panel-body > .table-wrap, > .panel .table-wrap) { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: start; }
@media (max-width: 1560px) { .grid.two:has(> * > .table-wrap, > * > .panel-body > .table-wrap, > .panel .table-wrap) { grid-template-columns: minmax(0, 1fr); } }

/* compact sidebar footer so it hides less of the menu */
.sidebar-foot { grid-template-columns: 1fr auto; align-items: center; padding-top: 10px; gap: 8px; }
.sidebar-foot .sidebar-user { min-width: 0; }
.sidebar-foot .sidebar-user > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .btn { padding: 8px 10px; font-size: 0; gap: 0; }
.sidebar-foot .btn svg { margin: 0; }

/* phones: inline multi-column filter rows and settle-up lines wrap instead of running off the card */
@media (max-width: 700px) {
    .form-grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .note-item { flex-wrap: wrap; }
}
