/* ==========================================================================
   STYLE.CSS — Adaptive Full-Screen Interface Mutation Engine
   ==========================================================================
   Table of Contents:
   1. Global Reset, Typography & CSS Variables
   2. .visual-hidden Utility — Absolute DOM Concealment
   3. .ui-screen — Full-Viewport Container Protocol
   4. Setup Panel — First-Visit Configuration Layer
   5. Persona 1: Student Hub (Deep Slate / Dark Blue Academic Portal)
   6. Persona 2: Wallet Tracker (Clean White / Grey / Green Expense Ledger)
   7. Persona 3: Office Workspace (Neutral Grey Gridlines Spreadsheet)
   8. Secure Chat Workspace — Full-Screen Messaging Portal
   9. Custom Scrollbars
   10. Animations
   11. Responsive Breakpoints
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL RESET, TYPOGRAPHY & CSS VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Typography */
  --ff-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.15s ease;
  --t-normal: 0.25s var(--ease-out);
  --t-smooth: 0.4s var(--ease-out);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--ff-sans);
  line-height: 1.5;
  background: #0a0b0d;
  color: #e5e7eb;
  overflow: hidden;
  position: relative;
  width: 100vw;
  height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* --------------------------------------------------------------------------
   2. .visual-hidden — ABSOLUTE DOM CONCEALMENT
   --------------------------------------------------------------------------
   Universal toggle class. When applied, the element is completely removed
   from the visual render tree and pointer event loop. */
.visual-hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   3. .ui-screen — FULL-VIEWPORT CONTAINER PROTOCOL
   --------------------------------------------------------------------------
   Every main persona container and the chat workspace use this base class
   to guarantee total viewport occupation when toggled visible. */
.ui-screen {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow: auto;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   4. SETUP PANEL — First-Visit Configuration Layer
   -------------------------------------------------------------------------- */
#setup-panel {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(30, 58, 138, 0.15), transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(88, 28, 135, 0.1), transparent 50%),
              #0a0b0d;
  padding: 1.5rem;
  animation: fadeIn 0.5s ease-out forwards;
}

.setup-card {
  width: 100%;
  max-width: 460px;
  background: #111318;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(255, 255, 255, 0.03),
              0 0 80px -20px rgba(59, 130, 246, 0.08);
}

.setup-card-stripe {
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #f59e0b);
  background-size: 300% 100%;
  animation: stripeShimmer 4s linear infinite;
}

.setup-card-body {
  padding: 2.5rem 2.25rem 2.25rem;
}

.setup-icon-ring {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  margin-bottom: 1.5rem;
}

.setup-card-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: -0.025em;
  margin-bottom: 0.4rem;
}

.setup-subtitle {
  font-size: 0.92rem;
  color: #6b7280;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.setup-field {
  margin-bottom: 1.5rem;
}

.setup-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.55rem;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #6b7280;
  pointer-events: none;
}

#mask-select {
  width: 100%;
  appearance: none;
  background: #1a1d24;
  border: 1.5px solid #2d3139;
  border-radius: 12px;
  padding: 0.85rem 2.75rem 0.85rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: #e5e7eb;
  outline: none;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

#mask-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#secret-code-input {
  width: 100%;
  background: #1a1d24;
  border: 1.5px solid #2d3139;
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  font-size: 0.92rem;
  color: #f9fafb;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

#secret-code-input::placeholder {
  color: #4b5563;
}

#secret-code-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.setup-hint {
  display: block;
  font-size: 0.75rem;
  color: #4b5563;
  margin-top: 0.45rem;
  line-height: 1.4;
}

#activate-workspace-btn {
  width: 100%;
  margin-top: 0.75rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--t-fast);
  box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.45);
}

#activate-workspace-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.5);
}

#activate-workspace-btn:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5. PERSONA 1: STUDENT HUB (Deep Slate / Dark Blue)
   -------------------------------------------------------------------------- */
#student-profile {
  --stu-bg: #0c0e14;
  --stu-surface: #151820;
  --stu-surface-2: #1c2029;
  --stu-border: #252a36;
  --stu-text: #e5e7eb;
  --stu-muted: #7c8494;
  --stu-accent: #3b82f6;
  --stu-accent-soft: rgba(59, 130, 246, 0.12);
  background: var(--stu-bg);
  color: var(--stu-text);
}

