:root {
  --bg: #060d08;
  --bg-elevated: #0d1a10;
  --sidebar: rgba(5, 10, 7, 0.96);
  --sidebar-border: rgba(160, 200, 145, 0.10);
  --panel: rgba(10, 20, 13, 0.94);
  --panel-strong: rgba(14, 26, 17, 0.98);
  --panel-soft: rgba(255, 255, 255, 0.028);
  --text: #f2f7f0;
  --muted: #a8bfaa;
  --muted-2: #6f8e72;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(160, 200, 145, 0.20);
  --accent: #4f9260;
  --accent-strong: #2d6e42;
  --accent-light: #8cca9a;
  --accent-copper: #b5713f;
  --accent-copper-soft: rgba(181, 113, 63, 0.14);
  --accent-gold: #c9a84c;
  --accent-gold-soft: rgba(201, 168, 76, 0.12);
  --danger: #e07a6a;
  --success: #6bc98a;
  --warn: #d4a43a;
  --white: #ffffff;
  --ink: #1a2e1c;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.44);
  --shadow-soft: 0 14px 32px rgba(0, 0, 0, 0.28);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(79, 146, 96, 0.22), transparent 32%),
    radial-gradient(ellipse at 82% 100%, rgba(181, 113, 63, 0.10), transparent 28%),
    linear-gradient(180deg, #060d08 0%, #09140b 50%, #060d08 100%);
  color: var(--text);
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(115deg, rgba(84,165,71,0.035), transparent 42%, rgba(227,188,34,0.03) 100%);
  pointer-events: none;
}
a { color: #dcefd8; text-decoration: none; }
a:hover { color: var(--white); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; }
.layout {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid var(--sidebar-border);
  background:
    linear-gradient(180deg, rgba(5,10,7,0.98) 0%, rgba(6,12,8,0.94) 100%),
    radial-gradient(circle at top left, rgba(84,165,71,0.10), transparent 35%);
  backdrop-filter: blur(18px);
  overflow: auto;
}
.brand-shell {
  margin-bottom: 20px;
  padding: 0 4px;
}
.brand-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}
.brand-wordmark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.brand-wordmark-text {
  display: grid;
  gap: 1px;
}
.brand-wordmark-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
}
.brand-wordmark-sub {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}
/* Hide large brand blocks - no longer used */
.brand-card, .brand-logo-wrap, .brand-kicker, .brand-copy, .brand-meta { display: none; }
.sidebar-toggle {
  display: none;
  width: 100%;
  margin-bottom: 12px;
  justify-content: space-between;
  align-items: center;
}
.nav-groups { display: grid; gap: 16px; }
.nav-group {
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  background: rgba(255,255,255,0.015);
}
.nav-title {
  margin: 0 0 10px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav { display: grid; gap: 6px; }
.nav a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.nav a::after {
  content: "›";
  color: var(--muted-2);
  font-size: 16px;
}
.nav a:hover {
  text-decoration: none;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
  transform: translateX(1px);
}
.nav a.is-active {
  color: var(--white);
  background: linear-gradient(135deg, rgba(79,146,96,0.28), rgba(45,110,66,0.36));
  border-color: rgba(140,202,154,0.22);
  border-left: 2px solid var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.nav a.is-active::after { color: var(--accent-light); }
.sidebar-footer {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}
.sidebar-footer span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}
.main {
  min-width: 0;
  padding: 26px 28px 32px;
}
.main-shell {
  max-width: 1500px;
  margin: 0 auto;
}
.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 20px;
  margin-bottom: 20px;
}
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.page-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-gold), #c69212);
}
.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.1vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-family: 'Fraunces', Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
}
.subtle { color: var(--muted); font-size: 13px; line-height: 1.55; }
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}
.page-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 12px;
}
.messages { display: grid; gap: 10px; margin: 0 0 18px; }
.message {
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(10px);
}
.message.success {
  border-color: rgba(111,209,150,.32);
  background: rgba(111,209,150,.08);
}
.message.error {
  border-color: rgba(232,124,124,.34);
  background: rgba(232,124,124,.08);
}
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.85fr);
  gap: 20px;
  margin-bottom: 20px;
  padding: 24px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    linear-gradient(135deg, rgba(84,165,71,0.15), rgba(0,97,44,0.18) 46%, rgba(8,17,13,0.75) 100%),
    rgba(255,255,255,0.03);
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(227,188,34,0.14), transparent 28%);
  pointer-events: none;
}
.hero-copy, .hero-side { position: relative; z-index: 1; }
.hero h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  line-height: 1.05;
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
}
.hero p {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.65;
}
.hero-actions, .btn-group, .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.hero-highlights .pill,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
}
.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
}
.hero-side {
  display: grid;
  align-content: space-between;
  gap: 18px;
}
/* brand-showcase and dev-card removed — replaced with hero-meta */
.brand-showcase, .dev-card { display: none; }
.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.hero-meta img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}
.hero-meta-copy {
  display: grid;
  gap: 2px;
}
.hero-meta-copy strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.hero-meta-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
html[data-theme="light"] .hero-meta {
  background: rgba(255,255,255,0.6);
  border-color: rgba(0,0,0,0.06);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card, .card {
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(13,23,18,0.95), rgba(10,18,14,0.92));
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}
.stat-card {
  overflow: hidden;
  padding: 18px;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-gold));
  opacity: 0.95;
}
.stat-card .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 10px;
}
.stat-card .value {
  font-size: clamp(1.7rem, 2vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.card {
  padding: 20px;
  margin-bottom: 18px;
}
.card.flat {
  background: rgba(255,255,255,0.02);
}
.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.card-header h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.card-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.grid-2, .grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.grid-3, .grid.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.narrow-card { max-width: 960px; }
.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid rgba(255,255,255,0.04); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}
th {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  background: rgba(255,255,255,0.02);
}
tbody tr:hover { background: rgba(255,255,255,.02); }
.text-right { text-align: right; }
.row-title {
  display: grid;
  gap: 2px;
}
.row-title strong { font-size: 14px; }
.row-title span { color: var(--muted); font-size: 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 700;
}
.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.badge.warn::before { background: var(--accent-gold); }
.badge.danger::before { background: var(--danger); }
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.btn:hover {
  background: rgba(255,255,255,0.07);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-primary {
  color: #fff;
  border-color: rgba(84,165,71,0.28);
  background: linear-gradient(180deg, #54a547 0%, #00612c 100%);
  box-shadow: 0 12px 24px rgba(0, 97, 44, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #5db151 0%, #006d32 100%);
}
.btn-secondary {
  color: var(--ink);
  border-color: rgba(227,188,34,0.28);
  background: linear-gradient(180deg, #f0ca35 0%, #e3bc22 100%);
}
.btn-secondary:hover { color: var(--ink); }
.btn-danger {
  background: rgba(232,124,124,.1);
  color: #ffd7d7;
  border-color: rgba(232,124,124,.28);
}
.btn-sm { min-height: 40px; padding: 7px 12px; font-size: 13px; border-radius: 12px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.form-grid.compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-group label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.form-input, input, select, textarea {
  width: 100%;
  background: rgba(255,255,255,0.055);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px 14px;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
select option { color: #101814; }
html[data-theme="dark"] select option { color: #101814; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(227,188,34,0.34);
  box-shadow: 0 0 0 4px rgba(227,188,34,0.12);
  background: rgba(255,255,255,0.08);
}
textarea { min-height: 110px; resize: vertical; }
.checkbox-row { justify-content: flex-end; align-items: flex-start; }
.form-check { width: 18px; height: 18px; accent-color: var(--accent); }
.form-hint, .errorlist { color: var(--muted); font-size: 12px; line-height: 1.45; }
.errorlist { list-style: none; padding: 0; margin: 0; color: #ffd2d2; }
.form-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.form-toolbar .subtle { max-width: 60ch; }
.quick-links-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}
.quick-links-panel strong {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.import-textarea { min-height: 72px; }
.import-preview-row td { vertical-align: top; }
.login-card-topbar { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.sticky-actions {
  position: sticky;
  bottom: 18px;
  z-index: 5;
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(227,188,34,0.16);
  background: rgba(8,16,12,0.92);
  box-shadow: var(--shadow-soft);
}
.line-items { display: grid; gap: 12px; }
.line-item-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  background: rgba(255,255,255,.03);
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.05);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.detail-grid dt {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.detail-grid dd { margin: 0; }
.line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.line:last-child { border-bottom: 0; }
.stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 18px;
  padding: 14px;
}
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.stat strong { font-size: 22px; }
.totals {
  display: grid;
  gap: 8px;
  justify-content: end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255,255,255,0.12);
}
.stack { display: grid; gap: 14px; }
.muted { background: rgba(255,255,255,.02); }
.actions { display: flex; align-items: end; }
.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 34px 18px;
  border-radius: 20px;
  border: 1px dashed rgba(227,188,34,0.18);
  background: rgba(255,255,255,0.02);
}
.empty-state strong { font-size: 15px; }
.empty-state span { color: var(--muted); font-size: 13px; line-height: 1.55; max-width: 48ch; }
.page-section + .page-section { margin-top: 18px; }
.qr-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
}
.qr-box {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 2px dashed rgba(227,188,34,0.18);
  border-radius: 18px;
  text-align: center;
  padding: 12px;
  font-weight: 700;
  word-break: break-word;
  background: rgba(255,255,255,0.02);
}
.qr-box.big { min-height: 240px; font-size: 24px; }
.image-box { display:flex; align-items:center; justify-content:center; background:#fff; border-radius: 18px; padding: 12px; }
.image-box img { max-width:100%; height:auto; display:block; }
.thermal-label { max-width: 420px; margin: 0 auto; }
.qr-card.thermal { grid-template-columns: 180px 1fr; align-items:center; }
.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 24px;
  padding: 18px 6px 0;
  color: var(--muted);
  font-size: 12px;
}
.app-footer .developer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.app-footer img { width: 34px; border-radius: 10px; }
.login-body {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}
.login-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 0.85fr);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.06);
}
.login-brand {
  position: relative;
  padding: 34px;
  display: grid;
  gap: 18px;
  align-content: space-between;
  background:
    linear-gradient(155deg, rgba(84,165,71,0.18), rgba(0,97,44,0.32) 48%, rgba(9,17,13,0.95) 100%),
    #080f0a;
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/core/branding/ailevelup-hero.6b4fe0fca657.webp") center/cover no-repeat;
  opacity: 0.18;
}
.login-brand > * { position: relative; z-index: 1; }
.login-brand-card {
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-brand-card img { width: 32px; height: 32px; object-fit: contain; }
.login-brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
}
.login-brand h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.04;
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
}
.login-brand p {
  margin: 0;
  color: rgba(245,247,246,0.82);
  line-height: 1.7;
  max-width: 52ch;
}
.login-card {
  background: linear-gradient(180deg, rgba(8,16,10,0.98), rgba(6,12,8,0.99));
  padding: 34px;
  display: grid;
  align-content: center;
}
.login-card h2 { margin: 0 0 8px; font-size: 1.7rem; }
.login-card .subtle { margin-bottom: 18px; }
.print-brand {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.print-brand-logo {
  display: grid;
  gap: 10px;
}
.print-brand-logo .patch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  background: rgba(255,255,255,0.98);
  border-radius: 18px;
  width: fit-content;
}
.print-brand-logo img { width: min(260px, 100%); }
.print-brand-meta {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: auto;
    padding-bottom: 12px;
  }
  .sidebar-toggle { display: flex; }
  .nav-groups { display: none; }
  .sidebar.is-open .nav-groups { display: grid; }
  .main { padding-top: 18px; }
}
@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr; }
  .topbar-actions { justify-content: flex-start; }
  .hero { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .main { padding: 18px 16px 26px; }
  .hero, .card, .stat-card, .login-card, .login-brand { padding: 18px; }
  .brand-card { padding: 14px; }
  .form-grid, .line-item-row { grid-template-columns: 1fr; }
  .qr-card, .qr-card.thermal { grid-template-columns: 1fr; }
  .print-brand { flex-direction: column; align-items: flex-start; }
  .print-brand-meta { text-align: left; }
}
@media print {
  body { background: white; color: #111; }
  body::before, .sidebar, .topbar, .messages, .btn, .topbar-actions, .app-footer, .sticky-actions { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  .card, .hero, .stat-card { box-shadow: none; border: 0; background: white; color: #111; }
  table, th, td { color: #111; }
  .subtle, .badge, .pill { color: #555; }
  .print-brand-logo .patch { border: 1px solid #ddd; }
  .table-wrap { border: 0; }
  .thermal-label { border:none; box-shadow:none; }
  .thermal-label .card-header .btn { display:none; }
}

.note-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(227,188,34,0.16);
  background: rgba(227,188,34,0.08);
}
.note-panel strong { display: block; margin-bottom: 6px; }
.note-panel span { display: block; color: var(--muted); line-height: 1.55; }

html[data-theme="light"] {
  --bg: #f4efe6;
  --bg-elevated: #fdf8f0;
  --sidebar: rgba(248, 244, 237, 0.99);
  --sidebar-border: rgba(60, 100, 70, 0.12);
  --panel: rgba(253, 250, 243, 0.98);
  --panel-strong: rgba(255, 253, 247, 1);
  --panel-soft: rgba(0, 0, 0, 0.025);
  --text: #1a2e1c;
  --muted: #5c7260;
  --muted-2: #7a8e7d;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(60, 100, 70, 0.18);
  --accent: #3d7a4f;
  --accent-copper: #a05a2c;
  --shadow: 0 20px 60px rgba(20, 40, 25, 0.08);
  --shadow-soft: 0 12px 30px rgba(20, 40, 25, 0.07);
}

html[data-theme="light"],
html[data-theme="light"] body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(61, 122, 79, 0.12), transparent 32%),
    radial-gradient(ellipse at 80% 100%, rgba(160, 90, 44, 0.08), transparent 28%),
    linear-gradient(180deg, #f4efe6 0%, #f0e9df 50%, #f4efe6 100%);
  color: var(--text);
}
html[data-theme="light"] body::before {
  background: linear-gradient(125deg, rgba(61,122,79,0.02), transparent 44%, rgba(181,113,63,0.02) 100%);
}
html[data-theme="light"] a { color: #225238; }
html[data-theme="light"] a:hover { color: #123926; }
html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(248,250,247,0.98) 0%, rgba(242,246,241,0.98) 100%);
  border-right-color: rgba(0, 97, 44, 0.12);
}
html[data-theme="light"] .brand-meta,
html[data-theme="light"] .nav-group,
html[data-theme="light"] .sidebar-footer,
html[data-theme="light"] .page-kicker,
html[data-theme="light"] .btn,
html[data-theme="light"] .message,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .note-panel,
html[data-theme="light"] .quick-links-panel,
html[data-theme="light"] .form-input,
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .brand-meta,
html[data-theme="light"] .nav-group,
html[data-theme="light"] .sidebar-footer,
html[data-theme="light"] .page-kicker,
html[data-theme="light"] .btn,
html[data-theme="light"] .message,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .quick-links-panel,
html[data-theme="light"] .form-input,
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card {
  background: rgba(255,255,255,0.94);
}
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card {
  border-color: rgba(0,0,0,0.07);
  box-shadow: var(--shadow-soft);
}
html[data-theme="light"] .nav a:hover {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.06);
}
html[data-theme="light"] .nav a.is-active {
  color: #103723;
  background: linear-gradient(135deg, rgba(84,165,71,0.16), rgba(227,188,34,0.16));
  border-color: rgba(0,97,44,0.18);
}
html[data-theme="light"] th {
  background: rgba(0,0,0,0.03);
  color: var(--muted);
}
html[data-theme="light"] th,
html[data-theme="light"] td {
  border-bottom-color: rgba(0,0,0,0.06);
}
html[data-theme="light"] tbody tr:hover { background: rgba(0,0,0,.02); }
html[data-theme="light"] .btn:hover { background: rgba(0,0,0,0.05); }
html[data-theme="light"] .btn-primary { color: #fff; }
html[data-theme="light"] .btn-secondary { color: var(--ink); }
html[data-theme="light"] .message.success { background: rgba(84,165,71,0.12); color: #18412a; }
html[data-theme="light"] .message.error { background: rgba(232,124,124,0.12); color: #7b2424; }
html[data-theme="light"] .note-panel { background: rgba(227,188,34,0.10); }
html[data-theme="light"] .subtle,
html[data-theme="light"] .form-hint,
html[data-theme="light"] .card-header p,
html[data-theme="light"] .row-title span,
html[data-theme="light"] .brand-meta-copy span,
html[data-theme="light"] .sidebar-footer span,
html[data-theme="light"] .note-panel span {
  color: var(--muted);
}

.theme-toggle { min-width: 112px; }
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.align-end { align-items: flex-end; }
.gap-xs { gap: 6px; }
.gap-sm { gap: 10px; }
.tight { margin: 0; }
.top-gap { margin-top: 14px; }
.compact-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.compact-card { padding: 16px; }
.compact-panel { padding: 12px 14px; }
.metric-card-link { display: grid; gap: 16px; align-content: space-between; }
.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.selected-card {
  border-color: rgba(84,165,71,0.28);
  box-shadow: inset 0 0 0 1px rgba(84,165,71,0.16);
}
.form-grid.two-up { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.between-actions { justify-content: space-between; align-items: center; width: 100%; gap: 12px; }
.import-table { min-width: 980px; }
.editable-import-table { min-width: 1220px; }
.inline-checkbox {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}
.list-hints {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.error-list { color: var(--danger); }
@media (max-width: 760px) {
  .between-actions { align-items: flex-start; }
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.metric-card {
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(13,23,18,0.95), rgba(10,18,14,0.92));
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  padding: 18px;
}
.metric-card strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.metric-card span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}
html[data-theme="light"] .metric-card {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.07);
  box-shadow: var(--shadow-soft);
}

html[data-theme="light"] .brand-card {
  background: linear-gradient(155deg, rgba(255,255,255,0.98) 0%, rgba(248,250,247,0.98) 100%);
}
html[data-theme="light"] .quick-links-panel {
  background: rgba(0,0,0,0.02);
}
html[data-theme="light"] .line-item-row {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.06);
}
html[data-theme="light"] .sticky-actions {
  background: rgba(255,255,255,0.96);
  border-color: rgba(0,97,44,0.12);
}
html[data-theme="light"] .page-kicker::before {
  background: linear-gradient(180deg, var(--accent), var(--accent-gold));
}
.import-preview-row[data-row-state="review"] { background: rgba(227,188,34,0.05); }
.import-preview-row[data-row-state="error"] { background: rgba(232,124,124,0.07); }
html[data-theme="light"] .import-preview-row[data-row-state="review"] { background: rgba(227,188,34,0.09); }
html[data-theme="light"] .import-preview-row[data-row-state="error"] { background: rgba(232,124,124,0.08); }


/* === v1.0 theme standardization pass === */
:root {
  --surface-1: rgba(13, 23, 18, 0.95);
  --surface-2: rgba(10, 18, 14, 0.92);
  --surface-3: rgba(255,255,255,0.035);
  --surface-4: rgba(255,255,255,0.05);
  --surface-5: rgba(255,255,255,0.08);
  --hero-text: var(--text);
  --hero-subtle: var(--muted);
  --table-head: rgba(255,255,255,0.03);
  --table-row-hover: rgba(255,255,255,0.035);
  --input-bg: rgba(255,255,255,0.06);
  --input-bg-focus: rgba(255,255,255,0.09);
  --button-bg: rgba(255,255,255,0.04);
  --button-bg-hover: rgba(255,255,255,0.09);
  --button-border: rgba(255,255,255,0.08);
  --button-text: var(--text);
  --chip-bg: rgba(255,255,255,0.045);
  --chip-border: rgba(255,255,255,0.08);
  --chip-text: var(--text);
}

html[data-theme="dark"] {
  --bg: #060d08;
  --bg-elevated: #0d1a10;
  --surface-1: rgba(13, 23, 18, 0.95);
  --surface-2: rgba(10, 18, 14, 0.92);
  --surface-3: rgba(255,255,255,0.03);
  --surface-4: rgba(255,255,255,0.05);
  --surface-5: rgba(255,255,255,0.08);
  --hero-text: #f4f7f5;
  --hero-subtle: #d3ddd7;
  --table-head: rgba(255,255,255,0.03);
  --table-row-hover: rgba(255,255,255,0.03);
  --input-bg: rgba(255,255,255,0.055);
  --input-bg-focus: rgba(255,255,255,0.085);
  --button-bg: rgba(255,255,255,0.04);
  --button-bg-hover: rgba(255,255,255,0.09);
  --button-border: rgba(255,255,255,0.08);
  --button-text: #f5f7f6;
  --chip-bg: rgba(255,255,255,0.045);
  --chip-border: rgba(255,255,255,0.08);
  --chip-text: #f5f7f6;
}

html[data-theme="light"] {
  --bg: #f3f6f1;
  --bg-elevated: #ffffff;
  --sidebar: rgba(250, 251, 248, 0.98);
  --sidebar-border: rgba(0, 97, 44, 0.12);
  --panel: rgba(255, 255, 255, 0.98);
  --panel-strong: rgba(255, 255, 255, 1);
  --panel-soft: rgba(12, 22, 17, 0.03);
  --text: #18221d;
  --muted: #55635d;
  --muted-2: #6c7a73;
  --border: rgba(15, 28, 22, 0.09);
  --border-strong: rgba(0, 97, 44, 0.18);
  --shadow: 0 22px 60px rgba(24, 36, 29, 0.08);
  --shadow-soft: 0 14px 30px rgba(24, 36, 29, 0.07);
  --surface-1: rgba(255,255,255,0.98);
  --surface-2: rgba(250,252,249,0.98);
  --surface-3: rgba(7, 24, 13, 0.02);
  --surface-4: rgba(7, 24, 13, 0.04);
  --surface-5: rgba(7, 24, 13, 0.07);
  --hero-text: #173126;
  --hero-subtle: #44534d;
  --table-head: #eff3ed;
  --table-row-hover: rgba(0, 97, 44, 0.035);
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
  --button-bg: #ffffff;
  --button-bg-hover: #f4f7f2;
  --button-border: rgba(21, 39, 31, 0.11);
  --button-text: #18221d;
  --chip-bg: #f7faf6;
  --chip-border: rgba(21, 39, 31, 0.09);
  --chip-text: #1d2a24;
}

html, body {
  background-color: var(--bg);
  color: var(--text);
}
body {
  min-width: 320px;
}
body::selection,
*::selection {
  background: rgba(227,188,34,0.28);
  color: var(--text);
}

a:not(.btn),
a:not(.btn):visited {
  color: #dcefd8;
}
a:not(.btn):hover {
  color: #ffffff;
}
html[data-theme="light"] a:not(.btn),
html[data-theme="light"] a:not(.btn):visited {
  color: #1c5a38;
}
html[data-theme="light"] a:not(.btn):hover {
  color: #123926;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(227, 188, 34, 0.18);
}
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] select:focus-visible,
html[data-theme="light"] textarea:focus-visible {
  box-shadow: 0 0 0 4px rgba(84, 165, 71, 0.16);
}

.sidebar,
.nav-group,
.sidebar-footer,
.brand-meta,
.page-kicker,
.page-meta,
.message,
.quick-links-panel,
.note-panel,
.table-wrap,
.card,
.stat-card,
.metric-card,
.sticky-actions,
.line-item-row,
.empty-state,
.stat,
.badge,
.hero-highlights .pill,
.pill,
input,
select,
textarea,
.form-input,
.btn {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.sidebar {
  background: linear-gradient(180deg, rgba(5, 10, 7, 0.98) 0%, rgba(6, 12, 8, 0.94) 100%);
}

.nav-group,
.sidebar-footer,
.brand-meta,
.page-kicker,
.page-meta,
.message,
.quick-links-panel,
.note-panel,
.table-wrap,
.empty-state,
.stat {
  background: var(--surface-3);
  border-color: var(--border);
}

.card,
.stat-card,
.metric-card {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border-color: var(--border);
}

.table-wrap {
  background: color-mix(in srgb, var(--surface-1) 50%, transparent);
}

th {
  background: var(--table-head);
  color: var(--muted);
}
tbody tr:hover {
  background: var(--table-row-hover);
}
th, td {
  border-bottom-color: var(--border);
}

.row-title strong,
.card-header h3,
.hero h2,
.topbar h1,
.stat-card .value,
.metric-card strong {
  color: var(--text);
}

.subtle,
.card-header p,
.row-title span,
.brand-meta-copy span,
.sidebar-footer span,
.note-panel span,
.form-hint,
.brand-copy,
.brand-showcase-copy span,
.dev-card span,
.empty-state span {
  color: var(--muted);
}

.btn,
a.btn,
a.btn:visited {
  background: var(--button-bg);
  border-color: var(--button-border);
  color: var(--button-text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.btn:hover,
a.btn:hover {
  background: var(--button-bg-hover);
  color: var(--button-text);
}
.btn-primary,
a.btn-primary,
a.btn-primary:visited {
  color: #ffffff;
  border-color: rgba(0, 97, 44, 0.18);
  background: linear-gradient(180deg, #58ad4a 0%, #00612c 100%);
  box-shadow: 0 12px 24px rgba(0, 97, 44, 0.24);
}
.btn-primary:hover,
a.btn-primary:hover {
  color: #ffffff;
  background: linear-gradient(180deg, #62b653 0%, #006a31 100%);
}
.btn-secondary,
a.btn-secondary,
a.btn-secondary:visited {
  color: #201d12;
  border-color: rgba(190, 151, 17, 0.24);
  background: linear-gradient(180deg, #f0ca35 0%, #e3bc22 100%);
  box-shadow: 0 10px 20px rgba(227, 188, 34, 0.18);
}
.btn-secondary:hover,
a.btn-secondary:hover {
  color: #201d12;
}
.btn-danger,
a.btn-danger,
a.btn-danger:visited {
  color: #ffe8e8;
}

input,
select,
textarea,
.form-input {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(227,188,34,0.34);
  box-shadow: 0 0 0 4px rgba(227,188,34,0.12);
  background: var(--input-bg-focus);
}
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  border-color: rgba(0,97,44,0.28);
  box-shadow: 0 0 0 4px rgba(84,165,71,0.12);
}

.badge,
.hero-highlights .pill,
.pill {
  background: var(--chip-bg);
  border-color: var(--chip-border);
  color: var(--chip-text);
}

.hero {
  align-items: start;
  border-color: var(--border);
  background:
    linear-gradient(135deg, rgba(84,165,71,0.16), rgba(0,97,44,0.18) 44%, rgba(8,17,13,0.78) 100%),
    var(--surface-3);
}
.hero h2,
.hero p,
.hero .pill {
  color: var(--hero-text);
}
.hero p,
.hero .pill,
.hero-highlights .pill {
  color: var(--hero-subtle);
}
.hero-highlights .pill {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}
.hero-copy {
  display: grid;
  align-content: start;
  gap: 14px;
}
.hero p {
  max-width: 62ch;
  margin-bottom: 0;
}
.hero-actions {
  margin-top: 2px;
}

.brand-showcase {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,249,245,0.97));
  border: 1px solid rgba(17, 31, 24, 0.08);
}
.dev-card {
  min-height: 116px;
}

.theme-toggle {
  min-width: 126px;
  font-weight: 800;
}
.topbar-actions .btn,
.login-theme-toggle {
  backdrop-filter: blur(12px);
}

.login-card {
  background: linear-gradient(180deg, rgba(8,16,10,0.98), rgba(6,12,8,0.99));
}
.login-brand .brand-meta {
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
}

.app-footer {
  color: var(--muted);
}
.app-footer .developer {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

html[data-theme="light"],
html[data-theme="light"] body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(61, 122, 79, 0.11), transparent 32%),
    radial-gradient(ellipse at 80% 100%, rgba(160, 90, 44, 0.07), transparent 28%),
    linear-gradient(180deg, #f4efe6 0%, #f0e9df 52%, #f4efe6 100%);
}
html[data-theme="light"] body::before {
  background:
    linear-gradient(125deg, rgba(61,122,79,0.018), transparent 44%, rgba(181,113,63,0.022) 100%);
}
html[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg, rgba(248, 244, 237, 0.99) 0%, rgba(243, 238, 229, 0.99) 100%);
  box-shadow: inset -1px 0 0 rgba(60, 100, 70, 0.08);
}
html[data-theme="light"] .nav-group,
html[data-theme="light"] .sidebar-footer,
html[data-theme="light"] .brand-meta,
html[data-theme="light"] .page-kicker,
html[data-theme="light"] .page-meta,
html[data-theme="light"] .quick-links-panel,
html[data-theme="light"] .note-panel,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .stat,
html[data-theme="light"] .app-footer .developer {
  background: rgba(255,255,255,0.78);
  border-color: rgba(16, 38, 30, 0.09);
}
html[data-theme="light"] .nav a {
  color: #223129;
}
html[data-theme="light"] .nav a::after {
  color: #718177;
}
html[data-theme="light"] .nav a:hover {
  background: rgba(0,97,44,0.05);
  border-color: rgba(0,97,44,0.10);
}
html[data-theme="light"] .nav a.is-active {
  color: #143322;
  background: linear-gradient(135deg, rgba(84,165,71,0.18), rgba(227,188,34,0.18));
  border-color: rgba(0,97,44,0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55);
}
html[data-theme="light"] .nav-title,
html[data-theme="light"] .stat-card .label,
html[data-theme="light"] .metric-label,
html[data-theme="light"] th,
html[data-theme="light"] .detail-grid dt,
html[data-theme="light"] .form-group label {
  color: #5c6c64;
}
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .metric-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,247,0.98));
  border-color: rgba(14, 36, 27, 0.08);
}
html[data-theme="light"] .table-wrap {
  background: rgba(255,255,255,0.84);
}
html[data-theme="light"] th {
  background: #edf2eb;
}
html[data-theme="light"] tbody tr:hover {
  background: rgba(84,165,71,0.045);
}
html[data-theme="light"] .hero {
  background:
    linear-gradient(135deg, rgba(231,240,228,0.98) 0%, rgba(219,232,216,0.96) 50%, rgba(205,221,203,0.96) 100%);
  border-color: rgba(0,97,44,0.12);
  box-shadow: var(--shadow);
}
html[data-theme="light"] .hero::before {
  background:
    radial-gradient(circle at top right, rgba(227,188,34,0.16), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent 50%);
}
html[data-theme="light"] .hero h2,
html[data-theme="light"] .hero p,
html[data-theme="light"] .hero .pill,
html[data-theme="light"] .hero-highlights .pill {
  color: #173126;
}
html[data-theme="light"] .hero p,
html[data-theme="light"] .hero-highlights .pill {
  color: #44534d;
}
html[data-theme="light"] .hero-highlights .pill {
  background: rgba(255,255,255,0.62);
  border-color: rgba(16,38,30,0.08);
}
html[data-theme="light"] .brand-showcase {
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(248,250,247,1));
  border-color: rgba(14,36,27,0.08);
}
html[data-theme="light"] .dev-card {
  background:
    linear-gradient(160deg, rgba(12,32,25,0.96), rgba(6,17,13,0.98)),
    #0a1510;
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="light"] .btn,
html[data-theme="light"] a.btn,
html[data-theme="light"] a.btn:visited {
  background: #ffffff;
  color: #18221d;
  border-color: rgba(16,38,30,0.11);
}
html[data-theme="light"] .btn:hover,
html[data-theme="light"] a.btn:hover {
  background: #f4f7f2;
  color: #18221d;
}
html[data-theme="light"] .btn-primary,
html[data-theme="light"] a.btn-primary,
html[data-theme="light"] a.btn-primary:visited {
  color: #ffffff;
}
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] a.btn-secondary,
html[data-theme="light"] a.btn-secondary:visited {
  color: #201d12;
}
html[data-theme="light"] .page-kicker,
html[data-theme="light"] .page-meta {
  color: #4c5b54;
}
html[data-theme="light"] .message {
  background: rgba(255,255,255,0.84);
}
html[data-theme="light"] .message.success {
  background: rgba(84,165,71,0.10);
  color: #1d4a30;
}
html[data-theme="light"] .message.error {
  background: rgba(232,124,124,0.11);
  color: #7b2424;
}
html[data-theme="light"] .sticky-actions {
  background: rgba(255,255,255,0.96);
  border-color: rgba(0,97,44,0.12);
}
html[data-theme="light"] .line-item-row {
  background: rgba(244,247,242,0.86);
  border-color: rgba(16,38,30,0.08);
}
html[data-theme="light"] .badge {
  background: #f7faf6;
  border-color: rgba(16,38,30,0.09);
  color: #1f2d25;
}
html[data-theme="light"] .login-brand {
  background:
    linear-gradient(155deg, rgba(84,165,71,0.16), rgba(0,97,44,0.24) 50%, rgba(11,21,16,0.96) 100%),
    #112019;
}
html[data-theme="light"] .login-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,247,0.98));
  color: var(--text);
}
html[data-theme="light"] .login-card .subtle {
  color: var(--muted);
}
html[data-theme="light"] .login-brand .page-kicker,
html[data-theme="light"] .login-card .page-kicker {
  background: rgba(255,255,255,0.72);
  color: #203028;
}
html[data-theme="light"] .login-brand .brand-meta {
  background: rgba(255,255,255,0.08);
}
html[data-theme="light"] .login-card .message.error {
  background: rgba(232,124,124,0.10);
  color: #7b2424;
}

