/* ─── DASHBOARD WINDOW ───────────────────────────────────── */
.dash-window {
  background: var(--bg);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(15, 10, 30, 0.12), 0 12px 24px rgba(15, 10, 30, 0.08),
              0 0 0 1px rgba(15, 10, 30, 0.04);
  font-size: 13px;
  line-height: 1.45;
  isolation: isolate;
  width: 100%;
}

/* Chrome */
.dash-chrome {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 10px 14px;
  background: var(--n-50);
  border-bottom: 1px solid var(--border);
}
.dash-traffic { display: flex; gap: 6px; }
.dash-traffic span { width: 11px; height: 11px; border-radius: 50%; display: block; }
.dash-urlbar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--n-500);
  max-width: 360px;
  margin: 0 auto;
}
.dash-chrome-right { color: var(--n-400); }

/* Body */
.dash-body {
  display: grid;
  grid-template-columns: 208px 1fr;
  min-height: 480px;
}

/* Sidebar */
.dash-sidebar {
  background: var(--n-50);
  border-right: 1px solid var(--border);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.dash-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--n-900);
  font-size: 14px;
  letter-spacing: -0.02em;
}
.dash-logo {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--purple-600);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.dash-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--n-600);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.dash-nav-item:hover { background: var(--n-100); }
.dash-nav-item.active {
  background: var(--bg);
  color: var(--purple-700);
  box-shadow: var(--sh-xs);
}
.dash-sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
}
.dash-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--purple-100);
  color: var(--purple-700);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Main */
.dash-main {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  overflow: hidden;
  min-width: 0;
}
.dash-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.dash-crumb {
  font-size: 11px;
  color: var(--n-500);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.dash-crumb span { margin: 0 6px; }
.dash-main-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--n-900);
  letter-spacing: -0.015em;
}
.dash-main-actions { display: flex; gap: 8px; }

.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--n-700);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.dash-chip:hover { border-color: var(--border-strong); }
.dash-chip.active {
  background: var(--n-900);
  color: white;
  border-color: var(--n-900);
}
.dash-chip-group { display: inline-flex; gap: 6px; }

/* KPIs */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
}
.dash-kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dash-kpi-label {
  font-size: 11px;
  color: var(--n-500);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.dash-kpi-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--n-900);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.dash-kpi-value.mono { font-family: var(--font-mono); letter-spacing: -0.03em; }
.dash-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  margin-top: 2px;
}
.dash-kpi-delta.up { color: #047857; }
.dash-kpi-delta.down { color: #047857; }

/* Split */
.dash-split {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: var(--s-3);
}
.dash-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-width: 0;
}
.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.dash-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--n-900);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.dash-legend {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--n-600);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.dash-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dash-legend i {
  width: 10px; height: 3px;
  border-radius: 1px;
  display: inline-block;
}

/* Chart container */
.dash-chart {
  width: 100%;
}

/* Donut */
.dash-donut {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.dash-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  font-size: 11px;
}
.dash-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-donut-legend-item .dot {
  width: 8px; height: 8px; border-radius: 2px;
}
.dash-donut-legend-item .label {
  color: var(--n-700);
  flex: 1;
}
.dash-donut-legend-item .val {
  color: var(--n-900);
  font-weight: 500;
  font-size: 11px;
}

/* Table */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-table thead th {
  text-align: left;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 500;
  color: var(--n-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.dash-table tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--n-100);
  vertical-align: middle;
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover { background: var(--n-50); }

.dash-client { display: flex; align-items: center; gap: 10px; }
.dash-avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.dash-client-name {
  color: var(--n-900);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.2;
}
.dash-channel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--n-100);
  color: var(--n-700);
  font-size: 10px;
  font-weight: 500;
  text-transform: capitalize;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Skeleton placeholders — keeps the dashboard aspirational, not realistic */
.dash-skel {
  display: inline-block;
  background: linear-gradient(90deg, var(--n-100) 0%, var(--n-200, #eef0f4) 50%, var(--n-100) 100%);
  background-size: 220% 100%;
  border-radius: 3px;
  height: 9px;
  vertical-align: middle;
  animation: dash-skel-shimmer 2.6s ease-in-out infinite;
}
.dash-skel.lg { height: 16px; border-radius: 4px; }
.dash-skel.md { height: 11px; border-radius: 3px; }
.dash-skel.sm { height: 7px; border-radius: 2px; }
.dash-skel.block { display: block; }
@keyframes dash-skel-shimmer {
  0%, 100% { background-position: 220% 0; }
  50% { background-position: 0 0; }
}
.dash-skel-circle {
  display: inline-block;
  background: var(--n-100);
  border-radius: 50%;
  vertical-align: middle;
}

/* Compact variant (for réguas section) */
.dash-compact .dash-body { min-height: auto; }
.dash-compact .dash-sidebar { display: none; }
.dash-compact .dash-body { grid-template-columns: 1fr; }

/* Responsive */
@media (max-width: 900px) {
  .dash-body { grid-template-columns: 1fr; min-height: auto; }
  .dash-sidebar { display: none; }
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-split { grid-template-columns: 1fr; }
  .dash-table { font-size: 11px; }
  .dash-table thead th, .dash-table tbody td { padding: 8px 6px; }
}

@media (max-width: 640px) {
  .dash-panel:has(.dash-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dash-table { min-width: 520px; }
}
