/* spa/profile.css — Panel: Profile — hero, stat-row, info-rows, modal. */

/* ══════════════════════════════════════════════════════════════
   PANEL: PROFILE
   ══════════════════════════════════════════════════════════════ */

/* ── PROFILE HERO CARD ──────────────────────────── */
.profile-hero {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  padding: 22px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 16px; overflow: hidden;
}

.profile-hero::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 60%;
  border-radius: 20px 0 0 20px;
  background: linear-gradient(135deg, rgba(207, 220, 255, 0.4) 0%, rgba(207,220,255,0) 75%);
  pointer-events: none; z-index: 1;
}

.profile-hero::after {
  display: none;
}

.avatar {
  position: relative; z-index: 2; width: 52px; height: 52px; min-width: 52px;
  border-radius: 50%; background: #0f172a; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; box-shadow: 0 3px 12px rgba(20,30,70,0.12);
}

.ph-body { position: relative; z-index: 2; flex: 1; min-width: 0; }

.ph-body h2 {
  font-size: 16px; font-weight: 700; letter-spacing: -0.2px; margin: 0 0 3px;
  text-transform: none; color: #0f172a;
}

.ph-body .ph-mail {
  font-size: 12.5px; font-weight: 500; color: var(--muted); margin: 0 0 8px; overflow-wrap: anywhere;
}

.plan-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.2px;
  padding: 0 9px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-soft-text);
}

.plan-pill.is-free { background: var(--blue-soft); color: var(--blue-soft-text); }
.plan-pill.is-expired { background: var(--orange-soft, #ffedd5); color: var(--orange-soft-text, #c2410c); }
.plan-pill svg { width: 13px; height: 13px; }

.hero-exam-badge {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.2px;
  padding: 0 9px; border-radius: 999px;
  background: rgba(99,102,241,0.12); color: #4338ca;
  border: 1px solid rgba(99,102,241,0.25);
  max-width: 100%; line-height: 1;
}
.hero-exam-badge > span,
.hero-exam-badge #hero-exam-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-exam-badge svg {
  width: 14px !important; height: 14px !important;
  min-width: 14px; min-height: 14px; max-width: 14px; max-height: 14px;
  flex-shrink: 0; display: inline-block; vertical-align: middle;
  stroke: #4f46e5;
}

/* ── HERO STAT CARDS (Phase 3 Overhaul) ──────────── */
.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.hero-stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  min-height: 152px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.hero-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0.95;
  border-radius: 18px 18px 0 0;
}

