/*
 * Maintenance note: cascade order is intentional. Later responsive and theme
 * sections normalize earlier component rules, so do not reorder selectors
 * without running the browser smoke checks.
 */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap");

:root {
  --ink: #19322e;
  --green: #174c42;
  --green-2: #24685a;
  --mint: #e5f1ed;
  --cream: #f6f2e9;
  --paper: #fff;
  --gold: #c99a45;
  --red: #b94e45;
  --muted: #71807d;
  --line: #dfe7e4;
  --shadow: 0 18px 50px rgba(25, 50, 46, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f6f8f7;
  font:
    14px/1.5 "DM Sans",
    sans-serif;
}

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

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--paper);
}

.login-story {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 44px 7vw;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(10, 56, 47, 0.92), rgba(18, 76, 66, 0.78)),
    url("https://images.unsplash.com/photo-1503454537195-1dcabb73ffb9?auto=format&fit=crop&w=1400&q=80")
      center/cover;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.28em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: "Playfair Display";
  font-size: 26px;
}

.story-copy {
  margin: auto 0;
  max-width: 620px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  font-weight: 700;
  color: #d7c18d;
}

.eyebrow.green {
  color: var(--green-2);
}

/* Unified application button foundation. A final normalization below protects
   these dimensions from older theme overrides. */
.btn,
.actions .btn,
td .btn,
.hero-row .btn,
.form-actions .btn {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 72px;
  max-width: 100%;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  appearance: none;
}

.btn.primary {
  border-color: #d9ad00;
  background: var(--gold);
  color: var(--ink);
}

.btn.secondary {
  border-color: #cbdced;
  background: var(--mint);
  color: var(--green);
}

.btn.danger {
  border-color: #efc5c8;
  background: #fae8e5;
  color: var(--red);
}

.btn:hover:not(:disabled) {
  filter: brightness(0.97);
}

.btn:focus-visible {
  outline: 3px solid rgba(46, 101, 176, 0.24);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn.wide {
  width: 100%;
  min-height: 44px;
  height: 44px;
  justify-content: space-between;
}

.actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

td .btn + .btn {
  margin-left: 7px;
}

td .actions .btn + .btn {
  margin-left: 0;
}

.table-wrap td:last-child {
  white-space: nowrap;
}

.filters > .btn {
  align-self: end;
  justify-self: start;
}

@media (max-width: 760px) {
  .btn,
  .actions .btn,
  td .btn,
  .hero-row .btn,
  .form-actions .btn {
    min-width: 68px;
    height: 36px;
    min-height: 36px;
    padding-inline: 10px;
  }

  .actions,
  .form-actions {
    gap: 6px;
  }
}

/* Production audit trail */
.audit-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.audit-hero h3 {
  margin-top: 4px;
  font-size: 31px;
}

.audit-hero p {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--muted);
}

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

.audit-summary article {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--green-2);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(16, 42, 92, 0.03);
}

.audit-summary small,
.audit-summary span {
  display: block;
  color: var(--muted);
}

.audit-summary small {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 700;
}

.audit-summary strong {
  display: block;
  margin: 5px 0 1px;
  color: var(--ink);
  font-family: "Playfair Display", serif;
  font-size: 25px;
}

.audit-summary span {
  font-size: 11px;
}

.audit-search-panel {
  padding: 16px 18px;
}

.audit-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 9px;
}

.audit-search {
  margin: 0;
}

.audit-search span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.audit-search input {
  height: 38px;
  margin: 0;
}

.audit-advanced {
  margin-top: 13px;
  border-top: 1px solid var(--line);
}

.audit-advanced summary,
.audit-raw summary {
  width: max-content;
  padding: 12px 0 2px;
  color: var(--green-2);
  font-weight: 700;
  cursor: pointer;
}

.audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  padding-top: 10px;
}

.audit-filter-grid label {
  margin: 0;
  font-size: 11px;
}

.audit-filter-grid input,
.audit-filter-grid select {
  height: 38px;
  margin-top: 5px;
  padding: 7px 10px;
}

.audit-results {
  padding: 0;
  overflow: hidden;
}

.audit-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.audit-results-head strong,
.audit-results-head span {
  display: block;
}

.audit-results-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.audit-results-head label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.audit-results-head select {
  width: 74px;
  height: 34px;
  margin: 0;
  padding: 5px 8px;
}

.audit-table {
  min-width: 1120px;
  table-layout: fixed;
}

.audit-table thead {
  background: #1764aa;
}

.audit-table th {
  padding: 11px 10px;
  border-color: #2d76b7;
  color: #fff;
  font-size: 10px;
}

.audit-table th:nth-child(1) {
  width: 78px;
}
.audit-table th:nth-child(2) {
  width: 175px;
}
.audit-table th:nth-child(3) {
  width: 155px;
}
.audit-table th:nth-child(4) {
  width: 145px;
}
.audit-table th:nth-child(5) {
  width: 115px;
}
.audit-table th:nth-child(6) {
  width: 175px;
}
.audit-table th:nth-child(8) {
  width: 82px;
}

.audit-table tbody tr:nth-child(odd) {
  background: #f7f9fc;
}

.audit-table tbody tr:hover {
  background: #eef5fd;
}

