/* ===================================================================
   YOPPI — Dashboard prototype styles (integrated with main site shell)
   =================================================================== */

.dash-body {
  background: var(--bg-alt);
}

/* ---------- Org chip (in site header nav-actions) ---------- */
.org-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.org-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.org-chip strong {
  display: block;
  font-size: 0.84rem;
}

.org-chip span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .nav-actions .org-chip {
    display: none;
  }
  .nav-actions .btn-secondary {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .nav-actions .btn-secondary span {
    display: none;
  }
}

/* ---------- Sub navigation (tabs) ---------- */
.dash-subnav {
  position: sticky;
  top: 84px;
  z-index: 40;
  background:
    radial-gradient(900px 240px at 15% -60%, var(--blue-100), transparent 60%),
    var(--blue-50);
  border-bottom: 1px solid var(--border);
}

.dash-subnav-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.dash-subnav-inner::-webkit-scrollbar {
  display: none;
}

.dash-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-500);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

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

.dash-tab:hover {
  color: var(--navy-950);
}

.dash-tab.active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.dash-badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.dash-tab.active .dash-badge {
  background: var(--accent);
  color: var(--white);
}

/* ---------- Content shell ---------- */
.dash-content {
  padding: 28px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Toolbar (search + notifications) */
.dash-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--slate-400);
}

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

.dash-search input {
  border: none;
  background: transparent;
  width: 100%;
  color: var(--text);
}

.dash-search input:focus {
  outline: none;
}

.icon-btn {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--slate-500);
  flex-shrink: 0;
}

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

.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f04438;
  border: 2px solid var(--white);
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 20;
}

.notif-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  font: inherit;
  font-size: 0.86rem;
  color: var(--text);
  cursor: pointer;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item--unread {
  background: var(--slate-50, #f8fafc);
  font-weight: 500;
}

.notif-empty {
  padding: 16px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.dash-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.dash-heading h1 {
  font-size: 1.6rem;
}

.dash-sample-tag {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.dash-heading p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* ---------- Subscription line ---------- */
.sub-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
}

.sub-panel-info {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-on-dark-muted);
}

.sub-panel-info strong {
  color: var(--white);
}

.sub-plan-tag {
  color: var(--blue-300);
}

/* ---------- KPI cards ---------- */
.kpi-row {
  gap: 20px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kpi-trend {
  font-size: 0.78rem;
  font-weight: 600;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 999px;
}

.kpi-trend.up {
  color: #067647;
  background: #ecfdf3;
}

.kpi-trend.warn {
  color: #b54708;
  background: #fffaeb;
}

.kpi-trend.neutral {
  color: var(--slate-600);
  background: var(--slate-100);
}

/* ---------- Section group (tab scroll target wrapping multiple panels) ---------- */
.dash-section-group {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Panels ---------- */
.dash-row-2 {
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

@media (max-width: 980px) {
  .dash-row-2 {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.panel-head h3 {
  font-size: 1.02rem;
}

.panel-head p {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.panel .table-wrap {
  border: 1px solid var(--border);
}

/* ---------- Bar chart (CSS) ---------- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 200px;
  padding-top: 8px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 40px;
  height: var(--h);
  border-radius: 8px 8px 4px 4px;
  background: var(--blue-300);
  transform: scaleY(0);
  transform-origin: bottom;
  animation: growBar 0.8s var(--ease) forwards;
}

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

.bar-col span {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

@keyframes growBar {
  to { transform: scaleY(1); }
}

/* ---------- Donut (CSS conic-gradient) ---------- */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(
    var(--accent) 0% 34%,
    var(--blue-300) 34% 60%,
    var(--navy-700) 60% 82%,
    var(--slate-200) 82% 100%
  );
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--white);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.donut-legend em {
  margin-left: auto;
  font-style: normal;
  font-weight: 700;
  color: var(--text-muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dot-1 { background: var(--accent); }
.dot-2 { background: var(--blue-300); }
.dot-3 { background: var(--navy-700); }
.dot-4 { background: var(--slate-200); }

/* ---------- Status pills ---------- */
.status {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-progress { background: #eff8ff; color: #175cd3; }
.status-pending { background: #fffaeb; color: #b54708; }
.status-scheduled { background: var(--accent-soft); color: var(--accent-strong); }
.status-resolved { background: #ecfdf3; color: #067647; }

/* ---------- Timeline list ---------- */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-list li {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.timeline-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.tl-date {
  flex-shrink: 0;
  width: 58px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.timeline-list strong {
  display: block;
  font-size: 0.92rem;
}

.timeline-list p {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .dash-subnav {
    top: 0;
  }
}

@media (max-width: 640px) {
  .dash-content {
    padding: 20px 18px 56px;
  }
  .dash-toolbar {
    flex-wrap: wrap;
  }
  .dash-search {
    max-width: none;
  }
}
