@font-face {
  font-family: "DagMontserrat";
  src: url("./assets/fonts/Montserrat-Regular.ttf") format("truetype");
  font-display: swap;
  font-weight: 400;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.settings-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  white-space: nowrap;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.settings-tab svg {
  width: 18px;
  height: 18px;
}

.settings-tab:hover,
.settings-tab:focus-visible {
  color: var(--text);
  background: var(--surface-2);
}

.settings-tab.active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 20%, transparent);
}

.settings-tab-content {
  display: grid;
  gap: 20px;
}

.settings-section-head,
.settings-payroll-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-section-head h2 {
  margin: 4px 0;
}

.settings-payroll-actions {
  justify-content: flex-end;
  margin-top: -4px;
}

.data-transfer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.data-transfer-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.data-transfer-card.export-card {
  border-color: color-mix(in srgb, var(--success) 32%, var(--line));
}

.data-transfer-card.import-card {
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
}

.data-transfer-icon,
.data-import-warning-icon {
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.import-card .data-transfer-icon,
.data-import-warning-icon {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.data-transfer-icon svg,
.data-import-warning-icon svg {
  width: 24px;
  height: 24px;
}

.data-transfer-copy {
  display: grid;
  gap: 8px;
}

.data-transfer-copy .badge {
  justify-self: start;
}

.data-transfer-copy h2,
.data-transfer-copy p {
  margin: 0;
}

.data-transfer-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.data-transfer-action {
  grid-column: 1 / -1;
  width: 100%;
}

.data-transfer-action svg,
.data-transfer-note svg,
.data-import-warning svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.visually-hidden-file {
  display: none;
}

.data-transfer-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: var(--radius);
  color: var(--primary-strong);
  background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface));
}

.data-transfer-note div {
  display: grid;
  gap: 4px;
}

.data-transfer-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.data-import-confirm-modal {
  width: min(620px, 100%);
}

.data-import-confirm-modal > h2 {
  margin: 10px 0 8px;
}

.data-import-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line));
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  line-height: 1.5;
}

.data-import-summary {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.data-import-summary > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.4fr) minmax(0, 1fr);
  gap: 16px;
  padding: 11px 14px;
}

.data-import-summary > div + div {
  border-top: 1px solid var(--line);
}

.data-import-summary dt {
  color: var(--muted);
  font-size: 13px;
}

.data-import-summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.salary-auto-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
}

.salary-auto-label svg {
  width: 14px;
  height: 14px;
}

.salary-calculation-box {
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
}

.salary-calculation-empty,
.salary-calculation-title > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.salary-calculation-empty svg,
.salary-calculation-title svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--primary);
}

.salary-calculation-empty div,
.salary-calculation-title div div {
  display: grid;
  gap: 3px;
}

.salary-calculation-empty span,
.salary-calculation-title span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.salary-calculation-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.salary-calculation-title a {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.salary-calculation-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.salary-calculation-head > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
}

.salary-calculation-head span {
  color: var(--muted);
  font-size: 12px;
}

.salary-calculation-head strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.salary-calculation-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.salary-calculation-groups span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.salary-calculation-groups b {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .settings-section-head,
  .settings-payroll-actions,
  .salary-calculation-title {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-payroll-actions .button,
  .settings-payroll-actions .ghost-button {
    width: 100%;
    justify-content: center;
  }

  .salary-calculation-head,
  .salary-calculation-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-transfer-grid {
    grid-template-columns: 1fr;
  }

  .data-import-summary > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@font-face {
  font-family: "DagMontserrat";
  src: url("./assets/fonts/Montserrat-Medium.ttf") format("truetype");
  font-display: swap;
  font-weight: 500;
}

@font-face {
  font-family: "DagSignature";
  src: url("./assets/fonts/Alistair Signature.otf") format("opentype");
  font-display: swap;
  font-weight: 400;
}

:root {
  color-scheme: light;
  --brand-warm: #f7f4e6;
  --brand-green: #474e27;
  --brand-green-deep: #30351a;
  --brand-bordo: #520808;
  --bg: #f7f4e6;
  --surface: #fffdf5;
  --surface-2: #f0ead8;
  --surface-3: #e5ddc8;
  --text: #252514;
  --muted: #676348;
  --faint: #928c70;
  --line: #ddd4bb;
  --primary: #474e27;
  --primary-strong: #30351a;
  --primary-soft: #e4e7d4;
  --accent: #520808;
  --accent-soft: #f1deda;
  --rose: #8b1717;
  --rose-soft: #f1deda;
  --sky: #3c6264;
  --sky-soft: #dce9e7;
  --violet: #69577c;
  --violet-soft: #e8e1ed;
  --success: #3f6f2c;
  --success-soft: #e1eed8;
  --warning: #8b5e13;
  --danger: #9b1c1c;
  --danger-soft: #f4d8d4;
  --shadow-sm: 0 1px 2px rgba(48, 53, 26, 0.08);
  --shadow-md: 0 12px 32px rgba(48, 53, 26, 0.1);
  --shadow-lg: 0 24px 60px rgba(48, 53, 26, 0.16);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "DagMontserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --script-font: "DagSignature", "Brush Script MT", cursive;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-warm: #f7f4e6;
  --brand-green: #aeb88a;
  --brand-green-deep: #15170d;
  --brand-bordo: #d27a72;
  --bg: #11130d;
  --surface: #191b12;
  --surface-2: #222619;
  --surface-3: #303521;
  --text: #f7f4e6;
  --muted: #c5bea2;
  --faint: #8e876e;
  --line: #3c402c;
  --primary: #aeb88a;
  --primary-strong: #e2e8c2;
  --primary-soft: rgba(174, 184, 138, 0.16);
  --accent: #d27a72;
  --accent-soft: rgba(210, 122, 114, 0.15);
  --rose: #ef9a93;
  --rose-soft: rgba(239, 154, 147, 0.14);
  --sky: #8ab4b0;
  --sky-soft: rgba(138, 180, 176, 0.14);
  --violet: #c5acd6;
  --violet-soft: rgba(197, 172, 214, 0.14);
  --success: #9cc878;
  --success-soft: rgba(156, 200, 120, 0.16);
  --warning: #d9ae66;
  --danger: #ef9a93;
  --danger-soft: rgba(239, 154, 147, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand-warm) 92%, #ffffff) 0%, var(--bg) 360px),
    var(--bg);
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 72%, #000000) 0%, var(--bg) 380px),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, #ffffff);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

svg {
  display: block;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--primary-strong);
  border-radius: var(--radius-sm);
  transition: top 180ms ease;
}

.skip-link:focus {
  top: 16px;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 18px 14px;
  border-right: 1px solid color-mix(in srgb, var(--primary-strong) 76%, #000000);
  background:
    linear-gradient(180deg, var(--primary-strong), color-mix(in srgb, var(--primary-strong) 82%, #101006)),
    var(--primary-strong);
  color: var(--brand-warm);
  z-index: 40;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 150px;
  padding: 8px 8px 22px;
  text-align: center;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border: 1px solid color-mix(in srgb, var(--brand-warm) 54%, transparent);
  border-radius: var(--radius);
  background: var(--brand-warm);
  box-shadow: var(--shadow-sm);
}

.brand-mark img {
  display: block;
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  color: var(--brand-warm);
  background: var(--primary-strong);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  display: block;
  color: var(--brand-warm);
  font-size: 25px;
  line-height: 1;
  font-weight: 800;
}

.brand-wordmark {
  display: block;
  width: min(168px, 100%);
  height: 48px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) saturate(100%) invert(93%) sepia(11%) saturate(567%) hue-rotate(7deg) brightness(107%) contrast(94%);
}

.brand-copy span {
  display: block;
  margin-top: 6px;
  color: color-mix(in srgb, var(--brand-warm) 78%, transparent);
  font-size: 14px;
  line-height: 1.25;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-color: color-mix(in srgb, var(--brand-warm) 32%, transparent) transparent;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section-label {
  padding: 0 12px 4px;
  color: color-mix(in srgb, var(--brand-warm) 50%, transparent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  color: color-mix(in srgb, var(--brand-warm) 72%, transparent);
  background: transparent;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-item:hover {
  color: var(--brand-warm);
  background: color-mix(in srgb, var(--brand-warm) 10%, transparent);
}

.nav-item.active {
  color: #30351a;
  background: #f7f4e6;
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item.locked {
  cursor: not-allowed;
  color: color-mix(in srgb, var(--brand-warm) 46%, transparent);
  background: color-mix(in srgb, var(--brand-warm) 4%, transparent);
}

.nav-item.locked:hover,
.nav-item.locked:active {
  color: color-mix(in srgb, var(--brand-warm) 46%, transparent);
  background: color-mix(in srgb, var(--brand-warm) 4%, transparent);
  transform: none;
}

.nav-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--brand-warm) 20%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--brand-warm) 8%, transparent);
}

.nav-lock small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}

.nav-lock svg {
  width: 15px;
  height: 15px;
}

.nav-item svg,
.topbar svg,
.button svg,
.ghost-button svg,
.icon-button svg,
.metric-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
}

.health-card {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--brand-warm) 18%, transparent);
  border-radius: var(--radius);
  color: var(--brand-warm);
  background: color-mix(in srgb, var(--brand-warm) 9%, transparent);
}

