/* ==========================================================================
   AistearLM - Dual-Mode Junior Infants Planning Dashboard CSS Design System
   ========================================================================== */

:root {
  /* Curated Palette - Irish Primary Education Heritage & Emerald Modernism */
  --primary-emerald: #059669;
  --primary-emerald-dark: #064e3b;
  --primary-emerald-hover: #047857;
  --primary-emerald-subtle: #ecfdf5;
  --emerald-border: #a7f3d0;

  --accent-gold: #f59e0b;
  --accent-gold-subtle: #fef3c7;
  --accent-gold-border: #fde68a;

  --purple-brand: #7c3aed;
  --purple-subtle: #f5f3ff;
  --purple-border: #ddd6fe;

  --blue-docs: #2563eb;
  --amber-slides: #d97706;

  --bg-slate: #f1f5f9;
  --card-bg: #ffffff;
  --surface-subtle: #f8fafc;
  
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --border-color: #e2e8f0;
  --border-focus: #10b981;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-pill: 9999px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-slate);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, .logo-icon, .btn, .mode-btn {
  font-family: 'Outfit', sans-serif;
}

.hidden {
  display: none !important;
}

/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
  color: white;
  padding: 1.25rem 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

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

.logo-icon {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.app-header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.subtitle {
  font-size: 0.85rem;
  color: #a7f3d0;
  margin-top: 0.2rem;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Mode Switcher */
.mode-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  gap: 0.25rem;
}

.mode-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #d1fae5;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mode-btn.active {
  background: #ffffff;
  color: var(--primary-emerald-dark);
  box-shadow: var(--shadow-sm);
}