@media (max-width: 1180px) {
  .sidebar {
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  }
}
@media (max-width: 760px) {
  .topbar-actions {
    width: 100%;
  }
  .topbar-actions > * {
    flex: 1 1 auto;
  }
  .hero-actions > * {
    flex: 1 1 auto;
  }
}


/* === v1.1 visibility and button contrast pass === */
:root {
  --btn-neutral-bg-dark: rgba(255,255,255,0.08);
  --btn-neutral-bg-dark-hover: rgba(255,255,255,0.14);
  --btn-neutral-border-dark: rgba(255,255,255,0.14);
  --btn-neutral-text-dark: #f5f7f6;
  --btn-neutral-bg-light: #ffffff;
  --btn-neutral-bg-light-hover: #eef3ee;
  --btn-neutral-border-light: rgba(18, 39, 30, 0.14);
  --btn-neutral-text-light: #18221d;
  --btn-primary-start: #58ad4a;
  --btn-primary-end: #00612c;
  --btn-primary-text: #ffffff;
  --btn-secondary-start: #f1cf4c;
  --btn-secondary-end: #ddb116;
  --btn-secondary-text: #1f1a0d;
  --btn-danger-bg-dark: rgba(116, 24, 24, 0.82);
  --btn-danger-bg-light: #fff1f1;
  --btn-danger-text-light: #8e2020;
}

