:root {
  --workspace-photo: url("./workspace-desk-v1.webp");
  --workspace-edge: #e3ddeb;
  --workspace-glow: #e8dcff66;
  --sidebar-base: #1b172c;
  --sidebar-top: #231b37;
  --tile-edge: #dfd2f4;
}

[data-theme="dark"] {
  --workspace-edge: #3d354f;
  --workspace-glow: #6a4fa220;
  --sidebar-base: #181424;
  --sidebar-top: #251c39;
  --tile-edge: #51406d;
}

.work-area {
  background: radial-gradient(ellipse at 86% 0, var(--workspace-glow) 0, transparent 42rem), var(--canvas);
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  z-index: 4;
  inset-block-start: 0;
  min-height: 68px;
  border-color: var(--workspace-edge);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
}

.sidebar {
  padding-inline: 15px;
  background: radial-gradient(ellipse at 0 0, #46366355, transparent 20rem), linear-gradient(150deg, var(--sidebar-top), var(--sidebar-base) 85%);
  border-inline-end: 1px solid #ffffff0e;
}

.sidebar .brand { padding-inline: 7px; gap: 11px; font-size: 1.34rem; }
.sidebar .brand img { width: 38px; height: 38px; }
.sidebar-meta { margin-inline-start: 55px; margin-block-start: 3px; }

.nav-link {
  --nav-mark: #cbb8ff;
  display: flex;
  min-height: 47px;
  position: relative;
  padding-block: 5px;
  padding-inline: 9px;
  gap: 10px;
  text-align: start;
}

.nav-schools { --nav-mark: #7ae7d1; }
.nav-knowledge { --nav-mark: #9fbefa; }
.nav-assistant { --nav-mark: #e3b3ff; }
.nav-coordination { --nav-mark: #f9c183; }
.nav-activity { --nav-mark: #acc4ff; }
.nav-team { --nav-mark: #f3b5d7; }
.nav-calls { --nav-mark: #e0c2ff; }
.nav-calendar { --nav-mark: #95d6ff; }
.nav-inbox { --nav-mark: #ffcc9a; }
.nav-summary { --nav-mark: #92e2da; }
.sidebar nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav-profile { --nav-mark: #c6c3e5; }

.nav-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: none;
  border-radius: 9px;
  color: var(--nav-mark);
  background: color-mix(in srgb, var(--nav-mark) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--nav-mark) 19%, transparent);
}

.nav-link .nav-icon .icon { width: 17px; height: 17px; color: inherit; opacity: 1; }
.sidebar .nav-link[aria-current="page"] { background: color-mix(in srgb, var(--nav-mark) 15%, #201930); }
.sidebar .nav-link[aria-current="page"]::before { content: ""; position: absolute; inset: 10px auto 10px 0; inset-inline-start: 0; inset-inline-end: auto; width: 3px; border-radius: 0 4px 4px 0; background: var(--nav-mark); }
[dir="rtl"] .sidebar .nav-link[aria-current="page"]::before { border-radius: 4px 0 0 4px; }

.page-heading { align-items: center; gap: 16px; }
.page-heading h1 { font-size: clamp(1.85rem, 4vw, 2.75rem); letter-spacing: -.047em; }
.page-heading-identity, .panel-heading-identity, .dialog-heading-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-heading-identity > div, .panel-heading-identity > div, .dialog-heading-identity > div { min-width: 0; }
.page-heading-identity h1, .dialog-heading-identity h2 { overflow-wrap: anywhere; }
.page-heading-icon, .panel-heading-icon, .dialog-heading-icon {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--primary-dark);
  border: 1px solid var(--tile-edge);
  background: linear-gradient(145deg, var(--primary-light), var(--surface-highlight));
}
.page-heading-icon { width: 53px; height: 53px; border-radius: 15px; }
.page-heading-icon .icon { width: 26px; height: 26px; }
.dialog-heading-icon { width: 41px; height: 41px; border-radius: 11px; }
.panel-heading-icon { width: 37px; height: 37px; border-radius: 10px; }
.dialog-heading-icon .icon, .panel-heading-icon .icon { width: 19px; height: 19px; }
.dialog-header { align-items: center; }

.workspace-welcome {
  position: relative;
  isolation: isolate;
  display: block;
  min-height: 220px;
  padding: clamp(22px, 3.5vw, 32px);
  margin-block-end: 17px;
  overflow: hidden;
  background: linear-gradient(112deg, #23163f 0%, #362356 50%, #281d43 100%);
  border: 1px solid #9c80c451;
  border-radius: 18px;
  box-shadow: 0 13px 31px #2b195c15;
}
.workspace-welcome::before, .workspace-welcome::after { display: none; }
.welcome-copy { position: relative; z-index: 1; max-width: min(100%, 540px); }
.workspace-welcome h2 { font-size: clamp(1.64rem, 3.4vw, 2.7rem); letter-spacing: -.045em; margin-block: 6px; }
.workspace-welcome .time-label { display: inline-flex; align-items: center; gap: 7px; color: #bdf7e8; }
.workspace-welcome .time-label .icon { margin: 0; }
.welcome-actions { margin-block-start: 17px; }
.welcome-actions .button-light { color: #38265e; }
.welcome-art {
  position: absolute;
  z-index: 0;
  inset-block: 0;
  inset-inline-end: 0;
  width: 57%;
  background-image: var(--workspace-photo), radial-gradient(ellipse at 69% 52%, #7359a6, transparent 65%);
  background-size: cover;
  background-position: 66% 58%;
  opacity: .82;
  mask-image: linear-gradient(90deg, transparent, #000 52%);
}
[dir="rtl"] .welcome-art { mask-image: linear-gradient(270deg, transparent, #000 52%); }

.auth-art {
  isolation: isolate;
  background-image: linear-gradient(90deg, #181126 1%, #211732dd 35%, #25183444 100%), var(--workspace-photo), radial-gradient(ellipse at 90% 45%, #63427e, #201730 70%);
  background-size: cover;
  background-position: 62% center;
}
.auth-art::before, .auth-art::after { display: none; }
[dir="rtl"] .auth-art { background-image: linear-gradient(270deg, #181126 1%, #211732dd 35%, #25183444 100%), var(--workspace-photo), radial-gradient(ellipse at 20% 45%, #63427e, #201730 70%); }
.auth-art h1 { letter-spacing: -.06em; }
.auth-art-copy { z-index: 1; }
.auth-stage { background: radial-gradient(ellipse at 100% 0, var(--workspace-glow), transparent 34rem), var(--canvas); }

.stats { gap: 12px; margin-block-end: 16px; }
.stat {
  --stat-tone: var(--meter-violet);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  align-content: center;
  text-align: start;
  padding: 17px 14px;
  min-height: 94px;
  border-radius: 13px;
  border-color: var(--workspace-edge);
  box-shadow: var(--shadow);
}
.stat-amber { --stat-tone: var(--meter-amber); }
.stat-blue { --stat-tone: var(--meter-blue); }
.stat-teal { --stat-tone: var(--meter-teal); }
.stat .stat-icon { grid-row: 1 / span 2; align-self: center; width: 44px; height: 44px; border-radius: 12px; }
.stat .stat-icon .icon { width: 22px; height: 22px; }
.stat-label { color: var(--muted); font-size: .875rem; font-weight: 600; align-self: end; }
.stat-value { grid-column: 2; align-self: start; font-variant-numeric: tabular-nums; font-size: clamp(1.42rem, 3vw, 1.86rem); line-height: 1.04; }
.stat:is(button):hover { border-color: var(--stat-tone); }
.chip .icon { width: 13px; height: 13px; flex: none; }
.chip:has(> .icon) { display: inline-flex; align-items: center; gap: 4px; }
.detail-grid dt { display: flex; align-items: center; gap: 5px; }
.detail-grid dt .icon { width: 14px; height: 14px; color: var(--primary-dark); }

@media (max-width: 960px) {
  .mobile-nav-more > summary::-webkit-details-marker { display: none; }
  .mobile-nav-more > summary { cursor: pointer; list-style: none; }
  .mobile-nav-more[open] > summary, .mobile-nav-more > summary[data-current-more] { color: var(--primary-dark); }
  .mobile-nav-extra {
    position: absolute;
    inset-inline: 8px;
    inset-block-end: calc(100% + 7px);
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 5px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--paper);
    box-shadow: var(--shadow);
  }
  .mobile-nav-extra .nav-link { flex-direction: row; justify-content: start; min-height: 38px; gap: 7px; padding-inline: 5px; }
  .mobile-nav-extra .nav-link > span { width: auto; text-align: start; }
  .topbar { min-height: 61px; }
  .mobile-nav .nav-link { gap: 3px; min-height: 51px; }
  .mobile-nav .nav-icon { --nav-mark: var(--primary-dark); width: 27px; height: 27px; border-color: transparent; background: var(--faint); }
  .mobile-nav .nav-link[aria-current="page"] .nav-icon { background: var(--primary-light); color: var(--primary-dark); }
  .page-heading-icon { width: 43px; height: 43px; border-radius: 12px; }
  .page-heading-icon .icon { width: 21px; height: 21px; }
  .page-heading-identity { gap: 9px; }
  .workspace-welcome { min-height: 186px; }
  .welcome-art { width: 72%; opacity: .6; }
}

@media (max-width: 460px) {
  .page-heading h1 { font-size: clamp(1.58rem, 6.7vw, 1.92rem); }
  .page-heading-icon { width: 37px; height: 37px; }
  .page-heading-icon .icon { width: 19px; height: 19px; }
  .stats { gap: 9px; }
  .stat { min-height: 87px; padding: 11px 10px; gap: 4px 8px; }
  .stat .stat-icon { width: 33px; height: 33px; border-radius: 9px; }
  .stat .stat-icon .icon { width: 17px; height: 17px; }
  .stat-label { font-size: .79rem; }
  .dialog-heading-icon { width: 33px; height: 33px; }
  .dialog-heading-icon .icon { width: 16px; height: 16px; }
}
