/* ============================================================
   PREMIUM WORK ANALYTICS
   STEP 2 — COMPLETE PAGE CSS
   ============================================================ */

/* ------------------------------------------------------------
   ANALYTICS PAGE ROOT
------------------------------------------------------------ */

.analytics-page {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  padding: 20px;
  animation: analyticsPageIn 220ms ease;
}

@keyframes analyticsPageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ------------------------------------------------------------
   ANALYTICS HEADER
------------------------------------------------------------ */

.analytics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 22px;
}

.analytics-header-left {
  min-width: 0;
}

.analytics-eyebrow {
  display: block;

  margin-bottom: 6px;

  color: var(--purple-light);

  font-size: 10px;
  font-weight: 800;

  text-transform: uppercase;

  letter-spacing: 0.12em;
}

.analytics-title {
  margin: 0;

  color: var(--text-primary);

  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;

  line-height: 1.1;

  letter-spacing: -0.045em;
}

.analytics-subtitle {
  max-width: 650px;

  margin: 8px 0 0;

  color: var(--text-secondary);

  font-size: 13px;

  line-height: 1.55;
}


/* ------------------------------------------------------------
   ANALYTICS HEADER ACTIONS
------------------------------------------------------------ */

.analytics-header-actions {
  display: flex;

  align-items: center;

  gap: 8px;

  flex-shrink: 0;
}

.analytics-back-button,
.analytics-range-button {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 7px;

  min-height: 36px;

  padding: 0 12px;

  border: 1px solid var(--border);

  border-radius: 9px;

  background: rgba(255, 255, 255, 0.025);

  color: var(--text-secondary);

  font-family: inherit;

  font-size: 11px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition);
}

.analytics-back-button:hover,
.analytics-range-button:hover {
  color: var(--text-primary);

  border-color: var(--border-strong);

  background: rgba(255, 255, 255, 0.055);
}

.analytics-back-button:active,
.analytics-range-button:active {
  transform: scale(0.97);
}


/* ------------------------------------------------------------
   RANGE SELECTOR
------------------------------------------------------------ */

.analytics-range-selector {
  display: flex;

  align-items: center;

  gap: 3px;

  padding: 3px;

  border: 1px solid var(--border);

  border-radius: 10px;

  background: rgba(255, 255, 255, 0.025);
}

.analytics-range-option {
  min-height: 29px;

  padding: 0 9px;

  border: 0;

  border-radius: 7px;

  background: transparent;

  color: var(--text-muted);

  font-family: inherit;

  font-size: 10px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background var(--transition),
    color var(--transition);
}

.analytics-range-option:hover {
  color: var(--text-primary);
}

.analytics-range-option.active {
  color: var(--text-primary);

  background:
    linear-gradient(135deg,
      rgba(91, 140, 255, 0.16),
      rgba(151, 105, 255, 0.14));

  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}


/* ============================================================
   KPI / SUMMARY CARDS
============================================================ */

.analytics-kpi-grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 12px;

  margin-bottom: 14px;
}

.analytics-kpi {
  position: relative;

  min-width: 0;

  overflow: hidden;

  padding: 15px;

  border: 1px solid var(--border);

  border-radius: 14px;

  background:
    linear-gradient(145deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.015));

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.16);

  transition:
    border-color var(--transition),
    transform var(--transition),
    background var(--transition);
}

.analytics-kpi:hover {
  transform: translateY(-1px);

  border-color: var(--border-strong);

  background:
    linear-gradient(145deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.02));
}

.analytics-kpi::after {
  content: "";

  position: absolute;

  width: 90px;
  height: 90px;

  right: -35px;
  top: -40px;

  border-radius: 50%;

  background:
    rgba(139, 92, 246, 0.08);

  filter: blur(15px);

  pointer-events: none;
}

.analytics-kpi-label {
  display: block;

  margin-bottom: 7px;

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 750;

  text-transform: uppercase;

  letter-spacing: 0.075em;
}

