/* ══════════════════════════════════════════════════════════════
   NaijaHumor Annotation Portal — Complete Design System v2
   Dark mode default · Light mode via .light-theme on body
   ══════════════════════════════════════════════════════════════ */

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

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Brand Palette — Premium Vibrant */
  --green:          #10b981;
  --green-dark:     #059669;
  --green-hover:    #047857;
  --green-light:    rgba(16, 185, 129, 0.15);
  --green-ring:     rgba(16, 185, 129, 0.3);
  --indigo:         #6366f1;
  --indigo-light:   rgba(99, 102, 241, 0.15);
  --amber:          #f59e0b;
  --amber-light:    rgba(245, 158, 11, 0.15);
  --red:            #ef4444;
  --red-light:      rgba(239, 68, 68, 0.15);
  --cyan:           #06b6d4;
  --cyan-light:     rgba(6, 182, 212, 0.15);

  /* Backgrounds — Premium Dark mode (default) */
  --bg-app:         #0a0f18;
  --bg-card:        rgba(21, 27, 43, 0.7);
  --bg-card-solid:  #151b2b;
  --bg-input:       rgba(13, 17, 28, 0.8);
  --bg-input-focus: rgba(26, 33, 52, 0.95);
  --bg-sidebar:     rgba(11, 15, 24, 0.85);
  --bg-hover:       rgba(32, 42, 65, 0.7);
  --bg-overlay:     rgba(5, 8, 16, 0.85);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inv:       #07090f;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.07);
  --border-strong:  rgba(255, 255, 255, 0.12);
  --border-focus:   var(--green);

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:      0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:      0 24px 60px rgba(0,0,0,0.6);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.25), 0 1px 4px rgba(0,0,0,0.15);
  --shadow-glow:    0 0 24px rgba(0, 168, 107, 0.15);

  /* Glass Effect */
  --glass:          blur(20px) saturate(180%);
  --glass-light:    blur(12px);

  /* Layout */
  --sidebar-w:      260px;
  --sidebar-collapsed: 72px;
  --radius-xs:      8px;
  --radius-sm:      12px;
  --radius-md:      16px;
  --radius-lg:      24px;
  --radius-xl:      32px;
  --transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Accent shorthands */
  --accent:         var(--green);
  --accent-dark:    var(--green-dark);
  --accent-hover:   var(--green-hover);
  --accent-light:   var(--green-light);
  --secondary:      var(--indigo);
}

/* ── Light Theme Override ──────────────────────────────────── */
body.light-theme {
  --bg-app:         #f0f4f8;
  --bg-card:        rgba(255, 255, 255, 0.85);
  --bg-card-solid:  #ffffff;
  --bg-input:       rgba(241, 245, 249, 0.9);
  --bg-input-focus: #ffffff;
  --bg-sidebar:     rgba(255, 255, 255, 0.92);
  --bg-hover:       rgba(241, 245, 249, 0.95);
  --bg-overlay:     rgba(15, 23, 42, 0.65);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --border:         rgba(0, 0, 0, 0.07);
  --border-strong:  rgba(0, 0, 0, 0.12);

  --shadow-card:    0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md:      0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-lg:      0 20px 50px rgba(0, 0, 0, 0.12);
  --shadow-glow:    0 0 24px rgba(0, 168, 107, 0.08);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

/* Subtle animated bg pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 10% -10%, rgba(0,168,107,0.04) 0%, transparent 60%),
              radial-gradient(ellipse 60% 60% at 90% 110%, rgba(99,102,241,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════════════════════════
   OVERLAYS & MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-overlay, rgba(10, 15, 26, 0.75));
  backdrop-filter: blur(8px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  animation: modalFadeIn 0.25s ease-out forwards;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  backdrop-filter: var(--glass);
  position: relative;
  z-index: 10001;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.help-modal-content {
  max-width: 750px;
}

.asset-modal-content {
  max-width: 850px;
}

.moment-modal-content {
  max-width: 1050px;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.scrollable-modal-body {
  max-height: 70vh;
}

/* Guide specific styles */
.guide-section {
  margin-bottom: 24px;
}
.guide-section h3 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}
.guide-section p, .guide-section li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}
.guide-section ul, .guide-section ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

/* Asset Library specific styles */
.asset-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 60vh;
  padding: 20px 24px;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.modal-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

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

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

