/* ==========================================================================
   StoryHub — Enterprise Design System & Color-Coded Engine
   Inspired by Stripe, Linear, Notion & Modern SaaS Standards
   ========================================================================== */

:root {
  /* Core Surface Tokens (Light Mode Default) */
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --popover: #ffffff;
  --popover-foreground: #0f172a;
  --primary: #0f172a;
  --primary-foreground: #f8fafc;
  --secondary: #f1f5f9;
  --secondary-foreground: #1e293b;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #f1f5f9;
  --accent-foreground: #0f172a;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: #0f172a;
  --radius: 10px;
  --sidebar-width: 260px;
  --topbar-height: 58px;

  /* Enterprise Color-Coded System */
  /* Green: Success, Completed Tasks, Positive Delta */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-success-text: #047857;

  /* Blue: General Info, Active Processes, System Status */
  --color-info: #3b82f6;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --color-info-text: #1d4ed8;

  /* Orange: Pending Actions, Warnings, Attention Items */
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-warning-text: #b45309;

  /* Red: Critical Alerts, Failures, Urgent Actions */
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-danger-text: #b91c1c;

  /* Purple: Analytics, Insights, AI Recommendations */
  --color-ai: #8b5cf6;
  --color-ai-bg: #f5f3ff;
  --color-ai-border: #ddd6fe;
  --color-ai-text: #6d28d9;

  /* Teal: Reader & Community Velocity, Engagement */
  --color-teal: #14b8a6;
  --color-teal-bg: #f0fdfa;
  --color-teal-border: #99f6e4;
  --color-teal-text: #0f766e;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Plus Jakarta Sans", "Inter", -apple-system, sans-serif;
  --font-reading: "Literata", "Noto Serif Telugu", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-colored-purple: 0 8px 20px -4px rgba(139, 92, 246, 0.25);
  --shadow-colored-teal: 0 8px 20px -4px rgba(20, 184, 166, 0.25);
  --shadow-colored-blue: 0 8px 20px -4px rgba(59, 130, 246, 0.25);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --background: #09090b;
  --foreground: #f8fafc;
  --card: #141417;
  --card-foreground: #f8fafc;
  --popover: #18181b;
  --popover-foreground: #f8fafc;
  --primary: #f8fafc;
  --primary-foreground: #09090b;
  --secondary: #222226;
  --secondary-foreground: #f8fafc;
  --muted: #1f1f23;
  --muted-foreground: #94a3b8;
  --accent: #222226;
  --accent-foreground: #f8fafc;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #27272a;
  --input: #27272a;
  --ring: #e2e8f0;

  /* Dark Theme Color System */
  --color-success: #34d399;
  --color-success-bg: #064e3b;
  --color-success-border: #065f46;
  --color-success-text: #a7f3d0;

  --color-info: #60a5fa;
  --color-info-bg: #1e3a8a;
  --color-info-border: #1e40af;
  --color-info-text: #bfdbfe;

  --color-warning: #fbbf24;
  --color-warning-bg: #451a03;
  --color-warning-border: #78350f;
  --color-warning-text: #fde68a;

  --color-danger: #f87171;
  --color-danger-bg: #450a0a;
  --color-danger-border: #7f1d1d;
  --color-danger-text: #fecaca;

  --color-ai: #a78bfa;
  --color-ai-bg: #2e1065;
  --color-ai-border: #4c1d95;
  --color-ai-text: #ddd6fe;

  --color-teal: #2dd4bf;
  --color-teal-bg: #042f2e;
  --color-teal-border: #115e59;
  --color-teal-text: #99f6e4;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.6);
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  min-height: 100vh;
}

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

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Focus states */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Google Fonts Material Symbols */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 8px 14px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  font-weight: 500;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}
.skip-link:focus-visible {
  transform: translateY(0);
}

/* Typography & Headings (Google Fonts) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin: 0;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.025em;
}

h1 { font-size: 1.875rem; line-height: 1.25; font-weight: 800; }
h2 { font-size: 1.5rem; line-height: 1.3; font-weight: 700; }
h3 { font-size: 1.125rem; line-height: 1.35; font-weight: 600; }
p { margin: 0; }

.muted {
  color: var(--muted-foreground);
}

kbd, .kbd-shortcut, .shortcut-tag, .kpi-value, .metric-pill strong, .player-ratio-badge {
  font-family: var(--font-mono);
}

/* Buttons */
/* ==========================================================================
   Universal Buttons Suite & Micro-Interactions
   ========================================================================== */
.button, button, .btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--foreground);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.button:hover, button:hover, .btn:hover {
  background: var(--secondary);
  border-color: #d4d4d8;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.button:active, button:active, .btn:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}

.button:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Primary Button (Sleek Dark Theme with Subtle Glow) */
.button.primary, .button.gx-primary, button.gx-primary, .btn-primary, .form button[type="submit"], .writer-publish-bar button[type="submit"] {
  background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
  color: #fafafa;
  border-color: #09090b;
  box-shadow: 0 2px 8px -1px rgba(9, 9, 11, 0.35), 0 1px 2px 0 rgba(9, 9, 11, 0.2);
}
.button.primary:hover, .button.gx-primary:hover, button.gx-primary:hover, .btn-primary:hover, .form button[type="submit"]:hover, .writer-publish-bar button[type="submit"]:hover {
  background: linear-gradient(180deg, #27272a 0%, #18181b 100%);
  border-color: #27272a;
  color: #ffffff;
  box-shadow: 0 6px 16px -2px rgba(9, 9, 11, 0.45);
  transform: translateY(-1.5px);
}
.button.primary:active, .button.gx-primary:active, button.gx-primary:active, .btn-primary:active {
  transform: scale(0.97);
}

/* Outline / Ghost Button */
.button.ghost, button.ghost, .button.outline, .btn-outline {
  background: #ffffff;
  color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.button.ghost:hover, button.ghost:hover, .button.outline:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
  color: var(--foreground);
}

/* Secondary Button */
.button.secondary, .btn-secondary {
  background: #f4f4f5;
  color: #18181b;
  border-color: #e4e4e7;
}
.button.secondary:hover {
  background: #e4e4e7;
  border-color: #d4d4d8;
}

/* Destructive / Danger Button */
.button.destructive, .button.danger, .btn-destructive, .btn-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.button.destructive:hover, .button.danger:hover, .btn-destructive:hover, .btn-danger:hover {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  border-color: #b91c1c;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-1.5px);
}

/* Success Button */
.button.success, .btn-success {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.button.success:hover, .btn-success:hover {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  border-color: #047857;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  transform: translateY(-1.5px);
}

/* Sizes */
.button.small, .button.sm, .btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 0.8125rem;
  border-radius: 6px;
  gap: 6px;
}

.button.large, .button.lg, .btn-lg {
  height: 44px;
  padding: 0 22px;
  font-size: 0.95rem;
  border-radius: 10px;
}

.button.pill-btn, .btn-pill {
  border-radius: 9999px;
  padding: 0 18px;
}

.button.icon-only, .icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  flex: none;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--foreground);
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: var(--secondary);
  border-color: #d4d4d8;
  transform: translateY(-1px);
}

/* Button Loading State */
.button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.button.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-right-color: #ffffff;
  animation: buttonSpin 0.65s linear infinite;
}
.button.ghost.is-loading::after, .button.secondary.is-loading::after {
  border-color: rgba(9, 9, 11, 0.2);
  border-right-color: #09090b;
}

