body {
  background: var(--dash-bg);
  color: var(--dash-text);
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--dash-border);
  background: var(--dash-card);
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dash-text);
}

.header-sub {
  font-size: 13px;
  color: var(--dash-muted);
  margin-left: 12px;
}

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

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--dash-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(0, 200, 83, 0); }
}

.last-updated {
  font-size: 13px;
  color: var(--dash-muted);
}

.countdown {
  font-size: 12px;
  font-weight: 600;
  color: var(--dash-muted);
  background: var(--dash-bg);
  padding: 4px 10px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

/* ── Grid ─────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 32px;
  min-height: calc(100vh - 140px);
}

/* ── Panel ────────────────────────────────────────────────── */
.panel {
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--dash-border);
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dash-text);
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--dash-muted);
}
.badge-green { background: rgba(0, 200, 83, 0.15); color: var(--dash-green); }
.badge-blue { background: rgba(68, 138, 255, 0.15); color: var(--dash-blue); }
.badge-orange { background: rgba(255, 145, 0, 0.15); color: var(--dash-orange); }
.badge-red { background: rgba(255, 61, 0, 0.15); color: var(--dash-red); }

.panel-body {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
}

.loading {
  color: var(--dash-muted);
  font-size: 14px;
  text-align: center;
  padding: 32px;
}

/* ── Data Table ───────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dash-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--dash-border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30, 40, 50, 0.5);
  color: var(--dash-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr.emergency { background: rgba(255, 61, 0, 0.06); }

/* Status badges in table */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-new { background: rgba(68, 138, 255, 0.15); color: var(--dash-blue); }
.status-qualified { background: rgba(255, 145, 0, 0.15); color: var(--dash-orange); }
.status-booked { background: rgba(0, 200, 83, 0.15); color: var(--dash-green); }
.status-estimate_sent { background: rgba(255, 145, 0, 0.15); color: var(--dash-orange); }
.status-completed { background: rgba(0, 200, 83, 0.15); color: var(--dash-green); }
.status-lost { background: rgba(255, 61, 0, 0.15); color: var(--dash-red); }

.urgency-emergency {
  color: var(--dash-red);
  font-weight: 700;
}
.urgency-normal { color: var(--dash-muted); }

/* ── Activity Feed ────────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(30, 40, 50, 0.5);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-dot.green { background: var(--dash-green); }
.activity-dot.blue { background: var(--dash-blue); }
.activity-dot.orange { background: var(--dash-orange); }
.activity-dot.red { background: var(--dash-red); }

.activity-content { flex: 1; }

.activity-event {
  color: var(--dash-text);
  line-height: 1.4;
}

.activity-time {
  font-size: 11px;
  color: var(--dash-muted);
  margin-top: 2px;
}

/* ── Finance Cards ────────────────────────────────────────── */
.finance-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.finance-card {
  background: var(--dash-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.finance-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dash-muted);
  margin-bottom: 4px;
}

.finance-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.finance-value.revenue { color: var(--dash-green); }
.finance-value.expenses { color: var(--dash-red); }
.finance-value.net { color: var(--dash-blue); }

.finance-delta {
  font-size: 12px;
  margin-top: 4px;
}
.finance-delta.up { color: var(--dash-green); }
.finance-delta.down { color: var(--dash-red); }

/* ── Category Bars ────────────────────────────────────────── */
.category-bars { margin-top: 8px; }

.cat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.cat-label {
  width: 120px;
  flex-shrink: 0;
  color: var(--dash-muted);
  text-align: right;
}

.cat-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--dash-bg);
  border-radius: 4px;
  overflow: hidden;
}

.cat-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--dash-blue);
  transition: width 0.6s ease;
}

.cat-amount {
  width: 70px;
  flex-shrink: 0;
  color: var(--dash-text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ── Stats Cards ──────────────────────────────────────────── */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--dash-bg);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--dash-text);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--dash-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Footer ───────────────────────────────────────────────── */
.dash-footer {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: var(--dash-muted);
  border-top: 1px solid var(--dash-border);
}
.dash-footer a { color: var(--dash-blue); }
.dash-footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr; padding: 16px; }
  .header { padding: 16px; }
  .finance-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .header { flex-direction: column; gap: 12px; }
  .header-right { gap: 12px; }
  .finance-cards { grid-template-columns: 1fr; }
}
