/* Helper styles to recreate the EMU shell as shown in the reference design */
:root {
  --font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-width: 276px;
  --sidebar-bg-start: #5c2bff;
  --sidebar-bg-end: #4a33ff;
  --sidebar-text: rgba(255, 255, 255, 0.84);
  --sidebar-text-muted: rgba(255, 255, 255, 0.64);
  --sidebar-active-bg: rgba(255, 255, 255, 0.16);
  --sidebar-active-border: rgba(255, 255, 255, 0.35);
  --layout-bg: #f3f5fb;
  --header-bg: #ffffff;
  --header-border: #e5e9f3;
  --header-icon: #5b6477;
  --banner-bg: #e7f0ff;
  --banner-text: #0f1e4b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--layout-bg);
  font-family: var(--font-family);
  color: #101828;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background-color: var(--layout-bg);
}

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg-start), var(--sidebar-bg-end));
  display: flex;
  flex-direction: column;
  padding: 24px 0 32px;
  gap: 16px;
}

.sidebar__logo {
  display: block;
  padding: 2px 24px 20px;
}

.sidebar__logo-image {
  display: block;
  width: 77px;
  max-width: 77px;
  height: auto;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 0 12px;
}

.sidebar__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--sidebar-text-muted);
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text);
}

.sidebar-link.is-active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-text);
  box-shadow: 0 0 0 1px var(--sidebar-active-border) inset, 0 8px 20px rgba(20, 0, 94, 0.15);
}

.sidebar-link__label {
  flex: 1;
  line-height: 1.4;
}

.sidebar-link__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.12));
}

.sidebar-icon--dashboard {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z'/%3E%3C/svg%3E");
}

.sidebar-icon--overview {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M5 5h3v14H5zm5 5h3v9h-3zm5-3h3v12h-3z'/%3E%3C/svg%3E");
}

.sidebar-icon--students {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4m0 2.5c-3.33 0-6 1.57-6 3.5V20h12v-1.5c0-1.93-2.67-3.5-6-3.5'/%3E%3C/svg%3E");
}

.sidebar-icon--classes {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M4 6h16v2H4zm2 4h12v2H6zm3 4h6v2H9z'/%3E%3C/svg%3E");
}

.sidebar-icon--analytics {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M5 18v-6h3v6zm5 0V6h3v12zm5 0v-9h3v9z'/%3E%3C/svg%3E");
}

.sidebar-icon--schools {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M4 10V8l8-5 8 5v2l-1.5-.94V20h-5v-5h-3v5h-5V9.06z'/%3E%3C/svg%3E");
}

.sidebar-icon--municipality {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 5a7 7 0 0 0-7 7c0 4.6 7 9 7 9s7-4.4 7-9a7 7 0 0 0-7-7m0 9.25A2.25 2.25 0 1 1 14.25 12 2.25 2.25 0 0 1 12 14.25'/%3E%3C/svg%3E");
}

.sidebar-icon--staff {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 12a3.5 3.5 0 1 0-3.5-3.5A3.5 3.5 0 0 0 12 12m-5 7.5L9.5 13h5L17 19.5l-2.5-1-2.5 3-2.5-3z'/%3E%3C/svg%3E");
}

.sidebar-icon--ai {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='m9 2 1.5 3 3 1.5L10.5 8 9 11 7.5 8 3 6.5 6 5zm6 9 1 2 2 1-2 1-1 2-1-2-2-1 2-1zm-8 5 1 2 2 1-2 1-1 2-1-2-2-1 2-1z'/%3E%3C/svg%3E");
}

.sidebar-icon--profile {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4m0 2c-3.31 0-10 1.66-10 5v1h20v-1c0-3.34-6.69-5-10-5'/%3E%3C/svg%3E");
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--layout-bg);
}

.app-header {
  height: 70px;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 16px;
}

.app-header__spacer {
  flex: 1;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background-color: rgba(238, 242, 255, 0.6);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.header-icon-btn:hover {
  background-color: rgba(214, 222, 255, 0.9);
  transform: translateY(-1px);
}

.header-icon {
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: contrast(0.95);
}

.header-icon--sparkles {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%235b6477' d='m9 2 1.5 3 3 1.5L10.5 8 9 11 7.5 8 3 6.5 6 5zm7 2 1 2 2 1-2 1-1 2-1-2-2-1 2-1zm-3 9 1 2 2 1-2 1-1 2-1-2-2-1 2-1z'/%3E%3C/svg%3E");
}

.header-icon--bell {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%235b6477' d='M12 22a2.5 2.5 0 0 0 2.45-2h-4.9A2.5 2.5 0 0 0 12 22m6-6v-5A6 6 0 0 0 7 7v9l-2 2v1h14v-1z'/%3E%3C/svg%3E");
}

.header-icon--moon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%235b6477' d='M12.74 2a8 8 0 1 0 7.26 11.07A7 7 0 0 1 12.74 2'/%3E%3C/svg%3E");
}

.header-divider {
  width: 1px;
  height: 28px;
  background-color: rgba(171, 183, 208, 0.6);
  margin-left: 4px;
}

.header-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background-color: rgba(238, 242, 255, 0.65);
  border-radius: 999px;
  border: 1px solid rgba(214, 222, 255, 0.9);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #505b71;
}

.header-user__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f8fafc, #dfe4f4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #424c63;
}

.header-user__chevron {
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%235b6477' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 34px 48px 48px;
  background-color: var(--layout-bg);
}