@keyframes buttonSpin {
  to { transform: rotate(360deg); }
}

/* Click Ripple Element */
.gx-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleEffect 0.55s ease-out;
  background-color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.button.ghost .gx-ripple, .button.secondary .gx-ripple {
  background-color: rgba(9, 9, 11, 0.15);
}
@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Forms & Inputs */
input, select, textarea {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--foreground);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  height: 38px;
  width: 100%;
  max-width: 100%;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

input:disabled, select:disabled, textarea:disabled {
  background: #f4f4f5 !important;
  color: #71717a !important;
  cursor: not-allowed;
  opacity: 0.8;
  border-color: #e4e4e7 !important;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--foreground);
}

.form {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

/* Checkbox */
.consent-check, .gx-check {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.84rem;
}
.consent-check input, .gx-check input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex: none;
  cursor: pointer;
}

/* Cards & Panels */
.card, .panel, .erp-card, .hc-section-card, .auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Shadcn Console Shell (Sidebar + Topbar + Content)
   ========================================================================== */

.erp-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--background);
}

/* Sidebar */
.erp-sidebar, .gx-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}

/* Sidebar Header */
.sidebar-header {
  height: var(--topbar-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.brand-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #09090b;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex: none;
}

.brand-copy {
  display: grid;
  flex: 1;
  min-width: 0;
}
.brand-copy strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}
.brand-copy small {
  font-size: 0.72rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-switcher-icon {
  color: var(--muted-foreground);
  font-size: 0.85rem;
  flex: none;
}

/* Sidebar Navigation Groups */
.sidebar-nav {
  padding: 12px 10px;
  display: grid;
  gap: 18px;
  flex: 1;
}

.nav-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  padding: 0 8px 6px;
}

.nav-group-list {
  display: grid;
  gap: 2px;
}

.nav-link, .gx-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover, .gx-nav a:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.nav-link.active, .nav-link.is-active, .gx-nav a.active, .gx-nav a.is-active {
  background: var(--secondary);
  color: var(--foreground);
  font-weight: 600;
}

.nav-link i, .gx-nav a i {
  font-size: 1rem;
  color: #71717a;
  flex: none;
}
.nav-link.active i, .gx-nav a.active i {
  color: var(--foreground);
}

.nav-badge {
  margin-left: auto;
  background: #09090b;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  line-height: 1.4;
}

.nav-chevron {
  margin-left: auto;
  color: #a1a1aa;
  font-size: 0.75rem;
}

/* Sidebar User Footer */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}
.sidebar-user:hover {
  background: var(--secondary);
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f4f4f5;
  border: 1px solid var(--border);
  color: var(--foreground);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex: none;
}

.user-info {
  display: grid;
  flex: 1;
  min-width: 0;
}
.user-info strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.2;
}
.user-info small {
  font-size: 0.72rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Shadcn Topbar Header
   ========================================================================== */

.erp-topbar, .gx-topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.sidebar-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--foreground);
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.topbar-nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.topbar-nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}
.topbar-nav-links a:hover, .topbar-nav-links a.active {
  color: var(--foreground);
}

.topbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quick Search Pill (⌘K) */
.search-pill, .gx-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  width: 220px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fafafa;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  box-shadow: none;
}
.search-pill input, .gx-search input {
  border: 0;
  background: transparent;
  padding: 0;
  height: 100%;
  width: 100%;
  font-size: inherit;
  color: var(--foreground);
  box-shadow: none;
}
.search-pill input:focus, .gx-search input:focus {
  outline: none;
  box-shadow: none;
}
.kbd-shortcut {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted-foreground);
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
  flex: none;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover {
  background: var(--secondary);
  color: var(--foreground);
  border-color: var(--border);
}

/* User Popover Menu */
.topbar-profile-menu {
  position: relative;
}

.topbar-avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #09090b;
  color: #ffffff;
  border: 0;
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.profile-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 230px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 100;
  display: none;
}
.topbar-profile-menu.is-open .profile-popover {
  display: grid;
  gap: 2px;
}

.popover-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.popover-header strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--foreground);
}
.popover-header small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  box-shadow: none;
}
.popover-item:hover {
  background: var(--secondary);
}

.popover-item.destructive {
  color: var(--destructive);
}
.popover-item.destructive:hover {
  background: #fee2e2;
  color: #dc2626;
}

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

.shortcut-tag {
  font-size: 0.68rem;
  color: #a1a1aa;
  font-family: inherit;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Page Body & Dashboard Layout (Screenshot 1)
   ========================================================================== */

.erp-body, .gx-desk {
  padding: 24px 28px;
  display: grid;
  gap: 24px;
  max-width: 1360px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-top: 3px;
}

/* Segmented Tabs (Shadcn Tabs) */
.segmented-tabs, .gx-tabs, .gx-settings-tabs, .profile-pill-tabs {
  display: inline-flex;
  align-items: center;
  background: #f4f4f5;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 2px;
  width: fit-content;
  margin-bottom: 14px;
}

.tab-btn, .gx-tab, .gx-settings-tabs a, .profile-pill-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: none;
}
.tab-btn:hover, .gx-tab:hover, .gx-settings-tabs a:hover, .profile-pill-tabs a:hover {
  color: var(--foreground);
  background: transparent;
}
.tab-btn.is-active, .tab-btn.active, .gx-tab.is-active, .gx-settings-tabs a.is-active, .profile-pill-tabs a.is-active {
  background: #ffffff;
  color: var(--foreground);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Metric KPI Grid (4 Cards) */
.kpi-grid, .dash-kpi-grid, .gx-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card, .dash-kpi, .gx-metric {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  font-weight: 500;
}
.kpi-top i {
  font-size: 1rem;
}

.kpi-value, .dash-kpi strong, .gx-metric strong {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--foreground);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 8px 0 4px;
}

.kpi-sub, .dash-kpi em, .gx-metric em {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-style: normal;
}

/* Dashboard 2-Column Grid (Chart + Recent Activity) */
.dashboard-grid, .dash-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}

.chart-card, .recent-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title-row h3 {
  font-size: 1rem;
  font-weight: 700;
}
.card-title-row p {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}

/* Recent List Items */
.recent-list {
  display: grid;
  gap: 16px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f4f4f5;
  border: 1px solid var(--border);
  color: var(--foreground);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex: none;
}

.recent-info {
  display: grid;
  flex: 1;
  min-width: 0;
}
.recent-info strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--foreground);
}
.recent-info small {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-amount {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
  text-align: right;
  flex: none;
}

/* ==========================================================================
   Shadcn Data Tables (Screenshot 2: User List)
   ========================================================================== */

.table-panel, .gx-table-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.table-search-input {
  height: 34px;
  width: 220px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.84rem;
}

.filter-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: #ffffff;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.filter-btn:hover {
  background: var(--secondary);
  border-style: solid;
}

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

/* Table */
.data-table, .gx-table, .erp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table thead th, .gx-table thead th, .erp-table thead th {
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  white-space: nowrap;
}

.data-table thead th a, .gx-table thead th a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.data-table tbody td, .gx-table tbody td, .erp-table tbody td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--foreground);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover, .gx-table tbody tr:hover, .erp-table tbody tr:hover {
  background: #f8fafc;
}

