/* ── Fonts (Inter via CDN in layout head) ─────────────────────────────────── */
/* ── Custom properties ────────────────────────────────────────────────────── */
:root {
  --bg:           #f0f4f8;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm:    0 1px 2px 0 rgb(0 0 0/.06);
  --shadow:       0 1px 3px 0 rgb(0 0 0/.08), 0 1px 2px -1px rgb(0 0 0/.06);
  --shadow-md:    0 4px 6px -1px rgb(0 0 0/.07), 0 2px 4px -2px rgb(0 0 0/.05);
  --shadow-lg:    0 10px 15px -3px rgb(0 0 0/.07), 0 4px 6px -4px rgb(0 0 0/.05);

  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-subtle:  #94a3b8;

  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-pale: #eef2ff;
  --primary-ring: rgba(99,102,241,.2);

  --success:      #10b981;
  --success-pale: #ecfdf5;
  --success-dark: #059669;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --danger-pale:  #fef2f2;

  --navy:         #0f172a;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: .9375rem;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1,h2,h3,h4,h5,h6 {
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.ha-navbar {
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.05);
  padding: 0 1.25rem;
  min-height: 52px;
}
.ha-navbar .navbar-brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.03em;
  color: #fff;
  padding: .75rem 0;
  margin-right: 1.5rem;
}
.ha-navbar .navbar-brand:hover { color: rgba(255,255,255,.9); }
.ha-navbar .navbar-brand i { color: #818cf8; }

/* child name pill */
.ha-navbar .child-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  color: rgba(255,255,255,.9);
  font-weight: 600; font-size: .825rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: .2rem .7rem;
  white-space: nowrap;
}
.ha-navbar .child-pill .grade-tag {
  font-size: .7rem; font-weight: 500;
  color: rgba(255,255,255,.55);
}

/* separator */
.ha-navbar .nav-sep { color: rgba(255,255,255,.15); padding: 0 .25rem; font-size: .7rem; }

/* child tabs */
.ha-navbar .nav-tab {
  color: rgba(255,255,255,.55);
  font-size: .825rem;
  font-weight: 500;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color .12s, background .12s;
  border: none; background: none;
}
.ha-navbar .nav-tab:hover    { color: rgba(255,255,255,.9); background: rgba(255,255,255,.07); }
.ha-navbar .nav-tab-active   { color: #fff !important; background: rgba(255,255,255,.12) !important; font-weight: 600; }

/* right side */
.ha-navbar .nav-right .nav-link {
  color: rgba(255,255,255,.65);
  font-size: .825rem;
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  transition: color .12s, background .12s;
}
.ha-navbar .nav-right .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }

/* ── Dropdown ─────────────────────────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .35rem;
  min-width: 180px;
  font-size: .875rem;
}
.dropdown-item {
  border-radius: var(--radius-sm);
  padding: .5rem .8rem;
  color: var(--text);
  font-weight: 500;
  transition: background .1s;
  display: flex; align-items: center; gap: .5rem;
}
.dropdown-item i { color: var(--text-muted); font-size: .875rem; }
.dropdown-item:hover { background: var(--bg); color: var(--text); }
.dropdown-item:hover i { color: var(--primary); }
.dropdown-item.active, .dropdown-item:active { background: var(--primary-pale); color: var(--primary); }
.dropdown-item.text-danger:hover { background: var(--danger-pale); color: var(--danger); }
.dropdown-item.text-danger i { color: var(--danger); }
.dropdown-divider { border-color: var(--border); margin: .35rem 0; }

/* ── Main layout ──────────────────────────────────────────────────────────── */
main.container-fluid { max-width: 1200px; padding: 1.75rem 1.5rem; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  overflow: hidden;
}
.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .9rem 1.25rem;
  font-size: .875rem; font-weight: 600;
  color: var(--text);
}
.card-body { padding: 1.25rem; }
.card-footer { background: var(--bg); border-top: 1px solid var(--border); padding: .75rem 1.25rem; }