.page-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--banner-bg);
  color: var(--banner-text);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.6;
  box-shadow: 0 12px 30px rgba(30, 54, 140, 0.08);
  width: 100%;
}

.page-banner strong {
  font-weight: 700;
}

.chart-card {
  background-color: #ffffff;
  border-radius: 18px;
  padding: 26px 32px 32px;
  box-shadow: 0 18px 40px rgba(76, 95, 158, 0.08);
  border: 1px solid rgba(125, 141, 189, 0.18);
}

.chart-card__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}

.chart-card__title {
  margin: 0;
  font-size: clamp(1.3rem, 1.6vw, 1.55rem);
  font-weight: 700;
  color: #111a3a;
}

.chart-card__meta {
  font-size: 0.85rem;
  color: rgba(15, 27, 55, 0.62);
}

.segment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.segment-card {
  border-radius: 18px;
  padding: 26px 24px;
  box-shadow: 0 16px 32px rgba(47, 69, 138, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  color: #0f1b37;
  background-color: #ffffff;
  border: 2px solid transparent;
}

.segment-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.segment-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5c2bff;
  color: #ffffff;
  font-size: 22px;
  box-shadow: 0 6px 18px rgba(92, 43, 255, 0.18);
}

.segment-card__title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.segment-card__metrics {
  display: grid;
  gap: 14px;
  font-size: 0.96rem;
  line-height: 1.45;
  text-align: center;
}

.segment-card__metrics strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 4px;
}

.segment-card--fail {
  border-color: rgba(239, 68, 68, 0.75);
}

.segment-card--low {
  border-color: rgba(249, 115, 22, 0.6);
}

.segment-card--mid {
  border-color: rgba(74, 222, 128, 0.6);
}

.segment-card--high {
  border-color: rgba(34, 197, 94, 0.6);
}

.page-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px 32px;
}

.page-headline__title {
  flex: 1 1 220px;
  margin: 0;
  font-size: clamp(1.75rem, 2vw, 2.25rem);
  font-weight: 700;
  color: #101737;
  letter-spacing: -0.01em;
}

.filters-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 18px;
  margin-left: auto;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 135px;
  flex: 0 0 auto;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(24, 36, 70, 0.65);
}

.filter-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(108, 123, 162, 0.32);
  background-color: #ffffff;
  color: #101828;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select:hover {
  border-color: rgba(93, 110, 158, 0.55);
  box-shadow: 0 12px 24px rgba(44, 69, 142, 0.08);
}

.filter-select__chevron {
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23182746' d='M7 10.25 12 15l5-4.75z'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.7;
}

.filter-select--wide {
  min-width: 260px;
}

.page-placeholder {
  height: 420px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(150, 160, 190, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(80, 91, 113, 0.8);
  font-size: 15px;
  letter-spacing: 0.01em;
}

.analysis-section {
  margin-top: 36px;
  padding: 32px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(22, 35, 65, 0.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.analysis-section__header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 1.8vw, 1.65rem);
  font-weight: 700;
  color: #0f1a3a;
}

.analysis-section__header p {
  margin: 0;
  color: rgba(15, 26, 58, 0.72);
  font-size: 0.95rem;
}

.analysis-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.analysis-empty {
  border: 1px dashed rgba(15, 26, 58, 0.2);
  border-radius: 18px;
  padding: 48px 32px;
  text-align: center;
  background: rgba(238, 243, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.analysis-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 222, 128, 0.18);
  color: #15803d;
  font-size: 28px;
  font-weight: 700;
}

.analysis-empty__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f1b37;
}

.analysis-empty__meta {
  margin: 0;
  color: rgba(15, 26, 58, 0.7);
  font-size: 0.95rem;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 960px;
}

.analysis-table thead th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 26, 58, 0.5);
  padding: 0 14px 12px;
  border-bottom: 1px solid rgba(16, 23, 55, 0.08);
  white-space: nowrap;
}

.analysis-table tbody th {
  text-align: left;
  font-weight: 600;
  color: #0f1b37;
}

.analysis-table__student {
  min-width: 150px;
  white-space: nowrap;
}

.analysis-table td,
.analysis-table th {
  padding: 16px 14px;
  border-bottom: 1px solid rgba(16, 23, 55, 0.07);
  vertical-align: middle;
}

.analysis-table tbody tr:hover {
  background: rgba(94, 104, 144, 0.06);
}

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 36px;
}

.sparkline__bar {
  width: 6px;
  background: linear-gradient(180deg, #f97316 0%, #dc2626 100%);
  border-radius: 4px 4px 0 0;
  display: inline-block;
  min-height: 4px;
}

.sparkline__summary {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(15, 26, 58, 0.6);
  font-variant-numeric: tabular-nums;
}


.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.score--low {
  background: rgba(239, 68, 68, 0.12);
  color: #c71f1f;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-chip--negative {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.status-chip--warn {
  background: rgba(251, 191, 36, 0.18);
  color: #a16207;
}

.status-chip--positive {
  background: rgba(74, 222, 128, 0.14);
  color: #15803d;
}

@media (max-width: 1024px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    border-radius: 0 0 24px 24px;
    padding-bottom: 18px;
  }

  .app-content {
    padding-top: 0;
  }

  .app-header {
    padding: 0 20px;
  }

  .app-main {
    padding: 24px 20px;
  }

  .filters-bar {
    align-items: stretch;
    flex-direction: column;
    flex-wrap: wrap;
    margin-left: 0;
    justify-content: flex-start;
  }

  .chart-card {
    padding: 22px 20px 26px;
  }

  .segment-grid {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }
}