/* Status Badges (Screenshot 2) */
.badge-status, .status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-status.active, .status.published, .status.completed, .status.active, .status.verified {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-status.suspended, .status.hidden, .status.blocked {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-status.invited, .status.draft, .status.pending, .status.todo {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Role item */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 500;
}
.role-badge i {
  color: #71717a;
  font-size: 0.9rem;
}

/* Three dots row menu & Shadcn dropdown popover */
.gx-row-menu {
  position: relative;
  display: inline-block;
}

.row-menu-btn, .gx-more {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}
.row-menu-btn:hover, .gx-more:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.gx-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 140px;
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.08) !important;
  padding: 4px !important;
  z-index: 100 !important;
  display: grid !important;
  gap: 2px !important;
}
.gx-menu[hidden] {
  display: none !important;
}

.gx-menu a, .gx-menu button, .gx-menu form button {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 32px !important;
  padding: 0 8px !important;
  border-radius: 4px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--foreground) !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  text-align: left !important;
  cursor: pointer !important;
  width: 100% !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.gx-menu a:hover, .gx-menu button:hover, .gx-menu form button:hover {
  background: var(--secondary) !important;
  color: var(--foreground) !important;
}

.gx-menu form {
  margin: 0 !important;
  padding: 0 !important;
}

.gx-menu button.gx-menu-danger, .gx-menu .destructive, .gx-menu form button.gx-menu-danger {
  color: #ef4444 !important;
}

.gx-menu button.gx-menu-danger:hover, .gx-menu .destructive:hover, .gx-menu form button.gx-menu-danger:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

/* Pagination */
.pagination, .gx-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.gx-page-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gx-page-btn:hover {
  background: var(--secondary);
}
.gx-page-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.gx-page-nums {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gx-page-num {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border: 1px solid transparent;
}
.gx-page-num:hover {
  background: var(--secondary);
  color: var(--foreground);
}
.gx-page-num.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ==========================================================================
   Public Header, Story Cards & Reader View
   ========================================================================== */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
}
.brand-logo {
  height: 28px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  transition: color 0.15s ease;
}
.site-nav a:hover {
  color: var(--foreground);
}
.site-nav a[aria-current="page"] {
  color: var(--foreground);
  font-weight: 600;
}

/* Public Main Content Container (Centered Middle Layout) */
.public-page #main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 48px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .public-page #main-content {
    padding: 0 14px 36px;
  }
}

/* Hero Section & Full Container 16:9 Media Showcase */
.hero-panel {
  width: 100%;
  margin: 0 0 20px;
  padding: 14px 0 0;
  display: block;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .hero-panel {
    margin: 0 0 16px;
    padding: 8px 0 0;
  }
}

.hero-media-showcase {
  width: 100%;
  display: block;
}

.hero-16-9-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #09090b;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--border);
  user-select: none;
  touch-action: pan-y;
}

.hero-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-slides-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}

.hero-slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 24px 50px;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0) 0%, rgba(9, 9, 11, 0.75) 60%, rgba(9, 9, 11, 0.92) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hero-slide-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  padding: 3px 10px;
  border-radius: 9999px;
  width: fit-content;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.hero-slide-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  max-width: 800px;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .hero-16-9-player {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
  }
  .hero-slide-overlay {
    padding: 24px 14px 44px;
    background: linear-gradient(180deg, rgba(9, 9, 11, 0) 0%, rgba(9, 9, 11, 0.6) 45%, rgba(9, 9, 11, 0.95) 100%);
  }
  .hero-slide-title {
    font-size: 0.95rem;
    line-height: 1.25;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  }
  .hero-slide-tag {
    font-size: 0.65rem;
    padding: 2px 7px;
  }
}

@media (max-width: 480px) {
  .hero-16-9-player {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
  }
}

.hero-player-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  background: rgba(9, 9, 11, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 9999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  max-width: calc(100% - 24px);
  user-select: none;
}

.player-ctrl-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}

.player-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}
.player-ctrl-btn:active {
  transform: scale(0.92);
}

.player-slide-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  padding: 0 4px;
  white-space: nowrap;
  flex: none;
}

.player-ratio-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.hero-carousel-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
  max-width: min(280px, 42vw);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.hero-carousel-dots::-webkit-scrollbar {
  display: none;
}

.hero-carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex: none;
  -webkit-tap-highlight-color: transparent;
}

.hero-carousel-dots .dot:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.2);
}

.hero-carousel-dots .dot.is-active {
  background: #ffffff;
  width: 14px;
  border-radius: 9999px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

@media (max-width: 640px) {
  .hero-player-controls {
    bottom: 8px;
    padding: 4px 8px;
    gap: 6px;
  }
  .player-ratio-badge {
    display: none;
  }
}

/* ==========================================================================
   Brand Partners & Collaborations Marquee
   ========================================================================== */
.partners-showcase-section {
  margin: 0 0 28px;
  width: 100%;
}

.partners-showcase-inner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 0 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.partners-showcase-header {
  padding: 0 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.partners-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.partners-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 9px;
  border-radius: 9999px;
}

.partners-showcase-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.partners-header-desc {
  font-size: 0.84rem;
  color: var(--muted-foreground);
  margin: 0;
}

.partners-marquee-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.partners-marquee-track {
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: max-content;
  animation: partnersMarqueeScroll 45s linear infinite;
  padding: 4px 12px;
}

.partners-marquee-container:hover .partners-marquee-track {
  animation-play-state: paused;
}

.partner-card {
  flex: none;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.partner-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}

.partner-logo-box {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.partner-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.2s ease;
}

.partner-card:hover .partner-logo-box {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.partner-card:hover .partner-logo {
  transform: scale(1.08);
}

.partner-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.partner-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}

.partner-parent {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  line-height: 1.2;
  white-space: nowrap;
}

@keyframes partnersMarqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 640px) {
  .partners-showcase-inner {
    padding: 16px 0 18px;
  }
  .partners-showcase-header {
    padding: 0 16px 12px;
    margin-bottom: 14px;
  }
  .partner-card {
    min-width: 160px;
    padding: 8px 12px;
    gap: 10px;
  }
  .partner-logo-box {
    width: 40px;
    height: 28px;
  }
  .partner-name {
    font-size: 0.82rem;
  }
  .partner-parent {
    font-size: 0.66rem;
  }
}

/* Search Strip & Library Controls */
.search-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.search-strip h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
}

.search-strip form.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 300px;
  flex: 1;
  max-width: 480px;
}

.search-strip form.search input {
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 14px;
  font-size: 0.875rem;
  flex: 1;
  background: #fafafa;
  color: var(--foreground);
}

.search-strip form.search button {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 12px;
  flex-wrap: wrap;
  width: 100%;
}

.section-heading h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.section-heading p {
  font-size: 0.84rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #fdfbf7;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 18px;
}

/* Story Cards Grid — strictly 4 stories per line */
.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.story-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.story-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.story-card-image {
  aspect-ratio: 16/10;
  background: #f4f4f5;
  overflow: hidden;
  display: block;
}
.story-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card-body {
  padding: 16px;
  display: grid;
  gap: 8px;
  flex: 1;
}

