/* ============================================================
   Dashboard page layout
   ============================================================ */

.dash-page {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Bar chart ──────────────────────────────────────────────── */
.dash-chart-wrap {
  padding: 16px 20px 12px;
}
.dash-bar-chart {
  width: 100%;
  display: block;
  overflow: visible;
}
.dash-bar {
  fill: hsl(var(--primary) / 0.22);
  transition: fill .15s;
}
.dash-bar:hover {
  fill: hsl(var(--primary) / 0.38);
}
.dbc-bar--hi {
  fill: hsl(var(--primary));
}
.dbc-bar--hi:hover {
  fill: hsl(var(--primary));
}
.dbc-grid {
  stroke: hsl(var(--border));
  stroke-width: 0.75;
  stroke-dasharray: 3 5;
}
.dbc-grid--top {
  stroke-dasharray: none;
}
.dbc-lbl-num {
  font-size: 11px;
  font-family: inherit;
  fill: hsl(var(--muted-foreground));
  text-anchor: middle;
  font-weight: 500;
}
.dbc-lbl-num--hi {
  fill: hsl(var(--primary));
  font-weight: 700;
}
.dbc-lbl-mon {
  font-size: 11px;
  font-family: inherit;
  fill: hsl(var(--muted-foreground));
  text-anchor: middle;
}
.dbc-lbl-mon--hi {
  fill: hsl(var(--foreground));
  font-weight: 600;
}
.dbc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 2px;
  border-top: 1px solid hsl(var(--border));
  margin-top: 4px;
}
.dbc-footer-label {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
.dbc-footer-value {
  font-size: 13px;
  font-weight: 700;
  color: hsl(var(--foreground));
}
.dash-bar-label-top {
  font-size: 10px;
  font-family: inherit;
  fill: hsl(var(--foreground));
  text-anchor: middle;
  font-weight: 600;
}
.dash-bar-label-x {
  font-size: 10px;
  font-family: inherit;
  fill: hsl(var(--muted-foreground));
  text-anchor: middle;
}
.dash-baseline {
  stroke: hsl(var(--border));
  stroke-width: 1;
}

/* ── List (recent + agenda) ─────────────────────────────────── */
.dash-list {
  padding: 4px 8px 8px;
}
.dash-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 8px;
  border-radius: var(--radius);
  text-decoration: none;
  gap: 12px;
  transition: background .1s;
}
.dash-list-item:hover { background: hsl(var(--accent)); }

.dli-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.dli-cod {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dli-cliente {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dli-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.dli-totale {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.dli-date {
  font-size: 12px;
  font-weight: 700;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.10);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Horizontal bars (top clienti) ─────────────────────────── */
.dash-hbars {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-hbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dhb-label {
  font-size: 12px;
  color: hsl(var(--foreground));
  width: 120px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dhb-track {
  flex: 1;
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 999px;
  overflow: hidden;
}
.dhb-fill {
  height: 100%;
  background: hsl(var(--primary) / 0.7);
  border-radius: 999px;
  min-width: 4px;
}
.dhb-value {
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  width: 64px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Section label inside card ──────────────────────────────── */
.dash-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  padding: 8px 16px 4px;
}

/* ── Statistiche page ────────────────────────────────────────── */
.stat-trend-chart {
  width: 100%;
  display: block;
  overflow: visible;
}
.stat-bar-offerte {
  fill: hsl(var(--primary) / 0.28);
  transition: fill .15s;
}
.stat-bar-offerte:hover { fill: hsl(var(--primary) / 0.45); }
.stat-bar-ordini {
  fill: hsl(var(--success));
  opacity: .75;
  transition: opacity .15s;
}
.stat-bar-ordini:hover { opacity: 1; }
.stat-legend {
  display: flex;
  gap: 16px;
  padding: 6px 0 2px;
  border-top: 1px solid hsl(var(--border));
  margin-top: 4px;
}
.stat-legend > span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
.stat-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}
.stat-cod-link {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: hsl(var(--primary));
  text-decoration: none;
}
.stat-cod-link:hover { text-decoration: underline; }
.stat-mono {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
}
.dhb-mono {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
}