/* hover lift for clickable cards */
.card-lift { transition: transform .15s, box-shadow .15s; }
.card-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg) !important; }

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress { background: var(--border-light); border-radius: 99px; overflow: hidden; }
.progress-bar { border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1); }
/* gradient by default */
.progress-bar { background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%); }
.progress-bar.bg-success { background: var(--success) !important; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { font-weight: 500; font-size: .875rem; border-radius: var(--radius-sm); transition: all .15s; }
.btn-lg { font-size: 1rem; border-radius: var(--radius); }
.btn-sm { font-size: .8125rem; border-radius: 5px; }

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark); border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px var(--primary-ring);
  transform: translateY(-1px);
}
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: var(--success-dark); border-color: var(--success-dark); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.btn-outline-secondary { border-color: var(--border); color: var(--text-muted); }
.btn-outline-secondary:hover { background: var(--bg); border-color: #cbd5e1; color: var(--text); box-shadow: none; }
.btn-outline-danger { border-color: #fca5a5; color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-pale); border-color: var(--danger); }

/* ── Goal achieve toggle ──────────────────────────────────────────────────── */
.achieve-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-subtle);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; padding: 0;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
  font-size: .875rem;
}
.achieve-btn:hover { border-color: var(--success); color: var(--success); background: var(--success-pale); }
.achieve-btn.is-achieved { border-color: var(--success); background: var(--success); color: #fff; }
.achieve-btn.is-achieved:hover { background: var(--success-dark); border-color: var(--success-dark); }

/* ── Goal list items ──────────────────────────────────────────────────────── */
.goal-row { transition: background .1s; }
.goal-row:hover { background: #f8fafc !important; }
.goal-row.achieved-row { background: var(--success-pale) !important; }
.goal-row.achieved-row:hover { background: #d1fae5 !important; }

/* ── Subject card header ──────────────────────────────────────────────────── */
.subj-header {
  border-left: 4px solid currentColor;
  padding-left: .9rem;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge { font-weight: 500; letter-spacing: .01em; border-radius: 20px; padding: .3em .75em; font-size: .75rem; }
.badge-subject {
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: .2em .6em;
  border-radius: 4px;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem; color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  padding: .5rem .75rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  outline: none;
}
.form-label { font-weight: 500; font-size: .875rem; margin-bottom: .375rem; }
.form-text  { color: var(--text-muted); font-size: .8125rem; }

/* ── List groups ──────────────────────────────────────────────────────────── */
.list-group-item { border-color: var(--border); font-size: .875rem; }
.list-group-item-action:hover { background: var(--bg); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--radius); font-size: .875rem; border-width: 1px; }
.alert-success { background: var(--success-pale); border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: var(--danger-pale);  border-color: #fecaca; color: #991b1b; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb { font-size: .8125rem; margin-bottom: 1rem; }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-subtle); }

/* ── Timeline ─────────────────────────────────────────────────────────────── */
.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 1.25rem;
}
.timeline-item::before {
  content: '';
  position: absolute; left: 0; top: .45rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-pale);
}
.timeline-item::after {
  content: '';
  position: absolute; left: 4px; top: 1.2rem; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item:last-child::after { display: none; }

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.avatar-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  letter-spacing: -.01em;
}
.avatar-lg { width: 52px; height: 52px; font-size: 1.3rem; }

/* ── Upload zone ──────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-pale);
}

/* ── Dashboard child card stats ──────────────────────────────────────────── */
.stat-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .25rem .6rem;
}

/* ── WP/ACF HTML content ──────────────────────────────────────────────────── */
.goal-content ul, .goal-content ol { padding-left: 1.25rem; margin-bottom: .5rem; }
.goal-content li  { margin-bottom: .25rem; line-height: 1.6; }
.goal-content h4  { font-size: .9375rem; font-weight: 600; margin-top: 1rem; color: var(--text); }
.goal-content p   { margin-bottom: .5rem; line-height: 1.65; }
.goal-content p:last-child, .goal-content ul:last-child { margin-bottom: 0; }

/* ── Subject progress rows (child overview) ───────────────────────────────── */
.subject-progress-row { transition: background .1s; }
.subject-progress-row:last-child { border-bottom: none !important; }
.subject-progress-row:hover { background: var(--bg); }
.subject-progress-row:hover .bi-chevron-right { color: var(--primary) !important; transform: translateX(2px); transition: transform .1s; }

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted) !important; }
.border-light { border-color: var(--border-light) !important; }
.shadow-card  { box-shadow: var(--shadow); }

/* collapse chevron rotation */
[data-bs-toggle="collapse"] .bi-chevron-down { transition: transform .2s; transform: rotate(-90deg); }
[aria-expanded="true"]  .bi-chevron-down { transform: rotate(0deg); }