.story-card h2 {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
}
.story-card h2 a:hover {
  color: #27272a;
}
.story-card p {
  color: var(--muted-foreground);
  font-size: 0.84rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.like-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #09090b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Reader View */
.reader-view {
  max-width: 780px;
  margin: 28px auto 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
}

.reader-view h1 {
  font-size: 2rem;
  margin: 12px 0 8px;
}

.story-body {
  font-family: var(--font-reading);
  font-size: 1.125rem;
  line-height: 1.75;
  color: #18181b;
  margin: 24px 0;
}

.story-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ==========================================================================
   Enterprise Auth Split Architecture (Full Image Overlay & Rich UI/UX)
   ========================================================================== */

.auth-stage {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: var(--background);
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  width: min(880px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .auth-split {
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Left Hero Image Artwork Showcase (100% Unobstructed & Crystal Clear) */
.auth-brand-panel {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center 15%;
  background-repeat: no-repeat;
  display: block;
  min-height: 100%;
}

.auth-brand-panel.login-theme {
  background-image: url('../img/login.png');
}

.auth-brand-panel.signup-theme {
  background-image: url('../img/signup.png');
}

.auth-brand-panel.forgot-theme {
  background-image: url('../img/login.png');
}

.auth-brand-overlay {
  display: none;
}

/* Right Form Card */
.auth-card-premium {
  padding: 24px 28px;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--card);
  box-sizing: border-box;
}

/* Brand Logo Header in Right Card */
.auth-card-brand-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.auth-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.auth-card-logo {
  height: 32px;
  width: auto;
  display: block;
  transition: opacity 0.15s ease;
}
.auth-brand-link:hover .auth-card-logo {
  opacity: 0.85;
}

/* Segmented Auth Mode Switcher Tab */
.auth-tab-switcher {
  display: flex;
  background: var(--secondary);
  padding: 3px;
  border-radius: 999px;
  gap: 3px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.auth-tab-link {
  flex: 1;
  text-align: center;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
}
.auth-tab-link:hover {
  color: var(--foreground);
}
.auth-tab-link.is-active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.auth-header-block {
  margin-bottom: 14px;
}
.auth-header-block .eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-info);
  display: block;
  margin-bottom: 2px;
}
.auth-header-block h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--foreground);
}
.auth-header-block p {
  color: var(--muted-foreground);
  font-size: 0.82rem;
  margin: 3px 0 0;
}

/* Modern Input Groups with Prefix Icons */
.form-field {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}
.form-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-icon-prefix {
  position: absolute;
  left: 14px;
  color: var(--muted-foreground);
  pointer-events: none;
  font-size: 1rem;
  z-index: 2;
  transition: color 0.15s ease;
}
.input-group input {
  width: 100%;
  padding-left: 42px !important;
  padding-right: 44px !important;
  height: 44px;
  border-radius: 10px;
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 0.875rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-group input:focus {
  border-color: var(--color-info);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}
.input-group:focus-within .input-icon-prefix {
  color: var(--color-info);
}

/* Show/Hide Password Button */
.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 6px;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  z-index: 3;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.password-toggle-btn:hover {
  color: var(--foreground);
  background: var(--secondary);
}

/* Live Password Strength Meter */
.password-strength-meter {
  display: none;
  margin-top: 6px;
}
.strength-bar {
  height: 4px;
  background: var(--secondary);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}
.strength-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background 0.3s ease;
}
.strength-label {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

/* Remember Me & Forgot Password Row */
.auth-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 16px;
  font-size: 0.82rem;
}
.remember-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
}
.remember-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #09090b;
  cursor: pointer;
}
[data-theme="dark"] .remember-check input[type="checkbox"] {
  accent-color: #3b82f6;
}
.forgot-link {
  color: var(--color-info);
  text-decoration: none;
  font-weight: 600;
}
.forgot-link:hover {
  text-decoration: underline;
}

/* Custom Styled Consent Boxes */
.consent-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.consent-card input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: #09090b;
  flex: none;
  cursor: pointer;
}
[data-theme="dark"] .consent-card input[type="checkbox"] {
  accent-color: #3b82f6;
}
.consent-card span {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}

/* Submit Button & Security Footnote */
.auth-submit-btn {
  width: 100%;
  height: 42px;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 10px;
  margin-top: 4px;
}

.auth-trust-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted-foreground);
  margin-top: 18px;
}
.auth-trust-footer i {
  color: var(--color-success);
}

/* Responsive Stacking & Mobile Hero Banner Optimization */
@media (max-width: 820px) {
  .auth-stage {
    padding: 16px 12px 60px;
  }
  .auth-split {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 16px;
  }
  .auth-brand-panel {
    min-height: 220px;
    padding: 24px 20px;
  }
  .auth-brand-inner {
    padding: 0;
  }
  .auth-hero-subtitle,
  .auth-feature-list,
  .auth-quote-card {
    display: none;
  }
  .auth-brand-inner h2 {
    font-size: 1.4rem;
  }
  .auth-card-premium {
    padding: 24px 20px;
  }
}

/* Toasts (Shadcn Toast System) */
.gx-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.gx-toast {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
}

.gx-toast-icon {
  font-size: 1.1rem;
  flex: none;
  margin-top: 1px;
}
.gx-toast-info .gx-toast-icon { color: #0284c7; }
.gx-toast-success .gx-toast-icon { color: #16a34a; }
.gx-toast-warning .gx-toast-icon { color: #d97706; }
.gx-toast-error .gx-toast-icon { color: #dc2626; }

.gx-toast-body {
  flex: 1;
  min-width: 0;
}
.gx-toast-body strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
}
.gx-toast-body p {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.gx-toast-close {
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  box-shadow: none;
}
.gx-toast-close:hover {
  background: var(--secondary);
  color: var(--foreground);
}

/* ==========================================================================
   Public Hero, Notices & Discovery (Shadcn Best Version)
   ========================================================================== */

/* ==========================================================================
   Public Hero, Notices & Discovery (Unified Container Alignment)
   ========================================================================== */

.site-notice-banner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  margin: 16px 0 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.site-notice-main {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  flex: 1;
}
.site-notice-pill {
  background: #09090b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  flex: none;
  letter-spacing: 0.03em;
}

.tag {
  display: inline-flex;
  align-items: center;
  background: #f4f4f5;
  color: #18181b;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  width: fit-content;
}

.featured-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #09090b;
  color: #ffffff;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.meta-author {
  font-weight: 600;
  color: var(--foreground);
}

.empty-state {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted-foreground);
  width: 100%;
  box-sizing: border-box;
}
.empty-state-svg {
  width: 140px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.06));
  animation: floatEmptyState 3.5s ease-in-out infinite;
}
@keyframes floatEmptyState {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.empty-state i {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.5;
}
.empty-state strong {
  display: block;
  font-size: 1.05rem;
  color: var(--foreground);
}

/* Authors Portrait Grid */
.authors-grid, .portrait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.portrait-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}
.portrait-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #a1a1aa;
}

.portrait-cover {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #09090b;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  flex: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.portrait-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.portrait-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}
.portrait-check {
  color: #0284c7;
  font-size: 0.85rem;
}
.portrait-bio {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}
.portrait-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.portrait-stats {
  display: flex;
  gap: 12px;
}
.portrait-cta {
  font-weight: 600;
  color: var(--foreground);
}

/* Reader Comments */
.comments {
  max-width: 820px;
  width: 100%;
  margin: 24px auto 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  box-sizing: border-box;
}

.comment-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* ==========================================================================
   Writer's Desk & Manuscript Editor (Shadcn Best Version)
   ========================================================================== */

.writer-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.gx-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.gx-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gx-accent-bar {
  width: 4px;
  height: 24px;
  background: #09090b;
  border-radius: 4px;
}
.gx-panel-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
.gx-panel-title p {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 1px;
}

.gx-compose {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  width: 100%;
}
.gx-compose-fields {
  display: grid;
  gap: 16px;
}
.gx-field-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 12px;
}

