/* Saflio POS — Dashboard Module */

.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dashboard-header h3 {
  font-size: 1.2em;
}

.dashboard-date {
  color: var(--text-muted);
  font-size: 0.9em;
}

/* Summary cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.dashboard-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.dashboard-card-label {
  font-size: 0.8em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.dashboard-card-value {
  font-size: 1.6em;
  font-weight: 800;
}

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

.dashboard-card-value.warning {
  color: var(--warning);
}

.dashboard-card-value.danger {
  color: var(--danger);
}

.dashboard-card-sub {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dashboard-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.dashboard-stats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}

.dashboard-stat-label {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.dashboard-stat-value {
  font-weight: 700;
}

.dashboard-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-alert {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.dashboard-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--warning);
}

.dashboard-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--danger);
}

.dashboard-alert-name {
  font-weight: 600;
}

.dashboard-alert-detail {
  color: var(--text-muted);
}

/* Quick action buttons */
.dashboard-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

/* ── Dashboard v2 — charts ── */
.dash-chart-wrap { position: relative; display: inline-flex; justify-content: center; }
.dash-chart-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.dash-chart-center-val { font-size: 1.15rem; font-weight: 800; }
.dash-chart-center-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-chart-empty { color: var(--text-muted); font-size: 0.85rem; padding: 1rem 0; text-align: center; }
.dash-legend { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.6rem; }
.dash-legend-item { display: flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; }
.dash-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dash-legend-label { color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-legend-val { font-weight: 700; }

.dash-bars { display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; padding-top: 0.5rem; }
.dash-bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.dash-bar-val { font-size: 0.62rem; color: var(--text-muted); margin-bottom: 2px; white-space: nowrap; }
.dash-bar { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: 0.85; transition: opacity 0.15s; }
.dash-bar-col:hover .dash-bar { opacity: 1; }
.dash-bar-label { font-size: 0.62rem; color: var(--text-muted); margin-top: 3px; }

.dash-hbar-row { margin-bottom: 0.55rem; }
.dash-hbar-top { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; margin-bottom: 0.2rem; }
.dash-hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-hbar-val { font-weight: 700; flex-shrink: 0; }
.dash-hbar-track { background: var(--border-light, rgba(128,128,128,0.15)); border-radius: 4px; height: 7px; overflow: hidden; }
.dash-hbar-fill { background: linear-gradient(90deg, #7c3aed, #f97316); height: 100%; border-radius: 4px; }
html[data-theme="dark"] .dash-hbar-track { background: #30303a; }
html[data-theme="dark"] .dash-chart-empty { color: #9ca3af; }
