/* OMANG Premium Styling System */

:root {
  color-scheme: dark;
  --bg-app: #000000;
  --bg-sidebar: #050505;
  --bg-card: #080808;
  --bg-input: #121212;
  --border-color: #1a1a1a;
  --border-focus: #333333;

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-gradient: linear-gradient(135deg, #6366f1, #3b82f6);
  --accent-color: #5850ec;

  --emerald: #10b981;
  --emerald-alpha: rgba(16, 185, 129, 0.15);
  --rose: #ef4444;

  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Admin tokens */
  --admin-bg: #0f0f1a;
  --admin-sidebar-bg: #13131f;
  --admin-card-bg: #1a1a2e;
  --admin-border: #2a2a3e;
  --admin-accent: #3b82f6;
  --admin-accent-soft: rgba(59, 130, 246, 0.15);
  --admin-nav-hover: rgba(255, 255, 255, 0.04);
  --admin-nav-active: rgba(59, 130, 246, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */

.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #06070a;
  z-index: 300;
  overflow: hidden;
}

.login-page[hidden] {
  display: none;
}

/* Animated background orbs */
.login-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: orb-float 12s ease-in-out infinite;
}

.login-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.login-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  bottom: -10%;
  right: -8%;
  animation-delay: -4s;
}

.login-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  top: 40%;
  right: 30%;
  animation-delay: -8s;
  opacity: 0.2;
}

@keyframes orb-float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -20px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 15px) scale(0.95);
  }
}

.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(960px, calc(100% - 32px));
  min-height: 520px;
  background: rgba(14, 17, 22, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  backdrop-filter: blur(40px);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: login-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes login-appear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Login Hero (left) */
.login-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.04));
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.login-hero-inner {
  max-width: 320px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.login-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.login-logo-text {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.login-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-feature svg {
  color: #818cf8;
  flex-shrink: 0;
}

/* Login Form (right) */
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.login-form-inner {
  width: 100%;
  max-width: 340px;
}

.login-form-header {
  margin-bottom: 32px;
}

.login-form-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.login-form-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-field input,
.login-field select {
  height: 48px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.login-field input:focus,
.login-field select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.login-field select option {
  background: #12131a;
  color: #ffffff;
}

.login-field input::placeholder {
  color: var(--text-muted);
}

.login-submit-btn {
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  transition: all var(--transition-fast);
  margin-top: 4px;
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-error {
  min-height: 18px;
  color: #fca5a5;
  font-size: 13px;
  text-align: center;
}

.login-footer-note {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}


/* ================================================================
   STUDENT CHAT LAYOUT
   ================================================================ */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.app-layout[hidden] {
  display: none;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 100;
  transition: transform var(--transition-normal), width var(--transition-normal);
}

/* Sidebar Collapse Option */
.sidebar-collapse-btn {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.sidebar-collapse-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.floating-sidebar-toggle {
  position: absolute;
  top: 60px;
  left: 20px;
  background: rgba(10, 12, 17, 0.7);
  border: 1px solid #222222;
  color: #ffffff;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.floating-sidebar-toggle:hover {
  background: #111111;
  border-color: #444444;
  transform: scale(1.05);
}

.floating-sidebar-toggle svg {
  stroke: #ffffff;
}

/* Collapsed Layout State */
.app-layout.sidebar-collapsed .sidebar {
  width: 0px !important;
  transform: translateX(-100%);
  border-right: none;
  overflow: hidden;
}

.app-layout.sidebar-collapsed .floating-sidebar-toggle {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  height: 56px;
  padding: 0 16px;
  margin-top: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mobile-only-btn {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.sidebar-actions {
  padding: 14px;
}

.btn {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-color);
  border-color: var(--text-muted);
}

/* Student Profile Card */
.sidebar-profile-card {
  margin: 0 14px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  color: #fff;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-info strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: #fff;
}

.profile-role-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #818cf8;
  letter-spacing: 0.5px;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.profile-stat {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
}

.profile-stat .label {
  display: block;
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.profile-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  color: #fff;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Session List */
.sessions-nav {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 12px;
  overflow: hidden;
}

/* Sessions nav header with collapse toggle */
.sessions-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 4px;
}

.sessions-collapse-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}

.sessions-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #818cf8;
}

.sessions-collapse-btn.collapsed svg {
  transform: rotate(180deg);
}

.session-list-container {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  max-height: 1200px;
  opacity: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-list-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.session-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.session-list-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}

.session-list-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.session-list-container.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.section-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 8px 10px 4px;
}


.session-item {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all var(--transition-fast);
}

.session-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.session-item.active {
  background-color: rgba(99, 102, 241, 0.1);
  color: #fff;
  border-left: 3px solid var(--accent-color);
  border-radius: 4px 8px 8px 4px;
}

.session-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.session-item.active .session-icon {
  color: #818cf8;
}

.session-title {
  flex: 1;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: none;
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-dashboard-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.memory-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

.memory-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-link-btn {
  border: 0;
  background: transparent;
  color: #818cf8;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.mini-link-btn:hover {
  color: #a5b4fc;
}

.memory-status-grid {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 1;
}

.memory-status-grid.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.memory-collapse-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}

.memory-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #818cf8;
}

.memory-collapse-btn.collapsed svg {
  transform: rotate(180deg);
}

.memory-status-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
}

.memory-status-item .label {
  display: block;
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.7px;
}

.memory-status-item strong {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.memory-status-item.ok {
  border-color: rgba(16, 185, 129, 0.35);
}

.memory-status-item.warn {
  border-color: rgba(245, 158, 11, 0.35);
}

.dash-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 5px 8px;
}

.dash-item .label {
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.dash-item strong {
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-actions {
  display: flex;
  gap: 6px;
}

.footer-actions .btn {
  flex: 1;
  height: 32px;
  font-size: 11px;
}

.pulse-indicator {
  width: 7px;
  height: 7px;
  background-color: var(--emerald);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px var(--emerald-alpha);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 var(--emerald-alpha);
  }

  70% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Sidebar Logout */
.sidebar-logout-btn {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}


/* ================================================================
   MAIN CONTENT / CHAT
   ================================================================ */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  position: relative;
}

/* Topbar */
.topbar {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(8, 9, 12, 0.8);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

.topbar-subtitle {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-muted);
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.model-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

/* Chat Logo Header */
.chat-logo-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 0 100px;
  flex-shrink: 0;
  background: var(--bg-app);
  z-index: 5;
}

.chat-logo-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  background: #0e1116;
  transition: box-shadow 0.3s ease;
}

.chat-logo-img:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.chat-logo-separator {
  display: none;
}

/* Chat Viewport */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-messages {
  width: 100%;
  max-width: 720px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Messages */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  line-height: 1.65;
  font-size: 14px;
  animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
  background: #ffffff;
  border: none;
  color: #000000;
  padding: 12px 24px;
  border-radius: 24px;
  word-break: break-word;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message.assistant {
  align-self: flex-start;
  max-width: 90%;
  position: relative;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #ffffff;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
}

.message.assistant:has(.resource-card-container) {
  max-width: 100%;
  width: 100%;
}

.message.assistant::before {
  display: none;
}

.message.system {
  align-self: center;
  background-color: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 30px;
  max-width: 90%;
  text-align: center;
}

.message-time {
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
  opacity: 0.6;
  user-select: none;
}

.message.user .message-time {
  text-align: right;
  color: rgba(0, 0, 0, 0.65);
  margin-top: 6px;
}

.message.assistant .message-time {
  text-align: left;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 6px;
}

.chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0 14px 0;
  width: 100%;
}

.chat-date-divider span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 16px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}