.image-upload {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.image-upload:hover {
  border-color: #09090b;
  background: #f4f4f5;
}
.image-upload input[type="file"] {
  display: none;
}
.image-preview img {
  border-radius: 8px;
  max-height: 180px;
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
}

.gx-write-shell {
  display: grid;
  gap: 14px;
  width: 100%;
}
.gx-write-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  padding: 10px 14px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.writer-wordcount {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  background: #f4f4f5;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ==========================================================================
   Chat & Internal Messaging (Shadcn Best Version)
   ========================================================================== */

.chat-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  height: calc(100vh - 120px);
  min-height: 560px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.chat-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #fafafa;
}

.chat-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-list {
  overflow-y: auto;
  flex: 1;
  display: grid;
  gap: 2px;
  padding: 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--foreground);
  transition: background 0.15s ease;
}
.chat-item:hover {
  background: #f4f4f5;
}
.chat-item.is-active {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.chat-header {
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  word-break: break-word;
}
.chat-bubble.mine {
  margin-left: auto;
  background: #09090b;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}
.chat-bubble.peer {
  margin-right: auto;
  background: #f4f4f5;
  color: #09090b;
  border-bottom-left-radius: 2px;
}

.chat-composer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ==========================================================================
   Site Footer (Shadcn Best Version)
   ========================================================================== */

.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 48px 20px 36px;
  width: 100%;
  box-sizing: border-box;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  box-sizing: border-box;
}

.site-footer h2 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--foreground);
  margin-bottom: 14px;
}

.site-footer a {
  display: block;
  font-size: 0.84rem;
  color: var(--muted-foreground);
  margin-bottom: 8px;
  transition: color 0.15s ease;
}
.site-footer a:hover {
  color: var(--foreground);
}

.footer-blurb {
  font-size: 0.84rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 12px 0;
  max-width: 380px;
}

.footer-ig {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--foreground) !important;
}

.footer-age-note {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f4f4f5;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 6px;
}

.copyright {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

/* ==========================================================================
   Responsive Breakpoints, Mobile Navigation & Drawer Architecture
   ========================================================================== */

/* Offcanvas Sidebar Backdrop */
.gx-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.gx-sidebar-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  place-items: center;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-toggle:hover {
  background: var(--secondary);
}
.nav-toggle:active {
  transform: scale(0.94);
}

/* Public Mobile Nav Backdrop */
.site-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
  pointer-events: none;
}
body.nav-open .site-nav-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.nav-open {
  overflow: hidden !important;
}

@media (max-width: 1024px) {
  .erp-shell {
    grid-template-columns: 100%;
  }
  .erp-sidebar, .gx-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    width: 290px;
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
    z-index: 1000;
    border-radius: 0 16px 16px 0;
  }
  body.sidebar-open .erp-sidebar, body.sidebar-open .gx-sidebar {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 8px;
    place-items: center;
    font-size: 1.25rem;
    -webkit-tap-highlight-color: transparent;
  }
  .kpi-grid, .dash-kpi-grid, .gx-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid, .dash-main-grid {
    grid-template-columns: 1fr;
  }
  .gx-compose {
    grid-template-columns: 1fr;
  }
  .erp-body, .gx-desk {
    padding: 20px 16px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  /* Responsive Light Mode Lock: Always stay in Light Mode on mobile viewports */
  :root, [data-theme="dark"], html, body {
    --background: #f8fafc !important;
    --foreground: #0f172a !important;
    --card: #ffffff !important;
    --card-foreground: #0f172a !important;
    --popover: #ffffff !important;
    --popover-foreground: #0f172a !important;
    --primary: #0f172a !important;
    --primary-foreground: #f8fafc !important;
    --secondary: #f1f5f9 !important;
    --secondary-foreground: #1e293b !important;
    --muted: #f1f5f9 !important;
    --muted-foreground: #64748b !important;
    --accent: #f1f5f9 !important;
    --accent-foreground: #0f172a !important;
    --border: #e2e8f0 !important;
    --input: #e2e8f0 !important;
    --ring: #0f172a !important;
    color-scheme: light !important;
  }

  /* Universal iOS Auto-Zoom Prevention: 16px base font on mobile inputs */
  input, select, textarea,
  .input-group input,
  .search-pill input,
  .gx-search input,
  .table-search-input,
  .chat-composer input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="number"],
  input[type="url"] {
    font-size: 16px !important;
  }

  /* Universal Touch Micro-Interactions */
  button, .button, a.button, .dock-link, .nav-toggle, .theme-toggle-btn, .sidebar-toggle {
    -webkit-tap-highlight-color: transparent;
  }

  .site-header-inner {
    padding: 0 16px;
    height: 58px;
  }
  .nav-toggle {
    display: grid;
  }
  .theme-toggle-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    font-size: 1.2rem;
  }

  .site-nav {
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 999;
    max-height: calc(100vh - 58px);
    max-height: calc(100dvh - 58px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  [data-theme="dark"] .site-nav {
    background: rgba(20, 20, 24, 0.98);
  }
  body.nav-open .site-nav {
    display: flex;
    animation: navSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .site-nav a, .site-nav .inline-form, .site-nav button {
    width: 100%;
  }
  .site-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    min-height: 44px;
    box-sizing: border-box;
  }
  .site-nav a:hover, .site-nav a[aria-current="page"] {
    background: var(--secondary);
    color: var(--foreground);
  }
  .site-nav .inline-form {
    margin: 0;
  }
  .site-nav .inline-form button {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    height: auto;
    font-size: 1rem;
    min-height: 44px;
  }

  .erp-topbar, .gx-topbar {
    padding: 0 12px;
    gap: 8px;
    height: 54px;
  }
  .topbar-nav-links {
    display: none;
  }
  .topbar-tools {
    gap: 6px;
  }
  .search-pill, .gx-search {
    width: 110px;
    height: 36px;
  }
  .kbd-shortcut {
    display: none;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }
  .topbar-avatar-btn {
    width: 36px;
    height: 36px;
  }

  .erp-body, .gx-desk {
    padding: 14px;
    gap: 14px;
  }
  .page-header, .gx-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .toolbar-actions, .gx-page-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .toolbar-actions .button, .gx-page-actions .button {
    flex: 1 1 calc(50% - 8px);
    min-width: 130px;
    min-height: 42px;
    justify-content: center;
  }

  .kpi-grid, .dash-kpi-grid, .gx-metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .auth-split {
    grid-template-columns: 1fr;
    width: min(480px, 100%);
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
  .auth-brand-panel {
    display: flex !important;
    width: 100%;
    min-height: 200px;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 240px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid var(--border);
    position: relative;
  }
  .auth-brand-inner {
    padding: 16px 18px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
  }
  .auth-hero-pill {
    font-size: 0.68rem;
    padding: 2px 8px;
    margin-bottom: 6px;
    width: fit-content;
  }
  .auth-hero-logo {
    height: 26px;
    margin-bottom: 4px;
  }
  .auth-brand-inner h2 {
    font-size: 1.25rem;
    margin: 0 0 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  }
  .auth-hero-subtitle,
  .auth-feature-list,
  .auth-quote-card {
    display: none;
  }
  .auth-card-premium {
    padding: 22px 18px;
    border-radius: 0 0 16px 16px;
    gap: 12px;
  }
  .form-row, .gx-field-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Story Reader View on Mobile */
  .reader-view {
    padding: 22px 18px;
    margin: 10px auto 0;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
  }
  .reader-view h1 {
    font-size: 1.6rem;
    line-height: 1.3;
  }
  .story-body {
    font-size: 1.125rem;
    line-height: 1.8;
    margin: 20px 0;
    letter-spacing: 0.01em;
  }
  .story-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 18px;
  }
  .story-actions form {
    width: 100%;
    margin: 0;
  }
  .story-actions .button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    font-size: 0.92rem;
  }
  .story-actions a.button:last-child {
    grid-column: 1 / -1;
  }

  .site-notice-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }
  .site-notice-ig {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }
  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Tables & Toolbar on Mobile */
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .toolbar-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  .toolbar-filters form {
    width: 100%;
  }
  .table-search-input {
    width: 100%;
    height: 42px;
  }
  .filter-btn {
    justify-content: center;
    min-height: 42px;
  }
  .pagination, .gx-pagination {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px;
  }
  .gx-page-nums {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
  .gx-page-num, .gx-page-btn {
    min-width: 38px;
    min-height: 38px;
  }

  /* Mobile Chat Shell & Responsive Layout */
  .chat-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: calc(100vh - 140px);
    min-height: calc(100dvh - 140px);
  }
  .chat-layout.has-selected .chat-list-card {
    display: none;
  }
  .chat-layout:not(.has-selected) .chat-detail-card {
    display: none;
  }
  .chat-back-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    min-height: 36px;
  }
  .chat-thread-item {
    padding: 12px 14px;
    min-height: 60px;
  }
  .inbox-composer {
    padding: 10px 12px;
  }
  .inbox-composer textarea {
    min-height: 44px;
  }

  /* Universal Responsive Popups, Modals & Dialogs */
  .gx-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-sizing: border-box;
  }
  .gx-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }
  .gx-modal-dialog {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 18px;
    max-width: min(440px, calc(100vw - 28px));
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    margin: auto;
  }
  .gx-modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
  }
  .gx-modal-footer .button {
    flex: 1;
    min-height: 42px;
    justify-content: center;
  }

  .profile-popover {
    position: fixed !important;
    top: 58px !important;
    right: 12px !important;
    left: auto !important;
    width: min(270px, calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 72px) !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    z-index: 1100 !important;
  }

  .gx-toasts {
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: 100% !important;
  }
  .gx-toast {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 520px) {
  .hero-copy h1 {
    font-size: 1.65rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hero-actions .button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  .hero-stats {
    gap: 14px;
  }
  .search-pill, .gx-search {
    display: none;
  }
  .topbar-tools {
    gap: 4px;
  }
  .segmented-tabs, .gx-tabs, .gx-settings-tabs, .profile-pill-tabs {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .actions {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .actions::-webkit-scrollbar {
    display: none;
  }
  .actions .button {
    flex: none;
    white-space: nowrap;
    min-height: 38px;
  }
}

/* ==========================================================================
   Admin Modules Grid (Control Center)
   ========================================================================== */
.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

@media (max-width: 1100px) {
  .admin-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 1100px) {
  .admin-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.admin-module-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.admin-module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #09090b;
}

.admin-module-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f4f4f5;
  color: #09090b;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-module-card:hover .admin-module-icon-wrap {
  background: #09090b;
  color: #ffffff;
}

.admin-module-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-module-body strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--foreground);
}