.btn,
a.btn,
a.btn:visited,
button.btn,
input.btn,
input[type="submit"].btn,
input[type="button"].btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 14px;
  border: 1px solid var(--btn-neutral-border-dark);
  background: var(--btn-neutral-bg-dark);
  color: var(--btn-neutral-text-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  text-shadow: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
}
.btn:hover,
a.btn:hover,
button.btn:hover,
input.btn:hover,
input[type="submit"].btn:hover,
input[type="button"].btn:hover {
  background: var(--btn-neutral-bg-dark-hover);
  color: var(--btn-neutral-text-dark);
  text-decoration: none;
}
.btn.btn-primary,
a.btn.btn-primary,
a.btn.btn-primary:visited,
button.btn.btn-primary,
input.btn.btn-primary,
input[type="submit"].btn.btn-primary {
  color: var(--btn-primary-text);
  border-color: rgba(0, 97, 44, 0.24);
  background: linear-gradient(180deg, var(--btn-primary-start) 0%, var(--btn-primary-end) 100%);
  box-shadow: 0 12px 24px rgba(0, 97, 44, 0.24);
}
.btn.btn-primary:hover,
a.btn.btn-primary:hover,
button.btn.btn-primary:hover,
input.btn.btn-primary:hover,
input[type="submit"].btn.btn-primary:hover {
  color: var(--btn-primary-text);
  background: linear-gradient(180deg, #66b957 0%, #006d32 100%);
}
.btn.btn-secondary,
a.btn.btn-secondary,
a.btn.btn-secondary:visited,
button.btn.btn-secondary,
input.btn.btn-secondary,
input[type="submit"].btn.btn-secondary {
  color: var(--btn-secondary-text);
  border-color: rgba(175, 137, 11, 0.26);
  background: linear-gradient(180deg, var(--btn-secondary-start) 0%, var(--btn-secondary-end) 100%);
  box-shadow: 0 12px 24px rgba(227, 188, 34, 0.18);
}
.btn.btn-secondary:hover,
a.btn.btn-secondary:hover,
button.btn.btn-secondary:hover,
input.btn.btn-secondary:hover,
input[type="submit"].btn.btn-secondary:hover {
  color: var(--btn-secondary-text);
  background: linear-gradient(180deg, #f4d761 0%, #e0b61f 100%);
}
.btn.btn-danger,
a.btn.btn-danger,
a.btn.btn-danger:visited,
button.btn.btn-danger,
input.btn.btn-danger,
input[type="submit"].btn.btn-danger {
  color: #ffe8e8;
  border-color: rgba(232,124,124,.32);
  background: var(--btn-danger-bg-dark);
}
.btn[disabled],
button.btn[disabled],
input.btn[disabled],
input[type="submit"].btn[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}
.hero .btn:not(.btn-primary):not(.btn-secondary):not(.btn-danger) {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.14);
}
.hero .btn:not(.btn-primary):not(.btn-secondary):not(.btn-danger):hover {
  background: rgba(255,255,255,0.18);
}

html[data-theme="light"] .btn,
html[data-theme="light"] a.btn,
html[data-theme="light"] a.btn:visited,
html[data-theme="light"] button.btn,
html[data-theme="light"] input.btn,
html[data-theme="light"] input[type="submit"].btn,
html[data-theme="light"] input[type="button"].btn {
  background: var(--btn-neutral-bg-light);
  color: var(--btn-neutral-text-light);
  border-color: var(--btn-neutral-border-light);
  box-shadow: 0 8px 18px rgba(24, 36, 29, 0.06);
}
html[data-theme="light"] .btn:hover,
html[data-theme="light"] a.btn:hover,
html[data-theme="light"] button.btn:hover,
html[data-theme="light"] input.btn:hover,
html[data-theme="light"] input[type="submit"].btn:hover,
html[data-theme="light"] input[type="button"].btn:hover {
  background: var(--btn-neutral-bg-light-hover);
  color: var(--btn-neutral-text-light);
}
html[data-theme="light"] .btn.btn-primary,
html[data-theme="light"] a.btn.btn-primary,
html[data-theme="light"] a.btn.btn-primary:visited,
html[data-theme="light"] button.btn.btn-primary,
html[data-theme="light"] input.btn.btn-primary,
html[data-theme="light"] input[type="submit"].btn.btn-primary {
  color: #ffffff;
}
html[data-theme="light"] .btn.btn-secondary,
html[data-theme="light"] a.btn.btn-secondary,
html[data-theme="light"] a.btn.btn-secondary:visited,
html[data-theme="light"] button.btn.btn-secondary,
html[data-theme="light"] input.btn.btn-secondary,
html[data-theme="light"] input[type="submit"].btn.btn-secondary {
  color: var(--btn-secondary-text);
}
html[data-theme="light"] .btn.btn-danger,
html[data-theme="light"] a.btn.btn-danger,
html[data-theme="light"] a.btn.btn-danger:visited,
html[data-theme="light"] button.btn.btn-danger,
html[data-theme="light"] input.btn.btn-danger,
html[data-theme="light"] input[type="submit"].btn.btn-danger {
  background: var(--btn-danger-bg-light);
  color: var(--btn-danger-text-light);
  border-color: rgba(174, 51, 51, 0.18);
}
html[data-theme="light"] .hero .btn:not(.btn-primary):not(.btn-secondary):not(.btn-danger) {
  background: rgba(255,255,255,0.78);
  color: #1a2a22;
  border-color: rgba(16, 38, 30, 0.08);
}
html[data-theme="light"] .hero .btn:not(.btn-primary):not(.btn-secondary):not(.btn-danger):hover {
  background: rgba(255,255,255,0.92);
}
html[data-theme="light"] .topbar-actions .btn,
html[data-theme="light"] .sticky-actions .btn,
html[data-theme="light"] .inline-actions .btn {
  color: #18221d;
}
html[data-theme="light"] .hero,
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .quick-links-panel,
html[data-theme="light"] .note-panel,
html[data-theme="light"] .sticky-actions {
  box-shadow: 0 12px 28px rgba(24,36,29,0.06);
}
html[data-theme="light"] .badge,
html[data-theme="light"] .pill,
html[data-theme="light"] .hero-highlights .pill {
  color: #1d2a24;
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .form-input {
  color: #18221d;
  background: #ffffff;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #73827b;
}
html[data-theme="light"] select option {
  color: #18221d;
  background: #ffffff;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-input {
  color: #f5f7f6;
}
html[data-theme="dark"] select option {
  color: #18221d;
  background: #ffffff;
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.pagination-info {
  font-size: 0.82rem;
  color: var(--muted);
}
.pagination-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.pagination-controls .btn.is-active {
  background: var(--accent);
  color: var(--white);
  cursor: default;
  pointer-events: none;
}

/* ── Global Search ──────────────────────────────────────── */
.search-wrap {
  position: relative;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  pointer-events: none;
  flex-shrink: 0;
}
.search-input {
  width: 220px;
  padding: 8px 12px 8px 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 13px;
  transition: width 0.2s ease, border-color 0.15s, background 0.15s;
}
.search-input:focus {
  outline: none;
  width: 280px;
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.07);
}
.search-input::placeholder { color: var(--muted-2); }
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 300px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel-strong);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  z-index: 9999;
  overflow: hidden;
}
.search-dropdown.is-open { display: block; }
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  text-decoration: none;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover,
.search-result.is-focused {
  background: rgba(84,165,71,0.12);
  color: var(--white);
}
.search-result-type {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(255,255,255,0.07);
  color: var(--muted);
}
.search-result-type.type-client  { background: rgba(84,165,71,0.18);  color: var(--accent); }
.search-result-type.type-invoice { background: rgba(227,188,34,0.16); color: var(--accent-gold); }
.search-result-type.type-sale    { background: rgba(111,209,150,0.14);color: var(--success); }
.search-result-type.type-project { background: rgba(255,255,255,0.08);color: var(--muted); }
.search-result-type.type-product { background: rgba(232,124,124,0.12);color: var(--danger); }
.search-empty {
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
html[data-theme="light"] .search-input {
  background: rgba(0,0,0,0.04);
  color: #18221d;
  border-color: rgba(16,38,30,0.14);
}
html[data-theme="light"] .search-input:focus {
  background: #fff;
  border-color: var(--accent);
}
html[data-theme="light"] .search-dropdown {
  background: #fff;
  border-color: rgba(16,38,30,0.12);
}
html[data-theme="light"] .search-result { color: #18221d; border-color: rgba(0,0,0,0.06); }
html[data-theme="light"] .search-result:hover { background: rgba(84,165,71,0.09); color: #0d1f15; }

/* ── Flash message dismiss & auto-fade ──────────────────── */
.messages { position: relative; }
.message {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  animation: msg-in 0.22s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.message.is-fading {
  transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.35s ease, padding 0.35s ease, margin 0.35s ease;
  opacity: 0;
  transform: translateY(-4px);
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  overflow: hidden;
}
.message-body { flex: 1; min-width: 0; }
.message-close {
  flex-shrink: 0;
  padding: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.message-close:hover { background: rgba(255,255,255,0.16); color: var(--white); }
html[data-theme="light"] .message-close { background: rgba(0,0,0,0.07); color: #18221d; }
html[data-theme="light"] .message-close:hover { background: rgba(0,0,0,0.14); }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--muted-2);
}
.breadcrumb a {
  color: var(--muted);
  transition: color 0.12s;
}
.breadcrumb a:hover { color: var(--white); }
.breadcrumb-sep {
  color: var(--muted-2);
  opacity: 0.5;
  user-select: none;
}
.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}
html[data-theme="light"] .breadcrumb a { color: #4a6458; }
html[data-theme="light"] .breadcrumb a:hover { color: #18221d; }
html[data-theme="light"] .breadcrumb-current { color: #18221d; }

/* ── Currency display ───────────────────────────────────── */
.currency { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.currency::before { content: "Rs. "; font-size: 0.78em; opacity: 0.72; }

/* ── Logout button distinct style ──────────────────────── */
.btn-logout {
  background: rgba(232,124,124,0.10);
  border-color: rgba(232,124,124,0.22);
  color: var(--danger);
}
.btn-logout:hover {
  background: rgba(232,124,124,0.20);
  border-color: rgba(232,124,124,0.38);
  color: #f5a0a0;
}
html[data-theme="light"] .btn-logout { color: #c0392b; background: rgba(192,57,43,0.07); border-color: rgba(192,57,43,0.18); }
html[data-theme="light"] .btn-logout:hover { background: rgba(192,57,43,0.14); }

/* ── Logged-in user chip in topbar ─────────────────────── */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.user-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
html[data-theme="light"] .user-chip { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: #4a6458; }

/* ── Utility colour classes ─────────────────────────────── */
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted   { color: var(--muted); }
.text-gold    { color: var(--accent-gold); }

/* ── Dashboard quick actions ────────────────────────────── */
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

/* ── App footer — minimal ───────────────────────────────── */
.app-footer {
  margin-top: 40px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.03em;
}

/* ── Login brand credit line ────────────────────────────── */
.login-brand-credit {
  font-size: 11px;
  color: rgba(245,247,246,0.4);
  letter-spacing: 0.04em;
}

/* POS quick sell refresh */
.pos-sale-shell {
  display: grid;
  gap: 18px;
}
.pos-catalog-card {
  overflow: hidden;
}
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}
.category-filter .pill {
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}
.category-filter .pill span {
  color: var(--muted-2);
  font-size: 12px;
}
.category-filter .pill.is-active {
  background: linear-gradient(135deg, rgba(84,165,71,0.28), rgba(0,97,44,0.30));
  border-color: rgba(227,188,34,0.24);
}
.pos-category-groups {
  display: grid;
  gap: 14px;
}
.pos-category-group {
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
}
.pos-category-group.compact {
  padding: 12px;
}
.pos-category-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}
.pos-category-head h4 {
  margin: 0;
  font-size: 16px;
}
.pos-category-head span {
  color: var(--muted-2);
  font-size: 12px;
}
.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.pos-product-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.pos-product-chip {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.pos-product-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(227,188,34,0.24);
  background: linear-gradient(180deg, rgba(84,165,71,0.12), rgba(255,255,255,0.03));
  text-decoration: none;
}
.pos-product-chip strong {
  font-size: 14px;
}
.pos-product-chip span {
  color: var(--muted);
  font-size: 12px;
}
.pos-sale-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.sale-lines-header {
  align-items: center;
}
.sale-line-row {
  grid-template-columns: minmax(180px, 1.15fr) minmax(180px, 1.2fr) minmax(110px, 0.65fr) minmax(130px, 0.8fr) minmax(120px, 0.8fr) 86px;
  align-items: start;
}
.sale-line-row .form-hint {
  margin-top: 6px;
}
.sale-line-row.is-marked-delete {
  opacity: 0.55;
}
.compact-empty {
  min-height: 0;
}
html[data-theme="light"] .pos-category-group {
  background: rgba(255,255,255,0.72);
  border-color: rgba(23, 37, 32, 0.10);
}
html[data-theme="light"] .pos-product-chip {
  border-color: rgba(23,37,32,0.10);
  background: linear-gradient(180deg, rgba(247,249,247,0.98), rgba(239,244,241,0.96));
  color: #13211b;
}
html[data-theme="light"] .pos-product-chip span,
html[data-theme="light"] .category-filter .pill span,
html[data-theme="light"] .pos-category-head span {
  color: #4e6257;
}
html[data-theme="light"] .category-filter .pill {
  background: rgba(244,247,245,0.96);
  border-color: rgba(23, 37, 32, 0.10);
  color: #13211b;
}
html[data-theme="light"] .category-filter .pill.is-active {
  background: linear-gradient(135deg, rgba(84,165,71,0.16), rgba(227,188,34,0.18));
  border-color: rgba(0,97,44,0.20);
}
@media (max-width: 1100px) {
  .pos-sale-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sale-line-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .pos-product-grid,
  .pos-product-grid.compact,
  .pos-sale-grid,
  .sale-line-row {
    grid-template-columns: 1fr;
  }
}


/* === v1.3 accessibility and chrome polish === */
html[data-theme="dark"] {
  --text: #f4f7f5;
  --muted: #c6d0ca;
  --muted-2: #96a89e;
  --border: rgba(255,255,255,0.10);
  --button-text: #f4f7f5;
  --input-bg: rgba(255,255,255,0.065);
  --input-bg-focus: rgba(255,255,255,0.09);
}

html[data-theme="light"] {
  --text: #17211c;
  --muted: #52625b;
  --muted-2: #6c7b73;
  --border: rgba(17, 36, 28, 0.12);
  --sidebar-border: rgba(17, 36, 28, 0.10);
  --button-text: #17211c;
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
}

html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="dark"],
html[data-theme="dark"] body {
  color: var(--text);
}

.brand-wordmark-name,
.partner-copy strong,
.developer-copy strong,
.app-footer strong,
.sidebar-footer strong,
.card-header h3,
.row-title strong,
.topbar h1,
.hero h2,
.metric-card strong,
.stat-card .value {
  color: var(--text);
}

.brand-wordmark-sub,
.partner-copy span,
.developer-copy span,
.sidebar-footer span,
.app-footer,
.subtle,
.card-header p,
.form-hint,
.metric-label,
.nav-title,
th,
.detail-grid dt,
.form-group label,
.note-panel span,
.empty-state span {
  color: var(--muted);
}

.btn,
a.btn,
a.btn:visited,
button.btn,
input.btn,
input[type="submit"].btn,
input[type="button"].btn {
  color: var(--button-text) !important;
}

.btn.btn-primary,
a.btn.btn-primary,
a.btn.btn-primary:visited,
button.btn.btn-primary,
input.btn.btn-primary,
input[type="submit"].btn.btn-primary {
  color: #ffffff !important;
}

.btn.btn-secondary,
a.btn.btn-secondary,
a.btn.btn-secondary:visited,
button.btn.btn-secondary,
input.btn.btn-secondary,
input[type="submit"].btn.btn-secondary {
  color: #201d12 !important;
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .nav-group,
html[data-theme="light"] .sidebar-footer,
html[data-theme="light"] .page-kicker,
html[data-theme="light"] .page-meta,
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .quick-links-panel,
html[data-theme="light"] .note-panel,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .sticky-actions,
html[data-theme="light"] .app-footer .developer {
  box-shadow: 0 10px 24px rgba(21, 36, 29, 0.05);
}

html[data-theme="light"] .nav a,
html[data-theme="light"] .user-chip,
html[data-theme="light"] .badge,
html[data-theme="light"] .pill,
html[data-theme="light"] .hero-highlights .pill {
  color: var(--text);
}

html[data-theme="light"] .hero p,
html[data-theme="light"] .hero .pill,
html[data-theme="light"] .hero-highlights .pill {
  color: #33463d;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .form-input {
  color: var(--text);
  caret-color: var(--text);
}

html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark"] .app-footer,
html[data-theme="dark"] .partner-copy span,
html[data-theme="dark"] .developer-copy span {
  color: var(--muted);
}

.partner-mark,
.app-footer .developer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.partner-mark img,
.app-footer .developer img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.partner-copy,
.developer-copy {
  display: grid;
  gap: 1px;
  line-height: 1.25;
}

.partner-copy strong,
.developer-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.partner-copy span,
.developer-copy span {
  font-size: 11px;
}

.sidebar-footer {
  padding: 10px 12px;
}

.sidebar-toggle {
  display: none;
}

@media (min-width: 1181px) {
  .sidebar-toggle {
    display: none !important;
  }
}

@media (max-width: 1180px) {
  .sidebar-toggle {
    display: inline-flex !important;
  }
}


/* === v1.4 POS workflow refresh === */
.pos-catalog-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.catalog-search {
  max-width: 420px;
}
.pos-search-empty {
  margin-top: 12px;
}
.pos-sale-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}
.pos-sale-main,
.pos-sale-sidebar {
  display: grid;
  gap: 18px;
}
.pos-sale-sidebar {
  position: sticky;
  top: 24px;
}
.sale-line-row {
  position: relative;
  grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1.2fr) minmax(110px, 0.65fr) minmax(130px, 0.8fr) minmax(120px, 0.8fr);
  padding-top: 52px;
}
.sale-line-tools {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sale-line-index {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.sale-line-remove {
  min-width: 110px;
}
.sale-line-row.is-marked-delete {
  opacity: 0.72;
  border-style: dashed;
}
.sale-line-row.is-marked-delete .form-group {
  pointer-events: none;
}
.sale-line-row.is-marked-delete::after {
  content: 'Item marked for removal';
  position: absolute;
  right: 140px;
  top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.summary-metric {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.summary-metric span,
.summary-tender-grid span,
.summary-line-copy span,
.summary-shift-note span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.summary-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}
.summary-metric.emphasis {
  background: linear-gradient(135deg, rgba(84,165,71,0.16), rgba(0,97,44,0.16));
  border-color: rgba(227,188,34,0.18);
}
.summary-list {
  display: grid;
  gap: 10px;
}
.summary-line-item,
.summary-tenders,
.summary-shift-note {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.summary-line-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.summary-line-copy {
  min-width: 0;
}
.summary-line-copy strong,
.summary-line-total {
  display: block;
  color: var(--text);
}
.summary-line-copy strong {
  margin-bottom: 4px;
}
.summary-line-total {
  white-space: nowrap;
}
.summary-tenders-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.summary-tenders-head span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.summary-tender-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.summary-tender-grid > div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.04);
}
.summary-tender-grid strong,
.summary-shift-note strong {
  display: block;
  margin-top: 4px;
}
html[data-theme="light"] .summary-metric,
html[data-theme="light"] .summary-line-item,
html[data-theme="light"] .summary-tenders,
html[data-theme="light"] .summary-shift-note {
  background: rgba(255,255,255,0.82);
  border-color: rgba(17, 36, 28, 0.12);
}
html[data-theme="light"] .summary-tender-grid > div {
  background: rgba(244,247,245,0.92);
  border-color: rgba(17, 36, 28, 0.08);
}
@media (max-width: 1200px) {
  .pos-sale-layout {
    grid-template-columns: 1fr;
  }
  .pos-sale-sidebar {
    position: static;
  }
}
@media (max-width: 900px) {
  .summary-metrics,
  .summary-tender-grid,
  .sale-line-row,
  .pos-sale-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .summary-metrics,
  .summary-tender-grid,
  .sale-line-row,
  .pos-sale-grid,
  .pos-product-grid,
  .pos-product-grid.compact {
    grid-template-columns: 1fr;
  }
  .sale-line-row {
    padding-top: 70px;
  }
  .sale-line-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .sale-line-row.is-marked-delete::after {
    position: static;
    display: block;
    margin-bottom: 8px;
  }
}


/* === v1.6 customer intake + light theme contrast pass === */
.customer-intake-card {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
}
.customer-intake-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}
.customer-intake-head h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--text);
}
.customer-intake-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}
.customer-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.customer-mode-switch .pill {
  cursor: pointer;
}
.customer-mode-switch .pill.is-active {
  background: linear-gradient(135deg, rgba(84,165,71,0.28), rgba(0,97,44,0.30));
  border-color: rgba(227,188,34,0.24);
}
.customer-panel {
  display: grid;
  gap: 12px;
}
.customer-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}
.customer-grid-new {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.customer-match-list {
  display: grid;
  gap: 10px;
}
.customer-match-card,
.customer-selected,
.customer-match-empty {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.customer-match-card {
  display: grid;
  gap: 4px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.customer-match-card strong,
.customer-selected strong {
  color: var(--text);
  font-size: 14px;
}
.customer-match-card span,
.customer-selected span,
.customer-match-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.customer-match-card.is-selected {
  border-color: rgba(227,188,34,0.26);
  background: linear-gradient(135deg, rgba(84,165,71,0.14), rgba(0,97,44,0.12));
}
.customer-selected {
  display: grid;
  gap: 4px;
}
.compact-note {
  margin: 0;
}
.pos-notes-field {
  grid-column: span 2;
}
option { color: #111; }
html[data-theme="dark"] option { color: #111; }
html[data-theme="light"] {
  --text: #152019;
  --muted: #44554d;
  --muted-2: #5a6b62;
  --button-text: #152019;
  --border: rgba(15, 32, 24, 0.14);
  --sidebar-border: rgba(15, 32, 24, 0.12);
  --table-head: #e8eeea;
  --table-row-hover: rgba(84,165,71,0.055);
}
html[data-theme="light"] .main,
html[data-theme="light"] .main-shell,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .nav-group,
html[data-theme="light"] .page-kicker,
html[data-theme="light"] .page-meta,
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .note-panel,
html[data-theme="light"] .quick-links-panel,
html[data-theme="light"] .message,
html[data-theme="light"] .line-item-row,
html[data-theme="light"] .summary-metric,
html[data-theme="light"] .summary-line-item,
html[data-theme="light"] .summary-tenders,
html[data-theme="light"] .summary-shift-note,
html[data-theme="light"] .customer-intake-card,
html[data-theme="light"] .customer-match-card,
html[data-theme="light"] .customer-selected,
html[data-theme="light"] .customer-match-empty,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .badge,
html[data-theme="light"] .pill {
  color: var(--text);
}
html[data-theme="light"] .brand-wordmark-name,
html[data-theme="light"] .partner-copy strong,
html[data-theme="light"] .developer-copy strong,
html[data-theme="light"] .app-footer,
html[data-theme="light"] .app-footer strong,
html[data-theme="light"] .nav a,
html[data-theme="light"] .row-title strong,
html[data-theme="light"] .summary-line-total,
html[data-theme="light"] .summary-metric strong,
html[data-theme="light"] .summary-tender-grid strong,
html[data-theme="light"] .summary-shift-note strong,
html[data-theme="light"] .customer-intake-head h4,
html[data-theme="light"] .customer-match-card strong,
html[data-theme="light"] .customer-selected strong,
html[data-theme="light"] .topbar h1,
html[data-theme="light"] .card-header h3 {
  color: var(--text) !important;
}
html[data-theme="light"] .subtle,
html[data-theme="light"] .form-hint,
html[data-theme="light"] .nav-title,
html[data-theme="light"] .sidebar-footer span,
html[data-theme="light"] .partner-copy span,
html[data-theme="light"] .developer-copy span,
html[data-theme="light"] .customer-intake-head p,
html[data-theme="light"] .customer-match-card span,
html[data-theme="light"] .customer-selected span,
html[data-theme="light"] .customer-match-empty,
html[data-theme="light"] .summary-line-copy span,
html[data-theme="light"] .summary-tender-grid span,
html[data-theme="light"] .summary-metric span,
html[data-theme="light"] .summary-shift-note span,
html[data-theme="light"] .card-header p,
html[data-theme="light"] th,
html[data-theme="light"] .form-group label {
  color: var(--muted) !important;
}
html[data-theme="light"] .search-input-wrap,
html[data-theme="light"] .search-dropdown,
html[data-theme="light"] .search-result,
html[data-theme="light"] .search-empty {
  color: var(--text);
}
html[data-theme="light"] .search-input-wrap svg,
html[data-theme="light"] .message-close,
html[data-theme="light"] .nav a::after {
  color: var(--muted-2);
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .form-input,
html[data-theme="light"] .search-input {
  color: var(--text) !important;
  background: #ffffff;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder,
html[data-theme="light"] .search-input::placeholder {
  color: #73837b;
}
html[data-theme="light"] .btn,
html[data-theme="light"] a.btn,
html[data-theme="light"] a.btn:visited,
html[data-theme="light"] button.btn {
  color: var(--button-text) !important;
  background: #ffffff;
  border-color: rgba(15, 32, 24, 0.12);
}
html[data-theme="light"] .btn:hover,
html[data-theme="light"] a.btn:hover {
  color: var(--button-text) !important;
  background: #f2f6f2;
}
html[data-theme="light"] .btn-primary,
html[data-theme="light"] a.btn-primary,
html[data-theme="light"] a.btn-primary:visited,
html[data-theme="light"] button.btn-primary {
  color: #ffffff !important;
}
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] a.btn-secondary,
html[data-theme="light"] a.btn-secondary:visited,
html[data-theme="light"] button.btn-secondary {
  color: #1f1a0d !important;
}
html[data-theme="light"] .customer-intake-card,
html[data-theme="light"] .customer-match-card,
html[data-theme="light"] .customer-selected,
html[data-theme="light"] .customer-match-empty {
  background: rgba(255,255,255,0.88);
  border-color: rgba(15, 32, 24, 0.10);
}
html[data-theme="light"] .customer-mode-switch .pill,
html[data-theme="light"] .category-filter .pill {
  background: #f7faf6;
  border-color: rgba(15, 32, 24, 0.10);
}
html[data-theme="light"] .customer-mode-switch .pill.is-active,
html[data-theme="light"] .category-filter .pill.is-active,
html[data-theme="light"] .customer-match-card.is-selected {
  background: linear-gradient(135deg, rgba(84,165,71,0.16), rgba(227,188,34,0.18));
  border-color: rgba(0,97,44,0.18);
}
@media (max-width: 960px) {
  .customer-grid,
  .customer-grid-new {
    grid-template-columns: 1fr;
  }
  .pos-notes-field {
    grid-column: auto;
  }
}


/* === v1.7 POS workbench + light button contrast === */
:root {
  --btn-neutral-bg-light: #edf3ee;
  --btn-neutral-bg-light-hover: #e3ebe5;
  --btn-neutral-border-light: rgba(18, 39, 30, 0.18);
  --btn-neutral-text-light: #112019;
}

.pos-sale-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 2.05fr);
  gap: 20px;
  align-items: start;
}

.pos-catalog-card {
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
}

.pos-sale-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.pos-sale-main > .card,
.pos-sale-sidebar {
  min-width: 0;
}

.pos-sale-sidebar {
  top: 22px;
}

.pos-category-groups {
  gap: 12px;
}

.pos-product-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.pos-product-chip {
  min-height: 94px;
}

.customer-intake-card {
  margin-bottom: 22px;
}

.customer-match-list {
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.customer-selected {
  background: linear-gradient(135deg, rgba(84,165,71,0.12), rgba(0,97,44,0.08));
}

.sale-lines-header {
  align-items: center;
  gap: 14px;
}

.sale-line-row {
  gap: 12px;
}

.sale-line-row .form-group {
  min-width: 0;
}

.summary-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.summary-line-copy strong {
  word-break: break-word;
}

html[data-theme="light"] .btn,
html[data-theme="light"] a.btn,
html[data-theme="light"] a.btn:visited,
html[data-theme="light"] button.btn,
html[data-theme="light"] input.btn,
html[data-theme="light"] input[type="submit"].btn,
html[data-theme="light"] input[type="button"].btn {
  background: var(--btn-neutral-bg-light) !important;
  color: var(--btn-neutral-text-light) !important;
  border-color: var(--btn-neutral-border-light) !important;
}

html[data-theme="light"] .btn:hover,
html[data-theme="light"] a.btn:hover,
html[data-theme="light"] button.btn:hover,
html[data-theme="light"] input.btn:hover,
html[data-theme="light"] input[type="submit"].btn:hover,
html[data-theme="light"] input[type="button"].btn:hover {
  background: var(--btn-neutral-bg-light-hover) !important;
  color: var(--btn-neutral-text-light) !important;
}

html[data-theme="light"] .btn.btn-primary,
html[data-theme="light"] a.btn.btn-primary,
html[data-theme="light"] a.btn.btn-primary:visited,
html[data-theme="light"] button.btn.btn-primary,
html[data-theme="light"] input.btn.btn-primary,
html[data-theme="light"] input[type="submit"].btn.btn-primary {
  background: linear-gradient(180deg, #58ad4a 0%, #00612c 100%) !important;
  color: #ffffff !important;
  border-color: rgba(0, 97, 44, 0.26) !important;
}

html[data-theme="light"] .btn.btn-secondary,
html[data-theme="light"] a.btn.btn-secondary,
html[data-theme="light"] button.btn.btn-secondary {
  background: linear-gradient(180deg, #f4d45c 0%, #ddb116 100%) !important;
  color: #1f1a0d !important;
}

html[data-theme="light"] .quick-links-panel .btn,
html[data-theme="light"] .sale-lines-header .btn,
html[data-theme="light"] .sale-line-tools .btn,
html[data-theme="light"] .topbar-actions .btn,
html[data-theme="light"] .form-actions .btn {
  color: #112019 !important;
}

html[data-theme="light"] .quick-links-panel .btn.btn-primary,
html[data-theme="light"] .sale-lines-header .btn.btn-primary,
html[data-theme="light"] .sale-line-tools .btn.btn-primary,
html[data-theme="light"] .topbar-actions .btn.btn-primary,
html[data-theme="light"] .form-actions .btn.btn-primary {
  color: #ffffff !important;
}

html[data-theme="light"] .customer-mode-switch .pill,
html[data-theme="light"] .category-filter .pill {
  background: #eef4ef;
  color: #112019;
  border-color: rgba(18, 39, 30, 0.14);
}

html[data-theme="light"] .pos-product-chip {
  background: linear-gradient(180deg, #f8fbf8 0%, #edf3ee 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

html[data-theme="light"] .customer-selected,
html[data-theme="light"] .summary-metric.emphasis {
  background: linear-gradient(135deg, rgba(84,165,71,0.12), rgba(227,188,34,0.14));
}

@media (max-width: 1480px) {
  .pos-sale-shell {
    grid-template-columns: 1fr;
  }

  .pos-catalog-card {
    position: static;
    order: 2;
    max-height: none;
  }

  .pos-sale-layout {
    order: 1;
  }
}

@media (max-width: 1120px) {
  .pos-sale-layout {
    grid-template-columns: 1fr;
  }

  .pos-sale-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 760px) {
  .pos-sale-shell,
  .pos-sale-layout {
    gap: 16px;
  }

  .pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  }

  .summary-list,
  .customer-match-list,
  .pos-catalog-card {
    max-height: none;
  }
}

/* Document editor refresh (invoices + bills) */
.document-editor-card {
  display: grid;
  gap: 18px;
}
.document-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.document-form-grid-span-2 {
  grid-column: span 2;
}
.document-advanced-panel {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
  overflow: hidden;
}
.document-advanced-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text);
}
.document-advanced-panel summary::-webkit-details-marker {
  display: none;
}
.document-advanced-panel[open] summary {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.document-advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}
.document-checkbox-panel {
  justify-content: center;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
}
.document-items-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}
.document-items-toolbar h3 {
  margin: 0 0 3px;
}
.document-items-toolbar p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
  font-size: 13px;
}
.document-items-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.document-summary-pill {
  min-width: 110px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.document-summary-pill span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 3px;
}
.document-summary-pill strong {
  font-size: 16px;
}
.document-line-items {
  gap: 14px;
}
.document-line-item-row {
  gap: 14px;
}
.document-line-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 2px;
}
.document-line-item-head strong {
  display: block;
  margin-bottom: 3px;
}
.document-line-item-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 0.7fr 0.8fr 0.8fr;
  gap: 12px;
  align-items: end;
}
.document-line-item-total {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.document-line-item-total span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.document-line-item-total strong {
  font-size: 18px;
}
.document-line-item-row.is-removed {
  opacity: 0.55;
  border-style: dashed;
}
.document-line-item-row.is-removed .document-line-item-grid,
.document-line-item-row.is-removed .document-line-item-head > div .subtle {
  filter: grayscale(0.25);
}
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1200px) {
  .document-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .document-advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .document-line-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .document-line-item-total,
  .document-form-grid-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .document-form-grid,
  .document-advanced-grid,
  .document-line-item-grid {
    grid-template-columns: 1fr;
  }
  .document-items-toolbar,
  .document-line-item-head {
    flex-direction: column;
    align-items: stretch;
  }
  .document-items-toolbar-actions {
    width: 100%;
  }
  .document-summary-pill {
    min-width: 0;
    flex: 1 1 150px;
  }
}

html[data-theme="light"] .document-advanced-panel,
html[data-theme="light"] .document-summary-pill,
html[data-theme="light"] .document-line-item-total,
html[data-theme="light"] .document-checkbox-panel {
  background: #ffffff;
  border-color: rgba(24, 37, 29, 0.1);
}
html[data-theme="light"] .document-advanced-panel summary,
html[data-theme="light"] .document-items-toolbar h3,
html[data-theme="light"] .document-line-item-head strong,
html[data-theme="light"] .document-summary-pill strong,
html[data-theme="light"] .document-line-item-total strong {
  color: #18231d;
}
html[data-theme="light"] .document-items-toolbar p,
html[data-theme="light"] .document-line-item-head .subtle,
html[data-theme="light"] .document-summary-pill span,
html[data-theme="light"] .document-line-item-total span {
  color: #55655d;
}
html[data-theme="light"] .btn,
html[data-theme="light"] a.btn,
html[data-theme="light"] a.btn:visited,
html[data-theme="light"] button.btn,
html[data-theme="light"] input.btn,
html[data-theme="light"] input[type="submit"].btn,
html[data-theme="light"] input[type="button"].btn {
  background: #f8fbf8;
  color: #18221d;
  border-color: rgba(24, 39, 30, 0.14);
}
html[data-theme="light"] .btn:hover,
html[data-theme="light"] a.btn:hover,
html[data-theme="light"] button.btn:hover,
html[data-theme="light"] input.btn:hover,
html[data-theme="light"] input[type="submit"].btn:hover,
html[data-theme="light"] input[type="button"].btn:hover {
  background: #eef4ef;
  color: #18221d;
}
html[data-theme="light"] .btn.btn-primary,
html[data-theme="light"] a.btn.btn-primary,
html[data-theme="light"] a.btn.btn-primary:visited,
html[data-theme="light"] button.btn.btn-primary,
html[data-theme="light"] input.btn.btn-primary,
html[data-theme="light"] input[type="submit"].btn.btn-primary {
  color: #ffffff;
}

/* === v2.0 POS customer-first flow === */
.pos-workbench {
  display: grid;
  gap: 18px;
}

.pos-flow-card,
.pos-browser-card,
.pos-summary-card,
.pos-cart-card,
.pos-customer-card,
.checkout-drawer {
  min-width: 0;
}

.pos-flow-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.pos-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pos-flow-steps .pill {
  cursor: pointer;
}

.pos-workbench-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.pos-browser-card,
.pos-summary-card {
  position: sticky;
  top: 24px;
}

.pos-workbench-main {
  display: grid;
  gap: 18px;
}

.compact-header {
  align-items: center;
}

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

.visually-hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.compact-quick-links {
  margin-top: 14px;
}

.pos-product-chip {
  min-height: 108px;
}

.pos-product-chip small {
  color: var(--muted-2);
  font-size: 11px;
}

.pos-step-actions {
  margin-top: 14px;
}

.sale-line-row {
  grid-template-columns: minmax(170px, 1.05fr) minmax(170px, 1.1fr) minmax(150px, 0.9fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(120px, 0.7fr);
  padding-top: 52px;
}

.qty-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
}

.qty-stepper input {
  text-align: center;
}

.qty-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.sale-line-total {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 100%;
}

.sale-line-total span {
  color: var(--muted);
  font-size: 12px;
}

.sale-line-total strong {
  font-size: 1rem;
}

.pos-summary-card .compact-summary {
  margin-bottom: 14px;
}

.summary-change-row {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.pos-summary-actions {
  display: grid;
  gap: 10px;
}

.checkout-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 35;
}

.checkout-drawer {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(560px, calc(100vw - 28px));
  z-index: 40;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
}

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

.checkout-notes-field {
  grid-column: 1 / -1;
}

.checkout-advanced {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
}

.checkout-advanced summary {
  cursor: pointer;
  font-weight: 700;
}

.checkout-advanced[open] summary {
  margin-bottom: 14px;
}

.checkout-actions {
  position: sticky;
  bottom: 0;
  background: inherit;
}

html[data-theme="light"] .checkout-drawer,
html[data-theme="light"] .checkout-advanced,
html[data-theme="light"] .pos-flow-card {
  background: rgba(255,255,255,0.98);
}

@media (max-width: 1380px) {
  .pos-workbench-layout {
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.4fr);
  }

  .pos-summary-card {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 1120px) {
  .pos-workbench-layout {
    grid-template-columns: 1fr;
  }

  .pos-browser-card,
  .pos-summary-card {
    position: static;
  }

  .compact-grid,
  .checkout-grid,
  .sale-line-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sale-line-total {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .pos-flow-card {
    display: grid;
  }

  .compact-grid,
  .checkout-grid,
  .sale-line-row {
    grid-template-columns: 1fr;
  }

  .qty-stepper {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }

  .checkout-drawer {
    left: 10px;
    right: 10px;
    top: 10px;
    bottom: 10px;
    width: auto;
  }
}

/* === v2.1 POS refinement pass === */
.pos-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.pos-home-side {
  display: grid;
  gap: 18px;
  align-items: start;
}

.pos-home-browser {
  top: 24px;
}

.pos-home-card {
  display: grid;
  gap: 14px;
}

.pos-home-highlight {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(84,165,71,0.13), rgba(0,97,44,0.08));
}

.pos-home-highlight.warn {
  background: linear-gradient(135deg, rgba(227,188,34,0.12), rgba(227,188,34,0.05));
}

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

.pos-home-list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-1) 68%, transparent);
}

.pos-home-list-item > div {
  display: grid;
  gap: 2px;
}

.pos-home-list-item span {
  color: var(--muted);
  font-size: 12px;
}

.pos-product-chip {
  min-height: 84px;
  align-content: start;
}

.pos-product-chip small {
  display: none;
}

.pos-browser-card {
  max-height: calc(100vh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
}

.pos-summary-card {
  max-height: none;
  overflow: visible;
}

.customer-match-list {
  max-height: 180px;
}

.summary-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.customer-selected.compact-summary {
  margin-bottom: 0;
}

.pos-step-actions {
  justify-content: flex-end;
}

.pos-step-actions .btn-primary {
  order: 3;
}

.checkout-drawer {
  width: min(500px, calc(100vw - 28px));
  background: linear-gradient(180deg, rgba(10,17,13,0.985), rgba(10,17,13,0.975));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

.checkout-scrim {
  background: rgba(0, 0, 0, 0.56);
}

.checkout-change-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-1) 62%, transparent);
}