.modal-tab-view {
  flex: 1;
  overflow-y: auto;
  padding-top: 8px;
}

.modal-snippets-list, .modal-moments-grid {
  max-height: none !important;
}

/* Moment Tagging Modal Layout (Split screen) */
.moment-modal-body-split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  height: 70vh;
  overflow: hidden;
  padding: 24px;
}

.canvas-col {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.moment-form-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-right: 8px;
  height: 100%;
  scrollbar-width: thin;
}

.canvas-container {
  position: relative;
  width: 100%;
  flex: 1;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
}

.canvas-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.drawing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.canvas-instructions {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg-overlay);
  backdrop-filter: blur(16px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
  backdrop-filter: var(--glass);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Login Card ───────────────────────────────────────────── */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: var(--glass);
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--green), var(--indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 32px rgba(0, 168, 107, 0.3);
  margin-bottom: 4px;
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.login-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.overlay-icon { font-size: 2rem; text-align: center; }
.overlay-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}
.overlay-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.65;
}
.overlay-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.overlay-note a { color: var(--accent); text-decoration: underline; }

/* Language Options */
.lang-options { display: flex; flex-direction: column; gap: 10px; }
.lang-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
  color: var(--text-primary);
}
.lang-option-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.lang-flag { font-size: 1.5rem; }
.lang-text { flex: 1; display: flex; flex-direction: column; }
.lang-text strong { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.lang-text small  { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.lang-arrow { color: var(--text-muted); font-size: 1rem; }

/* ══════════════════════════════════════════════════════════════
   APP SHELL — DASHBOARD LAYOUT
   ══════════════════════════════════════════════════════════════ */
#app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.dashboard-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  backdrop-filter: var(--glass);
  box-shadow: 2px 0 20px rgba(0,0,0,0.2);
  gap: 4px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-header .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green), var(--indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 168, 107, 0.25);
}

.sidebar-header .brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
  text-decoration: none;
  position: relative;
}

.sidebar-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke: currentColor;
  opacity: 0.8;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--green-light);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-link.active svg { opacity: 1; }

/* Active video badge in sidebar */
.sidebar-active-video {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 10px;
  align-items: center;
}

.active-video-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  overflow: hidden;
  flex-shrink: 0;
}

.active-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.active-video-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.active-video-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.active-video-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0 4px;
}

.control-row label {
  text-transform: none;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-secondary);
}

.sidebar-lang-select {
  width: 100px;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.sidebar-theme-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 4px 9px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.82rem;
  color: var(--text-primary);
}

.sidebar-theme-btn:hover { border-color: var(--accent); }

/* Sidebar User Info */
.sidebar-user-panel {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-info { display: flex; align-items: center; gap: 10px; padding: 0 4px; }

.sidebar-user-panel .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-hover);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user-panel .user-meta { display: flex; flex-direction: column; text-align: left; }
.sidebar-user-panel .user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-user-panel .user-role {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Language badge shown in user profile for annotators */
.user-lang-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  margin-top: 3px;
  display: inline-block;
}

/* Locked language badge shown instead of dropdown for annotators */
.lang-locked-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--green-light);
  border: 1px solid rgba(0, 168, 107, 0.25);
  border-radius: 20px;
  cursor: default;
  user-select: none;
}

.admin-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 0 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-light);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.admin-mode-btn:hover { background: rgba(245,158,11,0.15); }

/* Google Sign-in Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  background: #fff;
  color: #111;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 20px 24px;
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
  .sidebar { width: var(--sidebar-collapsed); padding: 20px 10px; }
  .sidebar-header .brand-name,
  .sidebar-link span,
  .sidebar-controls,
  .sidebar-user-panel .user-meta,
  .sidebar-user-panel #logout-btn,
  .sidebar-active-video { display: none; }
  .main-content { margin-left: var(--sidebar-collapsed); padding: 20px 16px; }
}

/* ── View Panels ─────────────────────────────────────────── */
.view-panel {
  display: none;
  flex-direction: column;
  gap: 22px;
  animation: fadeIn 0.25s ease;
  height: 100%;
  overflow: hidden;
}
.view-panel.active { display: flex; }

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

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.page-sub {
  font-size: 0.87rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  backdrop-filter: var(--glass-light);
  transition: border-color var(--transition);
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   VIDEO LIBRARY PANEL
   ══════════════════════════════════════════════════════════════ */
.add-video-card { border-color: rgba(0, 168, 107, 0.15); }

.add-video-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.yt-id-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  font-size: 0.875rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.yt-id-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--green-ring); }

