/* Forest Graphite #18251D + Acid Mint #B7FF72 */
:root {
  --forest: #18251d;
  --mint: #b7ff72;
  --ink: #18251d;
  --ink-soft: #354b3c;
  --muted: #5c7062;
  --line: #dce8d7;
  --paper: #ffffff;
  --bg: #f5f8f1;
  --green: #254b2f;
  --green-dark: #18251d;
  --green-light: #e5f8d2;
  --green-pale: #f0fbe8;
  --cream: #f5fbe9;
  --shadow: 0 8px 28px #18251d0d;
  --surface-soft: #f0f6eb;
  --field-bg: #ffffff;
  --accent-ink: #18251d;
}

html[data-theme="dark"] {
  --ink: #f2f8ee;
  --ink-soft: #dcebd7;
  --muted: #b3c8b4;
  --line: #34483a;
  --paper: #233429;
  --bg: #18251d;
  --green: #b7ff72;
  --green-dark: #d1ff9f;
  --green-light: #34533b;
  --green-pale: #2a4030;
  --cream: #263c2d;
  --shadow: 0 8px 28px #07100a33;
  --surface-soft: #2a4030;
  --field-bg: #1d2e23;
  --accent-ink: #18251d;
}

body, html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--green-light); }
.theme-toggle-icon { font-size: 18px; line-height: 1; }
.theme-toggle:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
.auth-theme-toggle { position: absolute; top: 18px; left: 18px; }
.auth-card { position: relative; padding-top: 64px; }