/* Typing */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  animation: typing-blink 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-blink {

  0%,
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}


/* ── AI Thinking Panel ──────────────────────────────────────────── */

.thinking-panel {
  margin: 8px 0 4px 0;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
  backdrop-filter: blur(8px);
  overflow: hidden;
  animation: thinking-panel-appear 0.25s ease-out;
}

@keyframes thinking-panel-appear {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.thinking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 8px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.thinking-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.thinking-spinner {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(139, 92, 246, 0.25);
  border-top-color: rgba(139, 92, 246, 0.85);
  border-radius: 50%;
  animation: thinking-spin 0.75s linear infinite;
}

@keyframes thinking-spin {
  to { transform: rotate(360deg); }
}

.thinking-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(139, 92, 246, 0.9);
  text-transform: uppercase;
}

.thinking-body {
  max-height: 280px;
  overflow-y: auto;
  padding: 10px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.thinking-body::-webkit-scrollbar { width: 4px; }
.thinking-body::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.35); border-radius: 4px; }

.thinking-text {
  margin: 0;
  font-family: 'Inter', 'SF Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary, rgba(255,255,255,0.65));
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Collapsed Thought Chip ─────────────────────────────────────── */

.thought-chip-wrapper {
  margin: 6px 0 4px 0;
}

/* ── Live Token Consumption Badge (On top of message) ──────────── */

.message-token-badge {
  display: inline-flex;
  flex-wrap: wrap;               /* when space runs out, whole groups wrap - never words inside a group */
  align-items: center;
  gap: 5px 9px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 5px 12px 5px 8px;
  margin: 6px 0 2px 0;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 11.5px;
  line-height: 1.3;
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-variant-numeric: tabular-nums;   /* digits line up, so changing figures don't jitter */
  color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  user-select: none;
  width: fit-content;
  align-self: flex-start;
  animation: token-badge-fade-in 0.25s ease-out;
}

/* every piece stays on one line; the badge wraps between pieces instead */
.message-token-badge > *,
.message-token-badge .token-bg-cost > * {
  white-space: nowrap;
}

@keyframes token-badge-fade-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-token-badge .token-model-tag {
  color: #93c5fd;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  padding: 1px 7px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.message-token-badge .token-icon {
  font-size: 12px;
  color: #10b981;
}

.message-token-badge .token-stat {
  color: rgba(255, 255, 255, 0.55);   /* the unit label ("in", "out", "total") is quiet... */
}

.message-token-badge .token-stat strong {
  color: #34d399;                     /* ...so the number stands out */
  font-weight: 700;
  margin-right: 2px;
}

/* spacing does the separating now; the bullets only caused ugly line breaks */
.message-token-badge .token-sep {
  display: none;
}

.message-token-badge .token-cost {
  color: #fbbf24;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  padding: 1px 7px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Background work (memory capture, skill-gap check) arrives a few seconds after the reply: its own divided section */
.message-token-badge .token-bg-cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  animation: token-chip-in 0.35s ease-out;
}

.message-token-badge .token-bg-plus {
  color: #a5b4fc;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.14);
  padding: 1px 7px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.30);
}

.message-token-badge .token-total {
  color: #fcd34d;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.20);
  padding: 1px 8px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

@keyframes token-chip-in {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

.thought-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px 4px 8px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.08);
  color: rgba(139, 92, 246, 0.85);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.thought-chip:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
}

.thought-chip svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.thought-chip.expanded svg {
  transform: rotate(90deg);
}

.thought-full {
  margin-top: 6px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.05);
  overflow: hidden;
  animation: thought-expand 0.22s ease-out;
}

@keyframes thought-expand {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.thought-budget-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.thought-budget-pill.tier-high {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #10b981;
}

.thought-budget-pill.tier-medium {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #f59e0b;
}

.thought-budget-pill.tier-low {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.5);
  color: #f97316;
}

.thought-budget-pill.tier-depleted {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.chat-thinking-budget-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  user-select: none;
}

.thought-full-text {
  display: block;
  margin: 0;
  padding: 10px 14px;
  max-height: 340px;
  overflow-y: auto;
  font-family: 'Inter', 'SF Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary, rgba(255,255,255,0.65));
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.thought-full-text::-webkit-scrollbar { width: 4px; }
.thought-full-text::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.35); border-radius: 4px; }