.add-video-btn {
  height: 42px;
  padding: 0 20px;
  white-space: nowrap;
  align-self: flex-end;
}

/* YouTube Preview */
.yt-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.2s ease;
}

.yt-preview-thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.yt-preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.yt-preview-id {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Videos Grid */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.video-card-item {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.video-card-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.video-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #000;
  display: block;
}

.video-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.video-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.video-card-actions {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.videos-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--text-muted);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   WORKSPACE PANEL
   ══════════════════════════════════════════════════════════════ */
/* Empty state */
.workspace-empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.workspace-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 380px;
}

.workspace-empty-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 8px;
}

.workspace-empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.workspace-empty-sub {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Workspace Top Bar */
.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 16px;
  backdrop-filter: var(--glass-light);
}

.workspace-video-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ws-thumb {
  width: 56px;
  height: 40px;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.ws-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ws-video-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

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

/* ── Workspace Grid Layout (2 Column) */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(400px, 1.2fr) minmax(350px, 1fr);
  gap: 24px;
  height: 100%;
  overflow: hidden;
}

@media (max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; overflow-y: auto; }
}

/* ── Player Column ───────────────────────────────────────── */
.ws-player-col {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ws-player-col::-webkit-scrollbar { width: 4px; }
.ws-player-col::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Annotation Column ───────────────────────────────────── */
.ws-annotation-col {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ws-annotation-col::-webkit-scrollbar { width: 4px; }
.ws-annotation-col::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Player Card */
.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-frame-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  overflow: hidden;
}

#yt-player-container,
.iframe-player {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block;
}

/* Capture Flash */
.capture-flash {
  position: absolute;
  inset: 0;
  background: white;
  z-index: 10;
  pointer-events: none;
  animation: flash 0.4s ease forwards;
}

@keyframes flash {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Player Info Bar */
.player-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-solid);
  gap: 12px;
}

.player-time-display {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-time-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.player-controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-play-btn {
  padding: 5px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

.player-ctrl-btn {
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: var(--radius-xs);
}

.player-speed-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.speed-select {
  width: auto;
  padding: 4px 8px;
  font-size: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

/* Timeline Strip */
.timeline-strip {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-track {
  height: 44px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    90deg,
    rgba(0,168,107,0.05),
    rgba(0,168,107,0.05) 1px,
    transparent 1px,
    transparent 12px
  );
}

.timeline-region {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0,168,107,0.12);
  border-left: 2.5px solid var(--accent);
  border-right: 2.5px solid var(--accent);
  transition: left 0.1s ease, right 0.1s ease;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 4px rgba(255,255,255,0.5);
  z-index: 2;
  pointer-events: none;
  transition: left 0.1s linear;
}

.timeline-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.time-label { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; }
.time-label.right { flex-direction: row-reverse; }
.time-badge {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.timeline-buttons { display: flex; gap: 6px; }

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
}

/* ── Waveform Visualizer ─────────────────────────────────── */
.waveform-section {
  border-top: 1px solid var(--border);
  background: var(--bg-app);
  padding: 10px 16px;
}

.waveform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.waveform-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.waveform-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
}

.waveform-container {
  position: relative;
  height: 52px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.waveform-clip-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0, 168, 107, 0.08);
  border-left: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
  pointer-events: none;
  transition: left 0.1s ease, right 0.1s ease;
}

.waveform-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  transition: left 0.1s linear;
}

/* Player Actions */
.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
}

.player-action-btn {
  flex: 1 1 auto;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* ── Annotation Column ───────────────────────────────────── */
.ws-annotation-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 10px;
}

/* Capture Badge */
.capture-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timestamp-badge {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  padding: 2px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
}

/* Canvas Bounding Box Editor */
.canvas-card { gap: 14px; }

.canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 1.5px solid var(--border);
}

.canvas-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.drawing-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  cursor: crosshair;
}

.canvas-instructions {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: rgba(255,255,255,0.8);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 100px;
  pointer-events: none;
  white-space: nowrap;
}

.canvas-meta {
  display: flex;
  gap: 14px;
}

.canvas-meta-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 160px;
  justify-content: flex-end;
}

.status-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* ── Capture Tab Switcher ──────────────────────────────────── */
.capture-tabs {
  display: flex;
  gap: 6px;
  padding: 0 2px 4px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 4px;
}

