/* ==========================================================================
   UpSkill Academy — Trainee & Instructor Portal Design System
   Exact Brand Palette: Warm Cream, Crisp White, Deep Burgundy, Egyptian Gold, Charcoal
   Aesthetic: Refined Editorial, Collegiate, Clean Hairlines, Flat Surfaces
   ========================================================================== */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/cairo-normal-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/cairo-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/source-serif-4-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/source-serif-4-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Exact UpSkill Brand Colors from css/style.css */
  --portal-bg: #FCFBF8;
  --portal-surface: #FFFFFF;
  --portal-surface-elevated: #FFFFFF;
  --portal-surface-subtle: #F6F4EE;
  --portal-surface-hover: #F0EDE4;
  
  --portal-border: #EAE6DF;
  --portal-border-hover: #D4CEBF;
  --portal-border-dark: #262626;

  --portal-text-main: #0A0A0A;
  --portal-text-muted: #52504C;
  --portal-text-light: #68655E;
  --portal-text-subtle: #8C887E;

  /* UpSkill Signature Burgundy */
  --portal-burgundy: #700019;
  --portal-burgundy-hover: #540013;
  --portal-burgundy-deep: #3D000E;
  --portal-burgundy-subtle: rgba(112, 0, 25, 0.06);
  --portal-burgundy-border: rgba(112, 0, 25, 0.18);

  /* UpSkill Egyptian Gold */
  --portal-gold: #C8952E;
  --portal-gold-text: #8A6414;
  --portal-gold-hover: #AF7F22;
  --portal-gold-subtle: rgba(200, 149, 46, 0.10);
  --portal-gold-border: rgba(200, 149, 46, 0.28);

  /* Secondary States */
  --portal-success: #1E6B47;
  --portal-success-subtle: rgba(30, 107, 71, 0.08);
  --portal-danger: #991B1B;
  --portal-danger-subtle: rgba(153, 27, 27, 0.08);

  /* Typography */
  --font-portal-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-portal-display: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --font-portal-arabic: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Refined Structural Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Subtle Editorial Shadows */
  --portal-shadow-sm: 0 1px 3px rgba(10, 10, 10, 0.04), 0 1px 2px rgba(10, 10, 10, 0.02);
  --portal-shadow-md: 0 4px 14px rgba(10, 10, 10, 0.06), 0 2px 4px rgba(10, 10, 10, 0.02);
  --portal-transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-portal-primary);
  background-color: var(--portal-bg);
  color: var(--portal-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Modal Open Background Scroll Lock */
body.portal-modal-open,
html.portal-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

body.portal-modal-open .portal-modal-window {
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
}

[dir="rtl"] {
  font-family: var(--font-portal-arabic);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}


/* ==========================================================================
   Portal Header & Navigation (Matches Main Website Header)
   ========================================================================== */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(252, 251, 248, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--portal-border);
  padding-block: 0.85rem;
}

.portal-container {
  max-width: 1600px;
  width: 100%;
  margin-inline: auto;
  padding-inline: 2rem;
}

@media (min-width: 1720px) {
  .portal-container {
    max-width: 1680px;
    padding-inline: 2.5rem;
  }
}

@media (max-width: 768px) {
  .portal-container {
    padding-inline: 1rem;
  }
}

.portal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.portal-logo-link {
  display: flex;
  align-items: center;
}

.portal-logo-link img {
  height: 34px;
  width: auto;
}

.portal-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  background-color: var(--portal-burgundy-subtle);
  color: var(--portal-burgundy);
  border: 1px solid var(--portal-burgundy-border);
}

.portal-group-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-inline-start: 1rem;
}

.portal-group-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--portal-text-main);
  transition: border-color var(--portal-transition);
}

.portal-group-selector:focus,
.portal-group-selector:hover {
  outline: none;
  border-color: var(--portal-burgundy);
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.portal-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--portal-border);
  background-color: transparent;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--portal-text-main);
  transition: all var(--portal-transition);
}

.portal-lang-btn:hover {
  border-color: var(--portal-burgundy);
  color: var(--portal-burgundy);
  background-color: var(--portal-surface-subtle);
}

.portal-user-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.55rem 0.3rem 0.85rem;
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-full);
}

.portal-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--portal-burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #FFFFFF;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.portal-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-preview-box {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 3px solid var(--portal-burgundy);
  box-shadow: 0 4px 14px rgba(112, 0, 25, 0.2);
  background-color: var(--portal-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--portal-text-main);
  line-height: 1.2;
}

.portal-user-role {
  font-size: 0.7rem;
  color: var(--portal-text-light);
  display: block;
}

/* ==========================================================================
   Portal Main Layout & Editorial Hero Banner
   ========================================================================== */
.portal-main {
  flex: 1;
  padding-block: 2.25rem 4rem;
}

.portal-hero-banner {
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: var(--portal-shadow-sm);
  position: relative;
}

.portal-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--portal-burgundy);
}

.portal-group-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--portal-gold-text);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portal-hero-title {
  font-family: var(--font-portal-display);
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--portal-text-main);
  line-height: 1.25;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

[dir="rtl"] .portal-hero-title {
  font-family: var(--font-portal-arabic);
}

.portal-hero-subtitle {
  color: var(--portal-text-muted);
  font-size: 0.95rem;
  max-width: 640px;
  line-height: 1.6;
}

.portal-metrics-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.metric-card {
  background-color: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.4rem;
  text-align: center;
  min-width: 135px;
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--portal-text-main);
  line-height: 1.2;
  font-family: var(--font-portal-primary);
}

.metric-value.highlight-burgundy {
  color: var(--portal-burgundy);
}

.metric-value.highlight-gold {
  color: var(--portal-gold-text);
}

