:root {
  --navy: #17243a;
  --navy2: #23334a;
  --ink: #1b2740;
  --muted: #78859b;
  --line: #e7eaf0;
  --bg: #f6f8fc;
  --white: #ffffff;
  --accent: #5368e9;
  --accent2: #6b7afa;
  --accentBg: #eef0ff;
  --green: #16886f;
  --greenBg: #e7f7f1;
  --amber: #ac741c;
  --amberBg: #fff5e3;
  --red: #ca5160;
  --redBg: #fff0f2;
  --radius: 18px;
  --shadow: 0 4px 22px rgba(24, 40, 69, 0.04);
  --shadow-lg: 0 14px 34px rgba(20, 36, 68, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

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

input, select, textarea {
  outline: 0;
}

input:focus, select:focus, textarea:focus {
  border-color: #8797ff !important;
  box-shadow: 0 0 0 3px rgba(88, 109, 250, 0.12);
}

:focus-visible {
  outline: 3px solid #8a98ff;
  outline-offset: 3px;
}

svg {
  flex: none;
  vertical-align: middle;
}

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

.sidebar {
  background: var(--navy);
  color: #b7c2d4;
  padding: 30px 16px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a4c67 transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  padding: 0 15px;
  margin-bottom: 36px;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #657aff, #97a6ff);
  border-radius: 14px;
  color: white;
  font-size: 25px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(10, 18, 39, 0.35);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.9px;
  line-height: 1.0;
}

.brand-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.65px;
  color: #a8b6ce;
  margin-top: 6px;
  font-weight: 700;
}

.nav-label {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.8px;
  color: #7f90ae;
  padding: 0 16px;
  text-transform: uppercase;
  margin: 0 0 11px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #afbed3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  text-align: left;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.16s ease;
}

.nav-btn:hover {
  background: #253651;
  color: #ffffff;
}

.nav-btn.active {
  color: #ffffff;
  background: linear-gradient(95deg, #5368e9, #485bd1);
  box-shadow: 0 7px 16px rgba(10, 18, 51, 0.22);
}

.side-bottom {
  margin-top: auto;
  padding-top: 20px;
}

.side-note {
  border: 1px solid #33435b;
  background: #22334b;
  border-radius: 15px;
  padding: 16px 14px;
  color: #dee7f4;
}

.side-note-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  font-size: 12px;
}

.side-note p {
  color: #a9b8cd;
  font-size: 11.5px;
  line-height: 1.55;
  margin: 8px 0 0;
}

.side-footer {
  font-size: 11px;
  color: #7d90ac;
  padding: 15px 8px 0;
  text-align: center;
}

.main {
  min-width: 0;
  padding: 28px clamp(20px, 3.2vw, 50px) 65px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 12px;
  color: #91a0b6;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #e7f7f1;
  color: #16886f;
  border: 1px solid #c2eedf;
}

.status-badge.offline {
  background: #fff0f2;
  color: #ca5160;
  border-color: #ffd2d8;
}

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

.monthbar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: white;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.month-btn {
  background: none;
  border: 0;
  border-radius: 8px;
  color: #7c88a0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.month-btn:hover {
  background: #f1f3ff;
  color: var(--accent);
}

.month-input {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
  min-width: 145px;
  max-width: 168px;
  padding: 4px 6px;
  font-size: 13px;
  cursor: pointer;
}

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

h1 {
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -1.1px;
  line-height: 1.17;
  margin: 0 0 6px;
  font-weight: 800;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.heading-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
  min-height: 41px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 9px rgba(86, 108, 238, 0.15);
}

.btn:hover {
  background: #4356d4;
  border-color: #4356d4;
  box-shadow: 0 6px 14px rgba(86, 108, 238, 0.25);
}

.btn.secondary {
  background: white;
  border-color: var(--line);
  color: #45516a;
  box-shadow: none;
}

.btn.secondary:hover {
  background: #f7f8fe;
  border-color: #cdd6f4;
  color: var(--accent);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}

.btn.ghost:hover {
  background: #f2f3f9;
  color: var(--ink);
}

.btn.danger {
  background: #fff0f2;
  border-color: #ffe0e5;
  color: #bf4d5d;
  box-shadow: none;
}

.btn.danger:hover {
  background: #ffe2e8;
  color: #a83949;
}

.btn.small {
  padding: 7px 12px;
  min-height: 33px;
  font-size: 12px;
  border-radius: 9px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-header {
  padding: 21px 23px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.card-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.3px;
  font-weight: 800;
}

.card-body {
  padding: 0 23px 23px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 1.4px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

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

.strong {
  font-weight: 750;
}

.micro {
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.pill.green {
  background: var(--greenBg);
  color: var(--green);
}

.pill.amber {
  background: var(--amberBg);
  color: var(--amber);
}

.pill.red {
  background: var(--redBg);
  color: var(--red);
}

.pill.neutral {
  background: #eff2f6;
  color: #738096;
}

.pill.purple {
  background: var(--accentBg);
  color: #5365d6;
}

.hero {
  background: linear-gradient(112deg, #4c62e5, #7180f5);
  min-height: 187px;
  border-radius: 21px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 33px;
  color: white;
  position: relative;
  margin-bottom: 23px;
  isolation: isolate;
  box-shadow: 0 10px 28px rgba(76, 98, 229, 0.22);
}

.hero:before {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  border: 64px solid rgba(255, 255, 255, 0.09);
  top: -190px;
  right: -75px;
  z-index: -1;
}

.hero:after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 45px solid rgba(255, 255, 255, 0.07);
  bottom: -202px;
  right: 230px;
  z-index: -1;
}

.hero-kicker {
  letter-spacing: 1.7px;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.82;
}

.hero h2 {
  font-size: 24px;
  letter-spacing: -0.6px;
  margin: 12px 0 8px;
  max-width: 480px;
  line-height: 1.25;
}

.hero p {
  margin: 0;
  font-size: 13.5px;
  color: #e9ecff;
  max-width: 530px;
  line-height: 1.5;
}

.hero-icon {
  width: 105px;
  height: 105px;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  transform: rotate(-9deg);
  margin-right: 28px;
}

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

.metric {
  padding: 20px 20px 19px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.metric-label {
  font-size: 12px;
  color: #7a879e;
  font-weight: 650;
}

.metric-icon {
  border-radius: 11px;
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  background: #f0f2ff;
  color: #596eea;
}

.metric-icon.green {
  background: #e5f7f0;
  color: #168e73;
}

.metric-icon.amber {
  background: #fff4e6;
  color: #ce8b2b;
}

.metric-icon.sky {
  background: #eaf5ff;
  color: #3589ba;
}

.metric-num {
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin: 15px 0 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-foot {
  color: #94a1b4;
  font-size: 11px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 20px;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid #eef0f5;
}

.mini-row:first-of-type {
  border-top: 0;
}

.mini-date {
  background: #f3f5fd;
  border-radius: 10px;
  color: #5868a0;
  width: 47px;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.12;
  flex: none;
}

.mini-date strong {
  font-size: 16px;
}

.mini-date span {
  font-size: 10px;
  text-transform: uppercase;
}

.mini-name {
  font-weight: 800;
  font-size: 13px;
}

.mini-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.mini-price {
  margin-left: auto;
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
  font-size: 13px;
}

.mini-price span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 550;
}

.group-progress {
  padding: 13px 0;
  border-top: 1px solid #eef0f5;
}

.group-progress:first-of-type {
  border-top: 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 8px;
  margin-bottom: 9px;
}

.progress-label strong {
  font-weight: 750;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 9px;
  background: #eff2f8;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6b78eb, #8b97fc);
  border-radius: 9px;
  transition: width 0.4s ease;
}

.hint {
  border: 1px solid #e3e7fb;
  background: #f7f8ff;
  border-radius: 13px;
  padding: 14px 16px;
  color: #65718e;
  font-size: 12px;
  display: flex;
  gap: 11px;
  line-height: 1.55;
}

.hint svg {
  color: var(--accent);
  flex: none;
  margin-top: 1px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
  flex-wrap: wrap;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #78859a;
  font-size: 12px;
  font-weight: 700;
}

.select {
  border: 1px solid var(--line);
  background: white;
  color: #36425b;
  border-radius: 10px;
  height: 41px;
  padding: 0 32px 0 12px;
  min-width: 180px;
  font-weight: 700;
  max-width: 100%;
}

.attendance-layout {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  gap: 19px;
  align-items: start;
}

.session-list {
  padding: 8px 10px 14px;
}

.session-list-heading {
  font-weight: 800;
  font-size: 12px;
  color: #7c879c;
  padding: 15px 12px 11px;
  display: flex;
  justify-content: space-between;
}

.session-item {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 13px 12px;
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  text-align: left;
  color: var(--ink);
  margin-bottom: 3px;
  transition: all 0.15s ease;
}

.session-item:hover {
  background: #f8f9ff;
}

.session-item.active {
  border-color: #e1e5ff;
  background: #f0f2ff;
}

.session-day {
  width: 43px;
  height: 44px;
  border-radius: 10px;
  background: #f0f3f8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  line-height: 1.1;
  flex: none;
}

.session-item.active .session-day {
  color: #5165dd;
  background: #ffffff;
}

.session-day strong {
  font-size: 17px;
}

.session-day small {
  font-size: 10px;
  text-transform: uppercase;
  color: #8a97aa;
  font-weight: 750;
}

.session-item-title {
  font-weight: 750;
  font-size: 13px;
}

.session-item-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.attendance-card {
  min-height: 420px;
}

.attendance-heading {
  padding: 23px 26px 21px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.attendance-heading h2 {
  margin: 3px 0;
  font-size: 20px;
  letter-spacing: -0.45px;
}

.attendance-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.attend-body {
  padding: 20px 26px 25px;
}

.attendance-pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #f6f7ff;
  border: 1px solid #e8ebff;
  border-radius: 15px;
  padding: 16px 18px;
  gap: 14px;
  margin-bottom: 19px;
}

.attend-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #8791b0;
  margin-bottom: 5px;
}

.attend-stat-value {
  font-size: 21px;
  letter-spacing: -0.5px;
  font-weight: 800;
  white-space: nowrap;
}

.attend-stat-value.emphasis {
  color: #4c63dd;
}

.roster-label {
  font-size: 11px;
  letter-spacing: 1.4px;
  color: #919bb0;
  font-weight: 850;
  margin: 16px 0 7px;
  text-transform: uppercase;
}

.student-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 1px;
  border-bottom: 1px solid #f0f2f5;
}

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

.avatar {
  width: 37px;
  height: 37px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 850;
  color: #6474a8;
  background: #edf0fa;
  font-size: 12px;
  flex: none;
}

.student-row:nth-child(even) .avatar {
  background: #f9f1eb;
  color: #ac8068;
}

.student-detail {
  flex: 1;
  min-width: 0;
}

.student-name {
  font-weight: 800;
  font-size: 13px;
}

.student-description {
  font-size: 11px;
  color: #a0aabc;
}

.attend-choice {
  min-width: 109px;
  border: 1px solid #e4e8ef;
  color: #8491a5;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 750;
  border-radius: 10px;
  transition: all 0.15s ease;
}

.attend-choice:hover {
  border-color: #8da0fa;
}

.attend-choice.on {
  background: var(--greenBg);
  border-color: #bbebd8;
  color: var(--green);
}

.attendance-bottom {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  color: #93a0b3;
  font-size: 11px;
  padding: 15px 26px;
}

.attendance-bottom svg {
  color: var(--green);
}

.billing-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.bill-total {
  padding: 20px 23px;
}

.bill-total p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 9px;
}

.bill-total strong {
  font-size: 25px;
  letter-spacing: -0.65px;
  font-weight: 800;
}

.bill-total span {
  display: block;
  font-size: 11px;
  color: #a0abba;
  margin-top: 8px;
}

.table-wrap {
  overflow: auto;
  width: 100%;
}

.data-table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
  min-width: 720px;
}

.data-table th {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: #9aa6b8;
  background: #fafbfe;
  border-top: 1px solid #eff1f5;
  border-bottom: 1px solid #eff1f5;
  padding: 14px 17px;
  white-space: nowrap;
}

.data-table td {
  padding: 16px 17px;
  border-bottom: 1px solid #eef0f5;
  font-size: 12px;
  vertical-align: middle;
}

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

.data-table th:first-child, .data-table td:first-child {
  padding-left: 24px;
}

.data-table th:last-child, .data-table td:last-child {
  padding-right: 24px;
}

.data-table tbody tr:hover {
  background: #fcfdff;
}

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

.person .avatar {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  font-size: 11px;
}

.person-name {
  font-weight: 800;
  color: #26334c;
  font-size: 12px;
  white-space: nowrap;
}

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

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.section-title {
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 3px;
}

.payments-foot {
  padding: 17px 24px;
  color: #919daf;
  font-size: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 25px;
}

.settings-card {
  padding: 20px 22px;
}

.settings-head {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 18px;
}

.group-mark {
  height: 40px;
  width: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #606de3;
  background: #eef0ff;
}

.settings-head h3 {
  font-size: 14px;
  margin: 0 0 2px;
  letter-spacing: -0.2px;
}

.settings-head p {
  font-size: 11px;
  color: #9ca7b8;
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field label, .form-label {
  font-size: 11px;
  font-weight: 800;
  color: #65728a;
}

.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #e0e5ef;
  border-radius: 10px;
  background: #ffffff;
  min-height: 41px;
  padding: 10px 12px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input[type=number] {
  font-variant-numeric: tabular-nums;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 17px 0 14px;
}

.rate-grid .field input {
  padding: 9px 7px;
  font-size: 12px;
}

.rate-grid .field label {
  text-align: center;
  font-size: 10px;
}

.settings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  color: #9aa7b9;
  font-size: 11px;
}

.settings-note {
  margin-bottom: 21px;
}

.settings-bottom {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.empty-icon {
  width: 65px;
  height: 65px;
  border-radius: 21px;
  background: #f0f2fe;
  display: grid;
  place-items: center;
  color: var(--accent);
  margin: 0 auto 17px;
}

.empty-state h3 {
  color: #26334b;
  font-size: 16px;
  margin: 0 0 7px;
}

.empty-state p {
  margin: 0 auto 16px;
  max-width: 360px;
  font-size: 13px;
  line-height: 1.6;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 23, 39, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  overflow: auto;
  animation: fadeIn 0.16s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(100%, 520px);
  background: white;
  border-radius: 22px;
  box-shadow: 0 35px 90px rgba(6, 19, 37, 0.42);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: modalScale 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 25px 26px 21px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  gap: 18px;
}

.modal-header h2 {
  margin: 0 0 5px;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.modal-header p {
  margin: 0;
  color: #94a0b1;
  font-size: 12px;
}

.modal-body {
  padding: 23px 26px 26px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 7px;
}

.modal-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}

.helper {
  color: #9da7b8;
  font-size: 11px;
  line-height: 1.55;
  margin: 0;
}

.toast {
  position: fixed;
  bottom: 23px;
  right: 25px;
  color: #ffffff;
  background: #1b2c43;
  border-radius: 12px;
  box-shadow: 0 12px 25px rgba(28, 40, 77, 0.35);
  padding: 13px 18px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 12.5px;
  max-width: min(420px, calc(100vw - 30px));
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error {
  background: #ca5160;
}

@keyframes toastIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.data-section {
  margin-top: 22px;
}

.footnote {
  color: #a6b0c0;
  font-size: 11px;
  margin: 24px 2px 0;
}

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

.routine-info {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 19px;
}

.routine-info .pill {
  padding: 7px 11px;
}

.exercise-row {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 19px 0;
  border-top: 1px solid #eef0f5;
  flex-wrap: wrap;
}

.exercise-row:first-child {
  border-top: 0;
}

.exercise-index {
  height: 42px;
  width: 42px;
  border-radius: 12px;
  background: #eef0ff;
  color: #5365d8;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 850;
  flex: none;
}

.exercise-name {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.exercise-meta {
  font-size: 12px;
  color: #8491a4;
}

.exercise-actions {
  margin-left: auto;
  display: flex;
  gap: 5px;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 21px;
}

.record-card {
  border: 1px solid #e8ebf5;
  background: white;
  border-radius: 16px;
  padding: 19px;
  min-width: 0;
  text-align: left;
  display: block;
  width: 100%;
  transition: all 0.15s ease;
}

.record-card:hover {
  border-color: #aeb9fa;
  box-shadow: 0 7px 18px rgba(40, 59, 121, 0.1);
  transform: translateY(-2px);
}

.record-card.active {
  border-color: #6b7afa;
  background: #f6f7ff;
  box-shadow: 0 0 0 2px rgba(107, 122, 250, 0.18);
}

.record-mark {
  height: 37px;
  width: 37px;
  background: #fff5e4;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #ba812c;
  margin-bottom: 12px;
}

.record-title {
  font-weight: 800;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.record-number {
  font-size: 25px;
  letter-spacing: -0.8px;
  font-weight: 850;
  margin: 9px 0 3px;
}

.record-foot {
  font-size: 11px;
  color: #94a0b3;
}

.filter-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-controls .field {
  min-width: 190px;
}

.nutrition-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 19px;
}

.nutrition-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.nutrition-metric {
  padding: 18px 18px 17px;
}

.nutrition-metric .eyebrow {
  font-size: 10px;
  letter-spacing: 0.75px;
}

.nutrition-value {
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -0.8px;
  margin: 10px 0 4px;
  white-space: nowrap;
}

.nutrition-diff {
  font-size: 11px;
  color: #8692a7;
}

.chart-card {
  padding: 21px 23px 17px;
}

.chart-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.chart-bar h2 {
  font-size: 17px;
  margin: 0 0 3px;
}

.chart-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chart-tab {
  border: 1px solid #e1e6f0;
  background: white;
  color: #728096;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  transition: all 0.15s ease;
}

.chart-tab:hover {
  border-color: #9daafa;
  color: var(--accent);
}

.chart-tab.active {
  background: #edf0ff;
  color: #4f63d9;
  border-color: #aeb8ff;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 355px;
}

.chart-note {
  font-size: 11px;
  color: #939eb1;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.health-note {
  background: #fafbff;
  border: 1px solid #e8ebf5;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 11px;
  color: #718099;
  line-height: 1.55;
}

.select-date {
  height: 41px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: #36425b;
  font-weight: 700;
  max-width: 100%;
}

.short-table {
  min-width: 590px;
}

/* Loading spinner */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(83, 104, 233, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1220px) {
  .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nutrition-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .hero-icon { margin-right: 0; }
}

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
  }
  .sidebar {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    height: auto;
    position: relative;
    padding: 15px 19px 11px;
  }
  .brand {
    margin-bottom: 14px;
    padding: 0 3px;
  }
  .brand-logo {
    width: 37px;
    height: 37px;
    border-radius: 11px;
    font-size: 21px;
  }
  .brand-title { font-size: 19px; }
  .brand-sub { font-size: 9px; margin-top: 4px; }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
    max-width: 100%;
    gap: 5px;
    padding-bottom: 3px;
  }
  .nav-btn {
    white-space: nowrap;
    width: auto;
    padding: 10px 12px;
    font-size: 12px;
  }
  .nav-label, .side-bottom { display: none; }
  .main { padding-top: 23px; }
  .attendance-layout { grid-template-columns: minmax(235px, 0.7fr) minmax(0, 1.3fr); }
}

@media (max-width: 710px) {
  .main { padding: 19px 15px 35px; }
  .topbar { margin-bottom: 25px; }
  .hero { padding: 22px 20px; min-height: 170px; }
  .hero-icon { display: none; }
  .hero h2 { font-size: 21px; }
  .metrics { gap: 10px; }
  .metric { padding: 16px; }
  .metric-num { font-size: 22px; }
  .billing-totals { gap: 10px; }
  .bill-total { padding: 15px; }
  .bill-total strong { font-size: 19px; }
  .attendance-layout { grid-template-columns: 1fr; }
  .routine-layout { grid-template-columns: 1fr; }
  .session-list { max-height: 230px; overflow: auto; }
  .attendance-card { min-height: 0; }
  .rate-grid { grid-template-columns: repeat(2, 1fr); }
  .page-heading { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .filter-controls { width: 100%; }
  .filter-controls .field { flex: 1; min-width: 145px; }
  .chart-card { padding: 17px 13px; }
  .chart-svg { min-height: 195px; }
}

@media (max-width: 430px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-label { font-size: 11px; }
  .metric-icon { height: 31px; width: 31px; }
  .metric-num { font-size: 19px; }
  .bill-total { padding: 13px 11px; }
  .bill-total strong { font-size: 16px; }
  .bill-total p { font-size: 11px; }
  .attendance-pricing { padding: 13px 10px; gap: 8px; }
  .attend-stat-value { font-size: 16px; }
  .attend-stat-label { font-size: 10px; }
  .attendance-heading, .attend-body { padding-left: 17px; padding-right: 17px; }
  .attendance-bottom { padding-left: 17px; padding-right: 17px; }
  .attend-choice { min-width: 93px; padding: 8px 9px; }
  .modal-body { padding: 20px; }
  .modal-header { padding: 21px 20px; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1; }
  .monthbar { width: 100%; justify-content: space-between; }
  .month-input { flex: 1; }
  .record-grid { gap: 8px; }
  .record-card { padding: 13px; }
  .record-number { font-size: 21px; }
  .nutrition-metric { padding: 14px; }
  .nutrition-value { font-size: 20px; }
  .chart-tab { padding: 7px 8px; }
  .exercise-actions { width: 100%; justify-content: flex-end; }
  .filter-controls .field { min-width: 135px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
