/* Targeted UX sweep: home, logging pages, and classroom tools */

body.sidebar-layout .main-content {
  background:
    radial-gradient(circle at 18% 8%, rgba(14, 165, 233, 0.08), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(16, 185, 129, 0.07), transparent 24rem),
    linear-gradient(180deg, #f8fafc 0%, #eef5fb 100%);
}

body.sidebar-layout .hero-section,
body.sidebar-layout .quick-actions-section,
body.sidebar-layout .priority-chip,
body.sidebar-layout .recent-activity-section,
body.sidebar-layout .analytics-dashboard,
body.sidebar-layout .tool-card,
body[data-page="outofclass"] .unified-form-section,
body[data-page="infringements"] .unified-form-section,
body[data-page="outofclass"] .selected-students-container,
body[data-page="infringements"] .selected-students-container {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

body.sidebar-layout .hero-section {
  isolation: isolate;
}

body.sidebar-layout .hero-section::after {
  content: "";
  position: absolute;
  inset: auto -8% -55% 35%;
  height: 170px;
  background: radial-gradient(closest-side, rgba(45, 212, 191, 0.25), transparent);
  pointer-events: none;
  z-index: 0;
}

body.sidebar-layout .priority-chip {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.sidebar-layout .priority-chip:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--chip-color, #3b82f6) 32%, rgba(148, 163, 184, 0.22));
}

body.sidebar-layout .action-card:focus-visible,
body.sidebar-layout .tool-card:focus-within,
body[data-page="outofclass"] .student-card.enhanced-card:focus-within,
body[data-page="infringements"] .student-card.enhanced-card:focus-within {
  outline: 3px solid rgba(14, 165, 233, 0.35);
  outline-offset: 3px;
}

body[data-page="outofclass"] .unified-form-section,
body[data-page="infringements"] .unified-form-section {
  border-radius: 18px;
  overflow: hidden;
  scroll-margin-top: 96px;
}

body[data-page="outofclass"] .unified-student-section,
body[data-page="infringements"] .unified-student-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.13), transparent 18rem);
}

body[data-page="outofclass"] .filters-accordion summary,
body[data-page="infringements"] .filters-accordion summary {
  min-height: 48px;
  touch-action: manipulation;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

body[data-page="outofclass"] .filters-accordion summary:hover,
body[data-page="infringements"] .filters-accordion summary:hover {
  background: rgba(14, 165, 233, 0.09) !important;
  transform: translateY(-1px);
}

body[data-page="outofclass"] .selected-students-container,
body[data-page="infringements"] .selected-students-container {
  padding: clamp(0.9rem, 2vw, 1.25rem);
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

body[data-page="outofclass"] .selected-students,
body[data-page="infringements"] .selected-students {
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  align-items: stretch;
}

body[data-page="outofclass"] .student-card.enhanced-card,
body[data-page="infringements"] .student-card.enhanced-card {
  min-height: 92px;
  align-items: flex-start;
  border-radius: 14px;
  border-color: rgba(14, 165, 233, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.12), transparent 12rem);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body[data-page="outofclass"] .student-card.enhanced-card:hover,
body[data-page="infringements"] .student-card.enhanced-card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 165, 233, 0.42);
}

body[data-page="outofclass"] .student-card.enhanced-card .student-name,
body[data-page="infringements"] .student-card.enhanced-card .student-name {
  text-align: left;
  line-height: 1.25;
}

body[data-page="outofclass"] .student-card.enhanced-card .meta-badge,
body[data-page="infringements"] .student-card.enhanced-card .meta-badge {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(241, 245, 249, 0.82);
}

body[data-page="outofclass"] .student-card.enhanced-card .remove-student,
body[data-page="infringements"] .student-card.enhanced-card .remove-student {
  min-width: 34px;
  min-height: 34px;
  opacity: 0.94;
}

body[data-page="infringements"] .category-cards-container {
  grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
}

body[data-page="infringements"] .category-card {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px !important;
  transform: translateZ(0);
}

body[data-page="infringements"] .category-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2) !important;
}

body[data-page="infringements"] .category-card.selected {
  outline: 4px solid rgba(255, 255, 255, 0.82);
  outline-offset: -10px;
}

body.classroom-tools-page .tools-intro {
  padding: 1rem 1.15rem;
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

body.classroom-tools-page .tools-grid {
  align-items: start;
}

body.classroom-tools-page .tool-card {
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

body.classroom-tools-page .tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  opacity: 0;
  transition: opacity 0.18s ease;
}

body.classroom-tools-page .tool-card:hover::before,
body.classroom-tools-page .tool-card:focus-within::before {
  opacity: 1;
}

body.classroom-tools-page #ptInterviewCard {
  grid-column: span 2;
}