.analytics-kpi-value {
  display: block;

  color: var(--text-primary);

  font-size: 24px;
  font-weight: 800;

  line-height: 1;

  letter-spacing: -0.045em;

  font-variant-numeric: tabular-nums;
}

.analytics-kpi-meta {
  display: flex;

  align-items: center;

  gap: 6px;

  margin-top: 8px;

  color: var(--text-muted);

  font-size: 10px;
}

.analytics-kpi-trend {
  display: inline-flex;

  align-items: center;

  gap: 3px;

  font-weight: 750;
}

.analytics-kpi-trend.positive {
  color: var(--green);
}

.analytics-kpi-trend.negative {
  color: var(--red);
}

.analytics-kpi-trend.neutral {
  color: var(--text-muted);
}


/* ============================================================
   MAIN ANALYTICS GRID
============================================================ */

.analytics-main-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.7fr) minmax(260px, 0.8fr);

  gap: 14px;

  align-items: stretch;
}


/* ------------------------------------------------------------
   ANALYTICS CARD
------------------------------------------------------------ */

.analytics-card {
  min-width: 0;

  border: 1px solid var(--border);

  border-radius: 16px;

  background:
    linear-gradient(180deg,
      rgba(22, 20, 17, 0.96),
      rgba(15, 14, 12, 0.96));

  box-shadow:
    0 15px 45px rgba(0, 0, 0, 0.22);
}

.analytics-card-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 15px;

  padding: 17px 18px 13px;
}

.analytics-card-heading {
  min-width: 0;
}

.analytics-card-title {
  margin: 0;

  color: var(--text-primary);

  font-size: 13px;
  font-weight: 750;

  letter-spacing: -0.015em;
}

.analytics-card-description {
  margin: 4px 0 0;

  color: var(--text-muted);

  font-size: 10px;

  line-height: 1.45;
}


/* ============================================================
   INTERACTIVE WORK HOURS CHART
============================================================ */

.analytics-chart-card {
  min-height: 390px;
}

.analytics-chart-header-actions {
  display: flex;

  align-items: center;

  gap: 8px;

  flex-shrink: 0;
}


/* ------------------------------------------------------------
   CHART LEGEND
------------------------------------------------------------ */

.analytics-chart-legend {
  display: flex;

  align-items: center;

  flex-wrap: wrap;

  gap: 8px 12px;
}

.analytics-legend-item {
  display: inline-flex;

  align-items: center;

  gap: 5px;

  color: var(--text-muted);

  font-size: 9px;
}

.analytics-legend-line {
  width: 15px;
  height: 2px;

  border-radius: 999px;

  background: var(--blue-light);
}

.analytics-legend-line.development {
  background: var(--purple-light);
}

.analytics-legend-line.average {
  height: 1px;

  background:
    repeating-linear-gradient(90deg,
      var(--text-muted) 0,
      var(--text-muted) 3px,
      transparent 3px,
      transparent 6px);
}


/* ------------------------------------------------------------
   CHART WRAPPER
------------------------------------------------------------ */

.analytics-chart-wrapper {
  position: relative;

  width: 100%;

  height: 315px;

  padding: 4px 14px 16px;
}

.analytics-chart {
  position: relative;

  width: 100%;
  height: 100%;

  overflow: visible;
}

.analytics-chart canvas,
.analytics-chart svg {
  display: block;

  width: 100%;
  height: 100%;
}


/* ------------------------------------------------------------
   CHART TOOLTIP
------------------------------------------------------------ */

.analytics-chart-tooltip {
  position: absolute;

  z-index: 30;

  min-width: 150px;

  padding: 10px 11px;

  border: 1px solid rgba(255, 255, 255, 0.10);

  border-radius: 10px;

  background:
    rgba(12, 14, 21, 0.96);

  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.45);

  backdrop-filter: blur(12px);

  pointer-events: none;

  opacity: 0;

  transform:
    translateY(5px);

  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.analytics-chart-tooltip.visible {
  opacity: 1;

  transform:
    translateY(0);
}