.health-card strong,
.health-card span {
  display: block;
}

.health-card strong {
  font-size: 13px;
}

.health-card span {
  color: color-mix(in srgb, var(--brand-warm) 72%, transparent);
  font-size: 12px;
}

.health-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent);
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(16px);
}

.menu-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 220px;
  max-width: 780px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--primary));
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 76%, var(--brand-warm));
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.global-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.global-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button,
.ghost-button,
.icon-button,
.profile-chip,
.segmented button,
.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.button {
  padding: 0 16px;
  color: var(--brand-warm);
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .button {
  color: #11130d;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button.danger-button {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button:active,
.ghost-button:active,
.icon-button:active,
.profile-chip:active,
.mini-action:active,
.nav-item:active {
  transform: translateY(1px);
}

.ghost-button,
.profile-chip {
  padding: 0 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, #ffffff);
  border-color: var(--line);
}

.ghost-button:hover,
.icon-button:hover,
.profile-chip:hover,
.mini-action:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}

.icon-button {
  width: 44px;
  padding: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, #ffffff);
  border-color: var(--line);
}

.icon-button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
}

.profile-chip .avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
  color: var(--brand-warm);
  background: var(--accent);
}

:root[data-theme="dark"] .avatar,
:root[data-theme="dark"] .profile-chip .avatar,
:root[data-theme="dark"] .segmented button.active {
  color: #11130d;
}

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 24px;
  width: min(760px, calc(100vw - 48px));
  max-height: min(70dvh, 640px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.search-result {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.search-result:hover {
  background: var(--surface-2);
}

.result-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
}

.result-title,
.result-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  color: var(--muted);
  font-size: 13px;
}

.main-content {
  display: grid;
  gap: 22px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 26px;
}

.main-content > *,
.panel {
  min-width: 0;
}

.page-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 6px;
}

.page-head::after {
  content: "";
  position: absolute;
  top: -10px;
  right: 4px;
  width: 104px;
  aspect-ratio: 1;
  background: url("./assets/brand/dagenglish-mark-green.png") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.page-head > * {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.page-head h1 {
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.08;
  font-weight: 500;
}

h2 {
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 500;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
}

.page-head p,
.muted {
  color: var(--muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.grid.side-main {
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
}

.panel,
.metric-card,
.student-card,
.teacher-card,
.group-card,
.setting-card {
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--primary));
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 18px;
}

.finance-panel {
  border-top-width: 3px;
}

.finance-panel.income {
  border-top-color: var(--success);
}

.finance-panel.expense {
  border-top-color: var(--danger);
}

.finance-panel.income h2 {
  color: var(--success);
}

.finance-panel.expense h2 {
  color: var(--danger);
}

.finance-summary-panel {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--primary);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 38%),
    var(--surface);
}

.finance-summary-panel.positive {
  border-top-color: var(--success);
}

.finance-summary-panel.negative {
  border-top-color: var(--danger);
}

.finance-profit-hero {
  display: grid;
  gap: 5px;
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--line);
}

.finance-profit-hero span,
.finance-summary-details span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.finance-profit-hero strong {
  color: var(--success);
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.finance-summary-panel.negative .finance-profit-hero strong {
  color: var(--danger);
}

.finance-summary-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 14px;
}

.finance-summary-details > div {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.finance-summary-details strong {
  font-size: clamp(15px, 1.4vw, 19px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.employee-role-overview {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.employee-role-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.employee-role-overview-head h2,
.employee-role-overview-head p {
  margin-bottom: 0;
}

.employee-role-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.employee-role-summary-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 116px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
}

.employee-role-summary-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.employee-role-summary-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.employee-role-summary-card > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.employee-role-summary-card span:not(.employee-role-summary-icon) {
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

.employee-role-summary-card strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.employee-role-summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.panel-head,
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head p,
.card-head p {
  margin-bottom: 0;
}

.metric-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 138px;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, var(--brand-warm)), var(--surface)),
    var(--surface);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--primary);
}

