/* ==========================================================================
   JIOCHAEL EdOS — Dashboard stylesheet
   All selectors are scoped to elements rendered by /mdl/dashboard.html.
   Nothing here affects other pages.
   ========================================================================== */

/* ---------- Root container ---------- */
#dash-root {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 4px 0 32px;
}

/* ---------- Hero ---------- */
.dash-hero {
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line-200, #E5E7EB);
}
.dash-greeting {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-500, #6B7280);
  letter-spacing: 0.02em;
}
.dash-name {
  margin: 4px 0 6px;
  font-family: 'Fraunces', 'Georgia', serif;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--ink-900, #111827);
  letter-spacing: -0.01em;
}
.dash-meta {
  margin: 6px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dash-role-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(26, 86, 219, 0.10), rgba(201, 162, 74, 0.14));
  color: var(--ink-800, #1F2937);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dash-date {
  font-size: 13px;
  color: var(--ink-500, #6B7280);
}

/* ---------- Quick actions ---------- */
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-100, #F9FAFB);
  border: 1px solid var(--line-200, #E5E7EB);
  color: var(--ink-800, #1F2937);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 120ms, border-color 120ms, transform 120ms;
}
.dash-action:hover {
  background: #fff;
  border-color: var(--ink-300, #D1D5DB);
  transform: translateY(-1px);
}
.dash-action-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1A56DB, #C9A24A);
  flex-shrink: 0;
}

/* ---------- KPI grid ---------- */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.kpi {
  padding: 18px 20px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line-200, #E5E7EB);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  opacity: 0;
  transform: translateY(6px);
  animation: kpi-in 400ms cubic-bezier(.2,.9,.3,1) forwards;
}
@keyframes kpi-in {
  to { opacity: 1; transform: translateY(0); }
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500, #6B7280);
  margin-bottom: 8px;
}
.kpi-value {
  font-family: 'Fraunces', 'Georgia', serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-900, #111827);
  letter-spacing: -0.01em;
}

/* ---------- Chart grid ---------- */
.dash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--line-200, #E5E7EB);
  border-radius: 14px;
  padding: 18px 20px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chart-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-800, #1F2937);
  letter-spacing: -0.005em;
}
.chart-body {
  width: 100%;
}
.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Chart legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-600, #4B5563);
}
.chart-legend-vertical {
  flex-direction: column;
  gap: 6px;
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.chart-legend-value {
  margin-left: 6px;
  color: var(--ink-500, #6B7280);
  font-weight: 400;
}

/* Donut layout */
.donut-wrap {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 16px;
  align-items: center;
}
@media (max-width: 520px) {
  .donut-wrap { grid-template-columns: 1fr; }
}

/* ---------- Lists grid ---------- */
.dash-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.list-card {
  background: #fff;
  border: 1px solid var(--line-200, #E5E7EB);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.list-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-200, #E5E7EB);
}
.list-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-800, #1F2937);
  letter-spacing: -0.005em;
}
.list-body {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 340px;
  overflow-y: auto;
}
.list-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid transparent;
}
.list-row:last-child {
  border-bottom: none;
}
.list-row-text {
  min-width: 0;
}
.list-row-primary {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-900, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row-secondary {
  font-size: 11px;
  color: var(--ink-500, #6B7280);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-100, #F3F4F6);
  color: var(--ink-600, #4B5563);
  white-space: nowrap;
}
.list-row-trailing {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700, #374151);
  white-space: nowrap;
}

/* ---------- Loading state ---------- */
.dash-loading {
  padding: 6px 0;
}
.dash-loading .skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #F3F4F6 0%, #E5E7EB 50%, #F3F4F6 100%);
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .dash-name { font-size: 24px; }
  .kpi-value { font-size: 24px; }
  .dash-hero { padding: 0 0 10px; }
}

/* ---------- Dark theme ---------- */
.theme-dark #dash-root {
  color: #E5E7EB;
}
.theme-dark .kpi,
.theme-dark .chart-card,
.theme-dark .list-card {
  background: #111827;
  border-color: #1F2937;
  box-shadow: none;
}
.theme-dark .dash-name,
.theme-dark .kpi-value,
.theme-dark .list-row-primary {
  color: #F9FAFB;
}
.theme-dark .dash-greeting,
.theme-dark .dash-date,
.theme-dark .kpi-label,
.theme-dark .list-row-secondary {
  color: #9CA3AF;
}
.theme-dark .dash-role-chip {
  background: linear-gradient(135deg, rgba(26, 86, 219, 0.22), rgba(201, 162, 74, 0.18));
  color: #F9FAFB;
}
.theme-dark .dash-hero {
  border-bottom-color: #1F2937;
}
.theme-dark .dash-action {
  background: #1F2937;
  border-color: #374151;
  color: #E5E7EB;
}
.theme-dark .dash-action:hover {
  background: #374151;
}
.theme-dark .list-head,
.theme-dark .list-row-badge {
  border-color: #1F2937;
}
.theme-dark .list-row-badge {
  background: #1F2937;
  color: #D1D5DB;
}
.theme-dark .chart-title,
.theme-dark .list-head h3,
.theme-dark .list-row-trailing {
  color: #E5E7EB;
}
.theme-dark .chart-legend,
.theme-dark .chart-legend-value {
  color: #9CA3AF;
}