/* ── Thought Bullet Lists (Claude-style thinking items) ───────────── */
.thought-bullets {
  list-style: none;
  margin: 0;
  padding: 10px 14px;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.thought-bullets::-webkit-scrollbar { width: 4px; }
.thought-bullets::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.35); border-radius: 4px; }

.thinking-bullet,
.thought-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary, rgba(255, 255, 255, 0.78));
}

.thinking-bullet-icon,
.thought-bullet-icon {
  flex-shrink: 0;
  font-size: 11px;
  color: rgba(167, 139, 250, 0.85);
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.thinking-bullet-text {
  flex: 1;
  word-break: break-word;
}

/* Composer */
.composer-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: #000000;
  display: flex;
  justify-content: center;
  z-index: 5;
  border-top: 1px solid #111111;
}

.composer-form {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.composer-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.composer-input-area {
  flex: 1;
  background-color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 14px 16px 30px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
  margin-left: 60px;
}

textarea#messageInput {
  flex: 1;
  height: 40px;
  min-height: 40px;
  max-height: 160px;
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  color: #000000;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  padding: 0;
  caret-color: #000000;
}

textarea#messageInput::placeholder {
  color: #777777;
}

/* Inline Send Button */
.inline-send-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #000000;
  border: none;
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.inline-send-btn:hover {
  background: #111111;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.inline-send-btn svg {
  stroke: currentColor;
}

.voice-btn-glowing {
  background: #000000;
  border: 2px solid #00e676;
  color: #00e676;
  border-radius: 24px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  height: 44px;
}

.voice-btn-glowing:hover {
  background: #00e676;
  color: #000000;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.7);
}

.voice-btn-glowing.listening {
  border-color: #ff1744;
  color: #ff1744;
  background: rgba(255, 23, 68, 0.1);
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.6);
  animation: mic-pulsate 1.5s infinite;
}

/* Whisper processing state — shown while audio is being transcribed */
.voice-btn-glowing.transcribing {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
  animation: mic-pulsate 0.8s infinite;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hide text, show spinner canvas while transcribing */
.voice-btn-glowing.transcribing .talk-default-content {
  display: none !important;
}

.voice-btn-glowing.listening .voice-wave-container,
.voice-btn-glowing.transcribing .voice-wave-container {
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 76px;
}

.voice-btn-glowing svg {
  stroke: currentColor;
  flex-shrink: 0;
}

/* --- Talk button inner layout --- */
.talk-default-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Hide mic+text while listening, show canvas */
.voice-btn-glowing.listening .talk-default-content {
  display: none !important;
}

#voiceWaveCanvas {
  display: block;
  border-radius: 4px;
}

.composer-actions-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 8px;
}

.file-tools {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: transparent;
  border: 0;
  color: #888888;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.action-btn svg {
  stroke: currentColor;
}

@keyframes mic-pulsate {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

.submit-btn {
  background: var(--accent-gradient);
  color: #fff;
}

.submit-btn:hover {
  transform: scale(1.06);
}

.composer-footnote {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Code blocks */
code {
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #fb7185;
}

.code-block {
  background-color: #0b0d10;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  overflow-x: auto;
}

.code-block code {
  background-color: transparent;
  padding: 0;
  color: #e2e8f0;
  font-size: 13px;
}

.message p {
  margin-bottom: 6px;
}

.message p:last-child {
  margin-bottom: 0;
}

.message strong {
  color: #fff;
  font-weight: 700;
}


/* ================================================================
   ADMIN DASHBOARD
   ================================================================ */

.admin-app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  background-color: var(--admin-bg);
}

.admin-app-layout[hidden] {
  display: none;
}

.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background-color: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.admin-sidebar-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--admin-border);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.admin-brand-text {
  display: flex;
  flex-direction: column;
}

.admin-brand-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  line-height: 1;
}

.admin-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
}

.admin-sidebar-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.admin-sidebar-actions {
  padding: 14px 14px 8px;
}

.admin-sidebar-actions .btn {
  height: 36px;
  border-radius: 8px;
  font-size: 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.admin-sidebar-actions .btn:hover {
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

/* Admin Nav */
.admin-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 16px;
}

.admin-nav-group {
  margin-bottom: 4px;
}

.admin-nav-group-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 12px 10px 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-nav-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--admin-border);
  opacity: 0.5;
}

.admin-nav-item {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 1px;
}

.admin-nav-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.admin-nav-item:hover {
  background-color: var(--admin-nav-hover);
  color: var(--text-primary);
}

.admin-nav-item:hover svg {
  color: var(--text-secondary);
}

.admin-nav-item.active {
  background-color: var(--admin-nav-active);
  color: #fff;
}

.admin-nav-item.active svg {
  color: var(--admin-accent);
}

/* Admin Sidebar Footer */
.admin-sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-version-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
}

.version-number {
  color: var(--text-secondary);
  font-weight: 800;
}

.version-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
  margin-left: auto;
}

/* Admin Main */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--admin-bg);
}

.admin-topbar {
  height: 50px;
  min-height: 50px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(12px);
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex: 1;
}

.breadcrumb-root {
  color: var(--text-secondary);
  font-weight: 600;
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 14px;
}

.breadcrumb-context {
  color: var(--text-secondary);
}

.breadcrumb-current {
  color: var(--admin-accent);
  font-weight: 700;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-search-box:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

.admin-user-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  cursor: pointer;
}

/* Admin Page Content */
.admin-page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.admin-page-header {
  margin-bottom: 22px;
}

.admin-page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--admin-accent);
  margin-bottom: 4px;
}

.admin-page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.admin-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color var(--transition-fast);
}

.admin-stat-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.admin-stat-card .stat-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.admin-stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-stat-card .stat-value.ok {
  color: var(--emerald);
}

.admin-stat-card .stat-value.warn {
  color: #f59e0b;
}

.admin-stat-card .stat-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-panel-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  margin-bottom: 18px;
  overflow: hidden;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-panel-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-panel-body {
  padding: 14px 18px;
}

