:root {
  --bg: #f7f9f6;
  --surface: #ffffff;
  --surface-strong: #edf6f4;
  --ink: #18222f;
  --muted: #637083;
  --line: #dbe4e1;
  --navy: #1f3a5f;
  --teal: #177e89;
  --coral: #d95f43;
  --gold: #d8a43d;
  --shadow: 0 18px 50px rgba(31, 58, 95, 0.13);
  --banner-image: url("assets/kids-jiu-jitsu-class.png");
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.5;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(247, 249, 246, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: none;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  position: relative;
}

.login-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 12px;
}

.profile-button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
  padding: 6px 10px;
}

.profile-avatar {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 900;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-button:hover {
  background: var(--surface-strong);
}

.login-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 58px;
  z-index: 120;
  width: min(300px, calc(100vw - 28px));
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-popover label {
  font-size: 0.86rem;
}

.login-popover input {
  margin-bottom: 10px;
}

.remember-login {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.login-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.84rem;
  margin: 8px 0;
}

.form-message {
  margin: 12px 0 0;
  padding: 12px;
  background: #dff7ed;
  border: 1px solid #8bd9b7;
  border-radius: 8px;
  color: #12805c;
  font-weight: 800;
}

.required-note {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  margin: 4px 0 0;
}

.screen-message {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 34, 47, 0.36);
}

.screen-message[hidden] {
  display: none;
}

.screen-message-box {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.screen-message-box h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.hamburger-menu {
  position: relative;
}

.hamburger-menu summary {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  font-weight: 800;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  list-style: none;
  min-height: 44px;
  width: 48px;
  padding: 8px;
}

.hamburger-menu summary::-webkit-details-marker {
  display: none;
}

.hamburger-menu summary span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--navy);
}

.hamburger-menu[open] summary {
  background: var(--surface-strong);
}

.hamburger-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  display: grid;
  align-content: start;
  width: min(340px, calc(100vw - 28px));
  min-height: 100vh;
  padding: 24px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hamburger-panel a {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  padding: 13px 12px;
}

.menu-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--line);
}

.filter,
.ghost-button {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  padding: 9px 12px;
  transition: 160ms ease;
}

.hamburger-panel a:hover,
.hamburger-panel a[aria-current="page"],
.filter:hover,
.ghost-button:hover {
  background: var(--surface-strong);
  color: var(--ink);
}

main {
  padding: 28px clamp(18px, 4vw, 56px) 56px;
}

.home-page main {
  padding-right: clamp(420px, 34vw, 480px);
}

.back-home {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--navy);
  font-size: 1.45rem;
  font-weight: 900;
}

.back-home:hover {
  background: var(--surface-strong);
}

.access-panel {
  max-width: 620px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero {
  min-height: 220px;
  display: grid;
  align-items: center;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(247, 249, 246, 0.98) 0%, rgba(247, 249, 246, 0.88) 45%, rgba(247, 249, 246, 0.18) 78%),
    var(--banner-image) center / cover;
  box-shadow: var(--shadow);
}

.hero-copy {
  width: min(560px, 100%);
  padding: clamp(18px, 3vw, 30px);
}

.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

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

.hero h2 {
  font-size: clamp(1.45rem, 2.7vw, 2.4rem);
  line-height: 1.05;
  margin-bottom: 10px;
  max-width: 560px;
}

