html, body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.header {
  min-height: var(--header-h);
  height: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  gap: var(--space-2) var(--space-3);
  flex-shrink: 0;
}

.logo {
  font-weight: 600;
  font-size: 16px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
}

.nav a {
  min-height: var(--control-h);
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
}

[data-theme="light"] .nav a:hover { background: var(--accent); color: #fff; }
[data-theme="dark"] .nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--accent); color: #fff; }

/* Dashboard/stat cards are UI surfaces, not underlined text links. */
.card .stat a, .dashboard-card a, .dashboard-card a:visited {
  text-decoration: none;
  color: inherit;
}
.card .stat a:hover, .dashboard-card a:hover, .dashboard-card a:focus-visible {
  text-decoration: none;
  color: inherit;
}

/* In-content text links (theme; not browser default purple/blue) */
.main a:not(.btn):not(.logo):not(.nav a):not(.stat):not(.stat-link),
.expander-body a:not(.btn):not(.stat):not(.stat-link),
.list-indent a:not(.btn):not(.stat):not(.stat-link),
.card a:not(.btn):not(.stat):not(.stat-link) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.main a:not(.btn):not(.logo):hover,
.expander-body a:not(.btn):hover,
.list-indent a:not(.btn):hover,
.card a:not(.btn):hover {
  color: var(--accent-hover);
}
.main a:not(.btn):not(.logo):visited,
.expander-body a:not(.btn):visited,
.list-indent a:not(.btn):visited,
.card a:not(.btn):visited {
  color: var(--accent);
}


.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
 flex-wrap: wrap; }

.user-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  text-transform: capitalize;
}

.org-select {
  height: var(--control-sm);
  min-height: var(--control-sm);
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

#theme-toggle {
  order: 999;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: var(--control-icon);
  height: var(--control-icon);
  min-height: var(--control-icon);
  padding: 0;
  box-sizing: border-box;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

 .btn-sm { min-height: var(--control-sm); padding: 0 10px; font-size: 12px; }

.main {
  flex: 1 0 auto;
  width: 100%;
  padding: var(--space-6);
}

.page-head {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-4) 18px;
  margin-bottom: var(--space-4);
}

.page-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.page-head .page-title {
  flex: 0 0 auto;
  margin: 0;
}
.page-head .page-desc {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 640px) {
  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
  }
  .page-head .page-desc {
    flex-basis: 100%;
  }
}
.page-head .page-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.page-head .page-desc {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
}
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.page-desc { color: var(--text-muted); margin-bottom: 24px; }

.card {
  /* Match Public meeting expanders / page panels */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: none;
  overflow: hidden;
}

.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }

.footer {
  height: var(--footer-h);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 16px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  flex-shrink: 0;
  margin-top: auto;
}

.btn {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
