/* ==========================================================================
   NEUTRON AI — CORE STYLES
   Depends on theme.css (variables) + animations.css (keyframes)
   ========================================================================== */

/* ---------------------------- Reset ---------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--color-text-primary);
  background: var(--color-black-900);
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; font-family: var(--font-display); letter-spacing: 0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(255, 215, 0, 0.3); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-black-900); }
::-webkit-scrollbar-thumb { background: var(--color-gold-700); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold-500); }

/* ---------------------------- Background canvas ---------------------------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: var(--z-background);
  background: var(--gradient-bg-radial);
  pointer-events: none;
}

/* ---------------------------- App shell ---------------------------- */
.app-shell {
  position: relative;
  z-index: var(--z-content);
  min-height: 100vh;
  display: flex;
}

/* ---------------------------- Sidebar ---------------------------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--gradient-sidebar);
  border-right: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: var(--z-sidebar);
  transition: transform var(--transition-base);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--color-border-subtle);
}

.sidebar-brand img { width: 30px; height: 30px; }

.sidebar-brand .brand-name {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.12em;
  color: var(--color-text-primary);
}

.sidebar-module-tag {
  margin: var(--space-md) var(--space-lg) 0;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-gold-700);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold-400);
  text-align: center;
  background: rgba(255, 215, 0, 0.05);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 11px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  position: relative;
  transition: all var(--transition-fast);
}

.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }

.sidebar-nav a:hover {
  background: rgba(255, 215, 0, 0.06);
  color: var(--color-gold-200);
}

.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.14) 0%, rgba(255, 215, 0, 0.02) 100%);
  color: var(--color-gold-300);
}

.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--gradient-gold-soft);
  box-shadow: var(--glow-gold-sm);
}

.sidebar-nav a.active svg { opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5)); }

/* "AI" pill on the Console link */
.sidebar-nav a .nav-pill {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--gradient-gold-soft);
  color: var(--color-text-on-gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow: var(--glow-gold-sm);
  animation: glowPulse 3s ease-in-out infinite;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border-subtle);
}

.sidebar-back {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}
.sidebar-back:hover { color: var(--color-gold-300); }

/* ---------------------------- Topbar ---------------------------- */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  border-bottom: 1px solid var(--color-border-subtle);
  background: rgba(5, 5, 10, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}

.topbar-left { display: flex; align-items: center; gap: var(--space-md); }
.topbar-clock { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--color-text-muted); }

.topbar-right { display: flex; align-items: center; gap: var(--space-lg); }

.topbar-lang { display: flex; gap: var(--space-xs); font-size: var(--fs-xs); color: var(--color-text-muted); }
.topbar-lang span { padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer; user-select: none; transition: all var(--transition-fast); }
.topbar-lang span:hover { color: var(--color-gold-200); }
.topbar-lang span.active { background: rgba(255, 215, 0, 0.12); color: var(--color-gold-300); }

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-gold-600);
  box-shadow: var(--glow-gold-sm);
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.page-body {
  padding: var(--space-xl);
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: var(--fs-xl);
  color: var(--color-text-primary);
}

.page-header .page-subtitle {
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  font-family: var(--font-body);
}

/* ---------------------------- Buttons ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--gradient-gold-soft);
  color: var(--color-text-on-gold);
  box-shadow: var(--glow-gold-sm);
}
.btn-primary:hover { box-shadow: var(--glow-gold-md); transform: translateY(-1px); }

.btn-secondary {
  background: transparent;
  border-color: var(--color-gold-600);
  color: var(--color-gold-300);
}
.btn-secondary:hover { background: rgba(255, 215, 0, 0.08); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--color-border-subtle);
  color: var(--color-text-secondary);
}
.btn-ghost:hover { border-color: var(--color-gold-600); color: var(--color-gold-200); }

.btn-danger {
  background: rgba(255, 90, 95, 0.1);
  border-color: rgba(255, 90, 95, 0.4);
  color: var(--color-danger);
}
.btn-danger:hover { background: rgba(255, 90, 95, 0.18); }

.btn-sm { padding: 7px 14px; font-size: var(--fs-xs); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ---------------------------- Cards ---------------------------- */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
}
.card:hover {
  background: var(--gradient-card-hover);
  border-color: var(--color-gold-700);
}

