/* MexConsumerPulse - Modern Executive Dark Theme Design System */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #101522;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 230, 153, 0.3);
  
  --text-main: #f0f4fc;
  --text-muted: #8b9bb4;
  --text-dim: #5c6b84;

  --accent-green: #00e699;
  --accent-green-glow: rgba(0, 230, 153, 0.18);
  --accent-cyan: #00bfff;
  --accent-red: #ff4757;
  --accent-red-glow: rgba(255, 71, 87, 0.2);
  --accent-amber: #ffa502;
  --accent-purple: #9b59b6;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-subtle: 0 8px 32px rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 25px rgba(0, 230, 153, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow */
.glow-bg {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 230, 153, 0.08) 0%, rgba(0, 191, 255, 0.04) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

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

.logo-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flag-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.swarm-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 230, 153, 0.08);
  border: 1px solid rgba(0, 230, 153, 0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 230, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 153, 0); }
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #00e699, #00bfff);
  color: #06111e;
  box-shadow: 0 4px 15px rgba(0, 230, 153, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 230, 153, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 36px 60px;
  position: relative;
  z-index: 1;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.kpi-footer {
  font-size: 12px;
  color: var(--text-dim);
}

.text-urgent {
  color: var(--accent-red);
}

.text-accent {
  color: var(--accent-green);
}

.alert-card {
  border-left: 4px solid var(--accent-red);
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #06111e;
  background: var(--text-main);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
}

/* Tab Contents */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* Daily Report Container */
.report-container {
  padding: 36px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.report-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 8px 0 4px;
}

.report-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.badge-pill {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(0, 230, 153, 0.1);
  color: var(--accent-green);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.executive-summary-box {
  background: rgba(0, 230, 153, 0.04);
  border: 1px solid rgba(0, 230, 153, 0.2);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.executive-summary-box ul {
  list-style: none;
}

.executive-summary-box li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 14px;
}

.executive-summary-box li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent-green);
  font-weight: bold;
}

.report-body {
  font-size: 15px;
  color: #d1d9e6;
  line-height: 1.7;
}

.report-body h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.report-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 20px 0 10px;
}

.report-body p {
  margin-bottom: 14px;
}

.report-body ul {
  margin: 0 0 20px 20px;
}

.report-body li {
  margin-bottom: 6px;
}

.report-body blockquote {
  border-left: 3px solid var(--accent-green);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
  font-style: italic;
  color: var(--text-muted);
}

.report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 13px;
}

.report-body th, .report-body td {
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.report-body th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-weight: 600;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 24px;
  margin-bottom: 24px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.filter-select, .search-input {
  background: rgba(10, 14, 22, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s ease;
}

.filter-select:focus, .search-input:focus {
  border-color: var(--accent-green);
}

.search-group {
  flex: 1;
  min-width: 250px;
}

/* Problems Grid */
.table-container {
  padding: 24px;
}

.table-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.compliance-badge {
  color: var(--accent-green);
  font-weight: 600;
}

.problems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 18px;
}

.problem-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius-sm);
  background: rgba(16, 22, 34, 0.6);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.problem-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(22, 30, 48, 0.7);
}

.problem-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.problem-category-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 191, 255, 0.1);
  color: var(--accent-cyan);
}

.problem-urgency {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-red);
}

.problem-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
  line-height: 1.4;
}

.problem-content {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.problem-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 11px;
}

.meta-pill {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--text-muted);
}

.problem-opp-box {
  background: rgba(0, 230, 153, 0.04);
  border-left: 2px solid var(--accent-green);
  padding: 8px 12px;
  border-radius: 0 4px 4px 0;
  font-size: 11px;
  color: #d1fae5;
  margin-top: auto;
}

.problem-opp-title {
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 2px;
}

/* Venture Opportunities */
.ventures-intro {
  padding: 28px;
  margin-bottom: 24px;
}

.ventures-intro h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.ventures-intro p {
  color: var(--text-muted);
  font-size: 14px;
}

.ventures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.venture-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.venture-header {
  margin-bottom: 14px;
}

.venture-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(155, 89, 182, 0.15);
  color: #d7bde2;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.venture-concept {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.venture-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.venture-tags {
  display: flex;
  gap: 8px;
  font-size: 11px;
}

/* Agent Swarm Console */
.console-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.agent-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.agent-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.agent-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-name h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.agent-target {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.agent-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.agent-footer {
  display: flex;
  gap: 8px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.badge-success {
  background: rgba(0, 230, 153, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 153, 0.3);
}

.badge-warning {
  background: rgba(255, 165, 2, 0.1);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 165, 2, 0.3);
}

.schedule-box {
  padding: 24px;
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.schedule-box p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  width: 90%;
  max-width: 550px;
  padding: 28px;
  position: relative;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-body p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.setup-steps {
  margin: 0 0 16px 20px;
  font-size: 13px;
  color: #cbd5e1;
}

.setup-steps li {
  margin-bottom: 8px;
}

.terminal-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-green);
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-card-hover);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 300;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}

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

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 13px;
}