.sidebar, html[data-theme="dark"] .sidebar { background: var(--forest); }
.brand-mark, html[data-theme="dark"] .brand-mark { background: var(--mint); color: var(--forest); outline-color: #b7ff7280; }
.brand, .brand b, .side-footer b { color: #f5faef; }
.brand small, .side-footer small, .side-label { color: #c4d9c1; }
.nav-item { color: #d5e6d0; }
.nav-item:hover { background: #36513b; color: #fff; }
.nav-item.active, html[data-theme="dark"] .nav-item.active { background: var(--mint); color: var(--forest); }
.nav-count { background: #eaf9dd; color: var(--forest); }
.sidebar-bottom { background: #29412f; border-color: #44624a; color: #f5faef; }
.sidebar-bottom p { color: #d0e1cb; }
.leaf-art { color: #8aca67; }
.avatar { background: var(--mint); color: var(--forest); }
.topbar { color: var(--muted); }
.breadcrumb b, .breadcrumb span { color: var(--ink-soft); }
.button.primary, #toggleInventoryEdit, .report-mode-tabs button.selected { background: var(--forest); color: var(--mint); }
.button.primary:hover { background: #2d4733; color: var(--mint); }
.button.secondary, .backup-button { background: var(--green-light); border-color: var(--line); color: var(--ink-soft); }
.button.secondary:hover, .backup-button:hover { background: var(--mint); color: var(--forest); }
.report-shortcut, .report-shortcut:nth-child(2), .report-shortcut:nth-child(3) { background: var(--forest); border-color: #45634b; }
.report-shortcut-accent { background: var(--mint); }
.report-shortcut-icon { background: #b7ff722b; color: var(--mint); }
.dashboard-quick-action.sale { background: var(--forest); color: var(--mint); }
.dashboard-quick-action.receiving { background: #426b43; color: #fff; }
.stat-card { border-top-color: var(--mint); }
.stat-card:after { background: var(--green-pale); }
.stat-value, .purchase-summary b, .stock-numbers b, .period-summary b, .sales-report-summary b, .inventory-overview button b { color: var(--ink); }
.stat-top, .stat-note, .panel-heading p, .page-heading p, .dashboard-reports-heading p, .purchase-summary span { color: var(--muted); }
.panel-heading h2, .dashboard-reports-heading h2, #dashboardPage > .page-heading p strong { color: var(--ink); }
.tip-bar, .mixed-total, .sales-report-total { background: var(--green-light); border-color: var(--line); color: var(--ink); }
.tip-bar b, .tip-bar small, .tip-action { color: var(--ink-soft); }
.text-link, .recent-amount, .period-row strong, .report-product-details strong, .purchase-total { color: var(--green); }
.stat-icon.mint, .stat-icon.lilac, .stat-icon.peach, .stat-icon.sand, .recent-icon { background: var(--green-light); color: var(--green); }
.auth-screen { background: radial-gradient(circle at 20% 15%, #b7ff7240, transparent 38%), var(--bg); }
.auth-card { background: var(--paper); border-color: var(--line); }
.auth-symbol { background: var(--forest); color: var(--mint); }
.auth-kicker, .auth-description, .auth-field { color: var(--muted); }
.auth-field input, .password-entry input, .password-entry button, .search-box, .inventory-toolbar select, .field input, .field select, .field textarea, .report-period-controls input, .report-period-controls select, .sales-report-toolbar input, .sales-report-toolbar select { background: var(--field-bg); color: var(--ink); border-color: var(--line); }
.search-box input { color: var(--ink); caret-color: var(--ink); }
.modal, .inventory-card, .inventory-overview button, .period-summary article, .report-mode-tabs button, .product-choices, .product-choices button, .sales-report-summary article, .sales-report-row, .purchase-summary > div { background: var(--paper); color: var(--ink); border-color: var(--line); }
.modal-header h2, .inventory-card h2, .period-row b, .sales-report-period, .sales-report-row strong, .purchase-main b, .product-name, .recent-desc b { color: var(--ink); }
.modal-kicker, .field, .purchase-meta, .period-row small, .inventory-card-meta, .stock-numbers span, .recent-desc small { color: var(--muted); }
.close-button, .stock-numbers > div, .inventory-card .stock-numbers > div, .form-hint, .sale-total-preview, .sales-report-columns, .sales-report-day-details, .report-product-image, .inventory-card-image, .selected-product, .fixed-costs, .receiving-entry, .category-tag, .dashboard-thumb-button, .dashboard-photo-close { background: var(--surface-soft); color: var(--ink); border-color: var(--line); }
.inventory-card-actions button, .inventory-status, .inventory-overview button.selected { background: var(--green-light); color: var(--ink-soft); border-color: var(--line); }
.report-mode-tabs button.selected, .product-choices button.selected { border-color: var(--mint); }
th, .full-panel tbody tr, .sales-report-day[open] summary { background: var(--surface-soft); color: var(--ink-soft); border-color: var(--line); }
td, .period-row, .report-product, .recent-item, .purchase-row, .sales-report-row, .sales-report-sale, .category-item { color: var(--ink-soft); border-color: var(--line); }
.toast { background: var(--mint); color: var(--forest); }

html[data-theme="dark"] .topbar { background: var(--bg); border-color: var(--line); }
html[data-theme="dark"] .backup-button, html[data-theme="dark"] .theme-toggle { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .button.primary, html[data-theme="dark"] #toggleInventoryEdit, html[data-theme="dark"] .report-mode-tabs button.selected { background: var(--mint); color: var(--forest); }
html[data-theme="dark"] .button.primary:hover { background: #d1ff9f; }
html[data-theme="dark"] .report-shortcut, html[data-theme="dark"] .report-shortcut:nth-child(2), html[data-theme="dark"] .report-shortcut:nth-child(3) { background: #2d4733; }
html[data-theme="dark"] .dashboard-quick-action.sale { background: var(--mint); color: var(--forest); }
html[data-theme="dark"] .dashboard-quick-action.sale small { color: #29422b; }
html[data-theme="dark"] .dashboard-quick-action.receiving { background: #3b6042; }
html[data-theme="dark"] .text-link, html[data-theme="dark"] .recent-amount, html[data-theme="dark"] .period-row strong, html[data-theme="dark"] .report-product-details strong, html[data-theme="dark"] .purchase-total { color: var(--mint); }
html[data-theme="dark"] .stat-icon.mint, html[data-theme="dark"] .stat-icon.lilac, html[data-theme="dark"] .stat-icon.peach, html[data-theme="dark"] .stat-icon.sand, html[data-theme="dark"] .recent-icon { color: var(--mint); }
html[data-theme="dark"] .auth-screen { background: radial-gradient(circle at 20% 15%, #b7ff721a, transparent 38%), var(--bg); }
html[data-theme="dark"] .auth-field input, html[data-theme="dark"] .field input, html[data-theme="dark"] .field select, html[data-theme="dark"] .field textarea { color: var(--ink); }
html[data-theme="dark"] .inventory-card-actions button:last-child { background: #543733; color: #ffd4cf; border-color: #704640; }
html[data-theme="dark"] .inventory-card .stock-numbers > div,
html[data-theme="dark"] .inventory-card.out .stock-numbers > div {
  background: #304b36;
  border: 1px solid #48654c;
}
html[data-theme="dark"] .inventory-card .stock-numbers b,
html[data-theme="dark"] .inventory-card.out .stock-numbers b { color: #f2f8ee; }
html[data-theme="dark"] .inventory-card .stock-numbers span { color: #c7dac2; }
html[data-theme="dark"] .inventory-card.out .inventory-status { background: #4b3635; color: #ffd9d4; }
html[data-theme="dark"] .inventory-card.low .inventory-status { background: #4b412e; color: #ffe3a6; }
html[data-theme="dark"] .report-product-total, html[data-theme="dark"] .sale-total-preview b, html[data-theme="dark"] .fixed-costs strong { color: var(--mint); }
html[data-theme="dark"] .receiving-entry-main b { color: var(--ink); }
html[data-theme="dark"] .receiving-entry-main small,
html[data-theme="dark"] .receiving-entry-main p { color: var(--muted); }
html[data-theme="dark"] .receiving-entry > strong { color: var(--mint); }
html[data-theme="dark"] .receiving-entry-icon { background: var(--green-light); color: var(--mint); }
html[data-theme="dark"] .full-panel tbody tr { box-shadow: none; }

/* Keep text legible on both palettes, including labels nested in cards and forms. */
#dashboardPage > .page-heading p, .dashboard-reports-heading p,
.inventory-result-count, .year-picker, .report-period-controls label,
.sales-report-toolbar label, .period-summary span, .period-summary small,
.report-product-details small, .sales-report-summary span,
.sales-report-sale small, .sales-report-empty-day,
.sales-report-empty-day .sales-report-period,
.sales-report-empty-day strong, .selected-product small,
.product-choices > p, .optional, .field-help { color: var(--muted); }
.modal .field > b, .fixed-costs > b, .sales-report-sale b { color: var(--ink); }
.fixed-costs small, .receiving-entry-main small, .receiving-entry-main p { color: var(--muted); }
.sales-report-sale > strong, .sales-report-chevron { color: var(--green); }
.sales-report-row:hover, .sales-report-day summary:hover { background: var(--surface-soft); }
.eyebrow, .purchase-main small { color: var(--muted); }
.more-button { color: var(--ink-soft); }
.field input::placeholder, .field textarea::placeholder, .search-box input::placeholder,
.auth-field input::placeholder { color: var(--muted); opacity: 1; }
.availability-card { background: var(--green-light); color: var(--ink); border-color: var(--line); }
.availability-card span, .availability-card small { color: var(--ink-soft); }
.availability-card strong { color: var(--ink); }
html[data-theme="dark"] .availability-card { background: #304b36; border-color: #759b70; }
html[data-theme="dark"] .availability-card strong { color: var(--mint); }
html[data-theme="dark"] .period-summary .outbound b,
html[data-theme="dark"] .report-product.outbound strong { color: #ffb8ad; }
html[data-theme="dark"] .transaction-edit { background: #304b36; color: #d1ff9f; border-color: #759b70; }
html[data-theme="dark"] .transaction-edit:hover,
html[data-theme="dark"] .transaction-edit:focus-visible { background: #3b6042; }
html[data-theme="dark"] .delete-transaction { background: #493430; color: #ffd4cc; border-color: #8e5e54; }
html[data-theme="dark"] .delete-transaction:hover { background: #5b3d37; }
html[data-theme="dark"] .auth-error { color: #ffb8ad; }

@media (max-width: 760px) {
  .topbar { background: var(--bg); }
  .sidebar, html[data-theme="dark"] .sidebar { background: var(--forest); border-color: #44624a; }
  .nav-item { color: #d5e6d0; }
  .nav-item.active, html[data-theme="dark"] .nav-item.active { background: var(--mint); color: var(--forest); }
  .theme-toggle { min-height: 40px; padding: 5px 8px; }
  .top-actions { gap: 5px; }
  .top-actions .theme-toggle-label { display: none; }
  .top-actions .theme-toggle { width: 40px; padding: 5px; }
  .full-panel tbody tr { background: var(--paper); border-color: var(--line); }
  .inventory-panel tbody tr { border-color: var(--line); }
}
