/*
 * Scholar Suite presentation layer.
 *
 * This file intentionally owns visual structure only. API calls, role policy,
 * route state and document export markup remain in the application bundle.
 */
:root {
  --ui-brand: #7a45bd;
  --ui-brand-deep: #5b2d95;
  --ui-brand-soft: #f1eafe;
  --ui-ink: #0c2343;
  --ui-muted: #6b7891;
  --ui-canvas: #f5f6fb;
  --ui-border: #e5e8f1;
  --ui-shadow: 0 8px 24px rgb(27 36 69 / 7%);
}

body {
  color: var(--ui-ink);
  background: var(--ui-canvas);
}

.app-shell {
  grid-template-columns: 276px minmax(0, 1fr);
  background: var(--ui-canvas);
}

.sidebar {
  z-index: 15;
  width: 276px;
  color: #fff;
  background: linear-gradient(180deg, var(--ui-brand) 0%, var(--ui-brand-deep) 100%);
  border-right: 0;
  padding: 18px 14px 16px;
  box-shadow: 8px 0 28px rgb(52 28 91 / 10%);
}

.brand-row {
  min-height: 58px;
  gap: 11px;
  padding: 0 8px 20px;
  border-bottom: 1px solid rgb(255 255 255 / 20%);
}

.brand-row strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: .01em;
}

.brand-row small {
  color: rgb(255 255 255 / 72%);
  font-size: 11px;
}

.brand-row > div:last-of-type {
  min-width: 0;
}

.brand-row > div:last-of-type strong,
.brand-row > div:last-of-type small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark,
.brand-mark.small {
  color: var(--ui-brand-deep);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgb(38 11 78 / 16%);
}

.sidebar nav {
  gap: 3px;
  margin-top: 18px;
}