.metric-label {
  font-size: 0.72rem;
  color: var(--portal-text-light);
  font-weight: 600;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* 2-Column Dashboard Grid */
.portal-grid-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .portal-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   20-Session Roadmap & Accordion (Editorial Style)
   ========================================================================== */
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-h2 {
  font-family: var(--font-portal-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--portal-text-main);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

[dir="rtl"] .section-h2 {
  font-family: var(--font-portal-arabic);
}

.section-h2-counter {
  font-family: var(--font-portal-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  background-color: var(--portal-surface-subtle);
  color: var(--portal-text-muted);
  border: 1px solid var(--portal-border);
}

/* Module Dividers & Grouping Headers */
.module-separator-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background-color: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  border-left: 3px solid var(--portal-burgundy);
  border-radius: var(--radius-xs);
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}

.module-separator-card:first-child {
  margin-top: 0;
}

[dir="rtl"] .module-separator-card {
  border-left: 1px solid var(--portal-border);
  border-right: 3px solid var(--portal-burgundy);
}

.module-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.module-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-burgundy);
  background: var(--portal-burgundy-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
}

.module-name {
  font-family: var(--font-portal-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--portal-text-main);
}

[dir="rtl"] .module-name {
  font-family: var(--font-portal-arabic);
}

.module-completion-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-text-muted);
}

.session-roadmap-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.session-card {
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--portal-transition);
}

.session-card:hover {
  border-color: var(--portal-border-hover);
  box-shadow: var(--portal-shadow-sm);
}

.session-card.is-active {
  border-color: var(--portal-burgundy);
  border-inline-start: 4px solid var(--portal-burgundy);
  box-shadow: var(--portal-shadow-md);
}

.session-card-header {
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.session-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.session-number-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background-color: var(--portal-surface-subtle);
  color: var(--portal-text-muted);
  border: 1px solid var(--portal-border);
}

.session-card.is-completed .session-number-badge {
  background-color: var(--portal-success-subtle);
  color: var(--portal-success);
  border-color: rgba(30, 107, 71, 0.25);
}

.session-card.is-active .session-number-badge {
  background-color: var(--portal-burgundy);
  color: #FFFFFF;
  border-color: var(--portal-burgundy);
}

.session-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.session-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--portal-text-main);
}

.session-meta-line {
  font-size: 0.78rem;
  color: var(--portal-text-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
}

.status-badge.completed {
  background-color: var(--portal-success-subtle);
  color: var(--portal-success);
  border-color: rgba(30, 107, 71, 0.25);
}

.status-badge.active-now {
  background-color: var(--portal-burgundy-subtle);
  color: var(--portal-burgundy);
  border-color: var(--portal-burgundy-border);
}

.status-badge.locked {
  background-color: var(--portal-surface-subtle);
  color: var(--portal-text-subtle);
  border-color: var(--portal-border);
}

.session-expand-arrow {
  color: var(--portal-text-subtle);
  transition: transform var(--portal-transition);
}

.session-card.is-expanded .session-expand-arrow {
  transform: rotate(180deg);
}

/* Expanded Session Content */
.session-card-body {
  display: none;
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--portal-border);
  background-color: var(--portal-surface-subtle);
}

.session-card.is-expanded .session-card-body {
  display: block;
}

/* Video Player Container */
.session-video-shell {
  margin-top: 1.25rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #0d0d0d;
  border: 1px solid var(--portal-border);
  position: relative;
  aspect-ratio: 16 / 9;
}

.session-video-shell iframe,
.session-video-shell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
}

.session-video-shell .video-placeholder-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.72) 0%, rgba(13, 13, 13, 0.88) 100%), url('/images/raml-hub.jpg') center / cover no-repeat;
}

.session-video-shell.is-playing .video-placeholder-card {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.video-placeholder-card.is-loading .video-placeholder-icon {
  animation: portalPlayPulse 0.9s infinite alternate ease-in-out;
  border-color: var(--portal-gold);
  background: rgba(200, 149, 46, 0.3);
}

@keyframes portalPlayPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.18); opacity: 1; }
}

.session-prep-objectives {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.objective-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--portal-text-muted);
}

.objective-item svg {
  color: var(--portal-burgundy);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

/* Vocab Chips */
.vocab-chips-wrap {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.vocab-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  color: var(--portal-text-main);
}

/* ==========================================================================
   Voice Audio Drill Recorder & Task Submission
   ========================================================================== */
.task-submission-card {
  margin-top: 1.5rem;
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-inline-start: 3px solid var(--portal-burgundy);
  border-radius: var(--radius-sm);
  padding: 1.4rem;
  box-shadow: var(--portal-shadow-sm);
}

.task-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.task-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-burgundy);
}

.task-prompt-text {
  font-size: 0.92rem;
  color: var(--portal-text-main);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

/* Audio Recorder Widget */
.voice-recorder-widget {
  background-color: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.recorder-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.record-btn-main {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background-color: var(--portal-burgundy);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--portal-transition), background-color var(--portal-transition);
}

.record-btn-main:hover {
  background-color: var(--portal-burgundy-hover);
  transform: translateY(-1px);
}

.record-btn-main.is-recording {
  background-color: #B91C1C;
  animation: pulse-burgundy 1.5s infinite;
}

@keyframes pulse-burgundy {
  0% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(185, 28, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
}

.recorder-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.waveform-bar {
  width: 3px;
  background-color: var(--portal-border-hover);
  border-radius: 1px;
  height: 8px;
  transition: height 0.15s ease;
}

.recorder-waveform.is-live-analyzing .waveform-bar {
  transition: height 0.04s ease-out, background-color 0.1s ease;
  background-color: var(--portal-burgundy);
}

.recorder-timer {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--portal-text-main);
}

.recorder-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Button Variants matching Main Website */
.btn-portal-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--portal-burgundy);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--portal-burgundy);
  transition: all var(--portal-transition);
}

.btn-portal-primary:hover {
  background-color: var(--portal-burgundy-hover);
  border-color: var(--portal-burgundy-hover);
  transform: translateY(-1px);
}