.analytics-tooltip-date {
  margin-bottom: 7px;

  color: var(--text-primary);

  font-size: 10px;
  font-weight: 800;
}

.analytics-tooltip-row {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 18px;

  margin-top: 4px;

  font-size: 9px;
}

.analytics-tooltip-label {
  display: inline-flex;

  align-items: center;

  gap: 5px;

  color: var(--text-secondary);
}

.analytics-tooltip-value {
  color: var(--text-primary);

  font-weight: 750;

  font-variant-numeric: tabular-nums;
}

.analytics-tooltip-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: var(--blue-light);
}

.analytics-tooltip-dot.development {
  background: var(--purple-light);
}

.analytics-tooltip-dot.average {
  background: var(--text-muted);
}


/* ============================================================
   CHART FOOTER / RANGE SUMMARY
============================================================ */

.analytics-chart-footer {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  padding: 10px 18px 14px;

  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.analytics-chart-footer-stat {
  display: flex;

  flex-direction: column;

  gap: 3px;
}

.analytics-chart-footer-label {
  color: var(--text-muted);

  font-size: 9px;
}

.analytics-chart-footer-value {
  color: var(--text-primary);

  font-size: 11px;
  font-weight: 750;
}


/* ============================================================
   RIGHT ANALYTICS COLUMN
============================================================ */

.analytics-side-column {
  display: flex;

  flex-direction: column;

  gap: 14px;

  min-width: 0;
}


/* ============================================================
   WORK DISTRIBUTION
============================================================ */

.analytics-distribution {
  padding-bottom: 15px;
}

.analytics-distribution-body {
  padding: 0 18px;
}

.analytics-distribution-row {
  display: grid;

  grid-template-columns:
    minmax(80px, 1fr) minmax(80px, 2fr) auto;

  align-items: center;

  gap: 9px;

  margin-top: 12px;
}

.analytics-distribution-label {
  overflow: hidden;

  color: var(--text-secondary);

  font-size: 9px;

  white-space: nowrap;

  text-overflow: ellipsis;
}

.analytics-distribution-track {
  width: 100%;
  height: 6px;

  overflow: hidden;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.06);
}

.analytics-distribution-fill {
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(90deg,
      var(--blue),
      var(--blue-light));

  transition: width 350ms ease;
}

.analytics-distribution-fill.development {
  background:
    linear-gradient(90deg,
      var(--purple),
      var(--purple-light));
}

.analytics-distribution-value {
  min-width: 42px;

  color: var(--text-primary);

  font-size: 9px;
  font-weight: 750;

  text-align: right;

  font-variant-numeric: tabular-nums;
}


/* ============================================================
   PRODUCTIVITY SCORE
============================================================ */

.analytics-score-card {
  overflow: hidden;
}

.analytics-score-body {
  display: flex;

  align-items: center;

  gap: 15px;

  padding: 4px 18px 18px;
}

.analytics-score-ring {
  position: relative;

  width: 82px;
  height: 82px;

  flex: 0 0 82px;
}

.analytics-score-ring svg {
  width: 100%;
  height: 100%;

  transform: rotate(-90deg);
}

.analytics-score-ring-track {
  fill: none;

  stroke: rgba(255, 255, 255, 0.06);

  stroke-width: 5;
}

.analytics-score-ring-progress {
  fill: none;

  stroke: var(--purple-light);

  stroke-width: 5;

  stroke-linecap: round;

  transition:
    stroke-dashoffset 500ms ease;
}

.analytics-score-number {
  position: absolute;

  inset: 0;

  display: grid;

  place-items: center;

  color: var(--text-primary);

  font-size: 19px;
  font-weight: 800;

  font-variant-numeric: tabular-nums;
}

.analytics-score-info {
  min-width: 0;
}

.analytics-score-status {
  margin: 0 0 4px;

  color: var(--text-primary);

  font-size: 11px;
  font-weight: 750;
}

.analytics-score-description {
  margin: 0;

  color: var(--text-muted);

  font-size: 9px;

  line-height: 1.5;
}


