/* Korotuksen opettajanäkymä: Aktiivisuus-välilehti (1.12.2026, static/js/korotusActivity.js).
   Kaaviot siirretty Alaian dashboardilta, vaalea teema korotusmodaalin tyyliin. */

/* Ryhmän lista */
.korotus-activity-days {
  font-family: inherit; font-size: 13px; font-weight: 800; color: #374151;
  border: 1px solid #e2e4f0; border-radius: 999px; padding: 8px 12px; background: #fff; cursor: pointer;
}
.korotus-activitytable td { vertical-align: middle; }
.korotus-activity-bar { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 700; }
.korotus-activity-bar > span { flex: 0 0 90px; height: 8px; background: #eef0f7; border-radius: 4px; overflow: hidden; }
.korotus-activity-bar > span b { display: block; height: 100%; background: #4f46e5; border-radius: 4px; }
.korotus-activity-note { font-size: 12px; color: #9ca3af; font-weight: 600; margin-top: 8px; }

/* Opiskelijan kaaviot */
.mpxa {
  --a-surface: #ffffff;
  --a-border: #ecedf5;
  --a-grid: #eef0f7;
  --a-axis: #d1d5e4;
  --a-text: #1f2937;
  --a-text-2: #4b5563;
  --a-muted: #9ca3af;
  --a-s1: #4f46e5;       /* työskentely, yksisarjaiset */
  --a-s1-soft: #dcdcfb;  /* sovellus auki (taustapalkki) */
  --a-s2: #e8692f;
  --a-s3: #16a37a;
  --a-s4: #d49a06;
  --a-s5: #d4528a;
  --a-up: #047857;
  --a-down: #b91c1c;
  color: var(--a-text);
  font-size: 13px;
}
.mpxa * { box-sizing: border-box; }
.mpxa-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.korotus-scope .mpxa-back {
  border: 1px solid #e2e4f0; background: #fff; border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 800; color: #4f46e5; cursor: pointer;
}
.korotus-scope .mpxa-back:hover { border-color: #a5b4fc; }
.mpxa-who { display: flex; flex-direction: column; min-width: 0; }
.mpxa-who .name { font-size: 16px; font-weight: 900; color: #312e81; }
.mpxa-who .meta { font-size: 12px; color: var(--a-muted); font-weight: 600; }
.mpxa-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.mpxa-seg { display: inline-flex; border: 1px solid #e2e4f0; border-radius: 999px; overflow: hidden; background: #fff; }
.korotus-scope .mpxa-seg button {
  background: transparent; color: var(--a-text-2); border: none; padding: 7px 12px;
  font-size: 12.5px; font-weight: 800; cursor: pointer; border-right: 1px solid #e2e4f0; border-radius: 0;
}
.korotus-scope .mpxa-seg button:last-child { border-right: none; }
.korotus-scope .mpxa-seg button.on { background: #312e81; color: #fff; }
.mpxa-nav { display: inline-flex; align-items: center; gap: 4px; }
.korotus-scope .mpxa-nav button {
  background: #fff; border: 1px solid #e2e4f0; color: var(--a-text-2);
  border-radius: 999px; padding: 4px 11px; cursor: pointer; font-size: 14px; font-weight: 800;
}
.korotus-scope .mpxa-nav button:disabled { opacity: 0.35; cursor: default; }
.mpxa-nav .lbl { min-width: 150px; text-align: center; font-size: 13px; font-weight: 800; color: var(--a-text); }
.mpxa select {
  font-family: inherit; background: #fff; color: var(--a-text); border: 1px solid #e2e4f0; border-radius: 999px;
  padding: 6px 10px; font-size: 12.5px; font-weight: 700;
}
.mpxa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin-bottom: 14px; }
.mpxa-kpi { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 14px; padding: 10px 12px; }
.mpxa-kpi .k { font-size: 10.5px; color: var(--a-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 900; }
.mpxa-kpi .v { font-size: 20px; font-weight: 900; color: #312e81; font-variant-numeric: tabular-nums; margin-top: 2px; }
.mpxa-kpi .v small { font-size: 11.5px; font-weight: 700; color: var(--a-text-2); margin-left: 3px; }
.mpxa-kpi .d { font-size: 11px; color: var(--a-muted); margin-top: 2px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mpxa-kpi .d.up { color: var(--a-up); }
.mpxa-kpi .d.down { color: var(--a-down); }
.mpxa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mpxa-card { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.mpxa-card.wide { grid-column: 1 / -1; }
.mpxa-card h4 { font-size: 13px; font-weight: 900; color: var(--a-text); margin: 0 0 2px; }
.mpxa-card .sub { font-size: 11.5px; color: var(--a-muted); margin-bottom: 8px; line-height: 1.45; font-weight: 600; }
.mpxa-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--a-text-2); margin-bottom: 6px; font-weight: 700; }
.mpxa-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mpxa-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mpxa svg { display: block; width: 100%; overflow: visible; }
.mpxa svg text { fill: var(--a-muted); font-size: 10px; font-family: inherit; font-weight: 700; }
.mpxa svg .hit { fill: transparent; cursor: pointer; }
.mpxa svg .hit:hover { fill: rgba(79, 70, 229, 0.06); }
.mpxa-tip {
  position: fixed; z-index: 100000; pointer-events: none; background: #fff; border: 1px solid #e2e4f0;
  border-radius: 10px; padding: 8px 10px; font-family: 'Nunito', sans-serif; font-size: 12px; color: #1f2937;
  min-width: 150px; box-shadow: 0 10px 28px rgba(31, 41, 55, 0.16); display: none; line-height: 1.5;
}
.mpxa-tip .t { font-weight: 900; margin-bottom: 3px; color: #312e81; }
.mpxa-tip .r { display: flex; justify-content: space-between; gap: 14px; color: #6b7280; font-weight: 600; }
.mpxa-tip .r b { color: #1f2937; font-weight: 800; font-variant-numeric: tabular-nums; }
.mpxa-tip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.mpxa-tip .hint { margin-top: 4px; color: #9ca3af; font-size: 11px; }
.mpxa-hbar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 64px; gap: 8px; align-items: center; margin-bottom: 5px; }
.mpxa-hbar .l { font-size: 12px; color: var(--a-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mpxa-hbar .tr { height: 8px; background: var(--a-grid); border-radius: 4px; overflow: hidden; }
.mpxa-hbar .tr b { display: block; height: 100%; background: var(--a-s1); border-radius: 4px; }
.mpxa-hbar .n { font-size: 12px; color: var(--a-text); text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.mpxa-muted { color: var(--a-muted); }
.mpxa-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.mpxa-row { display: flex; gap: 10px; align-items: baseline; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--a-grid); }
.mpxa-row .tm { color: var(--a-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; width: 88px; font-weight: 700; }
.mpxa-row .tx { color: var(--a-text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mpxa-row .tx b { color: var(--a-text); font-weight: 800; }
.mpxa-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; margin-top: 3px; }
.mpxa-empty { color: var(--a-muted); font-size: 13px; padding: 18px 4px; text-align: center; font-weight: 700; }
.mpxa-actions { display: flex; gap: 8px; margin-top: 10px; }
.korotus-scope .mpxa-actions button {
  background: #fff; border: 1px solid #e2e4f0; color: var(--a-text-2); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 800; cursor: pointer;
}
.mpxa-tablewrap { overflow-x: auto; }
.mpxa table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.mpxa th, .mpxa td { padding: 4px 6px; border-bottom: 1px solid var(--a-grid); text-align: right; font-variant-numeric: tabular-nums; }
.mpxa th:first-child, .mpxa td:first-child { text-align: left; }
.mpxa th { color: var(--a-muted); font-weight: 900; }
.mpxa-loading { color: var(--a-muted); padding: 30px; text-align: center; font-weight: 700; }
.mpxa-note { font-size: 11.5px; color: var(--a-muted); margin-top: 10px; line-height: 1.5; font-weight: 600; }
@media (max-width: 760px) {
  .mpxa-grid { grid-template-columns: 1fr; }
  .mpxa-controls { margin-left: 0; }
}