.btn-portal-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-portal-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: transparent;
  color: var(--portal-text-main);
  border: 1px solid var(--portal-border);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-xs);
  transition: all var(--portal-transition);
}

.btn-portal-secondary:hover {
  border-color: var(--portal-border-hover);
  background-color: var(--portal-surface-subtle);
}

/* ==========================================================================
   Sidebar Widgets (Next Session, Scorecard, Mentor Feedback)
   ========================================================================== */
.portal-sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.portal-widget-box {
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  box-shadow: var(--portal-shadow-sm);
}

.widget-title {
  font-family: var(--font-portal-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--portal-text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[dir="rtl"] .widget-title {
  font-family: var(--font-portal-arabic);
}

/* Next Live Session Schedule Card */
.schedule-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--portal-burgundy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.schedule-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--portal-text-main);
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

.schedule-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--portal-text-muted);
  margin-top: 0.45rem;
  line-height: 1.45;
}

.schedule-detail-row svg {
  color: var(--portal-gold-text);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Star Rubric Scorecard */
.rubric-metric-item {
  margin-bottom: 0.85rem;
}

.rubric-metric-item:last-child {
  margin-bottom: 0;
}

.rubric-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  margin-bottom: 0.3rem;
}

.rubric-score-badge {
  color: var(--portal-gold-text);
  font-weight: 700;
}

.rubric-progress-bar {
  height: 6px;
  background-color: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.rubric-progress-fill {
  height: 100%;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--portal-burgundy) 0%, var(--portal-gold) 100%);
}

.rubric-item,
.rubric-metric-item {
  margin-bottom: 0.85rem;
}

.rubric-item:last-child,
.rubric-metric-item:last-child {
  margin-bottom: 0;
}

.rubric-item-desc {
  font-size: 0.72rem;
  color: var(--portal-text-light);
  margin-top: 0.25rem;
  line-height: 1.35;
}

/* Mentor Debrief Quote Box */
.mentor-feedback-card {
  margin-top: 1rem;
  background-color: var(--portal-surface-subtle);
  border-inline-start: 3px solid var(--portal-burgundy);
  border-radius: var(--radius-xs);
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--portal-text-muted);
  line-height: 1.5;
}

.mentor-author-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-text-main);
}

.mentor-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 1px solid var(--portal-border);
}

/* ==========================================================================
   Instructor Studio Workspace (Editorial Data View)
   ========================================================================== */
.instructor-studio-wrap {
  display: none;
}

.instructor-studio-wrap.is-visible {
  display: block;
}

.trainee-workspace-wrap.is-hidden {
  display: none;
}

.instructor-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.instructor-stat-card {
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  box-shadow: var(--portal-shadow-sm);
}

.instructor-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.instructor-group-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-xs);
  padding: 0.4rem 0.75rem;
}

.instructor-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--portal-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.roster-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
}

@media (min-width: 992px) {
  .roster-table-responsive {
    scrollbar-width: thin;
  }
}

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

[dir="rtl"] .roster-table {
  text-align: right;
}

.roster-table th {
  padding: 0.75rem 0.85rem;
  color: var(--portal-text-light);
  font-weight: 700;
  border-bottom: 1px solid var(--portal-border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--portal-surface-subtle);
  white-space: nowrap;
}

.roster-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--portal-border);
  color: var(--portal-text-muted);
  vertical-align: middle;
}

.roster-table td[data-label="Action"],
.roster-table th:last-child {
  white-space: nowrap;
  text-align: end;
}

[dir="rtl"] .roster-table td[data-label="Action"],
[dir="rtl"] .roster-table th:last-child {
  text-align: start;
}

.roster-table td[data-label="Trainee Name"],
.roster-table td:first-child {
  white-space: nowrap;
}

.roster-table tr:hover td {
  background-color: var(--portal-surface-subtle);
}

/* Modal Styling & Overlays */
.portal-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(5px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overscroll-behavior: contain !important;
  touch-action: none;
}

.portal-modal-backdrop.is-open {
  display: flex;
}

.portal-modal-window {
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.75rem;
  box-shadow: var(--portal-shadow-md);
  position: relative;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
}

.portal-modal-window.is-wide {
  max-width: 640px;
}

.portal-modal-window.is-extra-wide {
  max-width: 760px;
}

/* Audio Player Preview Bar */
.audio-player-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.85rem;
  margin-block: 0.85rem 1.25rem;
}

.audio-play-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--portal-burgundy);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--portal-transition);
}

.audio-play-btn:hover {
  background-color: var(--portal-burgundy-hover);
}

.audio-play-btn svg {
  width: 14px;
  height: 14px;
  margin-left: 2px;
}

.audio-play-btn.is-playing svg {
  margin-left: 0;
}

.audio-waveform-mini {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.audio-bar-mini {
  flex: 1;
  background-color: var(--portal-border-hover);
  border-radius: 1px;
  height: 6px;
  transition: height 120ms ease;
}

.speed-toggle-btn {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--portal-border);
  background: var(--portal-surface);
  color: var(--portal-text-muted);
  cursor: pointer;
}

.speed-toggle-btn.active {
  background-color: var(--portal-burgundy);
  color: #FFFFFF;
  border-color: var(--portal-burgundy);
}

/* Quick Feedback Mentor Tags */
.quick-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
  margin-bottom: 0.85rem;
}

.quick-tag-chip {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background-color: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  color: var(--portal-text-muted);
  cursor: pointer;
  transition: all var(--portal-transition);
  user-select: none;
}

.quick-tag-chip:hover {
  background-color: var(--portal-burgundy-subtle);
  border-color: var(--portal-burgundy-border);
  color: var(--portal-burgundy);
}

/* Rubric Range Input Sliders */
.rubric-slider-group {
  margin-bottom: 0.85rem;
}

.rubric-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--portal-text-main);
  margin-bottom: 0.25rem;
}

.rubric-slider-val {
  color: var(--portal-gold-text);
  font-weight: 700;
  font-size: 0.82rem;
}

