/* RRFF brand kit — Navy #323c5a · Teal #00b3aa · Red #dc5a64 · Gold #e6aa28 */
:root {
  --navy: #323c5a;
  --navy-700: #414e75;
  --navy-900: #262e46;
  --navy-100: #eaecf3;
  --gold: #e6aa28;
  --gold-dark: #cc9418;
  --teal: #00b3aa;
  --teal-dark: #009a92;
  --red: #dc5a64;
  --ink: #2b3040;
  --muted: #6f7688;
  --line: #e3e6ef;
  --bg: #f6f7fb;
  --white: #fff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(50, 60, 90, .08), 0 8px 24px rgba(50, 60, 90, .07);
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--teal-dark); }
h1, h2, h3 { margin: 0 0 .5rem; color: var(--navy); font-family: var(--font-head); font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .82rem; }

/* ---------- login ---------- */
#login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1100px 520px at 15% -10%, rgba(0, 179, 170, .28), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--white);
  border-radius: 14px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  border-top: 5px solid var(--gold);
}
.login-card .brand { text-align: center; margin-bottom: 1.25rem; }
.login-card .brand .bar { height: 4px; width: 56px; background: var(--gold); margin: .6rem auto 0; border-radius: 3px; }

/* logo slot — falls back to a wordmark if no logo file is present */
.brand-logo { height: 78px; width: auto; max-width: 100%; object-fit: contain; display: block; margin: 0 auto .5rem; border-radius: 12px; }
/* align-self keeps the flex column from stretching the image to the sidebar width */
.sidebar .brand-logo { height: 54px; width: auto; align-self: flex-start; object-fit: contain; margin: .1rem 0 .6rem .45rem; border-radius: 0; }

/* ---------- shell ---------- */
#app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #ccd2e2;
  padding: 1.1rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.sidebar .logo { color: var(--white); font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; padding: .2rem .6rem 1rem; line-height: 1.25; }
.sidebar .logo span { display: block; color: var(--gold); font-family: var(--font); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin-top: .25rem; font-weight: 700; }
.nav-btn {
  background: none; border: 0; color: #ccd2e2; text-align: left;
  padding: .55rem .6rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .92rem;
  display: flex; align-items: center; gap: .55rem;
}
.nav-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-btn.active { background: var(--gold); color: var(--navy); font-weight: 650; }
.sidebar .logo-sub { color: var(--gold); font-size: .7rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; padding: 0 .6rem .9rem .65rem; }
.sidebar .spacer { flex: 1; }
.sidebar .who { font-size: .8rem; padding: .6rem; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar .who strong { color: #fff; display: block; }

.main { padding: 1.5rem 1.75rem 3rem; max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }

/* ---------- cards, grids ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1.1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat:nth-child(2) { border-top-color: var(--gold); }
.stat:nth-child(3) { border-top-color: var(--navy); }
.stat:nth-child(4) { border-top-color: var(--red); }
.stat .n { font-size: 1.9rem; font-family: var(--font-head); font-weight: 600; color: var(--navy); line-height: 1.1; }
.stat .l { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- forms ---------- */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--navy); margin-bottom: .28rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=url], select, textarea {
  width: 100%; padding: .52rem .6rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: .92rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0, 179, 170, .32); border-color: var(--teal); }
textarea { min-height: 76px; resize: vertical; }
.field { margin-bottom: .85rem; }
.row { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-bottom: .5rem; }
.check input { width: auto; }
.check label { margin: 0; font-weight: 500; color: var(--ink); }

