/* Farmland theme, adopted from the Aggrey & Clifford GROUND dashboard:
   Inter for text, JetBrains Mono for numbers and document numbers, Material Symbols icons,
   a charcoal sidebar with gold accents, a white 56px top bar, neutral grey surfaces,
   white cards with hairline borders, small uppercase table headers and soft badges.
   Loaded after app.css, so these rules win. */

:root {
  --canvas: #f7f7f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f2f2f2;
  --border: #e8e8e8;
  --border-soft: #f2f2f2;
  --text: #1a1a1a;
  --text-2: #666666;
  --text-3: #888888;
  --gold: #d4af37;
  --gold-hover: #c9a430;
  --gold-ink: #1a1a00;
  /* Gold is too light for text on white; links and focus text use the deeper gold. */
  --primary: #7a6000;
  --primary-hover: #5c4800;
  --side-bg: #2a2a2b;
  --side-raised: #383839;
  --side-line: rgba(255, 255, 255, 0.06);
  --side-text: #c0c0c0;
  --side-muted: #888888;
  --side-label: #666666;
  --danger: #c0392b;
  --danger-bg: #fde8e6;
  --loss: #c0392b;
  --loss-bg: #fde8e6;
  --ok-bg: #e8f5e9;
  --ok-text: #2e7d32;
  --warn-bg: #fff6dc;
  --warn-text: #7b5800;
  --radius: 4px;
  --radius-lg: 6px;
  --sidebar-w: 240px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
}

body { font: 13px/1.5 var(--font); background: var(--canvas); color: var(--text); }
a { color: var(--primary); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 9999px; }

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal; font-style: normal; font-size: 20px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr;
  display: inline-block; user-select: none; -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 20;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar { width: var(--sidebar-w); background: var(--side-bg); border-right: 1px solid var(--side-line); color: var(--side-text); }
.sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; padding: 22px 18px 18px; border-bottom: 1px solid var(--side-line); text-decoration: none; }
.sidebar-brand:hover { text-decoration: none; }
.brand-kicker { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); line-height: 1; }
.brand-name { margin-top: 5px; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: #fff; overflow-wrap: anywhere; }
.brand-rule { display: block; width: 22px; height: 2px; margin-top: 10px; border-radius: 1px; background: var(--gold); }
.sidebar-nav { display: block; flex: 1; overflow-y: auto; padding: 6px 0; }
.sidebar .nav-group { margin: 0 0 2px; padding: 0; border: 0; }
.sidebar .nav-group-title { margin: 0; padding: 10px 18px 4px; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--side-label); }
.sidebar .nav-link { display: flex; align-items: center; gap: 9px; margin: 1px 8px; padding: 7px 10px; border-radius: 5px; color: var(--side-text); font-size: 13px; font-weight: 400; opacity: 1; text-decoration: none; position: static; }
.sidebar .nav-link .material-symbols-outlined { font-size: 17px; color: var(--side-muted); flex-shrink: 0; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.sidebar .nav-link:hover .material-symbols-outlined { color: #bbb; }
.sidebar .nav-link.active { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 500; }
.sidebar .nav-link.active .material-symbols-outlined { color: var(--gold); }
.sidebar .nav-link.active::before { display: none; }
.sidebar details.nav-fold { margin: 0 0 2px; padding: 0; border: 0; }
.sidebar .nav-group:not(.nav-fold) + details.nav-fold { margin-top: 0; padding-top: 0; border-top: 0; }
.sidebar details.nav-fold > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; margin: 0; padding: 10px 18px 4px; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--side-label); }
.sidebar details.nav-fold > summary::-webkit-details-marker { display: none; }
.sidebar details.nav-fold > summary::after { content: none; }
.sidebar details.nav-fold > summary .material-symbols-outlined { font-size: 16px; transition: transform .15s; }
.sidebar details.nav-fold[open] > summary .material-symbols-outlined { transform: rotate(180deg); }
.sidebar details.nav-fold > summary:hover { color: #aaa; }
.sidebar details.nav-fold .nav-link { font-size: 13px; padding: 7px 10px; }
.sidebar-bottom { border-top: 1px solid var(--side-line); padding: 6px 0; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-top: 1px solid var(--side-line); }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--side-raised); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 10px; font-weight: 700; color: var(--gold); }
.avatar-light { background: #f2f2f2; border-color: var(--border); color: var(--primary); }
.sidebar-user { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 500; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { margin-top: 1px; font-size: 10px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-plain { display: inline-flex; align-items: center; padding: 4px; border: 0; border-radius: 4px; background: none; color: #555; cursor: pointer; }
.icon-plain .material-symbols-outlined { font-size: 16px; }
.icon-plain:hover { background: rgba(255, 255, 255, 0.08); color: #ccc; }

/* ── Top bar ─────────────────────────────────────────────────────── */
.topbar { display: flex; position: sticky; top: 0; z-index: 40; height: 56px; padding: 0 24px; gap: .75rem; align-items: center; background: #fff; border-bottom: 1px solid var(--border); }
.topbar-brand { display: none; font-size: 14px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar .icon-btn { display: none; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: #555; }
.topbar .icon-btn .material-symbols-outlined { font-size: 20px; }
.lang-switch { display: inline-flex; padding: 0; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lang-switch a { padding: 4px 9px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); text-decoration: none; }
.lang-switch a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.lang-switch a.active { background: var(--side-bg); color: #fff; text-decoration: none; }
@media (max-width: 1023px) {
  .topbar { padding: 0 12px; }
  .topbar .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
  .topbar-brand { display: inline; }
}

/* ── Page ────────────────────────────────────────────────────────── */
.container { max-width: 1280px; padding: 28px; }
@media (max-width: 1023px) { .container { padding: 16px 16px 72px; } }
h1 { font-size: 20px; font-weight: 600; letter-spacing: 0; color: var(--text); }
h2 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.page-header { margin-bottom: 20px; align-items: center; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.eyebrow a { color: var(--gold); }
.eyebrow a:hover { color: var(--primary); }
.summary-line { font-size: 13px; color: var(--text-3); }
.summary-line strong { color: var(--text); font-family: var(--mono); font-weight: 500; }
.lead-note { background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius-lg); color: #555; }
.muted { color: var(--text-3); }

/* ── Cards ───────────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; }
.table-title { padding: 12px 16px; margin: 0; font-size: 14px; font-weight: 600; border-bottom: 1px solid #f0f0f0; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.table-title a, .table-title .small { font-size: 12px; font-weight: 500; color: var(--primary); }
p.table-title { border-bottom: 0; font-weight: 400; color: var(--text-3); }
.table-title + table { margin-top: 0; }
.empty { background: #fff; border: 1px dashed var(--border); border-radius: var(--radius-lg); color: #aaa; font-size: 13px; }

/* Headline figure and home figures, in the reference's stat-card style. */
.headline .label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.headline .value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.home-figures { gap: 12px; background: none; border: 0; border-radius: 0; overflow: visible; }
.home-figures a, .home-figures div { flex-direction: row; align-items: center; gap: 12px; padding: 16px 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.home-figures a:hover { border-color: #d6d6d6; background: #fff; }
.home-figures .material-symbols-outlined { font-size: 20px; color: var(--gold); }
.home-figures .figure-text { display: flex; flex-direction: column-reverse; gap: 2px; min-width: 0; }
.home-figures .label { font-size: 12px; color: var(--text-3); }
.home-figures .value { font-size: 22px; font-weight: 700; line-height: 1; color: var(--text); }

/* ── Tables ──────────────────────────────────────────────────────── */
table { font-size: 13px; }
th { height: auto; padding: 10px 14px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
td { height: auto; padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child td { border-bottom: 0; }
.rows-link tbody tr[data-href]:hover td, tbody tr:hover td { background: var(--surface-2); }
.rows-link tbody tr[data-href]:hover { background: transparent; }
td.num, th.num, .num { font-family: var(--mono); font-size: 12.5px; }
th.num { font-family: var(--font); font-size: 11px; }
td:first-child a { font-weight: 500; }
.doc-no { font-family: var(--mono); font-size: 11px; color: #aaa; }
.totals-line td, .report-table .subtotal-line td { background: var(--surface-2); font-weight: 600; }
.report-table .grand-total td { border-top: 2px solid var(--text); background: #fff; font-weight: 700; }
.report-table .section-line th { background: #fff; color: var(--text); font-size: 11px; }
.table-compact td { padding: 8px 14px; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn { height: auto; gap: 6px; padding: 7px 14px; font-size: 13px; font-weight: 500; border: 1px solid #e0e0e0; border-radius: var(--radius); background: #fff; color: var(--text); }
.btn:hover { background: #f5f5f5; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
.btn-primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--gold-ink); }
.danger-btn { color: var(--danger); border-color: #f0c8c3; background: #fff; }
.danger-btn:hover { background: var(--danger-bg); }
button.link { color: var(--primary); font-size: 12px; font-weight: 500; }

/* ── Forms ───────────────────────────────────────────────────────── */
label { font-size: 12px; }
label > span { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--text); }
input, select, textarea { height: auto; padding: 7px 10px; font-size: 13px; border: 1px solid #e0e0e0; border-radius: var(--radius); background: #fff; }
select { padding-right: 28px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18); }
input::placeholder { color: #aaa; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); }
.hint { color: var(--text-3); }
.error-text { color: var(--danger); }

/* Period switch and filters */
.segmented { padding: 2px; background: #f2f2f2; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.segmented a { padding: 4px 10px; border-radius: var(--radius); font-size: 12px; font-weight: 500; color: var(--text-2); }
.segmented a.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* ── Badges for status ───────────────────────────────────────────── */
.state { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px !important; border-radius: 3px; border: 0 !important; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-decoration: none; }
.state::before { display: none; }
.state-paid, .state-posted, .state-saved { background: #e8f5e9 !important; color: #2e7d32; }
.state-unpaid, .state-issued { background: #fff6dc !important; color: #7b5800; }
.state-partial { background: #e8eefb !important; color: #1565c0; }
.state-overdue { background: #fde8e6 !important; color: #c0392b; }
.state-draft, .state-void { background: #f5f5f5 !important; color: #999; }
.owed { color: #7b5800; }
.headline .value.owed { color: #7b5800; }
.good, .headline .value.good { color: #2e7d32; }
.loss, .headline .value.loss { color: #c0392b; }

/* ── Alerts and folds ────────────────────────────────────────────── */
.alert { border-radius: var(--radius); font-size: 13px; }
.alert-ok { background: #e8f5e9; color: #2e7d32; border-color: #cfe8d1; }
.alert-error { background: #fde8e6; color: #93000a; border-color: #f6c9c3; }
details.card.more > summary { font-size: 14px; }
details.card.more > summary::after { content: "expand_more"; font-family: "Material Symbols Outlined"; font-size: 18px; color: #aaa; transition: transform .15s; }
details.card.more[open] > summary::after { content: "expand_more"; transform: rotate(180deg); }
.danger-zone { border: 1px dashed #f0c8c3; border-radius: var(--radius-lg); background: #fff; }
.report-list li a { border-top: 1px solid var(--border-soft); }
.report-list li strong { color: var(--text); }
.report-list li a:hover strong { color: var(--primary); }

/* ── Sign-in: split screen, dark brand panel on the left ─────────── */
.container-auth { max-width: none; padding: 0; }
.auth-split { display: flex; min-height: 100vh; }
.auth-brand { position: relative; flex: 1 1 0%; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; background: #303031; color: #c9c6c5; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(233, 195, 73, 0.18); box-shadow: 0 0 0 60px rgba(233, 195, 73, 0.04), 0 0 0 140px rgba(233, 195, 73, 0.03); }
.auth-brand-mark { display: flex; flex-direction: column; }
.auth-brand-mark .brand-kicker { color: #e9c349; }
.auth-brand-mark .brand-name { font-size: 26px; }
.auth-brand-lead { position: relative; max-width: 30rem; font-size: 15px; line-height: 26px; }
.auth-brand-lead strong { display: block; margin-bottom: 10px; font-size: 32px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 560px; padding: 48px; background: var(--canvas); }
.auth-panel-inner { width: 100%; max-width: 384px; margin: 0 auto; }
.auth-panel h1 { font-size: 24px; font-weight: 700; color: #1b1c1c; }
.auth-panel .auth-sub { margin-top: 6px; font-size: 14px; color: #4d4635; }
.auth-panel form { margin-top: 28px; gap: 20px; }
.auth-panel label > span { letter-spacing: .05em; }
.auth-panel input { padding: 10px 12px; font-size: 14px; }
.auth-panel .btn-primary { justify-content: center; padding: 10px 14px; font-size: 14px; }
.auth-panel .lang-switch { margin-top: 24px; }
.auth-mobile-brand { display: none; margin-bottom: 28px; text-align: center; }
@media (max-width: 1023px) {
  .auth-brand { display: none; }
  .auth-panel { max-width: none; min-height: 100vh; padding: 32px 20px; }
  .auth-mobile-brand { display: block; }
  .auth-mobile-brand .brand-name { color: #1b1c1c; font-size: 22px; }
}

/* ── Phone tweaks ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  td, th { padding-left: 10px; padding-right: 10px; }
  .home-figures .value { font-size: 19px; }
}

/* ── Print keeps the plain black letterhead ──────────────────────── */
@media print {
  .topbar, .sidebar { display: none !important; }
  .container { padding: 0; }
  td.num, .num { font-family: var(--font); }
  th { background: #fff !important; color: #000; }
}

/* Mono is for figures inside tables only; headlines, inputs and labels stay in Inter. */
.headline .value, .home-figures .value, .statement-owed strong, input.num, .totals-line td:not(.num), td.num strong.what { font-family: var(--font); }
input.num { font-size: 13px; }
.headline .value { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) { .page-header { align-items: flex-start; } }

.acct-icon { font-size: 17px; color: var(--gold); vertical-align: -3px; margin-right: 4px; }

/* Harvest form */
.shednet-pick, .product-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.shednet-pick legend, .product-pick legend { padding: 0; margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid #e0e0e0; border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; }
.chip > span { font-weight: 500; letter-spacing: 0; }
.chip input { margin: 0; }
.chip:has(input:checked) { border-color: var(--gold); background: #fffaf0; }
.chip:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25); }
.shednet-pick.has-error .chip { border-color: #f0c8c3; }
.harvest-total { display: flex; align-items: baseline; gap: 12px; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.harvest-total .label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.harvest-total .value { font-size: 22px; font-weight: 700; }
.alert-warn { background: #fff6dc; color: #6b4d00; border-color: #f1dfb0; }

/* Form columns may shrink below their content on phones; long rows wrap instead of overflowing. */
.form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-grid > label > input, .form-grid > label > select, .form-grid > label > textarea { width: 100%; min-width: 0; }
.form-actions { flex-wrap: wrap; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* Operations */
.op-kinds .chip .material-symbols-outlined { font-size: 18px; color: var(--text-3); }
.op-kinds .chip:has(input:checked) .material-symbols-outlined { color: var(--gold); }
.chip-nursery { border-style: dashed; }
.qty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }
.qty-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.qty-row > span { font-size: 13px; font-weight: 500; letter-spacing: 0; }
.qty-row input { padding: 6px 8px; }
.qty-row small { min-width: 54px; font-size: 11px; }
.state-op-sowing { background: #e8f5e9 !important; color: #2e7d32; }
.state-op-transplanting { background: #e8eefb !important; color: #1565c0; }
.state-op-fertiliser { background: #fff6dc !important; color: #7b5800; }
.state-op-pesticide { background: #fde8e6 !important; color: #a33a2b; }
.state-op-phasing_out { background: #f2f2f2 !important; color: #666; }

/* ── Lime accent (client's colour, #7CFF5F) ──────────────────────────
   Lime fills buttons and lights up the dark sidebar. Lime is too light for text on white,
   so links, labels and icons on white use a deep green from the same family. */
:root {
  --gold: #7cff5f;
  --gold-hover: #66f046;
  --gold-ink: #0f2409;
  --lime-soft: #effee9;
  --lime-line: #b9f7a8;
  --primary: #237a17;
  --primary-hover: #185c0f;
}
.eyebrow a, .home-figures .material-symbols-outlined, .acct-icon, .op-kinds .chip:has(input:checked) .material-symbols-outlined { color: var(--primary); }
.eyebrow a:hover { color: var(--primary-hover); }
.lead-note { border-left-color: var(--primary); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 255, 95, 0.35); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.chip:has(input:checked) { border-color: var(--primary); background: var(--lime-soft); }
.chip:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(124, 255, 95, 0.45); }
.btn-primary { box-shadow: inset 0 -1px 0 rgba(15, 36, 9, 0.12); }
.lang-switch a.active { background: var(--side-bg); color: var(--gold); }
.avatar-light { background: var(--lime-soft); border-color: var(--lime-line); color: var(--primary); }

/* Sign-in: the brand panel is lime with dark text, like the client's sample. */
.auth-brand { background: var(--gold); color: #1e3a14; }
.auth-brand::after { border-color: rgba(15, 36, 9, 0.12); box-shadow: 0 0 0 60px rgba(15, 36, 9, 0.03), 0 0 0 140px rgba(15, 36, 9, 0.025); }
.auth-brand-mark .brand-kicker { color: #1e3a14; }
.auth-brand-mark .brand-name { color: #0f1f0a; }
.auth-brand .brand-rule { background: #0f1f0a; opacity: .35; }
.auth-brand-lead strong { color: #0f1f0a; }

/* Wider sidebar with larger menu text (client found 240px too narrow). */
:root { --sidebar-w: 280px; }
.sidebar-brand { padding: 26px 22px 22px; }
.brand-name { font-size: 22px; }
.sidebar .nav-group-title, .sidebar details.nav-fold > summary { padding-left: 22px; padding-right: 22px; font-size: 11px; }
.sidebar .nav-link { gap: 12px; margin: 2px 10px; padding: 9px 12px; font-size: 14px; }
.sidebar .nav-link .material-symbols-outlined { font-size: 20px; }
.sidebar-foot { padding: 14px 20px; }
.sidebar-user-name { font-size: 13px; }
.sidebar-user-email { font-size: 11px; }
.avatar { width: 32px; height: 32px; font-size: 11px; }
@media (max-width: 1023px) { .sidebar { width: min(var(--sidebar-w), 86vw); } }

/* ── Sign-in with a real photo of the crop ───────────────────────────── */
.auth-photo .auth-hero {
  position: relative; flex: 1.15 1 0%; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 100vh; padding: 44px 52px; color: #fff; overflow: hidden;
  background: #1d2a17 url('/public/img/login-peppers.jpg') center 62% / cover no-repeat;
}
.auth-photo .auth-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 18, 7, 0.55) 0%, rgba(10, 18, 7, 0.05) 30%, rgba(10, 18, 7, 0.10) 55%, rgba(10, 18, 7, 0.82) 100%);
}
.auth-photo .auth-hero > * { position: relative; }
.auth-hero-top { display: flex; flex-direction: column; align-items: flex-start; }
.auth-hero-top .brand-kicker { color: var(--gold); }
.auth-hero-top .brand-name { color: #fff; font-size: 26px; }
.auth-hero-top .brand-rule { background: var(--gold); }
.auth-hero-bottom { max-width: 34rem; }
.auth-hero-title { margin: 0 0 10px; font-size: 40px; line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.auth-hero-lead { margin: 0 0 18px; font-size: 16px; line-height: 1.55; color: rgba(255, 255, 255, 0.88); }
.auth-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-tags span { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #0f2409; background: var(--gold); }
.auth-tags span + span { color: #fff; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(124, 255, 95, 0.55); }
.auth-credit { margin: 22px 0 0; font-size: 11px; color: rgba(255, 255, 255, 0.55); }

.auth-photo .auth-panel { flex: 1 1 0%; max-width: 620px; display: flex; align-items: center; justify-content: center; padding: 40px; background: #f4f6f2; }
.auth-card-box { width: 100%; max-width: 420px; padding: 40px 36px 30px; background: #fff; border: 1px solid #e6eae2; border-radius: 16px; box-shadow: 0 24px 60px rgba(16, 36, 9, 0.10), 0 2px 6px rgba(16, 36, 9, 0.05); }
.auth-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 18px; border-radius: 12px; background: var(--gold); color: #0f2409; font-size: 26px; }
.auth-card-box h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: #111; }
.auth-card-box .auth-sub { margin: 6px 0 0; font-size: 14px; color: #5b6357; }
.auth-card-box .auth-sub strong { color: #111; }
.auth-card-box .alert { margin: 18px 0 0; }
.auth-card-box form { margin-top: 26px; gap: 18px; }
.auth-card-box label > span { letter-spacing: .03em; }
.auth-card-box input { padding: 12px 14px; font-size: 15px; border-radius: 8px; }
.auth-card-box .btn-primary { justify-content: center; gap: 8px; padding: 13px 16px; font-size: 15px; border-radius: 8px; }
.auth-card-box .btn-primary .material-symbols-outlined { font-size: 18px; }
.auth-foot { display: flex; justify-content: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid #eef1ea; }
.auth-foot .lang-switch { margin: 0; }
.auth-photo .auth-mobile-brand { display: none; }

@media (max-width: 1023px) {
  .auth-photo { flex-direction: column; }
  .auth-photo .auth-hero { display: flex; flex: none; min-height: 230px; padding: 24px 20px; }
  .auth-photo .auth-hero-bottom { display: none; }
  .auth-photo .auth-hero::before { background: linear-gradient(180deg, rgba(10, 18, 7, 0.65) 0%, rgba(10, 18, 7, 0.15) 100%); }
  .auth-photo .auth-panel { max-width: none; min-height: 0; padding: 0 16px 32px; background: #f4f6f2; align-items: flex-start; }
  .auth-card-box { margin-top: -40px; padding: 28px 22px 22px; }
}
@media (max-width: 1023px) {
  .auth-photo .auth-panel { flex: none; justify-content: flex-start; }
}
.auth-card-box { position: relative; z-index: 1; }

/* ── Morogoro Fresh Farms logo ───────────────────────────────────── */
.sidebar-brand-logo { flex-direction: row; align-items: center; gap: 14px; }
.brand-mark-img { width: 52px; height: 52px; flex-shrink: 0; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-logo .brand-name { margin-top: 4px; font-size: 19px; line-height: 1.15; }
.topbar-brand { align-items: center; gap: 8px; }
.topbar-brand img { width: 26px; height: 26px; }
@media (max-width: 1023px) { .topbar-brand { display: inline-flex; } }
.auth-hero-logo { width: 260px; max-width: 70%; height: auto; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35)); }
.auth-logo-mark { display: block; width: 60px; height: 60px; margin-bottom: 16px; }
@media (max-width: 1023px) { .auth-hero-logo { width: 170px; } }
.print-logo { display: none; }
@media print {
  .print-head .print-farm { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
  .print-head .print-logo { display: block; grid-row: span 2; width: 54px; height: 54px; }
}

/* ── Settings: one page, tabs across the top ─────────────────────── */
.settings-head { margin-bottom: 22px; }
.settings-head h1 { margin-bottom: 14px; }
.settings-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.settings-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.settings-tabs a .material-symbols-outlined { font-size: 18px; color: var(--text-3); }
.settings-tabs a:hover { color: var(--text); text-decoration: none; }
.settings-tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--gold); }
.settings-tabs a.active .material-symbols-outlined { color: var(--primary); }
/* Inside Settings the page's own title becomes a section heading. */
.settings-head + .page-header h1, .settings-head + .page-header > div > h1 { font-size: 16px; font-weight: 600; }
.settings-head + .page-header .eyebrow { display: none; }
@media (max-width: 640px) {
  .settings-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .settings-tabs a { padding: 10px 10px; }
}
@media (max-width: 640px) {
  .settings-tabs { flex-wrap: wrap; overflow: visible; gap: 6px; border-bottom: 0; }
  .settings-tabs a { padding: 7px 11px; margin: 0; border: 1px solid var(--border); border-radius: 999px; background: #fff; }
  .settings-tabs a.active { border-color: var(--primary); background: var(--lime-soft); }
}

/* Statement: product lines of a multi-product sale sit under it, quieter. */
.statement-table .line-row td { padding-top: 4px; padding-bottom: 4px; border-bottom-color: transparent; font-size: 12px; color: var(--text-2); }
.statement-table .line-row .detail { margin: 0; padding-left: 10px; }
@media (max-width: 640px) {
  .statement-table td, .statement-table th { padding-left: 6px; padding-right: 6px; font-size: 12px; }
}
/* The "100 kg × 4,000" line is for phones only; on wider screens the Kg and Price columns show it. */
.statement-table .detail.show-sm { display: none; }
@media (max-width: 640px) {
  /* Kg and price move into the details text on phones, so the money columns fit. */
  .statement-table .c-kg, .statement-table .c-price { display: none; }
  .statement-table .detail.show-sm { display: block; color: var(--text); font-weight: 500; }
}

/* ── Install-as-app banner ───────────────────────────────────────── */
.install-banner { position: fixed; left: 50%; bottom: 16px; z-index: 80; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #2a2a2b; color: #e8e8e8; border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28); }
.install-banner[hidden] { display: none; }
.install-banner img { border-radius: 10px; flex-shrink: 0; }
.install-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 13px; }
.install-text strong { color: #fff; font-size: 14px; }
.install-actions { display: flex; gap: 8px; flex-shrink: 0; }
.install-banner .btn:not(.btn-primary) { background: transparent; color: #ccc; border-color: rgba(255, 255, 255, 0.2); }
@media (max-width: 520px) {
  .install-banner { flex-wrap: wrap; }
  .install-actions { width: 100%; justify-content: flex-end; }
}
@media print { .install-banner { display: none !important; } }

/* Top-bar "Install app": only shown while the browser allows installing. */
.install-app-btn { gap: 6px; padding: 6px 12px; border-color: var(--primary); color: var(--primary); font-weight: 600; }
.install-app-btn[hidden] { display: none; }
.install-app-btn .material-symbols-outlined { font-size: 18px; }
.install-app-btn:hover { background: var(--lime-soft); }
@media (max-width: 520px) { .install-app-label { display: none; } .install-app-btn { padding: 6px 8px; } }

/* The slide-in menu sits above the sticky top bar on phones and tablets. */
.sidebar { z-index: 60; }
.sidebar-backdrop { z-index: 55; }

/* Sales list: on phones kg × price goes under the customer so the table fits the screen. */
.sales-table .kg-line { display: none; }
@media (max-width: 640px) {
  .sales-table .c-kg, .sales-table .c-price { display: none; }
  .sales-table .kg-line { display: block; font-size: 12px; color: var(--text); font-weight: 500; }
  .sales-table td, .sales-table th { padding-left: 8px; padding-right: 8px; }
}
.sales-table .status-line { display: none; }
@media (max-width: 640px) {
  .sales-table .c-status { display: none; }
  .sales-table .status-line { display: block; margin-top: 4px; }
}