.rubric-slider-desc {
  font-size: 0.72rem;
  color: var(--portal-text-light);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.rubric-range-input {
  width: 100%;
  accent-color: var(--portal-burgundy);
  cursor: pointer;
}

/* Toast Notifications */
.portal-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  background-color: #1A1A1A;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 4px solid var(--portal-burgundy);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--portal-shadow-md);
  font-size: 0.85rem;
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: all var(--portal-transition);
}

[dir="rtl"] .portal-toast {
  right: auto;
  left: 2rem;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  border-right: 4px solid var(--portal-burgundy);
}

.portal-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .portal-toast {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    font-size: 0.78rem;
    padding: 0.7rem 0.85rem;
  }
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  color: var(--portal-text-subtle);
  font-size: 1.2rem;
  padding: 0.25rem;
  z-index: 25;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: all var(--portal-transition);
}

.modal-close-btn:hover {
  color: var(--portal-text-main);
  background-color: var(--portal-bg-hover);
}

[dir="rtl"] .modal-close-btn {
  right: auto;
  left: 1.25rem;
}

.btn-session-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(139, 29, 44, 0.08);
  color: var(--portal-burgundy);
  border: 1px solid rgba(139, 29, 44, 0.22);
  cursor: pointer;
  transition: all var(--portal-transition);
}

.btn-session-edit:hover {
  background: var(--portal-burgundy);
  color: #FFFFFF;
}

.form-field-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--portal-text-main);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background-color: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-xs);
  color: var(--portal-text-main);
  font-size: 0.85rem;
  transition: border-color var(--portal-transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--portal-burgundy);
}

/* ==========================================================================
   Comprehensive Mobile Responsiveness & Balanced Proportions (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .portal-container {
    padding-inline: 1rem;
  }


  /* 2. Portal Header Proportions */
  .portal-header {
    padding-block: 0.65rem;
  }

  .portal-header-inner {
    gap: 0.45rem;
  }

  .portal-logo-link {
    display: flex;
    align-items: center;
  }

  .portal-logo-link img {
    height: 26px;
    width: auto;
  }

  .portal-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }

  .portal-lang-btn {
    height: 32px;
    padding: 0 0.55rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
  }

  .portal-user-profile {
    height: 32px;
    padding: 0 0.65rem 0 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: var(--radius-full);
  }

  .portal-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
    border-radius: var(--radius-full);
    flex-shrink: 0;
  }

  .portal-user-name {
    font-size: 0.76rem;
    white-space: nowrap;
    line-height: 1;
  }

  /* Hide verbose multi-line role on mobile so the avatar chip maintains sleek proportions */
  .portal-user-role {
    display: none;
  }

  /* 3. Main Layout & Hero Banner */
  .portal-main {
    padding-block: 1.25rem 3rem;
  }

  .portal-hero-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1rem;
    margin-bottom: 1.5rem;
    gap: 1.25rem;
  }

  .portal-group-tag {
    font-size: 0.7rem;
    margin-bottom: 0.35rem;
    letter-spacing: 0.03em;
  }

  .portal-hero-title {
    font-size: 1.35rem;
    line-height: 1.25;
    margin-bottom: 0.45rem;
  }

  .portal-hero-subtitle {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  /* 3-Column Metrics Strip - Identical Parallel Heights */
  .portal-metrics-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    width: 100%;
    align-items: stretch;
  }

  .metric-card {
    min-width: 0;
    padding: 0.75rem 0.35rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
  }

  .metric-value {
    font-size: 1.2rem;
    line-height: 1.1;
  }

  .metric-label {
    font-size: 0.62rem;
    letter-spacing: 0;
    line-height: 1.25;
    margin-top: 0.25rem;
    min-height: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  /* 4. Section Heading & Session Cards - Clean Parallel Top Baseline */
  .section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
  }

  .section-h2 {
    font-size: 1.15rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }

  .section-h2 svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .section-h2-counter {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Session Cards - Mobile Parallel Layout */
  .session-card-header {
    padding: 0.85rem 0.75rem;
    display: flex;
    align-items: flex-start; /* Perfectly parallel top alignment across icon, title, badge, and arrow */
    justify-content: space-between;
    gap: 0.55rem;
  }

  .session-header-left {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
  }

  .session-number-badge {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 0.75rem;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    margin-top: 1px; /* Precision baseline alignment with the title's cap height */
  }

  .session-title-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }

  .session-title {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--portal-text-main);
    word-break: break-word;
  }

  .session-meta-line {
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--portal-text-light);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.35rem;
    row-gap: 0.15rem;
  }

  .session-header-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-top: 2px; /* Aligns parallel with the first line of the title */
  }

  .status-badge {
    font-size: 0.65rem;
    padding: 0.18rem 0.45rem;
    white-space: nowrap;
    border-radius: var(--radius-xs);
    font-weight: 600;
  }

  .session-expand-arrow {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
  }

  .session-card-body {
    padding: 0 0.85rem 0.85rem 0.85rem;
  }

  /* 5. Instructor Studio Mobile Proportions */
  .instructor-actions-bar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.65rem;
  }

  .instructor-group-box {
    width: 100%;
    justify-content: space-between;
    padding: 0.45rem 0.75rem;
  }

  .instructor-group-box select {
    max-width: 65%;
    font-size: 0.8rem;
    text-overflow: ellipsis;
  }

  #open-invite-modal-btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  .instructor-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    margin-bottom: 1.25rem;
  }

  .instructor-stat-card {
    padding: 0.85rem 0.75rem;
  }

  .instructor-stat-card .metric-value {
    font-size: 1.35rem;
  }

  .instructor-stat-card .metric-label {
    font-size: 0.68rem;
  }

  .roster-table-responsive {
    border: 1px solid var(--portal-border);
    border-radius: var(--radius-xs);
    margin-top: 0.75rem;
  }

  .roster-table {
    min-width: 580px;
  }

  .roster-table th,
  .roster-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
  }

  .widget-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .voice-recorder-widget {
    flex-direction: column;
    align-items: stretch;
  }

  .recorder-actions {
    justify-content: flex-end;
  }

  /* 6. Mobile Modals & Audio Player Bar */
  .portal-modal-window {
    padding: 1.25rem 1rem;
    max-height: 88vh;
    border-radius: var(--radius-sm);
  }

  .portal-modal-window.is-wide,
  .portal-modal-window.is-extra-wide {
    max-width: 100%;
  }

  .curriculum-form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .audio-player-bar {
    padding: 0.5rem 0.65rem;
    gap: 0.5rem;
  }

  .quick-tags-container {
    gap: 0.35rem;
  }

  .quick-tag-chip {
    font-size: 0.68rem;
    padding: 0.18rem 0.45rem;
  }
}