.btn.is-disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

html[data-theme="light"] .pos-home-highlight,
html[data-theme="light"] .pos-home-list-item,
html[data-theme="light"] .checkout-change-row {
  background: rgba(255,255,255,0.98);
}

@media (max-width: 1380px) {
  .pos-home-layout {
    grid-template-columns: 1fr;
  }

  .pos-home-browser {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 1120px) {
  .pos-step-actions {
    justify-content: stretch;
  }

  .pos-step-actions .btn,
  .pos-home-list-item {
    width: 100%;
  }

  .pos-home-list-item {
    align-items: start;
    flex-direction: column;
  }
}

/* === v2.3 POS search, product photos, and price tools === */
.product-row-title {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.product-row-thumb,
.product-spotlight-image,
.detail-media-image,
.pos-product-thumb {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.product-row-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.product-row-thumb-fallback,
.product-spotlight-fallback,
.pos-product-thumb-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted);
  background: linear-gradient(135deg, rgba(84,165,71,0.15), rgba(227,188,34,0.14));
}

.detail-media-card {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.detail-media-image {
  width: 100%;
  max-height: 320px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

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

.product-spotlight-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.product-spotlight-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.product-spotlight-copy {
  display: grid;
  gap: 6px;
}

.product-spotlight-copy span {
  color: var(--muted);
  font-size: 12px;
}

.product-spotlight-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pos-product-chip {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.pos-product-thumb {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.pos-product-copy {
  display: grid;
  gap: 4px;
  text-align: left;
}

.pos-product-copy strong,
.pos-product-copy > span {
  display: block;
}

.pos-browser-card {
  max-height: none;
  overflow: visible;
}

@media (max-width: 1120px) {
  .pos-workbench-layout {
    gap: 14px;
  }

  .pos-summary-card {
    order: -1;
    position: sticky;
    top: 12px;
    z-index: 6;
  }

  .summary-list {
    display: none;
  }

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

  .checkout-drawer {
    inset: 0;
    width: auto;
    border-radius: 0;
    padding-bottom: 96px;
  }

  .checkout-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px;
    border-top: 1px solid var(--border);
    background: inherit;
  }

  .customer-match-list {
    max-height: none;
  }

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

@media (max-width: 820px) {
  .product-row-title {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .product-row-thumb {
    width: 44px;
    height: 44px;
  }

  .pos-product-chip {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .pos-product-thumb {
    width: 56px;
    height: 56px;
  }

  .product-spotlight-grid {
    grid-template-columns: 1fr;
  }

  .product-spotlight-meta {
    align-items: stretch;
    flex-direction: column;
  }
}

html[data-theme="light"] .product-spotlight-card,
html[data-theme="light"] .detail-media-card,
html[data-theme="light"] .product-row-thumb,
html[data-theme="light"] .pos-product-thumb {
  background: rgba(255,255,255,0.98);
}

/* POS rebuild: plant store 3-step flow */
.plant-pos-shell {
  display: grid;
  gap: 18px;
}
.plant-pos-hero,
.plant-pos-steps-card,
.plant-panel-card,
.plant-side-card,
.plant-cart-card {
  border-color: var(--border-strong);
}
.plant-pos-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.plant-pos-hero h3,
.plant-panel-card h3,
.plant-side-card h3 {
  margin: 0 0 6px;
}
.plant-pos-hero p,
.plant-panel-card p,
.plant-side-card p {
  margin: 0;
  color: var(--muted);
}
.plant-pos-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.plant-pos-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.plant-step {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
}
.plant-step span {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
}
.plant-step strong {
  font-size: 15px;
}
.plant-step small {
  color: var(--muted);
}
.plant-step.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(84,165,71,0.18), rgba(84,165,71,0.08));
  box-shadow: inset 0 0 0 1px rgba(84,165,71,0.12);
}
.plant-step.is-complete {
  border-color: rgba(111, 209, 150, 0.28);
}
.plant-pos-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}
.plant-pos-grid-customer,
.plant-pos-grid-checkout {
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.95fr);
}
.plant-pos-grid-products {
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.95fr);
}
.plant-panel-card,
.plant-side-card,
.plant-cart-card {
  display: grid;
  gap: 16px;
}
.plant-customer-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.two-col-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.three-col-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.plant-note-soft {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}
.plant-customer-matches,
.plant-side-list,
.plant-cart-lines,
.plant-checkout-list {
  display: grid;
  gap: 10px;
}
.plant-customer-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
}
.plant-customer-summary strong {
  font-size: 15px;
}
.plant-customer-summary span {
  color: var(--muted);
  font-size: 13px;
}
.plant-side-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.plant-side-item span {
  color: var(--muted);
  font-size: 13px;
}
.plant-side-list-tight .plant-side-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.plant-side-list-tight .plant-side-item span {
  font-weight: 600;
  color: var(--text);
}
.plant-catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 12px;
  align-items: start;
}
.plant-accordion-list {
  display: grid;
  gap: 12px;
}
.plant-category-accordion {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.plant-category-accordion summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
}
.plant-category-accordion summary::-webkit-details-marker {
  display: none;
}
.plant-category-accordion summary strong {
  display: block;
  margin-bottom: 3px;
}
.plant-category-accordion summary small {
  color: var(--muted);
}
.plant-category-accordion[open] {
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.03);
}
.plant-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.plant-product-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  text-align: left;
}
.plant-product-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.plant-product-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255,255,255,0.05);
}
.plant-product-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.plant-product-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.plant-product-copy strong,
.plant-product-copy small,
.plant-product-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plant-product-copy small {
  color: var(--muted-2);
}
.plant-product-copy span {
  color: var(--accent-gold);
  font-weight: 700;
}
.plant-cart-card {
  position: sticky;
  top: 24px;
}
.plant-cart-line {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
}
.plant-cart-line.is-marked-delete {
  opacity: 0.55;
  background: rgba(232,124,124,0.08);
}
.plant-cart-line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.plant-line-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.plant-cart-line-grid {
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(100px, 1fr));
  align-items: start;
}
.plant-cart-product-field {
  display: none;
}
.plant-cart-name-field {
  min-width: 0;
}
.plant-cart-qty-field .form-input {
  text-align: center;
}
.plant-cart-line-total,
.plant-cart-summary,
.plant-checkout-overview,
.plant-checkout-totals {
  display: grid;
  gap: 10px;
}
.plant-cart-line-total,
.plant-checkout-line,
.plant-change-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.plant-cart-line-total span,
.plant-checkout-line span,
.plant-change-row span {
  color: var(--muted);
}
.plant-cart-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 4px;
}
.plant-cart-summary > div,
.plant-checkout-metric,
.plant-checkout-totals > div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.plant-cart-summary span,
.plant-checkout-metric span,
.plant-checkout-totals span {
  color: var(--muted);
  font-size: 13px;
}
.plant-cart-empty-state {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: rgba(255,255,255,0.015);
}
.plant-cart-empty-state.is-prompting {
  border-color: var(--accent-gold);
  box-shadow: inset 0 0 0 1px rgba(227,188,34,0.12);
}
.plant-checkout-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.plant-checkout-metric.emphasis,
.plant-checkout-totals > div.emphasis {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(84,165,71,0.12), rgba(84,165,71,0.05));
}
.plant-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  align-items: start;
}
.plant-checkout-list {
  max-height: 420px;
  overflow: auto;
}
.plant-tender-field {
  transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.plant-tender-field.is-secondary {
  opacity: 0.7;
}
.plant-tender-field.is-active {
  opacity: 1;
}
.plant-advanced-details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.plant-advanced-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.plant-panel-actions {
  justify-content: flex-end;
}
html[data-theme="light"] .plant-step,
html[data-theme="light"] .plant-category-accordion,
html[data-theme="light"] .plant-product-card,
html[data-theme="light"] .plant-cart-line,
html[data-theme="light"] .plant-cart-summary > div,
html[data-theme="light"] .plant-checkout-metric,
html[data-theme="light"] .plant-checkout-totals > div,
html[data-theme="light"] .plant-customer-summary,
html[data-theme="light"] .plant-side-item,
html[data-theme="light"] .plant-note-soft {
  background: rgba(255,255,255,0.86);
}
@media (max-width: 1180px) {
  .plant-pos-grid-customer,
  .plant-pos-grid-products,
  .plant-pos-grid-checkout,
  .plant-checkout-layout,
  .plant-catalog-toolbar {
    grid-template-columns: 1fr;
  }
  .plant-cart-card {
    position: static;
  }
}
@media (max-width: 860px) {
  .plant-pos-hero,
  .plant-step-panel .card-header {
    flex-direction: column;
    align-items: stretch;
  }
  .plant-pos-steps,
  .plant-checkout-overview,
  .plant-cart-summary,
  .three-col-grid,
  .two-col-grid,
  .plant-cart-line-grid {
    grid-template-columns: 1fr;
  }
  .plant-product-grid {
    grid-template-columns: 1fr;
  }
}


.settings-section {
  display: grid;
  gap: 18px;
  padding-top: 4px;
}
.settings-section + .settings-section {
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.settings-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.settings-section-head h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.company-logo-panel {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.company-logo-preview {
  min-height: 180px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
  display: grid;
  place-items: center;
}
.company-logo-preview img {
  max-height: 140px;
  width: auto;
  object-fit: contain;
}
.company-logo-fallback {
  color: var(--muted);
  text-align: center;
}
.settings-checkbox-row {
  align-content: start;
}
.company-settings-note {
  color: var(--muted);
}
@media (max-width: 900px) {
  .company-logo-panel {
    grid-template-columns: 1fr;
  }
}
html[data-theme="light"] .company-logo-preview {
  background: rgba(12, 20, 16, 0.03);
}

/* POS focus pass + login cleanup */
.plant-pos-toolbar,
.plant-pos-steps-card {
  width: min(1160px, 100%);
  margin: 0 auto;
}
.plant-pos-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 2px 0;
}
.plant-pos-toolbar-copy,
.plant-pos-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.plant-pos-toolbar-text {
  color: var(--muted);
  font-size: 14px;
}
.plant-focus-wrap {
  width: min(1160px, 100%);
  margin: 0 auto;
}
.plant-focus-wrap-narrow {
  width: min(980px, 100%);
}
.plant-panel-card-focus,
.plant-product-panel {
  gap: 18px;
}
.plant-task-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.plant-task-chip {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.plant-task-chip span {
  color: var(--muted);
  font-size: 13px;
}
.plant-note-centered {
  display: grid;
  align-content: center;
}
.compact-quick-links-inline {
  display: grid;
  gap: 10px;
}
.plant-product-stage {
  display: grid;
  gap: 14px;
}
.plant-task-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.plant-cart-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.plant-product-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.plant-product-card {
  min-height: 88px;
  align-items: start;
}
.plant-cart-review-shell {
  display: grid;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.plant-cart-summary-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.plant-cart-review {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.plant-cart-review summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 700;
}
.plant-cart-review summary::-webkit-details-marker {
  display: none;
}
.plant-cart-review-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.plant-cart-review-body {
  padding: 0 16px 16px;
  display: grid;
  gap: 12px;
}
.plant-cart-review .plant-cart-lines {
  margin-top: 4px;
}
.plant-pos-grid-checkout {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.72fr);
}
.plant-checkout-layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}
.plant-checkout-list {
  max-height: 320px;
}
.login-shell {
  width: min(980px, 100%);
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 0.85fr);
}
.login-brand {
  padding: 30px;
  gap: 20px;
  background:
    linear-gradient(160deg, rgba(84,165,71,0.16), rgba(18,30,24,0.92) 56%, rgba(9,16,13,0.98) 100%),
    #080f0a;
}
.login-brand::before {
  background:
    radial-gradient(circle at 82% 18%, rgba(84,165,71,0.18), transparent 0 34%),
    radial-gradient(circle at 18% 84%, rgba(227,188,34,0.10), transparent 0 30%);
  opacity: 1;
}
.login-brand-card {
  padding: 9px 12px;
  gap: 9px;
}
.login-brand-card img {
  width: 28px;
  height: 28px;
}
.login-brand h1 {
  font-size: clamp(1.9rem, 2.6vw, 2.45rem);
  max-width: 14ch;
}
.login-brand p {
  max-width: 40ch;
}
.login-brand-points {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.login-brand-points span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(245,247,246,0.9);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.login-brand-credit {
  display: none;
}
html[data-theme="light"] .login-brand {
  background:
    linear-gradient(160deg, rgba(84,165,71,0.14), rgba(250,252,248,0.96) 62%, rgba(242,246,241,0.98) 100%),
    #f7faf6;
}
html[data-theme="light"] .login-brand::before {
  background:
    radial-gradient(circle at 82% 18%, rgba(84,165,71,0.12), transparent 0 34%),
    radial-gradient(circle at 18% 84%, rgba(227,188,34,0.10), transparent 0 28%);
}
html[data-theme="light"] .login-brand p,
html[data-theme="light"] .login-brand .brand-meta,
html[data-theme="light"] .login-brand .page-kicker {
  color: rgba(18,29,23,0.72);
}
html[data-theme="light"] .login-brand-points span {
  background: rgba(255,255,255,0.78);
  border-color: rgba(84,165,71,0.14);
  color: rgba(18,29,23,0.78);
}
@media (max-width: 1180px) {
  .plant-task-strip,
  .plant-pos-grid-checkout,
  .plant-checkout-layout,
  .plant-task-toolbar {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .plant-cart-summary-compact,
  .plant-task-strip,
  .plant-checkout-overview {
    grid-template-columns: 1fr;
  }
  .plant-cart-review summary {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* Invoice refresh */
.document-header-toolbar {
  align-items: flex-start;
}
.document-header-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.document-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 16px;
}
.document-panel {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
  padding: 16px;
  display: grid;
  gap: 14px;
}
.document-panel-head h4 {
  margin: 0 0 4px;
}
.document-panel-head p {
  margin: 0;
  color: var(--muted);
}
.document-form-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.document-items-toolbar-anchored {
  align-items: center;
}
.invoice-editor-shell {
  gap: 16px;
}
.invoice-detail-hero {
  display: grid;
  gap: 18px;
}
.invoice-detail-hero-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.invoice-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.invoice-summary-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.invoice-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
  margin-top: 18px;
}
.invoice-progress-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 14px;
}
.invoice-progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 12px;
}
.invoice-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(84,165,71,0.92), rgba(227,188,34,0.86));
}
.invoice-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.invoice-progress-copy span {
  color: var(--muted);
}
.invoice-side-list {
  display: grid;
  gap: 10px;
}
.invoice-side-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
}
.invoice-side-list span {
  color: var(--muted);
}
.payment-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.payment-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid-span-2 {
  grid-column: span 2;
}
html[data-theme="light"] .document-panel,
html[data-theme="light"] .invoice-progress-card,
html[data-theme="light"] .invoice-side-list div {
  background: #ffffff;
  border-color: rgba(24, 37, 29, 0.1);
}
html[data-theme="light"] .document-panel-head h4,
html[data-theme="light"] .invoice-progress-copy strong,
html[data-theme="light"] .invoice-side-list strong {
  color: #18231d;
}
html[data-theme="light"] .document-panel-head p,
html[data-theme="light"] .invoice-progress-copy span,
html[data-theme="light"] .invoice-side-list span {
  color: #55655d;
}
@media (max-width: 1180px) {
  .document-overview-grid,
  .invoice-detail-layout,
  .invoice-summary-metrics {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .invoice-detail-hero-main,
  .payment-context-grid,
  .payment-form-grid,
  .document-form-grid-compact {
    grid-template-columns: 1fr;
    display: grid;
  }
  .invoice-detail-actions {
    justify-content: flex-start;
  }
}

/* Presenter / rebuilt POS */
.presenter-stepbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.presenter-step {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 12px 16px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}
.presenter-step.is-active {
  border-color: rgba(71, 157, 74, 0.55);
  box-shadow: 0 0 0 1px rgba(71, 157, 74, 0.18) inset;
}
.presenter-page {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: start;
}
.presenter-stack,
.presenter-side-stack {
  display: grid;
  gap: 18px;
}
.presenter-card,
.presenter-toolbar-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.presenter-card-focus {
  padding: 24px;
}
.presenter-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.presenter-card-head.compact {
  margin-bottom: 14px;
}
.presenter-card-head h2,
.presenter-card-head h3 {
  margin: 4px 0 6px;
}
.presenter-card-head p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}
.presenter-customer-pill,
.presenter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 40%);
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}
.presenter-customer-pill.is-selected,
.presenter-badge.is-success {
  border-color: rgba(71, 157, 74, 0.45);
  color: var(--text-strong);
}
.presenter-search-panel,
.presenter-form-grid {
  display: grid;
  gap: 14px;
}
.presenter-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.presenter-form-grid-wide {
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.presenter-form-grid .span-2,
.presenter-form-grid-wide .span-2 {
  grid-column: span 2;
}
.presenter-search-input {
  min-height: 52px;
}
.presenter-search-results,
.presenter-list,
.presenter-line-table {
  display: grid;
  gap: 10px;
}
.presenter-search-result,
.presenter-list-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 30%);
  color: var(--text);
  text-align: left;
}
.presenter-search-result strong,
.presenter-list-row strong,
.presenter-cart-row strong,
.presenter-line-row strong {
  display: block;
}
.presenter-search-result span,
.presenter-list-row span,
.presenter-cart-row span,
.presenter-line-row span,
.presenter-search-empty {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}
.presenter-search-result.is-selected {
  border-color: rgba(71, 157, 74, 0.55);
  box-shadow: 0 0 0 1px rgba(71, 157, 74, 0.18) inset;
}
.presenter-inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.presenter-inline-actions.stretch > * {
  flex: 1 1 180px;
}
.btn-block {
  width: 100%;
  justify-content: center;
}
.btn-ghost {
  background: transparent;
}
.presenter-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.presenter-metric-grid.compact {
  margin-bottom: 14px;
}
.metric {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 24%);
}
.metric span {
  color: var(--muted);
  font-size: 0.9rem;
}
.metric strong {
  color: var(--text-strong);
}
.presenter-credit-box,
.presenter-alert {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.presenter-credit-box span,
.presenter-alert span,
.presenter-alert li {
  color: var(--muted);
}
.presenter-credit-box.is-warning,
.presenter-alert.is-warning {
  border-color: rgba(197, 153, 42, 0.4);
}
.presenter-alert.is-danger {
  border-color: rgba(173, 71, 71, 0.45);
}
.presenter-alert.is-success {
  border-color: rgba(71, 157, 74, 0.45);
}
.presenter-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 240px minmax(0, 0.9fr);
  gap: 14px;
  align-items: end;
}
.presenter-toolbar-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.presenter-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.presenter-product-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 24%);
}
.presenter-product-media {
  width: 112px;
  height: 112px;
  border-radius: 18px;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 44%);
}
.presenter-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.presenter-product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 1.3rem;
}
.presenter-product-body {
  display: grid;
  gap: 10px;
}
.presenter-product-meta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.presenter-product-meta h3 {
  margin: 0 0 4px;
}
.presenter-product-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}
.presenter-product-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.presenter-price {
  display: block;
  font-size: 1.05rem;
  color: var(--text-strong);
  margin-bottom: 4px;
}
.presenter-cart-card.sticky,
.presenter-side-stack .sticky {
  position: sticky;
  top: 18px;
}
.presenter-cart-row,
.presenter-line-row,
.presenter-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.presenter-cart-list.compact .presenter-cart-row,
.presenter-line-row,
.presenter-summary-block {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 24%);
}
.presenter-summary-block {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.presenter-summary-row.grand {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.presenter-line-row {
  align-items: center;
}
.presenter-line-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.presenter-qty-input {
  width: 104px;
}
.presenter-empty-card {
  text-align: center;
}
@media (max-width: 1180px) {
  .presenter-page,
  .presenter-toolbar,
  .presenter-product-grid {
    grid-template-columns: 1fr;
  }
  .presenter-side-stack .sticky {
    position: static;
  }
}
@media (max-width: 760px) {
  .presenter-stepbar {
    grid-template-columns: 1fr;
  }
  .presenter-product-card,
  .presenter-card-head,
  .presenter-line-row,
  .presenter-line-actions,
  .presenter-search-result,
  .presenter-list-row {
    grid-template-columns: 1fr;
    display: grid;
  }
  .presenter-form-grid,
  .presenter-form-grid-wide,
  .presenter-metric-grid,
  .presenter-toolbar-summary {
    grid-template-columns: 1fr;
  }
  .presenter-form-grid .span-2,
  .presenter-form-grid-wide .span-2 {
    grid-column: span 1;
  }
  .presenter-product-media {
    width: 100%;
    height: 180px;
  }
  .presenter-inline-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* === v1.9 dashboard and finance standardization === */
.dashboard-overview {
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(84,165,71,0.14), rgba(8,17,13,0.82) 62%),
    linear-gradient(180deg, rgba(13,23,18,0.95), rgba(10,18,14,0.92));
}
.dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.95fr);
  gap: 22px;
  align-items: start;
}
.dashboard-overview-copy h3,
.finance-report-hero h3 {
  margin: 0 0 10px;
  font-size: clamp(1.55rem, 1.8vw, 2.15rem);
  letter-spacing: -0.03em;
  font-family: "Playfair Display", Georgia, serif;
}
.dashboard-overview-copy p,
.finance-report-hero p {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 68ch;
  line-height: 1.65;
}
.dashboard-overview-side {
  display: grid;
  gap: 14px;
}
.dashboard-summary-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-summary-metrics .summary-metric {
  min-height: 104px;
}
.summary-metric {
  display: grid;
  gap: 6px;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.035);
}
.summary-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.summary-metric strong {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.summary-metric small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.summary-metric.emphasis,
.summary-metric.is-positive,
.summary-metric.is-warning,
.summary-metric.is-negative {
  position: relative;
  overflow: hidden;
}
.summary-metric.emphasis::before,
.summary-metric.is-positive::before,
.summary-metric.is-warning::before,
.summary-metric.is-negative::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
}
.summary-metric.emphasis::before,
.summary-metric.is-positive::before { background: linear-gradient(180deg, var(--accent), #7ad86d); }
.summary-metric.is-warning::before { background: linear-gradient(180deg, var(--accent-gold), #d89a13); }
.summary-metric.is-negative::before { background: linear-gradient(180deg, #e87c7c, #bf4a4a); }
.dashboard-stats-grid .stat-card .subtle {
  margin-top: 8px;
  color: var(--muted);
}
.dashboard-finance-grid,
.dashboard-activity-grid {
  margin-bottom: 18px;
}
.dashboard-panel {
  padding: 20px;
}
.dashboard-key-value-list,
.dashboard-alert-list {
  display: grid;
  gap: 10px;
}
.dashboard-key-value-row,
.dashboard-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.025);
  color: inherit;
  text-decoration: none;
}
.dashboard-key-value-row:hover,
.dashboard-alert-row:hover {
  background: rgba(255,255,255,0.05);
}
.dashboard-key-value-row span,
.dashboard-alert-row span {
  color: var(--muted);
  font-size: 12px;
}
.dashboard-alert-row > div {
  display: grid;
  gap: 2px;
}
.dashboard-compact-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}
.finance-report-hero {
  padding: 22px;
}
.finance-summary-metrics {
  margin-top: 10px;
}
html[data-theme="light"] .dashboard-overview {
  background:
    linear-gradient(135deg, rgba(84,165,71,0.14), rgba(255,255,255,0.88) 72%),
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(247,249,245,0.98));
}
html[data-theme="light"] .summary-metric,
html[data-theme="light"] .dashboard-key-value-row,
html[data-theme="light"] .dashboard-alert-row {
  background: rgba(255,255,255,0.78);
  border-color: rgba(17,36,28,0.10);
}
html[data-theme="light"] .dashboard-key-value-row:hover,
html[data-theme="light"] .dashboard-alert-row:hover {
  background: rgba(84,165,71,0.10);
}
html[data-theme="light"] .dashboard-stats-grid .stat-card .subtle,
html[data-theme="light"] .summary-metric small,
html[data-theme="light"] .dashboard-key-value-row span,
html[data-theme="light"] .dashboard-alert-row span {
  color: #4a6458;
}
@media (max-width: 1080px) {
  .dashboard-overview-grid,
  .dashboard-summary-metrics,
  .dashboard-compact-metrics {
    grid-template-columns: 1fr;
  }
}

/* Overflow hardening for dashboard and dense cards */
.card-header > div,
.stat-card,
.summary-metric,
.dashboard-key-value-row,
.dashboard-alert-row,
.detail-grid > div {
  min-width: 0;
}

.card-header h3,
.card-header p,
.stat-card .label,
.stat-card .value,
.summary-metric span,
.summary-metric strong,
.summary-metric small,
.dashboard-key-value-row strong,
.dashboard-key-value-row span,
.dashboard-alert-row strong,
.dashboard-alert-row span,
.dashboard-overview-copy h3,
.dashboard-overview-copy p,
.detail-grid strong,
.detail-grid a,
.detail-grid div {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stat-card .value {
  font-size: clamp(1.35rem, 1.65vw, 2.05rem);
  line-height: 1.05;
}

.summary-metric strong {
  line-height: 1.12;
}

.dashboard-stats-grid .stat-card,
.dashboard-summary-metrics .summary-metric,
.dashboard-compact-metrics .summary-metric {
  overflow: hidden;
}

.wrap-actions,
.inline-form-actions.sale-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-form-actions.sale-status-actions form {
  margin: 0;
}

@media (max-width: 1280px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Final closeout refinements */
.grid-6 { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; }
.dashboard-hero-card, .dashboard-panel { overflow:hidden; }
.dashboard-hero-grid { display:grid; grid-template-columns:1.35fr 1fr; gap:18px; align-items:start; }
.dashboard-hero-metrics.compact-grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.dashboard-mini-metrics { margin:16px 0; }
.summary-card small { display:block; color:var(--muted-color,#6b7280); margin-top:6px; line-height:1.3; }
.qty-stepper { display:flex; align-items:center; gap:8px; }
.qty-stepper .form-input { min-width:92px; }
.presenter-line-row-rich { gap:12px; flex-wrap:wrap; }
.presenter-stepper-form { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.compact-actions { margin-top:8px; gap:6px; }
.sale-return-qty { max-width:120px; }
.sale-detail-grid > div { min-width:0; }
.sale-return-form .table-wrap { margin-bottom:8px; }
@media (max-width: 1180px) {
  .dashboard-hero-grid, .grid-6 { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .dashboard-hero-grid, .dashboard-hero-metrics.compact-grid-2, .grid-6 { grid-template-columns:1fr; }
}

/* Remove native browser number spinners so custom quantity controls behave predictably. */
.form-input[type="number"]::-webkit-outer-spin-button,
.form-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* === v2.3 dashboard, document editor, and presenter UI polish === */
.dashboard-hero-card {
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(84,165,71,0.16), transparent 34%),
    linear-gradient(135deg, rgba(17,34,26,0.95), rgba(13,24,18,0.9));
}
.dashboard-hero-copy {
  display: grid;
  gap: 18px;
}
.dashboard-hero-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  letter-spacing: -0.03em;
}
.dashboard-hero-copy p {
  margin: 0;
  max-width: 66ch;
  color: var(--muted);
  line-height: 1.65;
}
.dashboard-hero-priority {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.dashboard-priority-card,
.summary-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  min-width: 0;
}
.dashboard-priority-card span,
.summary-card span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.dashboard-priority-card strong,
.summary-card strong {
  font-size: clamp(1.1rem, 1.4vw, 1.45rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dashboard-priority-card small,
.summary-card small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}
.dashboard-priority-card.is-good,
.summary-card.emphasize {
  border-color: rgba(84,165,71,0.26);
  box-shadow: inset 0 0 0 1px rgba(84,165,71,0.1);
}
.dashboard-priority-card.is-alert {
  border-color: rgba(227,188,34,0.28);
  box-shadow: inset 0 0 0 1px rgba(227,188,34,0.12);
}
.dashboard-priority-card.is-neutral {
  border-color: rgba(255,255,255,0.12);
}
.dashboard-mini-metrics {
  align-items: stretch;
}
.dashboard-mini-stat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.dashboard-mini-stat > div:last-child {
  min-width: 0;
}
.dashboard-mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dashboard-inline-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.dashboard-inline-note.is-success {
  border-color: rgba(84,165,71,0.26);
  color: var(--text);
}
.dashboard-table-card .table-wrap {
  margin-top: 10px;
}
.dashboard-table-card table th,
.dashboard-table-card table td {
  vertical-align: middle;
}
.dashboard-table-card .empty-state {
  min-height: 180px;
}

.document-editor-card {
  gap: 20px;
}
.document-items-toolbar-anchored {
  align-items: end;
}
.document-line-items {
  display: grid;
  gap: 16px;
}
.document-line-item-row {
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  background: rgba(255,255,255,0.03);
}
.document-line-item-head {
  align-items: center;
}
.document-line-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.document-line-item-number {
  margin: 0;
}
.document-line-item-type {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.document-line-item-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: start;
}
.document-line-item-main,
.document-line-item-controls {
  display: grid;
  gap: 14px;
}
.document-line-item-controls {
  grid-template-columns: 130px 1fr 180px;
  align-items: end;
}
.document-line-item-control {
  display: grid;
  gap: 8px;
}
.document-line-item-control > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.document-line-item-helper {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.35;
}
.document-line-item-total {
  min-height: 100%;
  display: grid;
  align-content: center;
}
.qty-stepper {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.qty-stepper .btn {
  min-width: 42px;
  min-height: 42px;
  padding: 0;
}
.qty-stepper .form-input {
  min-width: 0;
  text-align: center;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.qty-stepper .form-input:focus {
  border-color: transparent;
  box-shadow: none;
}
.document-line-item-row.is-removed {
  opacity: 0.58;
}
.document-line-item-row.is-removed .document-line-item-type {
  border-style: dashed;
}

.presenter-stepbar {
  gap: 14px;
  margin-bottom: 22px;
}
.presenter-step {
  justify-content: flex-start;
  min-height: 64px;
  padding: 16px 18px;
  border-radius: 22px;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.presenter-step:hover {
  transform: translateY(-1px);
}
.presenter-step.is-active {
  background: linear-gradient(135deg, rgba(84,165,71,0.18), rgba(10,25,16,0.92));
}
.presenter-toolbar-card {
  padding: 20px 22px;
}
.presenter-toolbar-status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.presenter-helper-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.presenter-helper-pill,
.presenter-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 30%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.presenter-helper-pill.is-warning {
  border-color: rgba(197, 153, 42, 0.4);
}
.presenter-card-head-spread {
  align-items: flex-start;
}
.presenter-customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.presenter-inline-actions-split > * {
  flex: 1 1 220px;
}
.presenter-field-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.presenter-form-grid-create {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.presenter-form-grid-create .span-3 {
  grid-column: 1 / -1;
}
.presenter-metric-grid-tight .metric {
  min-height: 88px;
}
.presenter-list-row-rich,
.presenter-cart-row-rich {
  align-items: center;
}
.presenter-product-card {
  grid-template-columns: 124px minmax(0, 1fr);
  padding: 16px;
  border-radius: 22px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.presenter-product-card:hover {
  transform: translateY(-1px);
  border-color: rgba(84,165,71,0.24);
}
.presenter-product-media {
  width: 124px;
  height: 124px;
  border-radius: 20px;
}
.presenter-product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.presenter-cart-list.compact {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}
.presenter-line-row-rich {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
}
.presenter-line-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.presenter-stepper-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.presenter-stepper-form .btn.btn-sm {
  min-width: 42px;
  min-height: 42px;
  padding: 0;
}
.presenter-qty-input {
  width: 88px;
  text-align: center;
}
.presenter-line-total-badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 32%);
  color: var(--text-strong);
  font-weight: 700;
}
.presenter-payment-form {
  gap: 16px;
}
.presenter-payment-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.presenter-payment-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 28%);
}
.presenter-payment-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.presenter-payment-card strong {
  font-size: 1.15rem;
  color: var(--text-strong);
}
.presenter-payment-card.is-good {
  border-color: rgba(84,165,71,0.34);
}
.presenter-payment-card.is-warning {
  border-color: rgba(197,153,42,0.4);
}
.presenter-checkout-submit {
  margin-top: 4px;
}
.presenter-empty-inline {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 18%);
}
.presenter-empty-inline strong,
.presenter-empty-inline span {
  display: block;
}
.presenter-empty-inline span {
  margin-top: 6px;
  color: var(--muted);
}

html[data-theme="light"] .dashboard-hero-card {
  background:
    radial-gradient(circle at top right, rgba(84,165,71,0.14), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(245,248,243,0.96));
}
html[data-theme="light"] .dashboard-priority-card,
html[data-theme="light"] .summary-card,
html[data-theme="light"] .dashboard-inline-note,
html[data-theme="light"] .document-line-item-row,
html[data-theme="light"] .document-line-item-type,
html[data-theme="light"] .qty-stepper,
html[data-theme="light"] .presenter-helper-pill,
html[data-theme="light"] .presenter-tag,
html[data-theme="light"] .presenter-payment-card,
html[data-theme="light"] .presenter-line-total-badge {
  background: #ffffff;
  border-color: rgba(24,37,29,0.1);
}
html[data-theme="light"] .dashboard-priority-card strong,
html[data-theme="light"] .summary-card strong,
html[data-theme="light"] .dashboard-mini-icon,
html[data-theme="light"] .document-line-item-type,
html[data-theme="light"] .presenter-payment-card strong,
html[data-theme="light"] .presenter-line-total-badge {
  color: #18231d;
}
html[data-theme="light"] .dashboard-priority-card small,
html[data-theme="light"] .summary-card small,
html[data-theme="light"] .dashboard-inline-note,
html[data-theme="light"] .document-line-item-helper,
html[data-theme="light"] .presenter-field-hint,
html[data-theme="light"] .presenter-helper-pill,
html[data-theme="light"] .presenter-tag {
  color: #55655d;
}
html[data-theme="light"] .dashboard-mini-icon {
  background: #f5f8f4;
}
html[data-theme="light"] .presenter-step.is-active {
  background: linear-gradient(135deg, rgba(84,165,71,0.14), rgba(255,255,255,0.98));
}

@media (max-width: 1180px) {
  .dashboard-hero-priority,
  .presenter-payment-overview,
  .document-line-item-layout,
  .document-line-item-controls,
  .presenter-line-row-rich {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .dashboard-mini-stat,
  .presenter-customer-meta {
    display: grid;
  }
  .document-line-item-row,
  .presenter-card,
  .presenter-toolbar-card,
  .dashboard-hero-card {
    padding: 18px;
  }
}

@media (max-width: 760px) {
  .presenter-form-grid-create,
  .dashboard-hero-priority,
  .dashboard-hero-grid,
  .dashboard-hero-metrics.compact-grid-2,
  .grid-6,
  .presenter-payment-overview {
    grid-template-columns: 1fr;
  }
}

/* === v2.4 dashboard, invoice editor, and presenter layout refinement === */
.dashboard-panel-spacious {
  padding: 24px;
}
.dashboard-section-head {
  margin-bottom: 18px;
}
.dashboard-mini-metrics.grid-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.dashboard-primary-grid,
.dashboard-activity-grid-refresh {
  gap: 20px;
}
.dashboard-summary-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.dashboard-stock-list,
.dashboard-activity-list,
.dashboard-shift-list {
  display: grid;
  gap: 12px;
}
.dashboard-stock-item,
.dashboard-activity-item,
.dashboard-shift-row {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  min-width: 0;
}
.dashboard-stock-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}
.dashboard-stock-item strong,
.dashboard-activity-item strong,
.dashboard-shift-row strong {
  color: var(--text-strong);
}
.dashboard-stock-item span,
.dashboard-activity-item span,
.dashboard-shift-row span {
  color: var(--muted);
}
.dashboard-stock-item > div,
.dashboard-activity-top > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.dashboard-stock-meta,
.dashboard-activity-top,
.dashboard-activity-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard-activity-item {
  gap: 10px;
}
.dashboard-activity-top {
  align-items: flex-start;
}
.dashboard-activity-top strong:last-child {
  font-size: 1.02rem;
}
.dashboard-activity-bottom {
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.dashboard-empty-state-compact {
  min-height: 150px;
}
.document-items-toolbar {
  gap: 18px;
}
.document-items-toolbar-actions {
  gap: 12px;
}
.document-summary-pill {
  min-height: 72px;
  padding: 14px 16px;
}
.invoice-line-item-layout {
  grid-template-columns: minmax(0, 1.3fr) minmax(480px, 1fr);
  gap: 20px;
}
.invoice-line-item-controls {
  grid-template-columns: 120px 1fr 200px 140px;
  gap: 12px;
}
.document-line-item-row {
  padding: 20px;
}
.document-line-item-main {
  gap: 16px;
}
.document-line-item-controls {
  align-items: start;
}
.document-line-item-control {
  gap: 10px;
}
.document-line-item-control .form-input {
  min-height: 50px;
}
.document-line-item-control-qty .qty-stepper {
  min-height: 62px;
}
.document-line-item-discount {
  align-content: start;
}
.document-line-discount-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.document-line-discount-pills .btn {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
}
.document-line-item-total {
  min-height: 100px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(84,165,71,0.18);
  background: linear-gradient(135deg, rgba(84,165,71,0.08), rgba(0,97,44,0.06));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.document-line-item-total strong {
  font-size: 1.45rem;
  color: var(--accent);
}
.presenter-page.presenter-browse-page {
  grid-template-columns: minmax(0, 1.9fr) minmax(360px, 1fr);
  gap: 22px;
}
.presenter-toolbar-card,
.presenter-card {
  padding: 24px;
}
.presenter-toolbar {
  grid-template-columns: minmax(0, 1.35fr) 280px minmax(320px, 0.95fr);
  gap: 18px;
}
.presenter-product-grid {
  gap: 18px;
}
.presenter-product-card {
  gap: 18px;
  padding: 18px;
}
.presenter-product-body {
  gap: 12px;
}
.presenter-product-meta h3 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  line-height: 1.2;
}
.presenter-product-copy {
  line-height: 1.55;
}
.presenter-cart-row-editable {
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.presenter-cart-row-editable:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.presenter-cart-row-copy,
.presenter-cart-row-controls,
.presenter-cart-row-meta,
.presenter-cart-stepper-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.presenter-cart-row-copy,
.presenter-cart-row-controls {
  width: 100%;
}
.presenter-cart-row-copy {
  align-items: flex-start;
}
.presenter-cart-row-copy > div {
  min-width: 0;
}
.presenter-cart-row-copy strong:first-child {
  margin-bottom: 4px;
}
.presenter-cart-line-total {
  font-size: 1.04rem;
  white-space: nowrap;
}
.presenter-cart-stepper-form {
  justify-content: flex-start;
}
.presenter-cart-stepper-form .btn.btn-sm {
  min-width: 42px;
  min-height: 42px;
  padding: 0;
}
.presenter-cart-qty-readout {
  width: 78px;
  text-align: center;
  font-weight: 700;
}
.presenter-cart-row-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.presenter-cart-list.compact {
  max-height: 520px;
  padding-right: 2px;
}
.presenter-line-row-rich {
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto) auto;
  gap: 18px;
}
.presenter-list.presenter-cart-list.compact {
  padding: 0;
  border: 0;
  background: transparent;
}
.presenter-summary-block.total-block {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), var(--panel-muted) 24%);
}
.table-wrap,
.presenter-cart-list.compact {
  scrollbar-width: thin;
  scrollbar-color: rgba(108, 125, 115, 0.7) transparent;
}
.table-wrap::-webkit-scrollbar,
.presenter-cart-list.compact::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.table-wrap::-webkit-scrollbar-track,
.presenter-cart-list.compact::-webkit-scrollbar-track {
  background: transparent;
}
.table-wrap::-webkit-scrollbar-thumb,
.presenter-cart-list.compact::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(108, 125, 115, 0.7);
  border: 2px solid transparent;
  background-clip: padding-box;
}
html[data-theme="light"] .dashboard-stock-item,
html[data-theme="light"] .dashboard-activity-item,
html[data-theme="light"] .dashboard-shift-row,
html[data-theme="light"] .document-line-item-total {
  background: #ffffff;
  border-color: rgba(24,37,29,0.1);
}
html[data-theme="light"] .dashboard-activity-bottom {
  border-top-color: rgba(24,37,29,0.08);
}
html[data-theme="light"] .table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .presenter-cart-list.compact::-webkit-scrollbar-thumb {
  background: rgba(124, 137, 129, 0.85);
  background-clip: padding-box;
}
@media (max-width: 1280px) {
  .invoice-line-item-layout {
    grid-template-columns: 1fr;
  }
  .invoice-line-item-controls {
    grid-template-columns: 120px 1fr 200px 140px;
  }
  .presenter-page.presenter-browse-page,
  .presenter-toolbar,
  .dashboard-mini-metrics.grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .presenter-page.presenter-browse-page,
  .presenter-toolbar {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 960px) {
  .invoice-line-item-controls {
    grid-template-columns: 120px 1fr 200px;
  }
}
@media (max-width: 860px) {
  .dashboard-stock-item,
  .dashboard-activity-top,
  .dashboard-activity-bottom,
  .presenter-cart-row-copy,
  .presenter-cart-row-controls,
  .presenter-cart-row-meta {
    display: grid;
  }
  .dashboard-mini-metrics.grid-6,
  .dashboard-summary-grid-2 {
    grid-template-columns: 1fr;
  }
  .invoice-line-item-controls {
    grid-template-columns: 100px 1fr;
  }
  .document-line-item-controls {
    grid-template-columns: 100px 1fr;
  }
}
@media (max-width: 640px) {
  .invoice-line-item-controls,
  .document-line-item-controls {
    grid-template-columns: 1fr;
  }
}

/* Sprint 1-4 refinements */
.detail-media-figure {
  padding: 16px;
  min-height: 360px;
  background: rgba(255,255,255,0.04);
}
.detail-media-image {
  width: 100%;
  height: min(60vh, 420px);
  object-fit: contain;
  object-position: center;
  border-radius: 24px;
  background: rgba(255,255,255,0.03);
}
.detail-summary-head {
  gap: 14px;
  flex-wrap: wrap;
}
.detail-action-bar {
  align-items: flex-start;
}

.presenter-product-toolbar-meta {
  align-items: center;
}
.presenter-inline-actions.presenter-inline-actions-split {
  gap: 10px;
  flex-wrap: wrap;
}
.presenter-cart-list-compact {
  gap: 12px;
}
.presenter-cart-line-static {
  padding: 14px 16px;
}
.presenter-cart-line-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.presenter-cart-line-head strong {
  font-size: 18px;
  line-height: 1.25;
}
.presenter-cart-line-meta {
  color: var(--muted);
  font-size: 14px;
}
.presenter-check-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.presenter-card-head.compact {
  gap: 12px;
}

.document-line-item-row {
  padding: 24px;
}
.document-line-item-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 1fr);
  gap: 20px;
}
.document-line-item-controls {
  grid-template-columns: minmax(130px, 150px) minmax(150px, 180px) minmax(150px, 170px);
  gap: 14px;
}
.document-line-item-main {
  gap: 16px;
}
.document-line-item-control > label {
  font-size: 11px;
  letter-spacing: 0.12em;
}
.document-line-item-total {
  min-width: 150px;
}
.document-line-item-total .summary-card-value {
  font-size: clamp(24px, 2.4vw, 34px);
}
.document-line-item-helper {
  font-size: 13px;
}
.invoice-discount-pills {
  margin-top: 6px;
}

.dashboard-hero {
  gap: 18px;
}
.dashboard-metric-card {
  padding: 20px;
}
.dashboard-metric-card .metric-value {
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1;
}
.activity-card {
  min-height: 0;
}
.table-wrap {
  scrollbar-width: thin;
}

@media (max-width: 1180px) {
  .document-line-item-layout {
    grid-template-columns: 1fr;
  }
  .document-line-item-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .detail-media-figure {
    min-height: 240px;
  }
  .detail-media-image {
    height: 260px;
  }
  .presenter-check-grid {
    grid-template-columns: 1fr;
  }
  .document-line-item-controls {
    grid-template-columns: 1fr;
  }
  .document-line-item-total {
    min-width: 0;
  }
}
.presenter-inline-form {
  display: inline-flex;
  margin: 0;
}
.presenter-inline-form-block {
  display: block;
}
.presenter-inline-form .btn {
  width: 100%;
}

.presenter-toolbar-status-wrap {
  flex-wrap: wrap;
}

.presenter-product-footer-wrap {
  gap: 0.85rem;
}

.presenter-scan-modal[hidden] {
  display: none !important;
}

.presenter-scan-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.presenter-scan-dialog {
  width: min(760px, 100%);
  border-radius: 24px;
  background: var(--panel, #ffffff);
  border: 1px solid var(--line, rgba(148, 163, 184, 0.25));
  box-shadow: 0 32px 70px rgba(15, 23, 42, 0.28);
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.presenter-scan-form {
  display: grid;
  gap: 0.85rem;
}

.presenter-scan-camera {
  border: 1px dashed var(--line, rgba(148, 163, 184, 0.35));
  border-radius: 20px;
  padding: 0.9rem;
  background: rgba(148, 163, 184, 0.08);
}

.presenter-scan-camera video {
  display: block;
  width: 100%;
  max-height: 320px;
  border-radius: 16px;
  background: #020617;
  object-fit: cover;
}

.presenter-scan-feedback {
  min-height: 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.presenter-scan-feedback[data-tone="success"] {
  color: var(--success-700, #166534);
}

.presenter-scan-feedback[data-tone="error"] {
  color: var(--danger-700, #b91c1c);
}

.presenter-scan-feedback[data-tone="neutral"] {
  color: var(--muted, #64748b);
}

.presenter-scan-notes {
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

.qr-print-launcher,
.qr-print-presets,
.qr-print-bulk-bar {
  display: grid;
  gap: 1rem;
}

.qr-print-presets {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.qr-preset-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.25));
  border-radius: 18px;
  background: var(--panel, #ffffff);
}

.qr-preset-card strong {
  font-size: 1rem;
}

.qr-print-bulk-bar {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.25));
  border-radius: 20px;
  background: var(--panel, #ffffff);
}

.qr-print-checkbox-cell {
  width: 44px;
}

.qr-print-checkbox {
  width: 18px;
  height: 18px;
}

@media (max-width: 720px) {
  .presenter-scan-dialog {
    padding: 1rem;
  }

  .presenter-scan-modal {
    padding: 0.75rem;
  }
}

/* ===== Global UI standardisation pass ===== */
.card,
.presenter-card,
.presenter-toolbar-card,
.stat-card,
.quick-links-panel,
.table-wrap {
  border-radius: 22px;
}

.card,
.presenter-card,
.presenter-toolbar-card,
.quick-links-panel {
  border: 1px solid var(--line, rgba(148, 163, 184, 0.22));
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.section-header,
.card-header,
.form-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.section-header h1,
.section-header h2,
.section-header h3,
.card-header h1,
.card-header h2,
.card-header h3,
.form-toolbar h1,
.form-toolbar h2,
.form-toolbar h3,
.presenter-card-head h1,
.presenter-card-head h2,
.presenter-card-head h3 {
  margin: 0;
  color: var(--text, #0f172a);
  letter-spacing: -0.02em;
}

.subtle,
.form-hint,
.presenter-field-hint,
.presenter-card-head p,
.presenter-product-copy,
.presenter-scan-notes,
.metric span,
.detail-grid dt,
.label {
  color: var(--muted, #5f6f64);
}

.page-section,
.card.page-section {
  padding: 1.35rem;
}

.inline-actions,
.form-actions,
.sticky-actions .form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn,
a.btn,
button.btn {
  min-height: 42px;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn.btn-sm,
a.btn.btn-sm,
button.btn.btn-sm {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 12px;
}

.form-input,
input.form-input,
select.form-input,
textarea.form-input,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: 44px;
  border-radius: 14px;
}

textarea,
textarea.form-input {
  min-height: 110px;
}

label,
.form-group label,
.presenter-scan-form label,
.presenter-toolbar label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.22));
}

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

table thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #64748b);
  background: rgba(148, 163, 184, 0.08);
}

table th,
table td {
  padding: 0.9rem 1rem;
  vertical-align: middle;
}

table tbody td {
  color: var(--text, #0f172a);
}

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

.detail-grid-tight {
  margin-top: 1rem;
}

.detail-grid dd {
  margin: 0.35rem 0 0;
  color: var(--text, #0f172a);
  font-weight: 600;
}

.empty-state-warn {
  border: 1px dashed rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.presenter-toolbar-card,
.presenter-card {
  padding: 1.15rem;
}

.presenter-toolbar {
  gap: 1rem;
}

.presenter-toolbar-summary .metric,
.presenter-metric-grid .metric {
  border-radius: 16px;
}

.presenter-scan-shell {
  margin-top: 1rem;
}

.presenter-scan-panel {
  display: grid;
  gap: 1rem;
  border-radius: 20px;
  border: 1px solid var(--line, rgba(148, 163, 184, 0.26));
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.18));
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.presenter-scan-panel.is-active {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
}

.presenter-scan-grid {
  align-items: end;
}

.presenter-scan-actions {
  align-items: stretch;
}

.presenter-scan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.presenter-scan-camera {
  min-height: 100%;
}

.presenter-scan-notes {
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed var(--line, rgba(148, 163, 184, 0.35));
  background: rgba(148, 163, 184, 0.08);
}

.presenter-scan-feedback {
  padding: 0.15rem 0;
}

.badge,
.presenter-helper-pill,
.presenter-tag,
.presenter-badge {
  border-radius: 999px;
}

html[data-theme="light"] .card,
html[data-theme="light"] .presenter-card,
html[data-theme="light"] .presenter-toolbar-card,
html[data-theme="light"] .quick-links-panel,
html[data-theme="light"] .table-wrap {
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .presenter-scan-panel {
  background: linear-gradient(180deg, rgba(246, 250, 244, 0.92), rgba(255, 255, 255, 0.98));
}

html[data-theme="dark"] .section-header h1,
html[data-theme="dark"] .section-header h2,
html[data-theme="dark"] .section-header h3,
html[data-theme="dark"] .card-header h1,
html[data-theme="dark"] .card-header h2,
html[data-theme="dark"] .card-header h3,
html[data-theme="dark"] .form-toolbar h1,
html[data-theme="dark"] .form-toolbar h2,
html[data-theme="dark"] .form-toolbar h3,
html[data-theme="dark"] .detail-grid dd,
html[data-theme="dark"] table tbody td,
html[data-theme="dark"] label,
html[data-theme="dark"] .form-group label {
  color: #f8fafc;
}

html[data-theme="dark"] .subtle,
html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .metric span,
html[data-theme="dark"] .detail-grid dt,
html[data-theme="dark"] .label,
html[data-theme="dark"] table thead th {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme="dark"] .presenter-scan-panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.72));
}

html[data-theme="dark"] .presenter-scan-notes,
html[data-theme="dark"] .presenter-scan-camera,
html[data-theme="dark"] table thead th {
  background: rgba(30, 41, 59, 0.58);
}

@media (max-width: 920px) {
  .presenter-scan-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-section,
  .card.page-section,
  .presenter-toolbar-card,
  .presenter-card {
    padding: 1rem;
  }

  .btn,
  a.btn,
  button.btn {
    width: 100%;
    justify-content: center;
  }

  .inline-actions,
  .form-actions,
  .sticky-actions .form-actions,
  .presenter-inline-actions {
    width: 100%;
  }
}

/* ── UI/UX pass additions ─────────────────────────────────── */

/* POS index action bar */
.pos-home-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.pos-home-action-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pos-home-action-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.badge.success {
  background: rgba(111,209,150,0.14);
  border-color: rgba(111,209,150,0.32);
  color: var(--success);
}
@media (max-width: 640px) {
  .pos-home-action-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .pos-home-action-bar-right {
    width: 100%;
  }
  .pos-home-action-bar-right .btn {
    flex: 1;
  }
}

/* Browse cart — primary checkout button */
.presenter-checkout-btn {
  display: flex;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 16px;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.presenter-cart-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.presenter-cart-secondary-actions .btn,
.presenter-cart-secondary-actions button.btn {
  flex: 1;
  min-width: 80px;
  font-size: 12px;
  padding: 8px 10px;
}

/* Payment amount fields — conditional grid */
.presenter-payment-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.presenter-payment-amounts label[hidden] {
  display: none;
}

/* Checkout submit button sizing */
.btn-lg {
  padding: 15px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 16px;
}

/* btn-ghost small — for discount "None" reset */
.btn-ghost.btn-sm {
  opacity: 0.65;
  border-style: dashed;
}
.btn-ghost.btn-sm:hover {
  opacity: 1;
  background: rgba(255,255,255,0.04);
}

/* Sale detail — grouped sections */
.sale-detail-sections {
  display: grid;
  gap: 20px;
  margin-top: 4px;
}
.sale-detail-group {
  display: grid;
  gap: 10px;
}
.sale-detail-group-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* App footer — simplified */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-footer-build {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

/* Scan panel — smooth reveal */
.presenter-scan-panel[hidden] {
  display: none;
}


/* ── Shift detail page ─────────────────────────────────────── */
.shift-hero-metrics {
  margin-bottom: 18px;
}
.shift-detail-primary {
  align-items: start;
}
.shift-category-totals {
  display: grid;
  gap: 6px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}
.shift-category-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}
.shift-action-card {
  border-color: rgba(84,165,71,0.2);
}
.shift-close-card {
  border-color: rgba(227,188,34,0.22);
}

/* ── COA list ──────────────────────────────────────────────── */
.coa-type-group {
  margin-bottom: 8px;
}
.coa-type-group:last-child {
  margin-bottom: 0;
}
.coa-type-header {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 12px 16px 8px;
  border-top: 1px solid var(--border);
}
.coa-type-group:first-child .coa-type-header {
  border-top: none;
  padding-top: 4px;
}
.coa-code {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
}
.row-inactive td {
  opacity: 0.45;
}
html[data-theme="light"] .coa-code {
  background: rgba(0,0,0,0.04);
}

/* ── COA form advanced section ─────────────────────────────── */
.form-advanced-section {
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
}
.form-advanced-section summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  user-select: none;
  padding-bottom: 4px;
}
.form-advanced-section summary:hover {
  color: var(--text);
}

/* ── Finance control screens ──────────────────────────────── */
.finance-report-hero {
  margin-bottom: 18px;
}
.finance-summary-metrics {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.finance-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.finance-gap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.finance-gap-grid > div {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-soft);
}
.finance-gap-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.finance-gap-grid strong {
  font-size: 20px;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.filter-bar label {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
}
.form-grid.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 18px;
}
.journal-lines-table input,
.journal-lines-table select {
  min-width: 140px;
}
.checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}
@media (max-width: 980px) {
  .finance-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Opening balances and bank account setup ───────────────── */
.compact-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  min-width: 160px;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.link-button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.link-button:hover { text-decoration: underline; }
.opening-balance-table input[type="number"] { min-width: 130px; }
.opening-balance-table input[type="date"] { min-width: 145px; }
.summary-metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Finance setup UX pass: chart of accounts and bank accounts ── */
.finance-setup-card {
  max-width: 1040px;
}
.finance-setup-form {
  display: grid;
  gap: 18px;
}
.finance-helper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.finance-helper-card {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}
.finance-helper-card strong {
  font-size: 13px;
}
.finance-helper-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.finance-helper-card.primary-helper {
  border-color: rgba(84,165,71,0.26);
}
.setup-section {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
  border-radius: 18px;
  padding: 18px;
}
.setup-section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.setup-section-title > span {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(227,188,34,0.14);
  border: 1px solid rgba(227,188,34,0.25);
  font-weight: 800;
  flex: 0 0 30px;
}
.setup-section-title h4 {
  margin: 0 0 4px;
  font-size: 15px;
}
.setup-section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.finance-checkbox-card {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 12px;
}
.form-errors,
.errorlist {
  color: #ffd6d6;
  background: rgba(232,124,124,0.10);
  border: 1px solid rgba(232,124,124,0.22);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 0;
  list-style-position: inside;
  font-size: 13px;
}
.auto-ledger-only.is-muted {
  opacity: .55;
}
.auto-ledger-only.is-muted input {
  pointer-events: none;
}
.ledger-setup-panel select option:first-child {
  font-weight: 700;
}
@media (max-width: 720px) {
  .setup-section { padding: 14px; }
  .setup-section-title { gap: 10px; }
  .sticky-actions .form-actions { flex-direction: column; align-items: stretch; }
}

/* Login splash contrast pass -------------------------------------------------
   The login splash is intentionally darker than the app shell in both themes so
   the brand mark, company name, and module list remain readable in light mode. */
.login-shell--clear-splash {
    overflow: hidden;
}
.login-splash-panel {
    position: relative;
    min-height: 520px;
    color: #f7fff8;
    background:
        radial-gradient(circle at 16% 14%, rgba(199, 255, 171, 0.22), transparent 32%),
        radial-gradient(circle at 88% 8%, rgba(215, 181, 72, 0.20), transparent 28%),
        linear-gradient(145deg, #06351f 0%, #0b4a2b 48%, #0f2d1c 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.16);
}
.login-splash-panel::after {
    content: "";
    position: absolute;
    inset: auto -18% -22% 18%;
    height: 270px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(14px);
    pointer-events: none;
}
.login-splash-topline {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.login-brand-card--contrast {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}
.login-brand-card--contrast img {
    background: #ffffff;
    border-radius: 8px;
    padding: 3px;
}
.login-splash-panel .login-brand-name,
html[data-theme="light"] .login-splash-panel .login-brand-name {
    color: #ffffff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.24);
}
.login-splash-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.10);
    color: #ecffdf;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.login-splash-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
    max-width: 650px;
}
.login-splash-kicker,
html[data-theme="light"] .login-splash-kicker,
html[data-theme="dark"] .login-splash-kicker {
    width: fit-content;
    border-color: rgba(215, 181, 72, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #f2ffd9;
    box-shadow: none;
}
.login-splash-panel h1,
html[data-theme="light"] .login-splash-panel h1 {
    color: #ffffff;
    max-width: 720px;
    font-size: clamp(2.55rem, 5vw, 5.15rem);
    line-height: 0.94;
    letter-spacing: -0.06em;
}
.login-splash-panel p,
html[data-theme="light"] .login-splash-panel p {
    max-width: 620px;
    color: rgba(247, 255, 248, 0.88);
    font-size: 1.04rem;
    line-height: 1.72;
}
.login-splash-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.login-splash-grid > div {
    min-height: 112px;
    padding: 17px 18px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
}
.login-splash-grid strong {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.login-splash-grid span {
    color: rgba(247, 255, 248, 0.78);
    font-size: 0.93rem;
    line-height: 1.5;
}
html[data-theme="light"] .login-splash-panel {
    color: #f7fff8;
    background:
        radial-gradient(circle at 16% 14%, rgba(199, 255, 171, 0.24), transparent 32%),
        radial-gradient(circle at 88% 8%, rgba(215, 181, 72, 0.20), transparent 28%),
        linear-gradient(145deg, #07371f 0%, #0f5b34 48%, #0b2e1c 100%);
}
html[data-theme="light"] .login-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fcf8 100%);
}
html[data-theme="light"] .login-card h2 {
    color: #101c16;
}
@media (max-width: 980px) {
    .login-splash-panel {
        min-height: auto;
    }
    .login-splash-panel h1,
    html[data-theme="light"] .login-splash-panel h1 {
        font-size: clamp(2.25rem, 10vw, 3.7rem);
    }
}
@media (max-width: 640px) {
    .login-splash-grid {
        grid-template-columns: 1fr;
    }
    .login-splash-grid > div {
        min-height: auto;
    }
}

/* 2026-04 table/action polish for product QR and row actions */
.table-wrap table td:last-child,
.table-wrap table th:last-child {
  width: 1%;
  white-space: nowrap;
}
.table-wrap td > .inline-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.55rem;
  min-width: max-content;
}
.table-wrap td > .inline-actions .btn,
.table-wrap td > .inline-actions .btn-sm {
  white-space: nowrap;
  min-width: 0;
}
.product-row-title {
  min-width: min(360px, 46vw);
}
.qr-print-panel .form-grid,
.bulk-qr-print .form-grid {
  align-items: end;
}
@media (max-width: 900px) {
  .table-wrap td > .inline-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
  }
  .table-wrap table td:last-child,
  .table-wrap table th:last-child {
    width: auto;
    white-space: normal;
  }
  .product-row-title {
    min-width: 240px;
  }
}

/* List action alignment cleanup - 2026-04-26 */
.table-actions,
.row-actions,
.product-actions,
.inline-actions,
.actions-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.table-actions .btn,
.row-actions .btn,
.product-actions .btn,
.inline-actions .btn,
.actions-cell .btn,
.table-actions a,
.row-actions a,
.product-actions a,
.inline-actions a,
.actions-cell a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
}
.bulk-qr-panel .form-grid,
.bulk-qr-tools,
.qr-print-tools {
  align-items: end;
}
.bulk-qr-panel select,
.bulk-qr-panel input[type="number"] {
  min-height: 48px;
}

/* Bulk QR controls: keep the action aligned and prevent the button from floating mid-card. */
.qr-print-bulk-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1rem 1.25rem;
}
.qr-print-bulk-bar > div:first-child {
  grid-column: 1 / -1;
}
.qr-print-bulk-bar .inline-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .75rem;
}
.qr-print-bulk-bar .inline-actions label {
  min-width: 130px;
}
.qr-print-bulk-bar .inline-actions .field-narrow {
  min-width: 92px;
  max-width: 110px;
}
.qr-print-bulk-bar .inline-actions .btn.primary {
  margin-left: .25rem;
  min-height: 42px;
  align-self: end;
}
@media (max-width: 720px) {
  .qr-print-bulk-bar,
  .qr-print-bulk-bar .inline-actions {
    display: block;
  }
  .qr-print-bulk-bar .inline-actions label,
  .qr-print-bulk-bar .inline-actions .btn.primary {
    width: 100%;
    margin: .6rem 0 0;
  }
  .qr-print-bulk-bar .inline-actions .field-narrow {
    max-width: none;
  }
}


/* ═══════════════════════════════════════════════════════════════
   THE GARDEN ATELIER — Botanical redesign layer
   Plant Solutions Provider brand refresh
   ═══════════════════════════════════════════════════════════════ */

/* ── Fraunces headings throughout ─────────────────────────────── */
h1, h2, h3,
.topbar h1,
.card-header h3,
.hero h2,
.login-brand h1,
.login-card h2,
.pos-home-card h3,
.pos-catalog-card h3,
.dashboard-section-head h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
}

/* ── Body & link link colors ──────────────────────────────────── */
a:not(.btn), a:not(.btn):visited { color: #b3d4b8; }
a:not(.btn):hover { color: #e4f4e6; }
html[data-theme="light"] a:not(.btn), html[data-theme="light"] a:not(.btn):visited { color: #2a5e3a; }
html[data-theme="light"] a:not(.btn):hover { color: #143d22; }

/* ── Focus ring: copper accent ───────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(181, 113, 63, 0.32);
}
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] select:focus-visible,
html[data-theme="light"] textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(160, 90, 44, 0.20);
}

/* ── Input focus: copper ─────────────────────────────────────── */
input:focus, select:focus, textarea:focus {
  border-color: rgba(181, 113, 63, 0.42);
  box-shadow: 0 0 0 3px rgba(181, 113, 63, 0.14);
}
html[data-theme="light"] input:focus, html[data-theme="light"] select:focus, html[data-theme="light"] textarea:focus {
  border-color: rgba(160, 90, 44, 0.32);
  box-shadow: 0 0 0 3px rgba(160, 90, 44, 0.12);
}

/* ── Sidebar: refined, no nav-group boxes ────────────────────── */
.sidebar {
  background:
    radial-gradient(ellipse at top left, rgba(79, 146, 96, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(4, 8, 5, 0.99) 0%, rgba(6, 12, 8, 0.96) 100%);
  padding: 18px 14px;
}
.nav-groups { gap: 4px; }
.nav-group {
  padding: 4px 0;
  border: none;
  border-radius: 0;
  background: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-group:first-child { border-top: none; }
.nav-title {
  padding: 10px 10px 6px;
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.nav a {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #c8d8cb;
  display: flex;
  align-items: center;
  grid-template-columns: unset;
}
.nav a::after { display: none; }
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.72;
  color: var(--accent-light);
}
.nav a.is-active .nav-icon { opacity: 1; color: var(--accent-light); }
.nav a:hover {
  background: rgba(79, 146, 96, 0.10);
  border-color: rgba(140, 202, 154, 0.12);
  color: var(--white);
  transform: none;
}
.nav a:hover .nav-icon { opacity: 1; }
.nav a.is-active {
  color: var(--white);
  background: linear-gradient(135deg, rgba(79,146,96,0.26), rgba(45,110,66,0.34));
  border-color: rgba(140,202,154,0.20);
  border-left: 2px solid var(--accent);
  font-weight: 700;
}
html[data-theme="light"] .nav-group { border-top-color: rgba(60, 80, 60, 0.08); }
html[data-theme="light"] .nav a { color: #2d4a35; }
html[data-theme="light"] .nav a:hover { background: rgba(61,122,79,0.07); border-color: rgba(61,122,79,0.14); color: #143d22; }
html[data-theme="light"] .nav a.is-active {
  color: #143322;
  background: linear-gradient(135deg, rgba(61,122,79,0.16), rgba(160,90,44,0.08));
  border-color: rgba(61,122,79,0.22);
  border-left-color: var(--accent);
}
html[data-theme="light"] .nav-icon { color: #3d7a4f; }
html[data-theme="light"] .nav a.is-active .nav-icon { color: var(--accent); }

/* ── Brand wordmark ──────────────────────────────────────────── */
.brand-wordmark { border-bottom-color: rgba(140, 202, 154, 0.10); }
.brand-wordmark-name { font-family: 'DM Sans', sans-serif; font-size: 11.5px; letter-spacing: 0.06em; }
.brand-wordmark-sub { font-size: 9.5px; color: var(--muted-2); }

/* ── Sidebar footer: partner mark ───────────────────────────── */
.partner-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
}
.partner-mark img { width: 28px; height: 28px; border-radius: 7px; opacity: 0.85; }
.partner-copy strong { font-size: 11.5px; color: var(--muted); }
.partner-copy span { font-size: 10px; color: var(--muted-2); }

/* ── Page kicker: copper dot ─────────────────────────────────── */
.page-kicker::before {
  background: linear-gradient(180deg, var(--accent-copper), #8b4e28);
}
html[data-theme="light"] .page-kicker::before {
  background: linear-gradient(180deg, var(--accent-copper), #7a3d1e);
}

/* ── Card styles ─────────────────────────────────────────────── */
.card, .stat-card {
  border-radius: 22px;
}
.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Summary cards: Fraunces numerals ───────────────────────── */
.summary-card strong,
.summary-metric strong,
.stat-card .value {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
}

/* ── Dashboard date greeting ─────────────────────────────────── */
.dashboard-date-greeting {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-style: italic;
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  color: var(--muted);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

/* ── Dashboard pulse strip ───────────────────────────────────── */
.dashboard-pulse-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.dashboard-pulse-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
}
.dashboard-pulse-chip span { color: var(--muted); font-size: 12px; }
.dashboard-pulse-chip strong { color: var(--text); }
.dashboard-pulse-chip.is-good { border-color: rgba(107, 201, 138, 0.28); }
.dashboard-pulse-chip.is-alert { border-color: rgba(224, 122, 106, 0.28); }
.dashboard-pulse-chip.is-neutral { border-color: var(--border); }
.dashboard-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}
.dashboard-pulse-chip.is-good .dashboard-pulse-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(107, 201, 138, 0.22); }
.dashboard-pulse-chip.is-alert .dashboard-pulse-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(224, 122, 106, 0.22); }
html[data-theme="light"] .dashboard-pulse-chip { background: rgba(255,253,247,0.98); }

/* ── Dashboard hero grid: wider metrics ──────────────────────── */
.dashboard-hero-card {
  background:
    radial-gradient(ellipse at top right, rgba(181, 113, 63, 0.12), transparent 36%),
    radial-gradient(ellipse at bottom left, rgba(79, 146, 96, 0.14), transparent 40%),
    linear-gradient(180deg, var(--panel-strong), var(--panel));
  border-color: rgba(140, 202, 154, 0.14);
}
.dashboard-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.dashboard-hero-copy h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(1.5rem, 1.8vw, 2.1rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

/* ── Dashboard priority cards ────────────────────────────────── */
.dashboard-priority-card {
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.dashboard-priority-card span { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.dashboard-priority-card strong { display: block; font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; font-size: 1.05rem; margin: 4px 0 2px; }
.dashboard-priority-card small { display: block; color: var(--muted); font-size: 12px; }
.dashboard-priority-card.is-good { border-color: rgba(107, 201, 138, 0.24); background: rgba(107, 201, 138, 0.05); }
.dashboard-priority-card.is-alert { border-color: rgba(224, 122, 106, 0.24); background: rgba(224, 122, 106, 0.05); }
.dashboard-priority-card.is-neutral { border-color: var(--border); }

/* ── Dashboard mini icon: botanical letter token ─────────────── */
.dashboard-mini-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-copper-soft);
  border: 1px solid rgba(181, 113, 63, 0.20);
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-copper);
  flex-shrink: 0;
}
html[data-theme="light"] .dashboard-mini-icon {
  background: rgba(160, 90, 44, 0.10);
  border-color: rgba(160, 90, 44, 0.18);
  color: var(--accent-copper);
}
.dashboard-mini-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dashboard-mini-stat > div { display: grid; gap: 2px; }

/* ── Summary metrics numbers ─────────────────────────────────── */
.summary-metric strong {
  font-size: 1.15rem;
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}
.summary-metric span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--muted-2);
}
.summary-metric.emphasize strong { font-size: 1.5rem; color: var(--accent-light); }
.summary-card strong { font-size: 1.55rem; letter-spacing: -0.02em; }
.summary-card span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); }

/* ── Dashboard activity items ────────────────────────────────── */
.dashboard-activity-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dashboard-activity-item:last-child { border-bottom: none; }

/* ── Stock watch items ───────────────────────────────────────── */
.dashboard-stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dashboard-stock-item:last-child { border-bottom: none; }

/* ── Shift rows ──────────────────────────────────────────────── */
.dashboard-shift-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.dashboard-shift-row:last-child { border-bottom: none; }
.dashboard-shift-row span { color: var(--muted); }
.dashboard-shift-row strong { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; }

/* ── Badge: success/warn/danger ──────────────────────────────── */
.badge.success::before { background: var(--success); }
.badge.warn::before { background: var(--warn); }
.badge.danger::before { background: var(--danger); }

/* ── POS index: catalog card ─────────────────────────────────── */
.pos-home-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}
.pos-catalog-card { margin-bottom: 0; }
.pos-home-side { display: grid; gap: 18px; }

/* ── POS: category chip rail ─────────────────────────────────── */
.plant-catalog-chip-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 0 6px;
  scrollbar-width: none;
}
.plant-catalog-chip-rail::-webkit-scrollbar { display: none; }
.plant-catalog-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background 120ms ease, border-color 120ms ease;
}
.plant-catalog-chip:hover { background: rgba(79, 146, 96, 0.12); border-color: rgba(140, 202, 154, 0.28); }
.plant-catalog-chip.is-active {
  background: rgba(79, 146, 96, 0.22);
  border-color: rgba(140, 202, 154, 0.36);
  color: var(--accent-light);
}
.plant-catalog-chip-count {
  font-size: 11px;
  color: var(--muted-2);
  font-weight: 500;
}
html[data-theme="light"] .plant-catalog-chip { background: rgba(255,253,247,0.98); border-color: rgba(60,100,70,0.14); color: #1a2e1c; }
html[data-theme="light"] .plant-catalog-chip:hover { background: rgba(61,122,79,0.09); border-color: rgba(61,122,79,0.24); }
html[data-theme="light"] .plant-catalog-chip.is-active { background: rgba(61,122,79,0.15); border-color: rgba(61,122,79,0.30); color: #2a5e3a; }

/* ── POS product grid: botanical refinement ──────────────────── */
.plant-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px 0 0;
}
.plant-product-card {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(14, 28, 18, 0.94), rgba(10, 20, 13, 0.92));
  color: var(--text);
  text-decoration: none;
  transition: transform 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}
.plant-product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(140, 202, 154, 0.32);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  text-decoration: none;
  color: var(--text);
}
.plant-product-thumb {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(45, 90, 58, 0.9), rgba(30, 62, 42, 0.92));
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-style: italic;
  font-size: 2rem;
  font-weight: 700;
  color: rgba(140, 202, 154, 0.85);
  overflow: hidden;
}
.plant-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plant-product-thumb-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.plant-product-copy {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
}
.plant-product-copy strong { font-size: 13px; font-weight: 700; line-height: 1.3; }
.plant-product-copy small { font-size: 11px; color: var(--muted-2); }
.plant-product-copy span { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; font-size: 0.95rem; font-weight: 700; color: var(--accent-light); margin-top: 2px; }
html[data-theme="light"] .plant-product-card { background: rgba(255, 253, 247, 0.98); border-color: rgba(60,100,70,0.14); }
html[data-theme="light"] .plant-product-thumb { background: linear-gradient(180deg, #d4e8d8, #bfdbc5); color: #2a5e3a; }
html[data-theme="light"] .plant-product-copy span { color: var(--accent); }
html[data-theme="light"] .plant-product-card:hover { border-color: rgba(61,122,79,0.28); }

/* ── POS product accordion (existing) ───────────────────────── */
.plant-category-accordion {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
}
.plant-category-accordion summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  background: var(--panel);
  font-weight: 600;
  font-size: 14px;
}
.plant-category-accordion summary::-webkit-details-marker { display: none; }
.plant-category-accordion summary div { display: grid; gap: 2px; }
.plant-category-accordion summary small { color: var(--muted); font-size: 12px; font-weight: 400; }
.plant-category-accordion summary span { color: var(--muted-2); font-size: 12px; }
.plant-category-accordion[open] summary { border-bottom: 1px solid var(--border); }
.plant-category-accordion > .plant-product-grid { padding: 14px 16px; }
html[data-theme="light"] .plant-category-accordion { border-color: rgba(60,100,70,0.12); }
html[data-theme="light"] .plant-category-accordion summary { background: rgba(255,253,247,0.98); }

/* ── POS action bar ──────────────────────────────────────────── */
.pos-home-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.pos-home-action-bar-right { display: flex; gap: 10px; flex-wrap: wrap; }
.pos-shift-open-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}
.pos-shift-open-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(107, 201, 138, 0.28);
  animation: pulse-dot 2s ease-in-out infinite;
}
.pos-shift-closed-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--warn);
}
.pos-shift-closed-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(107, 201, 138, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(107, 201, 138, 0.10); }
}

