:root {
  --primary: #6D28D9; /* stronger, more balanced purple */
  --primary-600: #5B21B6;
  --primary-hover: #5424c8;
  --primary-light: #F3E8FF;
  --primary-glow: rgba(109,40,217,0.12);
  --navy: #0A2540;
  --navy-light: #1A3A5C;
  --cyan: #06B6D4;
  --cyan-dark: #0891B2;
  --cyan-light: #ECFEFF;
  --text-primary: #0A2540;
  --text-secondary: #475569;
  --text-muted: #9CA3AF;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --border: #E5E7EB;
  --border-focus: #5B4CF5;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --dark-bg: #0F1117;
  --dark-surface: #1A1D29;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 18px 45px -20px rgba(15,23,42,0.35), 0 6px 16px -8px rgba(15,23,42,0.12);
}

/* Base resets */
* {
  font-family: 'Inter', 'Raleway', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html {
  font-size: 100%;
}

body {
  background-color: var(--surface-2);
  color: var(--text-primary);
}

main {
  width: 100%;
}

button,
[role="button"],
input,
select,
textarea,
a {
  transition: all 0.2s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(91, 76, 245, 0.45);
  outline-offset: 2px;
}

/* Premium Utilities */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.reveal-on-scroll,
.reveal-up {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-on-scroll.is-visible,
.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px var(--primary-glow);
}

/* Custom UI Components */
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.68rem 0.95rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.sidebar-link.active {
  background-color: #ECFEFF;
  color: #06B6D4;
  font-weight: 600;
}

.sidebar-link:hover:not(.active) {
  background-color: #f1f5f9;
  color: var(--text-primary);
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 30px -12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -18px var(--primary-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid #E6E7F8;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn-secondary:hover { background-color: #fbfbff; border-color: #E0D9FF; }

/* Auth Cards */
.auth-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.88));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 1.5rem;
  box-shadow: 0 28px 70px -42px rgba(15,23,42,0.35), 0 12px 24px -18px rgba(91,76,245,0.18);
  border: 1px solid rgba(226, 232, 240, 0.95);
  padding: 2.25rem;
  width: 100%;
  max-width: 460px;
}

.auth-input {
  width: 100%;
  min-height: 2.95rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all 0.2s;
  color: var(--text-primary);
}

select.auth-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 6px 26px -12px var(--primary-glow);
}

/* Form input fields */
.input-field {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #0F172A;
  background: #FFFFFF;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-field:focus {
  outline: none;
  border-color: #06B6D4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.input-field::placeholder {
  color: #94A3B8;
}