.mode-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-gemini {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-cost {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-idle {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-running {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  animation: pulse 1.5s infinite;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ==========================================================================
   1. Form View Layout (2-Column Responsive Grid)
   ========================================================================== */
.main-layout {
  max-width: 1440px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 2rem;
  flex: 1;
  align-items: start;
}

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

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

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

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid #e2e8f0;
}

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

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

select, input[type="text"], textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
  background-color: #ffffff;
  transition: all 0.2s ease;
  line-height: 1.4;
}

select:focus, input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  background: var(--surface-subtle);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.checkbox-label {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  color: #334155;
  margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-emerald);
  cursor: pointer;
}

.quick-chips {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: var(--primary-emerald-subtle);
  color: var(--primary-emerald-dark);
  border-color: var(--emerald-border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  font-size: 1rem;
  padding: 0.9rem 1.25rem;
  margin-top: 0.75rem;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

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

/* Stepper */
.pipeline-stepper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.step-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  gap: 0.85rem;
  transition: all 0.25s ease;
}

.step-item.running {
  background: #fefce8;
  border-color: #fde047;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
}

.step-item.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.step-item.completed .step-status {
  color: #16a34a;
  font-weight: 700;
}

.step-item.error {
  background: #fef2f2;
  border-color: #fca5a5;
}

.step-item.error .step-status {
  color: #dc2626;
  font-weight: 700;
}

.step-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.step-info {
  flex: 1;
}

.step-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.step-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.step-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Results & Tabs */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.action-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.85rem;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.btn-action {
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-docs {
  background: var(--blue-docs);
  color: white;
}

.btn-docs:hover {
  background: #1d4ed8;
}

.btn-slides {
  background: var(--amber-slides);
  color: white;
}

.btn-slides:hover {
  background: #b45309;
}

.btn-drive {
  background: var(--primary-emerald);
  color: white;
}

.btn-drive:hover {
  background: var(--primary-emerald-hover);
}

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

/* Tabs */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  gap: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: var(--primary-emerald);
  border-bottom-color: var(--primary-emerald);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

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

/* Stations Grid */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.station-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 4px solid var(--primary-emerald);
}

.station-card h3 {
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 700;
}

.station-themes {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.theme-pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  background: #ecfdf5;
  color: #065f46;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.station-section {
  font-size: 0.82rem;
  line-height: 1.45;
}

.station-section strong {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

/* Gaeilge Grid */
.gaeilge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.phrase-card {
  background: #fdf4ff;
  border: 1px solid #f0abfc;
  border-radius: var(--radius-md);
  padding: 1rem;
}

.phrase-card h4 {
  color: #86198f;
  font-size: 1.05rem;
  font-weight: 700;
}

.phonetic {
  color: #a21caf;
  font-size: 0.8rem;
  font-style: italic;
}

.english-trans {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

/* ==========================================================================
   2. Conversational Chat Layout
   ========================================================================== */
.chat-layout {
  max-width: 1100px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 580px;
  padding: 0;
  overflow: hidden;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

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

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ecfdf5;
  border: 2px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-sm);
}

.chat-header-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.chat-header-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* Suggestion Pills */
.chat-suggestions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  white-space: nowrap;
}

.suggestion-chip {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.suggestion-chip:hover {
  background: var(--primary-emerald-subtle);
  color: var(--primary-emerald-dark);
  border-color: var(--emerald-border);
}

/* Messages Feed */
.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #f8fafc;
}

.message {
  display: flex;
  gap: 0.85rem;
  max-width: 85%;
  animation: fadeIn 0.25s ease;
}

.message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-bot {
  align-self: flex-start;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.message-bot .message-avatar {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
}

.message-user .message-avatar {
  background: #dbeafe;
  border: 1.5px solid #bfdbfe;
}

.message-content {
  background: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.message-user .message-content {
  background: #059669;
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.message-content p {
  margin: 0 0 0.5rem 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul, .message-content ol {
  margin: 0.5rem 0 0.5rem 1.25rem;
}

.message-content pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.82rem;
}

.chat-inline-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

/* Chat Input Form */
.chat-input-area {
  display: flex;
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  gap: 0.75rem;
  align-items: flex-end;
}

#chat-input {
  flex: 1;
  resize: none;
  padding: 0.75rem 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  outline: none;
  max-height: 120px;
}

#chat-input:focus {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.btn-send {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 10px;
  width: auto;
  margin-top: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: white;
  margin-top: auto;
}

/* ==========================================================================
   3. Modal & Export Hub Styles
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon {
  font-size: 1.6rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

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

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(85vh - 80px);
  overflow-y: auto;
}

.export-option-card {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
}

.export-option-card.highlight {
  border-color: var(--emerald-border);
  background: #f0fdf4;
}

.option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.option-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.export-option-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.mcp-action-row {
  display: flex;
  gap: 0.5rem;
}

.mcp-textarea {
  font-family: monospace;
  font-size: 0.78rem;
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  resize: vertical;
}

.oauth-info-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem;
}

.oauth-info-box h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.35rem;
}

.oauth-info-box p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   AUTHENTICATION & USER PROFILE DESIGN SYSTEM
   ========================================================================== */
.user-nav-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.5rem;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.btn-admin-nav {
  background: #f59e0b;
  color: #78350f;
  font-weight: 700;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.btn-admin-nav:hover {
  background: #d97706;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fee2e2;
}

/* ==========================================================================
   AUTHENTICATION OVERLAY & LOGIN/REGISTER MODALS
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #064e3b 0%, #062e24 45%, #091e18 100%);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  overflow-y: auto;
  position: fixed;
}

/* Ambient Floating Glow Elements */
.auth-ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.35;
}

.auth-glow-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #10b981 0%, rgba(16, 185, 129, 0) 70%);
  top: 10%;
  left: 20%;
  animation: floatOrb 8s ease-in-out infinite alternate;
}

.auth-glow-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #f59e0b 0%, rgba(245, 158, 11, 0) 70%);
  bottom: 10%;
  right: 20%;
  animation: floatOrb 10s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -30px) scale(1.1); }
}

/* Premium Auth Card */
.auth-card {
  background: #ffffff;
  width: 100%;
  max-width: 500px;
  border-radius: 20px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 40px rgba(5, 150, 105, 0.15);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-top: 3px solid #10b981;
  padding: 2.25rem;
  margin: auto;
  position: relative;
  z-index: 10;
  animation: authCardEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #a7f3d0;
  border-radius: 16px;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
  transition: transform 0.3s ease;
}