.metric-card.income::before {
  background: var(--success);
}

.metric-card.expense::before {
  background: var(--danger);
}

.metric-card.warn::before {
  background: var(--warning);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  min-width: 0;
  font-size: clamp(22px, 2.1vw, 28px);
  line-height: 1.12;
  font-weight: 500;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.analytics-metric-grid .metric-card strong {
  white-space: nowrap;
  overflow-wrap: normal;
  letter-spacing: -0.04em;
}

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

.metric-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--brand-warm);
  background: var(--primary-soft);
  background-color: var(--brand-green-deep);
  border-radius: var(--radius);
}

.metric-card.income .metric-icon {
  color: var(--success);
  background: var(--success-soft);
}

.metric-card.expense .metric-icon,
.metric-card.warn .metric-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.metric-card.income strong,
.mini-kpi.income strong {
  color: var(--success);
}

.metric-card.expense strong,
.mini-kpi.expense strong {
  color: var(--danger);
}

.metric-delta {
  align-self: end;
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  font-size: 12px;
  font-weight: 700;
}

.metric-delta.warn {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 14%, transparent);
}

.metric-delta.positive {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 13%, transparent);
}

.metric-delta.negative {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.metric-delta.neutral {
  color: var(--muted);
  background: var(--surface-2);
}

.period-sticky-shell {
  position: sticky;
  top: 84px;
  z-index: 22;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--text) 11%, transparent);
  backdrop-filter: blur(18px);
  overflow: visible;
}

.report-period-toolbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px 12px 18px;
}

.report-period-current {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.report-period-current span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.report-period-current strong {
  overflow-wrap: anywhere;
  font-size: clamp(14px, 1.4vw, 17px);
}

.report-period-picker {
  position: relative;
  flex: 0 0 auto;
}

.report-period-picker > summary {
  min-height: 46px;
  min-width: 166px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 7px 20px color-mix(in srgb, var(--text) 7%, transparent);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.report-period-picker > summary::-webkit-details-marker {
  display: none;
}

.report-period-picker > summary:hover,
.report-period-picker > summary:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 9px 24px color-mix(in srgb, var(--primary) 15%, transparent);
}

.report-period-picker > summary:active {
  transform: translateY(1px);
}

.report-period-picker > summary svg {
  width: 18px;
  height: 18px;
}

.report-period-picker > summary svg:last-child {
  width: 15px;
  height: 15px;
  margin-left: 2px;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.report-period-picker[open] > summary svg:last-child {
  transform: rotate(270deg);
}

.report-period-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: min(430px, calc(100vw - 36px));
  max-height: min(70dvh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 55px color-mix(in srgb, var(--text) 18%, transparent);
  animation: report-period-in 160ms ease-out;
}

body:has([role="dialog"][aria-modal="true"]) {
  overflow: hidden;
}

@keyframes report-period-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.report-period-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-period-options button {
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-2);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.report-period-options button:hover,
.report-period-options button:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--line));
  background: var(--primary-soft);
}

.report-period-options button.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent);
}

.report-custom-range {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.report-custom-range .analytics-date-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-period-done {
  min-height: 44px;
  justify-self: stretch;
}

.receipts-panel {
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--success) 13%, transparent), transparent 28%),
    var(--surface);
}

.receipts-head h2.receipts-period-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  margin: 4px 0 7px;
  font-size: 15px;
  line-height: 1.45;
}

.receipts-period-title span {
  color: var(--text);
  font-weight: 800;
}

.receipts-period-title small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.receipts-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.receipt-kpi,
.receipt-progress {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.receipt-kpi span,
.receipt-progress span,
.receipt-progress small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.receipt-kpi strong,
.receipt-progress strong {
  font-size: clamp(22px, 2vw, 30px);
  font-variant-numeric: tabular-nums;
}

.receipt-kpi.received {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
  background: var(--success-soft);
}

.receipt-kpi.planned {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.receipt-kpi.remainder,
.receipt-debt {
  color: var(--danger);
}

.receipt-kpi.remainder {
  border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
  background: var(--danger-soft);
}

.receipt-progress .progress span {
  background: var(--success);
}

.receipt-branch-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.receipt-branch-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb, var(--success) 24%, var(--line));
  border-radius: 999px;
  color: var(--success);
  background: var(--surface);
  font-weight: 800;
}

.receipt-branch-chips svg {
  width: 16px;
  height: 16px;
}

.receipt-income {
  color: var(--success);
  font-weight: 800;
}

.receipt-total td {
  background: var(--surface-2);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--surface);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--primary-strong);
  background: color-mix(in srgb, var(--surface-2) 74%, var(--brand-warm));
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--primary-soft) 58%, transparent);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-cell strong,
.person-cell span {
  display: block;
}

.person-cell span {
  color: var(--muted);
  font-size: 13px;
}

