/* ========================================================================
   IvyBridge Education · page-dashboard.css
   Styles for Dashboard.html — learning center preview
   ======================================================================== */

/* ---- Preview banner --------------------------------------------------- */
.dash-preview-banner {
  background: var(--ivy);
  color: var(--paper);
  padding: 12px 0;
  border-bottom: 1px solid var(--ivy-deep);
  position: relative;
}
.dash-preview-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-preview-text {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif-display);
  font-size: 14px;
  font-style: italic;
  color: var(--cream);
  flex-wrap: wrap;
}
.dash-preview-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  flex-shrink: 0;
}
.dash-preview-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
}
.dash-preview-dismiss:hover { color: var(--paper); }
.dash-preview-banner.is-hidden { display: none; }

/* ---- Page layout ------------------------------------------------------ */
.dash-page {
  background: var(--paper-2);
  min-height: 100vh;
}
.dash-layout {
  padding-top: 32px;
  padding-bottom: 80px;
}
.dash-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

/* ---- Sidebar ---------------------------------------------------------- */
.dash-sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* child switcher */
.dash-child-switcher {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
}
.dash-child-switcher-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--ink-2);
  opacity: 0.6;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.dash-child-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-child-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 100%;
  text-align: left;
}
.dash-child-item.is-active {
  background: var(--paper-2);
  border-color: var(--ivy);
}
.dash-child-item:hover:not(.is-active) { background: var(--paper-2); }
.dash-child-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif-display);
  font-size: 15px;
  font-style: italic;
  flex-shrink: 0;
}
.dash-child-avatar.ivy { background: var(--ivy); color: var(--gold-soft); }
.dash-child-avatar.gold { background: var(--gold); color: var(--ivy-deep); }
.dash-child-name {
  font-family: var(--serif-display);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.2;
}
.dash-child-stage {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 2px;
}
.dash-child-add {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}
.dash-child-add:hover { border-color: var(--ivy); color: var(--ivy); }

/* view toggle */
.dash-view-toggle {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-view-btn {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--serif-display);
  font-size: 15px;
  text-align: center;
  background: transparent;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}
.dash-view-btn.is-active {
  background: var(--ivy);
  color: var(--paper);
}
.dash-view-btn:hover:not(.is-active) { background: var(--paper-2); }

/* sidebar nav */
.dash-nav {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.dash-nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}
.dash-nav-item:last-child { border-bottom: none; }
.dash-nav-item:hover { background: var(--paper-2); }
.dash-nav-item.is-active { background: var(--paper-2); }
.dash-nav-label {
  font-family: var(--serif-display);
  font-size: 16px;
  color: var(--ink);
}
.dash-nav-en {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 2px;
}
.dash-nav-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--gold);
  flex-shrink: 0;
}

/* ---- Main content column ---------------------------------------------- */
.dash-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---- Header KPI banner ------------------------------------------------ */
.dash-header-banner {
  background: var(--ivy);
  color: var(--paper);
  padding: 28px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.dash-header-bg {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg,
    rgba(168,124,52,0.05) 0 14px,
    transparent 14px 30px);
  pointer-events: none;
}
.dash-header-inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.dash-header-greeting-eye {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  margin-bottom: 10px;
}
.dash-header-h2 {
  font-family: var(--serif-display);
  font-size: clamp(28px, 3vw, 40px);
  color: var(--paper);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
}
.dash-header-h2 em { font-style: italic; color: var(--gold-soft); }
.dash-header-hint {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 16px;
  color: var(--cream);
  margin-top: 10px;
  max-width: 560px;
  line-height: 1.45;
}
/* parent-only / student-only visibility */
.dash-parent-only { display: block; }
.dash-student-only { display: none; }
body.view-student .dash-parent-only { display: none; }
body.view-student .dash-student-only { display: block; }

.dash-header-kpis {
  display: flex;
  gap: 28px;
  flex-shrink: 0;
}
.dash-header-kpi {
  text-align: right;
}
.dash-header-kpi-n {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 30px;
  color: var(--gold-soft);
  line-height: 1;
}
.dash-header-kpi-l {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.6);
  margin-top: 5px;
}

/* ---- KPI row (4 cards) ------------------------------------------------ */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.dash-kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 22px;
}
.dash-kpi-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.dash-kpi-big {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  color: var(--ivy);
}
.dash-kpi-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 6px;
}