.hero-stat-card.card-member::before {
  background: linear-gradient(90deg, #6366f1, #818cf8);
}
.hero-stat-card.card-plan.is-plan-premium::before {
  background: linear-gradient(90deg, #10b981, #059669);
}
.hero-stat-card.card-plan.is-plan-free::before {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.hero-stat-card.card-plan.is-plan-expired::before {
  background: linear-gradient(90deg, #ef4444, #f87171);
}
.hero-stat-card.card-bookmarks::before {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.hero-stat-card::after {
  display: none;
}

.hero-stat-card.is-clickable {
  cursor: pointer;
  user-select: none;
}
.hero-stat-card.is-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(20, 30, 70, 0.12), 0 4px 12px -2px rgba(20, 30, 70, 0.06), inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(99, 102, 241, 0.35);
}
.hero-stat-card.is-clickable:active {
  transform: translateY(-1px) scale(0.99);
}

.hsc-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hsc-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hsc-icon-badge svg {
  width: 18px;
  height: 18px;
}
.badge-indigo { background: #e0e7ff; color: #4338ca; }
.badge-emerald { background: #d1fae5; color: #047857; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

.milestone-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.25);
  text-transform: uppercase;
}

.plan-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.plan-status-pill.pill-active {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.plan-status-pill.pill-free {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.plan-status-pill.pill-expired {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.vault-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid rgba(139, 92, 246, 0.3);
  text-transform: uppercase;
}

.hsc-body {
  position: relative;
  z-index: 2;
  margin-bottom: 12px;
}
.hsc-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.hsc-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hsc-number {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
  letter-spacing: -0.3px;
}
.is-plan-expired .hsc-number {
  color: #dc2626;
}
.hsc-unit {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.hsc-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}
.hsc-footer svg {
  stroke: #94a3b8;
  flex-shrink: 0;
}
.hsc-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 800;
  transition: color 0.15s ease, transform 0.15s ease;
}
.hsc-cta.cta-upgrade { color: #2563eb; }
.hsc-cta.cta-manage { color: #059669; }
.hsc-cta.cta-danger { color: #dc2626; }
.hsc-cta.cta-purple { color: #7c3aed; }
.hero-stat-card:hover .hsc-cta {
  transform: translateX(3px);
}

/* Backward compatibility for any residual .stat-box selectors */
.stat-box .label { font-size: 11.5px; font-weight: 700; }
.stat-box .num { font-size: 18px; font-weight: 800; }
.stat-sublabel { font-size: 11.5px; font-weight: 600; }

/* ── SECTION LABEL (profile/subscription) ───────── */
#panel-profile .section-label,
#panel-subscription .section-label {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px; font-size: 12px; font-weight: 800;
  letter-spacing: 0.3px; color: #334155; text-transform: uppercase;
}

/* ── PANEL CARD ─────────────────────────────────── */
.panel {
  position: relative; overflow: hidden;
  background: #ffffff;
  border-radius: 18px; border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  padding: 6px; margin-bottom: 18px;
}

.panel::after {
  display: none;
}

/* ── INFO ROWS ──────────────────────────────────── */
.info-row {
  position: relative; z-index: 1; display: flex; align-items: center;
  gap: 14px; padding: 14px; border-bottom: 1px solid var(--card-border);
}

.info-row:last-child { border-bottom: none; }

/* ── 2-COL GRID (desktop) ───────────────────────────────────── */
@media (min-width: 1024px) {
  .panel.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  /* Kill all horizontal borders — hidden items break nth-last-child counting */
  .panel.info-grid .info-row,
  .panel.info-grid .info-row:last-child {
    border-bottom: none;
  }
  /* Only column separator */
  .panel.info-grid .info-row:nth-child(odd) {
    border-right: 1px solid var(--card-border);
  }
  /* Row separator via top-border on rows 2 and onwards */
  .panel.info-grid .info-row:nth-child(n+3) {
    border-top: 1px solid var(--card-border);
  }
}

.info-row .ir-icon {
  width: 38px; height: 38px; min-width: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}

.info-row .ir-icon svg { width: 18px; height: 18px; }

.info-row.c-blue .ir-icon   { background: var(--blue-soft);   color: var(--blue-soft-text); }
.info-row.c-green .ir-icon  { background: var(--green-soft);  color: var(--green-soft-text); }
.info-row.c-orange .ir-icon { background: var(--orange-soft); color: var(--orange-soft-text); }
.info-row.c-red .ir-icon    { background: var(--red-soft);    color: var(--red-soft-text); }
.info-row.c-purple .ir-icon { background: #ede9fe; color: #6d28d9; }
.info-row.c-slate .ir-icon  { background: #f1f5f9; color: #475569; }
.info-row.c-indigo .ir-icon { background: #e0e7ff; color: #4338ca; }

.referral-reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.25);
  line-height: 1.2;
}

.btn-copy-id, #btn-share-referral {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-copy-id.is-copied, #btn-share-referral.is-copied {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}
.btn-copy-id.is-copied svg, #btn-share-referral.is-copied svg {
  stroke: #ffffff;
}

.ir-body { flex: 1; min-width: 0; }
.ir-label { font-size: 12px; font-weight: 800; letter-spacing: 0.4px; color: #64748b; text-transform: uppercase; margin-bottom: 3px; }
.ir-value { font-size: 14px; font-weight: 700; color: #0f172a; overflow-wrap: anywhere; }

.ir-action {
  position: relative; overflow: hidden; flex-shrink: 0;
  height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(20,30,70,0.04);
  font-size: 12px; font-weight: 700; color: #0f172a; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-main);
}

.ir-action::after {
  display: none;
}

.ir-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  box-shadow: 0 2px 5px rgba(20,30,70,0.08);
  transform: translateY(-1px);
}

.ir-action:active { transform: scale(0.96); }

/* ── MODAL ──────────────────────────────────────── */
body.ao-modal-open {
  overflow: hidden !important;
  touch-action: none;
}

.ao-modal-scrim {
  position: fixed; inset: 0; background: rgba(15,23,42,0.65);
  display: none; align-items: center; justify-content: center;
  padding: 16px; z-index: 210;
}

.ao-modal-scrim.is-open { display: flex; }

.ao-modal-box {
  position: relative; overflow-y: auto; max-height: 90vh;
  width: 100%; max-width: 380px;
  background: #ffffff;
  border-radius: 20px; border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--modal-shadow);
  padding: 22px;
  animation: ao-pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ao-modal-box::after {
  display: none;
}

.ao-modal-box h3 { position: relative; z-index: 1; font-size: 15px; font-weight: 800; margin: 0 0 14px; color: #0f172a; }
.ao-modal-box .field { position: relative; z-index: 1; margin-bottom: 14px; }
.ao-modal-box label {
  display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.4px;
  color: #475569; text-transform: uppercase; margin-bottom: 6px;
}

.ao-modal-box input,
.ao-modal-box select {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid #cbd5e1; border-radius: 11px;
  background: #f8fafc;
  box-shadow: inset 0 1px 2px rgba(20,30,70,0.04);
  font-size: 13px; font-weight: 600; color: var(--ink); outline: none;
  font-family: var(--font-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ao-modal-box input:focus,
.ao-modal-box select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-soft) 80%, transparent);
  background: #ffffff;
}

.ao-modal-actions { position: relative; z-index: 1; display: flex; gap: 10px; margin-top: 16px; }

.ao-modal-actions button {
  position: relative; overflow: hidden; flex: 1; height: 42px;
  border-radius: 11px; font-size: 13px; font-weight: 700; border: none;
  cursor: pointer; font-family: var(--font-main);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.ao-modal-actions button:active { transform: scale(0.97); }

.ao-modal-actions .btn-cancel {
  background: #f1f5f9;
  color: var(--ink); border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(20,30,70,0.06);
}

.ao-modal-actions .btn-cancel::after {
  display: none;
}

.ao-modal-actions .btn-cancel:hover {
  background: #e2e8f0;
}

.ao-modal-actions .btn-save {
  background: #0f172a;
  color: #fff; border: 1px solid transparent;
  box-shadow: 0 2px 6px rgba(15,23,42,0.18);
}

.ao-modal-actions .btn-save::after {
  display: none;
}

.ao-modal-actions .btn-save:hover {
  background: #1e293b;
}

.ao-modal-actions .btn-save:hover {
  background: linear-gradient(180deg, rgba(30,41,59,0.95) 0%, rgba(15,23,42,0.90) 100%);
}

/* ── INLINE FEEDBACK BANNERS ─────────────────────── */
.spa-feedback {
  border-radius: 12px; padding: 13px 16px; font-size: 13px;
  font-weight: 600; margin-bottom: 16px;
}

.spa-feedback.is-error   { background: var(--red-soft);   color: var(--red-soft-text); }
.spa-feedback.is-success { background: var(--green-soft); color: var(--green-soft-text); }

/* ── AVATAR CUSTOMIZATION & PALETTE ──────────────── */
.avatar-wrap-hero {
  position: relative;
  flex-shrink: 0;
}
.avatar-edit-badge {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 8px rgba(15,23,42,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink, #0f172a);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  z-index: 3;
}
.avatar-edit-badge:hover {
  transform: scale(1.1);
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(15,23,42,0.25);
}
.avatar-edit-badge svg {
  width: 12px;
  height: 12px;
}
.avatar-palette-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.avatar-swatch-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  box-shadow: 0 2px 6px rgba(15,23,42,0.15);
}
.avatar-swatch-btn:hover {
  transform: scale(1.12);
}
.avatar-swatch-btn.is-active {
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--blue, #2563eb);
  transform: scale(1.08);
}
.avatar-swatch-btn svg {
  width: 18px;
  height: 18px;
}

/* ── PIN VISIBILITY TOGGLE & INLINE FEEDBACK ─────── */
.pin-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.pin-input-wrap input {
  padding-right: 44px !important;
}
.btn-pin-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
}
.btn-pin-toggle:hover {
  color: var(--ink, #0f172a);
  background: rgba(15,23,42,0.06);
}
.btn-pin-toggle svg {
  width: 18px;
  height: 18px;
}
.pin-feedback-line {
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
  color: var(--muted, #64748b);
  min-height: 16px;
  transition: color 0.15s ease;
}
.pin-feedback-line.is-valid {
  color: #16a34a;
}
.pin-feedback-line.is-invalid {
  color: #dc2626;
}

/* ── MODAL SCROLL & MOBILE RESPONSIVENESS ────────── */
.ao-modal-box {
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ao-modal-box::-webkit-scrollbar {
  width: 5px;
}
.ao-modal-box::-webkit-scrollbar-thumb {
  background: rgba(15,23,42,0.15);
  border-radius: 999px;
}

@media (max-width: 768px) {
  .hero-stat-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 540px) {
  .profile-hero {
    padding: 14px 16px;
    gap: 12px;
  }
  .avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 15px;
  }
  .ph-body h2 {
    font-size: 15px;
  }
  .hero-stat-card {
    padding: 12px 14px;
    min-height: auto;
  }
  .hsc-number {
    font-size: 17px;
  }
  .avatar-palette-grid {
    gap: 6px;
  }
  .avatar-swatch-btn {
    width: 32px;
    height: 32px;
  }
  .info-row {
    padding: 11px 12px;
    gap: 10px;
  }
  .info-row .ir-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 9px;
  }
  .info-row .ir-icon svg {
    width: 16px;
    height: 16px;
  }
  .ir-action {
    height: 30px;
    padding: 0 10px;
    font-size: 11.5px;
    border-radius: 7px;
  }
  .ir-value {
    font-size: 13px;
  }
  .ao-modal-box {
    padding: 18px 16px;
    max-width: calc(100% - 16px);
    border-radius: 16px;
  }
}

@media (max-width: 375px) {
  .hero-stat-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .hero-stat-card {
    padding: 10px 12px;
  }
  .hsc-number {
    font-size: 17px;
  }
  .info-row {
    padding: 10px;
    gap: 8px;
  }
  .ir-action {
    padding: 0 8px;
    font-size: 11.5px;
  }
}

/* ══════════════════════════════════════════════════════════════
   SECURITY & DEVICE SESSION STYLES (Phase 4)
   ══════════════════════════════════════════════════════════════ */

/* Danger Action Button (e.g. Log Out Others) */
.ir-action.ir-action--danger {
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.28) !important;
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.95) 0%, rgba(254, 226, 226, 0.8) 100%) !important;
}
.ir-action.ir-action--danger:hover {
  background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%) !important;
  color: #b91c1c !important;
  border-color: rgba(185, 28, 28, 0.35) !important;
}

/* Online Session Status Badge */
.session-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #065f46;
  background: #d1fae5;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  line-height: 1;
}
.session-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: sessionPulse 2s infinite;
  display: inline-block;
}
@keyframes sessionPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Modal Checkbox Row */
.modal-checkbox-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(241, 245, 249, 0.6);
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 10px;
}
.modal-checkbox-row input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  margin: 0 !important;
  flex-shrink: 0;
}
.modal-checkbox-label {
  cursor: pointer;
}

/* Login History Modal List & Cards */
.login-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.login-history-list::-webkit-scrollbar {
  width: 4px;
}
.login-history-list::-webkit-scrollbar-thumb {
  background: rgba(203, 213, 225, 0.8);
  border-radius: 4px;
}

.login-history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.login-history-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(203, 213, 225, 0.9);
}

.lhc-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lhc-icon svg {
  width: 18px;
  height: 18px;
}
.lhc-icon--success {
  background: var(--green-soft);
  color: var(--green-soft-text);
}
.lhc-icon--failed {
  background: var(--red-soft);
  color: var(--red-soft-text);
}

.lhc-body {
  flex: 1;
  min-width: 0;
}
.lhc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.lhc-this-device-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.3px;
}
.lhc-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.lhc-status {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
}
.lhc-status--success {
  background: var(--green-soft);
  color: var(--green-soft-text);
}
.lhc-status--failed {
  background: var(--red-soft);
  color: var(--red-soft-text);
}

