/* Attribution Dashboard — LUMINA Global Light Theme */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-hover: #fbfbfd;
  --border: #d2d2d7;

  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #a1a1a6;

  --accent-brand: #000000;
  --accent-blue: #0071e3;
  --accent-purple: #5856d6;
  --accent-cyan: #5ac8fa;
  --accent-orange: #ff9500;
  --accent-red: #ff3b30;
  --accent-green: #34c759;
  --accent-pink: #d946ef;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);

  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  width: 100%;
  max-width: 1100px;
  padding: 60px 32px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
  position: sticky;
  top: 20px;
  z-index: 10;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 24px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  height: 26px;
}

.brand span {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  padding: 8px 16px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.back-link:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Page Title */
.page-title {
  text-align: center;
  margin-bottom: 48px;
}

.page-title h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-title p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Card */
.card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 24px;
  border: 1px solid white;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bg);
}

.card-header .card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-header i {
  color: var(--text-secondary);
}

/* KPI Row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  text-align: center;
  border: 1px solid white;
}

.kpi-card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.kpi-card .value.blue {
  color: var(--accent-blue);
}

.kpi-card .value.green {
  color: var(--accent-green);
}

.kpi-card .value.purple {
  color: var(--accent-purple);
}

.kpi-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Bar Charts */
.bar-group {
  margin-bottom: 14px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.bar-label .name {
  font-weight: 500;
  color: var(--text-primary);
}

.bar-label .pct {
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.bar-fill.blue {
  background: var(--accent-blue);
}

.bar-fill.pink {
  background: var(--accent-pink);
}

.bar-fill.orange {
  background: var(--accent-orange);
}

.bar-fill.red {
  background: var(--accent-red);
}

.bar-fill.cyan {
  background: var(--accent-cyan);
}

.bar-fill.green {
  background: var(--accent-green);
}

.bar-fill.purple {
  background: var(--accent-purple);
}

/* Waterfall */
.waterfall {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.wf-row .wf-label {
  width: 140px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.wf-row .wf-bar-wrap {
  flex: 1;
  height: 28px;
  background: var(--bg);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.wf-row .wf-bar {
  position: absolute;
  height: 100%;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.wf-row .wf-amount {
  width: 80px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.wf-amount.positive {
  color: var(--accent-green);
}

.wf-amount.negative {
  color: var(--accent-red);
}

/* Channel Split */
.channel-split {
  display: flex;
  gap: 32px;
  align-items: center;
}

.donut-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 14px solid var(--accent-blue);
  border-right-color: var(--accent-pink);
  border-bottom-color: var(--accent-orange);
  position: relative;
  flex-shrink: 0;
}

.donut-placeholder::after {
  content: 'P/M Split';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.channel-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Simulator */
.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  margin-bottom: 24px;
}

.sim-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-field label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sim-field input,
.sim-field select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

.sim-field input:focus,
.sim-field select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.sim-btn {
  background: var(--text-primary);
  border: none;
  border-radius: 12px;
  padding: 10px 24px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.sim-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.sim-result {
  background: var(--bg);
  border-radius: 16px;
  padding: 24px;
}

.sim-result strong {
  font-size: 14px;
  color: var(--text-primary);
}

.sim-result .breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.sim-result .breakdown .item .val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.sim-result .breakdown .item .lbl {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Audit Table */
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.audit-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.audit-table td {
  padding: 12px;
  border-bottom: 1px solid var(--bg);
  color: var(--text-primary);
}

.audit-table tr:hover td {
  background: var(--bg);
}

.hash {
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge.verified {
  background: rgba(52, 199, 89, 0.1);
  color: var(--accent-green);
}

.badge.pending {
  background: rgba(255, 149, 0, 0.1);
  color: var(--accent-orange);
}

/* Footer */
footer {
  margin-top: auto;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 40px 20px;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  header {
    border-radius: 14px;
    padding: 12px 16px;
  }
}