/* ── POS home list items ─────────────────────────────────────── */
.pos-home-list { display: grid; gap: 6px; }
.pos-home-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
  color: var(--text);
  font-size: 13px;
  transition: background 120ms, border-color 120ms;
}
.pos-home-list-item:hover { background: rgba(79,146,96,0.08); border-color: rgba(140,202,154,0.18); text-decoration: none; color: var(--text); }
.pos-home-list-item > div { display: grid; gap: 2px; }
.pos-home-list-item strong { font-size: 13.5px; font-weight: 700; }
.pos-home-list-item span { color: var(--muted); font-size: 12px; }
html[data-theme="light"] .pos-home-list-item { background: rgba(255,253,247,0.85); border-color: rgba(60,100,70,0.10); }
html[data-theme="light"] .pos-home-list-item:hover { background: rgba(61,122,79,0.07); border-color: rgba(61,122,79,0.18); }

/* ── Note/info panel: copper theme ──────────────────────────── */
.note-panel, .plant-note-soft {
  border-color: rgba(181, 113, 63, 0.20);
  background: rgba(181, 113, 63, 0.07);
}
.note-panel strong { color: var(--accent-copper); }
html[data-theme="light"] .note-panel, html[data-theme="light"] .plant-note-soft {
  border-color: rgba(160, 90, 44, 0.22);
  background: rgba(160, 90, 44, 0.07);
}
html[data-theme="light"] .note-panel strong { color: var(--accent-copper); }