/* ============================================================
   CONSISTENCY / STREAK
============================================================ */

.analytics-streak-card {
  padding-bottom: 15px;
}

.analytics-streak-body {
  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  gap: 15px;

  padding: 0 18px;
}

.analytics-streak-number {
  color: var(--text-primary);

  font-size: 30px;
  font-weight: 850;

  line-height: 1;

  letter-spacing: -0.05em;
}

.analytics-streak-label {
  margin-top: 5px;

  color: var(--text-muted);

  font-size: 9px;
}

.analytics-streak-best {
  color: var(--purple-light);

  font-size: 10px;
  font-weight: 750;

  text-align: right;
}


/* ============================================================
   WEEKDAY PERFORMANCE
============================================================ */

.analytics-weekday-card {
  padding-bottom: 15px;
}

.analytics-weekday-body {
  padding: 0 18px;
}

.analytics-weekday-row {
  display: grid;

  grid-template-columns: 28px 1fr 34px;

  align-items: center;

  gap: 8px;

  margin-top: 9px;
}

.analytics-weekday-name {
  color: var(--text-muted);

  font-size: 9px;
  font-weight: 700;
}

.analytics-weekday-track {
  width: 100%;
  height: 5px;

  overflow: hidden;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.055);
}

.analytics-weekday-fill {
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(90deg,
      var(--blue),
      var(--purple-light));

  transition: width 350ms ease;
}

.analytics-weekday-value {
  color: var(--text-secondary);

  font-size: 8px;
  font-weight: 700;

  text-align: right;

  font-variant-numeric: tabular-nums;
}


/* ============================================================
   INSIGHTS
============================================================ */

.analytics-insights-card {
  margin-top: 14px;
}

.analytics-insights-list {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 9px;

  padding: 0 18px 18px;
}

.analytics-insight {
  min-width: 0;

  padding: 11px;

  border: 1px solid rgba(255, 255, 255, 0.055);

  border-radius: 10px;

  background:
    rgba(255, 255, 255, 0.018);
}

.analytics-insight-icon {
  display: grid;

  place-items: center;

  width: 25px;
  height: 25px;

  margin-bottom: 8px;

  border-radius: 7px;

  background:
    rgba(139, 92, 246, 0.10);

  color: var(--purple-light);

  font-size: 12px;
}

.analytics-insight-title {
  margin: 0 0 4px;

  color: var(--text-primary);

  font-size: 10px;
  font-weight: 750;
}

.analytics-insight-text {
  margin: 0;

  color: var(--text-muted);

  font-size: 9px;

  line-height: 1.5;
}


/* ============================================================
   STUDY / DEVELOPMENT COMPARISON
============================================================ */

.analytics-comparison-card {
  margin-top: 14px;
}

.analytics-comparison-body {
  padding: 0 18px 18px;
}

.analytics-comparison {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 10px;
}

.analytics-comparison-item {
  min-width: 0;

  padding: 12px;

  border: 1px solid rgba(255, 255, 255, 0.055);

  border-radius: 10px;

  background:
    rgba(255, 255, 255, 0.018);
}

.analytics-comparison-label {
  color: var(--text-muted);

  font-size: 9px;
}

.analytics-comparison-value {
  margin-top: 5px;

  color: var(--text-primary);

  font-size: 18px;
  font-weight: 800;

  font-variant-numeric: tabular-nums;
}

.analytics-comparison-meta {
  margin-top: 4px;

  color: var(--text-muted);

  font-size: 8px;
}


/* ============================================================
   ACTIVITY TIMELINE
============================================================ */

.analytics-timeline-card {
  margin-top: 14px;
}

.analytics-timeline {
  position: relative;

  padding:
    0 18px 18px;
}

.analytics-timeline::before {
  content: "";

  position: absolute;

  top: 5px;
  bottom: 18px;
  left: 23px;

  width: 1px;

  background:
    rgba(255, 255, 255, 0.07);
}