/* ==========================================================================
   REMEDIATION ENHANCEMENTS (FIX-01, FIX-02, FIX-06, ENH-01, ENH-04)
   ========================================================================== */

/* 1. Strict Bidi & Number Isolation (FIX-02) */
bdi,
.metric-value,
.rubric-score-badge,
.rubric-slider-val,
.status-badge,
.recorder-timer,
.audio-player-bar span,
.fact-row dd strong,
span[dir="ltr"],
#instructor-roster-capacity span[dir="ltr"] {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  display: inline-block;
}

[dir="rtl"] .metric-value,
[dir="rtl"] .rubric-score-badge,
[dir="rtl"] .rubric-slider-val {
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

/* RTL Specific Alignment Adjustments */
[dir="rtl"] .session-header-left {
  flex-direction: row;
}

[dir="rtl"] .portal-hero-content {
  text-align: right;
}

[dir="rtl"] .session-card.is-active {
  border-inline-start: 4px solid var(--portal-burgundy);
  border-inline-end: 1px solid var(--portal-border);
}

[dir="rtl"] .task-submission-card {
  border-inline-start: 3px solid var(--portal-burgundy);
  border-inline-end: 1px solid var(--portal-border);
}

/* 2. Executive Video Placeholder Card (FIX-06) */
.video-placeholder-card {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(112, 0, 25, 0.12) 0%, rgba(10, 10, 10, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.75rem 1.25rem;
  color: #FFFFFF;
}

.video-placeholder-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(200, 149, 46, 0.16);
  border: 1px solid rgba(200, 149, 46, 0.4);
  color: var(--portal-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  transition: transform var(--portal-transition);
}

.video-placeholder-card:hover .video-placeholder-icon {
  transform: scale(1.06);
}

.video-placeholder-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--portal-gold);
  margin-bottom: 0.35rem;
}

.video-placeholder-title {
  font-family: var(--font-portal-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #FFFFFF;
}

.video-placeholder-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 440px;
  line-height: 1.45;
  margin: 0;
}

/* 3. Real Audio Waveform Playback Progress (ENH-01) */
.audio-waveform-mini {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.audio-bar-mini {
  width: 3px;
  min-height: 4px;
  background-color: var(--portal-border);
  border-radius: 2px;
  transition: background-color 0.2s ease, height 0.15s ease;
}

.audio-bar-mini.is-played {
  background-color: var(--portal-burgundy) !important;
}

.audio-bar-mini.is-active {
  background-color: var(--portal-gold) !important;
}

/* 4. Responsive Mobile Roster Cards (ENH-04) */
@media (max-width: 540px) {
  .roster-table-responsive {
    overflow-x: visible !important;
    border: none !important;
    margin-top: 0.5rem;
  }

  .roster-table {
    min-width: 0 !important;
    width: 100% !important;
    display: block !important;
  }

  .roster-table thead {
    display: none !important;
  }

  .roster-table tbody,
  .roster-table tr,
  .roster-table td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }

  .roster-table tr {
    margin-bottom: 0.85rem;
    background-color: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    box-shadow: var(--portal-shadow-sm);
  }

  .roster-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.45rem 0 !important;
    border-bottom: 1px dashed var(--portal-border-subtle) !important;
    font-size: 0.82rem;
    gap: 0.75rem;
    word-break: break-all;
    text-align: end;
  }

  .roster-table td:before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--portal-text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    text-align: start;
  }

  .roster-table td:last-child {
    border-bottom: none !important;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    display: block !important;
    text-align: center;
  }

  .roster-table td:last-child button {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   TRAINEE DOSSIER & ADMIN FACULTY MANAGEMENT STYLES
   ========================================================================== */

/* Danger Action Button */
.btn-portal-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: rgba(229, 62, 62, 0.08);
  color: #E53E3E;
  border: 1px solid rgba(229, 62, 62, 0.3);
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--portal-transition);
}

.btn-portal-danger:hover {
  background-color: #E53E3E;
  color: #FFFFFF;
  border-color: #E53E3E;
}

.btn-portal-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: var(--portal-surface-subtle);
  color: var(--portal-text-muted);
  border-color: var(--portal-border);
}

/* Trainee Dossier Header & Stats */
.dossier-header {
  border-bottom: 1px solid var(--portal-border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.dossier-profile-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-inline-end: 2.5rem;
}

.dossier-avatar {
  width: 52px;
  height: 52px;
  font-size: 1.2rem;
  background: var(--portal-burgundy);
  color: #FFFFFF;
  border: 2px solid rgba(112, 0, 25, 0.2);
}

.dossier-profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dossier-name {
  font-family: var(--font-portal-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--portal-text-main);
  margin: 0;
}

.dossier-meta {
  font-size: 0.8rem;
  color: var(--portal-text-muted);
}

.dossier-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-xs);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.dossier-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dossier-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--portal-text-main);
}