.admin-module-body small {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.admin-module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.admin-module-arrow {
  color: var(--muted-foreground);
  font-size: 0.85rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.admin-module-card:hover .admin-module-arrow {
  color: #09090b;
  transform: translateX(3px);
}

/* Master Detail Inbox Layout */
.inbox-layout.master-detail {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .inbox-layout.master-detail {
    grid-template-columns: 1fr;
  }
}

.inbox-thread-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 600px;
  overflow-y: auto;
}

.inbox-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.inbox-thread-item:hover {
  background: #f4f4f5;
}

.inbox-thread-item.is-active {
  background: #f4f4f5;
  border-color: var(--border);
}

.inbox-thread-item.is-unread strong {
  font-weight: 800;
  color: var(--foreground);
}

.inbox-thread-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.inbox-thread-meta time {
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

.inbox-badge.unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  display: inline-block;
}
.inbox-badge.replied {
  font-size: 0.75rem;
  color: #10b981;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0284c7;
  display: inline-grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex: none;
}
.avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.inbox-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
}

.inbox-bubble {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.inbox-bubble.incoming {
  background: #fafafa;
}

.inbox-bubble.outgoing {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* ==========================================================================
   18+ Age Gate Consent Modal & Restricted Screen
   ========================================================================== */
body.age-gate-open {
  overflow: hidden !important;
}

.age-gate,
.age-gate-blocked {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  animation: ageFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.age-gate[hidden],
.age-gate-blocked[hidden] {
  display: none !important;
}

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

.age-gate-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 860px;
  width: 100%;
  padding: 0;
  box-shadow: 0 35px 80px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
  animation: ageSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.age-gate-left {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  background: #ffffff;
}

.age-gate-header-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.age-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  width: fit-content;
}

.age-gate-left h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--foreground);
  margin: 0;
}

.age-gate-desc {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 0;
}

.age-gate-points {
  list-style: none;
  padding: 12px 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.age-gate-points li {
  font-size: 0.8125rem;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.age-gate-points li i {
  font-size: 0.95rem;
  color: #16a34a;
  flex: none;
}

.age-gate-admin {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.age-gate-admin strong {
  font-size: 0.78rem;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

.age-gate-admin strong i {
  color: #0284c7;
}

.age-gate-admin p {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.4;
  margin: 0;
}

.age-gate-ig {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #e11d48;
  text-decoration: none;
  width: fit-content;
}

.age-gate-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.age-gate-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.age-gate-actions .button {
  flex: 1;
  justify-content: center;
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 600;
}

.age-gate-legal {
  font-size: 0.72rem;
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.3;
}

.age-gate-right {
  position: relative;
  background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border-left: 1px solid var(--border);
}

.age-gate-mascot-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.age-gate-mascot-img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}

/* Dedicated Under-18 Access Restricted Screen */
.age-gate-blocked-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #fecaca;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 36px 28px;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: ageSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.age-gate-blocked-card .age-gate-avatar-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fee2e2;
  box-shadow: 0 8px 24px -4px rgba(239, 68, 68, 0.25);
  margin: 0 auto 16px;
  background: #fafafa;
}

.age-gate-blocked-card .age-gate-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.age-gate-blocked-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--foreground);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.age-gate-blocked-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.55;
  margin: 0 0 20px;
}

.age-gate-blocked-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.age-gate-blocked-actions .button {
  width: 100%;
  justify-content: center;
}