.hero p:not(.eyebrow) {
  color: #405066;
  font-size: 1rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.management-panel {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 48px;
  gap: 10px;
  margin-top: 16px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.management-panel a,
.management-more summary {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.management-more {
  position: relative;
}

.management-more summary {
  list-style: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 900;
}

.management-more summary::-webkit-details-marker {
  display: none;
}

.management-more-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(220px, calc(100vw - 28px));
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.management-panel a:hover,
.management-more summary:hover,
.management-more[open] summary {
  background: var(--surface-strong);
  color: var(--ink);
}

.management-panel strong {
  color: var(--navy);
  font-size: 0.86rem;
}

.banner-tools {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.wide-modal {
  width: min(860px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(24, 34, 47, 0.38);
}

.modal-form {
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.profile-preview {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-preview-avatar {
  width: 58px;
  height: 58px;
  font-size: 1rem;
}

.profile-preview p {
  color: var(--muted);
  margin: 0;
}

.permissions-grid {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  margin: 8px 0 16px;
}

.full-control-option {
  align-items: start;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  margin: 4px 0 14px;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.full-control-option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.full-control-option span {
  display: grid;
  gap: 2px;
}

.full-control-option strong {
  color: var(--navy);
}

.full-control-option small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(3, minmax(86px, auto));
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.permission-row legend {
  color: var(--navy);
  font-weight: 800;
  padding: 0 6px;
}

.permission-row label {
  align-items: center;
  display: flex;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.permission-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.banner-tools h2 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.1;
  margin: 0;
}

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

.banner-form label {
  margin-bottom: 0;
}

.banner-form input {
  margin-bottom: 8px;
}

.button-row {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1 / -1;
}

.primary-button,
.secondary-button,
.ghost-button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--coral);
  color: #fff;
  padding: 12px 18px;
}

.primary-button:hover {
  background: #c64d32;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--navy);
  padding: 11px 17px;
}

.full-width {
  width: 100%;
}

.stats-grid,
.student-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.stats-grid article,
.student-card,
.activity-card,
.lesson-card,
.lesson-form,
.manager-form,
.notes-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-grid article {
  padding: 20px;
}

.stats-grid span {
  color: var(--navy);
  display: block;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 800;
}

.stats-grid p {
  color: var(--muted);
  margin: 4px 0 0;
}

.home-schedule {
  max-width: 860px;
  margin-top: 32px;
}

.compact-lesson-list {
  gap: 10px;
}

.compact-lesson-card {
  grid-template-columns: minmax(86px, 112px) minmax(0, 1fr) minmax(92px, auto);
}

.birthday-board {
  max-width: 860px;
  margin-top: 32px;
}

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

.birthday-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.birthday-photo {
  width: 76px;
  height: 76px;
}

.birthday-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.birthday-info strong {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.birthday-info span {
  color: var(--coral);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: capitalize;
}

.birthday-info p {
  color: var(--muted);
  margin: 0;
}

.news-board {
  margin-top: 32px;
}

.home-page .news-modal {
  position: fixed;
  top: 88px;
  right: clamp(14px, 3vw, 36px);
  bottom: 24px;
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(380px, calc(100vw - 28px));
  margin: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.home-page .news-modal .section-heading {
  align-items: start;
  margin-bottom: 12px;
}

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

.news-modal .news-list {
  grid-template-columns: 1fr;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.news-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.news-card p {
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}

.workspace {
  margin-top: 34px;
}

.page-title {
  max-width: 780px;
}

.page-title h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  margin: 0 0 10px;
}

.page-title p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
}

.section-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

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

.shortcut-card {
  display: grid;
  gap: 8px;
  min-height: 140px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shortcut-card:hover {
  border-color: rgba(23, 126, 137, 0.35);
  box-shadow: var(--shadow);
}

.shortcut-card strong {
  color: var(--navy);
  font-size: 1.05rem;
}

.shortcut-card span {
  color: var(--muted);
}

.section-heading h2,
.workspace h2 {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.05;
  margin: 0;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.manager-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.logged-out .manager-grid {
  grid-template-columns: 1fr;
}

.logged-out .attendance-picker {
  display: none;
}

.attendance-picker {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attendance-picker h2 {
  margin: 0;
}

.attendance-picker label {
  width: min(260px, 100%);
  margin: 0;
}

.manager-form {
  padding: 20px;
}

.manager-form input,
.manager-form select,
.manager-form textarea {
  margin-bottom: 14px;
}

.compact-form {
  margin-top: 18px;
}

.inline-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

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

.activity-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

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

.activity-card h3 {
  margin-bottom: 4px;
}

.activity-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-meta span {
  background: var(--surface-strong);
  border-radius: 999px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
}

.activity-schedule {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.activity-schedule label,
.activity-schedule input,
.activity-schedule select {
  margin-bottom: 0;
}

.activity-schedule .primary-button {
  width: 100%;
}

.lesson-form,
.notes-panel {
  padding: 20px;
}

.lesson-form h3,
.notes-panel h3 {
  margin-bottom: 16px;
}

label {
  color: var(--ink);
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 11px 12px;
}

.lesson-form input,
.lesson-form select,
.lesson-form textarea {
  margin-bottom: 14px;
}

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

.student-select-list select {
  margin-bottom: 0;
}

.add-student-button {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-weight: 800;
  margin: 8px 0 14px;
  padding: 0;
  text-align: left;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 126, 137, 0.22);
  outline-offset: 2px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter,
.ghost-button {
  background: transparent;
}

.filter.active {
  background: var(--navy);
  color: #fff;
}

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

.lesson-card {
  display: grid;
  grid-template-columns: minmax(86px, 120px) 1fr minmax(120px, auto);
  gap: 16px;
  padding: 18px;
}

.lesson-date {
  color: var(--teal);
  font-weight: 800;
}

.lesson-card h3 {
  margin-bottom: 4px;
}

.lesson-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.tag {
  align-self: start;
  border-radius: 999px;
  background: #fff3e0;
  color: #86580d;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}

.card-actions {
  align-content: start;
  display: grid;
  gap: 8px;
  justify-items: start;
}

.small-button {
  min-height: 36px;
  padding: 7px 10px;
}

.delete-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--coral);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 800;
}

.delete-button:hover {
  background: #fff0ec;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.timeline {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.timeline span {
  color: var(--coral);
  font-weight: 800;
}

.timeline strong {
  color: var(--navy);
}

.timeline p {
  color: var(--muted);
  margin-bottom: 0;
}

.notes-panel .check-row,
.editable-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 14px;
}

.notes-panel .check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.editable-row label {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: 0;
}

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

.student-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
}

.student-photo {
  align-items: center;
  display: flex;
  justify-content: center;
  width: 86px;
  height: 86px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.student-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-photo span {
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 900;
}

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

.student-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.student-card strong {
  color: var(--navy);
}

.student-card span {
  color: var(--coral);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.student-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.student-card .presence-actions,
.student-card .button-row {
  grid-column: 1 / -1;
}

.logged-out .student-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
  gap: 16px;
  width: 100%;
}

.logged-out .student-card {
  gap: 14px;
  min-height: 168px;
  padding: 20px;
}

.logged-out .student-card-heading {
  align-items: start;
  display: grid;
  gap: 6px;
  margin-bottom: 0;
}

.logged-out .student-card strong {
  font-size: 1.12rem;
}

.logged-out .student-card-heading span {
  justify-self: start;
  padding: 4px 8px;
  background: #fff0ec;
  border-radius: 999px;
  font-size: 0.78rem;
}

.logged-out .student-card p {
  line-height: 1.45;
}

.presence-actions {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.presence-button {
  width: 44px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.presence-button.present {
  color: #12805c;
}

.presence-button.absent {
  color: #c53f3f;
}

.presence-button.present.active {
  background: #dff7ed;
  border-color: #8bd9b7;
}

.presence-button.absent.active {
  background: #ffe4e4;
  border-color: #f0a2a2;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.compact-heading {
  margin-bottom: 12px;
}

.compact-heading h2 {
  font-size: 1.35rem;
}

.response-list {
  min-width: 0;
}

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

.response-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.response-card > span,
.response-card-meta span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.response-card p {
  color: var(--muted);
  margin: 0;
}

.response-card p strong,
.response-card-meta strong {
  color: var(--navy);
}

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

.donation-panel {
  min-width: 0;
}

.donation-card,
.log-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.donation-card h2 {
  margin: 0;
}

.donation-card p {
  color: var(--muted);
  margin: 0;
}

.donation-data {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: var(--surface-strong);
  border-radius: 8px;
}

.donation-data span,
.log-card > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.donation-data strong {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.gallery-form {
  margin-bottom: 22px;
}

.gallery-preview {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

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

.gallery-preview-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gallery-preview-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.gallery-preview-card span {
  display: block;
  padding: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-years {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.gallery-view {
  display: grid;
  gap: 26px;
}

.gallery-month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 160px));
  gap: 12px;
  align-items: start;
}

.gallery-month-tile {
  display: grid;
  gap: 6px;
  overflow: hidden;
  padding: 0 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.gallery-month-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-strong);
}

.gallery-month-tile span,
.gallery-month-tile small {
  padding: 0 12px;
}

.gallery-month-tile span {
  color: var(--navy);
  font-weight: 900;
  text-transform: capitalize;
}

.gallery-month-tile small {
  color: var(--muted);
  font-weight: 800;
}

.gallery-month h3 {
  color: var(--navy);
  font-size: 1.35rem;
  margin-bottom: 12px;
  text-transform: capitalize;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  gap: 14px;
  align-items: start;
}

.gallery-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gallery-photo-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-strong);
}

.gallery-card div {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.gallery-card strong {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.gallery-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.attendance-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.attendance-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.permission-check {
  align-items: center;
  display: flex;
  gap: 8px;
  width: fit-content;
}

.permission-check input {
  width: auto;
  margin: 0;
}

.student-photo-box {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.student-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-viewer {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  padding: 0;
  background: transparent;
}

.photo-viewer::backdrop {
  background: rgba(24, 34, 47, 0.72);
}

.photo-viewer figure {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.photo-viewer img {
  width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  background: #0f1720;
  border-radius: 8px;
}

.photo-viewer figcaption {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.viewer-close,
.viewer-nav {
  position: absolute;
  z-index: 2;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.viewer-close {
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.viewer-nav {
  top: 50%;
  width: 44px;
  height: 54px;
  border-radius: 8px;
  font-size: 1.4rem;
  transform: translateY(-50%);
}

.viewer-prev {
  left: 10px;
}

.viewer-next {
  right: 10px;
}

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

.log-card p {
  color: var(--muted);
  margin: 0;
}

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

.attendance-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.attendance-table th,
.attendance-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: center;
}

.attendance-table thead th {
  color: var(--navy);
  font-size: 0.85rem;
}

.attendance-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 230px;
  background: var(--surface);
  text-align: left;
}

.attendance-summary-heading,
.attendance-summary-cell {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 136px;
  background: var(--surface);
  box-shadow: -10px 0 18px rgba(31, 58, 95, 0.06);
}

.attendance-summary-heading {
  color: var(--teal);
}

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

.attendance-table tbody th {
  display: grid;
  gap: 3px;
}

.attendance-table tbody th > span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.attendance-summary-card {
  display: grid;
  gap: 6px;
  justify-items: stretch;
  min-width: 104px;
}

.attendance-summary-card strong {
  color: var(--navy);
  font-size: 1rem;
}

.attendance-summary-card small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.attendance-summary-bar {
  height: 8px;
  overflow: hidden;
  background: #f1f5f3;
  border-radius: 999px;
}

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

.attendance-summary-bar.low span {
  background: #c53f3f;
}

.attendance-table thead .attendance-summary-heading {
  z-index: 2;
}

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

.attendance-status-cell.present span {
  background: #dff7ed;
  color: #12805c;
}

.attendance-status-cell.absent span {
  background: #ffe4e4;
  color: #c53f3f;
}

.semester-table th:not(:first-child),
.semester-table td:not(:first-child) {
  min-width: 104px;
}

.month-header {
  display: grid;
  gap: 8px;
}

.month-header strong {
  color: var(--navy);
  font-size: 0.9rem;
  text-transform: capitalize;
}

.saturday-row,
.month-attendance-row {
  display: grid;
  grid-auto-columns: 28px;
  grid-auto-flow: column;
  justify-content: center;
  gap: 4px;
}

.class-day-toggle,
.attendance-mini {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 900;
}

.class-day-toggle {
  border: 1px solid var(--line);
  background: #f8faf9;
  color: var(--muted);
  cursor: pointer;
}

.class-day-toggle.readonly {
  cursor: default;
}

.class-day-toggle.active {
  background: #dff7ed;
  border-color: #8bd9b7;
  color: #12805c;
}

.attendance-mini {
  background: #f1f5f3;
  color: var(--muted);
}

.attendance-mini.present {
  background: #dff7ed;
  color: #12805c;
}

.attendance-mini.absent {
  background: #ffe4e4;
  color: #c53f3f;
}

.attendance-mini.no-class {
  background: transparent;
  border: 1px dashed #d8e0dd;
}

@media (max-width: 900px) {
  .home-page main {
    padding-right: clamp(18px, 4vw, 56px);
  }

  .home-page .news-modal {
    position: static;
    width: auto;
    margin-top: 24px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .app-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    background:
      linear-gradient(180deg, rgba(247, 249, 246, 0.98) 0%, rgba(247, 249, 246, 0.86) 56%, rgba(247, 249, 246, 0.24) 100%),
      var(--banner-image) center / cover;
  }

  .stats-grid,
  .banner-tools,
  .attendance-picker,
  .layout-grid,
  .manager-grid,
  .two-column,
  .activity-grid,
  .compact-lesson-card,
  .birthday-list,
  .gallery-preview-grid,
  .news-list,
  .shortcut-grid,
  .student-grid {
    grid-template-columns: 1fr;
  }

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

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

  .management-panel {
    grid-template-columns: repeat(3, minmax(104px, 1fr)) 44px;
    overflow-x: auto;
  }

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

@media (max-width: 620px) {
  main {
    padding-inline: 14px;
  }

  .home-page main {
    padding-inline: 14px;
  }

  .hamburger-panel {
    left: 0;
    right: 0;
    width: 100vw;
    border-left: 0;
  }

  .hero {
    min-height: 230px;
    align-items: start;
  }

  .hero-copy {
    padding: 18px;
  }

  .hero p:not(.eyebrow) {
    display: none;
  }

  .hero-actions {
    margin-top: 12px;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    min-height: 38px;
    padding: 8px 12px;
  }

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

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

  .tag,
  .delete-button {
    justify-self: start;
  }

  .timeline li {
    grid-template-columns: 1fr;
  }

  .student-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .birthday-card {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .student-photo {
    width: 72px;
    height: 72px;
  }

  .birthday-photo {
    width: 66px;
    height: 66px;
  }

  .student-card-heading {
    display: grid;
  }
}