/* ══════════════════════════════════════════════════════════════
   PHASE 5: STUDY TELEMETRY & LEARNING ANALYTICS
   ══════════════════════════════════════════════════════════════ */

/* Section header action button (e.g. "Test Analytics ->") */
.profile-section-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-main);
}
.profile-section-action-btn:hover {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}
.profile-section-action-btn:active {
  transform: scale(0.96);
}

/* 4-card study stats grid */
.study-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  animation: fup 0.5s ease 0.15s both;
}

@media (max-width: 900px) {
  .study-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .study-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.study-stat-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}
.study-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
  border-color: rgba(203, 213, 225, 0.9);
}

.study-stat-card .ssc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ssc-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ssc-icon svg {
  width: 16px;
  height: 16px;
}

.ssc-icon--blue {
  background: var(--blue-soft);
  color: var(--blue-soft-text);
}
.ssc-icon--green {
  background: var(--green-soft);
  color: var(--green-soft-text);
}
.ssc-icon--purple {
  background: #ede9fe;
  color: #6d28d9;
}
.ssc-icon--amber {
  background: #fef3c7;
  color: #d97706;
}

.ssc-trend-tag {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--muted);
  background: rgba(100, 116, 139, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}
.ssc-trend-tag--streak {
  color: #d97706;
  background: rgba(217, 119, 6, 0.12);
}

