/* Dashboard-specific styles — command center layout, KPI cards, chart, job table. */
/* Builds on top of theme.css design tokens — never redefines :root or base typography. */

/* ─── Layout ─────────────────────────────────────────────────────────── */
.dash-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ─── Sidebar ─────────────────────────────────────────────────────────── */
.dash-sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.dash-logo {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  letter-spacing: -0.02em;
  margin-bottom: 36px;
  padding: 0 8px;
}

.dash-logo strong {
  font-weight: 800;
  color: #FFFFFF;
}

.dash-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.dash-nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.dash-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.dash-nav-item.active {
  background: rgba(255,255,255,0.14);
  color: #FFFFFF;
}

.dash-sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.dash-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
}

.dash-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.dash-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
}

.dash-user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

/* ─── Main content area ───────────────────────────────────────────────── */
.dash-main {
  margin-left: 220px;
  flex: 1;
  padding: 36px 40px 60px;
  max-width: 1100px;
}

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

.dash-eyebrow {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.dash-title {
  font-size: 28px;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.dash-date {
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 6px;
}

/* ─── KPI Cards ───────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}

.kpi-card--dark {
  background: var(--primary);
  border-color: var(--primary);
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
}

.kpi-icon--green { background: var(--accent-light); color: var(--primary); }
.kpi-icon--sage  { background: #EAF0E9; color: var(--accent); }

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

.kpi-label--light { color: rgba(255,255,255,0.6); }

.kpi-value {
  font-family: 'Syne', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.kpi-value--light { color: #FFFFFF; }

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

.kpi-badge--up      { background: #D4EDDA; color: #155724; }
.kpi-badge--neutral { background: var(--border); color: var(--text-muted); }
.kpi-badge--light   { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); }

/* ─── Revenue Chart ───────────────────────────────────────────────────── */
.chart-section {
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 20px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 160px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

/* Tooltip on hover */
.chart-bar-tooltip {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.chart-bar-wrap:hover .chart-bar-tooltip {
  opacity: 1;
}

.chart-bar {
  width: 100%;
  background: var(--accent-light);
  border-radius: 6px 6px 0 0;
  transition: background 0.2s;
  min-height: 6px;
}

.chart-bar:hover {
  background: var(--accent);
}

.chart-bar--active {
  background: var(--primary);
}

.chart-bar--active:hover {
  background: var(--primary);
  opacity: 0.85;
}

.chart-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  white-space: nowrap;
}

/* ─── Jobs Table ──────────────────────────────────────────────────────── */
.jobs-section {
  margin-bottom: 40px;
}

.jobs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.jobs-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.jobs-table-wrap {
  overflow-x: auto;
}

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.jobs-table thead tr {
  border-bottom: 1px solid var(--border);
}

.jobs-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
}

.jobs-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.jobs-table tbody tr:hover td {
  background: #F4F7F4;
}

.job-customer {
  font-weight: 600;
  color: var(--text);
}

.job-title {
  color: var(--text-muted);
}

.job-date {
  color: var(--text-muted);
  white-space: nowrap;
}

.job-revenue {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--primary);
}

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

.status--completed  { background: #D4EDDA; color: #155724; }
.status--scheduled  { background: #D1ECF1; color: #0C5460; }
.status--cancelled  { background: #F8D7DA; color: #721C24; }
.status--inprogress { background: #FFF3CD; color: #856404; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dash-sidebar {
    display: none;
  }
  .dash-main {
    margin-left: 0;
    padding: 24px 20px 60px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .dash-header {
    flex-direction: column;
    gap: 6px;
  }
  .chart-bars {
    height: 120px;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}