.capture-tab {
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.capture-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.capture-tab.active {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.capture-view { display: none; }
.capture-view.active { display: block; }

/* ── Clip Preview ────────────────────────────────────────────── */
.clip-preview-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  overflow: hidden;
  position: relative;
}

.clip-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: var(--text-muted);
}

.clip-placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.clip-preview-placeholder p {
  font-size: 0.78rem;
  text-align: center;
  max-width: 200px;
  line-height: 1.5;
}

.clip-preview-player {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.clip-preview-player iframe {
  flex: 1;
  display: block;
  border: none;
}

.clip-preview-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.75);
  justify-content: center;
}

.clip-preview-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.clip-preview-dur {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  margin-left: 4px;
}

/* ── Humor Source Chip Selector ─────────────────────────────── */
.humor-source-section {
  background: var(--bg-hover);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.humor-source-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  display: block;
}

.humor-source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.humor-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.humor-source-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.humor-source-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 168, 107, 0.35);
}

/* Visual Moments Grid */
.moments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.moment-thumb {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: var(--transition);
}

.moment-thumb:hover { border-color: var(--accent); }

.moment-thumb img { width: 100%; height: 100%; object-fit: cover; }

.moment-thumb-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 0.6rem;
  background: rgba(0,0,0,0.7);
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
}

.moment-thumb-time {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0,168,107,0.8);
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
}

.moment-thumb-box {
  position: absolute;
  border: 1.5px solid #ff3838;
  background: rgba(255, 56, 56, 0.15);
  pointer-events: none;
}

/* ── Right Action Sidebar ────────────────────────────────── */
.ws-action-sidebar {
  flex: 0 0 var(--right-width, 200px);
  width: var(--right-width, 200px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ws-action-sidebar::-webkit-scrollbar { width: 3px; }
.ws-action-sidebar::-webkit-scrollbar-thumb { background: var(--border); }

.action-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-app);
}

.action-sidebar-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.action-sidebar-section {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-section-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-bottom: 4px;
}

/* Action Timestamp Display */
.action-timestamp-display {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
}

.action-ts-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.action-ts-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.action-ts-clip-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.action-ts-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.action-ts-row code {
  font-size: 0.72rem;
}

.action-ts-row.accent { color: var(--accent); font-weight: 600; }
.action-ts-row.accent code { color: var(--accent); }

/* Action Buttons */
.action-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  position: relative;
}

.action-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Compact Mode Overrides for Right Sidebar */
.compact-right-sidebar .ws-action-sidebar {
  align-items: center;
}

.compact-right-sidebar .action-sidebar-header {
  padding: 10px 4px;
  text-align: center;
  width: 100%;
}

.compact-right-sidebar .action-sidebar-title {
  font-size: 0.58rem;
  letter-spacing: 0.02em;
}

.compact-right-sidebar .action-sidebar-section {
  padding: 10px 4px;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.compact-right-sidebar .action-section-label {
  font-size: 0.55rem;
  text-align: center;
  padding-bottom: 2px;
}

.compact-right-sidebar .action-timestamp-display {
  padding: 6px 4px;
  width: calc(100% - 8px);
}

.compact-right-sidebar .action-ts-label {
  font-size: 0.55rem;
}

.compact-right-sidebar .action-ts-value {
  font-size: 0.95rem;
}

.compact-right-sidebar .action-ts-clip-info {
  display: none; /* Hide sub-timestamps when compact to save vertical space */
}

.compact-right-sidebar .action-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-xs);
}

.compact-right-sidebar .action-btn span {
  display: none !important;
}

.compact-right-sidebar .shortcuts-section {
  display: none !important;
}

.action-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.action-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,168,107,0.3);
}

.action-btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border-color: var(--border);
}
.action-btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.action-btn-accent {
  background: var(--indigo-light);
  color: var(--indigo);
  border-color: rgba(99,102,241,0.2);
}
.action-btn-accent:hover {
  background: rgba(99,102,241,0.18);
}

.action-btn-submit {
  background: linear-gradient(135deg, var(--green), #059669);
  color: #fff;
  border-color: var(--green);
}
.action-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,168,107,0.35);
}

/* Shortcuts Section */
.shortcuts-section { background: var(--bg-app); }

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
  color: var(--text-primary);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   SNIPPETS LIST
   ══════════════════════════════════════════════════════════════ */