/* ── Empty state: botanical border ──────────────────────────── */
.empty-state {
  border-color: rgba(79, 146, 96, 0.18);
  background: rgba(79, 146, 96, 0.03);
}
html[data-theme="light"] .empty-state { border-color: rgba(61,122,79,0.18); background: rgba(61,122,79,0.03); }

/* ── Login: botanical left panel ─────────────────────────────── */
.login-brand {
  background:
    radial-gradient(ellipse at top right, rgba(181, 113, 63, 0.18), transparent 40%),
    linear-gradient(155deg, rgba(79, 146, 96, 0.24), rgba(45, 110, 66, 0.38) 48%, rgba(6, 12, 8, 0.97) 100%),
    #080f0a;
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cellipse cx='20' cy='40' rx='6' ry='18' fill='none' stroke='%234f9260' stroke-width='1' opacity='0.18' transform='rotate(-30 20 40)'/%3E%3Cellipse cx='60' cy='20' rx='5' ry='14' fill='none' stroke='%234f9260' stroke-width='1' opacity='0.14' transform='rotate(20 60 20)'/%3E%3Ccircle cx='40' cy='65' r='3' fill='%23b5713f' opacity='0.14'/%3E%3C/svg%3E");
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}
.login-brand::before { z-index: 0; }
.login-brand > * { position: relative; z-index: 2; }
.login-card h2 { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; font-size: 1.8rem; letter-spacing: -0.02em; }
.login-brand-card { border-radius: 12px; }
.login-brand-name { font-family: 'DM Sans', sans-serif; }