.avatar.soft {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.accent {
  color: var(--accent);
  background: var(--accent-soft);
}

.badge.rose {
  color: var(--rose);
  background: var(--rose-soft);
}

.badge.sky {
  color: var(--sky);
  background: var(--sky-soft);
}

.badge.violet {
  color: var(--violet);
  background: var(--violet-soft);
}

.badge.income {
  color: var(--success);
  background: var(--success-soft);
}

.badge.expense {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.progress {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.progress-row {
  display: grid;
  gap: 6px;
}

.progress-row .line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: inline-flex;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 78%, var(--brand-warm));
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: var(--brand-warm);
  background: var(--surface);
  background-color: var(--primary-strong);
  box-shadow: var(--shadow-sm);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.required-mark {
  color: var(--danger);
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, #ffffff);
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.checkbox-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 8px;
}

.schedule-days-field .field-helper {
  margin: 0 0 10px;
}

.schedule-preset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.schedule-preset-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.schedule-preset-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.schedule-preset-button:hover,
.schedule-preset-button:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.schedule-preset-button.is-active {
  border-color: var(--primary-strong);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.locked-feature-field {
  gap: 8px;
}

.locked-feature-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.locked-feature-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
}

.locked-feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

.locked-feature-icon svg {
  width: 19px;
  height: 19px;
}

.locked-feature-control > span:last-child {
  display: grid;
  gap: 2px;
}

.locked-feature-control strong {
  color: var(--text);
}

.locked-feature-control small {
  font-size: 12px;
  line-height: 1.4;
}

.schedule-days-grid {
  display: grid;
  grid-template-columns: minmax(132px, 1.7fr) repeat(7, minmax(44px, 1fr));
  gap: 8px;
}

.schedule-days-grid .schedule-all span {
  padding-inline: 14px;
}

.checkbox-pill {
  display: grid;
  min-height: 44px;
  cursor: pointer;
}

.checkbox-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-pill span {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.checkbox-pill input:checked + span {
  border-color: var(--primary-strong);
  color: #fff;
  background: var(--primary-strong);
}

.checkbox-pill input:focus-visible + span {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.mini-action {
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  font-size: 13px;
}

.chart {
  width: 100%;
  min-height: 260px;
}

.chart svg {
  width: 100%;
  height: auto;
}

.chart-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.bar-stack {
  display: grid;
  gap: 12px;
}

.rent-payment-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.rent-payment-history-row .record-actions .icon-button {
  width: 36px;
  min-height: 36px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 140px) minmax(0, 1fr) minmax(72px, max-content);
  gap: 12px;
  align-items: center;
}

.bar-row > * {
  min-width: 0;
}

.bar-row strong {
  overflow-wrap: anywhere;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.mini-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.mini-kpi {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
  overflow: hidden;
}

.mini-kpi strong,
.mini-kpi span {
  display: block;
}

.mini-kpi strong {
  font-size: 18px;
  line-height: 1.18;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.mini-kpi span {
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.salary-payment-item {
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
}

.group-row-actions,
.notification-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.searchable-field {
  position: relative;
  z-index: 4;
}

.searchable-control {
  position: relative;
}

.searchable-control > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.searchable-control input[type="search"] {
  width: 100%;
  padding-left: 42px;
}

.searchable-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% - 18px);
  right: 0;
  left: 0;
  max-height: 288px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.searchable-suggestions button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.searchable-suggestions button:hover,
.searchable-suggestions button:focus-visible {
  outline: none;
  background: var(--primary-soft);
  color: var(--primary);
}

.searchable-suggestions svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.searchable-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.salary-ledger-panel {
  padding: 0;
  overflow: hidden;
}

.salary-ledger-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.salary-table-scroll {
  border: 0;
  border-radius: 0;
}

.salary-ledger-table {
  min-width: 1280px;
}

.salary-ledger-table th,
.salary-ledger-table td {
  padding: 15px 16px;
  vertical-align: middle;
}

.salary-ledger-table th:first-child,
.salary-ledger-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 230px;
  background: var(--surface);
}

.salary-ledger-table th:first-child {
  background: var(--surface-2);
}

.salary-number {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.success-text {
  color: var(--success);
}

.warning-text {
  color: var(--warning);
}

.salary-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.salary-status svg {
  width: 16px;
  height: 16px;
}

.salary-status.paid {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}

.salary-status.waiting {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}

.salary-pay-button {
  min-height: 40px;
  white-space: nowrap;
}

.salary-pay-button svg {
  width: 17px;
  height: 17px;
}

.salary-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.salary-row-actions .mini-action {
  min-height: 40px;
  white-space: nowrap;
}

.salary-row-actions svg {
  width: 17px;
  height: 17px;
}

.salary-bottom-grid {
  align-items: start;
}

.salary-history-panel {
  padding: 18px;
}

.salary-history-panel .panel-head {
  margin-bottom: 10px;
}

.salary-history-list {
  max-height: 280px;
  overflow-y: auto;
}

.salary-history-list .timeline-item {
  padding: 8px 10px;
}

.teacher-payroll-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.teacher-payroll-month {
  display: grid;
  min-width: 210px;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.teacher-payroll-month input {
  min-height: 46px;
}

.teacher-payroll-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.teacher-payroll-card {
  display: grid;
  gap: 16px;
}

.teacher-payroll-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.teacher-payroll-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 16px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.teacher-payroll-total span,
.teacher-payroll-total small {
  color: var(--muted);
}

.teacher-payroll-total strong {
  color: var(--primary);
  font-size: clamp(22px, 3vw, 30px);
  font-variant-numeric: tabular-nums;
}

.teacher-payroll-total small {
  grid-column: 1 / -1;
}

.teacher-group-payroll-list {
  display: grid;
  gap: 8px;
}

.teacher-group-payroll-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.teacher-group-payroll-row > div {
  display: grid;
  gap: 3px;
}

.teacher-group-payroll-row > div:last-child {
  text-align: right;
}

.teacher-group-payroll-row span {
  color: var(--muted);
  font-size: 12px;
}

.teacher-group-payroll-row strong {
  font-variant-numeric: tabular-nums;
}

.teacher-payroll-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.teacher-payroll-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

.teacher-payroll-meta svg {
  width: 15px;
  height: 15px;
}

.teacher-payroll-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  background: color-mix(in srgb, var(--warning) 8%, transparent);
  font-size: 13px;
}

.teacher-lessons-panel {
  padding: 0;
  overflow: hidden;
}

.teacher-lessons-panel .panel-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.teacher-lessons-table {
  min-width: 1120px;
}

.teacher-lessons-table th,
.teacher-lessons-table td {
  padding: 13px 15px;
  vertical-align: middle;
}

@media (max-width: 920px) {
  .teacher-payroll-grid {
    grid-template-columns: 1fr;
  }

  .teacher-payroll-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-payroll-month {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .teacher-group-payroll-row {
    grid-template-columns: 1fr;
  }

  .teacher-group-payroll-row > div:last-child {
    text-align: left;
  }
}

.timeline-time {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.student-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.student-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  gap: 20px;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--success) 10%, transparent), transparent 58%),
    var(--surface);
}

.student-hero-main h2 {
  margin: 4px 0 8px;
  font-size: clamp(30px, 4vw, 52px);
  letter-spacing: -0.05em;
}

.student-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.student-priority-panel {
  display: grid;
  align-content: start;
}

.student-priority-list {
  display: grid;
  gap: 10px;
}

.student-priority-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 68%, var(--surface));
}

.student-priority-item.debt {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 68%, var(--surface));
}

.student-priority-item.risk {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
}

.student-filter-panel {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 58%),
    var(--surface);
}

.student-filter-summary {
  display: flex;
  justify-content: flex-end;
}

.student-payment-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.student-payment-filter button {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.student-payment-filter button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
}

.student-payment-filter button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
  outline-offset: 2px;
}

.student-payment-filter button.active {
  color: #fff;
  border-color: var(--primary-strong);
  background: linear-gradient(135deg, var(--primary-strong), color-mix(in srgb, var(--success) 45%, var(--primary-strong)));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary-strong) 18%, transparent);
}

