/* Grocers Support Systems — site styles */

:root {
  --green: #1f6f43;
  --green-dark: #17532f;
  --green-light: #e6f2eb;
  --ink: #1d2320;
  --muted: #5d6862;
  --line: #d9e0dc;
  --bg: #fafbfa;
  --card: #ffffff;
  --input: #ffffff;
  --thead: #f1f5f2;
  --hero-from: #123f24;
  --hero-to: #1a5c38;
  --accent: #d9822b;
  --radius: 10px;
  --max: 1080px;
  color-scheme: light;
}

/* Dark palette. Applies when the visitor's system prefers dark and no explicit
   choice was made, or when the toggle set data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #3c9a63;
    --green-dark: #2e7a4e;
    --green-light: #173322;
    --ink: #e8ebe9;
    --muted: #9aa6a0;
    --line: #2c3530;
    --bg: #121615;
    --card: #1a201d;
    --input: #141917;
    --thead: #1f2724;
    --hero-from: #0f3520;
    --hero-to: #17502f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --green: #3c9a63;
  --green-dark: #2e7a4e;
  --green-light: #173322;
  --ink: #e8ebe9;
  --muted: #9aa6a0;
  --line: #2c3530;
  --bg: #121615;
  --card: #1a201d;
  --input: #141917;
  --thead: #1f2724;
  --hero-from: #0f3520;
  --hero-to: #17502f;
  color-scheme: dark;
}

/* Theme toggle: a small round button in the header */
.theme-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0; margin-left: 10px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--green); }
a:hover { color: var(--green-dark); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.2px;
}

.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.nav { display: flex; gap: 6px; }

.nav a {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.nav a:hover { background: var(--green-light); color: var(--green-dark); }
.nav a.active { color: var(--green-dark); background: var(--green-light); }
.nav a.up { margin-left: 10px; font-weight: 500; opacity: 0.8; }

/* phone: the brand shows just its mark, the nav folds behind a menu button */
.menu-btn {
  display: none; width: 38px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font-size: 18px; cursor: pointer; margin-left: auto;
}
@media (max-width: 700px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
  .brand .brand-text { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .site-header .theme-btn { margin-left: 8px; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; gap: 0; padding: 6px 0 2px; border-top: 1px solid var(--line); margin-top: 8px; }
  .nav.open { display: flex; }
  .nav a { padding: 11px 6px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a.up { margin-left: 0; }
  .nav .auth-slot { display: block; padding: 8px 6px; }
}
.auth-slot { display: inline-flex; gap: 6px; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }

/* ---------- grocers.com main page ---------- */

.home {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.home-title {
  padding: 96px 0 40px;
}

.home-title h1 {
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: 4px;
  margin: 0 0 10px;
  color: var(--green-dark);
}

.home-title p { margin: 0; color: var(--muted); font-size: 18px; }

.home-links {
  list-style: none;
  padding: 0;
  margin: 0 0 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  max-width: 820px;
}

.home-links li { display: flex; flex-direction: column; }
.home-links li > a {
  display: block;
  flex: 1;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--green-dark);
}
.home-links li > a:hover { border-color: var(--green); background: var(--green-light); }
.home-links .tile-name { display: block; font-weight: 700; font-size: 20px; margin-bottom: 8px; }
.home-links .tile-desc { display: block; font-weight: 400; font-size: 15px; line-height: 1.5; color: var(--muted); }
.home-links .tile-links { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 6px 0; }
.home-links .tile-links a { font-size: 14px; font-weight: 600; color: var(--green-dark); text-decoration: none; }
.home-links .tile-links a:hover { text-decoration: underline; }

.home .site-footer { margin-top: auto; }

/* ---------- hero ---------- */

.hero {
  background: linear-gradient(160deg, var(--hero-from) 0%, var(--hero-to) 70%);
  color: #fff;
  padding: 88px 0 80px;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.12;
  margin: 0 0 20px;
  max-width: 14ch;
}

.hero p {
  font-size: 19px;
  max-width: 58ch;
  margin: 0 0 18px;
  opacity: 0.95;
}

.hero p:last-of-type { margin-bottom: 32px; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 16px;
}

.btn-light { background: #fff; color: #17532f; }
.btn-light:hover { background: var(--green-light); color: var(--green-dark); }
.btn-outline { border: 2px solid rgba(255,255,255,0.7); color: #fff; margin-left: 10px; }
.btn-outline:hover { border-color: #fff; color: #fff; }

/* ---------- sections ---------- */

section { padding: 64px 0; }

.section-title {
  font-size: 30px;
  margin: 0 0 8px;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 36px;
  max-width: 64ch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

.card .icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--green-light);
  color: var(--green-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.band { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  text-align: center;
}

.stat .num {
  font-size: 40px;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1;
}

.stat .label { color: var(--muted); margin-top: 6px; font-size: 15px; }

.contact-box {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.contact-box h2 { margin: 0 0 6px; font-size: 26px; }
.contact-box p { margin: 0; color: var(--muted); }
.contact-address {
  font-size: 18px; font-weight: 700; color: var(--green-dark);
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  user-select: all; white-space: nowrap;
}

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; }

/* ---------- clients table ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar input, .toolbar select {
  font: inherit;
  font-size: 15px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
}

.toolbar input { flex: 1 1 240px; }
.toolbar .count { color: var(--muted); font-size: 14px; margin-left: auto; }

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table { width: 100%; border-collapse: collapse; font-size: 15px; }

th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.contacts { white-space: normal; min-width: 180px; }

th {
  background: var(--thead);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

th:hover { color: var(--green-dark); }
th .arrow { opacity: 0.4; margin-left: 4px; }
th.sorted .arrow { opacity: 1; color: var(--green); }

tbody tr:hover { background: var(--green-light); }
tbody tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12.5px;
  font-weight: 600;
  margin-right: 4px;
}

.tag.pos { background: #fbe9d7; color: #8a4a0e; }

.note { color: var(--muted); font-size: 14px; margin-top: 14px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

@media (max-width: 600px) {
  .hero { padding: 60px 0 56px; }
  .btn-outline { margin-left: 0; margin-top: 10px; }

}

/* ---------- plain text pages (privacy etc.) ---------- */

.prose { max-width: 720px; padding-top: 48px; padding-bottom: 64px; }
.prose h1 { font-size: 32px; margin: 0 0 8px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--muted); font-size: 16px; }
.prose ul { padding-left: 22px; }
