:root {
  --paper: #090e18;      /* Obsidian Black */
  --ink: #f9fafb;        /* Crisp Off-White */
  --muted: #9ca3af;      /* Muted Slate Gray */
  --line: rgba(255, 255, 255, 0.08); /* Thin border */
  --panel: rgba(17, 24, 39, 0.7); /* Slate-900 Glass background */
  --gold: #fbbf24;       /* Amber Gold */
  --green: #10b981;     /* Emerald green */
  --red: #ef4444;       /* Red accent */
  --blue: #3b82f6;      /* Blue accent */
  --radius: 12px;
  --display: "Fraunces", Georgia, serif;
  --sans: "Inter", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}

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

/* Header & Shell */
.site-header {
  position: absolute;
  top: 38px;
  margin-top: 60px;
  left: 0;
  right: 0;
  z-index: 100;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
}

.logo-group span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--gold);
}

/* Ticker Ticker Ticker */
.ticker-bar {
  display: flex;
  background: #040810;
  color: #cbd5e1;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  height: 38px;
  align-items: center;
  overflow: hidden;
}

.ticker-label {
  background: var(--gold);
  color: #000;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 800;
  text-transform: uppercase;
  font-family: var(--sans);
  letter-spacing: 1px;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

.ticker-viewport {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.ticker-track {
  display: inline-flex;
  animation: ticker-slide 30s linear infinite;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin: 0 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.ticker-item .t-desc {
  font-weight: 700;
  color: var(--gold);
  margin-right: 6px;
}

@keyframes ticker-slide {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Card layout & Glassmorphism */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 30px;
}

/* Forms */
input, select, textarea {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 6px;
  outline: none;
  font-family: var(--sans);
}

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

.btn {
  background: var(--gold);
  color: #000;
  border: none;
  padding: 12px 24px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.btn:hover {
  background: #fcd34d;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  margin-top: 16px;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

td {
  font-size: 14px;
}

.mono-cell {
  font-family: var(--mono);
}

/* Grid & Utilities */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pro { background: rgba(251, 191, 36, 0.15); color: var(--gold); }
.badge-free { background: rgba(255, 255, 255, 0.1); color: var(--muted); }

/* --- PORTAL LAYOUT --- */
.portal-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-color: #040810;
}

.portal-sidebar {
  width: 260px;
  background: rgba(9, 14, 24, 0.95);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  z-index: 50;
}

.portal-sidebar .sidebar-logo {
  padding: 24px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-sidebar .sidebar-logo span {
  color: var(--gold);
}

.sidebar-links {
  padding: 24px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

.nav-link.active {
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold);
  border-left: 3px solid var(--gold);
}

.sidebar-footer {
  padding: 24px 16px;
  border-top: 1px solid var(--line);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-email {
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.logout-link {
  font-size: 12px;
  color: var(--muted);
}
.logout-link:hover { color: var(--red); }

.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Background grid for portal main */
.portal-main::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
  z-index: -1;
}

.portal-header {
  height: 72px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 8, 16, 0.8);
  backdrop-filter: blur(12px);
}

.breadcrumbs {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink);
}

.portal-content {
  padding: 40px;
  overflow-y: auto;
  flex: 1;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
  opacity: 0;
}

/* Live pulse indicator */
.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Footer Styles */
.site-footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 60px clamp(18px, 4vw, 56px) 40px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #040810;
  margin-top: 80px;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand strong {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.footer-brand strong .brand-basis {
  color: #245842; /* Forest green from the logo */
}

.footer-brand strong .brand-edge {
  color: #F6A93A; /* The yellow from the logo */
}

.footer-brand span {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.footer-links-group {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 60px);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 4px;
}

.footer-col a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  gap: 12px;
}

.footer-bottom a:hover {
  color: var(--gold);
}

.social-icon-link {
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icon-link:hover {
  color: var(--gold);
  transform: translateY(-2px);
}

/* Admin Dashboard Specific Styles */
.sidebar-section-title {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.1em;
  padding: 16px 16px 8px 16px;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}

.admin-alert-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.intel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(12px);
}

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

.intel-source {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  text-transform: uppercase;
}

.intel-meta {
  font-size: 12px;
  color: var(--muted);
}

.intel-body {
  font-size: 14px;
  line-height: 1.6;
}

.intel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
}

.btn-action {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: all 0.2s;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-gold {
  background: var(--gold);
  color: #000;
  border: none;
}

.btn-gold:hover {
  background: #f59e0b;
}

.compliance-queue-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.queue-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s;
}

.queue-item.warning {
  border-left: 4px solid var(--red);
}

.queue-item.clean {
  border-left: 4px solid var(--green);
}

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

.queue-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
}

.warnings-box {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  color: #fca5a5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.warnings-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.draft-editor-textarea {
  width: 100%;
  height: 250px;
  background: rgba(9, 14, 24, 0.6);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.badge-draft { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-queued { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-sent { background: rgba(16, 185, 129, 0.2); color: #34d399; }


/* Mobile Responsive Portal Layout */
@media (max-width: 768px) {
  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.8);
  }
  .portal-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle-btn {
    display: flex !important;
  }
  .sidebar-close-btn {
    display: block !important;
  }
  .portal-header {
    padding: 0 16px !important;
    height: 60px !important;
  }
  .portal-content {
    padding: 16px !important;
  }
  .breadcrumbs {
    font-size: 16px !important;
  }
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 600px; /* Prevent columns squishing on narrow layouts */
  }
  .grid-2 {
    grid-template-columns: 1fr !important;
  }
  .card {
    padding: 16px !important;
  }
  .metric-selector {
    width: 100% !important;
  }

  /* Public Pages Mobile Optimizations */
  .site-header {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 0 !important;
    background: #090e18 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  }
  .masthead {
    padding: 12px 16px !important;
    gap: 12px !important;
  }
  .logo-group img {
    height: 36px !important;
  }
  main.container {
    padding-top: 40px !important;
  }
}