/* ---- Two-col mid row -------------------------------------------------- */
.dash-mid-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* ---- Today block ------------------------------------------------------ */
.dash-today {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
}
.dash-today-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dash-today h3 {
  font-family: var(--serif-display);
  font-size: 22px;
  color: var(--ink);
  font-weight: 500;
  margin: 0;
}
.dash-lesson {
  display: grid;
  grid-template-columns: 80px 1fr 120px;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.dash-lesson:last-child { border-bottom: none; }
.dash-lesson-time {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 24px;
  color: var(--ivy);
  line-height: 1;
}
.dash-lesson-end {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 2px;
}
.dash-lesson-kind-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.dash-lesson-subject {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.dash-lesson-title {
  font-family: var(--serif-display);
  font-size: 18px;
  color: var(--ink);
  line-height: 1.3;
}
.dash-lesson-teacher {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.dash-lesson-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: right;
}

/* ---- Wallet ----------------------------------------------------------- */
.dash-wallet {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
}
.dash-wallet-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--ink-2);
  opacity: 0.6;
  text-transform: uppercase;
}
.dash-wallet-balance {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 52px;
  color: var(--ivy);
  line-height: 1;
  margin-top: 10px;
}
.dash-wallet-balance .unit {
  font-size: 22px;
  color: var(--gold);
}
.dash-wallet-note {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 6px;
}
.dash-wallet-bars {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-wallet-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-wallet-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.dash-wallet-bar-label { color: var(--ink-2); }
.dash-wallet-bar-val {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.dash-wallet-bar-track {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.dash-wallet-bar-fill {
  height: 100%;
  background: var(--ivy);
  border-radius: 3px;
  transition: width 0.6s ease;
}
.dash-wallet-rows {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-wallet-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}
.dash-wallet-row .v { font-family: var(--serif-display); }
.dash-wallet-row .v.gold { color: var(--gold); }

/* ---- Growth curve ----------------------------------------------------- */
.dash-curve {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}
.dash-curve-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-curve h3 {
  font-family: var(--serif-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
.dash-curve-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.dash-curve-legend {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.dash-curve-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.dash-curve-legend .sw {
  display: inline-block;
  width: 14px;
  height: 2px;
  vertical-align: middle;
}

/* ---- Two-col bottom row ----------------------------------------------- */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ---- Knowledge tree --------------------------------------------------- */
.dash-tree {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}
.dash-tree h3 {
  font-family: var(--serif-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 16px;
}
.dash-tree-branches {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-branch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.dash-branch-name {
  font-family: var(--serif-display);
  font-size: 17px;
  color: var(--ink);
}
.dash-branch-stat {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}
.dash-branch-bar {
  display: flex;
  gap: 3px;
}
.dash-branch-seg {
  flex: 1;
  height: 8px;
  border-radius: 1px;
}
.dash-branch-seg.filled { background: var(--ivy); }
.dash-branch-seg.empty { background: var(--paper-2); border: 1px solid var(--line); }
.dash-tree-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ---- Messages --------------------------------------------------------- */
.dash-messages {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}
.dash-messages-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dash-messages h3 {
  font-family: var(--serif-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
.dash-msg-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-msg {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dash-msg.is-unread {
  background: var(--paper-2);
  border-color: var(--gold-soft);
}
.dash-msg:hover { border-color: var(--ivy); }
.dash-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.dash-msg-from {
  font-family: var(--serif-display);
  font-size: 17px;
  color: var(--ink);
}
.dash-msg-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-left: 10px;
}
.dash-msg-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.14em;
}
.dash-msg-body {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}
.dash-msg-unread-dot {
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Upcoming schedule ------------------------------------------------ */
.dash-upcoming {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}
.dash-upcoming h3 {
  font-family: var(--serif-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 16px;
}
.dash-schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.dash-day-cell {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  min-height: 120px;
  background: #fff;
}
.dash-day-cell.is-today { background: var(--paper-2); }
.dash-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.dash-day-wd {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.dash-day-num {
  font-family: var(--serif-display);
  font-size: 18px;
  color: var(--ink);
}
.dash-day-cell.is-today .dash-day-num {
  font-style: italic;
  color: var(--ivy);
}
.dash-event {
  padding: 5px 7px;
  border-radius: 2px;
  font-size: 10.5px;
  line-height: 1.3;
  font-family: var(--serif-display);
  margin-top: 4px;
}
.dash-event.ivy { background: var(--ivy); color: var(--paper); }
.dash-event.gold { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
.dash-event.burgundy { background: rgba(107,31,42,0.08); color: var(--burgundy); }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 1100px) {
  .dash-header-kpis { gap: 18px; }
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .dash-nav { grid-column: span 2; }
  .dash-mid-row { grid-template-columns: 1fr; }
  .dash-bottom-row { grid-template-columns: 1fr; }
  .dash-schedule-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
  .dash-sidebar { grid-template-columns: 1fr; }
  .dash-nav { grid-column: span 1; }
  .dash-kpi-row { grid-template-columns: 1fr 1fr; }
  .dash-schedule-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-header-kpis { flex-wrap: wrap; gap: 12px; }
}