.audit-table td {
  padding: 11px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.audit-table td strong,
.audit-table td small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-table td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.audit-id {
  color: var(--green-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 700;
}

.audit-stamp {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.audit-action,
.audit-entity {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.audit-action.neutral {
  background: #edf1f7;
  color: #46566c;
}

.audit-action.success {
  background: #e5f5ed;
  color: #17623f;
}

.audit-action.change {
  background: #e8f0fb;
  color: #245e9c;
}

.audit-action.critical {
  background: #fae8e5;
  color: #a3313a;
}

.audit-entity {
  border-radius: 5px;
  background: #fff5cb;
  color: #684f00;
}

.audit-notes {
  color: #536174;
  white-space: nowrap;
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 17px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.audit-pagination > div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.audit-page {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.audit-page.active {
  border-color: var(--green-2);
  background: var(--green-2);
  color: #fff;
}

dialog.audit-dialog {
  width: min(1080px, calc(100% - 30px));
}

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

.audit-detail-head h2 {
  margin: 4px 0;
  font-size: 27px;
}

.audit-detail-head p {
  margin: 0;
  color: var(--muted);
}

.audit-event-id {
  color: var(--green-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.audit-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.audit-detail-meta > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.audit-detail-meta small,
.audit-detail-meta strong,
.audit-detail-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-detail-meta small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 9px;
}

.audit-detail-meta strong {
  margin-top: 4px;
}

.audit-detail-meta span {
  color: var(--muted);
  font-size: 11px;
}

.audit-detail-note {
  margin: 13px 0 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: var(--cream);
}

.audit-detail-note p {
  margin: 3px 0 0;
}

.audit-diff-table {
  min-width: 760px;
  margin-top: 8px;
  table-layout: fixed;
}

.audit-diff-table th:first-child {
  width: 26%;
}

.audit-diff-table td {
  word-break: break-word;
}

.audit-diff-table code {
  color: var(--green-2);
  font-weight: 700;
}

.audit-raw {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.audit-json-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 10px;
}

.audit-json-grid pre {
  max-height: 300px;
  margin: 6px 0 0;
  padding: 12px;
  overflow: auto;
  border-radius: 6px;
  background: #102a5c;
  color: #e8f0fb;
  font:
    11px/1.55 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

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

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

@media (max-width: 600px) {
  .audit-hero,
  .audit-results-head,
  .audit-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-hero .actions {
    justify-content: flex-start;
  }

  .audit-summary,
  .audit-filter-grid,
  .audit-json-grid,
  .audit-detail-meta {
    grid-template-columns: 1fr;
  }

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

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

  .audit-pagination > div {
    overflow-x: auto;
  }
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
}

h1 {
  font-size: clamp(48px, 6vw, 84px);
  line-height: 0.98;
  margin: 22px 0;
}

.story-copy p {
  max-width: 480px;
  font-size: 17px;
  color: #e4efec;
}

.story-foot {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  width: min(420px, 100%);
}

.login-card h2 {
  font-size: 40px;
  margin: 10px 0;
}

.login-card > p {
  color: var(--muted);
  margin-bottom: 35px;
}

label {
  display: block;
  color: #435753;
  font-weight: 600;
  margin: 15px 0;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(36, 104, 90, 0.1);
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 17px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-height: 36px;
  line-height: 1.15;
  white-space: nowrap;
}

.btn.primary {
  background: var(--green);
  color: #fff;
}

.btn.secondary {
  background: var(--mint);
  color: var(--green);
}

.btn.danger {
  background: #fae8e5;
  color: var(--red);
}

.btn.wide {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
}

.demo-note {
  font-size: 12px !important;
  text-align: center;
  line-height: 1.7;
}

.mobile-brand {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px 20px;
  background: var(--green);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.sidebar nav {
  margin: 48px 0;
  display: grid;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-btn {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #bdd2cd;
  text-align: left;
  cursor: pointer;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.nav-btn .nav-icon {
  width: 19px;
  flex: 0 0 19px;
  text-align: center;
}

.nav-label {
  min-width: 0;
}

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

.nav-group-toggle .nav-chevron {
  width: auto;
  margin-left: auto;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.nav-group.open .nav-chevron {
  transform: rotate(90deg);
}

.nav-group.open > .nav-group-toggle,
.nav-group.has-active > .nav-group-toggle {
  background: rgba(244, 196, 0, 0.09);
  color: #fff;
}

.nav-submenu {
  display: none;
  gap: 3px;
  margin-left: 23px;
  padding: 3px 0 3px 8px;
  border-left: 1px solid rgba(244, 196, 0, 0.4);
}

.nav-group.open .nav-submenu {
  display: grid;
}

.nav-child {
  padding: 9px 11px;
  font-size: 13px;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.profile > span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d5b974;
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.profile small {
  display: block;
  color: #adc5bf;
}

.icon-btn,
.menu-btn,
.bell {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.notification-wrap { position: relative; }
.notification-wrap .bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #244d75; }
.notification-wrap .bell:hover,.notification-wrap .bell[aria-expanded="true"] { background: #e9f2fc; }
.notification-count { position: absolute; top: -1px; right: -1px; min-width: 18px; height: 18px; padding: 1px 3px; border-radius: 10px; background: #c33d4d; color: #fff; font-size: 11px; font-weight: 800; line-height: 16px; }
.notification-count[hidden],.notification-panel[hidden] { display: none; }
.notification-panel { position: absolute; z-index: 100; top: calc(100% + 12px); right: 0; width: min(370px,calc(100vw - 30px)); max-height: min(520px,75vh); overflow: auto; border: 1px solid #d8e4ef; border-radius: 14px; background: #fff; box-shadow: 0 16px 45px #1d38552a; }
.notification-panel header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid #e1e9f1; background: #fff; }
.notification-panel h3 { margin: 0; color: #173e66; font-size: 16px; }
.notification-panel header button,.notification-item button { border: 0; background: transparent; color: #17619e; font: inherit; cursor: pointer; }
.notification-panel header button { font-size: 22px; }
.notification-item { padding: 14px 16px; border-bottom: 1px solid #edf1f6; }
.notification-item.is-unread { background: #f1f7ff; }
.notification-item p { margin: 6px 0; line-height: 1.45; }
.notification-item small { color: #60778e; }
.notification-item button { margin-left: 8px; font-size: 12px; font-weight: 800; }
.notification-empty { margin: 0; padding: 22px 16px; color: #60778e; }

.workspace {
  min-width: 0;
}

.topbar {
  height: 91px;
  padding: 0 35px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
}

.topbar > div:first-of-type {
  margin-right: auto;
}

.topbar h2 {
  font-size: 23px;
}

.topbar #breadcrumb {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workspace-select {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}

.workspace-select select {
  width: clamp(112px, 13vw, 195px);
  min-height: 35px;
  padding: 5px 26px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}

.workspace-manage {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f7fc;
  color: #174c8d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .workspace-select span { display: none; }
  .workspace-select select { width: clamp(90px, 26vw, 140px); min-height: 34px; font-size: 11px; }
  .workspace-manage { font-size: 0; padding: 8px; }
  .workspace-manage::after { content: "Years"; font-size: 11px; }
  .top-actions { gap: 5px; }
}

@media (max-width: 520px) {
  .topbar { padding: 0 9px; gap: 5px; }
  .topbar > div:first-of-type { display: none; }
  .top-actions { flex: 1; justify-content: flex-end; }
  .workspace-select select { width: clamp(94px, 27vw, 120px); }
}

.term-pill {
  padding: 8px 12px;
  border-radius: 20px;
  background: var(--cream);
  font-size: 12px;
}

.bell {
  color: var(--gold);
}

.menu-btn {
  display: none;
}

.content {
  padding: 32px 35px;
  max-width: 1500px;
  margin: auto;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
}

.hero-row h3 {
  font-size: 30px;
}

.hero-row p {
  margin: 5px 0;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
}

.metric,
.panel {
  background: var(--paper);
  border: 1px solid #e7ecea;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(20, 55, 48, 0.02);
}

.metric {
  padding: 21px;
}

.metric .label {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  font-family: "Playfair Display";
  font-size: 28px;
  margin: 10px 0 4px;
}

.metric small {
  color: var(--green-2);
}

.metric.warn small {
  color: var(--red);
}

.panel {
  padding: 22px;
  margin-top: 19px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel h3 {
  font-size: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 19px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 130px 1fr 100px;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
}

.bar {
  height: 8px;
  background: #edf1ef;
  border-radius: 5px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--green-2);
  border-radius: 5px;
}

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

th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 10px;
  padding: 11px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 13px 11px;
  border-bottom: 1px solid #edf1ef;
  vertical-align: middle;
}

.table-wrap {
  overflow: auto;
}

/* One grid toolbar and column-search row throughout the application. */
.grid-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.grid-search-count {
  color: var(--muted);
  font-size: 12px;
}
.grid-search-row > td,
.grid-search-row > th {
  padding: 7px 11px;
  background: #f7faf9;
}
.grid-search-row input,
.grid-search-row select {
  width: 100%;
  min-width: 85px;
  margin: 0;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
.grid-clear[hidden],
table tr[hidden] {
  display: none !important;
}
@media print {
  .grid-toolbar,
  .grid-search-row {
    display: none !important;
  }
}

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

.student-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--mint);
  font-weight: 700;
}

.badge {
  display: inline-block;
  border-radius: 20px;
  padding: 4px 9px;
  background: var(--mint);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.badge.red {
  background: #fae8e5;
  color: var(--red);
}

.badge.gold {
  background: #f8efd9;
  color: #8b6827;
}

.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
  min-width: max-content;
}

.actions .btn {
  padding: 6px 9px;
  min-height: 30px;
  font-size: 11px;
  flex: 0 0 auto;
}

.subtext {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.audit-time {
  min-width: 175px;
  white-space: nowrap;
}

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

.filters,
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.filters label,
.form-grid label {
  margin: 0;
}

.form-grid .span-2 {
  grid-column: span 2;
}

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

.notice {
  padding: 14px;
  border-radius: 9px;
  background: var(--cream);
  margin: 10px 0;
}

.notice.unread {
  border-left: 3px solid var(--gold);
}

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

dialog {
  width: min(720px, calc(100% - 30px));
  max-height: 90vh;
  overflow: auto;
  border: 0;
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(8, 30, 27, 0.55);
}

.permission-matrix {
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.permission-matrix-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  color: #fff;
  background: #21496f;
}

.permission-matrix-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #f4f8fd;
}

.permission-module { border-bottom: 1px solid var(--line); }
.permission-module:last-child { border-bottom: 0; }
.permission-module > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  color: #173e69;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.permission-module > summary::before { content: "▸"; color: #2f6fb0; font-size: 17px; }
.permission-module[open] > summary::before { content: "▾"; }
.permission-module > summary:hover { background: #edf5ff; }
.permission-module > summary:focus-visible { outline: 2px solid #3975bd; outline-offset: -2px; }
.permission-module[open] > summary { background: #eaf2fb; }
.permission-module-count { margin-left: auto; color: #55718e; font-size: 13px; font-weight: 600; }
.permission-module .table-wrap { border-top: 1px solid var(--line); }
.permission-module table { width: 100%; }
.permission-module th:first-child, .permission-module td:first-child { min-width: 205px; text-align: left; }
.permission-module th:last-child, .permission-module td:last-child { min-width: 210px; }

.permission-matrix table {
  min-width: 850px;
}

.permission-matrix thead th {
  color: #fff;
  background: #1765a8;
  text-align: center;
}
.permission-matrix-title label, .permission-matrix thead label { color: #fff; }

.permission-matrix tbody tr:nth-child(odd) {
  background: #f1f3f5;
}

.permission-matrix td:not(:first-child) {
  text-align: center;
}

.permission-matrix label, .um-form .permission-matrix label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  cursor: pointer;
}

.permission-matrix input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
}

.matrix-other {
  display: inline-block;
  margin: 3px 8px !important;
}

#roleForm {
  min-width: min(1050px, 84vw);
}

.dialog-close {
  position: absolute;
  right: 16px;
  top: 13px;
  border: 0;
  background: none;
  font-size: 25px;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 25px;
  bottom: 25px;
  transform: translateY(120px);
  opacity: 0;
  background: var(--ink);
  color: #fff;
  padding: 13px 18px;
  border-radius: 9px;
  transition: 0.25s;
}

.toast.show {
  transform: none;
  opacity: 1;
}

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

.form-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #dc8f8f;
  border-radius: 8px;
  background: #fff1f1;
  color: #9b1c1c;
  font-weight: 600;
}

.receipt {
  padding: 15px;
}

.receipt-brand {
  text-align: center;
  margin-bottom: 25px;
}

.receipt-total {
  font-size: 30px;
  font-family: "Playfair Display";
}

.receipt dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.receipt dd {
  text-align: right;
  margin: 0;
  font-weight: 700;
}

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

  .two-col {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    display: none;
  }

  .login-panel {
    padding: 25px;
    min-height: 100vh;
  }

  .mobile-brand {
    display: flex;
    margin-bottom: 70px;
  }

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

  .sidebar {
    position: fixed;
    z-index: 20;
    width: 250px;
    transform: translateX(-100%);
    transition: 0.2s;
  }

  .sidebar.open {
    transform: none;
  }

  .menu-btn {
    display: block;
  }

  .topbar {
    height: 76px;
    padding: 0 18px;
  }

  .term-pill {
    display: none;
  }

  .content {
    padding: 22px 17px;
  }

  .hero-row {
    align-items: flex-start;
    gap: 14px;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric {
    padding: 15px;
  }

  .metric strong {
    font-size: 21px;
  }

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

  .form-grid .span-2 {
    grid-column: auto;
  }

  .hero-row {
    flex-wrap: wrap;
  }

  .hero-row > .btn {
    width: auto;
    flex: 0 0 auto;
  }

  dialog .form-actions {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    background: #fff;
  }
}

/* A dedicated control stays inside the left sidebar. */
.sidebar-toggle {
  display: none;
}

@media (min-width: 761px) {
  .app-shell {
    grid-template-columns: 330px minmax(0, 1fr);
    transition: grid-template-columns 0.22s ease;
  }

  .sidebar {
    position: sticky;
    width: 330px;
    transition:
      width 0.22s ease,
      padding 0.22s ease;
  }

  .sidebar-toggle {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    margin-top: 10px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #dbe7f8;
    font:
      700 12px/1 "DM Sans",
      sans-serif;
    cursor: pointer;
    transition:
      background 0.18s ease,
      color 0.18s ease,
      border-color 0.18s ease;
  }

  .sidebar-toggle:hover,
  .sidebar-toggle:focus-visible {
    border-color: rgba(244, 196, 0, 0.7);
    background: rgba(244, 196, 0, 0.14);
    color: #fff;
    outline: none;
  }

  .sidebar-toggle-icon {
    width: 18px;
    flex: 0 0 18px;
    color: #f4c400;
    text-align: center;
  }

  .menu-btn {
    display: none;
  }

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

  .app-shell.sidebar-collapsed .sidebar {
    width: 86px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .app-shell.sidebar-collapsed .sidebar .brand {
    min-height: 68px;
    padding: 5px;
    gap: 0;
  }

  .app-shell.sidebar-collapsed .sidebar .brand-logo {
    width: 58px;
    height: 58px;
    max-height: 58px;
    flex-basis: 58px;
  }

  .app-shell.sidebar-collapsed .sidebar .brand-title,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .nav-chevron,
  .app-shell.sidebar-collapsed .sidebar-toggle-label,
  .app-shell.sidebar-collapsed .profile > div {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle {
    align-self: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    margin-top: 10px;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .sidebar nav {
    margin-top: 24px;
    padding-right: 0;
    overflow-x: hidden;
  }

  .app-shell.sidebar-collapsed .nav-btn {
    justify-content: center;
    min-height: 44px;
    padding: 10px;
    gap: 0;
  }

  .app-shell.sidebar-collapsed .nav-btn .nav-icon {
    width: 22px;
    flex-basis: 22px;
    font-size: 17px;
  }

  .app-shell.sidebar-collapsed .nav-submenu,
  .app-shell.sidebar-collapsed .nav-group.open .nav-submenu {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar-foot {
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
  }

  .app-shell.sidebar-collapsed .profile {
    gap: 0;
  }

  .app-shell.sidebar-collapsed .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
  }
}

/* Desktop website sidebar only. */
@media (min-width: 761px) {
  .sidebar .brand {
    min-height: 96px;
    padding: 10px 14px;
    gap: 12px;
  }

  .sidebar .brand-logo {
    width: 78px;
    height: 78px;
    max-height: 78px;
    flex-basis: 78px;
    transform: translateX(0);
  }

  .sidebar .brand-title,
  .sidebar .brand-light .brand-title {
    margin-left: 0;
    font-size: 22px;
    line-height: 1.05;
  }

  .sidebar .brand-title small,
  .sidebar .brand-light .brand-title small {
    margin: 5px 0 0;
    font-size: 8px;
    line-height: 1.2;
    letter-spacing: 0.025em;
    transform: none;
  }
}

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

  .hero-row {
    display: block;
  }

  .hero-row .btn {
    margin-top: 12px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #modal,
  #modal * {
    visibility: visible;
  }

  #modal {
    position: absolute;
    inset: 0;
    width: 100%;
    max-height: none;
  }

  .dialog-close,
  .receipt .btn {
    display: none;
  }
  .guardian-statement-action {
    display: none;
  }
}

/* EPG Kuwait identity: navy foundation, royal blue support, and yellow action accents. */
:root {
  --ink: #102a5c;
  --green: #123d7a;
  --green-2: #2e65b0;
  --mint: #e8f0fb;
  --cream: #fff8df;
  --gold: #f4c400;
  --red: #b53c45;
  --muted: #66758b;
  --line: #dbe4f1;
  --shadow: 0 18px 50px rgba(16, 42, 92, 0.12);
}

body {
  background: #f4f7fc;
}

.login-story {
  background:
    linear-gradient(145deg, rgba(16, 42, 92, 0.96), rgba(31, 78, 151, 0.86)),
    url("https://images.unsplash.com/photo-1503454537195-1dcabb73ffb9?auto=format&fit=crop&w=1400&q=80")
      center/cover;
}

.brand-logo {
  display: block;
  width: 132px;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}

.login-panel .brand-logo {
  width: 155px;
  max-height: 66px;
}

.sidebar {
  background: linear-gradient(180deg, #102a5c, #123d7a);
}

.sidebar .brand-logo {
  background: #fff;
  border-radius: 8px;
  padding: 5px;
  width: 150px;
  max-height: 62px;
}

.nav-btn {
  color: #cfddf4;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(244, 196, 0, 0.18);
  color: #fff;
}

.profile > span {
  background: var(--gold);
  color: var(--ink);
}

.profile small {
  color: #c8d7ee;
}

.btn.primary {
  background: var(--gold);
  color: var(--ink);
}

.btn.primary:hover {
  background: #ffd42a;
}

.btn.secondary {
  background: var(--mint);
  color: var(--green);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(46, 101, 176, 0.14);
}

.eyebrow {
  color: #e1b800;
}

.eyebrow.green {
  color: var(--green-2);
}

.term-pill {
  background: var(--cream);
  color: var(--ink);
}

.bell {
  color: #d7a900;
}

.metric small {
  color: var(--green-2);
}

.bar {
  background: #e6edf8;
}

.bar i {
  background: linear-gradient(90deg, var(--green-2), var(--gold));
}

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

.notice {
  background: var(--cream);
}

.notice.unread {
  border-left-color: var(--gold);
}

.brand-title {
  font-size: 18px;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}

.brand-title small {
  display: block;
  margin-top: 4px;
  font:
    600 7px/1.2 "DM Sans",
    sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-light .brand-title {
  color: #fff;
}

.brand-light .brand-title small {
  color: #d8e4f8;
}

.login-story .brand-logo {
  width: 205px;
  max-height: 82px;
}

.login-story .brand-title {
  font-size: 28px;
}

.login-story .brand-title small {
  font-size: 9px;
}

.login-panel .brand-logo {
  width: 185px;
  max-height: 78px;
}

.login-panel .brand-title {
  font-size: 23px;
}

.sidebar .brand {
  gap: 9px;
}

.sidebar .brand-logo {
  width: 104px;
  max-height: 52px;
}

.sidebar .brand-title {
  font-size: 15px;
}

.sidebar .brand-title small {
  font-size: 6px;
}

.sidebar .brand {
  width: 100%;
  gap: 2px;
  padding: 7px 8px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.sidebar .brand-logo {
  width: 135px;
  max-height: 66px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  flex: 0 1 135px;
}

.sidebar .brand-light .brand-title {
  color: var(--ink);
  font-size: 13px;
}

.sidebar .brand-light .brand-title small {
  color: var(--muted);
  font-size: 5px;
  letter-spacing: 0.05em;
}

.sidebar .brand-title {
  white-space: normal;
  min-width: 0;
}

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

.sidebar {
  width: 330px;
}

.login-story .brand-logo {
  width: min(410px, 100%);
  max-height: 164px;
}

.login-story .brand-title {
  font-size: 46px;
}

.login-story .brand-title small {
  font-size: 14px;
}

.login-panel .brand-logo {
  width: min(370px, 100%);
  max-height: 156px;
}

.login-panel .brand-title {
  font-size: 38px;
}

.login-panel .brand-title small {
  font-size: 11px;
}

.sidebar .brand {
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 10px;
}

.sidebar .brand-logo {
  width: 270px;
  max-height: 128px;
  flex: 0 1 270px;
}

.sidebar .brand-title {
  text-align: center;
  white-space: nowrap;
  font-size: 22px;
}

.sidebar .brand-light .brand-title {
  font-size: 22px;
}

.sidebar .brand-light .brand-title small {
  font-size: 9px;
  letter-spacing: 0.09em;
}

.sidebar nav {
  margin: 36px 0;
}

@media (max-width: 760px) {
  .sidebar {
    width: min(330px, 100vw);
  }
}

.sidebar .brand {
  gap: 3px;
  padding: 6px 10px;
}

.sidebar .brand-title {
  order: 1;
}

.sidebar .brand-logo {
  order: 2;
  width: 270px;
  height: 82px;
  max-height: 82px;
  flex: 0 1 82px;
}

.sidebar .brand-title small {
  margin-top: 6px;
}

.sidebar .brand {
  position: relative;
  justify-content: center;
  min-height: 94px;
  padding: 6px;
}

.sidebar .brand-logo {
  order: initial;
  width: 350px;
  height: 82px;
  max-height: 82px;
  flex: 0 1 82px;
}

.sidebar .brand-title {
  position: absolute;
  z-index: 1;
  top: 17px;
  left: 55%;
  transform: translateX(-50%);
  order: initial;
  padding: 2px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
}

.sidebar .brand-light .brand-title {
  color: var(--ink);
  font-size: 25px;
}

.sidebar .brand-title small {
  display: all;
  font-size: 25px;
  margin-left: 33px;
}

/* Phone navigation: a focused drawer that can always be dismissed. */
.mobile-menu-close,
.menu-backdrop {
  display: none;
}

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

  /* The desktop 330px sidebar grid must not reserve space on a phone. */
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .workspace,
  .content,
  .cards,
  .panel,
  .metric {
    width: 100%;
    max-width: 100%;
  }

  .sidebar {
    width: min(300px, calc(100vw - 44px));
    max-width: none;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 14px 0 36px rgba(7, 25, 58, 0.28);
    transform: translateX(-110%);
    transition: transform 0.24s ease;
  }

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

  .menu-backdrop {
    position: fixed;
    z-index: 19;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(7, 25, 58, 0.44);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }

  .menu-backdrop.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 17px;
    right: 15px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    font:
      400 28px/1 Arial,
      sans-serif;
    cursor: pointer;
  }

  .sidebar .brand {
    flex-direction: row;
    min-height: 72px;
    padding: 5px 42px 5px 7px;
    align-items: center;
    justify-content: flex-start;
  }

  .sidebar .brand-logo {
    width: 64px;
    height: 64px;
    max-height: 64px;
    flex: 0 0 64px;
    padding: 4px;
    background: #fff;
    border-radius: 0;
    object-fit: contain;
    object-position: center;
    transform: translateX(7px);
  }

  .sidebar .brand-title {
    display: block;
    position: static;
    transform: none;
    margin-left: -3px;
    padding: 0;
    background: transparent;
    color: var(--ink);
    font-size: 17px;
    text-align: left;
    white-space: nowrap;
  }

  .sidebar .brand-title small {
    display: block;
    margin: 3px 0 0;
    font-size: 5px;
    letter-spacing: 0.04em;
    transform: translateX(-5px);
  }

  .sidebar nav {
    margin: 28px 0;
    gap: 5px;
  }

  .sidebar-foot {
    margin-top: 22px;
    flex: 0 0 auto;
  }

  .nav-btn {
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 8px;
  }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    height: 64px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .workspace {
    padding-top: 64px;
  }

  .top-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
  }

  .term-pill {
    display: block;
    max-width: 132px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 6px 8px;
    font-size: 10px;
  }

  .topbar h2 {
    font-size: 21px;
  }

  .menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--mint);
    color: var(--ink);
  }

  .content {
    padding: 18px 14px 30px;
  }

  .hero-row h3 {
    font-size: 27px;
    line-height: 1.12;
  }

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

  .metric strong {
    font-size: 19px;
  }

  /* Keep the small bundled crest at a crisp, near-native display size. */
  .mobile-brand {
    margin-bottom: 28px;
    gap: 10px;
  }

  .mobile-brand .brand-logo {
    width: 64px;
    height: 64px;
    max-height: 64px;
    flex: 0 0 64px;
  }

  .mobile-brand .brand-title {
    font-size: 21px;
    white-space: nowrap;
  }

  .mobile-brand .brand-title small {
    margin-top: 3px;
    font-size: 6px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 760px) and (orientation: landscape) {
  .topbar {
    height: 54px;
  }

  .workspace {
    padding-top: 54px;
  }

  .content {
    padding-top: 14px;
  }
}

/* One stable sidebar wordmark layout at every screen width. */
.sidebar .brand {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-height: 106px;
  padding: 6px 10px;
  gap: 10px;
  overflow: hidden;
}

.sidebar .brand-logo {
  position: static;
  order: 0;
  width: 96px;
  height: 96px;
  max-height: 96px;
  flex: 0 0 96px;
  padding: 4px;
  background: #fff;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  transform: translateX(7px);
}

.sidebar .brand-title,
.sidebar .brand-light .brand-title {
  position: static;
  order: 0;
  display: block;
  margin: 0 0 0 -3px;
  padding: 0;
  transform: none;
  background: transparent;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.1;
  text-align: left;
  white-space: nowrap;
}

.sidebar .brand-title small,
.sidebar .brand-light .brand-title small {
  display: block;
  margin: 3px 0 0 -5px;
  color: var(--muted);
  font-size: 5.5px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Phone app sidebar only. */
@media (max-width: 760px) {
  .sidebar .brand {
    min-height: 76px;
    padding-left: 6px;
    gap: 7px;
  }

  .sidebar .brand-logo {
    width: 66px;
    height: 66px;
    max-height: 66px;
    flex-basis: 66px;
    transform: translateX(0);
  }

  .sidebar .brand-title,
  .sidebar .brand-light .brand-title {
    font-size: 20px;
    transform: translateX(-3px);
  }

  .sidebar .brand-title small,
  .sidebar .brand-light .brand-title small {
    transform: translateX(2px);
  }
}

.desktop-wordmark-break {
  display: none;
}

/* Final desktop-only wordmark sizing: two readable subtitle lines. */
@media (min-width: 761px) {
  .sidebar .brand {
    min-height: 96px;
    padding: 10px 14px;
    gap: 12px;
  }

  .sidebar .brand-logo {
    width: 70px;
    height: 70px;
    max-height: 70px;
    flex-basis: 70px;
    transform: none;
  }

  .sidebar .brand-title,
  .sidebar .brand-light .brand-title {
    margin-left: 0;
    font-size: 22px;
    line-height: 1.05;
  }

  .sidebar .brand-title small,
  .sidebar .brand-light .brand-title small {
    margin: 5px 0 0;
    font-size: 9px;
    line-height: 1.3;
    letter-spacing: 0.015em;
    transform: none;
    white-space: normal;
  }

  .desktop-wordmark-break {
    display: block;
  }
}

/* Keep the signed-in account visible on shorter desktop viewports. */
@media (min-width: 761px) {
  .sidebar {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar .brand,
  .sidebar-foot {
    flex: 0 0 auto;
  }

  .sidebar nav {
    flex: 1 1 auto;
    min-height: 0;
    margin: 24px 0;
    padding-right: 4px;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .sidebar-foot {
    margin-top: 0;
  }
}

/* Final button normalization after every legacy/theme rule. */
.app-shell .btn,
dialog .btn,
.app-shell .actions .btn,
.app-shell td .btn,
.app-shell .hero-row .btn,
.app-shell .form-actions .btn {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 72px;
  max-width: 100%;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.app-shell .actions,
dialog .actions,
.app-shell .form-actions,
dialog .form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.app-shell td .btn + .btn,
dialog td .btn + .btn {
  margin-left: 7px;
}

.app-shell td .actions .btn + .btn,
dialog td .actions .btn + .btn {
  margin-left: 0;
}

@media (max-width: 760px) {
  .app-shell .btn,
  dialog .btn,
  .app-shell .actions .btn,
  .app-shell td .btn,
  .app-shell .hero-row .btn,
  .app-shell .form-actions .btn {
    min-width: 68px;
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
  }
}

/* Student Billing workspaces. */
.finance-setting-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.finance-setting-toolbar label {
  display: grid;
  gap: 7px;
  width: min(440px, 100%);
  font-weight: 700;
}

.finance-setting-toolbar select {
  width: 100%;
}

.finance-setting-check {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.finance-setting-check input[type="checkbox"],
.finance-setting-check input[type="radio"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  order: 0;
}

#staffDiscountChildrenTable input[type="checkbox"],
#staffDiscountWorkflowForm input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.staff-discount-information {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 760px) {
  .staff-discount-information {
    grid-template-columns: 1fr;
  }
}

.finance-setting-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px 24px;
}

.finance-setting-form-grid > label,
.finance-setting-checkbox-group label,
.finance-setting-radio label {
  margin: 0;
}

.finance-setting-checkbox-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 14px 24px;
  padding: 6px 0;
}

.finance-setting-check span {
  min-width: 0;
}
.finance-setting-radio {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.finance-setting-radio legend {
  font-weight: 600;
  color: #435753;
}
.finance-setting-radio > div {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 14px;
}
.finance-setting-multiple > span {
  display: block;
  font-weight: 600;
  color: #435753;
}
.finance-setting-multiple details {
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.finance-setting-multiple summary {
  padding: 12px 13px;
  cursor: pointer;
}
.finance-setting-multiple-options {
  max-height: 230px;
  overflow-y: auto;
  padding: 0 13px 12px;
}
.finance-setting-multiple-options label {
  margin: 10px 0;
}
.finance-setting-notes,
.finance-setting-siblings {
  grid-column: 1 / -1;
  min-width: 0;
}
.finance-setting-siblings[hidden] {
  display: none;
}
.finance-setting-notes table {
  min-width: 0;
}
.finance-setting-siblings input {
  min-width: 65px;
}
.finance-setting-logo {
  display: block;
  width: 52px;
  height: 40px;
  object-fit: contain;
  margin-top: 8px;
}
#financePriorityForm input {
  width: 110px;
  margin: 0;
  padding: 8px 10px;
}

@media (max-width: 600px) {
  .finance-setting-form-grid,
  .finance-setting-checkbox-group {
    grid-template-columns: minmax(0, 1fr);
  }
}

.finance-setting-workspace h3 {
  margin-bottom: 14px;
}

.finance-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}

.finance-report-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f9fbfa;
}

.finance-report-card span {
  grid-row: span 2;
  color: var(--green-2);
  font-size: 22px;
}

.finance-report-card small {
  color: var(--muted);
}

.finance-statement {
  margin-top: 18px;
}

dialog.finance-dialog {
  width: min(1050px, calc(100% - 30px));
  max-height: calc(100vh - 42px);
  overflow-y: auto;
}

.currency-tax-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-tax-input input {
  min-width: 0;
  flex: 1;
}

.currency-setup-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.currency-setup-detail dd {
  margin: 0;
}

.online-acknowledgement { display:flex; align-items:flex-start; gap:0.65rem; margin:1rem 0; }
.online-acknowledgement input[type=checkbox] { width:auto; flex:none; margin-top:0.2rem; }
.online-report-expired td { background:#fce3e3; color:#7a1c1c; }
.online-report-due td { background:#fff1c9; color:#674600; }
#nativeRegistrationForm [hidden] { display:none !important; }
.link-button { border:0; background:transparent; color:var(--primary,#165b96); padding:0; text-decoration:underline; cursor:pointer; font:inherit; }
dialog.registration-dialog {
  width: min(1120px, calc(100% - 30px));
  max-height: calc(100vh - 32px);
  padding: 0;
}

.registration-heading {
  padding: 30px 34px 16px;
  background: linear-gradient(120deg, #f2f6fe, #fff);
}

.registration-heading h2 {
  margin: 6px 0;
}
.registration-heading p {
  margin: 0;
  color: var(--muted);
}

.registration-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 25px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.registration-tab {
  flex: 0 0 auto;
  padding: 11px 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.registration-tab.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.registration-section {
  display: none;
  padding: 24px 34px 30px;
}
.registration-section.active {
  display: block;
}
.registration-section-intro {
  margin-bottom: 20px;
}
.registration-section-intro h3 {
  margin: 0 0 5px;
}
.registration-section-intro p {
  margin: 0;
  color: var(--muted);
}
.registration-section .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.registration-section textarea {
  min-height: 80px;
  resize: vertical;
}

.registration-person {
  margin-top: 18px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.registration-person summary {
  font-weight: 700;
  cursor: pointer;
}
.registration-person .form-grid {
  margin-top: 17px;
}

.registration-document-grid {
  display: grid;
  gap: 10px;
}
.registration-document {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.registration-document strong,
.registration-document small {
  display: block;
}
.registration-document small {
  margin-top: 3px;
  color: var(--muted);
}
.registration-document-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.registration-document-actions input {
  max-width: 235px;
}

.registration-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 34px;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -8px 22px rgba(16, 42, 92, 0.06);
}
.registration-footer .form-actions {
  margin: 0;
}
.registration-footer > span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .registration-section .form-grid {
    grid-template-columns: 1fr;
  }
  .registration-heading,
  .registration-section {
    padding-left: 20px;
    padding-right: 20px;
  }
  .registration-footer {
    padding: 12px 20px;
    align-items: flex-start;
    flex-direction: column;
  }
  .registration-footer .form-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .registration-footer .btn {
    flex: 1;
  }
  .registration-document {
    align-items: stretch;
    flex-direction: column;
  }
}

.sidebar .nav-child {
  align-items: flex-start;
  white-space: normal;
  line-height: 1.25;
}

.sidebar .nav-child .nav-label {
  overflow-wrap: anywhere;
}

.sidebar .nav-submenu {
  min-width: 0;
}

.receivables-table {
  min-width: 1500px;
}

.guardian-statements-table {
  min-width: 1050px;
}
.receivable-filters input,
.receivable-filters select {
  width: 100%;
  min-width: 80px;
  padding: 7px;
}
.receivable-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}
.receivable-pagination > label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.receivable-preview-table {
  min-width: 2100px;
}
.receivable-preview-table input {
  width: 115px;
}
.receivable-preview-table select {
  width: 155px;
}
.receivable-details {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 1fr;
  gap: 0;
}
.receivable-details dt,
.receivable-details dd {
  padding: 11px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.receivable-details dt {
  font-weight: 600;
}

.receivable-exemptions {
  min-width: 230px;
}
.receivable-exemptions summary {
  cursor: pointer;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.receivable-exemption-options {
  padding: 10px;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.receivable-exemption-options .finance-setting-check input {
  width: auto;
}
.receivable-preview-table input[readonly] {
  background: #f5f7fb;
}

.billing-report-select {
  display: grid;
  gap: 8px;
  max-width: 480px;
  margin-bottom: 22px;
}
.billing-report-multiple {
  display: grid;
  align-content: start;
  gap: 8px;
}
.billing-report-multiple details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.billing-report-multiple summary {
  cursor: pointer;
}
.billing-report-options {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.billing-report-options label[hidden] {
  display: none;
}
.rr-detail th {
  width: 230px;
  text-align: left;
  vertical-align: top;
}
.rr-detail td {
  text-align: left;
}
.rr-form input[readonly],
.rr-form :disabled {
  background: #f4f6fa;
}
#rrInstallments {
  margin-top: 18px;
}
.rr-discount-field summary {
  white-space: normal;
}
.billing-option-search {
  margin: 10px 0;
}
.sd-base-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.sd-base-fields .sd-field {
  min-width: 0;
}
.md-form-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.md-field {
  margin-bottom: 14px;
  min-width: 0;
}
.md-field input[readonly] {
  background: #f4f6fa;
}
@media (max-width: 700px) {
  .md-form-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
.ds-field .billing-report-options label[hidden] {
  display: none !important;
}
#registrationSettingForm .checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
#registrationSettingForm .checkbox-label input {
  width: auto;
  margin: 0;
}
#registrationSettingMessage:empty {
  display: none;
}
#rfMessage:empty, #rfRulesMessage:empty, #rfEligibility:empty {display:none;}
#nativeRegistrationForm label:has(input[type=checkbox]) {display:flex;align-items:center;gap:8px;}
#nativeRegistrationForm input[type=checkbox] {width:auto;margin:0;}
.sd-base-fields fieldset {
  margin: 0;
}
@media (max-width: 700px) {
  .sd-base-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
#authorityCorrection[hidden], #authorityFields label[hidden] { display: none !important; }
#riForm[hidden], #riReasonLabel[hidden] { display: none !important; }
.teaching-behavior-panel { padding: 0; overflow: hidden; border-color: #d9e1eb; }
.teaching-behavior-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 30px 34px; color: #fff; background: radial-gradient(circle at 88% 18%, #345a83 0, transparent 31%), linear-gradient(120deg, #122b49, #203f67); }
.teaching-behavior-hero h3 { margin: 6px 0 8px; color: #fff; font-size: clamp(24px, 3vw, 36px); line-height: 1.15; }
.teaching-behavior-hero p { max-width: 560px; margin: 0; color: #d8e4f1; }
.teaching-eyebrow { display: block; color: #a26c20; font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.teaching-behavior-hero .teaching-eyebrow { color: #f6ce7e; }
.teaching-hero-count { min-width: 128px; padding: 14px 18px; border: 1px solid rgba(255,255,255,.25); border-radius: 16px; text-align: center; background: rgba(255,255,255,.08); }
.teaching-hero-count strong { display: block; color: #ffd991; font-size: 32px; line-height: 1; }
.teaching-hero-count span { display: block; margin-top: 6px; color: #e1eaf4; font-size: 12px; }
.teaching-behavior-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr); }
.teaching-roster { display: flex; flex-direction: column; padding: 28px 30px 32px; min-width: 0; }
.teaching-composer { padding: 28px 28px 30px; border-left: 1px solid #e5ebf1; background: #fafbfd; min-width: 0; }
.teaching-section-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 19px; }
.teaching-section-heading h3, .teaching-section-heading h4 { margin: 4px 0 0; color: #173154; font-size: 21px; }
.teaching-roster-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.teaching-roster-actions > span, .teaching-history .teaching-section-heading > span { color: #58718d; font-size: 12px; font-weight: 700; }
.teaching-roster-actions .btn { padding: 7px 10px; font-size: 12px; }
.teaching-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 10px; margin: 14px 0; }
.teaching-student { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 12px; border: 1px solid #dce5ee; border-radius: 15px; background: #fff; transition: border-color .18s, box-shadow .18s, transform .18s; }
label.teaching-student { cursor: pointer; }
label.teaching-student:hover { border-color: #bfa66a; transform: translateY(-2px); box-shadow: 0 7px 20px rgba(23,49,84,.09); }
.teaching-student:has(input:checked) { border-color: #c49a45; background: #fffaf0; box-shadow: 0 0 0 2px rgba(196,154,69,.15); }
.teaching-student:has(input:focus-visible) { outline: 3px solid #547fb0; outline-offset: 2px; }
.teaching-student input[type="checkbox"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.teaching-student-check { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #b8c7d6; border-radius: 50%; color: transparent; background: #fff; font-size: 11px; }
.teaching-student input:checked + .teaching-student-check { border-color: #bd8530; color: #fff; background: #bd8530; }
.teaching-avatar { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; flex: none; border-radius: 15px; background: #eef4fa; vertical-align: middle; }
.teaching-avatar svg { display: block; width: 45px; height: 45px; }
.teaching-student-name { min-width: 0; flex: 1; overflow-wrap: anywhere; color: #173154; font-size: 13px; font-weight: 700; }
.teaching-points { align-self: end; white-space: nowrap; color: #23785f; font-size: 11px; }
.teaching-points.is-negative { color: #ad6258; }
.teaching-empty-students { color: #63768a; }
.teaching-feedback-tip { display: flex; gap: 12px; margin-top: auto; padding: 17px; border: 1px solid #e6e0cf; border-radius: 14px; color: #344b62; background: #fffcf5; }
.teaching-feedback-tip > span { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; color: #a87123; background: #faebca; }
.teaching-feedback-tip strong { font-size: 13px; }
.teaching-feedback-tip p { margin: 5px 0 0; color: #65788a; font-size: 12px; line-height: 1.5; }
.teaching-skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.teaching-skill { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 50px; padding: 8px 10px; border: 1px solid #dce5ee; border-radius: 12px; color: #243f5d; background: #fff; text-align: left; cursor: pointer; }
.teaching-skill:hover, .teaching-skill.is-active { border-color: #c89d45; background: #fff8e8; }
.teaching-skill:focus-visible { outline: 3px solid #547fb0; outline-offset: 2px; }
.teaching-skill-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; color: #ab762c; background: #f9e9c8; font-size: 18px; }
.teaching-skill > span:nth-child(2) { min-width: 0; flex: 1; font-size: 12px; font-weight: 700; }
.teaching-skill strong { font-size: 12px; }
.teaching-composer-fields { display: grid; grid-template-columns: minmax(0, 1fr) 86px; gap: 10px; margin-top: 20px; }
.teaching-composer-fields label, .teaching-observation { display: block; color: #314d68; font-size: 12px; font-weight: 700; }
.teaching-composer-fields input, .teaching-observation textarea { width: 100%; margin-top: 6px; }
.teaching-observation { margin-top: 14px; }
.teaching-observation span { color: #78889b; font-weight: 400; }
.teaching-composer-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.teaching-sound-toggle { display: flex; align-items: center; gap: 8px; color: #465f79; font-size: 12px; cursor: pointer; }
.teaching-sound-toggle input { width: auto; margin: 0; accent-color: #bd8530; }
.teaching-history .teaching-section-heading { margin-bottom: 14px; }
.teaching-history-points { display: inline-block; min-width: 28px; padding: 4px 7px; border-radius: 8px; color: #217457; background: #e9f6ef; font-weight: 800; text-align: center; }
.teaching-history-points.is-negative { color: #a1574e; background: #fff0ee; }
@media (max-width: 1050px) { .teaching-behavior-layout { grid-template-columns: 1fr; } .teaching-composer { border-left: 0; border-top: 1px solid #e5ebf1; } }
@media (max-width: 640px) { .teaching-behavior-hero { padding: 23px 20px; } .teaching-hero-count { min-width: 92px; padding: 12px; } .teaching-roster, .teaching-composer { padding: 23px 19px; } .teaching-students { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); } .teaching-student { flex-wrap: wrap; } .teaching-points { width: 100%; padding-left: 3px; } }
@media (max-width: 640px) {
  .teaching-feedback-tip { margin-top: 18px; }
  .teaching-history thead { display: none; }
  .teaching-history tbody, .teaching-history tbody tr, .teaching-history tbody td { display: block; }
  .teaching-history tbody tr { margin: 12px 0; padding: 11px 12px; border: 1px solid #e2e9f1; border-radius: 12px; background: #fff; }
  .teaching-history tbody td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 2px; border: 0; text-align: right; overflow-wrap: anywhere; }
  .teaching-history tbody td::before { color: #63788f; font-size: 11px; font-weight: 800; text-align: left; text-transform: uppercase; }
  .teaching-history tbody td:nth-child(1)::before { content: "When"; }
  .teaching-history tbody td:nth-child(2)::before { content: "Student"; }
  .teaching-history tbody td:nth-child(3)::before { content: "Skill"; }
  .teaching-history tbody td:nth-child(4)::before { content: "Points"; }
  .teaching-history tbody td:nth-child(5)::before { content: "Observation"; }
  .teaching-history tbody td:nth-child(6)::before { content: "Teacher"; }
  .teaching-history tbody td[colspan]::before { content: none; }
}
@media (prefers-reduced-motion: reduce) { .teaching-student { transition: none; } label.teaching-student:hover { transform: none; } }
.teaching-plan-panel { padding: 0; overflow: hidden; }
.teaching-plan-hero { padding: 30px 34px; color: #fff; background: linear-gradient(120deg, #153653, #266b71); }
.teaching-plan-hero .teaching-eyebrow { color: #f7ce84; }
.teaching-plan-hero h3 { margin: 8px 0; color: #fff; font-size: clamp(25px, 3vw, 34px); }
.teaching-plan-hero p { max-width: 650px; margin: 0; color: #ddf0ed; }
.teaching-plan-create { margin: 24px 30px 0; padding: 16px 18px; border: 1px solid #dce7e8; border-radius: 13px; background: #f7fbfb; }
.teaching-plan-create summary { color: #174860; font-weight: 800; cursor: pointer; }
.teaching-plan-create form { margin-top: 17px; }
.teaching-plan-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; margin-bottom: 15px; }
.teaching-plan-form-grid label { display: block; color: #314d68; font-size: 12px; font-weight: 700; }
.teaching-plan-form-grid input { width: 100%; margin-top: 6px; }
.teaching-plan-collection { padding: 28px 30px 32px; }
.teaching-plan-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 10px; }
.teaching-plan-item { display: flex; justify-content: space-between; gap: 12px; min-height: 88px; padding: 15px; border: 1px solid #dce6ec; border-radius: 13px; color: #173154; background: #fff; text-align: left; cursor: pointer; }
.teaching-plan-item:hover, .teaching-plan-item.is-active { border-color: #79aeb0; background: #f2faf9; }
.teaching-plan-item strong, .teaching-plan-item small { display: block; }
.teaching-plan-item small { margin-top: 8px; color: #64798c; }
.teaching-plan-item em { align-self: start; white-space: nowrap; color: #227869; font-size: 11px; font-style: normal; font-weight: 800; }
.teaching-plan-layout { display: grid; grid-template-columns: minmax(210px,.55fr) minmax(0,1.4fr); gap: 20px; }
.teaching-plan-students { padding: 18px; border: 1px solid #e1e9ef; border-radius: 15px; background: #f7f9fc; }
.teaching-plan-students h4 { margin: 0 0 13px; color: #173154; }
.teaching-plan-student { display: flex; align-items: center; gap: 10px; width: 100%; margin: 7px 0; padding: 9px; border: 1px solid transparent; border-radius: 12px; color: #173154; background: #fff; text-align: left; cursor: pointer; }
.teaching-plan-student:hover, .teaching-plan-student.is-active { border-color: #c79b49; background: #fffaf0; }
.teaching-plan-student .teaching-avatar { width: 39px; height: 39px; border-radius: 11px; }
.teaching-plan-student .teaching-avatar svg { width: 36px; height: 36px; }
.teaching-plan-student > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.teaching-plan-student small { color: #58718d; }
.teaching-plan-editor { padding: 22px; border: 1px solid #e1e9ef; border-radius: 15px; background: #fff; }
.teaching-plan-editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.teaching-plan-editor-head h4 { margin: 3px 0; color: #173154; font-size: 21px; }
.teaching-plan-editor-head small { color: #61758a; }
.teaching-plan-editor form { display: grid; gap: 14px; }
.teaching-plan-editor form label { color: #314d68; font-size: 12px; font-weight: 700; }
.teaching-plan-editor form label span { color: #73869a; font-weight: 400; }
.teaching-plan-editor form input, .teaching-plan-editor form textarea { display: block; width: 100%; margin-top: 6px; }
.teaching-plan-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.teaching-plan-readout { display: grid; gap: 9px; }
.teaching-plan-readout p { margin: 0; padding: 12px; border-radius: 10px; background: #f6f9fc; white-space: pre-wrap; }
.teaching-plan-correction { margin-top: 20px; padding: 15px; border: 1px solid #e9d8b8; border-radius: 12px; background: #fffcf6; }
.teaching-plan-correction summary { color: #79551f; font-weight: 800; cursor: pointer; }
.teaching-plan-correction form { margin-top: 17px; }
.teaching-family-plan { display: grid; grid-template-columns: minmax(180px,.4fr) minmax(0,1fr); gap: 22px; margin: 15px 0; padding: 18px; border: 1px solid #deebe9; border-radius: 14px; background: #f8fcfb; }
.teaching-family-plan h4 { margin: 8px 0; color: #173154; font-size: 19px; }
.teaching-family-score { display: inline-block; padding: 6px 11px; border-radius: 9px; color: #176c60; background: #dff4ed; font-weight: 800; }
.teaching-family-plan p { margin: 0 0 10px; white-space: pre-wrap; }
@media (max-width: 800px) { .teaching-plan-layout { grid-template-columns: 1fr; } .teaching-plan-students { display: flex; gap: 8px; overflow: auto; align-items: center; } .teaching-plan-students h4 { margin: 0 8px 0 0; } .teaching-plan-student { min-width: 180px; margin: 0; } }
@media (max-width: 640px) { .teaching-plan-hero { padding: 23px 20px; } .teaching-plan-create { margin: 18px 19px 0; } .teaching-plan-collection { padding: 23px 19px; } .teaching-plan-form-grid, .teaching-family-plan { grid-template-columns: 1fr; } .teaching-plan-item { min-height: 74px; } }
.teaching-calendar-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; }
.teaching-calendar-head h4 { margin: 5px 0 0; color: #173154; font-size: 20px; }
.teaching-calendar-actions { display: flex; gap: 6px; }
.teaching-calendar-actions .btn { min-width: 36px; padding: 5px 10px; font-size: 21px; line-height: 1; }
.teaching-calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 7px; }
.teaching-calendar-grid > strong { padding: 5px; color: #5e7186; font-size: 11px; text-align: center; }
.teaching-calendar-day { min-height: 68px; padding: 8px; border: 1px solid #e1e8ef; border-radius: 10px; color: #253f5b; background: #fff; }
.teaching-calendar-day.is-school-day:not([class*="status-"]) { background: #f8fbfe; }
.teaching-calendar-day > span { display: block; font-size: 13px; font-weight: 800; }
.teaching-calendar-day small { display: inline-block; margin-top: 7px; padding: 3px 5px; border-radius: 5px; font-size: 10px; font-weight: 800; }
.teaching-calendar-day.status-present { border-color: #9dd8c3; background: #eaf8f1; }
.teaching-calendar-day.status-present small { color: #186d4f; background: #d5f0e1; }
.teaching-calendar-day.status-late { border-color: #ead090; background: #fff9e9; }
.teaching-calendar-day.status-late small { color: #8a6318; background: #f9e9ba; }
.teaching-calendar-day.status-absent { border-color: #ecc1ba; background: #fff1ee; }
.teaching-calendar-day.status-absent small { color: #9d5148; background: #f8ddd8; }
.teaching-calendar-day.status-excused { border-color: #b4c7e7; background: #f0f5fd; }
.teaching-calendar-day.status-excused small { color: #466a9d; background: #e0ebfa; }
.teaching-calendar-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin: 14px 0 6px; color: #62778b; font-size: 11px; }
.teaching-calendar-legend span:not(:last-child)::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #c9d6e1; }
.teaching-calendar-legend .status-present::before { background: #64b990 !important; }
.teaching-calendar-legend .status-late::before { background: #d6b156 !important; }
.teaching-calendar-legend .status-absent::before { background: #df8e84 !important; }
.teaching-calendar-legend .status-excused::before { background: #8dacd6 !important; }
.teaching-calendar-school-days { margin: 5px 0 18px; color: #62778b; font-size: 11px; }
@media (max-width: 640px) { .teaching-calendar-grid { gap: 3px; } .teaching-calendar-day { min-height: 48px; padding: 5px 3px; border-radius: 6px; } .teaching-calendar-day > span { font-size: 11px; } .teaching-calendar-day small { margin-top: 3px; padding: 1px 2px; font-size: 7px; } }
@media (max-width: 640px) {
  .teaching-family-behavior thead { display: none; }
  .teaching-family-behavior tbody, .teaching-family-behavior tbody tr, .teaching-family-behavior tbody td { display: block; }
  .teaching-family-behavior tbody tr { margin: 10px 0; padding: 10px 12px; border: 1px solid #e2e9f1; border-radius: 12px; }
  .teaching-family-behavior tbody td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 1px; border: 0; text-align: right; overflow-wrap: anywhere; }
  .teaching-family-behavior tbody td::before { color: #63788f; font-size: 11px; font-weight: 800; text-align: left; text-transform: uppercase; }
  .teaching-family-behavior tbody td:nth-child(1)::before { content: "Date"; }
  .teaching-family-behavior tbody td:nth-child(2)::before { content: "Skill"; }
  .teaching-family-behavior tbody td:nth-child(3)::before { content: "Points"; }
  .teaching-family-behavior tbody td:nth-child(4)::before { content: "Observation"; }
  .teaching-family-behavior tbody td[colspan]::before { content: none; }
}
.teaching-documents > p { color: #60768b; font-size: 13px; }
.teaching-document-form-grid { display: grid; grid-template-columns: minmax(130px,.7fr) minmax(160px,1fr) minmax(200px,1.3fr); gap: 12px; margin: 18px 0 14px; }
.teaching-document-form-grid label { display: block; color: #314d68; font-size: 12px; font-weight: 700; }
.teaching-document-form-grid label[hidden] { display: none; }
.teaching-document-form-grid select, .teaching-document-form-grid input { width: 100%; margin-top: 6px; }
.teaching-document-list { display: grid; gap: 8px; margin-top: 23px; }
.teaching-document-item { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 14px; border: 1px solid #e0e8ef; border-radius: 11px; background: #f8fafc; }
.teaching-document-item strong, .teaching-document-item small { display: block; overflow-wrap: anywhere; }
.teaching-document-item strong { color: #173154; font-size: 13px; }
.teaching-document-item small { margin-top: 5px; color: #687d91; }
.teaching-document-item > div { display: flex; flex-wrap: wrap; gap: 7px; }
@media (max-width: 800px) { .teaching-document-form-grid { grid-template-columns: 1fr; } }

@media (max-width: 520px) {
  .topbar { padding: 0 9px; gap: 5px; }
  .topbar > div:first-of-type { display: none; }
  .top-actions { flex: 1; justify-content: flex-end; gap: 5px; }
}