.admin-panel-actions {
  display: flex;
  gap: 8px;
}

.admin-pill-btn {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-pill-btn:hover {
  background: var(--admin-nav-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.admin-pill-btn.accent {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.admin-pill-btn.accent:hover {
  background: var(--admin-accent-soft);
}

.admin-pill-btn.danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.admin-pill-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Admin Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.admin-table td strong {
  color: var(--text-primary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
}

.status-pill.done {
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.status-pill.queued {
  border-color: rgba(99, 102, 241, 0.45);
  color: #a5b4fc;
}

.status-pill.failed {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.status-pill.running {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.status-pill.enabled {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

/* Admin Health */
.admin-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.admin-health-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  padding: 12px;
}

.admin-health-item:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.admin-health-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-muted);
}

.admin-health-item.ok .admin-health-dot {
  background: var(--emerald);
  box-shadow: 0 0 0 4px var(--emerald-alpha);
}

.admin-health-item.warn .admin-health-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.admin-health-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-health-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.45;
}

/* Admin misc */
.admin-tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-tab {
  height: 38px;
  padding: 0 14px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-tab:hover {
  color: var(--text-primary);
}

.admin-tab.active {
  color: var(--admin-accent);
  border-bottom-color: var(--admin-accent);
}

.admin-tab .tab-count {
  margin-left: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.admin-tag.green {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.admin-tag.blue {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.admin-tag.gray {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.admin-tag.red {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.admin-job-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.admin-job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-job-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-job-schedule {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-job-status {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: right;
}

.admin-job-status-item {
  display: flex;
  flex-direction: column;
}

.admin-job-status-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 800;
}

.admin-job-status-value {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.admin-job-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-job-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--admin-border);
}

.admin-kv-row {
  display: flex;
  gap: 20px;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.admin-kv-row:last-child {
  border-bottom: 0;
}

.admin-kv-label {
  color: var(--text-muted);
  min-width: 120px;
  font-weight: 600;
  font-size: 12px;
}

.admin-kv-value {
  color: var(--text-primary);
  flex: 1;
  overflow-wrap: anywhere;
}

.admin-kv-value.path {
  color: #818cf8;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.admin-toggle {
  position: relative;
  width: 36px;
  height: 18px;
  flex-shrink: 0;
}

.admin-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--admin-border);
  border-radius: 18px;
  transition: var(--transition-fast);
}

.admin-toggle-slider::before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.admin-toggle input:checked+.admin-toggle-slider {
  background-color: var(--admin-accent);
}

.admin-toggle input:checked+.admin-toggle-slider::before {
  transform: translateX(18px);
}

.admin-skill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}

.admin-skill-row:hover {
  background: rgba(255, 255, 255, 0.015);
}

.admin-skill-row:last-child {
  border-bottom: 0;
}

.admin-skill-row.is-disabled {
  opacity: 0.68;
}

.admin-skill-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}

.admin-skill-info {
  flex: 1;
}

.admin-skill-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-skill-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.admin-filter-bar {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-filter-pill {
  height: 24px;
  padding: 0 10px;
  border-radius: 4px;
  border: 0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.admin-filter-pill.active {
  background: var(--admin-accent);
  color: #fff;
}

.admin-filter-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.admin-info-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px dashed var(--admin-border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 12px 18px;
}

.admin-log-container {
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.admin-log-line {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.admin-log-time {
  color: var(--text-muted);
  margin-right: 8px;
}

.admin-empty {
  padding: 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.admin-path {
  color: var(--text-muted);
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}


/* ================================================================
   ADMIN STUDENTS PAGE
   ================================================================ */

/* Two-column layout: table left, form right */
.admin-students-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  align-items: start;
}

/* Form container */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Field wrapper */
.admin-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Label */
.admin-form-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

/* Input / Password */
.admin-form-input {
  height: 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.admin-form-input::placeholder {
  color: var(--text-muted);
}

.admin-form-input:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

/* Submit button */
.admin-form-submit-btn {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: 2px;
}

.admin-form-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.38);
}

.admin-form-submit-btn:active {
  transform: translateY(0);
}

/* Feedback message */
.admin-form-msg {
  min-height: 18px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  border-radius: 6px;
  padding: 0;
  transition: all var(--transition-fast);
}

.admin-form-msg.success {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 7px 12px;
}

.admin-form-msg.error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 7px 12px;
}

/* Responsive: stack on smaller screens */
@media (max-width: 960px) {
  .admin-students-layout {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {

  /* Login responsive */
  .login-container {
    flex-direction: column;
    min-height: auto;
  }

  .login-hero {
    display: none;
  }

  .login-form-panel {
    padding: 32px 24px;
  }

  .login-form-inner {
    max-width: 100%;
  }

  /* Chat responsive */
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.5);
  }

  /* Show floating toggle on tablet/mobile by default (sidebar starts hidden) */
  .floating-sidebar-toggle {
    opacity: 1;
    pointer-events: auto;
  }

  /* Hide the toggle when sidebar panel is open */
  .sidebar.active ~ * .floating-sidebar-toggle,
  .app-layout:has(.sidebar.active) .floating-sidebar-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .menu-toggle {
    display: block;
  }

  .mobile-only-btn {
    display: block;
  }

  .chat-viewport {
    padding-bottom: 140px;
  }

  .message {
    max-width: 92%;
  }

  .composer-container {
    padding: 12px;
  }

  .composer-input-area {
    padding: 14px 16px 30px 20px;
    border-radius: 24px;
    gap: 8px;
  }

  .topbar {
    padding: 0 12px;
  }

  textarea#messageInput {
    font-size: 13px;
  }

  /* Admin responsive */
  .admin-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 150;
  }

  .admin-sidebar.active {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.5);
  }

  .admin-sidebar-toggle {
    display: block;
  }

  .admin-topbar .menu-toggle {
    display: block;
  }

  .admin-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-two-col {
    grid-template-columns: 1fr;
  }

  .admin-health-grid {
    grid-template-columns: 1fr;
  }

  .admin-overview-grid {
    grid-template-columns: 1fr;
  }

  .admin-search-box {
    display: none;
  }
}

/* Resource recommendations styles — Compact Visual Box Cards */
.resource-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 190px));
  gap: 12px;
  margin: 12px 0 8px;
  width: 100%;
  box-sizing: border-box;
}

.resource-card-container:empty,
a.resource-card:empty {
  display: none !important;
}

.resource-card {
  display: flex;
  flex-direction: column;
  background: #14151f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  box-sizing: border-box;
  width: 100%;
  max-width: 190px;
  margin: 0;
  min-height: 185px;
  position: relative;
}

.resource-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.5);
  background: #1a1c29;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(99, 102, 241, 0.2);
}

.resource-card-cover {
  position: relative;
  height: 90px;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.resource-card:hover .resource-card-cover-img {
  transform: scale(1.06);
}

.resource-card-cover-graphic,
.resource-card-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.cover-topic-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-transform: capitalize;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  word-break: break-word;
}

.resource-card-pills {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 3;
}

.resource-pill {
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  line-height: 1.2;
}

.resource-pill.category {
  background: rgba(59, 130, 246, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.resource-pill.type {
  background: #10b981;
  color: #ffffff;
  font-weight: 800;
  text-transform: uppercase;
}

.resource-pill.type.docs,
.resource-pill.type.doc,
.resource-pill.type.pdf {
  background: #10b981;
}

.resource-pill.type.topics,
.resource-pill.type.topic {
  background: #10b981;
}

.resource-pill.type.video {
  background: #06b6d4;
}

.resource-pill.type.quiz,
.resource-pill.type.interactive {
  background: #8b5cf6;
}

.resource-pill.type.book {
  background: #f59e0b;
}

.resource-card-crest {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a78bfa;
  z-index: 3;
}

.resource-card-crest svg {
  width: 12px;
  height: 12px;
}

.resource-card-gradient-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to bottom, transparent 0%, rgba(20, 21, 31, 0.95) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Card Body */
.resource-card-body {
  padding: 10px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  background: #14151f;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.resource-card-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.resource-card-title {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.resource-card-desc {
  font-family: var(--font-body);
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.35;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.resource-card-meta {
  font-family: var(--font-body);
  font-size: 9.5px;
  color: #818cf8;
  font-weight: 600;
  margin-top: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}



/* ================================================================
   ADMIN DREAMING PAGE
   ================================================================ */

.dream-pipeline-flow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
  gap: 16px;
}

.dream-flow-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  flex: 1;
  min-width: 100px;
  transition: transform var(--transition-fast);
  position: relative;
}

.dream-flow-stage:hover {
  transform: translateY(-4px);
}

.dream-flow-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dream-flow-stage:hover .dream-flow-icon {
  box-shadow: 0 0 20px currentColor;
  filter: brightness(1.2);
  transform: scale(1.08);
}

.dream-flow-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.dream-flow-count {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-secondary);
  margin-top: -2px;
}

.dream-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  color: var(--text-muted);
  opacity: 0.6;
  animation: pulse-arrow 2s infinite ease-in-out;
}

