:root {
  --navy: #1F3864;
  --navy-strong: #16294A;
  --blue: #2E75B6;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --border: #D9E1EC;
  --text: #1A2332;
  --muted: #5A6675;
  --focus: #2E75B6;
  --danger: #B42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--navy); }
a:hover { color: var(--navy-strong); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

header.siq {
  background: var(--navy);
  color: #fff;
  padding: 8px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  flex-shrink: 0;
}
header.siq .brand {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .3px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
header.siq .module { color: #CBD8EC; font-size: 14px; font-weight: 400; margin-left: 6px; }
header.siq .top-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
header.siq .top-nav a {
  color: #DBE6F5;
  text-decoration: none;
  font-size: 15px;
  padding: 10px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
}
header.siq .top-nav a:hover { color: #fff; background: rgba(255, 255, 255, .12); }
header.siq .acct { color: #DBE6F5; font-size: 15px; padding: 0 8px; }

main.container {
  flex: 1 0 auto;
  width: 100%;
  max-width: 920px;
  margin: 32px auto;
  padding: 0 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.card-narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

h1 { font-size: 26px; margin: 0 0 8px; color: var(--navy); }
h2 { font-size: 19px; margin: 0 0 12px; color: var(--navy); }
h3 { font-size: 17px; margin: 0 0 6px; color: var(--navy); }
p { margin: 0 0 12px; }
p.muted { color: var(--muted); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  margin: 0 0 8px;
}

label { display: block; font-size: 15px; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
input[type=text], input[type=password], input[type=email], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  min-height: 44px;
  background: #fff;
  color: var(--text);
}
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--navy); }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  min-height: 44px;
  font-weight: 400;
}
input:disabled { background: #F0F3F7; color: var(--muted); }

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button-link:hover { background: var(--navy-strong); color: #fff; }
button:disabled { opacity: .55; cursor: not-allowed; }
.quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 18px 0 0 14px;
  color: var(--navy);
  font-weight: 600;
}
.btn-sm { padding: 8px 14px; font-size: 15px; margin-top: 0; }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--navy); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #F3C4BD; }
.btn-danger:hover { background: #FDECEA; color: var(--danger); }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); font-size: 15px; }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.err { color: var(--danger); font-size: 15px; margin-top: 12px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 13px; background: #EEF2F8; color: var(--navy); }
.pill.admin { background: #EAF1FA; color: var(--navy); }
.pill.member { background: #EEF2F8; color: var(--muted); }
.pill.pending { background: #FFF5E6; color: #8A5A00; }
.pill.on { background: #EAF6EE; color: #1B5E35; }
.pill.off { background: #F1F3F7; color: var(--muted); }
.muted-row td { color: var(--muted); }
.capitalize { text-transform: capitalize; }
.section-gap { margin-top: 22px; }

footer.siq {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 14px 24px;
  margin-top: 40px;
  text-align: center;
}
.foot-copy { color: var(--muted); font-size: 13px; }

.shell { display: flex; flex: 1 0 auto; width: 100%; }
.sidebar {
  width: 232px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  flex-shrink: 0;
}
.sidebar .ws { padding: 8px 10px 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.sidebar .ws .name { font-weight: 600; color: var(--navy); font-size: 16px; }
.sidebar .ws .plan { font-size: 13px; color: var(--muted); text-transform: capitalize; }
.sidebar a.item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  margin-bottom: 2px;
}
.sidebar a.item:hover { background: var(--bg); }
.sidebar a.item.active { background: #EAF1FA; color: var(--navy); font-weight: 600; }
.sidebar .section {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin: 16px 10px 6px;
}
.content { flex: 1; padding: 28px 34px; max-width: 980px; }
.content h1 { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 26px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.stat .n { font-size: 26px; font-weight: 600; color: var(--navy); }
.stat .l { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

.flash { padding: 12px 14px; border-radius: 6px; font-size: 15px; margin-bottom: 16px; }
.flash.success { background: #EAF6EE; color: #1B5E35; border: 1px solid #BFE0CB; }
.flash.error { background: #FDECEA; color: #8A2318; border: 1px solid #F3C4BD; }
.flash.info { background: #EEF2F8; color: var(--navy); border: 1px solid var(--border); }

.row-actions form { display: inline; }
.secret-box {
  background: #0F1B2D;
  color: #D6E2F2;
  padding: 12px 14px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  margin: 12px 0;
  word-break: break-all;
}
.hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.empty { color: var(--muted); font-size: 15px; padding: 16px 0; }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.plan-card { border: 1px solid var(--border); border-radius: 8px; padding: 18px; background: #fff; }
.plan-card.current { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.plan-card .price { font-size: 24px; font-weight: 600; color: var(--navy); }
.plan-card ul { padding-left: 18px; margin: 10px 0 16px; font-size: 15px; color: var(--muted); }

.landing-hero { padding: 32px 28px; }
.landing-hero h1 { font-size: 32px; max-width: 22ch; }
.hero-actions { margin-top: 18px; }
.split {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}
.panel-note { background: #F0F5FB; }
.panel-note a { font-weight: 600; }
.checklist { margin: 0; padding-left: 20px; }
.checklist li { margin-bottom: 14px; }
.checklist li:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  header.siq { padding: 8px 14px; }
  header.siq .top-nav { margin-left: 0; width: 100%; }
  main.container { margin: 20px auto; padding: 0 14px; }
  .shell { flex-direction: column; min-height: 0; }
  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
  }
  .sidebar .ws, .sidebar .section { width: 100%; }
  .sidebar a.item { margin-bottom: 0; }
  .content { padding: 20px 14px; }
  .stats, .plan-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .landing-hero h1 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