button, .btn {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  border-radius: 8px; border: 1px solid transparent; padding: .52rem .95rem;
  background: var(--navy); color: #fff; display: inline-flex; align-items: center; gap: .4rem;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--navy-700); }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: var(--navy-100); }
.btn-danger { background: #fff; color: var(--red); border-color: #f3ccd0; }
.btn-danger:hover { background: #fdf0f1; }
.btn-sm { padding: .3rem .55rem; font-size: .8rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .5rem .55rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: #f8f9fd; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .45rem; border-radius: 999px; color: #fff; white-space: nowrap; }
.tag.req { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.pill { display:inline-block; background: var(--navy-100); color: var(--navy); border-radius: 999px; padding: .1rem .5rem; font-size: .75rem; font-weight: 600; }

/* ---------- feedback ---------- */
.alert { padding: .7rem .9rem; border-radius: 8px; font-size: .88rem; margin-bottom: .9rem; border: 1px solid; }
.alert.ok { background: #e6f7f6; border-color: #a9e3df; color: #04756f; }
.alert.err { background: #fdeff0; border-color: #f3ccd0; color: #a32b37; }
.alert.warn { background: #fdf6e6; border-color: #f0d9a4; color: #8a6510; }
.progress { height: 8px; background: var(--navy-100); border-radius: 99px; overflow: hidden; margin: .6rem 0; }
.progress > div { height: 100%; background: var(--teal); width: 0; transition: width .2s; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(38, 46, 70, .58); display: grid; place-items: center; padding: 1.5rem; z-index: 50; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; padding: 1.4rem; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .9rem; }

@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; padding: .6rem; }
  .sidebar .logo { padding: .2rem .5rem; }
  .sidebar .spacer { display: none; }
  .sidebar .who { border: 0; }
  .main { padding: 1rem; }
}

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis text { font-size: 11px; fill: var(--muted); }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .val { font-size: 11px; font-weight: 700; fill: var(--navy); }
.chart-legend { display: flex; flex-wrap: wrap; gap: .45rem 1.1rem; margin-top: .7rem; }
.chart-legend span { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbars { display: flex; flex-direction: column; gap: .55rem; }
.hbar { display: grid; grid-template-columns: minmax(0, 13rem) 1fr auto; gap: .7rem; align-items: center; }
.hbar .lbl { font-size: .84rem; color: var(--ink); overflow-wrap: anywhere; }
.hbar .track { background: var(--navy-100); border-radius: 4px; height: 14px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; }
.hbar .n { font-size: .82rem; font-weight: 700; color: var(--navy); min-width: 2ch; text-align: right; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--navy); color: #fff;
  font-size: .78rem; padding: .4rem .6rem; border-radius: 7px; box-shadow: 0 6px 18px rgba(20,26,45,.28); }
.conflict-list { display: flex; flex-direction: column; gap: .4rem; margin: .6rem 0; }
.conflict { border-left: 4px solid var(--gold); background: #fdf6e6; border-radius: 6px; padding: .5rem .7rem; font-size: .85rem; }
.conflict.clash { border-left-color: var(--red); background: #fdeff0; }
.conflict.busy { border-left-color: var(--navy); background: var(--navy-100); }
.conflict b { color: var(--navy); }
.conflict ul { margin: .25rem 0 0 1rem; padding: 0; }

/* ---------- embedded previews ---------- */
.preview-frame { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--white); }
.preview-frame iframe { width: 100%; border: 0; display: block; height: 1100px; }
.preview-frame.tall iframe { height: 78vh; min-height: 640px; }
.card > .preview-frame:only-child { border: 0; border-radius: 0; }

/* ---------- bulk edit bar ---------- */
.bulk-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: .7rem;
  align-items: center; justify-content: space-between; background: var(--navy); color: #fff;
  border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: .8rem; box-shadow: var(--shadow); }
.bulk-count { font-size: .88rem; }
.bulk-count strong { font-size: 1.05rem; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.bulk-actions select { width: auto; padding: .35rem .5rem; font-size: .82rem; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); color: #fff; }
.bulk-actions select option { color: #222; }
.link-btn { background: none; border: 0; color: var(--gold); font: inherit; font-size: .82rem;
  text-decoration: underline; cursor: pointer; padding: 0 0 0 .4rem; }
.link-btn:hover { background: none; color: var(--gold); }
tr.picked td { background: #fdf6e6; }
/* the selection column narrows the row, so keep the actions on one line and let the table scroll */
#meetingsTable td:last-child { white-space: nowrap; }
#meetingsTable td:last-child .btn-row { gap: .3rem; flex-wrap: nowrap; }

/* ---------- facilitator view ---------- */
.sess { display: grid; grid-template-columns: 5.2rem 1fr auto; gap: 1rem; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--teal);
  border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); margin-bottom: .6rem; }
.sess.now { border-left-color: var(--gold); background: #fffdf6; }
.sess.done { opacity: .6; }
.sess .when { font-weight: 700; color: var(--navy); font-size: .95rem; line-height: 1.25; }
.sess .when span { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.sess .what strong { font-size: 1rem; color: var(--ink); }
.sess .what div { margin-top: .15rem; }
.sess .acts { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.sess-head { display: flex; align-items: baseline; gap: .6rem; margin: 1.2rem 0 .6rem; }
.sess-head h2 { margin: 0; }
.sess-empty { color: var(--muted); font-size: .9rem; padding: .6rem 0 1rem; }
@media (max-width: 720px) {
  .sess { grid-template-columns: 1fr; }
  .sess .acts { justify-content: flex-start; }
}

/* ---------- system health ---------- */
.check { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem .9rem; margin-bottom: .5rem; box-shadow: var(--shadow); }
.check .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .38rem; background: #00918a; }
.check.warn .dot { background: var(--gold); }
.check.fail .dot { background: var(--red); }
.check.fail { border-left: 4px solid var(--red); }
.check.warn { border-left: 4px solid var(--gold); }
.check strong { color: var(--navy); }
.check .detail { font-size: .86rem; color: var(--muted); margin-top: .1rem; }
.check .fix { font-size: .86rem; color: var(--ink); margin-top: .3rem; }
.health-banner { border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem;
  font-size: 1.02rem; font-weight: 600; box-shadow: var(--shadow); }
.health-banner.ok { background: #e6f7f6; color: #04756f; border: 1px solid #a9e3df; }
.health-banner.warn { background: #fdf6e6; color: #8a6510; border: 1px solid #f0d9a4; }
.health-banner.fail { background: #fdeff0; color: #a32b37; border: 1px solid #f3ccd0; }
