/* ═══════════════════════════════════════════════════════════════
   EP Classroom — Usage & costs panels (js/usage-panel.js), owner only.
   Uses the theme variables from themes.css (dark backgrounds, light text).
═══════════════════════════════════════════════════════════════ */

/* ── Toolbar ── */
.up-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.up-select {
  background: var(--bg-input, #1e2535); color: var(--text, #e6edf3);
  border: 1px solid var(--border-l, #2a3550); border-radius: 9px;
  padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.up-select:focus { outline: none; border-color: var(--accent, #4f8ef7); }
.up-search { position: relative; flex: 1 1 260px; min-width: 220px; }
.up-search input {
  width: 100%; box-sizing: border-box; padding: 9px 12px 9px 34px;
  background: var(--bg-input, #1e2535); color: var(--text, #e6edf3);
  border: 1px solid var(--border-l, #2a3550); border-radius: 9px; font: inherit; font-size: 13.5px;
}
.up-search input:focus { outline: none; border-color: var(--accent, #4f8ef7); }
.up-search input::placeholder { color: var(--muted, #8b96ad); }
.up-search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .8; pointer-events: none; }
.up-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--bg-panel2, #1c2333); border: 1px solid var(--border-l, #2a3550); border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5); padding: 4px; max-height: 320px; overflow-y: auto;
}
.up-sugg-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; color: var(--text, #e6edf3); font: inherit; font-size: 13.5px;
  padding: 7px 8px; border-radius: 7px; cursor: pointer;
}
.up-sugg-item:hover { background: var(--bg-hover, #232c3f); }
.up-sugg-item small { display: block; color: var(--muted, #8b96ad); font-size: 11.5px; }
.up-sugg-none { color: var(--muted, #8b96ad); font-size: 13px; padding: 10px; }

.up-seg { display: inline-flex; border: 1px solid var(--border-l, #2a3550); border-radius: 9px; overflow: hidden; }
.up-seg button { background: var(--bg-input, #1e2535); color: var(--muted, #8b96ad); border: none; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.up-seg button.on { background: var(--accent, #4f8ef7); color: #fff; font-weight: 600; }

/* ── KPI cards ── */
.up-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 14px; }
.up-kpi {
  background: var(--bg-panel2, #1c2333); border: 1px solid var(--border-l, #2a3550);
  border-radius: 12px; padding: 12px 14px;
}
.up-kpi-l { font-size: 11.5px; color: var(--muted, #8b96ad); text-transform: uppercase; letter-spacing: .05em; }
.up-kpi-v { font-size: 24px; font-weight: 800; color: var(--text-strong, #fff); margin: 4px 0 2px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-kpi-v.sm { font-size: 18px; }
.up-kpi-s { font-size: 12px; color: var(--muted, #8b96ad); line-height: 1.4; }
.up-meter { height: 6px; border-radius: 99px; background: var(--bg-input, #1e2535); margin: 6px 0; overflow: hidden; }
.up-meter span { display: block; height: 100%; background: var(--accent, #4f8ef7); border-radius: 99px; }

/* ── Cards / layout ── */
.up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .up-grid { grid-template-columns: 1fr; } }
.up-card {
  background: var(--bg-panel2, #1c2333); border: 1px solid var(--border-l, #2a3550);
  border-radius: 12px; padding: 14px; margin: 0 0 12px; min-width: 0;
}
.up-card h4 { margin: 0 0 10px; font-size: 14px; color: var(--text, #e6edf3); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.up-h-hint { font-weight: 400; font-size: 12px; color: var(--muted, #8b96ad); }
.up-empty { color: var(--muted, #8b96ad); font-size: 13px; padding: 14px 4px; text-align: center; }
.up-empty.err { color: #fca5a5; }
.up-foot { color: var(--muted, #8b96ad); font-size: 12px; margin: 6px 2px 0; line-height: 1.5; }
.up-muted { color: var(--muted, #8b96ad); font-size: 12px; }

/* ── Features list ── */
.up-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--muted, #8b96ad); margin: -4px 0 10px; }
.up-legend span { display: inline-flex; align-items: center; gap: 5px; }
.up-kind { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; flex-shrink: 0; background: #94a3b8; }
.up-kind.act { background: #7dd3fc; }
.up-kind.game { background: #f9a8d4; }
.up-kind.other { background: #fcd34d; }
.up-kind.ref { background: #c4b5fd; }
.up-kind.notes { background: #fdba74; }
.up-kind.tasks { background: #5eead4; }
.up-kind.planner { background: #a5b4fc; }
.up-kind.materials { background: #fde68a; }
.up-kind.ping { background: #fca5a5; }
.up-kind.sound { background: #d9f99d; }
.up-kind.remind { background: #e2e8f0; }
.up-kind.open { background: #86efac; }
.up-feat { padding: 8px 8px 9px; border-radius: 9px; cursor: pointer; }
.up-feat:hover { background: var(--bg-hover, #232c3f); }
.up-feat.open { background: var(--bg-active, #2a3550); }
.up-feat-top { display: flex; align-items: center; font-size: 13.5px; color: var(--text, #e6edf3); }
.up-feat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-feat-n { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 10px; }
.up-feat-who { font-size: 11.5px; color: var(--muted, #8b96ad); margin-top: 4px; }
.up-feat-users { margin-top: 8px; }
.up-bar { display: block; height: 6px; border-radius: 99px; background: var(--bg-input, #1e2535); margin-top: 6px; overflow: hidden; }
.up-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent, #4f8ef7), #7dd3fc); }
.up-bar.mini { display: inline-block; width: 70px; height: 5px; margin: 0 8px 0 0; vertical-align: middle; }

/* ── People ── */
.up-people { display: flex; flex-direction: column; gap: 2px; max-height: 460px; overflow-y: auto; }
.up-person {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 9px; padding: 7px 8px; cursor: pointer;
  color: var(--text, #e6edf3); font: inherit;
}
.up-person:hover { background: var(--bg-hover, #232c3f); }
.up-person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.up-person-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-person-sub { font-size: 12px; color: var(--muted, #8b96ad); }
.up-person-stat { display: flex; flex-direction: column; align-items: flex-end; min-width: 46px; }
.up-person-stat b { font-size: 14px; font-variant-numeric: tabular-nums; }
.up-person-stat small { font-size: 10.5px; color: var(--muted, #8b96ad); }

.up-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #0d1117; background: #7dd3fc;
}
.up-avatar.stu { background: #86efac; }
.up-avatar.sm { width: 22px; height: 22px; font-size: 11px; margin-right: 8px; vertical-align: middle; }
.up-avatar.lg { width: 44px; height: 44px; font-size: 19px; }

.up-chip {
  display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  background: rgba(125, 211, 252, .12); border: 1px solid rgba(125, 211, 252, .35);
  color: var(--text, #e6edf3); font: inherit; font-size: 12.5px;
}
.up-chip b { margin-left: 3px; color: #7dd3fc; }
.up-chip.stu { background: rgba(134, 239, 172, .1); border-color: rgba(134, 239, 172, .35); }
.up-chip.stu b { color: #86efac; }
.up-chip.sm { cursor: default; font-size: 12px; padding: 2px 8px; margin: 0 4px 4px 0; }
.up-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; margin-left: 6px; background: rgba(125, 211, 252, .15); color: #7dd3fc; }
.up-tag.stu { background: rgba(134, 239, 172, .14); color: #86efac; }

.up-idle summary { cursor: pointer; color: var(--text, #e6edf3); font-size: 13.5px; font-weight: 600; }
.up-idle-list { margin-top: 10px; }

/* ── Person detail ── */
.up-person-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.up-person-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 200px; }
.up-person-title h3 { margin: 0; font-size: 20px; color: var(--text-strong, #fff); }
.up-btn {
  background: var(--accent, #4f8ef7); color: #fff; border: none; border-radius: 9px;
  padding: 9px 16px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.up-btn:hover { filter: brightness(1.1); }
.up-btn.ghost { background: var(--bg-input, #1e2535); color: var(--text, #e6edf3); border: 1px solid var(--border-l, #2a3550); font-weight: 600; }
.up-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; margin: 0 0 14px; padding: 12px 14px; background: var(--bg-panel2, #1c2333); border: 1px solid var(--border-l, #2a3550); border-radius: 12px; }
.up-meta div { display: flex; flex-direction: column; min-width: 0; }
.up-meta span { font-size: 11px; color: var(--muted, #8b96ad); text-transform: uppercase; letter-spacing: .05em; }
.up-meta b { font-size: 13.5px; color: var(--text, #e6edf3); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.up-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.up-table th { text-align: left; font-size: 11.5px; color: var(--muted, #8b96ad); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border-l, #2a3550); }
.up-table td { padding: 8px; color: var(--text, #e6edf3); border-bottom: 1px solid var(--border, #1f2838); vertical-align: middle; }
.up-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.up-table tr.up-click { cursor: pointer; }
.up-table tr.up-click:hover td { background: var(--bg-hover, #232c3f); }
.up-costcell { white-space: nowrap; text-align: right; }

.up-timeline { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.up-tl-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border, #1f2838); }
.up-tl-day { width: 92px; flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: var(--text, #e6edf3); padding-top: 2px; }
.up-tl-items { flex: 1; min-width: 0; }

/* ── Cost chart ── */
.up-chart-card h4 { margin-bottom: 8px; }
.up-chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.up-col { flex: 1; height: 100%; display: flex; align-items: flex-end; background: rgba(255, 255, 255, .03); border-radius: 3px; }
.up-col span { display: block; width: 100%; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #7dd3fc, var(--accent, #4f8ef7)); }
.up-col:hover span { filter: brightness(1.25); }
.up-chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted, #8b96ad); margin-top: 6px; }

/* ── Cost modal ── */
.up-cost-modal { width: 620px; max-width: 94vw; max-height: 88vh; overflow-y: auto; }
.up-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.up-modal-head h3 { margin: 0; font-size: 19px; color: var(--text-strong, #fff); }

/* ✨ AI allowances (owner) */
.up-ai-default { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; font-size: 14px; color: #e6edf3; }
.up-ai-input { width: 80px; padding: 5px 8px; border-radius: 8px; border: 1px solid #30363d; background: #0d1117; color: #e6edf3; font: inherit; font-size: 14px; }
.up-ai-input:focus { outline: none; border-color: #7dd3fc; }