.dream-flow-arrow svg path {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4, 4;
  animation: flow-dash-move 1.5s infinite linear;
}

@keyframes pulse-arrow {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.08);
    opacity: 0.95;
  }
}

@keyframes flow-dash-move {
  to {
    stroke-dashoffset: -8;
  }
}

/* Stage Details Grid */
.dream-stages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .dream-stages-grid {
    grid-template-columns: 1fr;
  }
}

.dream-stage-panel {
  display: flex;
  flex-direction: column;
  max-height: 520px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  overflow: hidden;
}

.dream-stage-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 440px;
}

/* Custom Scrollbar for Stage Items */
.dream-stage-items::-webkit-scrollbar {
  width: 6px;
}

.dream-stage-items::-webkit-scrollbar-track {
  background: transparent;
}

.dream-stage-items::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.dream-stage-items::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dream-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 8px;
  border: 1px dashed var(--admin-border);
}

/* Dream Item Card */
.dream-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dream-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dream-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dream-item:hover::before {
  opacity: 1;
}

.dream-item-promotable {
  border-left: 3px solid var(--emerald);
  background: rgba(16, 185, 129, 0.02);
}

.dream-item-promotable:hover {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.3);
}

.dream-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.dream-item-type {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--admin-accent);
  letter-spacing: 0.5px;
}

.dream-item-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.dream-item-badge.promotable {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.dream-item-badge.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.dream-item-fact {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  position: relative;
  z-index: 1;
}

.dream-item-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.dream-metric {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.dream-metric-label {
  color: var(--text-muted);
  width: 70px;
  flex-shrink: 0;
}

.dream-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.dream-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dream-metric-val {
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  color: var(--text-secondary);
  width: 30px;
  text-align: right;
}

.dream-item-reflection {
  font-style: italic;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.015);
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 0 4px 4px 0;
  position: relative;
  z-index: 1;
}

.dream-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  position: relative;
  z-index: 1;
}

/* Bottom Grid layout */
.dream-bottom-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 768px) {
  .dream-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.dream-memory-preview {
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #a5b4fc;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  overflow-x: auto;
  max-height: 300px;
  white-space: pre-wrap;
}

.admin-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 32px 6px 12px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.6)' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

.admin-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-select:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 2px var(--admin-accent-soft);
}

.admin-select option {
  background: #12131a;
  color: var(--text-primary);
  padding: 10px;
}

/* ---- Admin date / text input ---- */
.admin-input {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  color: #e2e8f0;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  color-scheme: dark;
}

.admin-input:hover {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.1);
}

.admin-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.12);
}

/* Style the calendar icon button */
input[type="date"].admin-input::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(200deg) brightness(1.2);
  cursor: pointer;
  border-radius: 4px;
  padding: 2px;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