.dossier-stat-lbl {
  font-size: 0.72rem;
  color: var(--portal-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

/* Dossier Admin Actions Toolbar */
.dossier-actions-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(112, 0, 25, 0.03);
  border: 1px dashed var(--portal-border-hover);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.85rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dossier-actions-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--portal-burgundy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dossier-actions-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dossier-action-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}

/* Dossier Body & Submissions List */
.dossier-section-title-wrap {
  margin-bottom: 1rem;
}

.dossier-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--portal-text-main);
  margin: 0 0 0.25rem 0;
}

.dossier-section-sub {
  font-size: 0.78rem;
  color: var(--portal-text-muted);
}

.dossier-submissions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.submission-dossier-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-left: 4px solid var(--portal-burgundy);
  border-radius: var(--radius-xs);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--portal-shadow-sm);
  transition: box-shadow var(--portal-transition);
}

[dir="rtl"] .submission-dossier-card {
  border-left: 1px solid var(--portal-border);
  border-right: 4px solid var(--portal-burgundy);
}

.submission-dossier-card.is-graded {
  border-left-color: var(--portal-success);
}

[dir="rtl"] .submission-dossier-card.is-graded {
  border-right-color: var(--portal-success);
}

.submission-dossier-card.is-unsubmitted {
  border-left-color: var(--portal-border);
  opacity: 0.65;
}

[dir="rtl"] .submission-dossier-card.is-unsubmitted {
  border-right-color: var(--portal-border);
}

.submission-dossier-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.submission-dossier-session {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--portal-burgundy);
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.submission-dossier-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--portal-text-main);
  margin: 0;
}

.submission-dossier-meta {
  font-size: 0.75rem;
  color: var(--portal-text-muted);
  margin-top: 0.2rem;
}

.submission-rubric-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 0.85rem;
  background: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.85rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
}

.submission-rubric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.submission-rubric-lbl {
  color: var(--portal-text-muted);
}

.submission-rubric-val {
  font-weight: 700;
  color: var(--portal-gold-text);
}

.submission-feedback-quote {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(112, 0, 25, 0.04);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--portal-text-main);
  line-height: 1.45;
  border-left: 2px solid var(--portal-burgundy);
}

[dir="rtl"] .submission-feedback-quote {
  border-left: none;
  border-right: 2px solid var(--portal-burgundy);
}

/* Mobile Adjustments for Dossier Modal */
@media (max-width: 540px) {
  .dossier-stats-bar {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .dossier-actions-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dossier-actions-right {
    flex-direction: column;
  }

  .dossier-action-btn {
    width: 100%;
    justify-content: center;
  }

  .submission-rubric-mini {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   PHASE 4: PRE-WORK VIDEO TRACKING & READINESS CHECKLIST
   ========================================================================= */
.prework-tracking-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  margin-top: 0.85rem;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  transition: all var(--portal-transition);
}

.prework-tracking-bar.is-completed {
  background: rgba(46, 125, 50, 0.05);
  border-color: rgba(46, 125, 50, 0.3);
}

.prework-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.prework-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--portal-surface-alt);
  color: var(--portal-text-muted);
  border: 1px solid var(--portal-border);
  flex-shrink: 0;
  transition: all var(--portal-transition);
}

.prework-tracking-bar.is-completed .prework-icon-wrap {
  background: #2E7D32;
  color: #FFFFFF;
  border-color: #2E7D32;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.25);
}

.prework-status-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.prework-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--portal-accent-amber);
}

.prework-tracking-bar.is-completed .prework-status-badge {
  color: #2E7D32;
}

.prework-status-desc {
  font-size: 0.78rem;
  color: var(--portal-text-muted);
  line-height: 1.35;
}

.btn-prep-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border-hover);
  color: var(--portal-text-main);
  transition: all var(--portal-transition);
}

.btn-prep-toggle:hover {
  border-color: var(--portal-burgundy);
  color: var(--portal-burgundy);
}

.btn-prep-toggle.is-completed {
  background: #2E7D32 !important;
  color: #FFFFFF !important;
  border-color: #2E7D32 !important;
}

.btn-prep-toggle.is-completed:hover {
  background: #256629 !important;
  border-color: #256629 !important;
}

/* =========================================================================
   PHASE 4: TRAINEE SUBMISSIONS HISTORY & AUDIO ARCHIVE
   ========================================================================= */
.trainee-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-xs);
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  color: var(--portal-text-main);
  cursor: pointer;
  transition: all var(--portal-transition);
}

.trainee-history-btn:hover {
  border-color: var(--portal-burgundy);
  color: var(--portal-burgundy);
  background: var(--portal-burgundy-subtle);
}

.trainee-history-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--portal-surface-alt);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.trainee-history-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.history-session-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--portal-burgundy-subtle);
  color: var(--portal-burgundy);
  border: 1px solid var(--portal-burgundy-border);
}

@media (max-width: 540px) {
  .prework-tracking-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .btn-prep-toggle {
    width: 100%;
    justify-content: center;
  }

  .trainee-history-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .trainee-history-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Phase 6: Production Authentication Gateway & User Dropdown
   ========================================================================== */
.portal-auth-gate-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background: radial-gradient(ellipse at 50% 10%, rgba(112, 0, 25, 0.12) 0%, transparent 65%), var(--portal-bg);
  position: relative;
  z-index: 50;
}

.auth-gate-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-lg);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 2.25rem 2rem;
  max-width: 450px;
  width: 100%;
}

.auth-gate-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-gate-logo-link {
  display: inline-block;
  margin-bottom: 1rem;
  transition: opacity var(--portal-transition);
}

.auth-gate-logo-link:hover {
  opacity: 0.9;
}

.auth-gate-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.auth-gate-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--portal-burgundy-subtle);
  color: var(--portal-burgundy);
  border: 1px solid var(--portal-burgundy-border);
}

.auth-gate-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--portal-text-main);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.auth-gate-desc {
  font-size: 0.83rem;
  color: var(--portal-text-light);
  line-height: 1.45;
}

.auth-gate-form {
  margin-top: 1.25rem;
}

