/* Fresh Coast Optical — shared design system.
   One stylesheet for every page: home, CEO cockpit, team board, patient prep.
   Change a token here and it changes everywhere. */

:root {
  /* Brand — sampled from freshcoastoptical.com */
  --fco-navy: #123F5E;
  --fco-navy-light: #23739D;
  --fco-yellow: #F8E411;
  --fco-ink: #2A2328;

  /* Surfaces & text (light) */
  --surface-1: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f4;
  --text-primary: #2A2328;
  --text-secondary: #5c5760;
  --text-muted: #8a8690;
  --border: rgba(42, 35, 40, 0.10);

  /* Status */
  --good: #0ca30c;
  --good-bg: #e6f6e6;
  --warning: #b5790a;
  --serious: #b5560a;
  --critical: #b02a2a;

  /* Sample (patient prep) */
  --sample: #8a5a00;
  --sample-bg: #fff6db;

  /* Meters */
  --navy-track: #d9e4ec;
  --navy-fill: var(--fco-navy);
  --accent-heading: var(--fco-navy);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-1: #17191d;
    --surface-2: #1e2126;
    --surface-3: #262a30;
    --text-primary: #f2f1f0;
    --text-secondary: #c3c2c6;
    --text-muted: #8a8690;
    --border: rgba(255, 255, 255, 0.10);

    --good: #33c23a;
    --good-bg: #16301a;
    --warning: #f0b429;
    --serious: #e2734d;
    --critical: #e05b5b;

    --sample: #f0c040;
    --sample-bg: #2c2612;

    --navy-track: #2a3d4c;
    --navy-fill: #3f8fc4;
    --accent-heading: #6fb6e0;
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { padding-bottom: 60px; }
a { color: var(--accent-heading); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---- Header (shared, role-aware nav) ---- */
header.top {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
header.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 42px; width: auto; display: block; }
.brand .titles h1 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.brand .titles h1 a { color: inherit; text-decoration: none; }
.brand .titles p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }

.top-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.top-nav a {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  text-decoration: none; padding: 4px 2px;
}
.top-nav a:hover { color: var(--accent-heading); }
.top-nav a.active { color: var(--accent-heading); border-bottom: 2px solid var(--fco-yellow); }
.top-nav a.owner-only { display: none; } /* revealed by JS when role = owner */

.save-state {
  font-size: 12.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }

/* ---- Card ---- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px 20px;
}
.card h2 { font-size: 15.5px; margin: 0 0 2px; color: var(--accent-heading); }
.card .card-sub { font-size: 12.5px; color: var(--text-muted); margin: 0 0 18px; }

/* ---- Hero ---- */
section.hero { padding: 36px 0 8px; }
.hero-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 24px;
}
.hero-eyebrow {
  font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600; margin: 0 0 8px;
}
.hero-answer { font-size: 27px; font-weight: 750; margin: 0 0 4px; line-height: 1.3; color: var(--accent-heading); }
.hero-answer.status-good { color: var(--good); }
.hero-answer.status-warning { color: var(--warning); }
.hero-answer.status-neutral { color: var(--text-primary); }
.hero-sub { font-size: 14.5px; color: var(--text-secondary); margin: 0; }
.hero-sub b { color: var(--text-primary); }

/* ---- Inputs ---- */
input[type="number"], input[type="text"] {
  font-family: inherit; color: var(--text-primary);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
}
input:focus { outline: 2px solid var(--fco-navy-light); outline-offset: 1px; }

/* ---- Buttons ---- */
.btn {
  font-family: inherit; font-weight: 700; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--border);
  padding: 10px 16px; font-size: 14px;
  background: var(--surface-2); color: var(--text-primary);
}
.btn-primary { background: var(--fco-navy); color: #fff; border-color: var(--fco-navy); }
.btn-primary:hover { background: var(--fco-navy-light); }
.btn:disabled { opacity: 0.5; cursor: default; }
.link-btn {
  background: none; border: none; color: var(--text-muted);
  text-decoration: underline; cursor: pointer; font-size: 11.5px; padding: 0; font-family: inherit;
}

/* ---- Footer ---- */
footer.page-footer { padding: 32px 0 0; }
.footer-note {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.6;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* ---- Connection state chip (shared vs offline) ---- */
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.conn.offline .dot { background: var(--warning); }