.ssc-streak-card {
  border-color: rgba(245, 158, 11, 0.25);
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.2) 0%, var(--card-bg) 100%);
}

.ssc-num {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 3px;
  letter-spacing: -0.3px;
}
.ssc-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  line-height: 1.2;
}
.ssc-sublabel {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Recent Test Attempts Panel */
.profile-recent-tests-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  animation: fup 0.5s ease 0.2s both;
}

.prt-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}
.prt-panel-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.prt-panel-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.prt-panel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.8);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.prt-item:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(203, 213, 225, 0.9);
  transform: translateY(-1px);
}
.prt-item:active {
  transform: scale(0.99);
}

.prt-item-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background: #ede9fe;
  color: #6d28d9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prt-item-icon svg {
  width: 16px;
  height: 16px;
}

.prt-item-body {
  flex: 1;
  min-width: 0;
}
.prt-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.prt-item-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.prt-item-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}
.acc-badge--high {
  background: var(--green-soft);
  color: var(--green-soft-text);
}
.acc-badge--mid {
  background: var(--orange-soft);
  color: var(--orange-soft-text);
}
.acc-badge--low {
  background: var(--red-soft);
  color: var(--red-soft-text);
}

/* Empty State Card for Study Telemetry */
.profile-study-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.6) 100%);
  border: 1px dashed rgba(203, 213, 225, 0.9);
  margin-bottom: 20px;
  animation: fup 0.5s ease 0.2s both;
}
@media (max-width: 640px) {
  .profile-study-empty {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 12px;
  }
}

