/* ==========================================================================
   Open Scholars - Core Minimalist Design System
   "Empowering Ideas. Enabling Futures."
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400;1,600;1,700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Minimalist Monochromatic & Editorial Color Palette */
  --primary: #0f172a;           /* Crisp Obsidian */
  --primary-hover: #1e293b;
  --primary-light: #f1f5f9;
  --primary-accent: #4338ca;    /* Subtle Indigo Accent */

  --secondary: #0f172a;
  --accent-gold: #b45309;
  --accent-gold-light: #fef3c7;
  --accent-emerald: #047857;
  --accent-rose: #be123c;

  /* Surfaces & Backgrounds */
  --bg-app: #f8fafc;
  --surface-card: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-muted: #f1f5f9;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #0f172a;

  /* Typography */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevation & Shadows - Subtle & Refined */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.02);

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

p {
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 2rem;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-tagline-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.25px;
  display: block;
}

.nav-user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-meta-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.user-meta-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Scholar Verified Tag */
.scholar-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Buttons & Badges (Minimalist)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.99);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--surface-subtle);
  border-color: #cbd5e1;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--primary);
  background-color: var(--surface-subtle);
}

.btn-gold {
  background: var(--accent-gold);
  color: white;
}
.btn-gold:hover {
  background: #92400e;
}

.btn-success {
  background-color: #059669;
  color: white;
  border-color: #047857;
}
.btn-success:hover {
  background-color: #047857;
  border-color: #065f46;
}

.btn-danger {
  background-color: #fee2e2;
  color: var(--accent-rose);
  border-color: #fecaca;
}
.btn-danger:hover {
  background-color: #fecaca;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
}

.btn-block {
  width: 100%;
}