.student-payment-filter strong,
.student-payment-filter span {
  display: block;
}

.student-payment-filter span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.student-payment-filter button.active span {
  color: #fff;
}

.student-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.student-filter-actions {
  display: flex;
  justify-content: flex-end;
}

.students-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.student-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border-left: 5px solid var(--primary);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 6%, transparent), transparent 58%),
    var(--surface);
}

.student-card.has-debt {
  border-left-color: var(--danger);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 8%, transparent), transparent 56%),
    var(--surface);
}

.student-card.is-risk:not(.has-debt) {
  border-left-color: var(--accent);
}

.student-card.selected {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent), var(--shadow-sm);
}

.student-card-head,
.student-person,
.student-card-actions,
.student-card-tags,
.student-card-info span,
.student-payment-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-card-head,
.student-card-actions {
  justify-content: space-between;
}

.student-person {
  min-width: 0;
}

.student-person h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.student-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-weight: 900;
}

.student-card-tags {
  flex-wrap: wrap;
}

.student-card-tags span {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 78%, var(--surface));
  font-size: 12px;
  font-weight: 800;
}

.student-card-info {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.student-card-info svg,
.student-payment-strip svg {
  width: 18px;
  height: 18px;
}

.student-payment-strip {
  min-height: 48px;
  padding: 12px;
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
}

.student-payment-strip.ok {
  color: var(--success);
  background: var(--success-soft);
}

.student-payment-strip.debt {
  color: var(--danger);
  background: var(--danger-soft);
}

.student-card-actions {
  flex-wrap: wrap;
}

.student-primary-actions,
.record-actions,
.teacher-card-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.student-primary-actions {
  flex-wrap: wrap;
}

.student-primary-actions .mini-action {
  min-height: 44px;
}

.muted-action {
  color: var(--muted);
}

.student-icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.delete-warning-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  border-radius: var(--radius);
  color: var(--danger);
  background: var(--danger-soft);
}

.delete-warning-box svg {
  width: 28px;
  height: 28px;
}

.delete-warning-box p {
  margin: 5px 0 0;
}

.branch-delete-options-modal {
  width: min(860px, 100%);
}

.branch-delete-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.branch-delete-impact span {
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.branch-delete-impact strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.branch-delete-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.branch-delete-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.branch-delete-choice > span:last-child {
  display: grid;
  gap: 8px;
}

.branch-delete-choice strong {
  font-size: 16px;
  line-height: 1.35;
}

.branch-delete-choice small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.branch-delete-choice-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.branch-delete-choice-icon svg {
  width: 21px;
  height: 21px;
}

.branch-delete-choice.keep:hover,
.branch-delete-choice.keep:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.branch-delete-choice.cascade {
  border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 42%, var(--surface));
}

.branch-delete-choice.cascade .branch-delete-choice-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.branch-delete-choice.cascade:hover,
.branch-delete-choice.cascade:focus-visible {
  border-color: var(--danger);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 13%, transparent);
}

.trash-list {
  display: grid;
  gap: 12px;
}

.trash-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, var(--line));
  border-left: 5px solid var(--danger);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--danger) 6%, transparent), transparent 48%),
    var(--surface);
}

.trash-card h3 {
  margin: 0 0 4px;
}

.trash-card-meta {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.trash-card-meta span,
.trash-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trash-card-meta svg {
  width: 17px;
  height: 17px;
}

.trash-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.group-card,
.teacher-card,
.setting-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.groups-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.group-filter-panel {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 58%),
    var(--surface);
}

.group-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.group-filter-wide {
  grid-column: span 2;
}

.teacher-groups-board {
  display: grid;
  gap: 14px;
}

.teacher-group-accordion {
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: clip;
}

.teacher-group-accordion > summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) minmax(330px, auto);
  gap: 14px;
  align-items: center;
  min-height: 116px;
  padding: 18px 20px;
  list-style: none;
  cursor: pointer;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent 62%),
    var(--surface);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.teacher-group-accordion > summary::-webkit-details-marker {
  display: none;
}

.teacher-group-accordion > summary:hover,
.teacher-group-accordion[open] > summary {
  background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
}

.teacher-group-accordion[open] > summary {
  border-bottom: 1px solid var(--line);
}

.teacher-group-chevron {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--primary-strong);
  transition: transform 180ms ease;
}

.teacher-group-chevron svg {
  width: 20px;
  height: 20px;
}

.teacher-group-accordion[open] .teacher-group-chevron {
  transform: rotate(90deg);
}

.teacher-group-identity {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.teacher-group-identity > strong {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.12;
}

.teacher-group-identity small {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.teacher-group-identity em {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.teacher-group-identity svg {
  width: 16px;
  height: 16px;
}

.teacher-group-summary-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
}

.teacher-group-summary-kpis b {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: var(--radius);
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.teacher-group-summary-kpis small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.teacher-group-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  padding: 16px;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.teacher-group-content .lesson-group-card {
  box-shadow: none;
}

.teacher-group-content .group-card-actions .record-actions {
  margin-left: auto;
}

.lesson-group-card {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--primary) 20%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--success) 8%, transparent), transparent 58%),
    var(--surface);
}

.lesson-group-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}

.group-card-top,
.group-name-wrap,
.group-title-line,
.group-chip-row,
.group-schedule-line,
.group-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-card-top,
.group-title-line,
.group-card-actions {
  justify-content: space-between;
}

.group-title-line {
  flex-wrap: wrap;
}

.group-title-line h2 {
  margin: 0;
}

.group-name-wrap {
  min-width: 0;
}

.group-name-wrap h2 {
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.group-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-weight: 900;
}

.group-chip-row,
.group-schedule-line {
  flex-wrap: wrap;
}

.group-schedule-line {
  color: var(--muted);
  font-weight: 700;
}

.group-schedule-line span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.group-schedule-line svg {
  width: 18px;
  height: 18px;
}

.group-finance-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.group-payment-tile,
.group-debt-tile {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius);
}

.group-payment-tile {
  color: var(--success);
  background: var(--success-soft);
}

.group-debt-tile {
  color: var(--danger);
  background: var(--danger-soft);
}

.group-payment-tile span,
.group-debt-tile span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 900;
}

.group-payment-tile svg,
.group-debt-tile svg {
  width: 18px;
  height: 18px;
}

.group-payment-tile strong,
.group-debt-tile strong {
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.group-comment-preview {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.group-ops-list {
  display: grid;
  gap: 12px;
}

.group-ops-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1fr) minmax(220px, 0.9fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 58%, var(--surface));
}

