/* ============================================================
   At 40s — Sleek Minimal · indigo & gold (no green)
   Airy, hairline borders, light weights, restrained accent.
   Class & CSS-variable names kept stable so all views work.
   ============================================================ */
:root {
  /* Brand accent (variable kept as --green for compatibility; value = indigo) */
  --green: #4f46e5;
  --green-dark: #4338ca;
  --green-light: #f3f3fc;     /* whisper-light indigo wash */
  --gold: #b8860b;            /* restrained gold, used sparingly */

  --ink: #17171f;
  --ink-soft: #3a3a47;
  --muted: #8a8a99;
  --faint: #b6b6c2;
  --line: #d4d4de;            /* hairline (slightly darker) */
  --line-soft: #e4e4ec;
  --bg: #ffffff;
  --bg-tint: #fafafb;
  --card: #ffffff;

  --danger: #d92d20;
  --danger-bg: #fef3f2;
  --ok: #4f46e5;              /* "success/paid" rendered as the indigo accent */
  --ok-bg: #f3f3fc;
  --warn: #b8860b;
  --warn-bg: #fbf6ea;
  --info: #6b6f86;
  --info-bg: #f4f4f7;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20,20,40,.04);
  --shadow-pop: 0 12px 40px -16px rgba(30,28,60,.22);
  --ring: 0 0 0 3px rgba(79,70,229,.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-tint);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--green); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--green-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -0.025em; font-weight: 600; }
h1 { font-size: 1.35rem; font-weight: 600; }
h2 { font-size: .95rem; font-weight: 600; letter-spacing: -0.01em; }
small, .muted { color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  color: var(--ink);
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 600; font-size: 1rem; color: var(--ink); display: flex; align-items: center; gap: .6rem; letter-spacing: -0.02em; }
.topbar .brand:hover { color: var(--ink); }
.topbar .brand .logo {
  width: 28px; height: 28px; border-radius: 5px; background: var(--ink);
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .7rem; letter-spacing: -0.02em;
}
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .8rem; text-align: right; line-height: 1.3; color: var(--muted); }
.topbar .who a { color: var(--ink); text-decoration: none; font-weight: 600; }
.topbar .who a:hover { color: var(--green); }
.topbar .who .role { color: var(--faint); }
.topbar-btn { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); font-size: .82rem; font-weight: 600; padding: .4rem .7rem; border-radius: 6px; cursor: pointer; font-family: inherit; transition: border-color .15s ease, color .15s ease; }
.topbar-btn:hover { border-color: var(--faint); color: var(--ink); }
.hamburger { background: transparent; border: 1px solid var(--line); color: var(--ink); font-size: 1.05rem; cursor: pointer; padding: .25rem .55rem; border-radius: 5px; display: none; line-height: 1; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: calc(100vh - 59px); }
.sidebar {
  width: 232px; flex-shrink: 0; padding: 1.3rem .7rem;
  background: transparent;
  border-right: 1px solid var(--line);
}
.sidebar a {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .8rem; border-radius: 6px; color: var(--muted);
  font-weight: 500; font-size: .9rem; margin-bottom: 1px;
  transition: background .15s ease, color .15s ease;
}
.sidebar a .ic { width: 1.3rem; text-align: center; font-size: .95rem; opacity: .65; filter: grayscale(.4); }
.sidebar a:hover { background: var(--bg-tint); color: var(--ink); }
.sidebar a.active { background: var(--green-light); color: var(--green); font-weight: 600; }
.sidebar a.active .ic { opacity: 1; filter: none; }
.sidebar .group-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .11em; color: var(--faint); padding: 1.2rem .8rem .45rem; font-weight: 600; }
.content { flex: 1; padding: 2rem 2.2rem; max-width: 1120px; width: 100%; margin: 0 auto; }