input[type="date"].admin-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Style the date inner text segments */
input[type="date"].admin-input::-webkit-datetime-edit {
  color: #c7d2fe;
  padding: 0;
}

input[type="date"].admin-input::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"].admin-input::-webkit-datetime-edit-text {
  color: rgba(199, 210, 254, 0.45);
  padding: 0 2px;
}

input[type="date"].admin-input::-webkit-datetime-edit-day-field,
input[type="date"].admin-input::-webkit-datetime-edit-month-field,
input[type="date"].admin-input::-webkit-datetime-edit-year-field {
  color: #e2e8f0;
  border-radius: 3px;
  padding: 0 2px;
}

input[type="date"].admin-input::-webkit-datetime-edit-day-field:focus,
input[type="date"].admin-input::-webkit-datetime-edit-month-field:focus,
input[type="date"].admin-input::-webkit-datetime-edit-year-field:focus {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
  outline: none;
}

/* ================================================================
   STUDENT ACTIVITY DASHBOARD
   ================================================================ */

/* Activity view full-page layout */
.activity-view-section {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Override the chat-viewport's 160px bottom padding (meant for the chat input bar) */
  padding-bottom: 0 !important;
  padding-top: 0 !important;
}

/* Topbar with back button */
.activity-topbar {
  flex-shrink: 0;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(14, 17, 22, 0.7);
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.activity-back-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.activity-back-btn svg {
  transition: transform var(--transition-fast);
}

.activity-back-btn:hover svg {
  transform: translateX(-3px);
}

/* Scrollable content area inside activity view */
.activity-dashboard-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.activity-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.activity-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.activity-summary-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-summary-card .label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.activity-summary-card .value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-display);
}

.activity-summary-card .desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Tab Navigation */
.activity-tabs-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.activity-tabs-nav::-webkit-scrollbar {
  display: none;
}