.group-ops-row.has-debt {
  border-left-color: var(--danger);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--danger) 7%, transparent), transparent 38%),
    var(--surface);
}

.group-ops-main p {
  margin: 4px 0 0;
}

.group-ops-meta {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.group-ops-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.group-ops-meta svg {
  width: 17px;
  height: 17px;
}

.group-ops-comment {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.group-ops-comment strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.group-details-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
}

.group-details-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 58%, transparent);
  backdrop-filter: blur(8px);
}

.group-details-modal {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(1360px, 100%);
  max-height: min(92vh, 980px);
  overflow: auto;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.group-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.group-details-head h2 {
  margin: 0;
}

.group-details-head .icon-button svg {
  transform: rotate(45deg);
}

.group-details-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.group-info-tile,
.group-detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-2) 50%, var(--surface));
}

.group-info-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 126px;
  padding: 18px;
}

.group-info-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--ink);
}

.group-info-icon svg {
  width: 22px;
  height: 22px;
}

.group-info-tile span:not(.group-info-icon),
.group-summary-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.group-info-tile strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 19px;
}

.group-info-tile small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.group-details-body {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.group-detail-column {
  display: grid;
  gap: 18px;
}

.group-detail-panel {
  padding: 18px;
}

.group-detail-panel h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.group-detail-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.group-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.group-summary-cell {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
}

.group-summary-cell strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.group-summary-cell.income {
  background: var(--success-soft);
}

.group-summary-cell.income span,
.group-summary-cell.income strong {
  color: var(--success);
}

.group-summary-cell.accent {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.group-summary-cell.accent span,
.group-summary-cell.accent strong {
  color: var(--accent);
}

.group-summary-cell.danger {
  background: var(--danger-soft);
}

.group-summary-cell.danger span,
.group-summary-cell.danger strong {
  color: var(--danger);
}

.group-students-panel {
  min-width: 0;
}

.group-student-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
}

button.filter-chip {
  cursor: pointer;
  font: inherit;
}

button.filter-chip:hover,
button.filter-chip:focus-visible,
.filter-chip.active {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  background: var(--primary-soft);
}

.filter-chip.rose {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  background: var(--danger-soft);
}

.group-student-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.group-student-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.group-student-card.debt {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 72%, var(--surface));
}

.group-student-card h3 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.group-student-payment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.group-student-payment strong {
  color: var(--danger);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.group-student-card:not(.debt) .group-student-payment strong {
  color: var(--success);
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.record-actions {
  flex: 0 0 auto;
}

.record-actions .icon-button {
  width: 44px;
  min-height: 44px;
}

.record-actions .icon-button svg {
  width: 18px;
  height: 18px;
}

.payment-term-list {
  display: grid;
  gap: 4px;
  min-width: 170px;
  font-size: 12px;
  font-weight: 700;
}

.payment-term-list span {
  color: var(--muted);
}

.directory-filter-panel {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 64%),
    var(--surface);
}

.directory-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(170px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.teacher-directory-filter-grid {
  grid-template-columns: minmax(260px, 1.4fr) minmax(220px, .8fr) auto;
}

.directory-filter-reset {
  min-height: 44px;
}

.teacher-movement-positive,
.teacher-movement-negative {
  display: inline-flex;
  min-width: 38px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.teacher-movement-positive {
  color: var(--success);
  background: var(--success-soft);
}

.teacher-movement-negative {
  color: var(--danger);
  background: var(--danger-soft);
}

.teachers-directory-table td:last-child,
.teachers-directory-table th:last-child {
  text-align: right;
}

.teacher-period-toolbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface));
  box-shadow: var(--shadow-sm);
}

.teacher-period-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.teacher-period-toolbar > div:first-child strong,
.teacher-period-toolbar > div:first-child > span {
  overflow-wrap: anywhere;
}

.teacher-period-toolbar > div:first-child > span {
  color: var(--muted);
  font-size: 13px;
}

.teacher-period-picker {
  position: relative;
  flex: 0 0 auto;
}

.teacher-period-picker summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.teacher-period-picker summary::-webkit-details-marker {
  display: none;
}

.teacher-period-picker summary svg {
  width: 18px;
  height: 18px;
}

.teacher-period-picker summary svg:last-child {
  width: 16px;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.teacher-period-picker[open] summary svg:last-child {
  transform: rotate(-90deg);
}

.teacher-period-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 40px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.teacher-period-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.teacher-period-options button {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-2);
}

.teacher-period-options button.active {
  color: var(--brand-warm);
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.teacher-custom-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.teacher-custom-range label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.teacher-custom-range input {
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
}

.teacher-custom-range .button {
  grid-column: 1 / -1;
}

.teacher-card-tools {
  align-self: start;
  margin-left: auto;
}

.teacher-card .card-row {
  align-items: flex-start;
  flex-wrap: wrap;
}

.payment-ledger-panel {
  padding: 0;
  overflow: hidden;
}

.payment-ledger-panel .panel-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.payment-table-scroll {
  width: 100%;
  border-radius: 0;
}

.payment-ledger-table {
  min-width: 1280px;
}

.payment-ledger-table th,
.payment-ledger-table td {
  padding: 14px 16px;
  white-space: nowrap;
}

.payment-ledger-table th:first-child,
.payment-ledger-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 190px;
  background: var(--surface);
}

.payment-ledger-table th:last-child,
.payment-ledger-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface);
}

.payment-ledger-table thead th:first-child,
.payment-ledger-table thead th:last-child {
  z-index: 3;
  background: var(--surface-2);
}

.payment-ledger-table .payment-comment {
  min-width: 240px;
  max-width: 340px;
  white-space: normal;
}

.table-actions button.active {
  color: #fff;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.notification-rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.rule-channel {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: var(--radius);
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease;
}

.toggle.active {
  background: var(--primary);
}

.toggle.active::after {
  transform: translateX(20px);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.empty-state.compact {
  min-height: 86px;
  padding: 14px;
}

.analytics-toolbar {
  display: grid;
  gap: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent 48%),
    var(--surface);
}

.analytics-view-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, transparent), color-mix(in srgb, var(--success) 7%, transparent)),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.analytics-view-tabs button {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 18px;
  border: 2px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 20px;
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 86%, var(--primary-soft)), var(--surface));
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary-strong) 9%, transparent);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.analytics-view-tabs button::after {
  content: "Открыть";
  justify-self: start;
  grid-column: 2;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.analytics-view-tabs button:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 64%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), var(--surface));
}

.analytics-view-tabs button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent);
  outline-offset: 2px;
}