.card-title {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.kpi-card { display: flex; flex-direction: column; gap: var(--space-sm); }
.kpi-card-head { display: flex; align-items: center; justify-content: space-between; }
.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.08);
  color: var(--color-gold-400);
}
.kpi-icon svg { width: 18px; height: 18px; }

.kpi-value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--color-text-primary);
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.kpi-trend.up { background: rgba(61, 220, 132, 0.12); color: var(--color-success); }
.kpi-trend.down { background: rgba(255, 90, 95, 0.12); color: var(--color-danger); }

.kpi-sparkline { height: 40px; margin-top: 4px; position: relative; overflow: hidden; }
.kpi-sparkline canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* ---------------------------- Grid layouts ---------------------------- */
.grid-60-40 { display: grid; grid-template-columns: 60% 1fr; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.grid-50-50 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.card-heading h3 { font-size: var(--fs-md); color: var(--color-text-primary); font-family: var(--font-body); font-weight: 600; }

/* ---------------------------- Live activity feed ---------------------------- */
.activity-feed { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; }
.activity-item {
  display: flex;
  gap: var(--space-sm);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border-subtle);
}
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-gold-400);
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}
.activity-text { font-size: var(--fs-sm); color: var(--color-text-secondary); line-height: 1.4; }
.activity-text strong { color: var(--color-gold-300); font-weight: 600; }
.activity-time { font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: 2px; }

/* ---------------------------- Toolbar / toggles ---------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  flex-wrap: wrap;
}

.toggle-row { display: flex; align-items: center; gap: var(--space-sm); }
.toggle-label { font-size: var(--fs-sm); color: var(--color-text-secondary); }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; border-radius: var(--radius-pill);
  background: var(--color-graphite-400);
  border: 1px solid var(--color-border-subtle);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.switch-track::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  border-radius: 50%;
  background: var(--color-text-secondary);
  transition: all var(--transition-fast);
}
.switch input:checked + .switch-track { background: rgba(255, 215, 0, 0.18); border-color: var(--color-gold-500); }
.switch input:checked + .switch-track::before { transform: translateX(20px); background: var(--gradient-gold-soft); box-shadow: var(--glow-gold-sm); }

.switch.danger input:checked + .switch-track { background: rgba(255, 90, 95, 0.18); border-color: var(--color-danger); }
.switch.danger input:checked + .switch-track::before { background: var(--color-danger); box-shadow: 0 0 10px rgba(255, 90, 95, 0.6); }

/* ---------------------------- Filter bar ---------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.select-field, .input-field {
  background: var(--color-graphite-600);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  transition: border-color var(--transition-fast);
}
.select-field:focus, .input-field:focus { outline: none; border-color: var(--color-gold-500); }

/* ---------------------------- Table ---------------------------- */
.table-wrap {
  background: var(--gradient-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

table.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: rgba(255, 255, 255, 0.02);
}
.data-table tbody td {
  padding: 14px 18px;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: rgba(255, 215, 0, 0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-company { display: flex; align-items: center; gap: 10px; color: var(--color-text-primary); font-weight: 500; }
.company-favicon { width: 22px; height: 22px; border-radius: 5px; background: var(--gradient-gold-soft); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--color-text-on-gold); }

/* Badges / chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-gold { background: rgba(255, 215, 0, 0.1); color: var(--color-gold-300); border-color: rgba(255, 215, 0, 0.25); }
.badge-success { background: rgba(61, 220, 132, 0.1); color: var(--color-success); border-color: rgba(61, 220, 132, 0.25); }
.badge-warning { background: rgba(255, 176, 32, 0.1); color: var(--color-warning); border-color: rgba(255, 176, 32, 0.25); }
.badge-danger { background: rgba(255, 90, 95, 0.1); color: var(--color-danger); border-color: rgba(255, 90, 95, 0.25); }
.badge-muted { background: rgba(255, 255, 255, 0.05); color: var(--color-text-muted); border-color: var(--color-border-subtle); }
.badge-info { background: rgba(79, 195, 247, 0.1); color: var(--color-info); border-color: rgba(79, 195, 247, 0.25); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-dot.live { background: var(--color-success); }
.status-dot.idle { background: var(--color-text-muted); }
.status-dot.warn { background: var(--color-warning); }

.row-actions { display: flex; gap: 8px; }

/* ---------------------------- Split view ---------------------------- */
.split-view { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }

.field-group { margin-bottom: var(--space-lg); }
.field-label { display: block; font-size: var(--fs-sm); color: var(--color-text-secondary); margin-bottom: 8px; font-weight: 600; }
.field-hint { font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: 6px; }

textarea.input-field { width: 100%; min-height: 110px; resize: vertical; font-family: var(--font-body); line-height: 1.5; }

.range-row { display: flex; align-items: center; gap: var(--space-md); }
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-graphite-400);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gradient-gold-soft);
  box-shadow: var(--glow-gold-sm);
  cursor: pointer;
  border: 2px solid var(--color-black-900);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gradient-gold-soft);
  box-shadow: var(--glow-gold-sm);
  cursor: pointer;
  border: 2px solid var(--color-black-900);
}
.range-value { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--color-gold-300); min-width: 42px; text-align: right; }