.stu-nav {
  background: rgba(21, 24, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stu-border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0 2rem;
}

.stu-nav nav {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 2rem;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-icon {
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--stu-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  transition: all var(--t-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stu-body {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* Student Search Bar */
.stu-search-wrap {
  position: relative;
  width: 100%;
}

.search-icon-prefix {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--stu-muted);
  pointer-events: none;
  display: flex;
}

#edu-trigger {
  width: 100%;
  background: var(--stu-surface);
  border: 1.5px solid var(--stu-border);
  border-radius: 14px;
  padding: 1rem 1.25rem 1rem 3rem;
  font-size: 0.95rem;
  color: #ffffff;
  outline: none;
  transition: all var(--t-normal);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

#edu-trigger::placeholder { color: #4b5563; }

#edu-trigger:focus {
  border-color: var(--stu-accent);
  box-shadow: 0 0 0 4px var(--stu-accent-soft), 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Quick Stats */
.stu-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stu-stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--stu-surface);
  border: 1px solid var(--stu-border);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--stu-muted);
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-blue { background: #3b82f6; }
.dot-green { background: #22c55e; }
.dot-amber { background: #f59e0b; }
.dot-purple { background: #a855f7; }

/* Section Titles */
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f3f4f6;
  margin-bottom: 1.15rem;
  letter-spacing: -0.015em;
}

.section-title.dark {
  color: #111827;
}

/* Course Cards */
.course-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.course-card {
  display: flex;
  gap: 1rem;
  background: var(--stu-surface);
  border: 1px solid var(--stu-border);
  border-radius: 14px;
  padding: 1.15rem;
  transition: all var(--t-normal);
  cursor: pointer;
}

.course-card:hover {
  border-color: #3a3f4e;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.5);
}

.course-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.thumb-cs { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.thumb-math { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.thumb-phy { background: linear-gradient(135deg, #f59e0b, #d97706); }
.thumb-chem { background: linear-gradient(135deg, #22c55e, #16a34a); }

.course-info {
  flex: 1;
  min-width: 0;
}

.course-info h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-meta {
  font-size: 0.78rem;
  color: var(--stu-muted);
  margin-bottom: 0.6rem;
}

.course-progress {
  height: 5px;
  background: #252a36;
  border-radius: 3px;
  overflow: hidden;
}

.course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
  transition: width 0.6s var(--ease-out);
}

.course-pct {
  font-size: 0.72rem;
  font-weight: 600;
  color: #60a5fa;
  margin-top: 0.3rem;
  display: block;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.15rem;
}

.video-card {
  cursor: pointer;
  transition: all var(--t-normal);
}

.video-card:hover {
  transform: translateY(-3px);
}

.video-card:hover .play-ring {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a2332, #0f172a);
  position: relative;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.video-thumb.thumb-alt-1 { background: linear-gradient(135deg, #1e1b3a, #0f0c29); }
.video-thumb.thumb-alt-2 { background: linear-gradient(135deg, #1a1412, #2d1a0e); }
.video-thumb.thumb-alt-3 { background: linear-gradient(135deg, #0c1a12, #0a2818); }

.play-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 48px;
  height: 48px;
  background: rgba(59, 130, 246, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  opacity: 0;
  transition: all var(--t-normal);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.vid-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #e5e7eb;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--ff-mono);
}

.video-card h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.vid-channel {
  font-size: 0.78rem;
  color: var(--stu-muted);
}

/* --------------------------------------------------------------------------
   6. PERSONA 2: WALLET TRACKER (Clean White / Grey / Green)
   -------------------------------------------------------------------------- */
#wallet-profile {
  --wal-bg: #f4f5f7;
  --wal-surface: #ffffff;
  --wal-border: #e2e5ea;
  --wal-text: #111827;
  --wal-muted: #6b7280;
  --wal-green: #059669;
  --wal-red: #dc2626;
  --wal-indigo: #4f46e5;
  background: var(--wal-bg);
  color: var(--wal-text);
}

.wal-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--wal-border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.wal-nav nav {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 2rem;
}

.wal-nav .nav-brand {
  color: var(--wal-text);
}

.wal-nav .nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wal-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  transition: all var(--t-fast);
}

.wal-nav .nav-links a:hover,
.wal-nav .nav-links a.active {
  color: var(--wal-indigo);
  background: rgba(79, 70, 229, 0.06);
}

.wal-body {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Balance Cards */
.wal-cards-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 1rem;
}

.wal-hero-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  box-shadow: 0 4px 16px -4px rgba(30, 27, 75, 0.4);
}

.wal-hero-card .wal-label { color: #c7d2fe; }
.wal-hero-card .wal-value { color: #fff; font-size: 1.85rem; }

.wal-stat-card {
  background: var(--wal-surface);
  border: 1px solid var(--wal-border);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.wal-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wal-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.wal-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wal-text);
  letter-spacing: -0.02em;
}

.wal-value.small { font-size: 1.35rem; }

.wal-change {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.wal-change.positive { color: var(--wal-green); }
.wal-change.negative { color: var(--wal-red); }

.wal-goal-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin-top: 0.6rem;
  overflow: hidden;
}

.wal-goal-fill {
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, #059669, #34d399);
  border-radius: 3px;
}

/* Chart Bars */
.wal-chart-section {
  background: var(--wal-surface);
  border: 1px solid var(--wal-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.wal-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  height: 150px;
  padding-top: 0.5rem;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  justify-content: flex-end;
}

.bar-inner {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, #4f46e5, #818cf8);
  border-radius: 8px 8px 4px 4px;
  transition: height 0.6s var(--ease-out);
}

.bar-col span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--wal-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Transactions */
.wal-txn-section {
  background: var(--wal-surface);
  border: 1px solid var(--wal-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.wal-txn-list {
  display: flex;
  flex-direction: column;
}

.wal-txn-item {
  display: flex;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.wal-txn-item:last-child {
  border-bottom: none;
}

.txn-icon-badge {
  width: 42px;
  height: 42px;
  background: #f3f4f6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-right: 0.85rem;
  flex-shrink: 0;
}

.txn-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.txn-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--wal-text);
}

.txn-date {
  font-size: 0.78rem;
  color: var(--wal-muted);
}

.txn-amt {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.txn-amt.positive { color: var(--wal-green); }
.txn-amt.negative { color: var(--wal-text); }

/* Quick Pay */
.wal-pay-section {
  background: var(--wal-surface);
  border: 1px solid var(--wal-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.wal-pay-form {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

#upi-trigger,
#upi-amount {
  background: #ffffff;
  border: 1.5px solid var(--wal-border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  color: var(--wal-text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

#upi-trigger:focus,
#upi-amount:focus {
  border-color: var(--wal-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#upi-trigger::placeholder,
#upi-amount::placeholder {
  color: #9ca3af;
}

#send-pay-btn {
  background: var(--wal-indigo);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--t-fast);
}

#send-pay-btn:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   7. PERSONA 3: OFFICE WORKSPACE (Neutral Grey Gridlines)
   -------------------------------------------------------------------------- */
#office-profile {
  --off-bg: #f2f3f5;
  --off-surface: #ffffff;
  --off-border: #d1d5db;
  --off-grid: #e5e7eb;
  --off-text: #111827;
  --off-muted: #6b7280;
  --off-green: #107c41;
  background: var(--off-bg);
  color: var(--off-text);
}

.off-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--off-border);
  padding: 0 1.5rem;
}

.off-nav nav {
  display: flex;
  align-items: center;
  height: 52px;
  gap: 2rem;
}

.off-nav .nav-brand { color: #111827; }

.off-nav .nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: #6b7280;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  transition: all var(--t-fast);
}

.off-nav .nav-links a:hover,
.off-nav .nav-links a.active {
  background: #f3f4f6;
  color: #111827;
}

.off-body {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Toolbar */
.off-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 1rem;
  background: #fafafa;
  border-bottom: 1px solid var(--off-grid);
}

.tb-btn {
  background: transparent;
  border: none;
  color: #4b5563;
  font-size: 0.85rem;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  transition: all var(--t-fast);
}

.tb-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.tb-divider {
  width: 1px;
  height: 20px;
  background: #d1d5db;
  margin: 0 0.35rem;
}

/* Formula Bar */
.off-formula-row {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--off-border);
}

.cell-ref-badge {
  padding: 0.55rem 0.85rem;
  background: #f3f4f6;
  border-right: 1px solid var(--off-border);
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
  min-width: 55px;
  text-align: center;
}

.fx-badge {
  padding: 0 0.75rem;
  font-style: italic;
  font-family: serif;
  font-weight: 700;
  font-size: 1rem;
  color: #9ca3af;
  user-select: none;
}

#excel-trigger {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.55rem 0.75rem;
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  color: #111827;
  background: transparent;
}

#excel-trigger::placeholder { color: #9ca3af; }

/* Data Table */
.off-table-wrap {
  flex: 1;
  overflow: auto;
  background: #ffffff;
}

.off-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.off-table th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--off-border);
  white-space: nowrap;
  user-select: none;
  position: sticky;
  top: 0;
}

.off-table th::after {
  content: " ▾";
  font-size: 0.7rem;
  color: #9ca3af;
}

.off-table td {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--off-grid);
  color: #1f2937;
  white-space: nowrap;
}

.off-table tbody tr:hover:not(.blank-row) {
  background: #f0fdf4;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }

.blank-row td {
  height: 32px;
  background: #ffffff;
}

/* Status Bar */
.off-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 1rem;
  background: #f3f4f6;
  border-top: 1px solid var(--off-border);
  font-size: 0.72rem;
  color: #6b7280;
}

/* --------------------------------------------------------------------------
   8. SECURE CHAT WORKSPACE — Full-Screen Encrypted Messaging Portal
   -------------------------------------------------------------------------- */
#secure-chat-workspace {
  --chat-bg: #0b0d10;
  --chat-surface: #111418;
  --chat-border: #1e2128;
  --chat-text: #e5e7eb;
  --chat-muted: #6b7280;
  --chat-accent: #3b82f6;
  --chat-green: #22c55e;
  background: var(--chat-bg);
  color: var(--chat-text);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--chat-surface);
  border-bottom: 1px solid var(--chat-border);
  flex-shrink: 0;
}

.chat-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chat-lock-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  flex-shrink: 0;
}

.chat-topbar-info {
  display: flex;
  flex-direction: column;
}

.chat-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f9fafb;
}

.chat-status-line {
  font-size: 0.72rem;
  color: var(--chat-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chat-green);
  animation: pulse-dot 2s infinite;
}

#exit-chat-btn {
  background: transparent;
  border: 1px solid var(--chat-border);
  color: #6b7280;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

#exit-chat-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f9fafb;
  border-color: #30363d;
}

/* Chat Message Area */
.chat-canvas {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.msg-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: auto;
}

.msg-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  animation: msgSlideIn 0.25s var(--ease-out) forwards;
}

.msg-bubble.incoming {
  align-self: flex-start;
  background: #1a1d24;
  color: #c9d1d9;
  border-bottom-left-radius: 4px;
  border: 1px solid #252a36;
}

.msg-bubble.outgoing {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.35);
}

.msg-text {
  display: block;
}

.msg-time {
  display: block;
  font-size: 0.65rem;
  opacity: 0.6;
  margin-top: 0.3rem;
  text-align: right;
}

/* Chat Compose Footer */
.chat-compose {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  background: var(--chat-surface);
  border-top: 1px solid var(--chat-border);
  flex-shrink: 0;
}

.compose-action-btn {
  background: transparent;
  border: none;
  color: var(--chat-muted);
  padding: 0.4rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.compose-action-btn:hover {
  color: var(--chat-text);
  background: rgba(255, 255, 255, 0.05);
}

#chat-input {
  flex: 1;
  background: #1a1d24;
  border: 1.5px solid #252a36;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: #f0f6fc;
  outline: none;
  transition: border-color var(--t-fast);
}

#chat-input::placeholder {
  color: #4b5563;
}

#chat-input:focus {
  border-color: var(--chat-accent);
}

#send-msg-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.5);
  flex-shrink: 0;
}

#send-msg-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.5);
}

#send-msg-btn:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   9. CUSTOM SCROLLBARS
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(140, 140, 160, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 140, 160, 0.4);
}

/* --------------------------------------------------------------------------
   10. ANIMATIONS
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stripeShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes msgSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --------------------------------------------------------------------------
   11. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .wal-cards-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .stu-nav nav,
  .wal-nav nav,
  .off-nav nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 0;
    gap: 0.5rem;
  }

  .nav-links {
    width: 100%;
    gap: 0.15rem !important;
  }

  .nav-links a {
    font-size: 0.78rem !important;
    padding: 0.35rem 0.6rem !important;
  }

  .stu-body,
  .wal-body {
    padding: 1.25rem 1rem 3rem;
  }

  .course-cards {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .wal-cards-row {
    grid-template-columns: 1fr;
  }

  .wal-pay-form {
    grid-template-columns: 1fr;
  }

  .off-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .chat-compose {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  .setup-card-body {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .setup-card-body h2 {
    font-size: 1.3rem;
  }

  .stu-stats {
    flex-direction: column;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .wal-chart-bars {
    height: 120px;
  }

  .msg-bubble {
    max-width: 88%;
  }
}