body.classroom-tools-page .pt-session-name-row {
  align-items: flex-start;
}

body.classroom-tools-page .pt-session-name-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.58rem 0.7rem;
  border: 1.5px solid var(--border, #cbd5e1);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text, #1e293b);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}

body.classroom-tools-page .pt-session-name-input:focus {
  outline: none;
  border-color: var(--primary, #0066cc);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

body.classroom-tools-page .pt-queue-row {
  min-height: 48px;
}

body.classroom-tools-page .pt-label-input,
body.classroom-tools-page .pt-dur-input,
body.classroom-tools-page .time-input {
  min-height: 40px;
}

@media (max-width: 900px) {
  body.sidebar-layout .hero-content {
    align-items: stretch;
  }

  body.sidebar-layout .priority-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.classroom-tools-page #ptInterviewCard {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  body.sidebar-layout .dashboard-wrapper {
    padding: 1rem 0.75rem 1.5rem;
  }

  body.sidebar-layout .hero-section {
    border-radius: 16px;
    padding: 1.25rem;
  }

  body.sidebar-layout .hero-content {
    flex-direction: column;
    gap: 1rem;
  }

  body.sidebar-layout .hero-search {
    flex: 1 1 auto;
    width: 100%;
    margin-left: 0;
  }

  body.sidebar-layout .priority-grid,
  body[data-page="infringements"] .category-cards-container {
    grid-template-columns: 1fr !important;
  }

  body.sidebar-layout .action-card {
    width: 100%;
    justify-content: flex-start;
    border-radius: 14px;
    white-space: normal;
  }

  body[data-page="outofclass"] .selected-students,
  body[data-page="infringements"] .selected-students {
    grid-template-columns: 1fr !important;
  }

  body[data-page="outofclass"] .student-card.enhanced-card,
  body[data-page="infringements"] .student-card.enhanced-card {
    min-height: 96px;
  }

  body.classroom-tools-page .timer-display {
    font-size: clamp(2.8rem, 17vw, 4rem);
  }

  body.classroom-tools-page .pt-config-row {
    align-items: stretch;
  }

  body.classroom-tools-page .pt-config-label {
    width: 100%;
    min-width: 0;
  }

  body.classroom-tools-page .pt-session-name-input,
  body.classroom-tools-page .pt-config-row .time-input,
  body.classroom-tools-page .pt-config-row .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sidebar-layout .priority-chip,
  body.sidebar-layout .action-card,
  body[data-page="outofclass"] .student-card.enhanced-card,
  body[data-page="infringements"] .student-card.enhanced-card,
  body.classroom-tools-page .tool-card {
    transition: none;
  }
}

/* Home dashboard readability pass */
body.sidebar-layout .dashboard-wrapper {
  max-width: 1480px;
  padding: clamp(1rem, 2vw, 1.75rem) clamp(1rem, 2.4vw, 2rem) 2rem;
  gap: 1rem;
}

body.sidebar-layout .hero-section,
body.sidebar-layout .quick-actions-section,
body.sidebar-layout .activity-section,
body.sidebar-layout .analytics-dashboard {
  border-radius: 12px !important;
}

body.sidebar-layout .hero-section {
  padding: clamp(1.25rem, 2.4vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

body.sidebar-layout .hero-content {
  display: grid;
  grid-template-columns: auto minmax(18rem, 1fr) minmax(18rem, 26rem);
  align-items: center;
  gap: 1.25rem;
}

body.sidebar-layout .hero-logo {
  width: 62px !important;
  height: 62px !important;
}

body.sidebar-layout .hero-text h1 {
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  line-height: 1.15;
}

body.sidebar-layout .hero-text p {
  max-width: 54ch;
}

body.sidebar-layout .hero-search {
  width: 100%;
  min-width: 0;
  margin-left: 0;
  flex: none;
}

body.sidebar-layout .priority-grid {
  gap: 0.65rem;
}

body.sidebar-layout .priority-chip,
body.sidebar-layout .quick-actions-section,
body.sidebar-layout .activity-section,
body.sidebar-layout .analytics-dashboard {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
}

body.sidebar-layout .quick-actions-section,
body.sidebar-layout .analytics-dashboard {
  padding: clamp(1rem, 2vw, 1.35rem);
}

body.sidebar-layout .section-header,
body.sidebar-layout .analytics-dashboard .section-header {
  margin-bottom: 0.9rem !important;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

body.sidebar-layout .section-title {
  font-size: 1rem !important;
}

body.sidebar-layout .section-subtitle,
body.sidebar-layout .chart-subtitle {
  color: #64748b;
}

body.sidebar-layout .quick-actions-grid {
  gap: 0.7rem !important;
}

body.sidebar-layout .quick-action-row {
  gap: 0.5rem !important;
}

body.sidebar-layout .action-card {
  min-height: 52px !important;
  padding: 0.6rem 0.8rem !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.26) !important;
}

body.sidebar-layout .action-card .action-icon {
  width: 38px !important;
  height: 38px !important;
  font-size: 1.2rem !important;
}

body.sidebar-layout .action-card h3 {
  font-size: 0.9rem !important;
}

body.sidebar-layout .action-card p {
  color: #64748b;
}

body.sidebar-layout .dashboard-grid {
  grid-template-columns: minmax(280px, 0.36fr) minmax(0, 1fr);
  gap: 1rem !important;
}

body.sidebar-layout .activity-list {
  max-height: 430px;
}

body.sidebar-layout .activity-item {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--activity-color, #3b82f6) 70%, rgba(148, 163, 184, 0.35));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.sidebar-layout .analytics-dashboard {
  margin-top: 0.25rem !important;
}

body.sidebar-layout .metrics-row {
  gap: 0.75rem !important;
  margin-bottom: 1rem;
}

body.sidebar-layout .metric-card {
  min-height: 96px !important;
  padding: 0.95rem 1rem !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}

body.sidebar-layout .metric-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  font-size: 1.25rem !important;
}

body.sidebar-layout .metric-value {
  font-size: 1.9rem !important;
}

body.sidebar-layout .enhanced-charts-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.9rem !important;
  align-items: stretch;
}

body.sidebar-layout .analytics-dashboard .chart-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1rem !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.08), transparent 15rem) !important;
  border: 1px solid rgba(148, 163, 184, 0.26) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