@media (max-width: 768px) {
  .age-gate {
    padding: 10px !important;
    align-items: center !important;
  }
  .age-gate-card {
    grid-template-columns: 1fr;
    max-width: min(460px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    border-radius: 16px;
  }
  .age-gate-right {
    order: -1;
    height: 140px;
    max-height: 140px;
    border-left: none;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .age-gate-mascot-container {
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .age-gate-mascot-img {
    max-height: 130px;
    width: auto;
    object-fit: contain;
    object-position: bottom center;
  }
  .age-gate-left {
    padding: 18px 16px;
    gap: 10px;
  }
  .age-gate-left h2 {
    font-size: 1.2rem;
  }
  .age-gate-points {
    padding: 10px 12px;
    gap: 6px;
  }
  .age-gate-points li {
    font-size: 0.78rem;
  }
  .age-gate-actions {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .age-gate-actions .button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
}

/* ==========================================================================
   Member Profile, Healthcare Layout & User Detail Tabs
   ========================================================================== */
.hc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}
.hc-breadcrumb a {
  color: var(--muted-foreground);
  text-decoration: none;
}
.hc-breadcrumb a:hover {
  color: var(--foreground);
}

.hc-profile-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.hc-profile-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hc-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #18181b;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hc-profile-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.hc-profile-copy h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hc-verified {
  color: #0284c7;
  font-size: 1.15rem;
}
.you-chip {
  background: #f4f4f5;
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 0.72rem;
  font-weight: 700;
  font-style: normal;
  padding: 2px 8px;
  border-radius: 999px;
}
.hc-email {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: none;
}
.hc-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.hc-edit-btn {
  background: #18181b;
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hc-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.hc-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hc-meta span {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.hc-meta strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--foreground);
}
.hc-meta strong.is-ok {
  color: #16a34a;
}
.hc-meta strong.is-warn {
  color: #d97706;
}

.profile-pill-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.profile-pill-tabs::-webkit-scrollbar {
  display: none;
}
.profile-pill-tabs a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--border);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.profile-pill-tabs a:hover {
  background: #f4f4f5;
  color: var(--foreground);
}
.profile-pill-tabs a.is-active {
  background: #09090b;
  color: #ffffff;
  border-color: #09090b;
}

.hc-section-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.hc-section-head {
  margin-bottom: 18px;
}
.hc-section-head.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hc-section-head h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.hc-section-head p {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin: 2px 0 0;
}

.hc-edit-form {
  display: grid;
  gap: 16px;
  max-width: 540px;
}
.hc-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.hc-edit-form label.gx-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: normal;
}
.hc-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.hc-table th, .hc-table td {
  padding: 12px 14px;
  font-size: 0.85rem;
}
.hc-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.hc-chip.ok {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.hc-chip.warn {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.hc-chip.muted {
  background: #f4f4f5;
  color: #71717a;
  border: 1px solid var(--border);
}
.hc-link {
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.84rem;
}
.hc-link:hover {
  text-decoration: underline;
}

.hc-vitals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.hc-vital {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.hc-vital span {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.hc-vital strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--foreground);
}
.hc-vital em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
}
.hc-vital em.is-ok {
  color: #16a34a;
}
.hc-vital em.is-muted {
  color: var(--muted-foreground);
}

.hc-danger-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hc-profile-identity {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .hc-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .hc-vitals {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .hc-section-card {
    padding: 16px;
  }
}

/* ==========================================================================
   Toast Notifications System (Floating Stack & Animated Progress)
   ========================================================================== */
.gx-toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.gx-toast {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.06);
  color: var(--foreground);
  pointer-events: auto;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.25s ease, opacity 0.25s ease, margin 0.25s ease;
}

.gx-toast.is-dismissing {
  opacity: 0;
  transform: translateX(40px) scale(0.94);
  pointer-events: none;
}

.gx-toast-icon {
  flex: none;
  font-size: 1.25rem;
  line-height: 1;
  margin-top: 2px;
}

.gx-toast-info .gx-toast-icon { color: #3b82f6; }
.gx-toast-success .gx-toast-icon { color: #10b981; }
.gx-toast-warning .gx-toast-icon { color: #f59e0b; }
.gx-toast-error .gx-toast-icon { color: #ef4444; }

.gx-toast-line {
  flex: 1;
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0;
}

.gx-toast-line strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 2px;
}

.gx-toast-line span {
  color: var(--muted-foreground);
}

.gx-toast-action {
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.gx-toast-action:hover {
  background: rgba(59, 130, 246, 0.2);
}

.gx-toast-close {
  flex: none;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
  box-shadow: none;
  height: auto;
}
.gx-toast-close:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.gx-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: #09090b;
  opacity: 0.35;
  transform-origin: left;
  animation: toastProgress var(--toast-ttl, 7500ms) linear forwards;
}
.gx-toast-success .gx-toast-progress { background: #10b981; }
.gx-toast-error .gx-toast-progress { background: #ef4444; }
.gx-toast-warning .gx-toast-progress { background: #f59e0b; }
.gx-toast-info .gx-toast-progress { background: #3b82f6; }

@keyframes toastSlideIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ==========================================================================
   In-Page Alerts Callouts
   ========================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  margin-bottom: 18px;
  font-size: 0.875rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.alert-icon {
  flex: none;
  font-size: 1.15rem;
  line-height: 1;
  margin-top: 2px;
}

.alert-body {
  flex: 1;
}

.alert-body strong {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.alert-info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}
.alert-info .alert-icon { color: #0284c7; }

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.alert-success .alert-icon { color: #16a34a; }

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.alert-warning .alert-icon { color: #d97706; }

.alert-danger, .alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.alert-danger .alert-icon, .alert-error .alert-icon { color: #dc2626; }

/* ==========================================================================
   Universal Action Confirmation Modal System
   ========================================================================== */
.gx-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(9, 9, 11, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.gx-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.gx-modal-dialog {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  padding: 26px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0,0,0,0.05);
  transform: scale(0.92) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gx-modal-backdrop.is-open .gx-modal-dialog {
  transform: scale(1) translateY(0);
}

.gx-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.gx-modal-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  flex: none;
}

.gx-modal-icon-wrap.danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.gx-modal-icon-wrap.warning {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.gx-modal-icon-wrap.info {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.gx-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--foreground);
}

.gx-modal-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted-foreground);
  margin-bottom: 24px;
}

.gx-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   Dashboard Components (KPI Cards, Sparklines, Badges, Heart Pop)
   ========================================================================== */
.kpi-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.08), 0 0 0 1px #d4d4d8;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #18181b, #71717a);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-top i {
  font-size: 1.1rem;
  color: var(--foreground);
  background: #f4f4f5;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--foreground);
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 4px;
}
.kpi-trend.up {
  color: #16a34a;
  background: #f0fdf4;
}
.kpi-trend.down {
  color: #dc2626;
  background: #fef2f2;
}

/* Administration Workspace Cards */


.admin-module-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--foreground);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.admin-module-card:hover {
  transform: translateY(-3px);
  border-color: #a1a1aa;
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.09);
}

.admin-module-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f4f4f5;
  color: var(--foreground);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.admin-module-card:hover .admin-module-icon-wrap {
  transform: scale(1.08);
  background: #18181b;
  color: #ffffff;
}

.admin-module-body strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.admin-module-body small {
  display: block;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  line-height: 1.4;
  margin-bottom: 14px;
}

.admin-module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.admin-module-arrow {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  transition: transform 0.2s ease, color 0.2s ease;
}

.admin-module-card:hover .admin-module-arrow {
  transform: translateX(4px);
  color: var(--foreground);
}

/* Status Badges with Pulse Dots */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-status.active {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.badge-status.active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
  animation: pulseDot 2s infinite;
}

.badge-status.pending, .badge-status.invited {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}
.badge-status.pending::before, .badge-status.invited::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d97706;
}

.badge-status.suspended, .badge-status.urgent {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.badge-status.suspended::before, .badge-status.urgent::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dc2626;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* Story Card Heart Pop Animation */
.like-chip {
  cursor: pointer;
  transition: transform 0.2s ease;
}
.like-chip:hover {
  transform: scale(1.08);
}
.like-chip.is-liked i {
  color: #ef4444;
  animation: heartPop 0.4s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Duplicate Content Detection & Review Center
   ========================================================================== */
.candidate-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.erp-dialog {
  background: #ffffff;
  color: var(--foreground);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  margin: auto;
}

.erp-dialog::backdrop {
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.erp-dialog .field .input {
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}

.erp-dialog .field .input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

/* ==========================================================================
   Enterprise 6-Zone Dashboard Suite & Data Visualization
   ========================================================================== */

/* Zone Architecture */
.dashboard-zones {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.dashboard-zone {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.zone-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zone-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 6px;
}
.zone-badge.overview {
  background: var(--color-info-bg);
  color: var(--color-info-text);
  border: 1px solid var(--color-info-border);
}
.zone-badge.operations {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border: 1px solid var(--color-warning-border);
}
.zone-badge.analytics {
  background: var(--color-ai-bg);
  color: var(--color-ai-text);
  border: 1px solid var(--color-ai-border);
}
.zone-badge.users {
  background: var(--color-teal-bg);
  color: var(--color-teal-text);
  border: 1px solid var(--color-teal-border);
}
.zone-badge.financial {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}
.zone-badge.alerts {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border: 1px solid var(--color-danger-border);
}

.zone-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.zone-header p {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin: 2px 0 0;
}

/* Zone 1: Executive KPI Cards with Sparklines */
.kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

@media (max-width: 1200px) {
  .kpi-grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  .kpi-grid-6 {
    grid-template-columns: 1fr;
  }
}

.kpi-card-pro {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.kpi-card-pro:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #a1a1aa;
}
.kpi-card-pro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.kpi-card-pro.green::before { background: var(--color-success); }
.kpi-card-pro.blue::before { background: var(--color-info); }
.kpi-card-pro.purple::before { background: var(--color-ai); }
.kpi-card-pro.orange::before { background: var(--color-warning); }
.kpi-card-pro.teal::before { background: var(--color-teal); }
.kpi-card-pro.red::before { background: var(--color-danger); }

.kpi-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.kpi-icon-pill {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.kpi-icon-pill.green { background: var(--color-success-bg); color: var(--color-success-text); }
.kpi-icon-pill.blue { background: var(--color-info-bg); color: var(--color-info-text); }
.kpi-icon-pill.purple { background: var(--color-ai-bg); color: var(--color-ai-text); }
.kpi-icon-pill.orange { background: var(--color-warning-bg); color: var(--color-warning-text); }
.kpi-icon-pill.teal { background: var(--color-teal-bg); color: var(--color-teal-text); }
.kpi-icon-pill.red { background: var(--color-danger-bg); color: var(--color-danger-text); }

.kpi-main-val {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--foreground);
  margin: 4px 0 2px;
}
.kpi-sparkline-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.sparkline-svg {
  width: 90px;
  height: 32px;
  overflow: visible;
  flex: none;
}

/* Zone 2: Story Pipeline & Workflow Status */
.pipeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}
@media (max-width: 768px) {
  .pipeline-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .pipeline-strip {
    grid-template-columns: 1fr;
  }
}

.pipeline-step {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}
.pipeline-step:hover {
  background: var(--card);
  border-color: #a1a1aa;
}
.pipeline-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.pipeline-step strong {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--foreground);
}
.pipeline-progress {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.pipeline-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}
.pipeline-progress-bar.green { background: var(--color-success); }
.pipeline-progress-bar.blue { background: var(--color-info); }
.pipeline-progress-bar.orange { background: var(--color-warning); }
.pipeline-progress-bar.purple { background: var(--color-ai); }

/* Quick Action Launchpad */
.quick-action-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.quick-action-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--foreground);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.quick-action-btn:hover {
  transform: translateY(-2px);
  border-color: var(--ring);
  box-shadow: var(--shadow-sm);
}
.quick-action-btn i {
  font-size: 1.25rem;
  color: var(--color-info);
}

/* Zone 3: Analytics & Interactive Charts */
.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  width: 100%;
}
@media (max-width: 1024px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-range-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--secondary);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.chart-range-btn {
  background: transparent;
  border: 0;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chart-range-btn.is-active, .chart-range-btn:hover {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

.svg-chart-container {
  position: relative;
  width: 100%;
  height: 220px;
}
.svg-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Chart Tooltip */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #09090b;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -120%);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
  white-space: nowrap;
}
.chart-tooltip.is-visible {
  opacity: 1;
}

/* Reading Activity Heatmap */
.heatmap-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 4px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--secondary);
  transition: transform 0.15s ease, background 0.15s ease;
  cursor: pointer;
  position: relative;
}
.heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 10;
}
.heatmap-cell[data-level="0"] { background: var(--secondary); }
.heatmap-cell[data-level="1"] { background: #99f6e4; }
.heatmap-cell[data-level="2"] { background: #2dd4bf; }
.heatmap-cell[data-level="3"] { background: #0d9488; }
.heatmap-cell[data-level="4"] { background: #115e59; }

/* Zone 4: Real-time Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--secondary);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  margin-top: 6px;
}
.activity-dot.green { background: var(--color-success); }
.activity-dot.blue { background: var(--color-info); }
.activity-dot.orange { background: var(--color-warning); }
.activity-dot.purple { background: var(--color-ai); }

/* Zone 6: AI Insights Panel */
.ai-insight-panel {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(20, 184, 166, 0.05) 100%);
  border: 1px solid var(--color-ai-border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.ai-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-badge-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-ai-bg);
  color: var(--color-ai-text);
  border: 1px solid var(--color-ai-border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.ai-badge-pulse::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-ai);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
  animation: pulseDot 2s infinite;
}

.ai-recommendations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .ai-recommendations-grid {
    grid-template-columns: 1fr;
  }
}
.ai-rec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}
.ai-rec-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-rec-card p {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}

/* ==========================================================================
   Mobile Bottom Navigation Dock (1-Thumb Touch Architecture)
   ========================================================================== */
.mobile-bottom-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  min-height: 62px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 950;
  padding: 0 12px env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}
[data-theme="dark"] .mobile-bottom-dock {
  background: rgba(18, 18, 22, 0.96);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.dock-items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 62px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dock-item {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
}

.dock-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
  min-width: 54px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.dock-link i {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.15s ease;
}
.dock-link.is-active, .dock-link:hover {
  color: var(--foreground);
}
.dock-link.is-active i {
  color: var(--color-info);
  transform: translateY(-2px);
}
.dock-link:active {
  transform: scale(0.92);
}

/* Elevated Floating Action Button in Middle of Dock */
.dock-fab {
  position: relative;
  top: -14px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #09090b;
  color: #ffffff !important;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 3.5px solid var(--card);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
}
[data-theme="dark"] .dock-fab {
  background: #f8fafc;
  color: #09090b !important;
}
.dock-fab:hover {
  transform: scale(1.08) translateY(-2px);
}
.dock-fab:active {
  transform: scale(0.92) translateY(-1px);
}

@media (max-width: 768px) {
  .public-page body,
  body.public-page,
  .public-page main,
  body.has-bottom-dock {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .mobile-bottom-dock {
    display: flex;
  }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.15s ease;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle-btn:hover {
  background: var(--secondary);
}
.theme-toggle-btn:active {
  transform: scale(0.92);
}

/* Ultra-wide Screen Layout Constraints */
@media (min-width: 1920px) {
  .public-page #main-content, .site-header-inner, .site-footer-inner {
    max-width: 1440px;
  }
  .kpi-grid-6 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