.sidebar nav button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgb(255 255 255 / 84%);
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.sidebar nav button::before {
  width: 20px;
  color: rgb(255 255 255 / 72%);
  content: attr(data-ui-icon);
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.sidebar nav button:hover {
  color: #fff;
  background: rgb(255 255 255 / 13%);
  transform: translateX(2px);
}

.sidebar nav button.nav-active {
  color: var(--ui-brand-deep);
  background: #fff;
  box-shadow: 0 5px 14px rgb(45 19 82 / 14%);
}

.sidebar nav button.nav-active::before {
  color: var(--ui-brand-deep);
}

.nav-section-label {
  margin: 17px 10px 6px;
  color: rgb(255 255 255 / 58%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sidebar > .ghost {
  color: #fff;
  border-color: rgb(255 255 255 / 30%);
  background: rgb(255 255 255 / 8%);
  text-align: center;
}

.sidebar > .ghost:hover {
  background: rgb(255 255 255 / 16%);
}

.ui-sidebar-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-left: auto;
  color: var(--ui-brand-deep);
  background: #fff;
  border-radius: 9px;
  font-size: 18px;
  line-height: 1;
}

.topbar {
  min-height: 82px;
  gap: 18px;
  padding: 14px 30px;
  border-bottom: 4px solid var(--ui-brand);
  box-shadow: 0 2px 12px rgb(31 40 74 / 4%);
}

.topbar > div:first-child:not(.ui-topbar-brand) {
  min-width: 170px;
  gap: 3px;
}

.ui-topbar-brand {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: var(--ui-brand);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgb(52 28 91 / 18%);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.topbar > div:first-child strong {
  color: var(--ui-ink);
  font-size: 18px;
}

.topbar > div:first-child span {
  color: var(--ui-muted);
}

.ui-topbar-context {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 700;
}

.ui-topbar-context span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 4px 14px rgb(31 40 74 / 5%);
}

.ghost.compact {
  color: var(--ui-ink);
  border-color: #d9ddea;
  background: #fff;
  border-radius: 9px;
}

.content {
  max-width: 1540px;
  padding: 30px 34px 44px;
}

.page-heading {
  min-height: 64px;
  align-items: center;
  margin-bottom: 22px;
}

.page-heading .eyebrow {
  margin-bottom: 6px;
  color: var(--ui-brand);
  font-size: 11px;
}

.page-heading h1,
.panel h1 {
  color: var(--ui-ink);
  font-size: clamp(27px, 3vw, 36px);
  letter-spacing: -.02em;
}

.page-heading .muted,
.panel > .muted {
  max-width: 720px;
  color: var(--ui-muted);
  font-size: 13px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metric {
  position: relative;
  min-height: 142px;
  gap: 9px;
  padding: 22px 20px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  box-shadow: var(--ui-shadow);
}

.metric::after {
  position: absolute;
  right: 20px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: var(--ui-brand);
  background: var(--ui-brand-soft);
  border-radius: 50%;
  content: attr(data-ui-icon);
  font-size: 20px;
  font-weight: 800;
  transform: translateY(-50%);
}

.metric span {
  color: var(--ui-ink);
  font-size: 13px;
}

.metric strong {
  color: var(--ui-ink);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -.04em;
}

.metric small {
  color: var(--ui-muted);
}

.panel {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  box-shadow: var(--ui-shadow);
}

.panel h2 {
  color: var(--ui-ink);
  font-size: 23px;
}

.ui-quick-panel {
  margin-top: 22px;
}

.ui-dashboard-status {
  display: none;
}

.ui-quick-panel h2 {
  margin-bottom: 4px;
}

.ui-quick-panel > p {
  margin-top: 0;
  color: var(--ui-muted);
  font-size: 13px;
}

.ui-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 17px;
}

.ui-quick-action {
  display: grid;
  gap: 5px;
  min-height: 74px;
  color: var(--ui-ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  padding: 14px;
  box-shadow: 0 3px 10px rgb(31 40 74 / 3%);
}

.ui-quick-action:hover {
  border-color: #cbb1eb;
  background: #fcfaff;
  transform: translateY(-1px);
}

.ui-quick-action strong {
  color: var(--ui-brand-deep);
  font-size: 14px;
}

.ui-quick-action span {
  color: var(--ui-muted);
  font-size: 12px;
}

.toolbar,
.finance-actions,
.result-actions,
.attendance-actions {
  gap: 10px;
}

.toolbar input,
.toolbar select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.report-filter-grid input,
.report-filter-grid select {
  border-color: #d7dce9;
  border-radius: 9px;
}

.primary {
  background: var(--ui-brand-deep);
  border-radius: 9px;
}

.primary:hover {
  background: #48217e;
}

.student-row:hover,
.notification-row.unread {
  background: #fbf9ff;
}

.status-pill.active,
.status-pill.paid,
.status-pill.completed {
  color: #167044;
  background: #e7f8ee;
}

.status-pill {
  border: 1px solid transparent;
}

body.ui-sidebar-collapsed .app-shell {
  grid-template-columns: 82px minmax(0, 1fr);
}

body.ui-sidebar-collapsed .sidebar {
  width: 82px;
  padding-inline: 10px;
}

body.ui-sidebar-collapsed .brand-row {
  justify-content: center;
  padding-inline: 0;
}

body.ui-sidebar-collapsed .brand-row > div:nth-child(2),
body.ui-sidebar-collapsed .sidebar nav button span,
body.ui-sidebar-collapsed .nav-section-label,
body.ui-sidebar-collapsed .sidebar > .ghost {
  display: none;
}

body.ui-sidebar-collapsed .sidebar nav button {
  justify-content: center;
  padding-inline: 8px;
}

body.ui-sidebar-collapsed .sidebar nav button::before {
  width: auto;
}

@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ui-topbar-context {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-shell,
  body.ui-sidebar-collapsed .app-shell {
    display: block;
  }

  .sidebar,
  body.ui-sidebar-collapsed .sidebar {
    width: 100%;
    height: auto;
    padding: 13px 14px;
    position: relative;
  }

  .brand-row,
  body.ui-sidebar-collapsed .brand-row {
    justify-content: flex-start;
    padding: 0 6px 13px;
  }

  body.ui-sidebar-collapsed .brand-row > div:nth-child(2) {
    display: grid;
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
    margin-top: 12px;
    padding-bottom: 3px;
  }

  .sidebar nav button {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .nav-section-label,
  body.ui-sidebar-collapsed .nav-section-label {
    display: none;
  }

  .sidebar > .ghost {
    margin-top: 10px;
  }

  .content {
    padding: 22px 16px 34px;
  }

  .topbar {
    min-height: 68px;
    padding: 11px 16px;
  }

  .ui-topbar-brand {
    display: none;
  }

  .page-heading {
    display: grid;
    align-items: start;
    gap: 10px;
  }

  .ui-quick-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 126px;
  }

  .panel {
    padding: 18px;
  }
}