.pse-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pse-icon svg {
  width: 22px;
  height: 22px;
}

.pse-content {
  flex: 1;
  min-width: 0;
}
.pse-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 3px;
}
.pse-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.btn-start-test {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  font-family: var(--font-main);
}
.btn-start-test:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.btn-start-test:active {
  transform: scale(0.97);
}

/* Invoices modal & claim status */
.claim-pending-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.3px;
}

.invoices-list-wrap {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}
.invoices-subhead {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}
.invoices-empty-card {
  text-align: center;
  padding: 24px 16px;
  background: rgba(248, 250, 252, 0.6);
  border: 1px dashed rgba(203, 213, 225, 0.8);
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.invoices-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invoice-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.invoice-item-card:hover {
  background: #ffffff;
  border-color: rgba(203, 213, 225, 0.95);
}
.iic-left {
  flex: 1;
  min-width: 0;
}
.iic-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.iic-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.iic-admin-note {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 5px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.iic-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.iic-amount {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.iic-status {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1;
}
.iic-status--active {
  background: var(--green-soft);
  color: var(--green-soft-text);
}
.iic-status--pending {
  background: #fef3c7;
  color: #b45309;
}
.iic-status--expired {
  background: #f1f5f9;
  color: #64748b;
}

/* ══════════════════════════════════════════════════════════════
   PHASE 6: PRIVACY, COMPLIANCE & ACCESSIBILITY POLISH
   ══════════════════════════════════════════════════════════════ */

/* Accessible Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 999px;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: #2563eb;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Deactivation Warning Banner in Modal */
.deactivation-warning-box {
  background: #fef2f2;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

/* Danger Modal Button */
.btn-save--danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25) !important;
}
.btn-save--danger:hover {
  background: #b91c1c !important;
}

/* Global Accessibility Polish */
:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
.stat-box.is-clickable:focus-visible,
.prt-item:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Smooth Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   PHASE 5: DAILY TARGET, CONSISTENCY & SCHOLAR BADGES
   ══════════════════════════════════════════════════════════════ */

.daily-target-date-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 999px;
  padding: 3px 10px;
}

.daily-target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.dt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  min-height: 160px;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20, 30, 70, 0.08);
}