.tone-slider-labels { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: 6px; }

.preview-box {
  background: var(--color-black-800);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  min-height: 220px;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  position: relative;
  overflow: hidden;
}
.preview-url { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--color-text-muted); margin-bottom: var(--space-md); padding-bottom: var(--space-md); border-bottom: 1px dashed var(--color-border-subtle); }
.preview-hook { color: var(--color-text-primary); }
.typing-cursor { display: inline-block; width: 2px; height: 14px; background: var(--color-gold-400); vertical-align: middle; margin-left: 2px; animation: blinkCursor 0.9s step-end infinite; }
@keyframes blinkCursor { 50% { opacity: 0; } }

/* ---------------------------- Two panel inbox ---------------------------- */
.inbox-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gradient-card);
  height: calc(100vh - 220px);
  min-height: 520px;
}

.visitor-list {
  border-right: 1px solid var(--color-border-subtle);
  overflow-y: auto;
}
.visitor-search { padding: var(--space-md); border-bottom: 1px solid var(--color-border-subtle); }

.visitor-item {
  display: flex;
  gap: 10px;
  padding: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}
.visitor-item:hover { background: rgba(255, 215, 0, 0.05); }
.visitor-item.active { background: rgba(255, 215, 0, 0.08); }
.visitor-item.active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gradient-gold-soft);
}
.visitor-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gradient-gold-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-sm); color: var(--color-text-on-gold);
  flex-shrink: 0;
}
.visitor-meta { flex: 1; min-width: 0; }
.visitor-name { font-size: var(--fs-sm); color: var(--color-text-primary); font-weight: 600; }
.visitor-page { font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-inspector { display: flex; flex-direction: column; height: 100%; }
.chat-inspector-head { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-border-subtle); display: flex; align-items: center; justify-content: space-between; }
.chat-thread { flex: 1; overflow-y: auto; padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); }

.msg { max-width: 70%; padding: 10px 14px; border-radius: var(--radius-md); font-size: var(--fs-sm); line-height: 1.5; }
.msg-visitor { align-self: flex-start; background: var(--color-graphite-600); color: var(--color-text-secondary); border: 1px solid var(--color-border-subtle); }
.msg-ai { align-self: flex-end; background: rgba(255, 215, 0, 0.1); color: var(--color-text-primary); border: 1px solid rgba(255, 215, 0, 0.25); }
.msg-source { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: var(--fs-xs); color: var(--color-gold-400); }

.chat-inspector-foot { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--color-border-subtle); display: flex; gap: var(--space-sm); }
.chat-inspector-foot .input-field { flex: 1; }