.auth-gate-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.78rem;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--portal-text-light);
  cursor: pointer;
  user-select: none;
}

.auth-link {
  color: var(--portal-burgundy);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--portal-transition);
}

.auth-link:hover {
  opacity: 0.85;
  text-decoration: underline;
}


.auth-gate-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-gate-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  transition: color var(--portal-transition);
}

.auth-gate-back-link:hover {
  color: var(--portal-text-main);
}

/* ==========================================================================
   Interactive Demo Guest Mode & Gateway Trigger
   ========================================================================== */

/* 1. Floating Corner Demo Button on Auth Gate */
.auth-gate-corner-demo {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 25;
}

[dir="rtl"] .auth-gate-corner-demo {
  right: auto;
  left: 1.5rem;
}

.auth-corner-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  background: rgba(22, 22, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 149, 46, 0.45);
  border-radius: 999px;
  color: #E2B558;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all var(--portal-transition);
}

.auth-corner-demo-btn:hover {
  background: rgba(200, 149, 46, 0.18);
  border-color: #E2B558;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(200, 149, 46, 0.22);
}

.corner-demo-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E2B558;
  box-shadow: 0 0 0 0 rgba(226, 181, 88, 0.7);
  animation: demoPulse 2s infinite;
}

@keyframes demoPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(226, 181, 88, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(226, 181, 88, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(226, 181, 88, 0);
  }
}

/* 2. Login Card Demo Button & Divider */
.auth-gate-divider-row {
  display: flex;
  align-items: center;
  margin: 1.25rem 0 0.9rem;
  text-align: center;
  color: var(--portal-text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-gate-divider-row::before,
.auth-gate-divider-row::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--portal-border);
}

.auth-gate-divider-row span {
  padding: 0 0.75rem;
}

.btn-portal-demo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--portal-radius-md);
  background: linear-gradient(135deg, rgba(139, 21, 56, 0.08), rgba(200, 149, 46, 0.12));
  border: 1px solid rgba(200, 149, 46, 0.38);
  color: #E2B558;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--portal-transition);
}

.btn-portal-demo:hover {
  background: linear-gradient(135deg, rgba(139, 21, 56, 0.18), rgba(200, 149, 46, 0.22));
  border-color: #E2B558;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200, 149, 46, 0.18);
}

.demo-btn-chip {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(200, 149, 46, 0.18);
  border: 1px solid rgba(200, 149, 46, 0.35);
  color: #E2B558;
}

/* 3. Top Demo Banner (Collegiate Dark Slate & Gold) */
.portal-demo-banner {
  background: #111111;
  border-bottom: 1px solid #262626;
  color: #B5B2A8;
  padding: 0.45rem 0;
  z-index: 100;
  position: sticky;
  top: 0;
  width: 100%;
}

.portal-demo-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.demo-banner-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.demo-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  background: rgba(200, 149, 46, 0.18);
  color: #E2B558;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(200, 149, 46, 0.35);
}

.demo-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E2B558;
}

.demo-banner-hint {
  font-size: 0.76rem;
  color: #8C887B;
}

.demo-view-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: rgba(255, 255, 255, 0.07);
  padding: 0.2rem 0.3rem;
  border-radius: var(--portal-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.demo-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #B5B2A8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--portal-transition);
}

.demo-view-btn:hover {
  color: #FFFFFF;
}

.demo-view-btn.active {
  background-color: var(--portal-burgundy);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(139, 21, 56, 0.35);
}

.demo-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #E53E3E;
  background: rgba(229, 62, 62, 0.08);
  border: 1px solid rgba(229, 62, 62, 0.25);
  cursor: pointer;
  transition: all var(--portal-transition);
}

.demo-exit-btn:hover {
  background: rgba(229, 62, 62, 0.18);
  color: #FC8181;
  border-color: rgba(229, 62, 62, 0.45);
}

@media (max-width: 680px) {
  .portal-demo-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .demo-banner-left {
    justify-content: space-between;
    width: 100%;
  }

  .demo-banner-hint {
    display: none;
  }

  .demo-view-toggle {
    width: 100%;
    justify-content: center;
  }

  .demo-view-btn {
    flex: 1;
    justify-content: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.72rem;
  }

  .demo-banner-right {
    display: flex;
    justify-content: flex-end;
  }
}

/* User Dropdown Menu in Portal Header */
.portal-user-menu-container {
  position: relative;
}

.portal-user-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--portal-surface-subtle);
  border: 1px solid var(--portal-border);
  cursor: pointer;
  transition: all var(--portal-transition);
}

.portal-user-profile:hover,
.portal-user-profile:focus-visible {
  border-color: var(--portal-burgundy);
  box-shadow: 0 0 0 3px rgba(112, 0, 25, 0.12);
}

.portal-user-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

[dir="rtl"] .portal-user-text {
  text-align: right;
}

.portal-user-chevron {
  transition: transform var(--portal-transition);
}

.portal-user-menu-container.is-open .portal-user-chevron {
  transform: rotate(180deg);
}

.portal-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-md);
  box-shadow: var(--portal-shadow-xl);
  padding: 0.65rem 0;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all var(--portal-transition);
}

[dir="rtl"] .portal-user-dropdown {
  right: auto;
  left: 0;
}

.portal-user-menu-container.is-open .portal-user-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.portal-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem 0.75rem;
}

.portal-dropdown-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--portal-text-main);
  line-height: 1.2;
}

.portal-dropdown-email {
  font-size: 0.72rem;
  color: var(--portal-text-muted);
  line-height: 1.3;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 175px;
}

.portal-dropdown-divider {
  height: 1px;
  background: var(--portal-border);
  margin: 0.4rem 0;
}

.portal-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--portal-text-main);
  text-align: left;
  transition: all var(--portal-transition);
}

[dir="rtl"] .portal-dropdown-item {
  text-align: right;
}

.portal-dropdown-item:hover {
  background: var(--portal-surface-subtle);
  color: var(--portal-burgundy);
}

