/* SquirtleSquadMC Staff Portal. No build step: plain CSS, light and dark. */
:root {
  --brand: #19b5e6;
  --brand-ink: #0b7fa6;
  --gold: #f5a623;
  --red: #e6464f;
  --green: #2fb36b;
  --navy: #06111c;
  --bg: #f4f7fa;
  --panel: #ffffff;
  --panel-2: #eef3f7;
  --ink: #0d1b26;
  --muted: #5b6b78;
  --line: #dbe4eb;
  --focus: #19b5e6;
  --shadow: 0 1px 2px rgb(6 17 28 / 6%), 0 4px 14px rgb(6 17 28 / 6%);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #06111c;
    --panel: #0d1d2b;
    --panel-2: #12283a;
    --ink: #e7f1f7;
    --muted: #93a8b8;
    --line: #1d3447;
    --brand-ink: #5fd0f3;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #06111c;
  --panel: #0d1d2b;
  --panel-2: #12283a;
  --ink: #e7f1f7;
  --muted: #93a8b8;
  --line: #1d3447;
  --brand-ink: #5fd0f3;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
}
a {
  color: var(--brand-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.6rem;
}
h1 {
  font-size: 1.5rem;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0 0 0.8rem;
}
small,
.muted {
  color: var(--muted);
}
code {
  font-size: 0.9em;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---- shell ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--navy);
  color: #fff;
}
.top .brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.top .brand .brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  flex: none;
}
.top .brand .brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.top .spacer {
  flex: 1;
}
.top .me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.top .me img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.top button,
.top a.btn-ghost {
  color: #fff;
  white-space: nowrap;
}
.menu-toggle {
  display: none;
}
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 52px);
}
nav.side {
  padding: 1rem 0.6rem;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
nav.side a {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 500;
}
nav.side a:hover {
  background: var(--panel-2);
  text-decoration: none;
}
nav.side a.active {
  background: rgb(25 181 230 / 14%);
  color: var(--brand-ink);
}
nav.side .group {
  margin: 0.9rem 0.75rem 0.3rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
main {
  padding: 1.25rem;
  max-width: 1200px;
  width: 100%;
}
footer {
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 860px) {
  .layout {
    /* minmax(0, …): a wide table scrolls in its own box instead of widening the page. */
    grid-template-columns: minmax(0, 1fr);
  }
  nav.side {
    display: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  body.nav-open nav.side {
    display: block;
  }
  .menu-toggle {
    display: inline-flex;
  }
  main {
    padding: 1rem;
  }
  .top .me span {
    display: none;
  }
}

/* ---- components ---- */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card > h2:first-child,
.card > h3:first-child {
  margin-top: 0;
}
.stat {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}
.row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.stack > * + * {
  margin-top: 0.75rem;
}
.pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--panel-2);
  color: var(--ink);
  white-space: nowrap;
}
.pill.yes,
.pill.ok,
.pill.meets {
  background: rgb(47 179 107 / 16%);
  color: var(--green);
}
.pill.partly,
.pill.almost,
.pill.warn {
  background: rgb(245 166 35 / 18%);
  color: #b46f00;
}
.pill.no,
.pill.missed,
.pill.bad,
.pill.void {
  background: rgb(230 70 79 / 15%);
  color: var(--red);
}
.pill.loa,
.pill.not_yet {
  background: var(--panel-2);
  color: var(--muted);
}
:root[data-theme='dark'] .pill.partly,
:root[data-theme='dark'] .pill.almost,
:root[data-theme='dark'] .pill.warn {
  color: var(--gold);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .pill.partly,
  :root:not([data-theme='light']) .pill.almost,
  :root:not([data-theme='light']) .pill.warn {
    color: var(--gold);
  }
}

.flash {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 500;
}
.flash.ok {
  background: rgb(47 179 107 / 14%);
  color: var(--green);
}
.flash.error {
  background: rgb(230 70 79 / 13%);
  color: var(--red);
  white-space: pre-line;
}

.progress {
  height: 10px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--gold));
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th,
td {
  text-align: left;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
tr.void td {
  opacity: 0.55;
  text-decoration: line-through;
}
tr.void td.keep {
  text-decoration: none;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- forms ---- */
label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}
input,
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}
textarea {
  min-height: 70px;
  resize: vertical;
}
input[type='checkbox'],
input[type='radio'] {
  width: auto;
}
.field {
  margin-bottom: 0.75rem;
}
.fields {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #04202c;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.btn:hover {
  filter: brightness(1.05);
  text-decoration: none;
}
button.secondary,
.btn.secondary {
  background: var(--panel-2);
  color: var(--ink);
  border-color: var(--line);
}
button.danger,
.btn.danger {
  background: var(--red);
  color: #fff;
}
button.gold,
.btn.gold {
  background: var(--gold);
  color: #2b1a00;
}
button.small,
.btn.small {
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}
button.ghost,
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: inherit;
}
.choice {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice label {
  margin: 0;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 600;
  cursor: pointer;
  background: var(--panel);
}
.choice input:checked + label {
  background: var(--brand);
  color: #04202c;
  border-color: var(--brand);
}
.choice input[value='no']:checked + label {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.choice input[value='partly']:checked + label {
  background: var(--gold);
  border-color: var(--gold);
  color: #2b1a00;
}
.choice input[value='loa']:checked + label {
  background: var(--muted);
  border-color: var(--muted);
  color: #fff;
}
.choice input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.saved-tick {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 600;
}
.htmx-request .saving,
.saving.htmx-request {
  opacity: 1;
}
.saving {
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--muted);
  font-size: 0.85rem;
}

.meeting-card textarea {
  min-height: 54px;
}
.empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}
.list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-plain li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.list-plain li:last-child {
  border-bottom: 0;
}
.chart-box {
  position: relative;
  height: 260px;
}
/* ---- sign-in and other signed-out pages: centred in the window ---- */
body.bare {
  min-height: 100vh;
  background:
    radial-gradient(60rem 40rem at 12% 8%, rgb(25 181 230 / 16%), transparent 60%),
    radial-gradient(50rem 36rem at 92% 96%, rgb(245 166 35 / 12%), transparent 60%), var(--bg);
}
main.bare-main {
  min-height: 100vh;
  max-width: none;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.login-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgb(25 181 230 / 30%);
}
.logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.hero-login {
  width: 100%;
  text-align: center;
  padding: 2rem 1.75rem;
  border-radius: 16px;
}
.hero-login h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}
.hero-login p {
  margin-bottom: 1.25rem;
}
.hero-login .eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-ink);
}
.hero-login .login-note {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.login-foot {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.discord-btn {
  width: 100%;
  gap: 0.6rem;
  padding: 0.8rem 1.25rem;
  font-size: 1rem;
  background: #5865f2;
  color: #fff;
  box-shadow: 0 6px 20px rgb(88 101 242 / 35%);
}
.discord-btn:hover {
  background: #4752c4;
  filter: none;
}
.discord-btn svg {
  width: 22px;
  height: 17px;
  fill: currentColor;
  flex: none;
}
.tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.tabs a {
  padding: 0.5rem 0.85rem;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-weight: 600;
}
.tabs a.active {
  color: var(--brand-ink);
  border-bottom: 2px solid var(--brand);
}
.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
}
details summary {
  cursor: pointer;
  font-weight: 600;
}
