/* Parent portal: daily metrics, student detail, analytics, goals, progress. Load order matters: later files refine earlier ones (see docs/STRUCTURE.md). */
/* Parent: daily metrics */
.dsum { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.dsum div { background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 10px; text-align: center; }
.dsum b { display: block; font-size: 1.25rem; line-height: 1.2; } .dsum span { font-size: .75rem; color: var(--muted); }
.dbars { display: flex; align-items: flex-end; gap: 4px; height: 92px; margin: 8px 0 12px; padding: 4px 4px 0; border-bottom: 1.5px solid var(--line); }
.dbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.dbar i { display: block; width: 100%; max-width: 26px; min-height: 2px; background: #c7cbe8; border-radius: 6px 6px 0 0; } .dbar.goal i { background: var(--y); }
.dbar span { font-size: .65rem; color: var(--muted); margin-top: 2px; }
.tscroll { overflow-x: auto; } table.dm td, table.dm th { white-space: nowrap; font-size: .85rem; } table.dm td:last-child { white-space: normal; min-width: 160px; } table.dm tr.idle td { color: var(--muted); }

/* Parent area: tabs, overview, student detail */
.atabs { display: flex; gap: 6px; margin: 0 0 18px; padding: 5px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; position: sticky; top: 8px; z-index: 5; box-shadow: var(--shadow); }
.atabs button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 8px; border-radius: 12px; cursor: pointer; min-height: 44px; }
.atabs button.on { background: var(--y); color: var(--ink); } .atabs button:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.ovgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 12px; }
.ovcard { display: flex; flex-direction: column; gap: 6px; } .ovhead { display: flex; align-items: center; gap: 12px; } .ovhead .ring { margin-left: auto; width: 62px; height: 62px; font-size: .9rem; }
.ovhead .av { width: 46px; height: 46px; border-radius: 50%; background: var(--y-soft); display: grid; place-items: center; font-size: 1.6rem; flex: none; }
.dsum.tight { margin: 4px 0; } .dsum.tight b { font-size: 1.05rem; }
.alerts { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 5px; } .alerts.inline { flex-direction: row; flex-wrap: wrap; margin: 12px 0; }
.alerts li { font-size: .85rem; padding: 4px 10px; border-radius: 99px; background: var(--line); font-weight: 600; }
.alerts li.warn { background: #fff1c2; color: #92400e; } .alerts li.good { background: #dcfce7; color: #166534; } .alerts li.info { background: #eef0ff; color: var(--navy); }
.ovcard .small { align-self: flex-start; margin-top: auto; }
.spick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; align-items: center; }
.spick button { border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 99px; cursor: pointer; min-height: 40px; }
.spick button.on { background: var(--navy); color: #fff; border-color: var(--navy); } .dotw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e8644a; margin-left: 4px; }
.acc { border: 1.5px solid var(--line); border-radius: 14px; margin: 12px 0; background: #fff; } .acc > summary { cursor: pointer; font-weight: 700; padding: 12px 16px; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 44px; }
.acc > summary::-webkit-details-marker { display: none; } .acc > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; } .acc[open] > summary::after { transform: rotate(180deg); }
.acc > :not(summary) { margin-left: 16px; margin-right: 16px; } .acc[open] { padding-bottom: 12px; } .acc.sub { background: var(--bg); } .acc.danger summary { color: #881337; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; } .fchips button { border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 99px; cursor: pointer; } .fchips button.on { background: var(--y); border-color: var(--y-deep); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.empty { text-align: center; padding: 36px 20px; } .empty .big-emoji { font-size: 3rem; }
@media (max-width: 640px) { .atabs button { font-size: .85rem; padding: 10px 4px; } .ovgrid { grid-template-columns: 1fr; } .kcard .body { padding: 8px 12px 16px; } }

/* Parent analytics */
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: .9rem; } .hbar > div { background: var(--line); border-radius: 99px; height: 12px; overflow: hidden; } .hbar > div i { display: block; height: 100%; background: var(--y); border-radius: 99px; }
.stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--line); } .stack i { display: block; height: 100%; } .stack .l, .legend .l { background: #60a5fa; } .stack .p, .legend .p { background: var(--y); } .stack .q, .legend .q { background: #a78bfa; }
.legend { font-size: .8rem; color: var(--muted); margin: 0 0 8px; } .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; } .legend i:first-child { margin-left: 0; }
.ilist { margin: 0; padding-left: 20px; } .ilist li { margin: 6px 0; }
@media (max-width: 640px) { .hbar { grid-template-columns: 1fr auto; } .hbar > div { grid-column: 1 / -1; order: 3; } }

/* Goals */
.goalsf .presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .chipbtn { border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: .8rem; font-weight: 600; padding: 4px 11px; border-radius: 99px; cursor: pointer; min-height: 32px; } .chipbtn:hover { background: var(--y-soft); }
.goalrow { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 12px; font-size: .9rem; } .goalrow .bar { margin: 0; }

/* Progress + focus areas */
.sbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: #e7e8f3; margin: 6px 0; } .sbar.big { height: 18px; margin: 10px 0 6px; } .sbar i { display: block; height: 100%; }
.sbar .sm, .legend .sm { background: #22c55e; } .sbar .sg, .legend .sg { background: #fbbf24; } .sbar .sn, .legend .sn { background: #ef4444; } .sbar .ss, .legend .ss { background: #93c5fd; } .legend .s0 { background: #e7e8f3; }
.subprog { margin: 10px 0; } .subhead { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.focus { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.focus li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--line); } .focus .fi { font-size: 1.1rem; line-height: 1.4; }
.focus li.fix { border-color: #fecdd3; background: #fff5f6; } .focus li.polish, .focus li.lesson { border-color: #fde68a; background: #fffbeb; } .focus li.next { border-color: #c7d2fe; background: #f5f6ff; } .focus li.habit { border-color: #bbf7d0; background: #f3fff7; }
.focus.kid li { align-items: center; } .focus.kid li > div { flex: 1; } .focus.kid button { flex: none; }
.ovprog { margin: 4px 0; }