.portal-dropdown-item.is-signout {
  color: #E53E3E;
}

.portal-dropdown-item.is-signout:hover {
  background: rgba(229, 62, 62, 0.08);
  color: #C53030;
}

.portal-app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Instructors Studio & Modals: Strict LTR English Isolation */
#instructor-studio,
#instructor-review-modal,
#instructor-curriculum-modal,
#invite-trainee-modal,
#add-instructor-modal,
#edit-instructor-modal,
#instructor-trainee-dossier-modal,
#portal-change-photo-modal {
  direction: ltr !important;
  text-align: left !important;
}

#instructor-studio [dir="rtl"],
#instructor-review-modal [dir="rtl"],
#instructor-curriculum-modal [dir="rtl"],
#invite-trainee-modal [dir="rtl"],
#add-instructor-modal [dir="rtl"],
#edit-instructor-modal [dir="rtl"],
#instructor-trainee-dossier-modal [dir="rtl"],
#portal-change-photo-modal [dir="rtl"] {
  direction: ltr !important;
  text-align: left !important;
}

/* ==========================================================================
   Executive Side Tabs Navigation & Workspace Shell
   ========================================================================== */
.portal-workspace-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  margin-top: 1.5rem;
}

[dir="rtl"] .portal-workspace-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

.portal-side-nav {
  position: sticky;
  top: 1.5rem;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-md, 12px);
  padding: 0.75rem;
  box-shadow: var(--portal-shadow-sm);
  z-index: 5;
}

.side-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--portal-radius-sm, 8px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--portal-text-muted);
  font-family: var(--font-portal-primary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  text-decoration: none;
}

[dir="rtl"] .side-nav-tab {
  font-family: var(--font-portal-arabic);
  text-align: right;
  font-size: 0.82rem;
  padding: 0.7rem 0.75rem;
}

[dir="rtl"] .schedule-title,
[dir="rtl"] #trainee-overview-milestone-title,
[dir="rtl"] #trainee-overview-milestone-desc,
[dir="rtl"] .task-prompt-text,
[dir="rtl"] .submission-dossier-title {
  direction: ltr;
  text-align: start;
}

.side-nav-tab-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.side-nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke-width: 2.2;
}

.side-nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-nav-tab:hover {
  background: var(--portal-bg-hover);
  color: var(--portal-text-main);
  border-color: var(--portal-border-subtle);
}

.side-nav-tab.is-active {
  background: var(--portal-burgundy);
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(112, 0, 25, 0.22);
}

.side-nav-tab.is-active .side-nav-icon {
  stroke: #FFFFFF;
}

.side-nav-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--portal-bg-hover);
  color: var(--portal-text-muted);
  border: 1px solid var(--portal-border);
  flex-shrink: 0;
}

.side-nav-tab.is-active .side-nav-chip {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.35);
}

.side-nav-chip.highlight-gold {
  background: rgba(200, 149, 46, 0.18);
  color: var(--portal-gold-text);
  border-color: rgba(200, 149, 46, 0.35);
}

.side-nav-tab.is-active .side-nav-chip.highlight-gold {
  background: #C8952E;
  color: #FFFFFF;
  border-color: #C8952E;
}

/* Tab Content Panels */
.portal-tab-content-area {
  min-width: 0;
  flex: 1;
}

.portal-tab-panel {
  display: none;
}

.portal-tab-panel.is-active {
  display: block;
  animation: portalPanelFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   Attendance Register UI (Instructor & Trainee)
   ========================================================================== */
.attendance-register-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-md, 12px);
  padding: 1.5rem;
  box-shadow: var(--portal-shadow-sm);
  margin-bottom: 2rem;
}

.attendance-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--portal-border);
  margin-bottom: 1.25rem;
}

.attendance-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--portal-burgundy);
  background: rgba(112, 0, 25, 0.08);
  border: 1px solid rgba(112, 0, 25, 0.18);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.attendance-pills-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--portal-bg-hover);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--portal-border);
}

.attendance-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-portal-primary);
  font-size: 0.75rem;
  font-weight: 700;
  background: transparent;
  color: var(--portal-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.attendance-pill-btn:hover {
  background: #FFFFFF;
  color: var(--portal-text-main);
}

.attendance-pill-btn.is-selected.status-present {
  background: #1E6B47;
  color: #FFFFFF;
  border-color: #1E6B47;
}

.attendance-pill-btn.is-selected.status-late {
  background: #C8952E;
  color: #FFFFFF;
  border-color: #C8952E;
}

.attendance-pill-btn.is-selected.status-absent {
  background: #B3261E;
  color: #FFFFFF;
  border-color: #B3261E;
}

.attendance-pill-btn.is-selected.status-excused {
  background: #4B5563;
  color: #FFFFFF;
  border-color: #4B5563;
}

.attendance-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.15rem;
  background: var(--portal-bg-hover);
  border: 1px solid var(--portal-border);
  border-left: 3.5px solid var(--portal-burgundy);
  border-radius: var(--portal-radius-md, 8px);
  margin-top: 1rem;
}

[dir="rtl"] .attendance-summary-strip {
  border-left: 1px solid var(--portal-border);
  border-right: 3.5px solid var(--portal-burgundy);
}

/* ==========================================================================
   Mobile & Narrow Viewport Responsive Behavior (iPhone 13 Pro 390px Benchmark)
   ========================================================================== */
@media (max-width: 991px) {
  .portal-workspace-shell {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
  }

  .portal-side-nav {
    position: static;
    top: auto;
    padding: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .portal-side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav-list {
    flex-direction: row;
    gap: 0.45rem;
    white-space: nowrap;
    overflow-x: auto;
  }

  .side-nav-tab {
    flex: 0 0 auto;
    width: auto;
    padding: 0.55rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 999px;
  }

  .side-nav-tab .side-nav-chip {
    display: none;
  }
}



