/* StoryTime Design System & Aesthetics
   Theme: Mythic Codex / Modern Enchanted
   Google Fonts: Cinzel, Lora, Inter
*/

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Inter:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  /* Color Tokens - Midnight Realm (Default) */
  --bg-primary: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-elevated: #1a243d;
  --bg-card: rgba(26, 36, 61, 0.75);
  --bg-glass: rgba(19, 27, 46, 0.85);
  
  --border-color: rgba(212, 175, 55, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(245, 158, 11, 0.4);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-gold: #f59e0b;
  --text-gold-light: #fef3c7;

  --accent-gold: #d97706;
  --accent-gold-glow: #f59e0b;
  --accent-violet: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-ruby: #ef4444;

  --badge-victory: #10b981;
  --badge-defeat: #ef4444;
  --badge-neutral: #8b5cf6;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.25);

  --font-display: 'Cinzel', serif;
  --font-body: 'Lora', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s ease;
}

/* Parchment Theme Override */
[data-theme="parchment"] {
  --bg-primary: #fbf5e8;
  --bg-surface: #f3e9d2;
  --bg-surface-elevated: #e8d9bc;
  --bg-card: rgba(243, 233, 210, 0.85);
  --bg-glass: rgba(251, 245, 232, 0.92);

  --border-color: rgba(139, 90, 43, 0.3);
  --border-subtle: rgba(139, 90, 43, 0.15);
  --border-glow: rgba(180, 83, 9, 0.35);

  --text-primary: #2d241e;
  --text-secondary: #5c4d41;
  --text-muted: #8c786a;
  --text-gold: #b45309;
  --text-gold-light: #78350f;

  --accent-gold: #b45309;
  --accent-gold-glow: #d97706;
  --accent-violet: #6d28d9;
  --accent-cyan: #0284c7;

  --shadow-sm: 0 2px 8px rgba(80, 50, 20, 0.08);
  --shadow-md: 0 8px 24px rgba(80, 50, 20, 0.14);
  --shadow-lg: 0 16px 36px rgba(80, 50, 20, 0.2);
  --shadow-glow: 0 0 20px rgba(180, 83, 9, 0.2);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ui);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  background-image: 
    radial-gradient(ellipse at top, rgba(217, 119, 6, 0.08) 0%, transparent 60%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* App Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 8px var(--accent-gold-glow));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
}

.nav-item {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background: rgba(245, 158, 11, 0.12);
}

.nav-item.active {
  color: var(--text-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

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

/* User Badge & Avatar */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.user-role-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-admin {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-author {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-reader {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b45309 100%);
  color: #ffffff;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color);
}

.btn-outline {
  background: transparent;
  color: var(--text-gold);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-gold-glow);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: var(--accent-ruby);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-gold);
  border-color: var(--border-color);
}

/* System Initialization Notice */
.system-alert-banner {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-gold-light);
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 3.5rem 1.5rem 3rem;
  position: relative;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--text-gold);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 40%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
}

[data-theme="parchment"] .hero-title {
  background: linear-gradient(135deg, #2d241e 0%, #78350f 50%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* Search and Filters */
.library-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-gold-glow);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.genre-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.genre-pill {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.genre-pill:hover, .genre-pill.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-gold-glow);
  color: var(--text-gold);
}

/* Story Cards Grid */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  position: relative;
}

.story-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold-glow);
  box-shadow: var(--shadow-glow);
}

.story-card-banner {
  height: 120px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  background-size: cover;
  background-position: center;
}

.banner-parchment {
  background: linear-gradient(135deg, #2b1f14 0%, #4a3525 60%, #8b5a2b 100%);
}

.banner-cyber {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #065f46 100%);
}

.banner-mystic {
  background: linear-gradient(135deg, #18181b 0%, #3b0764 60%, #4c0519 100%);
}

.story-genre-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.story-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.story-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.story-card-author {
  font-size: 0.85rem;
  color: var(--text-gold);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.story-card-summary {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.story-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.825rem;
  color: var(--text-muted);
}

.story-card-actions {
  margin-top: 1rem;
}

/* ============================================================
   READER EXPERIENCE
   ============================================================ */
.reader-wrapper {
  max-width: 820px;
  margin: 0 auto;
}

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

.reader-book-info h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-gold);
}

.reader-controls-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reader-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  backdrop-filter: blur(16px);
  animation: fadeIn 0.4s ease-out;
}

.reader-scene-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.reader-scene-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.reader-scene-content {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--text-primary);
  margin-bottom: 2.5rem;
  white-space: pre-line;
}

/* End Scene Celebration Banner */
.endpoint-banner {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.endpoint-victory {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.endpoint-defeat {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.endpoint-neutral {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

/* Choices Hub */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.choices-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.choice-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
  font-family: var(--font-body);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.choice-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-gold);
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.choice-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-gold-glow);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.choice-btn:hover::before {
  transform: scaleY(1);
}

.choice-glyph {
  font-size: 1.25rem;
  color: var(--text-gold);
  flex-shrink: 0;
}

/* Reader Toolbar & History Drawer */
.reader-footer {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.journey-log {
  margin-top: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.journey-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.journey-pill {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.journey-pill.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-gold);
  color: var(--text-gold);
  font-weight: 600;
}

/* ============================================================
   AUTHOR STUDIO & VISUAL STORY GRAPH
   ============================================================ */
.author-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.author-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.studio-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  min-height: 680px;
}

@media (max-width: 960px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

.studio-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  max-height: 750px;
}

.scene-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scene-item {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scene-item:hover, .scene-item.active {
  border-color: var(--accent-gold-glow);
  background: var(--bg-surface-elevated);
}

.scene-item.active {
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.scene-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.studio-editor {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-gold-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 180px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Visual Graph Canvas */
.graph-viewport {
  width: 100%;
  height: 520px;
  background: #060911;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.graph-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
}

.graph-node {
  cursor: pointer;
  transition: filter var(--transition-fast);
}

.graph-node:hover {
  filter: drop-shadow(0 0 8px var(--accent-gold-glow));
}

/* ============================================================
   ADMIN CONSOLE
   ============================================================ */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-gold);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.data-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.data-table th, .data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-surface);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 600;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-gold);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideIn 0.3s ease-out;
}

.toast-success {
  border-color: var(--accent-emerald);
}

.toast-error {
  border-color: var(--accent-ruby);
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   PASSCODE & EMAIL CONFIGURATION STYLES
   ============================================================ */
.passcode-input {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2rem;
  letter-spacing: 0.35em;
  text-align: center;
  font-weight: 700;
  color: var(--text-gold);
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  width: 100%;
  outline: none;
  transition: all var(--transition-fast);
}

.passcode-input:focus {
  border-color: var(--accent-gold-glow);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.email-config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.email-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 760px;
  margin: 1.25rem auto 0 auto;
}

.email-server-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.test-console-box {
  background: #050811;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: #a7f3d0;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-top: 0.75rem;
}

.badge-unverified {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.auth-error-alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #fca5a5;
  margin-bottom: 1.25rem;
  line-height: 1.4;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.auth-notice-alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--text-gold-light);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.shake-animate {
  animation: authShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

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

.input-error {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.06) !important;
  box-shadow: 0 0 0 1px #ef4444, 0 0 12px rgba(239, 68, 68, 0.25) !important;
}

/* Custom Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-color);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: rgba(16, 185, 129, 0.3);
  border-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.badge-suspended {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}


