.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 6px 6px;
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin: 0 0 var(--space-2); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.card-head .card-title { margin: 0; }

/* Colored "material" stat cards (Materialized style) */
.stat-card { border: none; color: #fff; position: relative; overflow: hidden; padding: 14px 16px 10px; cursor: default; border-radius: 6px 6px 20px 20px; }
.stat-card .card-title { color: rgba(255,255,255,0.9); font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.stat-card .kpi-value { font-size: 24px; font-weight: 750; line-height: 1.1; }
.stat-card .kpi-delta { font-size: 12px; font-weight: 600; margin-top: 3px; opacity: 0.95; }
.stat-card .kpi-spark { margin-top: 8px; height: 34px; }
.stat-card .kpi-bars { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin-top: 8px; opacity: 0.55; }
.stat-card .kpi-bars i { display: block; flex: 1; background: #fff; border-radius: 2px 2px 0 0; }
.stat-card.green { background: linear-gradient(160deg, #4caf50, var(--m-green)); }
.stat-card.purple { background: linear-gradient(160deg, #ab47bc, var(--m-purple)); }
.stat-card.slate { background: linear-gradient(160deg, #78909c, var(--m-slate)); }
.stat-card.pink { background: linear-gradient(160deg, #f06292, var(--m-pink)); }
.stat-card.teal { background: linear-gradient(160deg, #4dd0e1, var(--m-teal)); }
.stat-card.orange { background: linear-gradient(160deg, #ffb74d, var(--m-orange)); }

/* Hero chart card with colored header band (Materialized "Revenue" style) */
.hero-card { padding: 0; overflow: hidden; border-radius: 28px 28px 6px 6px; }
.hero-card .hero-head {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; padding: 14px 16px 6px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.hero-card .hero-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.hero-card .hero-head .hero-sub { font-size: 12px; opacity: 0.85; }
.hero-card .hero-body { padding: 8px 12px 12px; }
.hero-pill { background: rgba(255,255,255,0.18); border-radius: 8px; padding: 6px 10px; font-size: 12px; text-align: right; line-height: 1.3; }
.hero-pill strong { font-size: 14px; display: block; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.mock-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; color: var(--text-faint);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 8px; letter-spacing: 0.01em;
}
.mock-banner {
  font-size: 12px; color: var(--text-muted); background: var(--surface-2);
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom: var(--space-3);
}

.filter-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.filter-chip {
  font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); cursor: pointer;
}
.filter-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.filter-chip select { border: none; background: none; font: inherit; color: inherit; }
.filter-chip select option { color: #111; }

.data-table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.02em; padding: 8px 10px;
  border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap;
}
table.data-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tbody tr { cursor: pointer; }
table.data-table tbody tr:hover { background: var(--surface-2); }
.trend-pos { color: var(--green); font-weight: 600; }
.trend-neg { color: var(--red); font-weight: 600; }

.tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--border); margin-bottom: var(--space-3); }
.tab-btn {
  background: none; border: none; padding: 8px 4px; font-size: 13px; font-weight: 600;
  color: var(--text-faint); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.brief-card { border: 1px solid var(--border); border-radius: 6px 6px 18px 18px; padding: var(--space-3); background: var(--surface); }
.brief-card + .brief-card { margin-top: var(--space-3); }
.brief-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.brief-card-company { font-weight: 650; font-size: 14px; }
.brief-card-date { font-size: 11.5px; color: var(--text-faint); }
.brief-section { margin-top: var(--space-2); }
.brief-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent); margin-bottom: 3px; }
.brief-take { font-size: 13.5px; line-height: 1.5; }
.brief-flags { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.brief-flag { font-size: 12px; border-radius: var(--radius-sm); padding: 8px 10px; flex: 1 1 220px; border: 1px solid var(--border); background: var(--surface-2); }
.brief-flag.present { background: var(--accent-soft); border-color: var(--accent); }
.brief-flag-title { font-weight: 650; margin-bottom: 2px; }
.brief-action { font-size: 13px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: var(--space-2); border-left: 3px solid var(--m-orange); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 600; border-radius: var(--radius-sm);
  padding: 9px 16px; cursor: pointer; border: 1px solid transparent; color: var(--text);
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--accent-glow); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.fab {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--m-pink); color: #fff; font-size: 22px; line-height: 1;
  box-shadow: 0 6px 18px rgba(233, 30, 99, 0.45); display: inline-flex; align-items: center; justify-content: center;
}

.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--space-3); }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.form-field input, .form-field select, .form-field textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
}
.form-field select option { color: #111; }
.form-hint { font-size: 11.5px; color: var(--text-faint); }

.snapshot-field { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.snapshot-field:last-child { border-bottom: none; }

.empty-dash { color: var(--text-faint); }

.pipeline-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pipeline-steps li { display: flex; align-items: center; gap: 8px; color: var(--text-faint); }
.pipeline-steps li.done { color: var(--green); }
.pipeline-steps li.active { color: var(--text); font-weight: 600; }

.section-title { font-size: 20px; font-weight: 700; margin: 0 0 var(--space-1); }
.section-subtitle { font-size: 13px; color: var(--text-muted); margin: 0 0 var(--space-4); }

/* Clickable list rows (needs attention, donut breakdown) */
.list-row {
  display: flex; justify-content: space-between; align-items: center; padding: 9px 6px;
  border-bottom: 1px solid var(--border); gap: 8px; cursor: pointer; border-radius: 6px;
}
.list-row:hover { background: var(--surface-2); }
.list-row:last-child { border-bottom: none; }
.list-row .row-title { font-weight: 600; font-size: 13px; }
.list-row .row-sub { font-size: 11.5px; color: var(--text-faint); }

/* Circular progress ring (CRM style) */
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }

/* Chart builder */
.chart-builder { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chart-builder select { font: inherit; font-size: 12.5px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.chart-builder select option { color: #111; }
.custom-chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.custom-chart-grid > * { min-width: 0; }
.chart-remove { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 16px; line-height: 1; }
.chart-remove:hover { color: var(--red); }

.modal-overlay { position: fixed; inset: 0; background: rgba(5, 9, 18, 0.6); z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 28px 28px 8px 8px; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-head { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; color: #fff; border-radius: 28px 28px 0 0; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 2px, transparent 2px 40px); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 8px 12px 12px; }