/* ── Login splash grid: botanical ────────────────────────────── */
.login-splash-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
}
.login-splash-grid > div strong { font-size: 13.5px; font-weight: 700; color: var(--accent-light); }
.login-splash-grid > div span { font-size: 12px; color: rgba(200, 220, 200, 0.82); line-height: 1.5; }
.login-splash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-splash-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(181, 113, 63, 0.18);
  border: 1px solid rgba(181, 113, 63, 0.28);
  color: #e0a87a;
}
.login-splash-copy h1 { color: #f2f7f0; margin-bottom: 10px; }
.login-splash-copy p { color: rgba(200, 218, 202, 0.90); }
.login-card { background: linear-gradient(180deg, rgba(8, 16, 10, 0.98), rgba(6, 12, 8, 0.99)); }
html[data-theme="light"] .login-card {
  background: linear-gradient(180deg, rgba(253, 250, 243, 0.99), rgba(248, 244, 237, 0.99));
}
html[data-theme="light"] .login-card h2 { color: #1a2e1c; }
html[data-theme="light"] .login-card .subtle { color: #5c7260; }

/* ── Topbar search ───────────────────────────────────────────── */
.search-input { font-family: 'DM Sans', sans-serif; }
.search-input-wrap { border-color: var(--border-strong); }
.search-result-type.type-client  { background: rgba(79,146,96,0.16);  color: var(--accent-light); }
.search-result-type.type-invoice { background: rgba(201,168,76,0.14); color: var(--accent-gold); }
.search-result-type.type-sale    { background: rgba(107,201,138,0.12); color: var(--success); }
.search-result-type.type-product { background: rgba(181,113,63,0.14); color: var(--accent-copper); }

/* ── User chip ───────────────────────────────────────────────── */
.user-chip { border-color: var(--border-strong); }
.user-chip-dot { background: var(--success); box-shadow: 0 0 0 2px rgba(107, 201, 138, 0.22); }

/* ── Compact grid (dashboard mini metrics) ───────────────────── */
.compact-grid-2, .grid-2 { gap: 16px; }
.compact-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

/* ── Dashboard panels ────────────────────────────────────────── */
.dashboard-panel { margin-bottom: 0; }
.dashboard-section-head { flex-wrap: wrap; gap: 10px; }
.dashboard-inline-note { font-size: 12px; color: var(--muted-2); }
.dashboard-inline-note.is-success { color: var(--success); }

/* ── Wrap actions ────────────────────────────────────────────── */
.wrap-actions { flex-wrap: wrap; gap: 10px; }

/* ── Finance: Fraunces numbers ───────────────────────────────── */
.finance-gap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.finance-gap-grid > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel); }
.finance-gap-grid > div span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); }
.finance-gap-grid > div strong { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; font-size: 1.5rem; letter-spacing: -0.02em; }

/* ── Responsive: mobile sidebar ──────────────────────────────── */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .dashboard-hero-grid { grid-template-columns: 1fr; }
  .pos-home-layout { grid-template-columns: 1fr; }
  .pos-home-browser { grid-column: 1; }
}
@media (max-width: 760px) {
  .dashboard-hero-copy h2 { font-size: 1.5rem; }
  .login-splash-grid { grid-template-columns: 1fr; }
  .dashboard-pulse-strip { gap: 8px; }
  .dashboard-pulse-chip { padding: 7px 11px; font-size: 12px; }
  .plant-product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}


/* ═══════════════════════════════════════════════════════════════
   DENSITY PASS — compact proportions, reduced visual weight
   2026-06-13
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout: narrower sidebar, tighter main ──────────────────── */
.layout { grid-template-columns: 230px minmax(0, 1fr); }
.main { padding: 14px 20px 22px; }

/* ── Topbar: smaller heading, less bottom margin ─────────────── */
.topbar { margin-bottom: 10px; gap: 14px; }
.topbar h1,
h1.page-title { font-size: clamp(1.15rem, 1.4vw, 1.45rem); letter-spacing: -0.018em; }
.page-kicker { padding: 3px 8px; font-size: 10px; margin-bottom: 5px; }
.subtle { font-size: 12px; }

/* ── Sidebar: tighter internal padding, slimmer nav items ─────── */
.sidebar { padding: 12px 10px; }
.brand-shell { margin-bottom: 12px; }
.brand-wordmark { padding: 8px 4px; }
.nav-groups { gap: 0px; }
.nav-group { padding: 2px 0; }
.nav-title { padding: 7px 8px 3px; font-size: 9px; letter-spacing: 0.18em; }
.nav { gap: 2px; }
.nav a { padding: 6px 8px; font-size: 12.5px; gap: 8px; }
.nav-icon { width: 15px; height: 15px; }

/* ── Cards: tighter padding and radius ───────────────────────── */
.card { padding: 13px 15px; margin-bottom: 14px; border-radius: 18px; }
.stat-card { padding: 14px 16px; border-radius: 18px; }
.card-header { margin-bottom: 10px; }
.card-header h3 { font-size: 0.88rem; }
.card-header p { font-size: 12px; margin-top: 2px; }

/* ── Buttons: slimmer height and font ────────────────────────── */
.btn { min-height: 34px; padding: 7px 12px; font-size: 13px; border-radius: 11px; }
.btn-sm { min-height: 26px; padding: 4px 9px; font-size: 11.5px; border-radius: 9px; }
.btn-primary { box-shadow: 0 6px 16px rgba(0, 97, 44, 0.22); }

/* ── Badges: tighter ─────────────────────────────────────────── */
.badge { padding: 4px 8px; font-size: 11px; gap: 6px; }
.badge::before { width: 6px; height: 6px; }