.analytics-view-tabs button.active {
  border-color: color-mix(in srgb, var(--primary-strong) 72%, var(--success));
  color: #fff;
  background:
    radial-gradient(circle at 92% 18%, color-mix(in srgb, #fff 18%, transparent), transparent 28%),
    linear-gradient(135deg, var(--primary-strong), color-mix(in srgb, var(--success) 54%, var(--primary-strong)));
  box-shadow: 0 18px 36px color-mix(in srgb, var(--primary-strong) 26%, transparent);
}

.analytics-view-tabs button.active::after {
  content: "Выбрано";
  color: var(--primary-strong);
  background: #fff;
}

.analytics-view-tabs strong {
  display: block;
  font-size: clamp(21px, 2.2vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.analytics-view-tabs small {
  display: block;
  margin-top: 6px;
  color: color-mix(in srgb, var(--muted) 82%, var(--primary-strong));
  font-size: 13px;
  font-weight: 700;
}

.analytics-view-tabs button.active small,
.analytics-view-tabs button.active .analytics-tab-icon,
.analytics-view-tabs button.active strong {
  color: #fff;
}

.analytics-view-tabs button.active .analytics-tab-icon {
  background: color-mix(in srgb, #fff 18%, transparent);
}

.analytics-tab-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.analytics-tab-icon svg {
  width: 28px;
  height: 28px;
}

.branch-analytics-grid {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.branch-analytics-grid .analytics-card {
  padding: 18px;
}

.branch-analytics-grid .mini-kpis {
  grid-template-columns: repeat(3, minmax(132px, 1fr));
}

.branch-analytics-grid .mini-kpi {
  padding: 14px;
}

.branch-analytics-grid .mini-kpi strong {
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: clamp(15px, 1.25vw, 18px);
  letter-spacing: -0.04em;
}

.analytics-toolbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.analytics-toolbar-head h2 {
  margin: 3px 0 6px;
  font-size: clamp(20px, 2vw, 28px);
  font-variant-numeric: tabular-nums;
}

.analytics-range-summary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--line));
  border-radius: 999px;
  color: var(--primary-strong);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.analytics-range-summary svg,
.analytics-date-arrow svg {
  width: 17px;
  height: 17px;
}

.analytics-controls {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.analytics-period-group {
  display: grid;
  gap: 9px;
}

.analytics-control-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.analytics-segmented {
  display: grid;
  grid-template-columns: repeat(8, minmax(88px, 1fr));
  gap: 8px;
}

.analytics-segmented button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.analytics-segmented button:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.analytics-segmented button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent);
  outline-offset: 2px;
}

.analytics-segmented button.active {
  border-color: var(--primary-strong);
  color: #fff;
  background: var(--primary-strong);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--primary-strong) 22%, transparent);
}

.analytics-custom-range {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) minmax(360px, 1fr);
  gap: 20px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.analytics-custom-head {
  display: grid;
  gap: 4px;
  align-self: center;
}

.analytics-custom-head strong {
  font-size: 15px;
}

.analytics-custom-head span {
  color: var(--muted);
  font-size: 12px;
}

.analytics-date-fields {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  gap: 12px;
  align-items: end;
}

.analytics-date-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  color: var(--muted);
}

.analytics-card-list {
  display: grid;
  gap: 12px;
}

.analytics-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 64%, var(--surface));
}

.analytics-card.compact {
  gap: 12px;
}

.analytics-card h3 {
  margin: 0 0 2px;
  font-size: 17px;
}

.value-bar-row {
  display: grid;
  gap: 7px;
}

.value-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.value-row-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.value-row-meta {
  color: var(--muted);
  font-size: 12px;
}

.analytics-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.analytics-signal {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 66%, var(--surface));
}

.analytics-signal.income {
  border-color: color-mix(in srgb, var(--success) 38%, var(--line));
}

.analytics-signal.warn {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
}

.analytics-signal span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.analytics-signal strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 26px;
  line-height: 1.1;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.quick-action-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.quick-action-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 19, 13, 0.52);
}