textarea.input-field {
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* Targeted page-level transitions */
.stagger-children > * {
  animation: fade-up 0.35s ease-out both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.09s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.18s; }

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

/* Stat card number count-in */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Interactive card lift */
.shadow-sm {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Smooth link underline on hover */
a {
  transition: color 0.2s ease;
}

.nav-link-clean {
  display: inline-flex;
  align-items: center;
  height: 2.15rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0 0.55rem;
  color: #475569;
  font-weight: 500;
  transition: background-color .2s ease, color .2s ease;
}

.nav-link-clean:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.surface-hover-clean {
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.surface-hover-clean:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 22px -18px rgba(15, 23, 42, 0.45);
}

/* Sidebar active indicator pulse */
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 54%;
  background: #06B6D4;
  border-radius: 0 4px 4px 0;
}
/* Sidebar link position and active indicator */
.sidebar-link {
  position: relative;
}

/* Button press effect */
.btn-primary:active {
  transform: scale(0.97);
}

/* Table row highlight slide */
tbody tr {
  transition: background-color 0.15s ease;
}

/* Badge pulse for live indicators */
@keyframes soft-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Badge component variants */
.badge { display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.625rem; border-radius: 0.5rem; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-pending_review { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-published { background: #dbeafe; color: #1e40af; }
.badge-archived { background: #f1f5f9; color: #94a3b8; }

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.premium-bg {
  background: linear-gradient(180deg, #f8faff 0%, #f7f8fc 52%, #f9fafb 100%);
}

.premium-surface {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow:
    0 18px 42px -26px rgba(15, 23, 42, 0.28),
    0 2px 10px rgba(91, 76, 245, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.panel-soft {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 10px 30px -24px rgba(15, 23, 42, 0.35);
}

/* Co-Pilot Drawer styles */
.copilot-drawer {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 420px;
  max-width: calc(100% - 40px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px -24px rgba(15,23,42,0.35), 0 8px 20px -12px rgba(15,23,42,0.12);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  z-index: 60;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #f3f5f8;
  background: linear-gradient(90deg, rgba(109,40,217,0.04), rgba(255,255,255,0));
}

.copilot-header .left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.copilot-body {
  padding: 18px 20px;
  max-height: 430px;
  overflow: auto;
}

.copilot-footer {
  padding: 16px 18px;
  border-top: 1px solid #f3f5f8;
  background: #ffffff;
}

.copilot-badge {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
  padding: 0;
  line-height: 0;
}

.copilot-note {
  font-size: 12px;
  color: var(--text-muted);
}

.tone-option {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .12s ease;
}
.tone-option:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -18px rgba(91,76,245,0.10); }

.copilot-result .p-3 { padding: 12px !important; }

/* Smaller mobile adjustments */
@media (max-width: 640px) {
  .copilot-drawer { right: 12px; left: 12px; width: auto; bottom: 70px; }
}

.card-elevate {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card-elevate:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -26px rgba(79, 70, 229, 0.34);
  border-color: rgba(129, 140, 248, 0.34);
}

.campaign-cta,
.campaign-cta-secondary {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

.campaign-cta:hover,
.campaign-cta-secondary:hover {
  transform: translateY(-1px);
}

.ambient-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(40px);
  pointer-events: none;
  animation: none;
}

.ambient-orb.alt {
  animation-delay: 0s;
  animation-duration: 0s;
}

.reveal-up {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal-up .5s ease forwards;
}

.reveal-up.delay-1 { animation-delay: .05s; }
.reveal-up.delay-2 { animation-delay: .1s; }
.reveal-up.delay-3 { animation-delay: .15s; }
.reveal-up.delay-4 { animation-delay: .2s; }

.hover-scale-soft {
  transition: transform .2s ease;
}

.hover-scale-soft:hover {
  transform: scale(1.015);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-premium {
  position: relative;
  overflow: hidden;
}

.btn-premium::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, 0.28) 45%, transparent 80%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}

.btn-premium:hover::after {
  transform: translateX(120%);
}

.page-shell {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.section-card {
  border-radius: 1rem;
  padding: 1.35rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.section-head {
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.15rem;
  line-height: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.section-subtitle {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #94a3b8;
}

.page-title {
  font-size: 1.8rem;
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.page-subtitle {
  margin-top: 0.15rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: #64748b;
}

.page-lead {
  margin-top: 0.5rem;
  font-size: 0.975rem;
  line-height: 1.55rem;
  color: #64748b;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.card-title {
  font-size: 0.95rem;
  line-height: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.meta-label {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: #94a3b8;
}

/* Unified button styles for primary and secondary actions */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.875rem;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-action:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-action-primary {
  background: linear-gradient(135deg, #6D28D9, #06B6D4);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-action-primary:hover {
  background: linear-gradient(135deg, #5B21B6, #0891B2);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px var(--primary-glow);
}

.auth-card .page-title {
  line-height: 1.1;
}

.auth-card .page-lead {
  max-width: 30rem;
  margin-left: auto;
  margin-right: auto;
}

.auth-card .eyebrow {
  color: var(--primary-600, var(--primary));
}

.auth-card .btn-primary,
.auth-card .btn-action-primary {
  box-shadow: 0 14px 30px -16px rgba(91,76,245,0.35);
}

.auth-card .btn-primary:hover,
.auth-card .btn-action-primary:hover {
  box-shadow: 0 18px 36px -18px rgba(91,76,245,0.38);
}

.auth-card .auth-input {
  background: linear-gradient(180deg, #fff, #fcfcff);
}

.auth-card .auth-input::placeholder {
  color: #94a3b8;
}

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

.btn-action-secondary {
  background: #fff;
  color: #1f2937;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-action-secondary:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.btn-action-danger {
  background: #fff;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.btn-action-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.65rem;
}

@media (max-width: 1024px) {
  .page-shell { gap: 1rem; }
  .section-card { padding: 1rem; }
  .page-title { font-size: 1.25rem; line-height: 1.75rem; }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  50% { transform: translateY(-12px) translateX(8px) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Dynamic Primary Utilities */
.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.hover\:bg-primary-hover:hover { background-color: var(--primary-hover) !important; }
.border-primary { border-color: var(--primary) !important; }
.ring-primary\/20 { --tw-ring-color: rgba(109, 40, 217, 0.2); }
.focus\:ring-primary\/30:focus { --tw-ring-color: rgba(109, 40, 217, 0.3); }