/* ── Summary cards: smaller numerals, less padding ───────────── */
.summary-card { padding: 11px 13px; gap: 3px; border-radius: 16px; }
.summary-card strong { font-size: 1.1rem; }
.summary-card small { font-size: 10.5px; }
.summary-card span { font-size: 10px; }

/* ── Dashboard: compressed spacing throughout ────────────────── */
.dashboard-date-greeting { font-size: 0.82rem; margin-bottom: 8px; }
.dashboard-pulse-strip { margin-bottom: 12px; gap: 7px; }
.dashboard-pulse-chip { padding: 6px 10px; font-size: 11.5px; gap: 7px; border-radius: 10px; }
.dashboard-pulse-chip span { font-size: 11px; }
.dashboard-pulse-dot { width: 6px; height: 6px; }

/* ── Dashboard hero card ─────────────────────────────────────── */
.dashboard-hero-card.card { padding: 13px 15px; }
.compact-grid-3 { gap: 9px; }

/* ── Dashboard mini metrics ──────────────────────────────────── */
.dashboard-mini-metrics.grid-6 { gap: 9px; }
.dashboard-mini-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 0.82rem; }
.dashboard-mini-stat { gap: 9px; }
.dashboard-mini-stat > div { gap: 1px; }

/* ── Dashboard section heads + panels ────────────────────────── */
.dashboard-section-head { margin-bottom: 10px; }
.dashboard-panel-spacious { padding: 15px 17px; }
.dashboard-primary-grid,
.dashboard-activity-grid-refresh { gap: 12px; margin-bottom: 14px; }
.dashboard-summary-grid-2 { gap: 9px; margin-bottom: 10px !important; }

/* ── Summary metrics (shift / stock panels) ──────────────────── */
.summary-metric { padding: 8px 10px; }
.summary-metric strong { font-size: 0.95rem; }
.summary-metric span { font-size: 10px; letter-spacing: 0.08em; }
.summary-metric.emphasize strong { font-size: 1.1rem; }

/* ── Dashboard stock/shift/activity items ────────────────────── */
.dashboard-stock-item { padding: 7px 0; }
.dashboard-shift-row { padding: 5px 0; font-size: 12px; }
.dashboard-activity-item { padding: 7px 0; }
.dashboard-inline-note { padding: 3px 8px; font-size: 11px; }

/* ── Tables: denser ─────────────────────────────────────────── */
th, td { padding: 9px 12px; }
th { font-size: 10.5px; }

/* ── Finance grid ────────────────────────────────────────────── */
.finance-gap-grid > div { padding: 10px 12px; }
.finance-gap-grid > div strong { font-size: 1.2rem; }

/* ── POS action bar ──────────────────────────────────────────── */
.pos-home-action-bar { padding: 10px 14px; margin-bottom: 12px; }
.plant-catalog-chip { padding: 6px 11px; font-size: 12px; }

/* ── Login: proportional ─────────────────────────────────────── */
.login-card h2 { font-size: 1.5rem; }

/* ── Empty state: tighter ────────────────────────────────────── */
.empty-state { padding: 24px 20px; }
.empty-state strong { font-size: 13.5px; }
.empty-state span { font-size: 12px; }

/* ── Light mode density (mirrors above) ──────────────────────── */
html[data-theme="light"] .summary-card strong { font-size: 1.1rem; }

/* ── Responsive: maintain layout at narrower sidebar ─────────── */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
}

/* ── Email settings: status bar + test strip ─────────────────── */
.email-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}
.email-status-bar.is-good { border-color: rgba(107,201,138,0.28); background: rgba(107,201,138,0.05); }
.email-status-bar.is-warn { border-color: rgba(212,164,58,0.32); background: rgba(212,164,58,0.06); }
.email-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-2); flex-shrink: 0;
}
.email-status-bar.is-good .email-status-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(107,201,138,0.22); }
.email-status-bar.is-warn .email-status-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(212,164,58,0.20); }
.email-status-bar strong { color: var(--text); font-size: 13px; }
.email-status-bar span { color: var(--muted); font-size: 12.5px; }
html[data-theme="light"] .email-status-bar { background: rgba(255,253,247,0.98); }
html[data-theme="light"] .email-status-bar.is-good { background: rgba(107,201,138,0.06); }
html[data-theme="light"] .email-status-bar.is-warn { background: rgba(212,164,58,0.07); }

.email-test-strip {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.smtp-only-fields {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  margin-bottom: 14px;
}
html[data-theme="light"] .smtp-only-fields { background: rgba(0,0,0,0.02); }

/* ── Settings: vertical tab shell ───────────────────────────── */
.settings-shell { display:grid; grid-template-columns:200px minmax(0,1fr); gap:0; min-height:480px; }
.settings-sidenav { border-right:1px solid var(--border); padding:10px 8px; display:flex; flex-direction:column; gap:2px; }
.settings-sidenav-section { font-size:10px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--muted-2); padding:6px 10px 4px; margin-top:6px; }
.settings-sidenav-btn { display:flex; align-items:center; gap:9px; padding:8px 10px; border-radius:10px;
  font-size:13px; font-weight:500; color:var(--muted); background:none; border:none;
  cursor:pointer; text-align:left; width:100%; transition:background 100ms, color 100ms; }
.settings-sidenav-btn:hover { background:rgba(79,146,96,0.08); color:var(--text); }
.settings-sidenav-btn.is-active { background:rgba(79,146,96,0.18);
  color:var(--text); font-weight:700; box-shadow:inset 3px 0 0 var(--accent); border-radius:0 10px 10px 0; }
.settings-sidenav-icon { width:16px; height:16px; flex-shrink:0; opacity:0.65; }
.settings-sidenav-btn.is-active .settings-sidenav-icon { opacity:1; color:var(--accent-light); }
.settings-sidenav-badge { margin-left:auto; width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.settings-sidenav-badge.is-warn { background:var(--warn); box-shadow:0 0 0 2px rgba(212,164,58,.22); }
.settings-sidenav-badge.is-good { background:var(--success); box-shadow:0 0 0 2px rgba(107,201,138,.22); }
.settings-panel { padding:24px 28px; display:none; }
.settings-panel.is-active { display:block; }
.settings-panel-title { font-size:0.82rem; font-weight:700; color:var(--muted-2);
  text-transform:uppercase; letter-spacing:.12em; margin-bottom:18px;
  padding-bottom:10px; border-bottom:1px solid var(--border); }
.settings-panel-footer { margin-top:24px; padding-top:16px; border-top:1px solid var(--border);
  display:flex; gap:10px; align-items:center; }

/* ── Email mode: radio cards ─────────────────────────────────── */
.email-mode-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:20px; }
.email-mode-card { position:relative; }
.email-mode-card input[type=radio] { position:absolute; opacity:0; width:0; height:0; }
.email-mode-card label { display:flex; flex-direction:column; gap:5px; padding:14px 15px;
  border-radius:14px; border:1px solid var(--border); background:var(--panel);
  cursor:pointer; transition:border-color 130ms, background 130ms; height:100%; }
.email-mode-card label strong { font-size:13px; color:var(--text); }
.email-mode-card label span { font-size:11.5px; color:var(--muted); line-height:1.45; }
.email-mode-card label .email-mode-tag { display:inline-block; font-size:10px; font-weight:700;
  text-transform:uppercase; letter-spacing:.08em; padding:2px 6px; border-radius:5px;
  background:rgba(79,146,96,0.12); color:var(--accent-light); margin-top:2px; align-self:flex-start; }
.email-mode-card input:checked + label { border-color:rgba(79,146,96,.5); background:rgba(79,146,96,.10); }
.email-mode-card input:checked + label strong { color:var(--accent-light); }
html[data-theme="light"] .email-mode-card label { background:rgba(255,255,255,.9); }
html[data-theme="light"] .email-mode-card input:checked + label { background:rgba(79,146,96,.06); }

/* ── Email status bar: bigger and bolder ─────────────────────── */
.email-status-bar { font-size:14px; font-weight:500; padding:14px 18px; margin-bottom:22px; gap:12px; }
.email-status-bar strong { font-size:14px; }
.email-status-dot { width:10px; height:10px; }

/* ── SMTP credential block ───────────────────────────────────── */
.smtp-cred-block { padding:16px 18px; border-radius:14px;
  border:1px solid var(--border); background:rgba(255,255,255,.02); margin-bottom:16px; }
.smtp-cred-block-title { font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:.1em; color:var(--muted-2); margin-bottom:12px; }
html[data-theme="light"] .smtp-cred-block { background:rgba(0,0,0,.02); }

/* ── Responsive: stack sidenav on narrow screens ─────────────── */
@media (max-width:860px) {
  .settings-shell { grid-template-columns:1fr; }
  .settings-sidenav { flex-direction:row; flex-wrap:wrap; border-right:none; border-bottom:1px solid var(--border); padding:8px 12px; }
  .settings-sidenav-section { display:none; }
  .settings-sidenav-btn { padding:6px 10px; font-size:12px; border-radius:8px; }
  .settings-sidenav-btn.is-active { box-shadow:none; border-radius:8px;
    background:rgba(79,146,96,0.18); }
  .settings-panel { padding:18px 20px; }
}

/* ═══════════════════════════════════════════════════════════════
   STANDARDIZATION PASS — uniform type scale, compact forms
   2026-06-14
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Type: DM Sans for ALL content headings ───────────────── */
/* Strip Fraunces from h2/h3/h4 everywhere except display contexts */
h2, h3, h4 { font-family: 'DM Sans', ui-sans-serif, sans-serif; }

.card-header h2,
.card-header h3,
.form-toolbar h2,
.form-toolbar h3,
.hero h2,
.pos-home-card h3,
.dashboard-section-head h3,
.section-header h2,
.section-header h3,
.document-panel-head h4,
.settings-section-head h4,
.settings-panel-title {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
}

/* Preserve Fraunces only on the top-level page title and login */
.topbar h1,
.login-brand h1,
.login-card h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
}

/* ── 2. Content heading sizes — calibrated scale ─────────────── */
/* Card and toolbar h3: tight, semi-display weight */
.card-header h3,
.form-toolbar h3 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Document panel subheadings */
.document-panel-head h4,
.settings-section-head h4,
h4 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  margin: 0 0 3px;
}

/* Hero h2: slightly larger, still DM Sans */
.hero h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── 3. Form inputs: compact everywhere ──────────────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]),
select,
.form-input {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 10px;
  line-height: 1.3;
}
textarea {
  min-height: 74px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
  line-height: 1.45;
}
/* Filter bars: even more compact */
.filter-bar input,
.filter-bar select {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12.5px;
}

/* ── 4. Labels: restore compact uppercase muted style ────────── */
.form-group label,
label.form-label,
.filter-bar label,
.form-group > label:first-child {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-2);
  display: block;
}
/* Prevent label from inheriting grid layout from Garden Atelier */
.form-group { gap: 5px; }
.form-grid { gap: 12px 16px; }
.document-form-grid { gap: 10px 14px; }

/* ── 5. Document panel compact ───────────────────────────────── */
.document-panel-head { margin-bottom: 10px; }
.document-panel-head p { font-size: 11.5px; color: var(--muted); margin: 2px 0 0; }
.document-overview-grid { gap: 12px; }

/* ── 6. Table: tighter rows everywhere ───────────────────────── */
th, td { padding: 7px 11px; }
th { font-size: 10px; letter-spacing: 0.1em; }
.row-title strong { font-size: 13px; font-weight: 600; }
.row-title span { font-size: 11.5px; }

/* ── 7. Detail grid (dt/dd pairs): small and muted ───────────── */
.detail-grid dt {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.detail-grid dd {
  font-size: 13px;
  font-weight: 500;
  margin: 3px 0 0;
  color: var(--text);
}

/* ── 8. Form toolbar: tighter and centred ────────────────────── */
.form-toolbar { align-items: center; margin-bottom: 12px; gap: 10px; }
.form-toolbar .subtle { font-size: 11.5px; }

/* ── 9. Inline actions: consistent small gap ─────────────────── */
.inline-actions { gap: 6px; }

/* ── 10. Badges: keep compact from density pass ─────────────── */
.badge { padding: 3px 7px; font-size: 10.5px; gap: 5px; border-radius: 999px; }
.badge::before { width: 5px; height: 5px; }

/* ── 11. Page subtitle (topbar .subtle) ─────────────────────── */
.topbar .subtle,
.topbar > div > .subtle { font-size: 11.5px; }

/* ── 12. Stat / metric numbers: DM Sans not Fraunces ─────────── */
.stat strong { font-family: 'DM Sans', sans-serif; font-size: 18px; font-weight: 700; }

/* ── 13. Page kicker pill ────────────────────────────────────── */
.page-kicker { font-size: 10px; padding: 3px 7px; letter-spacing: 0.1em; margin-bottom: 4px; }

/* ── 14. Card header sub-text ────────────────────────────────── */
.card-header p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ── 15. Section headers in Ledger / Finance / Reports ───────── */
.section-header h1,
.section-header h2,
.section-header h3 {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── 16. Light mode mirrors ──────────────────────────────────── */
html[data-theme="light"] .form-group label,
html[data-theme="light"] label.form-label {
  color: var(--muted-2);
}

/* Specificity fix: cover input.form-input and select.form-input */
input.form-input,
select.form-input,
textarea.form-input,
.form-input {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 10px;
}
textarea.form-input { min-height: 74px; padding: 8px 10px; }

/* ════════════════════════════════════════════════════════════════════
   PATCH 3 — Strip Fraunces from data values; standardize content area
   ═══════════════════════════════════════════════════════════════════ */

/* Data metric values: DM Sans everywhere (Fraunces is display-only for .topbar h1) */
.summary-card strong,
.summary-metric strong,
.stat-card .value,
.dashboard-priority-card strong,
.dashboard-shift-row strong,
.finance-gap-grid > div strong {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
  font-optical-sizing: normal;
  font-style: normal;
}

/* Light-mode specificity: repeat with [data-theme] selector to beat any earlier
   html[data-theme="light"] .* rules that might reset font-family */
html[data-theme="light"] .summary-card strong,
html[data-theme="light"] .summary-metric strong,
html[data-theme="light"] .stat-card .value,
html[data-theme="light"] .dashboard-shift-row strong,
html[data-theme="light"] .finance-gap-grid > div strong {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
}

/* Date greeting: small DM Sans, no italic, muted */
.dashboard-date-greeting {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

/* Dashboard hero heading (higher specificity than h2 rule — needs explicit override) */
.dashboard-hero-copy h2 {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
  font-optical-sizing: normal;
}

/* Finance gap grid: tighter value size to match content density */
.finance-gap-grid > div strong {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

/* Summary card values: reduce further in light mode to match refined density */
html[data-theme="light"] .summary-card strong { font-size: 1.05rem; }
html[data-theme="light"] .summary-metric strong { font-size: 0.9rem; }

/* Dashboard mini-stat values: tighten */
.dashboard-mini-stat strong {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Topbar subtitle line: smaller, muted */
.topbar .subtle { font-size: 11.5px; color: var(--muted-2); }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE SYSTEM — 4-breakpoint coherent layer
   Appended last so cascade always wins over scattered earlier rules.

   Large desktop  ≥ 1440px  — wider sidebar, more breathing room
   Small desktop  1181–1439px — 260px sidebar (unchanged baseline)
   [existing]     ≤ 1180px  — sidebar collapses to toggle drawer
   Tablet         ≤ 1024px  — single-column grids, layout fixes
   Mobile         ≤ 680px   — table scroll, stacked headers, full-width forms
   ═══════════════════════════════════════════════════════════════════ */

/* ── Large desktop (≥ 1440px) ─────────────────────────────────── */
@media (min-width: 1440px) {
  .layout { grid-template-columns: 290px minmax(0, 1fr); }
  .main { padding: 30px 36px 40px; }
  .main-shell { max-width: 1700px; }
  .sidebar { padding: 20px 14px; }
}

/* ── Tablet (≤ 1024px) ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .main { padding: 18px 20px 28px; }

  /* Collapse two- and three-column content grids */
  .grid-2, .grid.two,
  .grid-3, .grid.three,
  .finance-grid,
  .dashboard-hero-grid { grid-template-columns: 1fr; }

  /* Filter bar: prevent labels overflowing */
  .filter-bar label { min-width: 0; flex: 1 1 160px; }

  /* Inline actions wrap at tablet width */
  .topbar-actions { flex-wrap: wrap; gap: 8px; }
  .inline-actions { flex-wrap: wrap; }
}

/* ── Mobile (≤ 680px) ─────────────────────────────────────────── */
@media (max-width: 680px) {
  /* Main content: tighter padding */
  .main { padding: 12px 14px 24px; }

  /* Topbar: stack heading and action buttons */
  .topbar { grid-template-columns: 1fr; gap: 10px; }
  .topbar-actions { justify-content: flex-start; }

  /* Card headers: let buttons fall below the title */
  .card-header { flex-wrap: wrap; gap: 8px; }
  .card-header .inline-actions { justify-content: flex-start; }

  /* Narrow cards: fill the viewport */
  .narrow-card { max-width: 100%; }

  /* ── Tables: horizontal scroll block ──
     Setting display:block on <table> creates a new BFC that honours
     overflow-x. Inner thead/tbody/tr/th/td keep their table display
     values so columns and borders still render correctly.
     min-width:0 removes the 640px floor; the table can be as narrow
     as its content but will scroll if it needs more. ── */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    width: 100%;
  }
  /* Tighter cells on mobile */
  th, td { padding: 8px 10px; font-size: 12px; }
  /* Let tfoot rows look right in block mode */
  thead, tbody, tfoot, tr { display: block; min-width: max-content; }
  tr { display: table-row; }
  thead { display: table-header-group; }
  tbody { display: table-row-group; }
  tfoot { display: table-footer-group; }

  /* Form grids: force single column */
  .form-grid,
  .form-grid.compact,
  .line-item-row { grid-template-columns: 1fr; }

  /* Form actions: full-width-ish buttons */
  .form-actions { flex-wrap: wrap; gap: 8px; }
  .form-actions .btn { flex: 1; min-width: 120px; text-align: center; }

  /* Sticky actions bar: stack nicely */
  .sticky-actions { padding: 10px 14px; }

  /* Filter bar: fully vertical */
  .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .filter-bar label { min-width: 0; width: 100%; }
  .filter-bar .btn { width: 100%; justify-content: center; }

  /* Stats grid: 2 across (not single column — keeps visual density) */
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Summary cards: single column */
  .summary-cards { grid-template-columns: 1fr; }

  /* Detail list: horizontal to vertical */
  .detail-list { grid-template-columns: 1fr; }
  .detail-list dt { padding-bottom: 0; }

  /* Inline actions in tight spots */
  .inline-actions { gap: 6px; }

  /* Page section overflow guard for scrollable tables */
  .page-section { overflow: visible; }

  /* Payroll / employee grids used with inline style overrides */
  .dashboard-grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* ── Cat 2: Touch & Interaction ──────────────────────────── */
button, .btn, .nav a, [role="button"],
.presenter-list-row, .presenter-search-result,
.plant-product-card, .pos-home-list-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 60ms;
  box-shadow: none;
}
.btn-primary:active {
  transform: translateY(0) scale(0.95);
}
.nav a:active {
  opacity: 0.65;
  transition-duration: 60ms;
}
.presenter-list-row:active,
.presenter-search-result:active,
.pos-home-list-item:active {
  opacity: 0.65;
  transition-duration: 60ms;
}
.plant-product-card:active {
  transform: scale(0.97);
  transition-duration: 60ms;
}

/* ── Cat 3: Performance — image CLS guard ────────────────── */
.brand-wordmark img,
.partner-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ── Cat 7: Reduced motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Cat 4: SVG icon labels in summary-card spans ─────────── */
.summary-card .icon-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.summary-card .icon-label svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── Invoice line-item density pass 2026-06-17 ────────────────────────── */
/* Collapse verbose helper text: keep it readable on hover only */
.document-line-item-helper {
  font-size: 10.5px;
  line-height: 1.3;
  opacity: 0.45;
  margin-top: -2px;
}
/* Tighter row padding */
.document-line-item-row {
  padding: 14px 18px;
}
/* Narrow the inter-control gap */
.invoice-line-item-controls {
  gap: 10px;
}
/* Shrink discount pill buttons to feel like annotations, not primary actions */
.document-line-discount-pills .btn {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 11px;
  opacity: 0.7;
}
.document-line-discount-pills {
  gap: 4px;
}
/* Tighten the VAT type select visual weight */
.invoice-line-item-controls .document-line-item-control:nth-child(3) .form-input {
  font-size: 13px;
}
/* Line total box: slightly smaller */
.invoice-line-item-controls .document-line-item-total {
  min-height: 80px;
  padding: 12px 14px;
}
.invoice-line-item-controls .document-line-item-total strong {
  font-size: 1.25rem;
}

/* ── Invoice line-item density pass 2 — helper texts removed 2026-06-17 ── */
/* Controls are shorter now; tighten label→input gap and vertically centre */
.document-line-item-control {
  gap: 6px;
}
.invoice-line-item-controls {
  align-items: center;
}
/* Discount pills row: fit two pills compactly */
.document-line-item-discount {
  gap: 6px;
}
/* Live total: compact, vertically centred */
.document-line-item-total {
  min-height: 72px;
  padding: 10px 14px;
}

/* ── Invoice line-item: stacked layout (product/desc row + controls row) 2026-06-17 ── */
/* Drop the side-by-side split entirely */
.invoice-line-item-layout {
  grid-template-columns: 1fr;
  gap: 10px;
}
/* Product (narrow) + description (grows) sit on one row */
.invoice-line-item-layout .document-line-item-main {
  grid-template-columns: minmax(140px, 0.55fr) 1fr;
  gap: 12px;
}
/* All 5 controls in a single row: qty | price | vat | discount | total */
.invoice-line-item-layout .invoice-line-item-controls {
  grid-template-columns: 118px minmax(80px, 1fr) 168px 96px 120px;
  align-items: start;
  gap: 10px;
}

/* ── Invoice: make the line-item row single-column so head sits above fields ── */
.document-editor-card .document-line-item-row {
  grid-template-columns: 1fr;
}

/* ── Discount pills: horizontal row, tighter columns ── */
.document-line-discount-pills {
  flex-wrap: nowrap;
}
/* Rebalance controls: narrow price, wider discount for 2-pill row */
.invoice-line-item-layout .invoice-line-item-controls {
  grid-template-columns: 110px minmax(100px, 0.8fr) 160px 100px 120px;
}
.document-line-item-discount .document-line-discount-pills .btn {
  padding: 2px 10px;
  font-size: 11.5px;
}