/* ---------------------------- Guardrail section ---------------------------- */
.guardrail-section { margin-top: var(--space-xl); }
.guardrail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-lg); padding: var(--space-lg) 0; border-bottom: 1px solid var(--color-border-subtle); }
.guardrail-row:last-child { border-bottom: none; }
.guardrail-info h4 { font-size: var(--fs-sm); color: var(--color-text-primary); font-family: var(--font-body); margin-bottom: 4px; }
.guardrail-info p { font-size: var(--fs-xs); color: var(--color-text-muted); max-width: 480px; }

/* ---------------------------- Home hero cards ---------------------------- */
.home-shell { position: relative; z-index: var(--z-content); min-height: 100vh; display: flex; flex-direction: column; }
.home-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-lg) var(--space-2xl);
  border-bottom: 1px solid var(--color-border-subtle);
}
.home-topbar .brand { display: flex; align-items: center; gap: 10px; }
.home-topbar .brand img { width: 28px; height: 28px; }
.home-topbar .brand span { font-family: var(--font-display); letter-spacing: 0.14em; font-size: var(--fs-sm); }
.home-topbar-right { display: flex; align-items: center; gap: var(--space-lg); }

.home-hero { text-align: center; padding: var(--space-2xl) var(--space-lg) var(--space-xl); }
.home-hero h1 { font-size: var(--fs-3xl); margin-bottom: var(--space-md); }
.home-hero p { font-size: var(--fs-md); color: var(--color-text-secondary); max-width: 680px; margin: 0 auto; }
.home-hero .tag-row { display: flex; justify-content: center; gap: var(--space-sm); margin-top: var(--space-lg); flex-wrap: wrap; }

.module-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  max-width: 1040px;
  width: 100%;
  margin: var(--space-xl) auto var(--space-2xl);
  padding: 0 var(--space-lg);
  flex: 1;
}

.module-card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-slow);
}
.module-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-slow);
}
.module-card:hover {
  border-color: var(--color-gold-600);
  transform: translateY(-6px);
  box-shadow: var(--glow-gold-lg), var(--shadow-elevate);
}
.module-card:hover::before { opacity: 1; }

.module-avatar {
  width: 148px; height: 148px;
  border-radius: 50%;
  margin: 0 auto var(--space-lg);
  border: 3px solid var(--color-gold-500);
  box-shadow: var(--glow-gold-md);
  overflow: hidden;
  position: relative;
}
.module-avatar img { width: 100%; height: 100%; object-fit: cover; }
.module-avatar-ring {
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 215, 0, 0.35);
}

.module-card h2 { font-size: var(--fs-lg); margin-bottom: var(--space-sm); }
.module-card .module-desc { font-size: var(--fs-sm); color: var(--color-text-muted); margin-bottom: var(--space-lg); min-height: 42px; }

.module-stats { display: flex; justify-content: center; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.module-stat { display: flex; flex-direction: column; align-items: center; }
.module-stat .stat-value { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--color-gold-300); }
.module-stat .stat-label { font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: 2px; }

.module-card .btn { width: 100%; justify-content: center; }

/* ---------------------------- Placeholder / coming soon ---------------------------- */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl);
  min-height: 420px;
  border: 1px dashed var(--color-border-subtle);
  border-radius: var(--radius-xl);
  background: var(--gradient-card);
}
.coming-soon .icon-ring {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 1px solid var(--color-gold-600);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-lg);
  box-shadow: var(--glow-gold-sm);
}
.coming-soon .icon-ring svg { width: 36px; height: 36px; color: var(--color-gold-400); }
.coming-soon h2 { font-size: var(--fs-lg); margin-bottom: var(--space-sm); }
.coming-soon p { color: var(--color-text-muted); font-size: var(--fs-sm); max-width: 420px; }

/* ---------------------------- Utility ---------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--fs-sm); }
.w-full { width: 100%; }

/* ---------------------------- Responsive ---------------------------- */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-60-40, .grid-50-50, .split-view, .grid-2col { grid-template-columns: 1fr; }
  .module-cards { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-elevate); }
  .main-area { margin-left: 0; }
  .inbox-layout { grid-template-columns: 1fr; height: auto; }
  .nav-toggle { display: flex !important; }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 215, 0, 0.08);
  color: var(--color-gold-300);
  border: 1px solid var(--color-border-subtle);
}