/* ---------- Cards / grid ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem 1.6rem; margin-bottom: 1.4rem;
}
.card h2 { margin-top: 0; margin-bottom: 1rem; }
.grid { display: grid; gap: 1.3rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Stat tiles ---------- */
.stat {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
  transition: border-color .15s ease;
}
.stat:hover { border-color: var(--faint); }
.stat .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.7rem; font-weight: 600; margin-top: .45rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .sub { font-size: .76rem; color: var(--faint); margin-top: .45rem; }
/* Headline tiles: distinguished only by a sparing accent colour — no heavy fills */
.stat.accent { border-color: var(--line); }
.stat.accent .value { color: var(--green); }
.stat.accent .label { color: var(--green); opacity: .85; }
.stat.gold .value { color: var(--gold); }
.stat.gold .label { color: var(--gold); opacity: .9; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
thead th { border-bottom: 1px solid var(--line); }
th { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--bg-tint); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.total-row td { font-weight: 600; border-top: 1px solid var(--line); background: transparent; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .5rem; border-radius: 5px; font-size: .72rem; font-weight: 600; letter-spacing: 0; border: 1px solid transparent; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.red { background: var(--danger-bg); color: var(--danger); }
.badge.gold { background: var(--warn-bg); color: var(--warn); }
.badge.grey { background: var(--bg-tint); color: var(--muted); border-color: var(--line); }
.badge.blue { background: var(--info-bg); color: var(--info); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .95rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-weight: 600; font-size: .87rem; cursor: pointer; font-family: inherit;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--faint); color: var(--ink); background: var(--bg-tint); }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn.gold { background: #fff; color: var(--gold); border-color: var(--warn-bg); }
.btn.gold:hover { background: var(--warn-bg); color: var(--gold); border-color: var(--gold); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger-bg); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: .35rem .65rem; font-size: .79rem; border-radius: 5px; }
.btn.block { width: 100%; justify-content: center; }

/* ---------- Forms ---------- */
label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .35rem; }
input, select, textarea {
  width: 100%; padding: .62rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .95rem; background: #fff; color: var(--ink); font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 1rem; }
.form-row { display: grid; gap: .9rem; grid-template-columns: repeat(2, 1fr); }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.inline-form { display: flex; gap: .55rem; align-items: end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }

/* ---------- Avatars ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-weight: 600; font-size: .8rem; flex-shrink: 0; }
.member-cell { display: flex; align-items: center; gap: .6rem; }

/* ---------- Flash ---------- */
.flash { padding: .75rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.4rem; font-weight: 500; font-size: .88rem; border: 1px solid var(--line); }
.flash.success { background: var(--ok-bg); color: var(--green-dark); border-color: rgba(79,70,229,.15); }
.flash.error { background: var(--danger-bg); color: var(--danger); border-color: rgba(217,45,32,.15); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.page-head h1 { margin: 0; }
.page-head .spacer { flex: 1; }
.crumbs { font-size: .82rem; color: var(--faint); margin-bottom: .5rem; font-weight: 500; }
.crumbs a { color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--green); }

/* progress bar */
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .4s ease; }

.pill-row { display: flex; gap: .45rem; flex-wrap: wrap; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.2rem 0; }

.bottomnav { display: none; }

/* ---------- Minutes ---------- */
.minute { border: 1px solid var(--line-soft); border-radius: 8px; padding: .8rem; margin-bottom: .8rem; }
.minute:target { border-color: var(--green); }
.minute-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.note-list { list-style: none; margin: .4rem 0; padding: 0; }
.note-list li { border-left: 2px solid var(--line); padding: .1rem 0 .1rem .6rem; margin-bottom: .5rem; }
.note-meta { display: flex; gap: .5rem; align-items: center; font-size: .78rem; color: var(--muted); }
.note-body { white-space: pre-wrap; }
.note-add { display: flex; gap: .5rem; align-items: flex-start; margin: .5rem 0; }
.note-add textarea { flex: 1; }
.resolution { background: var(--bg-tint); border-radius: 6px; padding: .5rem .6rem; margin-top: .5rem; }
.comments { margin-top: .6rem; border-top: 1px dashed var(--line-soft); padding-top: .5rem; }
.comments h4 { margin: 0 0 .4rem; font-size: .85rem; font-weight: 600; }
.comment { border-left: 2px solid var(--green-light); padding: .1rem 0 .1rem .6rem; margin-bottom: .45rem; }
.point { padding: .5rem 0; border-bottom: 1px solid var(--line-soft); }
.point:last-of-type { border-bottom: 0; }
.minute-edit, .minute-add { margin-top: .6rem; }
.minute-edit summary, .minute-add summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.minute-edit[open] summary, .minute-add[open] summary { margin-bottom: .5rem; }
@media (max-width: 560px) {
  .note-add { flex-direction: column; }
  .note-add textarea { width: 100%; }
}

/* ---------- Notices & next meeting ---------- */
.notice { border: 1px solid var(--line); border-left: 4px solid var(--green); background: var(--green-light);
  border-radius: 8px; padding: .7rem .8rem; margin-bottom: .5rem; }
.notice.urgent { border-left-color: var(--danger); background: var(--danger-bg); }
.notice-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.notice-body { margin-top: .3rem; white-space: pre-wrap; font-size: .9rem; }
.notice-icon { font-size: 1rem; }

.next-meeting { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .5rem; }
.next-meeting.empty { background: var(--bg-tint); color: var(--ink); border: 1px dashed var(--line); }
.nm-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.nm-date { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: .1rem 0 .5rem; }
.nm-rows { display: grid; gap: .25rem; margin-bottom: .7rem; }
.nm-rows > div { display: flex; gap: .6rem; font-size: .88rem; }
.nm-k { opacity: .65; min-width: 72px; }
.nm-v { font-weight: 500; }
.next-meeting .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.next-meeting .btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.next-meeting.empty .btn { background: #fff; color: var(--ink); border-color: var(--line); }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
.shot { margin: 0; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; background: var(--bg-tint); }
.shot img { width: 100%; height: 150px; object-fit: cover; display: block; }
.shot figcaption { padding: .45rem .55rem; }
.shot-cap { font-size: .85rem; margin-bottom: .2rem; word-break: break-word; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .hamburger { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 59px; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); width: 244px;
    background: #fff; box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: translateX(0); }
  .scrim { display: none; position: fixed; inset: 59px 0 0 0; background: rgba(20,20,40,.25); z-index: 55; }
  .scrim.show { display: block; }
  .content { padding: 1.3rem 1.1rem 5rem; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .topbar .who .role { display: none; }
  h1 { font-size: 1.2rem; }
  .stat .value { font-size: 1.5rem; }
}
@media (max-width: 420px) {
  .grid.cols-4, .grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