.auth-logo-badge:hover {
  transform: rotate(6deg) scale(1.05);
}

.auth-logo-emoji {
  font-size: 2rem;
  line-height: 1;
}

.auth-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 0.25rem;
  font-weight: 500;
}

.auth-curriculum-pill {
  display: inline-block;
  margin-top: 0.6rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}

/* Segmented Tab Bar */
.auth-tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid #e2e8f0;
}

.auth-tab {
  border: none;
  background: transparent;
  padding: 0.6rem 0.8rem;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.auth-tab:hover:not(.active) {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.5);
}

.auth-tab.active {
  background: #ffffff;
  color: #065f46;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Auth View Titles */
.auth-view-header {
  margin-bottom: 1.25rem;
}

.auth-view-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.auth-view-header p {
  font-size: 0.84rem;
  color: #64748b;
  margin-top: 0.2rem;
}

/* Form Groups & Inputs with Icons */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-leading-icon {
  position: absolute;
  left: 0.9rem;
  font-size: 1rem;
  pointer-events: none;
  color: #94a3b8;
  z-index: 2;
}

.form-control.with-icon {
  padding-left: 2.65rem;
}

.form-control.with-trailing {
  padding-right: 2.85rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 0.95rem;
  font-size: 0.92rem;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  background: #fafdfc;
}

.form-control::placeholder {
  color: #94a3b8;
  font-size: 0.88rem;
}

/* Password Toggle Eye Button */
.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  font-size: 1rem;
  color: #64748b;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.btn-toggle-password:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: scale(1.1);
}

/* Token Status Pill Embedded Inside Input */
.token-status-pill {
  position: absolute;
  right: 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  background: #f1f5f9;
  color: #64748b;
  pointer-events: none;
  z-index: 2;
  transition: all 0.2s ease;
}

.token-status-pill.valid {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.token-status-pill.invalid {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.form-row-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .form-row-dual {
    grid-template-columns: 1fr;
  }
}

/* Submit Button */
.btn-auth-submit {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 10px;
  margin-top: 0.4rem;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-auth-submit:active {
  transform: translateY(0) scale(0.99);
}

.btn-auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Error Messages with Shake Animation */
.auth-error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: errorShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes errorShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* Admin Quick Access Helper Box */
.auth-admin-helper {
  margin-top: 1.4rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.auth-admin-helper:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

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

.helper-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fef3c7;
  color: #b45309;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid #fde68a;
}

.helper-role-tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: #065f46;
}

.helper-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
}

.btn-autofill {
  background: #ffffff;
  border: 1.5px solid #059669;
  color: #065f46;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
}

.btn-autofill:hover {
  background: #ecfdf5;
  color: #047857;
  border-color: #047857;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
}

.btn-autofill:active {
  transform: translateY(0);
}

/* Footer Switch Link */
.auth-footer-switch {
  margin-top: 1.4rem;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 1.15rem;
}

.auth-footer-switch p {
  font-size: 0.85rem;
  color: #64748b;
}

.auth-footer-switch a {
  color: #059669;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-footer-switch a:hover {
  color: #047857;
  text-decoration: underline;
}

/* ==========================================================================
   ADMIN INVITES MODAL
   ========================================================================== */
.modal-card-wide {
  max-width: 840px;
}

.admin-create-box {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.admin-create-box h4 {
  color: #065f46;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.new-invite-alert {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  animation: authFadeUp 0.2s ease-out;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.invite-copy-group {
  display: flex;
  gap: 0.5rem;
}

.invites-history-section h4 {
  font-size: 1rem;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.table-responsive {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
}

.invites-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.invites-table th {
  background: #f8fafc;
  color: #475569;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.invites-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.invites-table tr:last-child td {
  border-bottom: none;
}

.status-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
}

.status-badge-used {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
}

.status-badge-expired {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
}


