:root {
  color-scheme: light;
  --ink: #17213a;
  --muted: #6c7890;
  --line: #dbe2ec;
  --surface: #ffffff;
  --surface-soft: #f4f6fb;
  --navy: #263b73;
  --navy-2: #324d89;
  --blue: #315aa6;
  --blue-soft: #eaf0fb;
  --green: #16845b;
  --green-soft: #e5f6ef;
  --amber: #9a6500;
  --amber-soft: #fff3d6;
  --red: #c8102e;
  --red-soft: #fcebef;
  --shadow: 0 12px 34px rgba(38, 59, 115, 0.09);
  --radius: 17px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
}

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

button,
a,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.child-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--navy);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 14px;
  font-weight: 820;
  line-height: 1;
}

.child-avatar.large {
  width: 104px;
  height: 104px;
  flex-basis: 104px;
  font-size: 28px;
}

.child-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.child-identity {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.child-identity-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.child-identity-copy strong {
  overflow-wrap: anywhere;
}

.child-identity-copy > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.page-heading-title {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-heading-title > div {
  min-width: 0;
}

.boot-screen,
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-screen {
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(38, 59, 115, 0.14);
  border-radius: 15px;
  background: white;
  box-shadow: 0 5px 15px rgba(20, 32, 51, 0.12);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.auth-layout {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-story {
  min-height: 570px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: white;
  background: var(--navy);
}

.auth-story .brand-lockup {
  color: white;
}

.auth-story h1 {
  max-width: 520px;
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-story p {
  max-width: 480px;
  margin: 0;
  color: #c6d5e8;
  font-size: 17px;
  line-height: 1.6;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
}

.auth-panel h2 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.035em;
}

.auth-panel > p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.5;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-lockup small {
  display: block;
  margin-top: 2px;
  color: inherit;
  opacity: 0.64;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  color: #eaf0f8;
  background: var(--navy);
  /* The admin menu is taller than a short desktop viewport.
     Scroll the sidebar itself so Profile / Logout stay reachable. */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}

.sidebar .brand-lockup {
  padding: 0 10px 24px;
  color: white;
}

.sidebar .brand-mark {
  background: white;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin: 8px 0;
}

.nav-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 12px;
  color: #c7d3e2;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.nav-button:hover,
.nav-button:focus-visible {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nav-button.active {
  color: white;
  background: var(--navy-2);
  font-weight: 750;
}

.sidebar-user {
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-user span {
  margin: 4px 0 12px;
  color: #9fb0c5;
  font-size: 13px;
}

.main-column {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid rgba(223, 230, 239, 0.86);
  background: rgba(244, 247, 251, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.topbar-identity .brand-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 12px;
}

.topbar-title {
  min-width: 0;
}

.topbar-title strong,
.topbar-title span {
  display: block;
}

.topbar-title strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.page {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 34px clamp(20px, 4vw, 48px) 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-heading h1 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.page-heading p {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.page-actions,
.button-row,
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--navy);
  color: white;
  font-weight: 730;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--navy-2);
}

.button:focus-visible {
  outline: 3px solid rgba(36, 107, 254, 0.28);
  outline-offset: 2px;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: #bdc9d8;
  background: #f9fbfd;
}

.button.danger {
  background: var(--red);
}

.button.ghost {
  min-height: 36px;
  padding: 7px 10px;
  background: transparent;
  color: var(--navy-2);
}

.button.small {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 13px;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric,
.card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.metric {
  position: relative;
  min-height: 134px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 7px 20px rgba(38, 59, 115, 0.055);
}

.metric::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--navy);
  content: "";
}

.metric.alert::before {
  background: var(--red);
}

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

.metric strong {
  margin-top: 18px;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.045em;
}

.metric.alert strong {
  color: var(--red);
}

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

.quick-action {
  min-height: 96px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 7px 20px rgba(38, 59, 115, 0.055);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.quick-action:hover {
  border-color: #b5c2d6;
  box-shadow: 0 10px 24px rgba(38, 59, 115, 0.1);
  transform: translateY(-1px);
}

.quick-action:focus-visible {
  outline: 3px solid rgba(49, 90, 166, 0.22);
  outline-offset: 2px;
}

.quick-action-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--navy);
}

.quick-action-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.quick-action-symbol {
  font-size: 24px;
  font-weight: 780;
  line-height: 1;
}

.quick-action-label {
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.quick-action-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.quick-action-arrow {
  color: var(--red);
  font-size: 27px;
  line-height: 1;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
}

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

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

.group-overview-card {
  display: flex;
  flex-direction: column;
}

.group-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 760;
}

.group-card-link span {
  color: var(--red);
  font-size: 24px;
  line-height: 1;
}

.group-roster-heading {
  margin-top: 0;
}

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

.group-member-card {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 7px 20px rgba(38, 59, 115, 0.055);
  text-align: left;
  cursor: pointer;
}

.group-member-card:hover {
  border-color: #b5c2d6;
  box-shadow: 0 10px 24px rgba(38, 59, 115, 0.1);
}

.group-member-card:focus-visible {
  outline: 3px solid rgba(49, 90, 166, 0.22);
  outline-offset: 2px;
}

.group-member-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.group-member-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-member-main strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.25;
}

.group-member-main span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.group-member-arrow {
  color: var(--red);
  font-size: 25px;
  line-height: 1;
}

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

.user-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(38, 59, 115, 0.055);
}

.user-card-heading {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.user-card-heading > div {
  min-width: 0;
}

.user-card-heading h2 {
  overflow-wrap: anywhere;
  margin: 0 0 5px;
  font-size: 18px;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.user-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.user-card-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.user-card-meta div {
  min-width: 0;
}

.user-card-meta dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.user-card-meta dd {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.user-card > .button {
  align-self: flex-start;
  margin-top: auto;
}

.card,
.panel {
  padding: 20px;
  border-radius: var(--radius);
}

.card h2,
.card h3,
.panel h2,
.panel h3 {
  margin: 0 0 8px;
  letter-spacing: -0.025em;
}

.card p,
.panel p {
  color: var(--muted);
  line-height: 1.5;
}

.card.clickable {
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.card.clickable:hover {
  border-color: #aebdd0;
  transform: translateY(-1px);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 21px;
}

.filters {
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

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

.field.grow {
  flex: 1 1 260px;
}

.field label,
.field > span {
  color: #39485d;
  font-size: 13px;
  font-weight: 700;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--ink);
}

/* Show/hide control inside password input, available on login, sign-up and dialogs. */
.password-control {
  position: relative;
  min-width: 0;
}
.password-control > .input {
  padding-right: 112px;
  min-width: 0;
}
.password-visibility-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  border-radius: 7px;
  background: #edf3fc;
  color: #183f77;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.password-visibility-toggle:focus-visible {
  outline: 2px solid #246bfe;
  outline-offset: 1px;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.13);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  background: #f9fbfd;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

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

tbody tr.clickable {
  cursor: pointer;
}

tbody tr.clickable:hover {
  background: #f8faff;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #38506d;
  background: #edf2f7;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

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

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

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

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  white-space: nowrap;
}

.money.negative {
  color: var(--red);
}

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

.empty-state,
.error-state,
.loading-state {
  padding: 48px 24px;
  border: 1px dashed #c9d4e1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.empty-state h2,
.error-state h2 {
  margin: 0 0 8px;
}

.empty-state p,
.error-state p,
.loading-state {
  color: var(--muted);
}

.error-state {
  border-color: #efc2c8;
  background: var(--red-soft);
}

.detail-list {
  display: grid;
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row dt {
  color: var(--muted);
}

.detail-row dd {
  margin: 0;
  font-weight: 650;
}

.schedule-list,
.feed-list,
.message-list {
  display: grid;
  gap: 10px;
}

.schedule-item,
.feed-item {
  display: grid;
  grid-template-columns: minmax(92px, 0.35fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.schedule-item.cancelled {
  opacity: 0.68;
}

.schedule-item strong,
.schedule-item span {
  display: block;
}

.message-layout {
  min-height: 560px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.conversation-list {
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

.conversation-button {
  width: 100%;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: white;
  text-align: left;
  cursor: pointer;
}

.conversation-button.active {
  background: var(--blue-soft);
}

.conversation-button strong,
.conversation-button span {
  display: block;
}

.conversation-button span {
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-header,
.chat-form {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}


.chat-header.child-only {
  padding-top: 10px;
  padding-bottom: 10px;
}

.chat-header.child-only .chat-child {
  margin-top: 0;
}

.chat-form {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.message-list {
  align-content: end;
  max-height: 500px;
  overflow-y: auto;
  padding: 18px;
  background: #f8fafc;
}

.message {
  max-width: min(76%, 620px);
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 13px 13px 13px 4px;
  background: white;
}

.message.own {
  justify-self: end;
  border-color: #c9d9ff;
  border-radius: 13px 13px 4px 13px;
  background: var(--blue-soft);
}

.message p {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
}

.message small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

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

.attendance-person {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(270px, 1.25fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.attendance-heading p {
  margin: 6px 0 0;
  font-size: 13px;
}

.birthday-reminder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid #efd28c;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--ink);
}

.birthday-reminder-icon {
  font-size: 22px;
  line-height: 1.2;
}

.birthday-reminder strong {
  color: #765000;
  font-size: 14px;
}

.birthday-reminder p {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.attendance-person-name {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.attendance-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.attendance-mark {
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
  background: white;
  color: #3d4b60;
  font-size: 13px;
  font-weight: 740;
  cursor: pointer;
}

.attendance-mark:focus-visible {
  outline: 3px solid rgba(36, 107, 254, 0.22);
  outline-offset: 1px;
}

.attendance-mark.present[aria-pressed="true"] {
  border-color: #8ed2b8;
  background: var(--green-soft);
  color: var(--green);
}

.attendance-mark.sick[aria-pressed="true"] {
  border-color: #edcb7a;
  background: var(--amber-soft);
  color: var(--amber);
}

.attendance-mark.vacation[aria-pressed="true"] {
  border-color: #b9cdfd;
  background: var(--blue-soft);
  color: var(--navy-2);
}

.attendance-save {
  width: 100%;
  margin-top: 16px;
}

.statistics-note {
  margin-top: 22px;
}

.statistics-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #edf2fa;
}

.statistics-tab {
  appearance: none;
  min-height: 46px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.statistics-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 5px 14px rgba(38, 59, 115, 0.12);
}

.statistics-tab:focus-visible {
  outline: 3px solid rgba(49, 90, 166, 0.22);
  outline-offset: 1px;
}

.statistics-panel[hidden] {
  display: none;
}

.metric-caption {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

.ltv-metric strong {
  font-size: clamp(24px, 2.7vw, 34px);
}

.forecast-metric strong {
  font-size: clamp(24px, 2.7vw, 34px);
}

.forecast-dialog {
  min-width: min(680px, 90vw);
}

.forecast-dialog h3 {
  margin: 24px 0 8px;
}

.forecast-result {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid #b9d9ca;
  border-radius: 14px;
  background: #edf9f3;
}

.forecast-result span {
  color: var(--muted);
  font-weight: 700;
}

.forecast-result strong {
  color: #17623e;
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: -0.04em;
}

.forecast-result.negative {
  border-color: #efc2c8;
  background: var(--red-soft);
}

.forecast-result.negative strong {
  color: var(--red);
}

.forecast-detail-list {
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.forecast-detail-list .detail-row dd {
  text-align: right;
}

.forecast-detail-list dt small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.forecast-subrow {
  padding-left: 18px;
  font-size: 13px;
}

.forecast-total dt,
.forecast-total dd {
  color: var(--ink);
  font-weight: 800;
}

.forecast-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
  padding: 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  font-size: 18px;
}

.forecast-equation strong {
  color: var(--navy);
  font-size: 22px;
}

.dialog-form > .forecast-note {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.expense-category-grid .metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.statistics-expense-toggle[aria-expanded="true"] {
  border-color: #aebbd0;
  background: var(--blue-soft);
}

.statistics-expense-breakdown {
  margin-top: -8px;
  margin-bottom: 22px;
}

.statistics-expense-breakdown .section-title {
  margin-top: 0;
}

.payroll-details {
  margin-top: 12px;
  padding: 0;
  overflow: hidden;
}

.payroll-details summary {
  padding: 15px 17px;
  color: var(--navy);
  font-weight: 760;
  cursor: pointer;
}

.payroll-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.payroll-details .table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.statistics-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid #cdd9ec;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--navy);
}

.statistics-period strong {
  font-size: 17px;
  text-transform: capitalize;
}

.statistics-period span {
  color: #53647f;
  font-size: 13px;
}

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

.statistics-group-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(38, 59, 115, 0.055);
}

.statistics-group-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.statistics-group-card h3,
.statistics-group-card dl,
.statistics-group-card dd {
  margin: 0;
}

.statistics-group-card header span {
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
}

.statistics-group-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
  padding-top: 13px;
}

.statistics-group-card dl > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.statistics-group-card dt {
  color: var(--muted);
  font-size: 11px;
}

.statistics-group-card dd {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 16px;
  font-weight: 780;
}

.statistics-group-card dd.negative {
  color: var(--red);
}

.child-card-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 0;
}

.child-card-heading-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.child-card-heading h2 {
  margin: 0;
}

.child-photo-actions {
  gap: 6px;
}

.family-member-list {
  display: grid;
  gap: 9px;
  margin: 15px 0;
}

.chat-child {
  margin-top: 8px;
}

.chat-child .child-avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  font-size: 11px;
}

.conversation-child-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 680;
}

.conversation-child-line .child-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 10px;
}

.form-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(860px, calc(100vh - 28px));
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 28px 90px rgba(10, 22, 40, 0.28);
}

.form-dialog::backdrop {
  background: rgba(12, 25, 43, 0.55);
  backdrop-filter: blur(4px);
}

.dialog-form {
  padding: 24px;
}

.dialog-form h2 {
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}

.dialog-form > p {
  margin: 0 0 22px;
  color: var(--muted);
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--navy);
  color: white;
  animation: toast-in 180ms ease both;
}

.toast.error {
  background: var(--red);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav {
  display: none;
}

.mobile-menu-toggle,
.mobile-drawer,
.mobile-drawer-backdrop {
  display: none;
}

.mobile-menu-open {
  overflow: hidden;
}

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

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

  .attendance-grid {
    grid-template-columns: 1fr;
  }

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

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

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

@media (max-width: 820px) {
  .auth-page {
    padding: 0;
    background: white;
  }

  .auth-layout {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-story {
    min-height: auto;
    padding: 28px 24px;
  }

  .auth-story h1,
  .auth-story > div:last-child p {
    display: none;
  }

  .auth-panel {
    padding: 30px 24px 48px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 64px;
    padding: 10px 12px;
    gap: 10px;
  }

  .mobile-menu-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--navy);
    cursor: pointer;
  }

  .mobile-menu-toggle span {
    width: 23px;
    height: 2.5px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-menu-toggle:focus-visible {
    outline: 3px solid rgba(38, 59, 115, 0.18);
    outline-offset: 1px;
  }

  .topbar-identity {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-logout {
    display: none;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: block;
    background: rgba(20, 28, 43, 0.52);
    opacity: 0;
    transition: opacity 180ms ease;
  }

  .mobile-drawer-backdrop[hidden] {
    display: none;
  }

  .mobile-drawer-backdrop.open {
    opacity: 1;
  }

  .mobile-drawer {
    position: fixed;
    z-index: 100;
    inset: 0 auto 0 0;
    width: min(84vw, 350px);
    display: flex;
    flex-direction: column;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    background: #f7f9fc;
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 40px rgba(20, 32, 51, 0.18);
    transform: translateX(-102%);
    transition: transform 180ms ease;
    overflow: hidden;
  }

  .mobile-drawer.open {
    transform: translateX(0);
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px 16px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-drawer .brand-lockup {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
  }

  .mobile-drawer .brand-lockup .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 12px;
  }

  .mobile-drawer .brand-lockup > span:last-child {
    min-width: 0;
    display: grid;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.05;
  }

  .mobile-drawer .brand-lockup small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
  }

  .mobile-drawer-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    color: var(--text);
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-drawer-nav {
    min-height: 0;
    display: grid;
    gap: 5px;
    margin: 14px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
  }

  .mobile-drawer-nav .nav-button {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--muted);
    background: transparent;
    text-align: left;
    font-size: 16px;
    font-weight: 650;
  }

  .mobile-drawer-nav .nav-button.active {
    color: var(--navy);
    background: var(--blue-soft);
    font-weight: 800;
  }

  .mobile-drawer-nav .nav-order-button {
    margin-top: 6px;
    border: 1px dashed #c8d2e1;
    background: white;
  }

  .mobile-drawer-user {
    margin-top: auto;
    padding: 14px 4px 2px;
    border-top: 1px solid var(--line);
  }

  .mobile-drawer-user strong,
  .mobile-drawer-user > span {
    display: block;
  }

  .mobile-drawer-user strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-drawer-user > span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
  }

  .mobile-drawer-user .button-row {
    margin-top: 12px;
  }

  .topbar-identity .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 11px;
  }

  .page {
    padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
  }

  .dashboard-page {
    padding-top: 18px;
  }

  .dashboard-page .page-heading {
    gap: 0;
    margin-bottom: 18px;
  }

  .dashboard-page .page-heading h1 {
    font-size: 34px;
  }

  .dashboard-page .page-heading p {
    margin-top: 5px;
    font-size: 15px;
  }

  .mobile-nav { display: none !important; }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .message-layout {
    min-height: 0;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .conversation-list {
    max-height: 172px;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .conversation-button {
    padding: 13px 15px;
  }

  .chat-panel {
    display: block;
  }

  .chat-header {
    padding: 13px 15px;
    background: white;
  }

  .message-list {
    min-height: 230px;
    max-height: 46vh;
    align-content: start;
    padding: 14px;
  }

  .chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 12px;
    margin-bottom: calc(16px + env(safe-area-inset-bottom));
    background: white;
  }

  .chat-form .input {
    min-width: 0;
  }

  .chat-form .button {
    min-width: 112px;
  }
}

@media (max-width: 620px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .metrics,
  .compact-metric-grid,
  .user-grid,
  .group-roster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 94px;
    padding: 14px;
  }

  .metric span {
    font-size: 12px;
    line-height: 1.25;
  }

  .metric strong {
    margin-top: 12px;
    font-size: clamp(24px, 8vw, 30px);
  }

  .statistics-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    overflow-x: auto;
  }

  .statistics-tab {
    flex: 1 0 auto;
    min-height: 42px;
    padding: 9px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .ltv-metric strong {
    font-size: clamp(20px, 6.5vw, 27px);
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
  }

  .dashboard-metrics .metric {
    min-height: 92px;
    padding: 14px;
  }

  .dashboard-metrics .metric span {
    font-size: 12px;
    line-height: 1.25;
  }

  .dashboard-metrics .metric strong {
    margin-top: 12px;
    font-size: 30px;
  }

  .dashboard-section-title {
    margin: 19px 0 10px;
  }

  .dashboard-section-title h2 {
    font-size: 20px;
  }

  .dashboard-actions {
    gap: 10px;
  }

  .quick-action {
    min-height: 84px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px;
    border-radius: 15px;
  }

  .quick-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .quick-action-icon svg {
    width: 21px;
    height: 21px;
  }

  .quick-action-symbol {
    font-size: 21px;
  }

  .quick-action-label {
    font-size: 14px;
    line-height: 1.2;
  }

  .quick-action-arrow {
    font-size: 22px;
  }

  .user-grid {
    gap: 10px;
  }

  .user-card {
    gap: 11px;
    padding: 13px;
    border-radius: 15px;
  }

  .user-card-heading {
    display: grid;
    gap: 8px;
  }

  .user-card-heading h2 {
    font-size: 15px;
  }

  .user-card-heading p,
  .user-card-meta dd {
    font-size: 12px;
  }

  .user-card-meta dt {
    font-size: 10px;
  }

  .user-card .badge {
    width: max-content;
    max-width: 100%;
    font-size: 11px;
  }

  .user-card > .button {
    width: 100%;
    padding-right: 8px;
    padding-left: 8px;
  }

  .group-roster-grid {
    gap: 10px;
  }

  .statistics-period {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
  }

  .statistics-period strong {
    font-size: 15px;
  }

  .statistics-period span {
    font-size: 11px;
  }

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

  .statistics-group-card {
    padding: 12px;
    border-radius: 15px;
  }

  .statistics-group-card header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 9px;
  }

  .statistics-group-card h3 {
    font-size: 18px;
  }

  .statistics-group-card dl {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 5px;
  }

  .statistics-group-card dl > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 0;
    border-bottom: 1px solid #edf1f6;
  }

  .statistics-group-card dl > div:last-child {
    border-bottom: 0;
  }

  .statistics-group-card dt {
    font-size: 9px;
  }

  .statistics-group-card dd {
    font-size: 12px;
    text-align: right;
  }

  .child-avatar {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    font-size: 13px;
  }

  .child-avatar.large {
    width: 96px;
    height: 96px;
    flex-basis: 96px;
    font-size: 26px;
  }

  .child-identity {
    gap: 8px;
  }

  .child-card-heading {
    align-items: flex-start;
    gap: 13px;
  }

  .group-member-card {
    min-height: 86px;
    gap: 7px;
    padding: 12px;
    border-radius: 15px;
  }

  .group-member-main strong {
    font-size: 14px;
  }

  .group-member-main span {
    font-size: 10px;
  }

  .group-member-arrow {
    font-size: 21px;
  }

  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .field.grow {
    flex-basis: auto;
  }

  .schedule-item,
  .feed-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .forecast-detail-list .detail-row dd {
    text-align: left;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .attendance-person {
    grid-template-columns: 1fr;
  }

  .attendance-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .message {
    max-width: 92%;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-form .button {
    width: 100%;
  }

  .table-wrap.mobile-cards {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .mobile-cards table,
  .mobile-cards tbody,
  .mobile-cards tr,
  .mobile-cards td {
    display: block;
  }

  .mobile-cards thead {
    display: none;
  }

  .mobile-cards tr {
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
  }

  .mobile-cards td {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 6px 0;
    border: 0;
  }

  .mobile-cards td[data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 730;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .mobile-cards td:not([data-label]) {
    display: block;
  }
}

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


/* KRONE annual club fee */
.annual-fee-summary { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.annual-fee-summary > .muted { flex-basis: 100%; margin-top: 2px; }

/* KRONE child payment rows */
.child-payment-line {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
}

.child-payment-amount {
  white-space: nowrap;
  font-weight: 800;
}

.child-payment-state {
  min-width: 0;
}

.child-payment-action {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .mobile-cards td.child-payment-cell {
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }

  .mobile-cards td.child-payment-cell::before {
    align-self: center;
    font-size: 11px;
  }

  .child-payment-line {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "amount action"
      "state state";
    align-items: center;
    gap: 7px 10px;
    width: 100%;
  }

  .child-payment-amount {
    grid-area: amount;
    min-width: 0;
  }

  .child-payment-state {
    grid-area: state;
    min-width: 0;
  }

  .child-payment-line .badge {
    max-width: 100%;
    justify-self: start;
  }

  .child-payment-action {
    grid-area: action;
    min-width: 82px;
    padding-inline: 10px;
    justify-self: end;
  }
}

/* v4.5.7: child-parent messaging and announcement recipient list */
.child-parent-search-results {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 4px;
}

.child-parent-search-result {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.child-parent-search-result span {
  color: var(--muted);
  font-size: 13px;
}

.child-parent-search-result.active {
  border-color: var(--navy);
  background: var(--blue-soft);
}

.child-parent-selected {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--navy);
}

.announcement-recipient-list {
  display: grid;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
}

.announcement-recipient-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.announcement-recipient-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.announcement-recipient-item span,
.announcement-recipient-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .page-actions .button {
    width: 100%;
  }

  .announcement-recipient-item {
    align-items: stretch;
    flex-direction: column;
  }
}

.metric-action {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.metric-action:hover {
  border-color: #aebbd0;
  box-shadow: 0 9px 22px rgba(38, 59, 115, 0.08);
}

.metric-action small {
  display: block;
  margin-top: 7px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 750;
}

.attendance-detail-dialog {
  min-width: min(640px, 90vw);
}

.attendance-detail-list {
  display: grid;
  gap: 9px;
  max-height: 55vh;
  overflow-y: auto;
}

.attendance-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.attendance-detail-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.attendance-detail-item small {
  color: var(--muted);
}

.movement-detail-item {
  appearance: none;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.movement-detail-item:hover,
.movement-detail-item:focus-visible {
  border-color: var(--navy);
  box-shadow: 0 7px 18px rgba(38, 59, 115, 0.1);
}

.movement-detail-person,
.movement-detail-date {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.movement-detail-date {
  flex: 0 0 auto;
  text-align: right;
}

.attendance-detail-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 12px;
  font-size: 13px;
  color: var(--muted);
}

.attendance-detail-counts strong {
  color: var(--ink);
}

.missing-attendance-dialog {
  min-width: min(680px, 90vw);
}

.payment-attempts-dialog {
  min-width: min(720px, 90vw);
}

.payment-attempts-list {
  display: grid;
  gap: 10px;
  max-height: 56vh;
  overflow-y: auto;
}

.payment-attempt-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.payment-attempt-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.payment-attempt-card p,
.payment-attempt-card small {
  grid-column: 1 / -1;
  margin: 0;
}

.payment-attempt-card small {
  color: var(--muted);
}

.payment-attempt-error {
  color: var(--red);
}

.missing-attendance-groups {
  display: grid;
  gap: 12px;
  max-height: 58vh;
  overflow-y: auto;
}

.missing-attendance-group {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.missing-attendance-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.missing-attendance-group h3,
.missing-attendance-group ul {
  margin: 0;
}

.missing-attendance-group ul {
  display: grid;
  gap: 7px;
  padding: 0;
  list-style: none;
}

.missing-attendance-group li {
  margin: 0;
}

.missing-attendance-session {
  width: 100%;
  appearance: none;
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.missing-attendance-session:hover {
  border-color: #e4bd62;
  transform: translateY(-1px);
}

.missing-attendance-session:focus-visible {
  outline: 3px solid rgba(49, 90, 166, 0.25);
  outline-offset: 2px;
}

.missing-attendance-session span,
.missing-attendance-session small {
  color: var(--muted);
}

.missing-attendance-session small b {
  margin-left: 6px;
  color: var(--navy);
  white-space: nowrap;
}

.expense-actions {
  flex-wrap: wrap;
}

.success-state {
  border-color: #a8d9c6;
  background: var(--green-soft);
}

.billing-term-actions {
  margin-top: 12px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .attendance-detail-dialog {
    min-width: 0;
  }

  .missing-attendance-dialog {
    min-width: 0;
  }

  .payment-attempts-dialog {
    min-width: 0;
  }

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

  .missing-attendance-session {
    grid-template-columns: 1fr auto;
  }

  .missing-attendance-session small {
    grid-column: 1 / -1;
  }

  .attendance-detail-item {
    align-items: stretch;
    flex-direction: column;
  }

  .attendance-detail-counts {
    justify-content: flex-start;
  }

  .movement-detail-date {
    text-align: left;
  }

  .billing-term-actions .button {
    width: 100%;
  }
}

/* v4.6.3: mobile profile access */
.topbar-profile-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.topbar-profile-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 12px;
}

/* v4.7.1 — clearer parent finance and staff message deletion */
.parent-finance-period {
  margin-top: -6px;
  margin-bottom: 12px;
  text-transform: capitalize;
}

.parent-finance-card .detail-row dd {
  text-align: right;
}

.parent-finance-total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.card-link-text {
  margin: 14px 0 0;
  color: var(--navy);
  font-weight: 760;
}

.conversation-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--line);
}

.conversation-row .conversation-button {
  border-bottom: 0;
}

.conversation-delete {
  width: 42px;
  min-width: 42px;
  border: 0;
  border-left: 1px solid var(--line);
  background: white;
  color: var(--red);
  font-size: 25px;
  font-weight: 700;
  cursor: pointer;
}

.conversation-delete:hover {
  background: #fff4f5;
}

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

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
}

.message-meta small {
  margin-top: 0;
}

.message-delete {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 720px) {
  .parent-finance-card .detail-row {
    align-items: flex-start;
  }

  .conversation-delete {
    width: 46px;
    min-width: 46px;
  }

  .chat-header {
    align-items: flex-start;
  }

  .chat-header .button {
    flex: 0 0 auto;
  }
}

.document-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #dce3ef);
  border-radius: 18px;
}

.document-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  min-width: 0;
  white-space: normal;
  border: 0;
  border-radius: 13px;
  color: var(--muted, #71809d);
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.document-tab span {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(38, 59, 115, .1);
  color: inherit;
  font-size: 12px;
}

.document-tab.active {
  color: #243b78;
  background: #e9effc;
}

.document-policy-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--line, #dce3ef);
  border-radius: 18px;
  background: var(--surface, #fff);
}

.document-policy-entry strong,
.document-policy-entry small {
  display: block;
}

.document-policy-entry small {
  margin-top: 4px;
  color: var(--muted, #71809d);
}

.sick-note-card .detail-row dd .button,
.policy-card .detail-row dd .button {
  margin: 0;
}

.policy-preview {
  margin: 18px 0;
  border: 1px solid var(--line, #dce3ef);
  border-radius: 16px;
  overflow: hidden;
}

.policy-preview > summary {
  padding: 15px 18px;
  color: #263b73;
  font-weight: 800;
  cursor: pointer;
  background: #f7f9fd;
}

.policy-preview > .legal-document {
  max-height: 58vh;
  padding: 18px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.policy-preview .legal-document header p,
.policy-preview .legal-document p {
  color: var(--muted, #71809d);
  line-height: 1.55;
}

.policy-preview .legal-document h1 {
  margin-top: 0;
  font-size: 25px;
}

.policy-preview .legal-document h2 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.policy-dialog {
  width: min(760px, calc(100vw - 32px));
}

@media (max-width: 720px) {
  .document-tabs {
    margin-inline: -2px;
  }

  .document-tab {
    padding-inline: 8px;
    font-size: 13px;
  }

  .document-policy-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .document-policy-entry .button {
    width: 100%;
  }

  .policy-preview > .legal-document {
    max-height: 52vh;
    padding: 14px;
  }
}

/* KRONE v4.7.3 — attendance matrix */
.attendance-matrix-filters {
  align-items: end;
}

.attendance-matrix-title {
  margin-top: 24px;
}

.attendance-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 14px 0 16px;
  color: var(--muted, #71809b);
  font-size: 14px;
  font-weight: 700;
}

.attendance-matrix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.attendance-matrix-legend i {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  border: 1px solid rgba(31, 54, 99, 0.12);
  display: inline-block;
}

.attendance-matrix-legend .present i,
.attendance-matrix-cell.present { background: #dff5e9; color: #177a50; }
.attendance-matrix-legend .sick i,
.attendance-matrix-cell.sick { background: #fff1bd; color: #9a6800; }
.attendance-matrix-legend .vacation i,
.attendance-matrix-cell.vacation { background: #dfeeff; color: #245fa4; }
.attendance-matrix-legend .absent i,
.attendance-matrix-cell.absent { background: #f3f5f8; color: #8a94a8; }

.attendance-matrix-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line, #d9e1ee);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(29, 52, 91, 0.04);
}

.attendance-matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 100%;
  background: #fff;
}

.attendance-matrix-name-col {
  width: var(--matrix-name-width);
}

.attendance-matrix-date-col {
  width: var(--matrix-date-width);
}

.attendance-matrix-table th,
.attendance-matrix-table td {
  box-sizing: border-box;
  border-right: 1px solid #e2e7ef;
  border-bottom: 1px solid #e2e7ef;
  text-align: center;
  vertical-align: middle;
}

.attendance-matrix-shell {
  --matrix-name-width: 220px;
  --matrix-date-width: 76px;
  position: relative;
}

.attendance-matrix-sticky-head {
  position: sticky;
  top: 72px;
  z-index: 9;
  overflow: hidden;
  border: 1px solid var(--line, #d9e1ee);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #f7f9fc;
  box-shadow: 0 7px 18px rgba(29, 52, 91, 0.08);
}

.attendance-matrix-sticky-head-scroll {
  width: 100%;
  overflow: hidden;
}

.attendance-matrix-head-table {
  min-width: 100%;
}

.attendance-matrix-table thead th {
  padding: 12px 8px;
  background: #f7f9fc;
  color: #22324f;
  font-size: 13px;
}

.attendance-matrix-table thead th:not(.attendance-matrix-name),
.attendance-matrix-cell {
  width: var(--matrix-date-width);
  min-width: var(--matrix-date-width);
  max-width: var(--matrix-date-width);
}

.attendance-matrix-table thead th span,
.attendance-matrix-table thead th small {
  display: block;
}

.attendance-matrix-table thead th small {
  margin-top: 3px;
  color: #7a879f;
  font-weight: 500;
}

.attendance-matrix-name {
  position: sticky;
  left: 0;
  z-index: 2;
  width: var(--matrix-name-width);
  min-width: var(--matrix-name-width);
  max-width: var(--matrix-name-width);
  padding: 12px 14px;
  background: #fff;
  text-align: left !important;
  color: #17233f;
  font-size: 14px;
  font-weight: 700;
  white-space: normal;
}

.attendance-matrix-table thead .attendance-matrix-name {
  z-index: 5;
  background: #f7f9fc;
}

.attendance-matrix-cell {
  width: var(--matrix-date-width);
  min-width: var(--matrix-date-width);
  max-width: var(--matrix-date-width);
  height: 56px;
  padding: 4px;
  background: #fff;
}

.attendance-matrix-cell span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-weight: 900;
  font-size: 16px;
}

.attendance-matrix-cell.present span { background: #c9efdb; }
.attendance-matrix-cell.sick span { background: #ffe59a; }
.attendance-matrix-cell.vacation span { background: #cfe3fb; }
.attendance-matrix-cell.absent span { background: #e9edf3; }
.attendance-matrix-cell.pending { background: #fff; }
.attendance-matrix-cell.not-enrolled {
  background: repeating-linear-gradient(135deg, #fafbfc, #fafbfc 7px, #f1f3f6 7px, #f1f3f6 14px);
}

.attendance-matrix-table tr:last-child th,
.attendance-matrix-table tr:last-child td { border-bottom: 0; }
.attendance-matrix-table th:last-child,
.attendance-matrix-table td:last-child { border-right: 0; }

@media (max-width: 720px) {
  .attendance-matrix-shell {
    --matrix-name-width: 165px;
    --matrix-date-width: 64px;
  }

  .attendance-matrix-sticky-head {
    top: 64px;
    border-radius: 18px 18px 0 0;
  }

  .attendance-matrix-wrap {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0 0 18px 18px;
  }
  .attendance-matrix-name {
    width: var(--matrix-name-width);
    min-width: var(--matrix-name-width);
    max-width: var(--matrix-name-width);
    padding: 10px 10px;
    font-size: 13px;
  }
  .attendance-matrix-cell {
    height: 52px;
  }
  .attendance-matrix-cell span {
    width: 32px;
    height: 32px;
  }
}


/* KRONE v4.7.5 — departed children in matrix */
.attendance-matrix-child-name {
  display: block;
}

.attendance-matrix-group-badge {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.attendance-matrix-row-left .attendance-matrix-name {
  background: #fff1f2;
  color: #8f2035;
}

.attendance-matrix-left-badge {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fde2e7;
  color: #b32645;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

/* KRONE v4.8.6 — СБП и автоматическое подтверждение оплаты */
.payment-info-card {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #9bd0b9;
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--ink);
}

.payment-info-card.muted {
  border-color: var(--line);
  background: var(--surface);
}

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

.payment-info-card span {
  color: var(--muted);
  line-height: 1.45;
}

.parent-online-payment-actions {
  margin-top: 16px;
}

.online-payment-button {
  background: var(--navy);
  color: #fff;
}

.online-payment-button.is-disabled,
.online-payment-button:disabled {
  border-color: #cbd5e5;
  background: #e8edf6;
  color: #53617c;
  cursor: not-allowed;
  opacity: 1;
}

.payment-primary-actions {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.payment-primary-actions h2,
.payment-primary-actions p {
  margin: 0;
}

.compact-payment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.bank-payment-badge {
  margin-top: 5px;
  white-space: normal;
}

@media (max-width: 720px) {
  .compact-payment-card {
    align-items: stretch;
    flex-direction: column;
  }

  .parent-online-payment-actions .online-payment-button {
    width: 100%;
  }
}

.search-select-field {
  position: relative;
}

.search-select-field > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.search-select-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(10, 22, 40, 0.18);
}

.search-select-option {
  width: 100%;
  display: block;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.search-select-option:hover,
.search-select-option:focus-visible {
  background: var(--surface-soft, #eef3fb);
  outline: none;
}

/* KRONE v4.8.0 — electronic contract signing */
.notice {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #e7c568;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #6f4c00;
}

.notice.bad {
  border-color: #efb5c0;
  background: var(--red-soft);
  color: #8d1930;
}

.notice span {
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-attention-card {
  margin-top: 12px;
}

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

.contract-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contract-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.contract-filter-count {
  grid-column: 1 / -1;
  margin: 0;
}

.contract-family {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.contract-family > summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 750;
}

.contract-family-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.contract-family-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--background);
}

.contract-family-list span:first-child {
  display: grid;
  gap: 2px;
}

.contract-family-list small {
  color: var(--muted);
}

.registration-call {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #9bd0b9;
  border-radius: 14px;
  background: var(--green-soft);
}

.registration-call[hidden] {
  display: none;
}

.registration-call h3,
.registration-call p {
  margin: 0;
}

.registration-legal {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.registration-legal summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 700;
}

.contract-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.contract-card-heading h2 {
  margin-top: 5px;
}

.contract-number {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.contract-warning {
  margin: 0;
  color: var(--red) !important;
  font-size: 13px;
}

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

.contract-overview-grid .card {
  min-width: 0;
}

.contract-overview-grid strong,
.contract-overview-grid p {
  overflow-wrap: anywhere;
}

.contract-signature-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 22px;
  margin-top: 16px;
  border-color: #a8d9c6;
  background: #f7fffb;
}

.contract-signature-card h2 {
  margin-top: 12px;
}

.contract-documents {
  display: grid;
  gap: 12px;
}

.contract-document {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.contract-document > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 19px;
  cursor: pointer;
  list-style: none;
}

.contract-document > summary::-webkit-details-marker {
  display: none;
}

.contract-document > summary span:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.contract-document > summary small {
  color: var(--muted);
}

.contract-document[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f9fbfe;
}

.contract-document-body {
  padding: 20px;
}

.legal-document {
  max-width: 860px;
  margin: 0 auto;
  color: #1b2943;
  font-size: 14px;
  line-height: 1.62;
}

.legal-document h1 {
  margin: 0 0 24px;
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
}

.legal-document h2 {
  margin: 24px 0 8px;
  font-size: 17px;
}

.legal-document p,
.legal-document ul {
  margin: 8px 0;
}

.legal-document dl {
  display: grid;
  gap: 7px;
}

.legal-document dl > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
}

.legal-document dt {
  color: var(--muted);
  font-weight: 700;
}

.legal-document dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.legal-document aside {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--navy);
  background: var(--blue-soft);
}

.contract-document-meta {
  display: grid;
  gap: 8px;
  margin: 22px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.contract-document-meta > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.contract-document-meta strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.contract-hash {
  overflow-wrap: anywhere;
  color: #334765;
  font-size: 11px;
}

.contract-signing-panel {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid #b9cae4;
  border-radius: var(--radius);
  background: #f8faff;
}

.contract-signing-panel > p {
  color: var(--muted);
}

.contract-ack-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.contract-ack {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  line-height: 1.45;
}

.contract-ack input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--navy);
}

.contract-otp-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #9bd0b9;
  border-radius: 14px;
  background: var(--green-soft);
}

.contract-otp-panel h3,
.contract-otp-panel p {
  margin-top: 0;
}

.contract-otp-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.contract-code-input {
  max-width: 220px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
}

.contract-audit-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.contract-audit-list article {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
}

.contract-audit-list time {
  color: var(--muted);
  font-size: 13px;
}

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

  .contract-search {
    grid-column: 1 / -1;
  }

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

@media (max-width: 720px) {
  .contract-filters {
    grid-template-columns: 1fr;
  }

  .contract-search {
    grid-column: auto;
  }

  .contracts-grid,
  .contract-overview-grid,
  .contract-signature-card {
    grid-template-columns: 1fr;
  }

  .contract-card-heading,
  .contract-document > summary,
  .contract-audit-list article,
  .contract-family-list > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .contract-document-body,
  .contract-signing-panel {
    padding: 15px;
  }

  .legal-document {
    font-size: 13px;
  }

  .legal-document h1 {
    font-size: 20px;
  }

  .legal-document dl > div {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .contract-otp-form {
    align-items: stretch;
    flex-direction: column;
  }

  .contract-code-input {
    max-width: none;
  }
}

/* KRONE 5.0: administrative legal document editor */
.document-tabs.admin-document-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.legal-document-card {
  min-width: 0;
}

.legal-document-card .button-row {
  flex-wrap: wrap;
}

.legal-document-dialog,
.legal-document-editor,
.legal-history-dialog {
  width: min(860px, calc(100vw - 32px));
  max-width: 860px;
}

.legal-document-editor-text {
  min-height: 360px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.55;
}

.legal-document-text {
  max-height: 52vh;
  overflow: auto;
  margin: 14px 0 0;
  padding: 16px;
  border: 1px solid var(--line, #dce3ef);
  border-radius: 14px;
  background: var(--surface-soft, #f7f9fc);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.55;
}

.legal-history-list {
  display: grid;
  gap: 12px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 2px;
}

.legal-history-item {
  padding: 14px;
  border: 1px solid var(--line, #dce3ef);
  border-radius: 14px;
  background: var(--surface, #fff);
}

.legal-history-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted, #71809d);
}

.legal-parent-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

@media (max-width: 900px) {
  .document-tabs.admin-document-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .legal-document-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .document-tabs.admin-document-tabs {
    grid-template-columns: 1fr 1fr;
  }
  .legal-document-dialog,
  .legal-document-editor,
  .legal-history-dialog {
    width: min(96vw, 860px);
  }
  .legal-parent-statuses {
    justify-content: flex-start;
  }
}

.legal-status-pair {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.legal-status-pair small {
  font-size: 10px;
  line-height: 1;
  color: var(--muted, #71809d);
}

@media (max-width: 560px) {
  .legal-status-pair {
    align-items: flex-start;
  }
}

/* KRONE 5.0: parent legal cabinet and revision reminders */
.parent-legal-dialog,
.parent-legal-update-dialog {
  width: min(860px, calc(100vw - 32px));
  max-width: 860px;
}

.parent-legal-text {
  max-height: 46vh;
}

.parent-legal-update-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.legal-update-item {
  width: 100%;
  border: 1px solid var(--line, #dce3ef);
  border-radius: 14px;
  background: var(--surface, #fff);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.legal-update-item span:first-child {
  display: grid;
  gap: 4px;
}

.legal-update-item small {
  color: var(--muted, #71809d);
}

.parent-consent-grid {
  margin-bottom: 18px;
}

.parent-consent-card .button-row,
.parent-consent-card > .button {
  margin-top: 10px;
}

.error-text {
  color: #9b2424;
}

@media (max-width: 560px) {
  .parent-legal-dialog,
  .parent-legal-update-dialog {
    width: min(96vw, 860px);
  }
  .legal-update-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* KRONE 5.0 — Настройки push-уведомлений */
.document-tabs.settings-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.push-template-help {
  margin-bottom: 20px;
}

.push-template-help p {
  margin: 8px 0 0;
}

.push-template-help code,
.push-template-variables code {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 8px;
  background: #edf2fa;
  color: var(--navy, #263b73);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.push-template-category {
  margin-top: 24px;
}

.push-template-grid {
  align-items: stretch;
}

.push-template-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.push-template-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.push-template-card-head h3,
.push-template-card-head p {
  margin: 0;
}

.push-template-card-head p {
  margin-top: 6px;
}

.push-template-preview {
  display: grid;
  gap: 10px;
  margin: 0;
}

.push-template-preview > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f9fd;
}

.push-template-preview dt {
  color: var(--muted, #71809d);
  font-size: 12px;
  font-weight: 700;
}

.push-template-preview dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.push-template-meta {
  margin-top: auto;
}

.push-template-variables {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

@media (max-width: 720px) {
  .push-template-card-head {
    flex-direction: column;
  }

  .push-template-card-head .button {
    width: 100%;
  }
}

/* KRONE 5.0 — выбор аудитории объявления по году рождения */
.announcement-birth-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.announcement-birth-year-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.announcement-birth-year-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--navy);
}

.announcement-birth-year-option span {
  display: grid;
  gap: 2px;
}

.announcement-birth-year-option small {
  color: var(--muted);
  font-size: 11px;
}


/* KRONE 5.0 — мероприятия */
.event-card {
  display: grid;
  gap: 14px;
}

.event-card h2 {
  margin: 0;
  line-height: 1.22;
}

.event-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.event-card-title {
  min-width: 0;
}

.event-card-date {
  margin: 6px 0 0;
  line-height: 1.35;
}

.event-card-audience {
  flex: 0 0 auto;
}

.event-card-payment {
  margin: 0;
}

.event-description {
  margin: 0;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  font-size: 1rem;
}

.event-card-actions {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.event-child-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.event-child-row {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 620px) {
  .event-card-head {
    flex-direction: column;
    gap: 10px;
  }

  .event-card-audience {
    align-self: flex-start;
  }

  .event-description {
    line-height: 1.65;
  }
}

/* KRONE 5.0.7.1: in-app sick-note file viewer */
.sick-note-file-dialog {
  width: min(960px, calc(100% - 20px));
  max-height: calc(100vh - 20px);
  overflow: hidden;
}
.sick-note-file-viewer {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 20px);
  padding: 16px;
  box-sizing: border-box;
}
.sick-note-file-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}
.sick-note-file-toolbar > div {
  min-width: 0;
}
.sick-note-file-toolbar strong,
.sick-note-file-toolbar span {
  display: block;
}
.sick-note-file-toolbar span {
  color: var(--muted);
  margin-top: 2px;
}
.sick-note-file-stage {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  overflow: auto;
  border-radius: 14px;
  background: #eef2f8;
}
.sick-note-file-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.sick-note-file-frame {
  display: block;
  width: 100%;
  min-height: min(70vh, 760px);
  border: 0;
  background: #fff;
}
.sick-note-file-actions {
  margin-top: 12px;
}
@media (max-width: 640px) {
  .sick-note-file-dialog {
    width: calc(100% - 10px);
    max-height: calc(100vh - 10px);
    border-radius: 16px;
  }
  .sick-note-file-viewer {
    max-height: calc(100vh - 10px);
    padding: 10px;
  }
  .sick-note-file-stage {
    min-height: 52vh;
  }
  .sick-note-file-image {
    max-height: calc(100vh - 180px);
  }
  .sick-note-file-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* KRONE 5.0.11 — дополнительные дети мероприятия */
.event-extra-children {
  margin-top: 14px;
}

[data-event-child-picker] {
  margin-top: 12px;
}

[data-event-child-list] {
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}


/* KRONE 5.0.11: configurable administrator mobile navigation order */
.nav-order-button {
  border: 1px dashed var(--line);
}

.admin-nav-order-list {
  display: grid;
  gap: 8px;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  padding-right: 2px;
}

.admin-nav-order-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.admin-nav-order-handle {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.admin-nav-order-actions {
  display: flex;
  gap: 4px;
}

.admin-nav-order-actions .button {
  min-width: 42px;
  padding-inline: 10px;
}

/* KRONE 5.0.11.9 — readable parent-link and vacation request cards */
.request-review-card .request-card-meta,
.parent-link-own-request .request-card-meta,
.request-review-card .request-card-status,
.parent-link-own-request .request-card-status {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.request-review-card .request-card-meta > strong,
.parent-link-own-request .request-card-meta > strong,
.request-review-card .request-card-meta > .muted,
.parent-link-own-request .request-card-meta > .muted,
.request-review-card .request-card-status > .muted,
.parent-link-own-request .request-card-status > .muted {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.request-review-card .request-card-status,
.parent-link-own-request .request-card-status {
  align-content: start;
  justify-items: start;
}

.request-review-card .button-row {
  margin-top: 5px;
}


/* KRONE 5.0.11.10 — compact mobile attendance matrix + collapsible event details */
.event-details {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.event-details-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
  color: #26395f;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.event-details-toggle::-webkit-details-marker { display: none; }
.event-details-toggle::after {
  content: "▾";
  margin-left: 8px;
  font-size: 12px;
  transition: transform .16s ease;
}
.event-details[open] .event-details-toggle::after { transform: rotate(180deg); }
.event-details[open] .event-description { margin-top: 10px; }
.event-details .event-description {
  border-top: 0;
  padding-top: 4px;
}

@media (max-width: 480px) {
  .attendance-matrix-shell {
    --matrix-name-width: 116px;
    --matrix-date-width: 48px;
  }
  .attendance-matrix-table thead th {
    padding: 8px 3px;
    font-size: 11px;
    line-height: 1.1;
  }
  .attendance-matrix-table thead th small {
    margin-top: 2px;
    font-size: 9.5px;
  }
  .attendance-matrix-name {
    padding: 7px 6px;
    font-size: 10.5px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .attendance-matrix-child-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .attendance-matrix-cell {
    height: 44px;
    padding: 2px;
  }
  .attendance-matrix-cell span {
    width: 27px;
    height: 27px;
    border-radius: 9px;
    font-size: 14px;
  }
  .attendance-matrix-legend {
    gap: 7px 10px;
    font-size: 11px;
  }
  .attendance-matrix-legend i {
    width: 12px;
    height: 12px;
    border-radius: 4px;
  }
}

/* KRONE 5.0.11.11 — eligible children viewer for admin and trainer */
.event-info-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.event-info-actions .event-details {
  border-top: 0;
  padding-top: 0;
}
.event-info-actions .event-details[open] {
  flex: 1 0 100%;
}
.event-eligible-button {
  min-height: 38px;
  white-space: nowrap;
}
.event-eligible-list {
  max-height: min(58vh, 620px);
  overflow: auto;
}
.event-eligible-child {
  display: grid;
  gap: 4px;
}
@media (max-width: 480px) {
  .event-info-actions {
    gap: 8px;
  }
  .event-eligible-button {
    white-space: normal;
  }
}

/* KRONE 5.0.11.12 — upcoming events first + automatic archive */
.events-sections {
  display: grid;
  gap: 24px;
}
.events-section-title {
  margin: 0 0 14px;
  font-size: 1.25rem;
}
.event-archive-section {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.event-archive-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 4px 2px;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  list-style: none;
}
.event-archive-toggle::-webkit-details-marker {
  display: none;
}
.event-archive-toggle::after {
  content: "▾";
  margin-left: auto;
  font-size: 0.9em;
  transition: transform 0.18s ease;
}
.event-archive-section[open] > .event-archive-toggle::after {
  transform: rotate(180deg);
}
.event-archive-list {
  margin-top: 14px;
}
.event-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.event-archive-badge {
  background: #eef2f7;
  color: var(--muted);
}
.archived-event-card {
  opacity: 0.94;
}

@media (max-width: 560px) {
  .event-card-badges {
    justify-content: flex-start;
  }
  .event-archive-toggle {
    font-size: 1.05rem;
  }
}


/* KRONE 5.0.11.13 — push diagnostics */
.push-diagnostics { margin-top: 18px; border-top: 1px solid var(--border, #d9e1ec); padding-top: 14px; }
.push-diagnostics > summary { cursor: pointer; font-weight: 700; color: var(--text, #17213a); min-height: 44px; display: flex; align-items: center; }
.push-diagnostics-body { padding-top: 8px; }
.push-diagnostic-origin { overflow-wrap: anywhere; word-break: break-word; }
.push-diagnostic-hint { margin: 12px 0; }

/* KRONE 5.0.11.20 — equipment cards with details */
.equipment-list {
  gap: 22px;
}

.equipment-card {
  overflow: hidden;
}

.equipment-summary {
  display: grid;
  gap: 16px;
}

.equipment-summary-text h2 {
  margin: 0 0 6px;
}

.equipment-details-toggle {
  justify-self: start;
}

.equipment-details {
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 18px;
}

.equipment-description {
  margin: 14px 0 4px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.equipment-parent-notice {
  margin-bottom: 22px;
}

.equipment-parent-notice strong {
  display: block;
  margin-bottom: 8px;
}

.equipment-parent-notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.equipment-product-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 18px;
  background: #f7f9fc;
  margin-bottom: 0;
}

.equipment-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.equipment-card-head h2 {
  margin: 0 0 6px;
}

.equipment-price {
  font-size: 1.45rem;
  font-weight: 800;
}

.equipment-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.equipment-info-grid > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  gap: 5px;
}

.equipment-info-grid span {
  color: var(--muted);
  font-size: .9rem;
}

.equipment-child-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.equipment-child-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.equipment-card-actions {
  margin-top: 18px;
}

.equipment-closed-note {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff6dc;
  color: #7a5600;
}

.equipment-size-chart-full {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
}

@media (max-width: 720px) {
  .equipment-info-grid {
    grid-template-columns: 1fr;
  }
  .equipment-child-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .equipment-child-row > div:last-child,
  .equipment-child-row .button,
  .equipment-card-actions .button {
    width: 100%;
  }
}


/* KRONE 5.0.11.21 — фильтр детей по нескольким годам рождения */
.child-birth-year-field {
  min-width: 180px;
}

.child-birth-year-filter {
  position: relative;
  min-width: 180px;
}

.child-birth-year-summary {
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  list-style: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.child-birth-year-summary::-webkit-details-marker {
  display: none;
}

.child-birth-year-summary::after {
  flex: 0 0 auto;
  color: var(--muted);
  content: "⌄";
  font-size: 18px;
  line-height: 1;
  transition: transform 120ms ease;
}

.child-birth-year-filter[open] .child-birth-year-summary::after {
  transform: rotate(180deg);
}

.child-birth-year-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0;
  width: min(310px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.child-birth-year-options {
  max-height: 280px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.child-birth-year-option {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.child-birth-year-option:has(input:checked) {
  border-color: var(--navy);
  background: var(--blue-soft);
}

.child-birth-year-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--navy);
}

.child-birth-year-option span {
  font-weight: 700;
}

.child-birth-year-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 10px;
}

@media (max-width: 720px) {
  .child-birth-year-field,
  .child-birth-year-filter,
  .child-birth-year-summary {
    width: 100%;
  }

  .child-birth-year-popover {
    right: 0;
    left: 0;
    width: 100%;
  }
}

/* KRONE 5.0.11.25 — единый фирменный дизайн родительского кабинета */
.app-shell.role-parent {
  --parent-bg-top: #071a36;
  --parent-bg-mid: #0a2a5a;
  --parent-bg-bottom: #06182f;
  --parent-accent: #1576ff;
  --parent-accent-2: #36a1ff;
  --parent-ink-on-dark: #f7fbff;
  --parent-muted-on-dark: #b8c7df;
}

.app-shell.role-parent .main-column {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 88% 10%, rgba(39, 125, 255, 0.24), transparent 28%),
    radial-gradient(circle at 14% 58%, rgba(19, 95, 205, 0.18), transparent 30%),
    linear-gradient(132deg, transparent 0 41%, rgba(63, 137, 255, 0.08) 41% 42%, transparent 42% 60%, rgba(13, 77, 159, 0.12) 60% 63%, transparent 63%),
    linear-gradient(155deg, var(--parent-bg-top) 0%, var(--parent-bg-mid) 54%, var(--parent-bg-bottom) 100%);
  color: var(--parent-ink-on-dark);
}

.app-shell.role-parent .main-column::before,
.app-shell.role-parent .main-column::after {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  content: "";
}

.app-shell.role-parent .main-column::before {
  inset: 72px 0 auto auto;
  width: min(52vw, 680px);
  height: min(46vw, 560px);
  opacity: 0.22;
  background:
    linear-gradient(154deg, transparent 0 20%, rgba(28, 112, 255, 0.7) 20% 23%, transparent 23% 35%, rgba(28, 112, 255, 0.42) 35% 38%, transparent 38%),
    linear-gradient(22deg, transparent 0 46%, rgba(255, 255, 255, 0.08) 46% 48%, transparent 48%);
  transform: skewX(-11deg);
}

.app-shell.role-parent .main-column::after {
  right: -14vw;
  bottom: -10vw;
  width: 58vw;
  height: 34vw;
  opacity: 0.17;
  background:
    linear-gradient(145deg, transparent 0 32%, #1e7cff 32% 36%, transparent 36% 51%, #0e5ccc 51% 55%, transparent 55% 66%, rgba(200, 16, 46, 0.8) 66% 68%, transparent 68%);
  transform: rotate(-7deg);
}

.app-shell.role-parent .topbar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(5, 23, 50, 0.88);
  color: white;
  box-shadow: 0 10px 30px rgba(0, 8, 24, 0.12);
}

.app-shell.role-parent .topbar-title strong {
  color: white;
}

.app-shell.role-parent .topbar-title span {
  color: #aebfd8;
}

.app-shell.role-parent .mobile-menu-toggle {
  color: white;
}

.app-shell.role-parent .page {
  max-width: 1180px;
}

.app-shell.role-parent .page-heading h1,
.app-shell.role-parent .section-title h2 {
  color: white;
}

.app-shell.role-parent .page-heading p {
  color: var(--parent-muted-on-dark);
}

.app-shell.role-parent .page-heading {
  margin-bottom: 26px;
}

.app-shell.role-parent .card,
.app-shell.role-parent .panel,
.app-shell.role-parent .metric,
.app-shell.role-parent .quick-action,
.app-shell.role-parent .filters,
.app-shell.role-parent .feed-item,
.app-shell.role-parent .schedule-item,
.app-shell.role-parent .message-layout,
.app-shell.role-parent .empty-state,
.app-shell.role-parent .loading-state {
  border-color: rgba(214, 225, 240, 0.88);
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(0, 17, 45, 0.18);
}

.app-shell.role-parent .card,
.app-shell.role-parent .panel,
.app-shell.role-parent .metric,
.app-shell.role-parent .quick-action {
  border-radius: 20px;
}

.app-shell.role-parent .button {
  border-radius: 13px;
  background: linear-gradient(135deg, #176fe6, #0e4fbe);
  box-shadow: 0 8px 18px rgba(17, 91, 206, 0.22);
}

.app-shell.role-parent .button:hover {
  background: linear-gradient(135deg, #2580fa, #135bcf);
}

.app-shell.role-parent .button.secondary,
.app-shell.role-parent .button.ghost {
  box-shadow: none;
}

.app-shell.role-parent .button.secondary {
  border-color: #d5dfec;
  background: white;
  color: var(--ink);
}

.app-shell.role-parent .button.ghost {
  background: transparent;
  color: #dbe8fb;
}

.app-shell.role-parent .quick-action {
  min-height: 104px;
}

.app-shell.role-parent .quick-action-icon {
  background: #e8f2ff;
  color: #1359bd;
}

.app-shell.role-parent .quick-action-arrow {
  color: #1977f3;
}

.app-shell.role-parent .dashboard-section-title {
  margin-top: 24px;
}

.parent-dashboard-hero {
  min-height: clamp(210px, 36vw, 360px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  background:
    linear-gradient(90deg, rgba(5, 18, 42, 0.18), rgba(5, 18, 42, 0.02)),
    url('/assets/parent-dashboard-hero.webp') center / cover no-repeat;
  box-shadow: 0 20px 48px rgba(0, 10, 30, 0.28);
}

.app-shell.role-parent .dashboard-actions {
  gap: 14px;
}

.app-shell.role-parent .grid-2,
.app-shell.role-parent .grid-3,
.app-shell.role-parent .feed-list,
.app-shell.role-parent .schedule-list {
  gap: 14px;
}

.app-shell.role-parent .parent-schedule-rule {
  min-height: 92px;
  border-radius: 16px;
  box-shadow: 0 7px 18px rgba(20, 52, 96, 0.08);
}

.app-shell.role-parent .parent-schedule-rule > div:first-child strong {
  color: #10254a;
  font-size: 17px;
}

.app-shell.role-parent .parent-schedule-rule > div:nth-child(2) strong {
  color: #10254a;
}

.app-shell.role-parent .parent-finance-card,
.app-shell.role-parent .equipment-parent-notice,
.app-shell.role-parent .parent-link-own-request {
  box-shadow: 0 12px 28px rgba(0, 17, 45, 0.16);
}

.app-shell.role-parent .field > span,
.app-shell.role-parent .field label {
  color: #334765;
}

.app-shell.role-parent .page-actions .button.secondary {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.96);
}

@media (min-width: 821px) {
  .app-shell.role-parent .sidebar {
    background: linear-gradient(180deg, #071a36, #0a2a5a 56%, #06182f);
  }
}

@media (max-width: 820px) {
  .app-shell.role-parent .topbar {
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .app-shell.role-parent .page {
    padding-top: 24px;
  }

  .app-shell.role-parent .page-heading h1 {
    font-size: 36px;
  }

  .app-shell.role-parent .page-heading p {
    font-size: 16px;
  }

  .app-shell.role-parent .dashboard-page {
    padding-top: 20px;
  }

  .parent-dashboard-hero {
    min-height: 220px;
    border-radius: 20px;
    background-position: center;
  }

  .app-shell.role-parent .dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell.role-parent .quick-action {
    min-height: 94px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: 15px;
  }

  .app-shell.role-parent .mobile-drawer {
    border-right-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #071a36, #0a2a5a 62%, #06182f);
    color: white;
  }

  .app-shell.role-parent .mobile-drawer-header,
  .app-shell.role-parent .mobile-drawer-user {
    border-color: rgba(255, 255, 255, 0.12);
  }

  .app-shell.role-parent .mobile-drawer .brand-lockup,
  .app-shell.role-parent .mobile-drawer-user strong {
    color: white;
  }

  .app-shell.role-parent .mobile-drawer .brand-lockup small,
  .app-shell.role-parent .mobile-drawer-user > span {
    color: #aebfd8;
  }

  .app-shell.role-parent .mobile-drawer-nav .nav-button {
    color: #b8c8df;
  }

  .app-shell.role-parent .mobile-drawer-nav .nav-button.active {
    color: white;
    background: rgba(35, 117, 255, 0.24);
  }

  .app-shell.role-parent .mobile-drawer-close {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: white;
  }
}

@media (max-width: 620px) {
  .app-shell.role-parent .dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell.role-parent .quick-action {
    min-height: 88px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 12px;
  }

  .app-shell.role-parent .quick-action-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .app-shell.role-parent .quick-action-label {
    font-size: 15px;
  }

  .parent-dashboard-hero {
    min-height: 192px;
    background-position: center;
  }
}

/* KRONE 5.0.11.28 — мобильная читаемость, даты без overflow, главная без стрелок */
.interface-theme-card > p {
  margin: 0 0 16px;
}

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

.interface-theme-option {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
}

.interface-theme-option:has(input:checked),
.interface-theme-option.selected {
  border-color: #7ea9ee;
  background: #eaf2ff;
  box-shadow: 0 0 0 2px rgba(23, 111, 230, 0.08);
}

.interface-theme-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 2px 0 0;
  accent-color: #176fe6;
}

.interface-theme-option span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.interface-theme-option strong,
.interface-theme-option small {
  display: block;
}

.interface-theme-option small {
  color: #65748c;
  line-height: 1.35;
}

/* Общая фирменная тема. Родители всегда получают theme-krone,
   администратор и тренер — только если выбрали её в профиле. */
.app-shell.theme-krone {
  --krone-bg-top: #071a36;
  --krone-bg-mid: #0a2a5a;
  --krone-bg-bottom: #06182f;
  --krone-accent: #176fe6;
  --krone-accent-2: #2580fa;
  --krone-on-dark: #f7fbff;
  --krone-muted-on-dark: #b8c7df;
}

.app-shell.theme-krone .main-column {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 88% 10%, rgba(39, 125, 255, 0.22), transparent 28%),
    radial-gradient(circle at 14% 58%, rgba(19, 95, 205, 0.16), transparent 30%),
    linear-gradient(132deg, transparent 0 41%, rgba(63, 137, 255, 0.08) 41% 42%, transparent 42% 60%, rgba(13, 77, 159, 0.11) 60% 63%, transparent 63%),
    linear-gradient(155deg, var(--krone-bg-top) 0%, var(--krone-bg-mid) 54%, var(--krone-bg-bottom) 100%);
  color: var(--krone-on-dark);
}

.app-shell.theme-krone .main-column::before,
.app-shell.theme-krone .main-column::after {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  content: "";
}

.app-shell.theme-krone .main-column::before {
  inset: 72px 0 auto auto;
  width: min(52vw, 680px);
  height: min(46vw, 560px);
  opacity: 0.18;
  background:
    linear-gradient(154deg, transparent 0 20%, rgba(28, 112, 255, 0.7) 20% 23%, transparent 23% 35%, rgba(28, 112, 255, 0.42) 35% 38%, transparent 38%),
    linear-gradient(22deg, transparent 0 46%, rgba(255, 255, 255, 0.08) 46% 48%, transparent 48%);
  transform: skewX(-11deg);
}

.app-shell.theme-krone .main-column::after {
  right: -14vw;
  bottom: -10vw;
  width: 58vw;
  height: 34vw;
  opacity: 0.14;
  background: linear-gradient(145deg, transparent 0 32%, #1e7cff 32% 36%, transparent 36% 51%, #0e5ccc 51% 55%, transparent 55% 66%, rgba(200, 16, 46, 0.8) 66% 68%, transparent 68%);
  transform: rotate(-7deg);
}

.app-shell.theme-krone .topbar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(5, 23, 50, 0.92);
  color: white;
  box-shadow: 0 10px 30px rgba(0, 8, 24, 0.12);
}

.app-shell.theme-krone .topbar-title strong,
.app-shell.theme-krone .mobile-menu-toggle {
  color: white;
}

.app-shell.theme-krone .topbar-title span {
  color: #aebfd8;
}

.app-shell.theme-krone .page-heading h1,
.app-shell.theme-krone #page-content > .section-title h2,
.app-shell.theme-krone .events-section-title {
  color: white;
}

.app-shell.theme-krone .page-heading p,
.app-shell.theme-krone #page-content > .section-title > p,
.app-shell.theme-krone #page-content > .section-title > div > p {
  color: var(--krone-muted-on-dark);
}

/* Рабочие поверхности всегда светлые и полностью непрозрачные. */
.app-shell.theme-krone .card,
.app-shell.theme-krone .panel,
.app-shell.theme-krone .metric,
.app-shell.theme-krone .quick-action,
.app-shell.theme-krone .filters,
.app-shell.theme-krone .feed-item,
.app-shell.theme-krone .schedule-item,
.app-shell.theme-krone .message-layout,
.app-shell.theme-krone .empty-state,
.app-shell.theme-krone .loading-state,
.app-shell.theme-krone .table-wrap,
.app-shell.theme-krone .document-tabs,
.app-shell.theme-krone .document-policy-entry {
  border-color: #d7e0ec;
  background: #fff;
  color: var(--ink);
  opacity: 1;
  box-shadow: 0 14px 34px rgba(0, 17, 45, 0.16);
}

.app-shell.theme-krone .card,
.app-shell.theme-krone .panel,
.app-shell.theme-krone .metric,
.app-shell.theme-krone .quick-action {
  border-radius: 20px;
}

.app-shell.theme-krone .card h1,
.app-shell.theme-krone .card h2,
.app-shell.theme-krone .card h3,
.app-shell.theme-krone .panel h1,
.app-shell.theme-krone .panel h2,
.app-shell.theme-krone .panel h3,
.app-shell.theme-krone .card .section-title h2,
.app-shell.theme-krone .panel .section-title h2 {
  color: var(--ink);
}

.app-shell.theme-krone .card p,
.app-shell.theme-krone .panel p,
.app-shell.theme-krone .card .muted,
.app-shell.theme-krone .panel .muted,
.app-shell.theme-krone .table-wrap .muted,
.app-shell.theme-krone .schedule-item .muted,
.app-shell.theme-krone .feed-item .muted {
  color: #65748c;
}

.app-shell.theme-krone .detail-row dd,
.app-shell.theme-krone .detail-row strong,
.app-shell.theme-krone .money,
.app-shell.theme-krone .child-identity-copy strong,
.app-shell.theme-krone .card-link-text {
  color: var(--ink);
}

.app-shell.theme-krone .detail-row dt {
  color: #64738b;
}

.app-shell.theme-krone .table-wrap,
.app-shell.theme-krone .table-wrap table,
.app-shell.theme-krone .table-wrap tbody,
.app-shell.theme-krone .table-wrap tr,
.app-shell.theme-krone .table-wrap td,
.app-shell.theme-krone .table-wrap th {
  color: var(--ink);
}

.app-shell.theme-krone .table-wrap th {
  color: #5f6e86;
}

.app-shell.theme-krone .mobile-cards tr {
  background: #fff;
  color: var(--ink);
  opacity: 1;
}

.app-shell.theme-krone .mobile-cards td[data-label]::before {
  color: #687790;
}

.app-shell.theme-krone .button:not(.secondary):not(.ghost):not(.danger):not(:disabled) {
  background: linear-gradient(135deg, #176fe6, #0e4fbe);
  color: #fff;
  box-shadow: 0 8px 18px rgba(17, 91, 206, 0.22);
}

.app-shell.theme-krone .button:not(.secondary):not(.ghost):not(.danger):not(:disabled):hover {
  background: linear-gradient(135deg, #2580fa, #135bcf);
  color: #fff;
}

.app-shell.theme-krone .button.secondary {
  border-color: #d5dfec;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.app-shell.theme-krone .button.ghost {
  background: transparent;
  color: #dbe8fb;
  box-shadow: none;
}

/* Disabled-кнопки не должны становиться синими с серым текстом. */
.app-shell.theme-krone .button:disabled,
.app-shell.theme-krone .online-payment-button.is-disabled,
.app-shell.theme-krone .online-payment-button:disabled {
  border-color: #cbd5e5;
  background: #e8edf6;
  color: #53617c;
  box-shadow: none;
  opacity: 1;
}

.app-shell.theme-krone .online-payment-button:not(:disabled),
.app-shell.theme-krone .event-card .button:not(.secondary):not(:disabled) {
  color: #fff;
}

.app-shell.theme-krone .document-tab {
  color: #5d6c85;
}

.app-shell.theme-krone .document-tab.active {
  background: #e9effc;
  color: #243b78;
}

.app-shell.theme-krone .document-policy-entry strong,
.app-shell.theme-krone .document-policy-entry h2,
.app-shell.theme-krone .contract-card-heading h2 {
  color: var(--ink);
}

.app-shell.theme-krone .document-policy-entry small,
.app-shell.theme-krone .contract-card-heading .muted {
  color: #65748c;
}

.app-shell.theme-krone .quick-action-icon {
  background: #e8f2ff;
  color: #1359bd;
}

.app-shell.theme-krone .quick-action-arrow {
  color: #1977f3;
}

/* Фирменный фон для сайдбара и мобильного меню. */
@media (min-width: 821px) {
  .app-shell.theme-krone .sidebar {
    background: linear-gradient(180deg, #071a36, #0a2a5a 56%, #06182f);
  }
}

.mobile-drawer.theme-krone {
  border-right-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #071a36, #0a2a5a 62%, #06182f);
  color: white;
}

.mobile-drawer.theme-krone .mobile-drawer-header,
.mobile-drawer.theme-krone .mobile-drawer-user {
  border-color: rgba(255, 255, 255, 0.12);
}

.mobile-drawer.theme-krone .brand-lockup,
.mobile-drawer.theme-krone .mobile-drawer-user strong {
  color: white;
}

.mobile-drawer.theme-krone .brand-lockup small,
.mobile-drawer.theme-krone .mobile-drawer-user > span {
  color: #aebfd8;
}

.mobile-drawer.theme-krone .nav-button {
  color: #b8c8df;
}

.mobile-drawer.theme-krone .nav-button.active {
  color: white;
  background: rgba(35, 117, 255, 0.24);
}

.mobile-drawer.theme-krone .mobile-drawer-close {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Родительская главная: hero не карточка, а полноширинный блок между приветствием и быстрыми действиями. */
.app-shell.role-parent.theme-krone .dashboard-page {
  --dashboard-page-pad: clamp(20px, 4vw, 48px);
  width: 100%;
  max-width: none;
  padding-right: 0;
  padding-left: 0;
}

.app-shell.role-parent.theme-krone .dashboard-page > .page-heading,
.app-shell.role-parent.theme-krone .dashboard-page #page-content > :not(.parent-dashboard-hero) {
  width: min(1180px, calc(100% - (2 * var(--dashboard-page-pad))));
  margin-right: auto;
  margin-left: auto;
}

.app-shell.role-parent.theme-krone .parent-dashboard-hero {
  width: 100%;
  min-height: 0;
  aspect-ratio: 941 / 485;
  margin: -10px 0 16px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(5, 18, 42, 0.08), rgba(5, 18, 42, 0)),
    url('/assets/parent-dashboard-hero.webp') center / cover no-repeat;
  box-shadow: none;
  /* Изображение не заканчивается жёсткой прямой: края растворяются в фоне KRONE. */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.62) 6%,
    #000 15%,
    #000 84%,
    rgba(0, 0, 0, 0.62) 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.62) 6%,
    #000 15%,
    #000 84%,
    rgba(0, 0, 0, 0.62) 94%,
    transparent 100%
  );
}

/* Даты в посещаемости: ни один input не выходит за границы карточки. */
#parent-attendance-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#parent-attendance-filters .field,
#parent-attendance-filters .field.grow,
#parent-attendance-filters .input,
#parent-attendance-filters .select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

#parent-attendance-filters .field.grow,
#parent-attendance-filters > .button {
  grid-column: 1 / -1;
}

/* Месячные карточки посещаемости и история оплаты должны быть контрастными. */
.app-shell.role-parent.theme-krone #parent-attendance-results .mobile-cards tr,
.app-shell.role-parent.theme-krone .parent-finance-card,
.app-shell.role-parent.theme-krone .parent-finance-card .detail-row,
.app-shell.role-parent.theme-krone .event-card,
.app-shell.role-parent.theme-krone .parent-consent-card,
.app-shell.role-parent.theme-krone .contract-card {
  color: var(--ink);
}

@media (max-width: 720px) {
  .interface-theme-options {
    grid-template-columns: 1fr;
  }

  #parent-attendance-filters {
    grid-template-columns: 1fr;
  }

  #parent-attendance-filters .field.grow,
  #parent-attendance-filters > .button {
    grid-column: auto;
  }

  .app-shell.role-parent.theme-krone .dashboard-page {
    --dashboard-page-pad: 20px;
    padding-top: 24px;
  }

  .app-shell.role-parent.theme-krone .parent-dashboard-hero {
    margin-top: 0;
    margin-bottom: 22px;
  }
}


/* KRONE 5.0.11.28 — быстрые действия без декоративных стрелок. */
.app-shell.role-parent .quick-action-arrow,
.app-shell.theme-krone .quick-action-arrow {
  display: none !important;
}

/* На iOS input[type=date] имеет собственную intrinsic-width. Жёстко ограничиваем его карточкой. */
#parent-attendance-filters,
#parent-attendance-filters .field,
#parent-attendance-filters .field.grow {
  min-width: 0;
  max-width: 100%;
}

#parent-attendance-filters input[type="date"].input {
  display: block;
  inline-size: 100%;
  width: 100%;
  min-inline-size: 0;
  min-width: 0;
  max-inline-size: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

#parent-attendance-filters input[type="date"].input::-webkit-date-and-time-value {
  min-width: 0;
  text-align: center;
}

@media (max-width: 720px) {
  #parent-attendance-filters {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #parent-attendance-filters .field {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
}


/* KRONE 5.0.11.28 — admin parent requests collapsible sections */
.admin-request-section {
  margin: 0 0 22px;
}

.admin-request-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 4px 2px;
  color: var(--text, #17213a);
  user-select: none;
}

.admin-request-section > summary::-webkit-details-marker {
  display: none;
}

.admin-request-section-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-request-section-title {
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-request-section-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--border, #d8e0ed);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--brand, #24488f);
  font-weight: 750;
  font-size: 15px;
}

.admin-request-section-toggle::before { content: "Раскрыть"; }
.admin-request-section[open] .admin-request-section-toggle::before { content: "Свернуть"; }

.admin-request-section-body {
  margin-top: 10px;
}

@media (max-width: 720px) {
  .admin-request-section > summary {
    gap: 10px;
  }

  .admin-request-section-heading {
    gap: 8px;
  }

  .admin-request-section-title {
    font-size: 25px;
  }

  .admin-request-section-toggle {
    min-height: 40px;
    padding: 7px 11px;
    font-size: 14px;
  }
}

/* KRONE 5.0.11.28 — compact staff tools, statistics details and messenger polish */

/* Табель: ещё компактнее на телефонах — больше детей и дат одновременно. */
@media (max-width: 480px) {
  .attendance-matrix-shell {
    --matrix-name-width: 102px;
    --matrix-date-width: 43px;
  }

  .attendance-matrix-table thead th {
    padding: 6px 2px;
    font-size: 9.5px;
    line-height: 1.02;
  }

  .attendance-matrix-table thead th small {
    margin-top: 1px;
    font-size: 8px;
  }

  .attendance-matrix-name {
    padding: 5px 4px;
    font-size: 9.2px;
    line-height: 1.05;
    letter-spacing: .01em;
  }

  .attendance-matrix-cell {
    height: 37px;
    padding: 1px;
  }

  .attendance-matrix-cell span {
    width: 23px;
    height: 23px;
    border-radius: 8px;
    font-size: 12px;
  }
}

/* The mobile .page-actions container uses a two-column grid. The finance
   toolbar is a single grid child and must span both columns, not just one. */
@media (max-width: 760px) {
  .page-actions > .finance-toolbar-actions {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }
}

/* Оплата: три основные команды держим одной компактной строкой. */
.finance-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 7px;
  width: 100%;
}

.finance-toolbar-actions .button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  font-size: 12.5px;
  line-height: 1.12;
  text-align: center;
}

@media (max-width: 420px) {
  /* Four commands cannot remain on one row at 320px: on small phones
     use two equally sized, readable columns without sideways scrolling. */
  .finance-toolbar-actions {
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }
  .finance-toolbar-actions .button {
    flex: 1 1 calc(50% - 4px);
    width: calc(50% - 4px);
    max-width: calc(50% - 4px);
    min-width: 0;
    min-height: 44px;
    padding: 9px 5px;
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Подробные расходы показываются модально, а не далеко ниже на странице. */
.statistics-expense-dialog {
  width: min(960px, 92vw);
  max-width: 960px;
  max-height: min(86vh, 900px);
  overflow-y: auto;
}

.statistics-expense-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.statistics-expense-dialog .section-title {
  margin-top: 24px;
}

@media (max-width: 620px) {
  .statistics-expense-dialog-head {
    flex-direction: column;
  }
}

/* Сообщения: привычная схема "список диалогов -> чат", как в мессенджерах. */
.vk-message-layout {
  min-height: 620px;
  background: #fff;
  border-radius: 20px;
}

.vk-conversation-list {
  background: #fff;
}

.vk-message-layout .conversation-row {
  min-height: 72px;
}

.vk-message-layout .conversation-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
}

.conversation-avatar {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e9f2ff, #d9e8ff);
  color: #214a91;
  font-weight: 800;
  font-size: 15px;
}

.conversation-main {
  min-width: 0;
}

.conversation-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview {
  overflow: hidden;
  margin-top: 4px !important;
  color: #75839a !important;
  font-size: 13px !important;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-side {
  display: flex !important;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  color: #8793a8;
}

.conversation-side small { font-size: 11px; }

.conversation-unread {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #1977f3;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800;
}

.vk-chat-header {
  min-height: 66px;
  padding: 10px 14px;
  background: #fff;
}

.chat-back-button {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #edf4ff;
  color: #1e5eb8;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.chat-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.chat-contact {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-contact strong,
.chat-contact span {
  display: block;
}

.chat-contact strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contact span {
  margin-top: 2px;
  color: #8290a7;
  font-size: 12px;
}

.vk-message-list {
  background: #edf2f7;
}

.vk-message-list .message {
  border: 0;
  box-shadow: 0 1px 2px rgba(17, 36, 67, .08);
}

.vk-message-list .message.own {
  background: #dcebff;
  color: var(--ink);
}

.chat-empty-message,
.chat-placeholder {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 260px;
  color: #7c899d;
  text-align: center;
}

.vk-chat-form {
  background: #fff;
}

@media (max-width: 820px) {
  .vk-message-layout {
    min-height: 0;
    overflow: visible;
    border: 0;
    border-radius: 18px;
  }

  .vk-message-layout .conversation-list {
    display: block;
    max-height: none;
    border: 0;
    border-radius: 18px;
  }

  .vk-message-layout .chat-panel {
    display: none;
  }

  .vk-message-layout.chat-open .conversation-list {
    display: none;
  }

  .vk-message-layout.chat-open .chat-panel {
    display: grid;
    grid-template-rows: auto minmax(300px, 1fr) auto;
    min-height: min(70vh, 720px);
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
  }

  .chat-back-button { display: inline-flex; align-items: center; justify-content: center; }

  .vk-message-list {
    min-height: 300px;
    max-height: 56vh;
  }

  .vk-chat-form {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-bottom: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .chat-delete-dialog {
    padding: 7px 9px;
    font-size: 12px;
  }
}


/* KRONE 5.0.11.30 — mobile messenger must never exceed the viewport. */
@media (max-width: 820px) {
  .vk-message-layout,
  .vk-message-layout.chat-open {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
  }

  .vk-message-layout .chat-panel,
  .vk-message-layout.chat-open .chat-panel,
  .vk-chat-header,
  .vk-message-list,
  .vk-chat-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .vk-message-layout.chat-open .chat-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .vk-chat-header {
    justify-content: flex-start;
    overflow: hidden;
  }

  .chat-back-button,
  .chat-avatar,
  .vk-chat-header .chat-delete-dialog {
    flex: 0 0 auto;
  }

  .chat-contact {
    width: 0;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 0;
    overflow: hidden;
  }

  .chat-contact strong,
  .chat-contact span {
    min-width: 0;
    max-width: 100%;
  }

  .vk-message-list {
    overflow-x: hidden;
    padding-left: 12px;
    padding-right: 12px;
  }

  .vk-message-list .message {
    min-width: 0;
    max-width: 84%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .vk-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    overflow: hidden;
    padding-left: 12px;
    padding-right: 12px;
  }

  .vk-chat-form .input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .vk-chat-form .chat-send-button {
    width: auto;
    min-width: 0;
    max-width: 112px;
    padding-left: 14px;
    padding-right: 14px;
    white-space: nowrap;
  }

  .vk-chat-header .chat-delete-dialog {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .vk-chat-header .chat-delete-dialog::before {
    content: "×";
    font-size: 22px;
    line-height: 1;
  }
}


/* KRONE 5.0.11.32 — hero на главной родителя плавно растворяется в фирменном фоне. */
@media (max-width: 720px) {
  .app-shell.role-parent.theme-krone .parent-dashboard-hero {
    margin-top: -8px;
    margin-bottom: 14px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.72) 6%, #000 14%, #000 85%, rgba(0,0,0,.72) 94%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.72) 6%, #000 14%, #000 85%, rgba(0,0,0,.72) 94%, transparent 100%);
  }
}

/* 5.0.11.33: seasonal club-fee mode hides irrelevant monthly filters. */
#finance-filters [data-finance-monthly-only][hidden] { display: none !important; }

.finance-toolbar-actions > [hidden] { display: none !important; }

/* KRONE 5.0.11.35 — readable requests section headings on branded dark background. */
.app-shell.theme-krone .admin-request-section > summary,
.app-shell.theme-krone .admin-request-section-title {
  color: #fff;
}
.app-shell.theme-krone .admin-request-section-heading > .badge {
  background: #edf3fc;
  color: #253b62;
}
.app-shell.theme-krone .admin-request-section-toggle {
  background: #fff;
  border-color: #d5dfec;
  color: #203b6f;
}
@media (max-width: 720px) {
  .admin-request-section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }
  .admin-request-section-title {
    font-size: clamp(19px, 4.6vw, 25px);
  }
  .admin-request-section > summary {
    align-items: center;
  }
}

/* Event audience warning: readable on the light modal on every theme. */
.event-birth-warning {
  min-width: 0;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #e9c68b;
  border-radius: 12px;
  background: #fff6e6;
  color: #533c1b;
}
.event-birth-warning > strong {
  display: block;
  font-size: 15px;
  line-height: 1.4;
}
.event-birth-warning p {
  margin: 7px 0 12px;
  color: #654c28;
  line-height: 1.45;
}
.event-missing-birth-list {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow-y: auto;
  margin-top: 12px;
}
.event-missing-birth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  border-top: 1px solid #e7d9c2;
  padding: 10px 0 0;
}
.event-missing-birth-row > strong {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  color: #23314a;
}
.event-missing-birth-date {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #38465d;
  font-size: 13px;
}
.event-missing-birth-date .input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 16px;
}
@media (max-width: 420px) {
  .event-missing-birth-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .event-missing-birth-row > strong {
    grid-column: auto;
  }
}

/* KRONE 5.0.11.36 — readable admin user records and contract audit on light surfaces. */
.app-shell.theme-krone .user-card,
.app-shell.theme-krone .contract-audit-list article,
.app-shell.theme-krone .contract-overview-grid .card {
  background: #fff;
  color: #172440;
  border-color: #d7e0ec;
}
.app-shell.theme-krone .user-card-heading h2,
.app-shell.theme-krone .user-card-meta dd,
.app-shell.theme-krone .contract-audit-list article strong,
.app-shell.theme-krone .contract-overview-grid .card > strong {
  color: #172440;
  opacity: 1;
}
.app-shell.theme-krone .user-card-heading p,
.app-shell.theme-krone .user-card-meta dt,
.app-shell.theme-krone .contract-audit-list time,
.app-shell.theme-krone .contract-overview-grid .card p {
  color: #62728c;
  opacity: 1;
}
.app-shell.theme-krone .user-grid .user-card {
  box-shadow: 0 14px 34px rgba(0, 17, 45, 0.16);
}
.announcement-child-picker {
  min-width: 0;
  max-height: 290px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 4px;
}
.announcement-selected-child[hidden] { display: none !important; }
.announcement-selected-child span { overflow-wrap: anywhere; }
@media (max-width: 540px) {
  .announcement-child-picker { grid-template-columns: minmax(0, 1fr); }
}

/* 5.0.11.41 — attendance status within the eligible event audience */
.event-eligible-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.event-eligible-filters .button {
  min-height: 40px;
  max-width: 100%;
  white-space: normal;
}
.event-eligible-list {
  min-width: 0;
}
.event-eligible-child {
  overflow-wrap: anywhere;
}


/* KRONE 5.0.11.42 — installation help only when opened as a mobile browser tab. */
.home-install-hint {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  max-width: 100%;
  margin: 12px 0 18px;
  padding: 15px 17px;
  border: 1px solid #cad9ee;
  border-radius: 16px;
  background: #f2f7ff;
  color: #182d4b;
}
.home-install-hint-copy { min-width: 0; flex: 1; }
.home-install-hint-copy strong { display: block; font-weight: 750; font-size: 15px; line-height: 1.35; }
.home-install-hint-copy p { margin: 5px 0 0; color: #445d7e; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.home-install-hint-actions { display: flex; flex-shrink: 0; align-items: flex-start; gap: 8px; }
.home-install-hint-actions .button { white-space: nowrap; min-height: 40px; }
.home-install-hint-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  opacity: .8;
  font-size: 24px;
  cursor: pointer;
}
.home-install-hint-dismiss:focus-visible { outline: 3px solid #5598ff; outline-offset: 2px; }
.app-shell.theme-krone .home-install-hint {
  border-color: rgba(178, 202, 241, .3);
  background: rgba(20, 44, 85, .92);
  color: #fff;
}
.app-shell.theme-krone .home-install-hint-copy p { color: #d8e7ff; }
.app-shell.theme-krone .home-install-hint-dismiss { border-color: rgba(255,255,255,.4); }
@media (max-width: 640px) {
  .home-install-hint { flex-direction: column; gap: 12px; padding: 14px; }
  .home-install-hint-actions { justify-content: space-between; width: 100%; }
}


/* KRONE 5.0.11.42 — dashboard alert only when local push is disabled. */
.home-push-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  margin: 10px 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #f0c67d;
  background: #fff8e9;
  color: #543915;
}
.home-push-hint-copy { min-width: 0; flex: 1; }
.home-push-hint-copy strong { display: block; font-size: 15px; font-weight: 750; line-height: 1.35; }
.home-push-hint-copy p { margin: 5px 0 0; font-size: 13px; line-height: 1.5; color: #684d21; overflow-wrap: anywhere; }
.home-push-hint .button { flex-shrink: 0; min-height: 40px; white-space: nowrap; }
.app-shell.theme-krone .home-push-hint {
  background: rgba(95, 63, 22, .55);
  border-color: rgba(249, 194, 92, .55);
  color: #fff;
}
.app-shell.theme-krone .home-push-hint-copy p { color: #ffedcf; }
@media (max-width: 640px) {
  .home-push-hint { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .home-push-hint .button { align-self: flex-start; white-space: normal; }
}

/* KRONE 5.0.11.42 — narrow phones: keep both columns inside the viewport.
   Long Russian labels must never expand the parent dashboard grid. */
.app-shell.role-parent .dashboard-actions,
.app-shell.role-parent .quick-action,
.app-shell.role-parent .quick-action-label {
  min-width: 0;
  max-width: 100%;
}
.app-shell.role-parent .quick-action-label {
  overflow-wrap: anywhere;
}
@media (max-width: 375px) {
  .app-shell.role-parent .dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .app-shell.role-parent .quick-action {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 104px;
    padding: 12px 8px;
    text-align: center;
  }
  .app-shell.role-parent .quick-action-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }
  .app-shell.role-parent .quick-action-label {
    font-size: 13px;
    line-height: 1.25;
  }
  .app-shell.role-parent .quick-action-unread {
    vertical-align: middle;
  }
}

/* KRONE 5.0.11.42 — 320px screens: long actions in admin/trainer dashboards.
   The previous mobile grid adjustment covered only the parent role. */
@media (max-width: 375px) {
  .app-shell:not(.role-parent) .dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .app-shell:not(.role-parent) .dashboard-actions .quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
    max-width: 100%;
    min-height: 112px;
    padding: 12px 8px;
    gap: 7px;
  }
  .app-shell:not(.role-parent) .dashboard-actions .quick-action-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }
  .app-shell:not(.role-parent) .dashboard-actions .quick-action-label {
    min-width: 0;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}


/* KRONE 5.0.11.43 — parent home quick actions on real 320–430px phones.
   Put the icon above the label; never split a Russian word mid-word. */
@media (max-width: 430px) {
  .app-shell.role-parent .dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .app-shell.role-parent .dashboard-actions .quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    min-height: 108px;
    padding: 12px 6px;
    text-align: center;
  }
  .app-shell.role-parent .dashboard-actions .quick-action-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }
  .app-shell.role-parent .dashboard-actions .quick-action-label {
    display: block;
    min-width: 0;
    max-width: 100%;
    font-size: clamp(12px, 3.4vw, 15px);
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
  .app-shell.role-parent .dashboard-actions .quick-action-label .quick-action-unread {
    margin-left: 5px;
  }
}

/* KRONE 5.0.11.43 — iOS Safari: event cards must not grow wider than
   their mobile content area when buttons have long Russian labels. */
@media (max-width: 820px) {
  .events-sections,
  .events-upcoming-section,
  .events-sections .feed-list,
  .events-sections .event-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .events-sections,
  .events-sections .feed-list,
  .events-sections .event-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .events-sections .event-card-head,
  .events-sections .event-card-title,
  .events-sections .event-card-badges,
  .events-sections .event-info-actions,
  .events-sections .event-card-actions {
    min-width: 0;
    max-width: 100%;
  }
  .events-sections .event-card h2 {
    overflow-wrap: anywhere;
  }
  .events-sections .event-info-actions .event-details,
  .events-sections .event-info-actions .event-eligible-button,
  .events-sections .event-card-actions .button {
    min-width: 0;
    max-width: 100%;
  }
  .events-sections .event-eligible-button,
  .events-sections .event-card-actions .button {
    white-space: normal;
  }
}


/* KRONE 5.0.11.43 — group names in statistics must be readable
   on the white cards, including the dark-blue KRONE theme. */
.statistics-group-card h3,
.app-shell.theme-krone .statistics-group-card h3 {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.app-shell.theme-krone .statistics-group-card {
  color: var(--ink);
}

/* KRONE 5.0.11.44 — unpaid equipment order actions */
.equipment-parent-order-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.equipment-parent-order-buttons .button { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: normal; word-break: normal; }
@media (max-width: 720px) {
  .equipment-parent-order-buttons { width: 100%; flex-direction: column; align-items: stretch; }
  .equipment-parent-order-buttons .button { width: 100%; }
}

/* KRONE 5.0.11.46 — event invitation link and unread messages in sidebar */
.nav-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nav-button > span:first-child { min-width: 0; }
.nav-unread-count {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 999px;
  background: #d52244;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nav-unread-count[hidden] { display: none !important; }
.event-invitation-open { margin-top: 10px; max-width: 100%; white-space: normal; }
.event-invitation-highlight { outline: 3px solid #efb84a; outline-offset: 3px; }

/* 5.0.11.50 — internal achievement staging cards */
.achievement-notice { border-left: 5px solid var(--blue); }
.achievement-notice p { margin: 8px 0 0; line-height: 1.5; }
.achievement-selector,.achievement-notice { margin-bottom: 18px; }
.achievement-search { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.achievement-search .field { flex: 1 1 210px; min-width: 0; }
.achievement-selector>.field { margin-bottom: 20px; }
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,240px),1fr)); gap: 12px; margin-top: 15px; }
.achievement-card { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.achievement-card.inactive { opacity: .55; }
.achievement-icon { flex: 0 0 48px; display: grid; place-items: center; font-size: 28px; width: 48px; height: 48px; border-radius: 14px; background: var(--blue-soft); }
.achievement-card-body { min-width: 0; flex: 1; }
.achievement-card-body strong { display: block; overflow-wrap: anywhere; }
.achievement-card-body p { margin: 6px 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.achievement-card-body small { color: var(--muted); }
.achievement-actions { margin-top: 12px; }
.achievement-child-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.achievement-child-header h3 { margin: 0 auto 0 0; }
.achievement-progress { margin: 20px 0; display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.achievement-progress progress { flex: 0 0 100%; width: 100%; height: 12px; accent-color: var(--blue); }
.achievement-review-list { display: grid; gap: 10px; }
.achievement-review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 0; min-width: 0; }
.achievement-review-row > div:not(.button-row) { flex: 1 1 180px; min-width: 0; }
.achievement-review-row p { margin: 5px 0; overflow-wrap: anywhere; }
.achievement-history { margin-top: 18px; }
.achievement-history summary { cursor: pointer; font-weight: 700; }
@media (max-width: 420px) { .achievement-search .button { flex: 1 1 100%; } .achievement-review-row .button-row { flex-wrap: wrap; } }

/* 5.0.11.51 — compact search results, no separate child dropdown */
.achievement-search .achievement-status-filter { flex: 0 1 180px; min-width: 140px; }
.achievement-search-results { margin: 14px 0 22px; }
.achievement-result-list { display: grid; gap: 8px; }
.achievement-result { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; width: 100%; min-height: 54px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); cursor: pointer; font: inherit; }
.achievement-result strong { min-width: 0; overflow-wrap: anywhere; }
.achievement-result span { font-size: 14px; color: var(--muted); }
.achievement-result.selected { outline: 2px solid var(--blue); outline-offset: -2px; }
@media(max-width:420px) { .achievement-search .achievement-status-filter { flex: 1 1 100%; } .achievement-result { align-items: start; } }

/* KRONE 5.0.11.52 — контраст кнопок оплаты в карточках детей.
   В фирменной теме ghost-кнопки были светлыми на белых карточках. */
.app-shell.role-admin .child-payment-line .button.child-payment-action {
  min-height: 36px;
  min-width: 82px;
  border: 1px solid #a4b6d2;
  border-radius: 10px;
  background: #fff;
  color: #1b3156;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: none;
  opacity: 1;
}
.app-shell.role-admin .child-payment-line .button.child-payment-action:not(:disabled):hover {
  border-color: #5277af;
  background: #eef3fb;
  color: #142b52;
}
.app-shell.role-admin .child-payment-line .button.child-payment-action:disabled {
  border-color: #cfd8e5;
  background: #eff2f6;
  color: #59667a;
  opacity: 1;
  cursor: not-allowed;
}

/* KRONE 5.0.11.52 — QR-платёж, пока банковский шлюз не подключён */
.online-payment-button.is-manual {
  border: 1px solid #244d9d;
  background: #244d9d;
  color: #fff;
  cursor: pointer;
  opacity: 1;
}
.online-payment-button.is-manual:hover { background: #183e85; }
.manual-payment-dialog { text-align: center; }
.manual-payment-dialog h2 { margin-bottom: 12px; }
.manual-payment-dialog .manual-payment-notice {
  margin: 0 0 12px;
  color: #1b2a48;
  line-height: 1.5;
  font-weight: 650;
}
.manual-payment-dialog .manual-payment-purpose {
  margin: 0 0 12px;
  color: #4f5f79;
  overflow-wrap: anywhere;
}
.manual-payment-qr {
  display: block;
  width: min(100%, 370px);
  max-width: 100%;
  height: auto;
  margin: 8px auto 16px;
  border: 1px solid #e1e5ed;
  background: white;
  border-radius: 10px;
  image-rendering: auto;
}
.manual-payment-dialog .manual-payment-hint {
  margin: 0 0 12px;
  color: #50617e;
  line-height: 1.45;
  font-size: 0.9rem;
}
.manual-payment-dialog .dialog-actions { justify-content: center; flex-wrap: wrap; }
@media (max-width: 400px) {
  .manual-payment-dialog { padding: 16px; }
  .manual-payment-qr { width: min(100%, 300px); }
  .manual-payment-dialog .dialog-actions .button { flex: 1; }
}

/* KRONE 5.0.11.52 — archive events contrast fix (branded and normal themes).
   The archive toggle sits directly on the dark page background, unlike event
   cards. Give it its own opaque light surface instead of dark-on-dark text. */
.events-sections .event-archive-section {
  min-width: 0;
  max-width: 100%;
  border-top-color: var(--line, #dbe2ec);
}
.events-sections .event-archive-toggle,
.app-shell.theme-krone .events-sections .event-archive-toggle {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 14px 18px;
  border: 1px solid #cbdaf0;
  border-radius: 16px;
  background: #ffffff;
  color: #17213a;
  opacity: 1;
  box-shadow: 0 12px 28px rgba(4, 21, 48, 0.18);
  line-height: 1.35;
  text-align: left;
}
.events-sections .event-archive-toggle > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.events-sections .event-archive-toggle > .badge,
.app-shell.theme-krone .events-sections .event-archive-toggle > .badge {
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid #cbdaf0;
  background: #eaf2ff;
  color: #174a92;
  opacity: 1;
  font-weight: 800;
}
.events-sections .event-archive-toggle::after {
  flex: 0 0 auto;
  margin-left: 4px;
  color: #174a92;
  font-size: 1.1em;
}
.events-sections .event-archive-toggle:hover {
  background: #f6f9ff;
  border-color: #a9c5ee;
}
.events-sections .event-archive-toggle:focus-visible {
  outline: 3px solid #80aeff;
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .events-sections .event-archive-toggle {
    padding: 12px 14px;
    font-size: 1rem;
  }
}

/* KRONE 5.0.11.52: mobile finance — keep the long label above amounts,
   rather than in a narrow side column that collides with 4 800 ₽.
   Scope only to the main-charges amount cell: other tables are unchanged. */
@media (max-width: 760px) {
  .mobile-cards td.finance-main-amount-cell {
    display: block;
    min-width: 0;
    padding-top: 10px;
    padding-bottom: 12px;
    line-height: 1.55;
  }
  .mobile-cards td.finance-main-amount-cell[data-label]::before {
    display: block;
    max-width: 100%;
    margin-bottom: 6px;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .mobile-cards td.finance-main-amount-cell > strong,
  .mobile-cards td.finance-main-amount-cell > small {
    overflow-wrap: anywhere;
  }
}