.dt-card--consistency {
  background: #ffffff;
  border-color: rgba(251, 191, 36, 0.5);
}

.dt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dt-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dt-icon-box {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dt-icon-box svg {
  width: 20px;
  height: 20px;
}

.dt-icon--blue {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.dt-icon--amber {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.dt-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.dt-card-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dt-pct-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 999px;
  padding: 3px 9px;
  flex-shrink: 0;
}

.dt-pct-badge.is-complete {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dt-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  flex-shrink: 0;
}

.dt-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.dt-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dt-bar-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.dt-bar-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dt-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dt-fill--blue {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.dt-fill--green {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.dt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
}

.dt-status-pill {
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 10px;
}

.dt-pill--achieved {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.dt-action-btn:hover {
  color: #1d4ed8;
  transform: translateX(2px);
}

/* 7-Day Consistency Dots */
.weekly-streak-dots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 6px 2px;
}

.ws-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.ws-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  transition: all 0.2s ease;
}

.ws-dot.is-active {
  background: #10b981;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.ws-dot-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.ws-day-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
}

.ws-day-col.is-today .ws-day-label {
  color: #0f172a;
  font-weight: 800;
}

.ws-day-col.is-today .ws-dot {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.ws-summary-text {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

/* ── SCHOLAR ACHIEVEMENTS & MILESTONE BADGES ────── */
.badge-counter-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 999px;
  padding: 3px 10px;
}

.scholar-badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.badge-item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 10px rgba(20, 30, 70, 0.04);
  min-height: 154px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.badge-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 30, 70, 0.08);
}

.badge-item-card.is-unlocked {
  background: linear-gradient(180deg, #ffffff 0%, rgba(254, 243, 199, 0.2) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
}

.badge-item-card.is-locked {
  background: rgba(248, 250, 252, 0.8);
  border: 1px dashed #cbd5e1;
  opacity: 0.85;
}

.bic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bic-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bic-icon svg {
  width: 19px;
  height: 19px;
}

.bic-icon--veteran_scholar { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.bic-icon--streak_master    { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.bic-icon--accuracy_ace    { background: rgba(16, 185, 129, 0.12); color: #059669; }
.bic-icon--knowledge_vault { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.bic-icon--quiz_champion   { background: rgba(234, 179, 8, 0.15);  color: #b45309; }
.bic-icon--high_scorer     { background: rgba(236, 72, 153, 0.12); color: #db2777; }

.badge-item-card.is-locked .bic-icon {
  filter: grayscale(85%);
  opacity: 0.6;
}

.bic-status-pill {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  border-radius: 999px;
  padding: 3px 8px;
  text-transform: uppercase;
}

.bic-status-pill--unlocked {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bic-status-pill--locked {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.bic-body {
  margin-top: 10px;
  flex: 1;
}

.bic-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.bic-desc {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.35;
}

.bic-footer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bic-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
}

.bic-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bic-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.bic-bar--gold {
  background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
}

.bic-bar--progress {
  background: #3b82f6;
}

/* ── RESPONSIVE BREAKPOINTS ─────────────────────── */
@media (max-width: 900px) {
  .scholar-badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .daily-target-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .scholar-badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .ws-dot {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 480px) {
  .daily-target-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .dt-card {
    padding: 12px 14px;
    border-radius: 14px;
    min-width: 0;
  }
  .dt-header {
    gap: 8px;
    min-width: 0;
  }
  .dt-title-wrap {
    gap: 8px;
    min-width: 0;
  }
  .dt-icon-box {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
  }
  .dt-icon-box svg {
    width: 17px;
    height: 17px;
  }
  .ws-dot {
    width: 22px;
    height: 22px;
  }
  .scholar-badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .badge-item-card {
    padding: 10px;
    min-height: auto;
    border-radius: 12px;
    min-width: 0;
  }
  .bic-top {
    gap: 4px;
  }
  .bic-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
  }
  .bic-icon svg {
    width: 15px;
    height: 15px;
  }
  .bic-status-pill {
    font-size: 11.5px;
    padding: 2px 6px;
    letter-spacing: 0.2px;
  }
  .bic-body {
    margin-top: 6px;
  }
  .bic-name {
    font-size: 12px;
  }
  .bic-desc {
    font-size: 11.5px;
    line-height: 1.3;
    margin-top: 2px;
  }
  .bic-footer {
    margin-top: 8px;
  }
}

/* ══════════════════════════════════════════════════════════════
   PHASE 6: INVOICES FILTER TABS & RECEIPT CONTROLS
   ══════════════════════════════════════════════════════════════ */
.invoices-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(241, 245, 249, 0.85);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.invoices-tab {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.invoices-tab:hover {
  color: var(--ink);
}

.invoices-tab.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.iic-receipt-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.iic-receipt-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.modal-close-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close-icon:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

/* ══════════════════════════════════════════════════════════════
   PHASE 6: NIGHT STUDY MODE / DARK THEME PALETTE
   ══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg: #0b0f19;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --card-border: #1e293b;
  --input-border: #334155;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] body {
  background: #0b0f19;
  color: #f1f5f9;
}

[data-theme="dark"] #panel-profile {
  color: #f1f5f9;
}

[data-theme="dark"] .profile-hero {
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .profile-hero::before {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 75%);
}

[data-theme="dark"] .profile-hero::after {
  display: none;
}

[data-theme="dark"] .avatar {
  background: #1e293b;
  border: 2px solid #3b82f6;
  color: #60a5fa;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .ph-body h2 {
  color: #f8fafc;
}

[data-theme="dark"] .ph-body .ph-mail {
  color: #94a3b8;
}

[data-theme="dark"] .hero-stat-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.85);
}

[data-theme="dark"] .hsc-number,
[data-theme="dark"] .hsc-val {
  color: #f8fafc;
}

[data-theme="dark"] .hsc-label,
[data-theme="dark"] .hsc-lbl,
[data-theme="dark"] .hsc-unit {
  color: #94a3b8;
}

[data-theme="dark"] .hsc-footer {
  border-top-color: rgba(51, 65, 85, 0.8);
  color: #94a3b8;
}

[data-theme="dark"] .section-label {
  color: #94a3b8;
}

[data-theme="dark"] .study-stat-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .ssc-value {
  color: #f8fafc;
}

[data-theme="dark"] .ssc-label {
  color: #94a3b8;
}

[data-theme="dark"] .ssc-sub {
  color: #64748b;
}

[data-theme="dark"] .daily-target-grid {
  background: transparent;
}

[data-theme="dark"] .dt-card,
[data-theme="dark"] .daily-goal-box,
[data-theme="dark"] .weekly-streak-box {
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .dt-card--consistency {
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .dt-card-title,
[data-theme="dark"] .dgb-title,
[data-theme="dark"] .ws-title {
  color: #f8fafc;
}

[data-theme="dark"] .dt-card-sub,
[data-theme="dark"] .dgb-subtitle,
[data-theme="dark"] .ws-subtitle {
  color: #94a3b8;
}

[data-theme="dark"] .dt-bar-label-row {
  color: #cbd5e1;
}

[data-theme="dark"] .dt-bar-track,
[data-theme="dark"] .dgb-progress-track {
  background: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .dt-footer {
  border-top-color: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .ws-day-label,
[data-theme="dark"] .ws-day-name,
[data-theme="dark"] .ws-summary-text {
  color: #94a3b8;
}

[data-theme="dark"] .ws-day-col.is-today .ws-day-label {
  color: #f8fafc;
}

[data-theme="dark"] .ws-dot {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(71, 85, 105, 0.8);
}

[data-theme="dark"] .ws-dot.is-active {
  background: #10b981;
  border-color: #059669;
}

[data-theme="dark"] .profile-recent-tests-panel {
  background: #1e293b;
  border-color: rgba(51, 65, 85, 0.85);
}

[data-theme="dark"] .prt-panel-title {
  color: #f8fafc;
}

[data-theme="dark"] .prt-panel-header {
  border-bottom-color: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .profile-study-empty {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .pse-title {
  color: #f8fafc;
}

[data-theme="dark"] .pse-desc {
  color: #94a3b8;
}

[data-theme="dark"] .pse-icon {
  background: rgba(30, 41, 59, 0.8);
  color: #60a5fa;
}

[data-theme="dark"] .badge-item-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .badge-item-card.is-locked {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(51, 65, 85, 0.6);
  opacity: 0.6;
}

[data-theme="dark"] .bic-name {
  color: #f8fafc;
}

[data-theme="dark"] .bic-desc {
  color: #94a3b8;
}

[data-theme="dark"] .bic-progress-track {
  background: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .info-row {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .ir-label {
  color: #94a3b8;
}

[data-theme="dark"] .ir-value {
  color: #f8fafc !important;
}

[data-theme="dark"] .ir-action {
  background: #0f172a;
  border-color: #334155;
  color: #93c5fd;
}

[data-theme="dark"] .ir-action:hover {
  background: #1e293b;
  border-color: #475569;
  color: #bfdbfe;
}

[data-theme="dark"] .ir-action--danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

[data-theme="dark"] .ir-action--danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

[data-theme="dark"] .ao-modal-box {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .ao-modal-box h3,
[data-theme="dark"] .ao-modal-box h2 {
  color: #f8fafc;
}

[data-theme="dark"] .ao-input {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .ao-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .invoices-tabs {
  background: rgba(15, 23, 42, 0.8);
}

[data-theme="dark"] .invoices-tab {
  color: #94a3b8;
}

[data-theme="dark"] .invoices-tab:hover {
  color: #f8fafc;
}

[data-theme="dark"] .invoices-tab.active {
  background: #1e293b;
  color: #f8fafc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .invoice-item-card {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(51, 65, 85, 0.85);
}

[data-theme="dark"] .invoice-item-card:hover {
  background: rgba(51, 65, 85, 0.5);
  border-color: rgba(71, 85, 105, 0.9);
}

[data-theme="dark"] .iic-title {
  color: #f8fafc;
}

[data-theme="dark"] .iic-amount {
  color: #f8fafc;
}

[data-theme="dark"] .iic-meta {
  color: #94a3b8;
}

[data-theme="dark"] .iic-receipt-btn {
  background: #1e293b;
  border-color: #334155;
  color: #93c5fd;
}

[data-theme="dark"] .iic-receipt-btn:hover {
  background: #334155;
  color: #bfdbfe;
}

[data-theme="dark"] .iic-status--expired {
  background: #1e293b;
  color: #94a3b8;
}

[data-theme="dark"] .invoices-empty-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(51, 65, 85, 0.6);
  color: #94a3b8;
}

[data-theme="dark"] .btn-cancel {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .btn-cancel:hover {
  background: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .modal-close-icon {
  color: #94a3b8;
}

[data-theme="dark"] .modal-close-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

[data-theme="dark"] .lhc-row {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(51, 65, 85, 0.85);
}

[data-theme="dark"] .lhc-device-name {
  color: #f8fafc;
}

[data-theme="dark"] .lhc-meta {
  color: #94a3b8;
}

[data-theme="dark"] .ao-header {
  background: rgba(15, 23, 42, 0.95) !important;
  border-bottom: 1px solid rgba(51, 65, 85, 0.8) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .ao-logo-text {
  color: #f8fafc !important;
}

[data-theme="dark"] .ao-header-link {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .ao-header-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .ao-header-link.active {
  color: #60a5fa !important;
  background: rgba(37, 99, 235, 0.2) !important;
}

[data-theme="dark"] .ao-dropdown-menu {
  background: #0f172a;
  border: 1px solid #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .ao-dropdown-item {
  color: #cbd5e1;
}

[data-theme="dark"] .ao-dropdown-item:hover {
  background: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .ao-tab-bar {
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .ao-tab-btn {
  color: #94a3b8;
}

[data-theme="dark"] .ao-tab-btn.is-active {
  color: #60a5fa;
}