.analytics-timeline-item {
  position: relative;

  display: grid;

  grid-template-columns: 12px 1fr auto;

  gap: 10px;

  align-items: start;

  padding: 7px 0;
}

.analytics-timeline-dot {
  position: relative;

  z-index: 2;

  width: 9px;
  height: 9px;

  margin-top: 3px;

  border: 2px solid #0f0e0c;

  border-radius: 50%;

  background: var(--blue-light);

  box-shadow:
    0 0 0 1px rgba(91, 140, 255, 0.25);
}

.analytics-timeline-dot.development {
  background: var(--purple-light);

  box-shadow:
    0 0 0 1px rgba(151, 105, 255, 0.25);
}

.analytics-timeline-content {
  min-width: 0;
}

.analytics-timeline-title {
  color: var(--text-primary);

  font-size: 9px;
  font-weight: 700;
}

.analytics-timeline-date {
  margin-top: 2px;

  color: var(--text-muted);

  font-size: 8px;
}

.analytics-timeline-hours {
  color: var(--text-secondary);

  font-size: 9px;
  font-weight: 750;

  font-variant-numeric: tabular-nums;
}


/* ============================================================
   ANALYTICS EMPTY STATES
============================================================ */

.analytics-empty {
  display: grid;

  place-items: center;

  min-height: 180px;

  padding: 25px;

  text-align: center;
}

.analytics-empty-icon {
  display: grid;

  place-items: center;

  width: 42px;
  height: 42px;

  margin-bottom: 10px;

  border-radius: 12px;

  background:
    rgba(139, 92, 246, 0.09);

  color: var(--purple-light);

  font-size: 18px;
}

.analytics-empty-title {
  margin: 0 0 5px;

  color: var(--text-primary);

  font-size: 12px;
  font-weight: 750;
}

.analytics-empty-text {
  max-width: 280px;

  margin: 0;

  color: var(--text-muted);

  font-size: 9px;

  line-height: 1.5;
}


/* ============================================================
   ANALYTICS LOADING
============================================================ */

.analytics-loading {
  position: relative;

  overflow: hidden;
}

.analytics-loading::after {
  content: "";

  position: absolute;

  inset: 0;

  background:
    linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.035),
      transparent);

  transform: translateX(-100%);

  animation:
    analyticsShimmer 1.25s infinite;
}

@keyframes analyticsShimmer {
  to {
    transform: translateX(100%);
  }
}


/* ============================================================
   EXPANDED ANALYTICS MODE
============================================================ */

.analytics-page.expanded {
  padding: 24px;
}

.analytics-page.expanded .analytics-main-grid {
  grid-template-columns: minmax(0, 1fr);
}

.analytics-page.expanded .analytics-side-column {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));
}

.analytics-page.expanded .analytics-chart-card {
  min-height: 500px;
}

.analytics-page.expanded .analytics-chart-wrapper {
  height: 410px;
}

.analytics-page.expanded .analytics-insights-card,
.analytics-page.expanded .analytics-comparison-card,
.analytics-page.expanded .analytics-timeline-card {
  margin-top: 14px;
}


/* ============================================================
   ANALYTICS BACK BUTTON
============================================================ */

.analytics-navigation {
  display: flex;

  align-items: center;

  gap: 8px;

  margin-bottom: 16px;
}

