:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-sunken: #f2f1ed;
  --border: #e4e1da;
  --border-strong: #d3cfc5;
  --text: #201f1c;
  --text-muted: #6f6a61;
  --text-faint: #a29c8f;

  --accent: #c8501f;
  --accent-hover: #a83f17;
  --accent-bg: #fbe9df;

  --success: #1c7a4d;
  --success-bg: #e3f2e8;

  --warn: #a8710a;
  --warn-bg: #faf0d9;

  --danger: #ae2c22;
  --danger-bg: #fae6e3;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 1px 2px rgba(32, 31, 28, 0.06), 0 1px 1px rgba(32, 31, 28, 0.04);
  --shadow-panel: 0 4px 16px rgba(32, 31, 28, 0.08);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* Layout shells */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
}

.sidebar-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.sidebar-brand-text {
  font-weight: 700;
  font-size: 15px;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--surface-sunken);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent-hover);
}

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 16px 12px 6px;
  font-weight: 600;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
}

.topbar-title {
  font-size: 16px;
  font-weight: 650;
}

.topbar-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.content {
  flex: 1;
  padding: 24px;
  overflow: auto;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
}

/* Public top nav (coach / parent portals) */

.public-nav {
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.public-nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.public-nav-links {
  display: flex;
  gap: 4px;
}

.public-nav-link {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.public-nav-link.active {
  background: var(--accent-bg);
  color: var(--accent-hover);
}

.public-content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* Cards, panels, tables */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.card-pad {
  padding: 18px 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14.5px;
  font-weight: 650;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  padding: 18px 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 26px;
  font-weight: 650;
  margin-top: 6px;
}

.stat-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

tr:last-child td {
  border-bottom: none;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--surface-sunken); color: var(--text-muted); }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 550;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.btn-quiet:hover { background: var(--surface-sunken); }

.btn-accent {
  border-color: #eecbb8;
  background: var(--accent-bg);
  color: var(--accent-hover);
}

.btn-accent:hover { background: #f5d9c4; border-color: var(--accent); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

/* Forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: var(--surface);
  appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* Section headers inside content */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 17px;
}

.section-head-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Empty state */

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-title {
  font-weight: 650;
  color: var(--text);
  margin-bottom: 6px;
}

/* Utility */

.muted { color: var(--text-muted); }
.ta-right { text-align: right; }
.faint { color: var(--text-faint); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; align-items: center; }
.flex-gap { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; }