#nav-guest {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-admin-quick {
  width: 33px;
  height: 33px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-admin-quick:hover {
  background: var(--surface-subtle);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.btn-admin-quick:active {
  transform: scale(0.96);
}

.btn-admin-quick svg {
  transition: transform var(--transition-fast);
}

.btn-admin-quick:hover svg {
  transform: scale(1.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-student {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border-color);
}

.badge-admin {
  background: #0f172a;
  color: #ffffff;
}

.badge-type {
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-subject {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.status-pill {
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-review {
  background: #f1f5f9;
  color: #475569;
}
.status-review .status-dot { background: #94a3b8; }

.status-assessed {
  background: #eff6ff;
  color: #1d4ed8;
}
.status-assessed .status-dot { background: #3b82f6; }

.status-shortlisted {
  background: #fefce8;
  color: #854d0e;
}
.status-shortlisted .status-dot { background: #eab308; }

.status-selected {
  background: #ecfdf5;
  color: #047857;
}
.status-selected .status-dot { background: #10b981; }

.status-awarded {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.status-awarded .status-dot { background: #d97706; }

/* ==========================================================================
   Cards & Layout Elements
   ========================================================================== */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition-fast);
}

.card-header-clean {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }
.text-gold { color: var(--accent-gold); }
.font-semibold { font-weight: 600; }

/* ==========================================================================
   Public Landing Page
   ========================================================================== */
.landing-view {
  display: none;
}
.landing-view.active {
  display: block;
}

.landing-hero {
  max-width: 1100px;
  margin: 4rem auto 2rem;
  text-align: center;
  padding: 0 1.5rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.25rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.hero-title span {
  color: var(--primary-accent);
}

.hero-subtitle {
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 4rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: white;
  overflow: hidden;
}

.metric-item {
  padding: 1.5rem;
  text-align: center;
  border-right: 1px solid var(--border-color);
}
.metric-item:last-child {
  border-right: none;
}
.metric-item strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}
.metric-item span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Workflow Section */
.workflow-section {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.workflow-card-main {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.workflow-section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.workflow-section-header h2 {
  font-size: 1.75rem;
  margin: 0.5rem 0;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.workflow-step {
  border-left: 2px solid var(--border-color);
  padding-left: 1rem;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary-accent);
  margin-bottom: 0.5rem;
}

.workflow-step h4 {
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
}

.workflow-step p {
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* Subjects Section */
.landing-subjects-section {
  max-width: 1100px;
  margin: 3rem auto 5rem;
  padding: 0 1.5rem;
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title-wrap h2 {
  font-size: 1.75rem;
}

.landing-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.landing-subject-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.landing-subject-card:hover {
  border-color: #94a3b8;
  transform: translateY(-2px);
}

.landing-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.landing-subject-card h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}

.landing-subject-card p {
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
  min-height: 48px;
}

.landing-card-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Modals & OTP Flow (Minimalist & Professional)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}
.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: min(92vh, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-card.modal-lg {
  max-width: 820px;
}

.modal-card.modal-xl {
  max-width: 1020px;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: #ffffff;
}

.modal-header h3 {
  font-size: 1.125rem;
  margin: 0;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--surface-subtle);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

/* Quick Rubric Score Presets */
.rubric-presets-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.rubric-preset-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.rubric-preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-subtle);
}

/* Decision & Approval Box in Assessment Modal */
.assess-decision-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.125rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.assess-decision-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.quick-approve-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all var(--transition-fast);
}

/* Unified Auth Tabs in Modal (Scholar vs Admin) */
.auth-role-tabs {
  display: flex;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: 1.25rem;
  gap: 4px;
}

.auth-role-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.auth-role-tab.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.auth-role-tab:hover:not(.active) {
  color: var(--text-main);
}

.admin-cred-hint {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-cred-hint strong {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-control {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast);
}
.form-control:focus {
  border-color: var(--primary);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.select-control {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-main);
  outline: none;
}

/* Search Box */
.search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box-wrap svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
}
.search-box-wrap input {
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  background: white;
  width: 240px;
  transition: border-color var(--transition-fast);
}
.search-box-wrap input:focus {
  border-color: var(--primary);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 280px;
  animation: toastSlide 0.2s ease-out;
}

.toast.toast-error {
  background: #991b1b;
}

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

.toast-title {
  font-weight: 600;
}
.toast-msg {
  font-size: 0.75rem;
  color: #cbd5e1;
}
.toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

/* ==========================================================================
   Netlify Injected Badge & Branding Suppression
   ========================================================================== */
#nl-badge,
.nl-badge,
[id*="nl-badge"],
[class*="nl-badge"],
[id^="nl-"],
a[href*="netlify.com"],
a[href*="netlify.app"],
iframe[src*="netlify"],
[data-netlify-badge],
.netlify-badge,
#netlify-badge,
[class*="netlify-badge"],
[id*="netlify-badge"],
netlify-drawer,
#netlify-drawer {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  position: absolute !important;
  z-index: -9999 !important;
}

/* ==========================================================================
   Password Input with Visibility Toggle & Scholar Auth Tabs
   ========================================================================== */
.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrap .form-control {
  padding-right: 2.75rem;
}

.btn-toggle-password {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.btn-toggle-password:hover {
  color: var(--text-main);
}

/* Scholar Auth Tabs */
.auth-nav-tabs {
  display: flex;
  background: var(--surface-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  gap: 0.25rem;
}

.auth-nav-tab {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-nav-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Submissions Ledger Table & View Mode Toggle */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}

.data-table th {
  background: var(--surface-subtle);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

.view-mode-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-mode-toggle-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ==========================================================================
   Mobile Navigation & Drawer Architecture
   ========================================================================== */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.mobile-nav-toggle:hover {
  background: var(--surface-subtle);
  border-color: var(--primary);
}

.mobile-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}
.mobile-sidebar-close:hover {
  color: var(--text-main);
  background: var(--surface-subtle);
}

.sidebar-header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 104;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-locked {
  overflow: hidden !important;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-metrics {
    max-width: 100%;
  }
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  /* Prevent side-scrolling */
  html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
  }

  /* Navigation Bar */
  .site-navbar {
    padding: 0.625rem 1rem;
  }

  .nav-container {
    gap: 0.5rem;
  }

  .brand-logo {
    font-size: 1.0625rem;
    gap: 0.5rem;
  }

  .brand-tagline-sub {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    display: block;
  }

  #nav-guest {
    gap: 0.375rem;
  }

  #nav-guest .btn {
    padding: 0.375rem 0.65rem;
    font-size: 0.75rem;
  }

  #nav-user {
    gap: 0.5rem;
  }

  .user-meta-email {
    display: none !important;
  }

  .user-meta-name {
    font-size: 0.8125rem;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Public Landing Page */
  .landing-hero {
    margin: 2rem auto 1.5rem;
    padding: 0 1rem;
  }

  .hero-pill {
    font-size: 0.6875rem;
    padding: 0.3rem 0.65rem;
    margin-bottom: 1.25rem;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }

  .hero-title {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
    line-height: 1.25;
    margin-bottom: 1rem;
    word-break: normal;
    overflow-wrap: normal;
  }

  .hero-subtitle {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 auto 1.5rem;
    padding: 0 0.25rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 2rem;
    gap: 0.65rem;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    border-radius: var(--radius-md);
  }

  .metric-item {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
  }

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

  .metric-item strong {
    font-size: 1.25rem;
  }

  /* Workflow Timeline */
  .workflow-section {
    margin: 2rem auto;
    padding: 0 1rem;
  }

  .workflow-card-main {
    padding: 1.25rem;
  }

  .workflow-section-header {
    margin-bottom: 1.75rem;
  }

  .workflow-section-header h2 {
    font-size: 1.35rem;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .workflow-step {
    padding-left: 0.875rem;
  }

  /* Subjects / Disciplines Showcase */
  .landing-subjects-section {
    margin: 2rem auto 3rem;
    padding: 0 1rem;
  }

  .section-title-wrap {
    margin-bottom: 1.5rem;
  }

  .section-title-wrap h2 {
    font-size: 1.35rem;
  }

  .landing-subjects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .landing-subject-card {
    padding: 1.25rem;
  }

  .landing-subject-card p {
    min-height: auto;
    margin-bottom: 1rem;
  }

  /* Modals on Mobile Devices (Scrollable Bottom Sheet / Centered Card) */
  .modal-overlay {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .modal-card,
  .modal-card.modal-lg,
  .modal-card.modal-xl {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15) !important;
  }

  .modal-header {
    padding: 1rem 1.25rem;
    flex-shrink: 0;
  }

  .modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }

  .modal-footer {
    padding: 0.875rem 1.25rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
    min-width: 120px;
    justify-content: center;
  }

  /* Toast Notifications */
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .site-navbar {
    padding: 0.5rem 0.65rem;
  }
  .nav-container {
    width: 100%;
    max-width: 100%;
    gap: 0.25rem;
  }
  .brand-logo {
    font-size: 0.92rem;
    gap: 0.35rem;
    flex-shrink: 0;
  }
  .brand-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
  }
  .brand-icon svg {
    width: 15px;
    height: 15px;
  }
  #nav-guest {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
  }
  #nav-guest .btn {
    padding: 0.3rem 0.45rem;
    font-size: 0.72rem;
    white-space: nowrap;
  }
  #nav-guest .btn svg {
    display: none !important;
  }
  .btn-admin-quick {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  #nav-role-badge {
    display: none !important;
  }

  .site-navbar {
    padding: 0.45rem 0.5rem;
  }

  .modal-overlay {
    padding: 0;
  }

  .modal-card,
  .modal-card.modal-lg,
  .modal-card.modal-xl {
    max-height: 95vh !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .modal-body {
    padding: 1rem;
  }
}

@media (max-width: 360px) {
  .brand-logo {
    font-size: 0.85rem;
  }
  #nav-guest .btn {
    padding: 0.25rem 0.35rem;
    font-size: 0.68rem;
  }
}