.analytics-navigation-button {
  display: inline-flex;

  align-items: center;

  gap: 7px;

  min-height: 32px;

  padding: 0 10px;

  border: 1px solid var(--border);

  border-radius: 8px;

  background: rgba(255, 255, 255, 0.025);

  color: var(--text-secondary);

  font-family: inherit;

  font-size: 10px;
  font-weight: 700;

  cursor: pointer;

  transition:
    color var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.analytics-navigation-button:hover {
  color: var(--text-primary);

  border-color: var(--border-strong);

  background: rgba(255, 255, 255, 0.05);
}


/* ============================================================
   RESPONSIVE — TABLET
============================================================ */

@media (max-width: 1100px) {

  .analytics-kpi-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .analytics-main-grid {
    grid-template-columns: 1fr;
  }

  .analytics-side-column {
    display: grid;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .analytics-side-column .analytics-card {
    min-height: 0;
  }

  .analytics-insights-list {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


/* ============================================================
   RESPONSIVE — SMALL TABLET
============================================================ */

@media (max-width: 800px) {

  .analytics-page {
    padding: 16px;
  }

  .analytics-header {
    flex-direction: column;
  }

  .analytics-header-actions {
    width: 100%;

    justify-content: space-between;
  }

  .analytics-side-column {
    grid-template-columns: 1fr;
  }

  .analytics-insights-list {
    grid-template-columns: 1fr;
  }

  .analytics-chart-card {
    min-height: 360px;
  }

  .analytics-chart-wrapper {
    height: 285px;
  }

}


/* ============================================================
   RESPONSIVE — MOBILE
============================================================ */

@media (max-width: 600px) {

  .analytics-page {
    padding: 13px;
  }

  .analytics-header {
    gap: 14px;

    margin-bottom: 16px;
  }

  .analytics-title {
    font-size: 22px;
  }

  .analytics-subtitle {
    font-size: 11px;
  }

  .analytics-header-actions {
    display: grid;

    grid-template-columns:
      auto 1fr;

    width: 100%;
  }

  .analytics-range-selector {
    justify-content: space-between;

    width: 100%;
  }

  .analytics-range-option {
    flex: 1;

    padding: 0 6px;
  }

  .analytics-kpi-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 8px;

    margin-bottom: 10px;
  }

  .analytics-kpi {
    padding: 12px;
  }

  .analytics-kpi-value {
    font-size: 20px;
  }

  .analytics-kpi-label {
    font-size: 8px;
  }

  .analytics-kpi-meta {
    font-size: 8px;
  }

  .analytics-card-header {
    padding: 14px 14px 11px;
  }

  .analytics-chart-card {
    min-height: 330px;
  }

  .analytics-chart-wrapper {
    height: 245px;

    padding:
      2px 8px 10px;
  }

  .analytics-chart-footer {
    padding:
      8px 14px 12px;
  }

  .analytics-chart-footer-label {
    font-size: 8px;
  }

  .analytics-chart-footer-value {
    font-size: 10px;
  }

  .analytics-score-body {
    padding:
      4px 14px 14px;
  }

  .analytics-distribution-body,
  .analytics-weekday-body,
  .analytics-comparison-body,
  .analytics-timeline {
    padding-left: 14px;
    padding-right: 14px;
  }

  .analytics-streak-body {
    padding:
      0 14px;
  }

  .analytics-insights-list {
    padding:
      0 14px 14px;
  }

  .analytics-side-column {
    gap: 10px;
  }

  .analytics-insights-card,
  .analytics-comparison-card,
  .analytics-timeline-card {
    margin-top: 10px;
  }

  .analytics-page.expanded {
    padding: 14px;
  }

  .analytics-page.expanded .analytics-side-column {
    grid-template-columns: 1fr;
  }

  .analytics-page.expanded .analytics-chart-wrapper {
    height: 300px;
  }

}


/* ============================================================
   RESPONSIVE — VERY SMALL PHONES
============================================================ */

@media (max-width: 420px) {

  .analytics-page {
    padding: 10px;
  }

  .analytics-title {
    font-size: 20px;
  }

  .analytics-kpi {
    padding: 10px;
  }

  .analytics-kpi-value {
    font-size: 18px;
  }

  .analytics-kpi-meta {
    display: none;
  }

  .analytics-chart-legend {
    gap: 6px 8px;
  }

  .analytics-legend-item {
    font-size: 8px;
  }

  .analytics-chart-wrapper {
    height: 220px;
  }

  .analytics-comparison {
    grid-template-columns: 1fr;
  }

}


/* ============================================================
   ACCESSIBILITY / TOUCH
============================================================ */

.analytics-page button {
  -webkit-tap-highlight-color: transparent;
}

.analytics-page button:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.65);

  outline-offset: 2px;
}

.analytics-page [data-chart-point] {
  cursor: crosshair;
}


/* ============================================================
   REDUCED MOTION
============================================================ */

@media (prefers-reduced-motion: reduce) {

  .analytics-page,
  .analytics-kpi,
  .analytics-chart-tooltip,
  .analytics-distribution-fill,
  .analytics-weekday-fill,
  .analytics-score-ring-progress {
    animation: none !important;

    transition: none !important;
  }

}


/* ============================================================
   PREMIUM WORK CHART TOOLTIP
   ============================================================ */

.work-chart-tooltip {
  position: absolute;

  z-index: 30;

  width: 190px;

  padding: 11px 12px;

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 12px;

  background:
    rgba(12, 15, 24, 0.96);

  backdrop-filter:
    blur(14px);

  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35);

  pointer-events: none;

  opacity: 0;

  transform:
    translateY(5px) scale(0.97);

  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.work-chart-tooltip.visible {
  opacity: 1;

  transform:
    translateY(0) scale(1);
}

.work-chart-tooltip-date {
  margin-bottom: 9px;

  color:
    var(--text-primary);

  font-size: 11px;

  font-weight: 750;
}

.work-chart-tooltip-row {
  display: grid;

  grid-template-columns:
    8px 1fr auto;

  align-items: center;

  gap: 7px;

  min-height: 22px;

  color:
    var(--text-secondary);

  font-size: 10px;
}

.work-chart-tooltip-row strong {
  color:
    var(--text-primary);

  font-size: 10px;

  font-variant-numeric:
    tabular-nums;
}

.work-chart-tooltip-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;
}