body.sidebar-layout .analytics-dashboard .chart-card.large {
  grid-column: span 8;
}

body.sidebar-layout .analytics-dashboard .chart-card.medium {
  grid-column: span 4;
}

body.sidebar-layout .analytics-dashboard .chart-card.full-width {
  grid-column: span 8;
}

body.sidebar-layout .analytics-dashboard .chart-header {
  min-height: 40px;
  margin-bottom: 0.7rem !important;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

body.sidebar-layout .analytics-dashboard .chart-header h3 {
  font-size: 0.9rem !important;
  color: #0f172a;
}

body.sidebar-layout .analytics-dashboard .chart-legend {
  gap: 0.45rem !important;
}

body.sidebar-layout .analytics-dashboard .legend-item {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
}

body.sidebar-layout .analytics-dashboard .chart-container {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.sidebar-layout .analytics-dashboard .chart-container:hover {
  transform: none;
  box-shadow: none;
}

body.sidebar-layout .analytics-dashboard .chart-container.large,
body.sidebar-layout .analytics-dashboard .chart-container.medium,
body.sidebar-layout .analytics-dashboard .chart-container.comparison {
  height: 260px !important;
}

body.sidebar-layout .analytics-dashboard .chart-card canvas {
  width: 100% !important;
  min-height: 0 !important;
}

body.sidebar-layout .analytics-dashboard .chart-card.medium:nth-child(3) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.98)),
    radial-gradient(circle at 50% 45%, rgba(16, 185, 129, 0.12), transparent 11rem) !important;
}

@media (max-width: 1260px) {
  body.sidebar-layout .hero-content {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.sidebar-layout .hero-search {
    grid-column: 1 / -1;
  }

  body.sidebar-layout .analytics-dashboard .chart-card.large,
  body.sidebar-layout .analytics-dashboard .chart-card.medium,
  body.sidebar-layout .analytics-dashboard .chart-card.full-width {
    grid-column: span 12;
  }

  body.sidebar-layout .analytics-dashboard .chart-container.large,
  body.sidebar-layout .analytics-dashboard .chart-container.medium,
  body.sidebar-layout .analytics-dashboard .chart-container.comparison {
    height: 240px !important;
  }
}

@media (max-width: 760px) {
  body.sidebar-layout .hero-content,
  body.sidebar-layout .dashboard-grid {
    grid-template-columns: 1fr;
  }

  body.sidebar-layout .hero-logo {
    width: 56px !important;
    height: 56px !important;
  }

  body.sidebar-layout .priority-grid,
  body.sidebar-layout .metrics-row {
    grid-template-columns: 1fr 1fr !important;
  }

  body.sidebar-layout .analytics-dashboard .chart-container.large,
  body.sidebar-layout .analytics-dashboard .chart-container.medium,
  body.sidebar-layout .analytics-dashboard .chart-container.comparison {
    height: 220px !important;
  }
}

@media (max-width: 520px) {
  body.sidebar-layout .priority-grid,
  body.sidebar-layout .metrics-row {
    grid-template-columns: 1fr !important;
  }
}