.snippets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.snippets-list::-webkit-scrollbar { width: 3px; }
.snippets-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.snippet-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
  cursor: pointer;
}

.snippet-item:hover { border-color: var(--accent); background: var(--bg-hover); }

.snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
}

.snippet-time {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.snippet-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  font-style: italic;
}

.snippet-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════════════════════ */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

input[type=text],
input[type=email],
input[type=password],
textarea,
select {
  width: 100%;
  padding: 9px 13px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--green-ring);
}

/* ASR Draft */
.asr-draft-box {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--text-secondary);
  min-height: 44px;
  line-height: 1.6;
}

/* Soft Keyboard */
.keyboard-anchor-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.soft-keyboard {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-md);
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.key-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 7px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.key-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px var(--green-ring);
}

.key-btn:active { transform: translateY(1px); }

/* ══════════════════════════════════════════════════════════════
   TAXONOMY CHIPS
   ══════════════════════════════════════════════════════════════ */
.modality-grid {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.tag-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tag-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.tag-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.tag-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.tag-chip.selected { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tag-chip.language-specific.selected { background: var(--indigo-light); border-color: var(--indigo); color: var(--indigo); }

/* ══════════════════════════════════════════════════════════════
   SUBMIT ROW
   ══════════════════════════════════════════════════════════════ */
.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.intensity-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.intensity-group label { text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.06em; }

.intensity-slider {
  width: 90px;
  accent-color: var(--accent);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.intensity-slider:focus { box-shadow: none; }

.intensity-dots {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  min-width: 55px;
}

.btn-submit { padding: 10px 20px; font-size: 0.88rem; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,168,107,0.35);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }

.btn-accent {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}
.btn-accent:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.15); }

.btn-sm { padding: 5px 12px; font-size: 0.76rem; }
.btn-xs { padding: 3px 8px; font-size: 0.7rem; border-radius: var(--radius-xs); }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pending   { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-ready     { background: rgba(0,168,107,0.15);  color: var(--green); }
.badge-completed { background: rgba(99,102,241,0.15); color: var(--indigo); }
.badge-failed    { background: rgba(239,68,68,0.15);  color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 10px 14px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
  background: var(--bg-app);
}

.data-table td {
  padding: 11px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.table-empty { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 32px; }

/* ══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════════════════════════════ */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 900px) { .metrics-row { grid-template-columns: repeat(2, 1fr); } }

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  backdrop-filter: var(--glass-light);
}

.metric-card.accent { border-color: rgba(0,168,107,0.25); box-shadow: var(--shadow-glow); }

.metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.metric-card.accent .metric-value { color: var(--accent); }

/* Admin Sub-Tabs */
.admin-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg-app);
  padding: 0 20px;
}

.admin-tab {
  padding: 12px 18px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1.5px;
  white-space: nowrap;
}

.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.admin-tab-panel { padding: 24px; display: block; }

.tab-panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab-panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 800px) { .admin-form-grid { grid-template-columns: 1fr; } }

.admin-add-user-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.admin-add-user-btns {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 1px;
}

/* ══════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════ */
.text-muted    { color: var(--text-muted); }
.text-sm       { font-size: 0.82rem; }
.mt-2          { margin-top: 8px; }
.btn-lg        { padding: 12px 24px; font-size: 0.95rem; }
.empty-icon    { font-size: 2.5rem; margin-bottom: 4px; }
.danger        { --border: rgba(239,68,68,0.2); color: var(--red); }

/* Interactive Admin/Annotator Badges & Table Selects */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.role-badge.inactive {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  opacity: 0.6;
}

.role-badge.inactive:hover {
  opacity: 1;
  border-color: var(--text-secondary);
}

.role-badge.active.admin {
  background: rgba(99, 102, 241, 0.2);
  color: var(--indigo);
  border: 1.5px solid var(--indigo);
}

.role-badge.active.admin:hover {
  background: rgba(99, 102, 241, 0.3);
}

.role-badge.active.annotator {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green);
  border: 1.5px solid var(--green);
}

.role-badge.active.annotator:hover {
  background: rgba(16, 185, 129, 0.3);
}

.table-lang-select {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  padding: 3px 6px !important;
  font-size: 0.8rem !important;
  outline: none !important;
  cursor: pointer;
  transition: var(--transition);
}

.table-lang-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--green-ring) !important;
}