.work-chart-tooltip-row.study .work-chart-tooltip-dot {
  background:
    #60a5fa;

  box-shadow:
    0 0 8px rgba(96, 165, 250, 0.55);
}

.work-chart-tooltip-row.development .work-chart-tooltip-dot {
  background:
    #a78bfa;

  box-shadow:
    0 0 8px rgba(167, 139, 250, 0.55);
}

.work-chart-tooltip-total {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

  margin-top: 8px;

  padding-top: 8px;

  border-top:
    1px solid rgba(255, 255, 255, 0.07);

  color:
    var(--text-muted);

  font-size: 10px;
}

.work-chart-tooltip-total strong {
  color:
    var(--text-primary);

  font-size: 11px;
}


/* ============================================================
   GRAPH CANVAS
   ============================================================ */

#workHoursChart,
[data-work-hours-chart] {
  display: block;

  width: 100%;

  height: 230px;

  min-height: 190px;

  touch-action: none;

  cursor: crosshair;
}

@media (max-width: 600px) {

  #workHoursChart,
  [data-work-hours-chart] {
    height: 210px;

    min-height: 180px;
  }

  .work-chart-tooltip {
    width: 175px;
  }
}


/* ============================================================
   ANALYTICS PAGE — VIEW SWAP + WIRING
   (added by js/analytics.js integration)
   ============================================================ */

/* When the analytics page is active, it replaces the dashboard's
   right-side content (summary bar + subjects grid). The sidebar,
   living in the fixed .side-panel, stays put. */
.app-shell.analytics-active > .summary-bar,
.app-shell.analytics-active > main {
  display: none;
}

/* Start-date picker in the header actions. */
.analytics-start-picker {
  cursor: pointer;
}

.analytics-start-picker > span {
  color: var(--text-muted);

  font-size: 11px;
  font-weight: 700;
}

.analytics-start-picker input[type="date"] {
  min-width: 0;

  padding: 0;

  border: 0;

  background: transparent;

  color: inherit;

  font: inherit;

  cursor: pointer;

  color-scheme: dark;
}

/* Interactive chart layers rendered inside #analyticsChart. */
.analytics-chart-svg {
  display: block;

  width: 100%;
  height: 100%;
}

.analytics-chart-overlay {
  cursor: crosshair;

  touch-action: none;
}

.analytics-chart-active-dot {
  pointer-events: none;

  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
}
