/* ── Catalog combobox, level checklist, filters, availability, interview ── */

[hidden] { display: none !important; }

/* Combobox */
.combo { position: relative; }
.combo-list {
  display: none; position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 320px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.combo-list.open { display: block; }
.combo-option {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; cursor: pointer; font-size: 0.9375rem;
}
.combo-option:hover, .combo-option.active { background: var(--bg); }
.combo-meta { color: var(--text-secondary); font-size: 0.75rem; white-space: nowrap; align-self: center; }
.combo-empty { padding: 12px; color: var(--text-secondary); font-size: 0.875rem; }

/* Level + course checklist */
.level-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.level-tab {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  border-radius: 999px; padding: 6px 14px; font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.level-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.level-count {
  display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; text-align: center;
  background: rgba(0,122,255,0.15); color: var(--primary); font-size: 0.6875rem; font-weight: 700;
}
.level-tab.active .level-count { background: rgba(255,255,255,0.3); color: #fff; }
.level-filter { margin-bottom: 8px; }
.level-courses {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px;
  max-height: 280px; overflow-y: auto; padding: 4px 0;
}
.course-check { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 0.875rem; cursor: pointer; border-radius: 6px; }
.course-check:hover { background: var(--bg); }
.course-check.suggested { background: rgba(52,199,89,0.1); }
.course-hint { font-size: 0.6875rem; color: var(--accent); margin-left: auto; }
.level-summary { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 8px; }
.history-prompt { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.field-hint { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 4px; }
.field-hint .char-count { float: right; }

/* Filters modal */
.filters-btn { white-space: nowrap; }
.dual-range { position: relative; height: 28px; margin-top: 8px; }
.dual-range-track { position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--border); }
.dual-range-fill { position: absolute; top: 0; bottom: 0; background: var(--primary); border-radius: 2px; }
.dual-range input[type=range] {
  position: absolute; left: 0; width: 100%; top: 0; margin: 0; height: 28px;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.dual-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: grab;
}
.dual-range input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary); cursor: grab;
}
.dual-range input[type=range]::-webkit-slider-runnable-track { background: none; }
.dual-range input[type=range]::-moz-range-track { background: none; }
.star-filter { display: flex; gap: 4px; }
.star-btn {
  background: none; border: none; font-size: 2rem; line-height: 1; cursor: pointer; padding: 2px 4px;
  color: var(--border);
}
.star-btn.filled { color: #FFB800; }
.star-btn:focus-visible { outline: 2px solid var(--primary); border-radius: 6px; }

/* Weekly availability editor */
.avail-day { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.avail-day:last-child { border-bottom: none; }
.avail-day-name { width: 96px; font-weight: 600; font-size: 0.875rem; padding-top: 8px; flex-shrink: 0; }
.avail-day-windows { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.avail-window { display: flex; align-items: center; gap: 8px; }
.avail-window input[type=time] { width: auto; }

/* Admin tabs + dashboard charts */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.admin-tabs .admin-tab { flex-shrink: 0; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }
.admin-tabs .admin-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.chart-card h4 { margin-bottom: 2px; }
.chart-hint { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 8px; }
.chart-box { position: relative; height: 260px; }
.attention-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.attention-item {
  flex: 1 0 auto; display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text); font: inherit; cursor: pointer; text-align: left; white-space: nowrap;
}
.attention-item:disabled { cursor: default; }
.attention-item:not(:disabled):hover { border-color: var(--primary); }
.attention-item .value { font-size: 1.25rem; font-weight: 700; color: var(--primary); min-width: 1.5ch; }
.attention-item.warn .value { color: var(--danger); }
.attention-item .label { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.2; }
.attention-item .hint { display: block; font-size: 0.7rem; color: var(--danger); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.range-select { font: inherit; font-size: 0.75rem; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); }
@media (max-width: 420px) { .chart-grid { grid-template-columns: 1fr; } }

/* Pre-join popup */
.prejoin-video { position: relative; background: #111; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.prejoin-video video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.prejoin-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #bbb; }
.prejoin-controls { display: flex; justify-content: center; gap: 16px; margin: 14px 0 6px; }
.round-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.round-btn.off { background: var(--danger); border-color: var(--danger); }
/* No camera-off icon exists, so slash the camera icon */
#prejoin-cam { position: relative; }
#prejoin-cam.off::after { content: ''; position: absolute; width: 30px; height: 3px; background: #fff; border-radius: 2px; transform: rotate(-45deg); box-shadow: 0 0 0 1px var(--danger); }
.round-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Admin tables + interview room */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th, .admin-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text-secondary); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.interview-stage { position: relative; max-width: 860px; }
.interview-remote {
  min-height: 360px; background: #111; border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.interview-placeholder { color: #aaa; }
.interview-video { width: 100%; max-height: 520px; object-fit: contain; background: #111; }
.interview-local {
  position: absolute; right: 12px; bottom: 12px; width: 160px; border-radius: 10px; overflow: hidden;
  background: #222; box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.interview-local .interview-video { transform: scaleX(-1); }

@media (max-width: 600px) {
  .avail-day { flex-direction: column; gap: 4px; }
  .interview-local { width: 100px; }
}

/* Stripe reassurance */
.stripe-badge { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
/* The wordmark is fixed purple, so its tile stays light in dark mode like a logo chip */
.stripe-badge-logo { flex-shrink: 0; width: 76px; height: 56px; display: flex; align-items: center; justify-content: center; background: #eef0ff; border-radius: 12px; }
.stripe-badge-logo img { width: 54px; height: auto; }
.stripe-badge-text { flex: 1; min-width: 0; }
.stripe-badge-text strong { display: block; font-size: 1rem; color: var(--text); }
.stripe-badge-text p { margin: 2px 0 0; font-size: 0.8125rem; line-height: 1.35; color: var(--text-secondary); }
.stripe-badge-lock { flex-shrink: 0; color: var(--text-secondary); }
.stripe-badge-action { flex-shrink: 0; }
@media (max-width: 480px) {
  .stripe-badge { gap: 12px; padding: 12px; flex-wrap: wrap; }
  .stripe-badge-action { width: 100%; }
  .stripe-badge-action .btn { width: 100%; }
  .stripe-badge-logo { width: 64px; height: 48px; }
  .stripe-badge-logo img { width: 46px; }
}

/* Last-seen badges on admin Users: the app's .badge, plus a dot for "Online now" */
.badge.seen { white-space: nowrap; }
.badge.seen b { color: var(--text); font-weight: 700; }

/* Destructive confirmation modal */
.danger-modal { max-width: 400px; text-align: center; padding: 28px 24px 22px; }
.danger-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 59, 48, 0.12); color: var(--danger); }
.danger-modal h3 { margin: 0 0 4px; font-size: 1.125rem; }
.danger-sub { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 12px; word-break: break-all; }
.danger-modal p { margin: 0 0 22px; font-size: 0.875rem; line-height: 1.45; color: var(--text-secondary); }
.danger-actions { display: flex; gap: 10px; }
.danger-actions .btn { flex: 1; }
.badge.seen .seen-dot { width: 6px; height: 6px; border-radius: 50%; background: #34C759; }

/* ── Student home: live subject supply ── */
.supply-live {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #248A3D; background: rgba(52, 199, 89, 0.12);
}
.supply-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #34C759; animation: supply-pulse 1.6s ease-in-out infinite; }
@keyframes supply-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.supply-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 6px; }
.supply-summary strong { color: var(--text); font-weight: 700; }
.supply-summary .sep { color: var(--border); }
.supply-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--border); margin-right: 5px; vertical-align: middle; }
.supply-dot.on { background: #34C759; }
.subject-level { margin-top: 12px; }
.subject-level-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); margin-bottom: 6px; }
.subject-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 9px 7px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font: inherit;
  font-size: 0.8125rem; font-weight: 500; cursor: pointer; transition: border-color var(--transition), transform var(--transition), background var(--transition);
}
.subject-chip:hover { border-color: var(--primary); transform: translateY(-1px); }
.subject-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.subject-chip.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.subject-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 1px 7px;
  border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--bg); color: var(--text-secondary);
}
.subject-chip.has-online .subject-count { background: rgba(52, 199, 89, 0.14); color: #248A3D; }
.subject-chip.selected .subject-count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.subject-chip.selected .supply-dot.on { background: #fff; }
.supply-note { font-size: 0.75rem; color: var(--text-light); margin-top: 12px; line-height: 1.45; }
.supply-empty p { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.45; }
.supply-empty p:last-child { margin-bottom: 0; }

/* ── Student onboarding ── */
.onboarding-card { padding: 0; overflow: hidden; border: 1px solid rgba(0, 122, 255, 0.3); }
.onboarding-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; background: var(--primary); color: #fff; }
.onboarding-head h3 { color: #fff; margin: 0; }
.onboarding-head .btn { background: rgba(255, 255, 255, 0.18); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); }
.onboarding-head .btn:hover { background: rgba(255, 255, 255, 0.3); }
.onboarding-steps { list-style: none; margin: 0; padding: 22px 20px 24px; display: grid; gap: 20px; }
.onboarding-steps li { display: flex; gap: 14px; align-items: flex-start; }
.onboarding-steps .step-num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: rgba(0, 122, 255, 0.12); color: var(--primary); font-size: 0.875rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.onboarding-steps strong { display: block; font-size: 0.9375rem; margin-bottom: 4px; }
.onboarding-steps div > span { display: block; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.45; }
@media (min-width: 700px) { .onboarding-steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

/* ── Form field help ── */
.field-help { font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