.quick-action-modal {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.quick-action-modal [data-quick-close] svg,
.quick-action-modal [data-record-delete-cancel] svg,
.quick-action-modal [data-student-delete-cancel] svg,
.quick-action-modal [data-experience-category-delete-cancel] svg {
  transform: rotate(45deg);
}

.experience-category-delete-layer {
  z-index: 1500;
}

.quick-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-form-grid .field.full {
  grid-column: 1 / -1;
}

.field-helper {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-transform: none;
}

[data-custom-role-field][hidden] {
  display: none;
}

.monthly-payment-field {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.payment-hint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.payment-hint-chips button {
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.payment-hints-toggle {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.payment-hints-toggle svg {
  width: 16px;
  height: 16px;
}

.payment-hints-editor {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.payment-hints-editor[hidden] {
  display: none;
}

.payment-hint-entry,
.payment-hint-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-hint-entry input {
  flex: 1;
}

.payment-hint-list {
  display: grid;
  gap: 7px;
}

.payment-hint-row {
  justify-content: space-between;
  min-height: 46px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 800;
}

.payment-conditions {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.payment-condition-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.payment-condition-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.payment-condition-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text) !important;
  cursor: pointer;
  font-size: 14px !important;
  text-transform: none !important;
}

.payment-condition-check input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--primary-strong);
}

.payment-condition-amount {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted) !important;
  font-size: 12px !important;
  text-transform: none !important;
}

.payment-condition-amount input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.field textarea {
  resize: vertical;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.chart svg text {
  font-family: var(--font);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  .grid.cols-4,
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .student-hero,
  .student-hero-main {
    grid-template-columns: 1fr;
  }

  .group-ops-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-ops-row .mini-action {
    justify-self: start;
  }

  .group-details-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-details-body {
    grid-template-columns: 1fr;
  }

  .trash-card {
    grid-template-columns: 1fr;
  }

  .trash-card-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 920px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--ink) 48%, transparent);
    backdrop-filter: blur(3px);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    transform: translateX(-104%);
    transition: transform 220ms ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .topbar {
    padding: 10px 14px;
  }

  .topbar-actions .ghost-button,
  .profile-chip span:not(.avatar) {
    display: none;
  }

  .main-content {
    padding: 18px 14px 28px;
  }

  .page-head {
    display: grid;
  }

  .page-actions {
    justify-content: flex-start;
  }

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

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

  .student-payment-filter,
  .student-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .group-details-layer {
    padding: 14px;
  }

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

@media (max-width: 680px) {
  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .mini-kpis {
    grid-template-columns: 1fr;
  }

  .schedule-preset-list {
    grid-template-columns: 1fr;
  }

  .branch-delete-impact,
  .branch-delete-choice-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }

  .global-search {
    min-width: 0;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar .global-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .search-panel {
    left: 14px;
    width: calc(100vw - 28px);
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .quick-form-grid,
  .analytics-signal-grid,
  .student-hero-metrics,
  .student-payment-filter,
  .student-filter-grid {
    grid-template-columns: 1fr;
  }

  .analytics-toolbar-head {
    display: grid;
    gap: 12px;
  }

  .analytics-range-summary {
    justify-self: start;
  }

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

  .period-sticky-shell {
    top: 128px;
    max-height: none;
    overflow: visible;
  }

  .receipts-kpis,
  .group-filter-grid,
  .teacher-group-content,
  .teacher-group-summary-kpis {
    grid-template-columns: 1fr;
  }

  .group-filter-wide {
    grid-column: auto;
  }

  .teacher-group-accordion > summary {
    grid-template-columns: auto auto minmax(0, 1fr);
    padding: 15px;
  }

  .teacher-group-summary-kpis {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-view-tabs button {
    min-height: 86px;
    padding: 14px;
  }

  .teacher-period-toolbar {
    display: grid;
  }

  .teacher-period-picker,
  .teacher-period-picker summary {
    width: 100%;
  }

  .teacher-period-picker summary {
    justify-content: space-between;
  }

  .teacher-period-popover {
    right: auto;
    left: 0;
    width: 100%;
  }

  .payment-condition-row {
    grid-template-columns: 1fr;
  }

  .payment-condition-amount {
    grid-template-columns: 1fr;
  }

  .analytics-date-fields,
  .analytics-custom-range,
  .analytics-custom-range .field {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .analytics-date-arrow {
    display: none;
  }

  .groups-board,
  .students-board,
  .branch-analytics-grid,
  .group-ops-row,
  .group-details-summary-grid,
  .group-summary-grid,
  .group-student-list {
    grid-template-columns: 1fr;
  }

  .group-card-top,
  .student-card-head,
  .group-details-head {
    display: grid;
  }

  .student-card-actions {
    justify-content: flex-start;
  }

  .group-details-modal {
    padding: 16px;
    border-radius: 20px;
  }

  .branch-analytics-grid .mini-kpis {
    grid-template-columns: 1fr;
  }

  .group-student-list {
    max-height: none;
  }

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

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

  .schedule-days-grid .schedule-all {
    grid-column: span 2;
  }

}

.teacher-experience-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.experience-category-dropdown {
  position: relative;
  min-width: 0;
}

.experience-category-trigger {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, #ffffff);
  text-align: left;
}

.experience-category-trigger:hover,
.experience-category-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.experience-category-trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.experience-category-trigger[aria-expanded="true"] svg {
  transform: rotate(-90deg);
}

.experience-category-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: min(100%, 520px);
  min-width: 100%;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.experience-category-menu[hidden] {
  display: none;
}

.experience-category-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 6px;
  align-items: center;
  border-radius: 10px;
}

.experience-category-option-row:has(.experience-category-option:last-child) {
  grid-template-columns: 1fr;
}

.experience-category-option-row:hover,
.experience-category-option-row.selected {
  background: var(--surface-2);
}

.experience-category-option {
  display: flex;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.experience-category-option span {
  overflow-wrap: anywhere;
}

.experience-category-option svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--primary);
}

.experience-category-option-delete {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--danger);
  background: transparent;
}

.experience-category-option-delete:hover,
.experience-category-option-delete:focus-visible {
  background: var(--danger-soft);
}

.experience-category-option-delete svg {
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
}

[data-student-format-section][hidden],
[data-teacher-only-field][hidden],
[data-teacher-experience-field][hidden] {
  display: none !important;
}

.compact-action,
.experience-add-range {
  min-height: 30px;
  width: fit-content;
  padding: 4px 9px;
  font-size: 11px;
}

.compact-action svg,
.experience-add-range svg {
  width: 13px;
  height: 13px;
}

.teacher-experience-summary {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
}

.teacher-experience-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.teacher-experience-layer {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgb(17 24 16 / 58%);
  backdrop-filter: blur(5px);
}

.teacher-experience-dialog {
  width: min(720px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(10 20 10 / 28%);
}

.teacher-experience-dialog form {
  display: grid;
  gap: 18px;
}

.teacher-experience-dialog .modal-head {
  margin-bottom: 0;
}

.experience-brackets {
  display: grid;
  gap: 10px;
}

.experience-bracket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.experience-bracket-row label {
  display: grid;
  gap: 6px;
}

.experience-bracket-row label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .teacher-experience-control,
  .experience-bracket-row {
    grid-template-columns: 1fr;
  }

  .teacher-experience-control .mini-action {
    justify-content: center;
  }

  .experience-bracket-row .icon-button {
    justify-self: end;
  }

  .teacher-experience-dialog {
    padding: 18px;
    border-radius: 18px;
  }
}

@media (max-width: 1100px) {
  .receipts-kpis,
  .group-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-group-accordion > summary {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .teacher-group-summary-kpis {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .receipts-kpis,
  .group-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .report-period-toolbar {
    min-height: 66px;
    gap: 10px;
    padding: 10px 11px 10px 14px;
  }

  .report-period-picker > summary {
    min-width: 0;
    min-height: 44px;
  }

  .report-period-popover {
    right: -2px;
    width: min(390px, calc(100vw - 28px));
  }

  .receipts-panel {
    padding: 16px;
  }

  .group-filter-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 460px) {
  .receipts-kpis,
  .group-filter-grid,
  .teacher-group-summary-kpis {
    grid-template-columns: 1fr;
  }

  .report-period-current strong {
    max-width: 150px;
    font-size: 13px;
  }

  .report-period-picker > summary span {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .report-custom-range .analytics-date-fields {
    grid-template-columns: 1fr;
  }

  .finance-summary-details {
    grid-template-columns: 1fr;
  }

  .teacher-group-summary-kpis {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) {
  .directory-filter-grid,
  .teacher-directory-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory-filter-reset {
    justify-self: start;
  }
}

@media (max-width: 680px) {
  .directory-filter-grid,
  .teacher-directory-filter-grid,
  .group-finance-tiles {
    grid-template-columns: 1fr;
  }

  .directory-filter-reset {
    width: 100%;
  }

  .employee-role-overview-head {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-role-overview-head .badge {
    align-self: flex-start;
  }
}

@media (max-width: 460px) {
  .employee-role-summary-grid {
    grid-template-columns: 1fr;
  }
}
