/* OMANG Premium Styling System */

:root {
  color-scheme: dark;
  --bg-app: #08090c;
  --bg-sidebar: #0e1116;
  --bg-card: #15181f;
  --bg-input: #121419;
  --border-color: #20242f;
  --border-focus: #4f46e5;

  --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: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Inter', 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);
  -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);
}

.sidebar-header {
  height: 56px;
  padding: 0 16px;
  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;
  overflow-y: auto;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.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-list-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.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: 1px solid var(--border-color);
  padding: 12px 14px;
  background: rgba(10, 12, 17, 0.5);
  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;
}

.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 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: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 16px 16px 2px 16px;
  word-break: break-word;
}

.message.assistant {
  align-self: flex-start;
  max-width: 90%;
  position: relative;
  padding: 14px 16px 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 2px 16px 16px 16px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.message.assistant::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-gradient);
  border-radius: 3px 0 0 3px;
}

.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;
}

/* 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); }
}

/* Composer */
.composer-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, var(--bg-app) 60%, transparent);
  display: flex;
  justify-content: center;
  z-index: 5;
}

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

.composer-input-area {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 8px 14px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.composer-input-area:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15), 0 0 0 1px var(--border-focus);
}

textarea#messageInput {
  flex: 1;
  height: 24px;
  min-height: 24px;
  max-height: 160px;
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  padding: 4px 0;
}

textarea#messageInput::placeholder { color: var(--text-muted); }

.composer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

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

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

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.send-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.voice-btn { background: transparent; color: var(--text-muted); }
.voice-btn:hover { background-color: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }
.voice-btn.listening { background-color: rgba(239, 68, 68, 0.15); color: var(--rose); animation: mic-pulsate 1.5s infinite; }

@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-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); }
  .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: 6px 12px; border-radius: 14px; gap: 6px; }
  .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 */
.resource-card-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 8px;
  width: 100%;
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  text-decoration: none;
  transition: transform var(--transition-fast) cubic-bezier(0.16, 1, 0.3, 1),
              border-color var(--transition-fast),
              background var(--transition-fast),
              box-shadow var(--transition-fast);
  cursor: pointer;
}

.resource-card:hover {
  transform: translateY(-1.5px);
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(59, 130, 246, 0.02));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.resource-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.resource-card:hover .resource-icon-wrapper {
  transform: scale(1.05);
}

.resource-card.pdf .resource-icon-wrapper {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.resource-card.video .resource-icon-wrapper {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.resource-card.book .resource-icon-wrapper {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.resource-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.resource-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resource-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-type-tag {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-block;
  line-height: 1.2;
}

.pdf .resource-type-tag {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

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

.book .resource-type-tag {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.resource-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.resource-arrow {
  color: var(--text-muted);
  transition: transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.resource-card:hover .resource-arrow {
  transform: translateX(3px);
  color: #ffffff;
}

.resource-card.interactive .resource-icon-wrapper,
.resource-card.quiz .resource-icon-wrapper {
  background: rgba(139, 92, 246, 0.12); /* Purple */
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.interactive .resource-type-tag,
.quiz .resource-type-tag {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
}

.resource-card.generic .resource-icon-wrapper {
  background: rgba(107, 114, 128, 0.12); /* Gray */
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.generic .resource-type-tag {
  background: rgba(107, 114, 128, 0.15);
  color: #d1d5db;
}


/* ================================================================
   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;
}



