/* Bichler App v1 — Joseph's prototype styling, kept close to what he approved,
   plus the sign-in gate and save indicator that server-side storage needs. */

* { box-sizing: border-box; }
:root {
  --navy: #0d3154;
  --blue: #1d5d8f;
  --light: #eef4f8;
  --line: #d8e1e8;
  --text: #1f2933;
  --muted: #66788a;
  --white: #ffffff;
  --good: #1c7a4a;
  --bad: #a32b1c;
}
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: var(--text); background: #f6f8fa; }
button, input, textarea { font: inherit; }

.brand { font-size: 24px; font-weight: 800; letter-spacing: .08em; }
.brand span { font-weight: 400; letter-spacing: .02em; }
.tagline { font-size: 13px; opacity: .85; margin-top: 3px; }

.button { border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.button.primary { background: var(--navy); color: var(--white); font-weight: 700; width: 100%; padding: 14px; margin-top: 20px; }
.button.secondary { background: white; color: var(--navy); font-weight: 700; }
.button.ghost { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.4); }
.button:disabled { opacity: .6; cursor: default; }

/* Sign-in gate */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--navy);
}
.gate[hidden] { display: none; }
.gate-card {
  background: white; border-radius: 16px; padding: 32px;
  width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.gate-card .brand { color: var(--navy); }
.gate-card .tagline { color: var(--muted); margin-bottom: 24px; }
.gate-error { color: var(--bad); font-weight: 600; margin: 14px 0 0; }
.gate-error[hidden] { display: none; }

/* App chrome */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; background: var(--navy); color: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.save-status { font-size: 13px; opacity: .9; min-width: 96px; text-align: right; }
.save-status.is-error { color: #ffc9c2; font-weight: 700; opacity: 1; }

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 116px); }
.sidebar { padding: 18px 12px; background: white; border-right: 1px solid var(--line); }
.nav {
  width: 100%; text-align: left; border: 0; background: transparent; color: var(--text);
  padding: 12px 14px; border-radius: 10px; margin-bottom: 6px; cursor: pointer;
}
.nav:hover, .nav.active { background: var(--light); color: var(--navy); font-weight: 700; }
.workspace { padding: 26px; max-width: 1100px; width: 100%; }
.panel { display: none; }
.panel.active { display: block; }
h1 { margin-top: 0; color: var(--navy); font-size: 32px; }
h2 { color: var(--navy); }
.lead { max-width: 800px; line-height: 1.55; font-size: 18px; color: #3e4b57; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin: 24px 0; }
.card {
  border: 1px solid var(--line); background: white; border-radius: 14px; padding: 18px; text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); cursor: pointer;
}
.card strong { display: block; color: var(--navy); font-size: 18px; margin-bottom: 5px; }
.card span { color: var(--muted); }
label { display: block; margin: 18px 0 7px; font-weight: 700; color: var(--navy); }
input, textarea {
  width: 100%; border: 1px solid #b9c6d0; border-radius: 10px; padding: 12px; background: white; color: var(--text);
}
textarea { min-height: 125px; resize: vertical; line-height: 1.45; }
textarea.large { min-height: 250px; }
.note-box, .status {
  background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-top: 18px;
}
.status { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.status strong { color: var(--navy); }
footer { text-align: center; padding: 18px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: white; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .brand { font-size: 20px; }
  .app-shell { display: block; }
  .sidebar {
    display: flex; overflow-x: auto; gap: 6px;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 10px;
  }
  .nav { min-width: max-content; width: auto; margin: 0; }
  .workspace { padding: 18px 14px 28px; }
  h1 { font-size: 27px; }
  .cards { grid-template-columns: 1fr; }
  .status { flex-direction: column; }
  .save-status { text-align: left; }
}