.activity-tab-btn {
  background: transparent;
  border: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.activity-tab-btn.active {
  background: var(--primary-color, #6366f1);
  color: #fff;
}

.activity-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Category Sections */
.activity-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.activity-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary-color, #6366f1);
  padding-left: 8px;
  margin: 0;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Dashboard Cards */
.activity-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.activity-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.activity-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Badges */
.activity-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.activity-badge.passed {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.activity-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.activity-badge.unattempted {
  background: rgba(107, 114, 128, 0.15);
  color: #d1d5db;
}

.activity-badge.watched {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.activity-badge.dropped {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.activity-badge.unwatched {
  background: rgba(107, 114, 128, 0.15);
  color: #d1d5db;
}

/* Progress bar inside card */
.activity-card-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-secondary);
}

.activity-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.activity-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary-color, #6366f1);
  transition: width 0.3s ease;
}

.activity-badge.dropped+.activity-bar .activity-bar-fill {
  background: var(--amber, #f59e0b);
}

.activity-badge.watched+.activity-bar .activity-bar-fill {
  background: var(--emerald, #10b981);
}

/* INTERACTIVE MODALS STYLING */
.activity-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.activity-modal-wrapper {
  position: relative;
  width: 90%;
  max-width: 520px;
  z-index: 1001;
}

.activity-modal-container {
  background: #181922;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.activity-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.activity-modal-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.activity-modal-close-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 24px;
  font-weight: 400;
  cursor: pointer;
  line-height: 1;
}

.activity-modal-close-btn:hover {
  color: #fff;
}

.activity-modal-body {
  padding: 20px;
}

/* Mock Player and Solver */
.video-player-mock {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-screen {
  aspect-ratio: 16/9;
  background: #0d0e12;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-screen-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-btn {
  width: 54px;
  height: 54px;
  background: var(--primary-color, #6366f1);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition-fast);
}

.video-play-btn:hover {
  transform: scale(1.1);
}

.video-player-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-player-progress-container label {
  font-size: 11px;
  color: var(--text-secondary);
}

.video-progress-slider {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  accent-color: var(--primary-color, #6366f1);
}

.video-player-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.quiz-solver-mock {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-question {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-option-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
  color: #fff;
}

.quiz-option-btn.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-color, #6366f1);
  color: #fff;
}

.quiz-submit-btn {
  width: 100%;
  height: 40px;
  background: var(--primary-color, #6366f1);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 6px;
}

.quiz-submit-btn:hover {
  background: #4f46e5;
}

.quiz-submit-btn:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
}

.quiz-solver-feedback {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

.quiz-solver-feedback.correct {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.quiz-solver-feedback.incorrect {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Option states after answer is submitted ───────────────────── */
.quiz-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.quiz-option-btn.correct-answer {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  color: #6ee7b7 !important;
  font-weight: 700;
  opacity: 1 !important;
}

.quiz-option-btn.wrong-answer {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #fca5a5 !important;
  opacity: 1 !important;
}

/* ── Multi-question quiz progress bar ─────────────────────────── */
.quiz-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Quiz score screen ─────────────────────────────────────────── */
.quiz-score-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
}

.quiz-score-emoji {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 4px;
}

.quiz-score-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
}

.quiz-score-number {
  font-size: 44px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.quiz-score-pct {
  font-size: 15px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
}

.quiz-score-breakdown {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.quiz-score-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.quiz-score-row.correct {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.quiz-score-row.incorrect {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.quiz-score-row-text {
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.4;
}

/* ── In-progress badge ─────────────────────────────────────────── */
.activity-badge.in-progress {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

/* ================================================================
   PICTURE VIEWER SPLIT LAYOUT
   ================================================================ */

/* Ensure the main container behaves correctly in flex layout */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.sidebar {
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Picture Viewer Panel */
.picture-viewer {
  width: 45%;
  flex-shrink: 0;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.picture-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(21, 24, 31, 0.95);
  backdrop-filter: blur(10px);
}

.picture-viewer-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.picture-viewer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.picture-viewer-close-btn:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.picture-viewer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.picture-viewer-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  min-height: 300px;
  max-height: 60vh;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.picture-viewer-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.picture-viewer-meta {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 22px;
}

.picture-viewer-meta p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Mobile responsive layout */
@media (max-width: 768px) {
  .picture-viewer {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
  }
}


/* ================================================================
   INTERACTIVE FLASHCARD DECK
   ================================================================ */

.flashcard-deck {
  margin: 12px 0;
  border-radius: 16px;
  /* overflow: hidden intentionally OMITTED — it breaks CSS 3D perspective/backface-visibility */
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(12, 12, 30, 0.6);
}

.flashcard-deck-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px 16px 0 0;
}

.flashcard-deck-icon {
  font-size: 20px;
}

.flashcard-deck-title {
  font-size: 14px;
  font-weight: 600;
  color: #c4b5fd;
  letter-spacing: 0.02em;
  flex: 1;
}

.flashcard-deck-tip {
  font-size: 11px;
  color: rgba(196, 181, 253, 0.5);
  font-style: italic;
}

.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 18px;
}

/* --- Individual Card --- */
.flashcard {
  /* perspective must be on the PARENT of the element that transforms */
  perspective: 1000px;
  -webkit-perspective: 1000px;
  cursor: pointer;
  height: 160px;
  user-select: none;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}

.flashcard:hover .flashcard-inner {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35);
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  gap: 6px;
  overflow: hidden;
}

/* Front face — dark indigo — sits in front (z-index:2) */
.flashcard-front {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  z-index: 2;
}

/* Back face — purple/violet — rotated 180deg, behind the front (z-index:1) */
.flashcard-back {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
  border: 1px solid rgba(139, 92, 246, 0.5);
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  z-index: 1;
}

.flashcard-number {
  font-size: 10px;
  color: rgba(196, 181, 253, 0.45);
  letter-spacing: 0.06em;
  position: absolute;
  top: 10px;
  right: 12px;
}

.flashcard-term {
  font-size: 15px;
  font-weight: 700;
  color: #e0e7ff;
  line-height: 1.3;
}

.flashcard-hint {
  font-size: 10px;
  color: rgba(196, 181, 253, 0.45);
  margin-top: 4px;
  font-style: italic;
}

.flashcard-definition {
  font-size: 12px;
  color: #ddd6fe;
  line-height: 1.5;
  overflow-y: auto;
  max-height: 90px;
}

.flashcard-example {
  font-size: 11px;
  color: rgba(221, 214, 254, 0.65);
  margin-top: 6px;
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
  width: 100%;
  text-align: left;
}

@media (max-width: 500px) {
  .flashcard-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
  }

  .flashcard {
    height: 140px;
  }
}

/* ================================================================ */
/* CLASSROOM CARDS HUB STYLES                                       */
/* ================================================================ */

.classroom-hub-container {
  padding: 28px 36px;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.classroom-hub-header {
  margin-bottom: 24px;
}

.classroom-hub-title {
  font-size: 24px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.5px;
  margin: 0 0 6px 0;
}

.classroom-hub-subtitle {
  font-size: 13px;
  color: #94a3b8;
}

.classroom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 16px;
}

.classroom-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.classroom-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 16px 32px -10px rgba(99, 102, 241, 0.35);
  background: rgba(30, 41, 59, 0.92);
}

.classroom-cover {
  height: 130px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

.classroom-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.classroom-card:hover .classroom-cover-img {
  transform: scale(1.06);
}

.classroom-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a78bfa;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.classroom-body {
  padding: 18px 20px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.classroom-name {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
  line-height: 1.35;
}

.classroom-meta {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 18px;
}

.classroom-enter-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: white;
  font-weight: 600;
  font-size: 13px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-top: auto;
}

.classroom-card:hover .classroom-enter-btn {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.classroom-detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.classroom-back-link {
  align-self: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.62);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.classroom-detail-hero {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
}

.classroom-detail-hero img {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(30, 41, 59, 0.9);
}

.classroom-badge.inline {
  position: static;
  display: inline-flex;
  margin-bottom: 8px;
}

.classroom-chat-btn {
  border: none;
  border-radius: 8px;
  background: #22c55e;
  color: #052e16;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
}

.classroom-tabs {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 4px 0 12px 0 !important;
  margin: 8px 0 20px 0 !important;
  flex-shrink: 0 !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch;
}

.classroom-tabs::-webkit-scrollbar {
  display: none !important;
}

.classroom-tab {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(30, 41, 59, 0.8) !important;
  color: #cbd5e1 !important;
  border-radius: 10px !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 0 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-family: var(--font-display, inherit) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  transition: all 0.2s ease !important;
}

.classroom-tab:hover {
  background: rgba(51, 65, 85, 0.9) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.classroom-tab strong {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.classroom-tab.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border-color: #818cf8 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45) !important;
}

.classroom-tab.active strong {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.classroom-tab-panel {
  min-height: 260px;
}

.classroom-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.classroom-resource-card,
.classroom-topic-card,
.classroom-test-card {
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.classroom-resource-card {
  display: grid;
  grid-template-rows: 130px 1fr;
}

.classroom-resource-thumb {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: #111827;
}

.classroom-resource-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  font-size: 32px;
  font-weight: 900;
}

.classroom-resource-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.classroom-resource-type {
  color: #93c5fd;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.classroom-resource-body h3,
.classroom-topic-card h3,
.classroom-test-card h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.35;
}

.classroom-resource-body p,
.classroom-topic-card p,
.classroom-test-card p {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.classroom-resource-link {
  margin-top: auto;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.classroom-topic-list,
.classroom-test-list,
.classroom-overview-grid {
  display: grid;
  gap: 12px;
}

.classroom-topic-card,
.classroom-test-card {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.topic-objective {
  color: #dbeafe !important;
  margin-top: 8px !important;
}

.topic-counts,
.test-count {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.classroom-empty {
  padding: 22px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.45);
  font-size: 13px;
}

@media (max-width: 720px) {
  .classroom-hub-container {
    padding: 18px;
  }

  .classroom-detail-hero {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .classroom-detail-hero img {
    width: 64px;
    height: 64px;
  }

  .classroom-chat-btn {
    grid-column: 1 / -1;
  }

  .classroom-topic-card,
  .classroom-test-card {
    grid-template-columns: 1fr;
  }

  .topic-counts,
  .test-count {
    align-items: flex-start;
  }
}

/* ── Scroll to Bottom Button ─────────────────────────────── */
.scroll-to-bottom-btn {
  position: fixed;
  bottom: 176px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(18, 24, 38, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 18px 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 900;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255,255,255,0.04) inset;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  user-select: none;
  white-space: nowrap;
}

.scroll-to-bottom-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.scroll-to-bottom-btn:hover {
  background: rgba(32, 42, 64, 0.92);
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255,255,255,0.07) inset;
  transform: translateX(-50%) translateY(-2px);
  color: rgba(255, 255, 255, 0.96);
}

.scroll-to-bottom-btn svg {
  opacity: 0.75;
  flex-shrink: 0;
  transition: opacity 0.18s ease;
}

.scroll-to-bottom-btn:hover svg {
  opacity: 1;
}

/* ================================================================
   ADMIN CHAT HISTORY CONVERSATION VIEW
   ================================================================ */

.admin-chat-history-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px;
  background: #080a0e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  /* No max-height here — scroll lives inside each session stream */
}

.admin-chat-history-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.admin-chat-history-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.admin-chat-history-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.admin-chat-history-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.admin-chat-session-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.admin-chat-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(59, 130, 246, 0.04) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-wrap: wrap;
  gap: 8px;
  transition: background 0.15s ease;
}

.admin-chat-session-header:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.16) 0%, rgba(59, 130, 246, 0.08) 100%);
}

.admin-chat-session-card[data-open="false"] .admin-chat-session-header {
  border-bottom-color: transparent;
}

.admin-chat-session-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #f3f4f6;
}

.admin-chat-session-icon {
  font-size: 15px;
}

.admin-chat-session-id-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #94a3b8;
  font-weight: 500;
}

.admin-chat-session-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-chat-session-time {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
}

.admin-chat-messages-stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px;
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
}

.admin-chat-messages-stream::-webkit-scrollbar {
  width: 5px;
}
.admin-chat-messages-stream::-webkit-scrollbar-track {
  background: transparent;
}
.admin-chat-messages-stream::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.admin-chat-messages-stream::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Message Rows */
.admin-chat-msg-row {
  display: flex;
  gap: 12px;
  max-width: 88%;
  animation: admin-msg-appear 0.22s ease-out;
}

@keyframes admin-msg-appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-chat-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.admin-chat-msg-row.assistant {
  align-self: flex-start;
  flex-direction: row;
}

.admin-chat-msg-row.system {
  align-self: center;
  max-width: 92%;
  width: 100%;
  justify-content: center;
}

/* Avatars */
.admin-chat-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
  flex-shrink: 0;
}

.admin-chat-avatar.user {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.admin-chat-avatar.assistant {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Message Body & Meta */
.admin-chat-msg-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.admin-chat-msg-row.user .admin-chat-msg-body {
  align-items: flex-end;
}

.admin-chat-msg-row.assistant .admin-chat-msg-body {
  align-items: flex-start;
}

.admin-chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.admin-chat-sender-name {
  font-weight: 600;
  color: #cbd5e1;
}

.admin-chat-msg-time {
  color: var(--text-muted);
  font-size: 11px;
}

/* Bubbles */
.admin-chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  max-width: 100%;
}

.admin-chat-bubble.user {
  background: #ffffff;
  color: #0f172a;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-weight: 500;
}

.admin-chat-bubble.user a {
  color: #4338ca;
}

.admin-chat-bubble.assistant {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-chat-bubble.assistant p {
  margin: 0 0 8px 0;
}
.admin-chat-bubble.assistant p:last-child {
  margin-bottom: 0;
}

.admin-chat-bubble.system {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  padding: 6px 14px;
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 500;
}

.admin-chat-system-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.admin-chat-system-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}
 
#studentActivityBtn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
}
 
img.classroom-cover {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
 
.classroom-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 6px 0 0 0;
  line-height: 1.35;
}
 
/* Cassie admin page: the pool and how long it lasts */
.cassie-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  margin-bottom: 18px;
}

.cassie-pool {
  padding: 24px 28px;
  border-right: 1px solid var(--admin-border);
}

.cassie-pool-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cassie-pool-amount {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin: 6px 0 14px;
}

.cassie-pool-amount span {
  font-size: 28px;
  letter-spacing: 0;
  color: var(--text-muted);
}

.cassie-runway {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.cassie-runway-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.cassie-runway-fill.good { background: var(--emerald); }
.cassie-runway-fill.low { background: #f59e0b; }
.cassie-runway-fill.empty { background: var(--rose); }

.cassie-runway-text {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cassie-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
}

.cassie-totals strong {
  color: var(--text-primary);
  font-weight: 600;
}

.cassie-fund {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 28px;
}

.cassie-fund-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.cassie-fund-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.cassie-fund input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
}

.cassie-fund input:focus-visible,
.cassie-fund .admin-pill-btn:focus-visible {
  outline: 2px solid var(--admin-accent);
  outline-offset: 1px;
}

.cassie-fund .admin-pill-btn {
  height: 34px;
}

.cassie-fund-row {
  display: grid;
  grid-template-columns: 1fr 84px auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--admin-border);
  font-size: 12px;
  color: var(--text-secondary);
}

.cassie-mini-bar {
  width: 72px;
  height: 4px;
  margin-top: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.cassie-mini-bar div {
  height: 100%;
  background: var(--admin-accent);
}

@media (max-width: 760px) {
  .cassie-hero { grid-template-columns: 1fr; }
  .cassie-pool { border-right: 0; border-bottom: 1px solid var(--admin-border); }
  .cassie-pool-amount { font-size: 46px; }
}
