:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --primary-25: #fff7ed;
  --primary-50: #ffedd5;
  --primary-100: #fed7aa;
  --primary-200: #fdba74;
  --primary-400: #fb923c;
  --primary-500: #f97316;
  --primary-600: #ea580c;
  --primary-700: #c2410c;
  --text-strong: #2d1f12;
  --text-muted: #7a695c;
  --card-shadow: rgba(191, 90, 12, 0.15);
  --glow: rgba(249, 115, 22, 0.18);
  --surface-page: var(--primary-25);
  --surface-panel: #fff;
  --surface-elevated: #fff;
  --surface-muted: #f8fafc;
  --surface-soft: rgba(249, 115, 22, 0.08);
  --border-soft: rgba(148, 163, 184, 0.35);
  --border-strong: rgba(249, 115, 22, 0.2);
  --overlay-bg: rgba(72, 36, 12, 0.45);
  --table-head-bg: var(--primary-50);
  --table-row-odd: rgba(254, 215, 170, 0.35);
  --table-row-hover: rgba(249, 115, 22, 0.12);
  --success-strong: #15803d;
  --danger-strong: #b91c1c;
  background-color: var(--primary-25);
  color: var(--text-strong);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-y: scroll;
  background: var(--surface-page);
  color: var(--text-strong);
}

body.has-modal {
  overflow: hidden;
}

.page-root {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  box-sizing: border-box;
}

.page-root--login {
  position: relative;
}

.page-root--hj-sidebar {
  --hj-topbar-height: 78px;
  --hj-sidebar-width: 148px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 1.5rem;
  padding: var(--hj-topbar-height) 0 2rem;
}

.page-root--hj-sidebar > .dashboard-layout--sidebar {
  display: contents;
}

.hj-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-height: var(--hj-topbar-height);
  display: grid;
  grid-template-columns: var(--hj-sidebar-width) minmax(0, 1fr);
  align-items: stretch;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(45, 31, 18, 0.14);
  box-sizing: border-box;
  z-index: 30;
}

.hj-topbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-right: 1px solid rgba(45, 31, 18, 0.08);
}

.hj-topbar-logo img {
  width: 96px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.hj-topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.35rem 1.2rem;
  min-width: 0;
}

.hj-topbar-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.hj-topbar-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  min-width: 0;
}

.hj-topbar-identity strong {
  font-size: 1rem;
  color: #2d1f12;
}

.hj-topbar-identity span {
  color: var(--text-muted);
  min-width: 0;
}

.hj-topbar-affiliation {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-700);
  white-space: normal;
}

.hj-topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  min-width: 0;
}

.hj-topbar-meta-item {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hj-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.hj-topbar-recents {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(560px, 42vw);
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
}

.hj-topbar-recents[hidden] {
  display: none !important;
}

.hj-topbar-recents-title {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.hj-topbar-recents-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.hj-topbar-recents-list::-webkit-scrollbar {
  display: none;
}

.hj-topbar-actions-divider {
  display: none;
  width: 1px;
  height: 32px;
  margin-right: 0.05rem;
  background: rgba(148, 163, 184, 0.42);
  border-radius: 999px;
  flex: 0 0 auto;
}

.hj-topbar-recents:not([hidden]) + .hj-topbar-actions .hj-topbar-actions-divider {
  display: block;
}

.page-root--hj-sidebar #dashboard-tabs.dashboard--sidebar {
  position: fixed;
  left: 0;
  top: var(--hj-topbar-height);
  width: var(--hj-sidebar-width);
  max-height: calc(100vh - var(--hj-topbar-height));
  overflow-y: auto;
  z-index: 5;
}

.page-root--hj-sidebar .dashboard-panels--sidebar {
  width: min(1120px, 100%);
}

.page-root--hj-sidebar > .modal-overlay {
  width: 100%;
}

.container {
  background: #fff;
  padding: 3rem 4rem;
  border-radius: 16px;
  box-shadow: 0 20px 45px var(--card-shadow);
  width: min(1120px, 100%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.container.narrow {
  width: min(520px, 100%);
  text-align: center;
}

h1 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary-600);
}

.page-heading-row {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.page-heading-row h1 {
  margin-bottom: 0;
  flex: 0 0 auto;
}

p {
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

label {
  font-weight: 600;
}

input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7d9e0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  color: #fff;
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.28);
}

.error {
  color: #d14343;
  font-weight: 600;
  margin: 0;
}

.footnote {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

.container .btn.primary {
  align-self: center;
}

.profile {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: nowrap;
  text-align: left;
  position: relative;
  overflow: visible;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.profile-recent-tabs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0;
}

.profile-recent-tabs[hidden] {
  display: none !important;
}

.profile-recent-tabs-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.profile-recent-tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.profile-recent-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-height: 36px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.24);
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary-700);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-recent-tab-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(249, 115, 22, 0.42);
  background: rgba(249, 115, 22, 0.13);
  box-shadow: 0 8px 16px rgba(249, 115, 22, 0.14);
}

.profile-recent-tab-btn.is-active {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  border-color: transparent;
  color: #fff;
}

.profile .welcome {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.profile .email {
  color: var(--text-muted);
  margin: 0;
}

.profile-actions-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  margin-left: auto;
  flex: 0 0 auto;
  align-self: flex-start;
}

.profile-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 58px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--primary-600);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--primary-400);
  box-shadow: 0 8px 16px var(--glow);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.4;
  transform: scale(0.92);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

:root[data-theme="light"] .theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: scale(1);
}

.login-page-actions {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 20;
}

#cost-summary-info {
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .page-heading-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .profile {
    flex-wrap: wrap;
  }

  .profile-recent-tabs {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .profile-recent-tabs-list {
    justify-content: flex-start;
  }

  .profile-actions-wrap {
    margin-left: 0;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-root {
    padding: 1rem 0.75rem 1.25rem;
    gap: 1rem;
  }

  .login-page-actions {
    top: 1rem;
    right: 1rem;
  }

  .container {
    padding: 1.25rem 1rem;
    border-radius: 14px;
    gap: 1.25rem;
  }
}

.branch-filter-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.25);
  background: rgba(249, 115, 22, 0.08);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.branch-filter-option input {
  accent-color: var(--primary-600);
}


.students header {
  text-align: left;
  margin-bottom: 1rem;
}

.students h2 {
  margin: 0 0 0.5rem;
  color: var(--primary-700);
}

.students .sub {
  margin: 0;
  color: var(--text-muted);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(191, 90, 12, 0.12);
}

thead {
  background: var(--primary-50);
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.95rem;
}

tbody tr:nth-child(odd) {
  background: rgba(254, 215, 170, 0.35);
}

tbody tr:hover {
  background: rgba(249, 115, 22, 0.12);
}

.empty {
  text-align: center;
  margin: 2rem 0 0;
}

.btn.primary {
  align-self: flex-start;
}

.quick-links h2 {
  margin: 0 0 1rem;
  color: var(--primary-700);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 15px 30px rgba(191, 90, 12, 0.12);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid rgba(249, 115, 22, 0.12);
}

.card h3 {
  margin: 0;
  color: var(--primary-700);
}

.card p {
  margin: 0;
  color: var(--text-muted);
  min-height: 60px;
}

.stats-card p,
.stats-card span {
  min-height: 0;
}

.stats-card .stats-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-700);
}

.stats-up {
  color: #15803d;
}

.stats-down {
  color: #b91c1c;
}

.stats-header {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.stats-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stats-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.stats-range select {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  background: #fff;
}

.stats-compare {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.92rem;
}

.stats-section-title {
  margin: 0.5rem 0 0.3rem;
  color: var(--primary-700);
  font-size: 1.05rem;
}

.stats-breakdown {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
}

.stats-row-label {
  color: var(--text-muted);
}

.stats-row-value {
  font-weight: 600;
  color: var(--primary-700);
}

.stats-row-delta {
  text-align: right;
  font-size: 0.85rem;
}

.btn.secondary {
  background: rgba(249, 115, 22, 0.12);
  color: var(--primary-600);
}

.btn.secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.22);
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-layout {
  width: min(1440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-layout--sidebar {
  display: grid;
  grid-template-columns: var(--hj-sidebar-width, 148px) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.dashboard--sidebar {
  position: sticky;
  top: 2rem;
  align-self: stretch;
}

.tab-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tab-controls-grouped {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.55rem 1rem;
}

.tab-controls-grouped .tab-control-group--academic,
.tab-controls-grouped .tab-control-group--admin {
  flex: 1 1 420px;
}

.tab-controls-grouped .tab-control-group--util {
  flex: 1 1 100%;
}

.tab-controls-sidebar .tab-control-group--academic,
.tab-controls-sidebar .tab-control-group--admin,
.tab-controls-sidebar .tab-control-group--util {
  flex: 0 0 auto;
}

.tab-controls-sidebar {
  position: relative;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-height: 100%;
  padding: 1rem;
  border: 0;
  border-right: 1px solid #ddd;
  border-radius: 0;
  background: #f9f9f9;
  box-shadow: none;
}

.tab-controls-sidebar-head {
  position: relative;
  display: flex;
  width: 100%;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: 0;
  padding: 0;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 0.2rem;
  right: -18px;
  width: 38px;
  height: 54px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sidebar-toggle-btn:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 16px 30px rgba(194, 65, 12, 0.18);
}

.sidebar-toggle-btn:focus-visible {
  outline: 3px solid rgba(249, 115, 22, 0.24);
  outline-offset: 2px;
}

.sidebar-toggle-btn-icon {
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1;
}

.sidebar-toggle-btn[aria-expanded="false"] {
  border-color: rgba(194, 65, 12, 0.5);
  background: linear-gradient(180deg, #fb923c 0%, #f97316 52%, #ea580c 100%);
  color: #fff7ed;
  box-shadow: 0 16px 32px rgba(194, 65, 12, 0.26);
}

.sidebar-toggle-btn[aria-expanded="false"]:hover {
  border-color: rgba(154, 52, 18, 0.72);
  box-shadow: 0 18px 36px rgba(154, 52, 18, 0.34);
}

.tab-controls-sidebar-kicker {
  display: none;
}

.tab-controls-sidebar-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}

.tab-controls-sidebar-copy {
  display: none;
}

.tab-control-group {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
}

.tab-control-group--sidebar {
  flex-direction: column;
  gap: 0.284rem;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  align-items: stretch;
}

.tab-control-heading {
  display: flex;
  flex-direction: column;
  gap: 0.162rem;
  width: 100%;
}

.tab-control-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-700);
  letter-spacing: 0.02em;
}

.tab-control-group--sidebar .tab-control-title {
  justify-content: flex-start;
  display: flex;
  width: calc(100% + 1rem);
  min-width: 0;
  color: #444;
  background: #e0e0e0;
  padding: 0.324rem 0.6rem;
  margin-right: -1rem;
  border-radius: 6px 0 0 6px;
  box-sizing: border-box;
}

.tab-control-description {
  display: none;
}

.tab-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tab-control-column {
  display: flex;
  flex-direction: column;
  gap: 0.162rem;
}

@media (max-width: 860px) {
  .tab-controls-grouped .tab-control-group--academic,
  .tab-controls-grouped .tab-control-group--admin,
  .tab-controls-grouped .tab-control-group--util {
    flex-basis: 100%;
  }
}

@media (max-width: 1100px) {
  .page-root--hj-sidebar {
    display: flex;
    padding: 0 0 1.5rem;
    gap: 1rem;
  }

  .page-root--hj-sidebar > .dashboard-layout--sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .hj-topbar {
    position: sticky;
    top: 0;
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .hj-topbar-logo {
    border-right: 0;
    border-bottom: 1px solid rgba(45, 31, 18, 0.08);
  }

  .hj-topbar-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .hj-topbar-recents {
    width: 100%;
    justify-content: flex-start;
  }

  .hj-topbar-recents-list {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hj-topbar-actions {
    justify-content: flex-start;
  }

  .page-root--hj-sidebar #dashboard-tabs.dashboard--sidebar {
    position: static;
    width: min(1120px, calc(100% - 1.5rem));
    box-sizing: border-box;
    max-height: none;
    overflow: visible;
    margin: 0 auto;
  }

  .dashboard-layout--sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .dashboard--sidebar {
    position: static;
    top: auto;
    align-self: auto;
  }

  .sidebar-toggle-btn {
    display: none;
  }

  .page-root--hj-sidebar .dashboard-panels--sidebar {
    width: min(1120px, calc(100% - 1.5rem));
    box-sizing: border-box;
    margin: 0 auto;
  }
}

@media (max-width: 1100px) and (min-width: 641px) {
  .hj-topbar-main {
    gap: 0.8rem;
    padding: 0.8rem 1rem 0.95rem;
  }

  .hj-topbar-info {
    gap: 0.4rem;
  }

  .hj-topbar-identity {
    gap: 0.45rem 0.7rem;
  }

  .hj-topbar-meta {
    gap: 0.3rem 0.85rem;
  }

  .hj-topbar-actions {
    gap: 0.5rem;
  }

  .hj-topbar-actions .btn,
  .hj-topbar-actions .theme-toggle {
    min-height: 2.4rem;
    padding: 0.55rem 0.95rem;
  }

  .page-root--hj-sidebar #dashboard-tabs.dashboard--sidebar,
  .page-root--hj-sidebar .dashboard-panels--sidebar {
    width: min(1120px, calc(100% - 1.5rem));
    box-sizing: border-box;
  }

  .tab-controls-sidebar {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.75rem;
    min-height: 0;
    padding: 0.95rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(191, 90, 12, 0.08);
  }

  .tab-controls-sidebar-head {
    display: none;
  }

  .tab-controls-sidebar:not(.tab-controls-grouped) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .tab-controls-grouped {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: start;
  }

  .tab-controls-grouped .tab-control-group--academic,
  .tab-controls-grouped .tab-control-group--admin {
    flex: 1 1 calc(50% - 0.375rem);
  }

  .tab-controls-grouped .tab-control-group--util {
    flex: 1 1 100%;
  }

  .tab-control-group--sidebar {
    gap: 0.45rem;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(249, 115, 22, 0.14);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 250, 245, 0.96), rgba(255, 255, 255, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }

  .tab-control-group--sidebar.is-collapsed {
    padding-bottom: 0.65rem;
  }

  .tab-control-heading {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
  }

  .tab-control-group--sidebar .tab-control-title {
    width: auto;
    margin-right: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--primary-700);
  }

  .tab-control-heading::after {
    content: "▾";
    flex: 0 0 auto;
    font-size: 0.9rem;
    color: var(--primary-500);
    transition: transform 0.18s ease;
  }

  .tab-control-group--sidebar.is-collapsed .tab-control-heading::after {
    transform: rotate(-90deg);
  }

  .tab-control-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .tab-control-column[hidden] {
    display: none !important;
  }

  .tab-controls-sidebar .tab-btn--sidebar {
    width: 100%;
    min-height: 2.95rem;
    padding: 0.62rem 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(249, 115, 22, 0.24);
    background: rgba(249, 115, 22, 0.08);
    color: var(--primary-700);
    font-size: 0.92rem;
  }

  .tab-controls-sidebar .tab-btn--sidebar.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
    color: #fff;
    box-shadow: 0 8px 18px rgba(234, 88, 12, 0.22);
  }

  .dashboard-panels--sidebar {
    border-radius: 16px;
  }

  .panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.8rem 1rem;
  }

  .student-search-inline,
  .student-filters,
  .teacher-filters,
  .payment-controls,
  .manager-note-header-right {
    width: 100%;
    margin-left: 0;
  }

  .student-search-inline {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .student-search-inline input {
    width: 100%;
  }

  .student-search-inline-count {
    margin-left: 0;
  }

  .student-filters,
  .teacher-filters,
  .payment-controls,
  .manager-note-header-right,
  .panel-header > .btn.primary {
    grid-column: 1 / -1;
  }

  .payment-controls,
  .manager-note-header-right {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .filter-group {
    width: 100%;
    justify-content: space-between;
    gap: 0.7rem;
  }

  .filter-group-buttons {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .panel-header > .btn.primary {
    width: fit-content;
    min-width: 10rem;
  }

  .pagination {
    flex: 0 0 auto;
  }

  .table-wrapper {
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  #students-container .student-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100%;
  }

  #students-container .student-table th,
  #students-container .student-table td {
    padding: 0.74rem 0.8rem;
  }

  :root[data-theme="dark"] .tab-controls-sidebar {
    border-color: rgba(148, 163, 184, 0.26);
    background: #0f172a;
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.34);
  }

  :root[data-theme="dark"] .tab-control-group--sidebar {
    border-color: rgba(251, 146, 60, 0.2);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  :root[data-theme="dark"] .tab-control-group--sidebar .tab-control-title {
    color: #fdba74;
  }

  :root[data-theme="dark"] .tab-control-heading::after {
    color: #fb923c;
  }

  :root[data-theme="dark"] .tab-controls-sidebar .tab-btn--sidebar {
    border-color: rgba(251, 146, 60, 0.3);
    background: rgba(251, 146, 60, 0.14);
    color: #f8fafc;
  }

  :root[data-theme="dark"] .tab-controls-sidebar .tab-btn--sidebar.active {
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #fff;
  }
}

.tab-btn {
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.28);
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary-600);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn--sidebar {
  width: 100%;
  min-height: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  justify-content: flex-start;
  align-items: center;
  flex-direction: row;
  gap: 0;
  text-align: left;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #333;
}

.tab-btn-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.tab-btn--sidebar .tab-btn-label {
  white-space: nowrap;
}

.tab-btn-meta {
  display: none;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.26);
}

.tab-btn--sidebar.active {
  transform: none;
  background: var(--primary-500);
  color: #fff;
}

.dashboard-panels--sidebar {
  margin: 0;
  width: 100%;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: none;
}

.tab-panels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

@media (min-width: 1101px) {
  .page-root--hj-sidebar #dashboard-tabs.dashboard--sidebar {
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    will-change: transform;
  }

  .page-root--hj-sidebar.sidebar-collapsed #dashboard-tabs.dashboard--sidebar {
    transform: translateX(calc(-100% + 24px));
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.12);
  }

  .page-root--hj-sidebar.sidebar-collapsed .tab-controls-sidebar-head {
    min-height: 0;
  }

  .page-root--hj-sidebar.sidebar-collapsed .tab-controls-sidebar-copy,
  .page-root--hj-sidebar.sidebar-collapsed .tab-control-group--sidebar,
  .page-root--hj-sidebar.sidebar-collapsed .tab-controls-sidebar > .tab-btn--sidebar {
    opacity: 0;
    pointer-events: none;
  }

  .page-root--hj-sidebar.sidebar-collapsed .tab-controls-sidebar-copy {
    margin: 0;
    max-height: 0;
    overflow: hidden;
  }

  .page-root--hj-sidebar.sidebar-collapsed .tab-controls-sidebar {
    overflow: hidden;
  }
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.tab-panel.active {
  display: flex;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

/* Students tab: keep filters fixed on the right regardless of pagination */
.tab-panel[data-panel="students"] .panel-header {
  justify-content: flex-start;
}

.tab-panel[data-panel="students"] .student-filters {
  margin-left: auto;
}

.filters-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 240px;
  min-width: 240px;
}

.student-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.student-search-inline {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 0.4rem;
}

.student-search-inline input {
  width: 200px;
  padding: 0.55rem 2.2rem 0.55rem 0.9rem;
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 999px;
  background: rgba(255, 247, 237, 0.85);
  font-size: 0.95rem;
  color: var(--primary-700);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.student-search-inline input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.student-search-inline-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.panel-header .branch-filter-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
  width: auto;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.25);
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary-600);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.18);
}

.student-table th,
.finance-table th {
  position: relative;
}

.table-head-center thead th {
  text-align: center;
}

.student-table .col-resizer,
.finance-table .col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
}

.student-table thead th::after,
.finance-table thead th::after {
  content: "";
  position: absolute;
  top: 18%;
  right: 0;
  width: 1px;
  height: 64%;
  background: rgba(15, 23, 42, 0.12);
}

.student-table thead th:last-child::after,
.finance-table thead th:last-child::after {
  display: none;
}

.student-table th .col-resizer::before,
.finance-table th .col-resizer::before {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: calc(50% - 1px);
  width: 2px;
  background: rgba(249, 115, 22, 0.4);
  border-radius: 2px;
  opacity: 0.5;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.student-table th:hover .col-resizer::before,
.student-table th .col-resizer:hover::before,
.finance-table th:hover .col-resizer::before,
.finance-table th .col-resizer:hover::before {
  opacity: 0.95;
  background: rgba(249, 115, 22, 0.8);
}

.student-table th.sortable {
  cursor: pointer;
  padding-right: 1.35rem;
}

.student-table th.sortable::before {
  content: "";
  display: none;
}

.student-table th.sortable.sorted-asc::before {
  content: "";
  display: none;
}

.student-table th.sortable.sorted-desc::before {
  content: "";
  display: none;
}

.student-column-menu {
  position: absolute;
  z-index: 2200;
  min-width: 190px;
  padding: 0.45rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.student-column-menu-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  color: #1f2937;
  cursor: pointer;
  white-space: nowrap;
}

.student-column-menu-btn:hover {
  background: rgba(249, 115, 22, 0.12);
}

.student-column-filter-wrap {
  margin-top: 0.35rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.student-column-filter-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.student-column-filter-options {
  max-height: 210px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
}

.student-column-filter-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: #374151;
  min-width: 0;
  width: 100%;
}

.student-column-filter-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--primary-500);
}

.student-column-filter-option span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-column-filter-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.student-profile-teacher-checklist {
  border: 1px solid rgba(249, 115, 22, 0.22);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  max-height: 200px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.42rem;
  background: rgba(255, 255, 255, 0.92);
}

.student-profile-teacher-option {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: #334155;
  min-width: 0;
}

.student-profile-teacher-option span {
  display: inline;
  min-width: 0;
  line-height: 1.25;
}

.student-profile-teacher-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--primary-500);
}

#student-profile-form .student-profile-class-teachers-field {
  gap: 0.25rem;
}

#student-profile-form #student-profile-class-teachers-list {
  padding: 0.38rem 0.42rem;
  max-height: 148px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.2rem 0.38rem;
}

#student-profile-form #student-profile-class-teachers-list .student-profile-teacher-option {
  gap: 0.28rem;
  font-size: 0.83rem;
  line-height: 1.15;
}

#student-profile-form #student-profile-class-teachers-list .student-profile-teacher-option input[type="checkbox"] {
  width: 13px;
  height: 13px;
}

#student-profile-form #student-profile-class-teachers-list .student-profile-teacher-option span {
  line-height: 1.2;
}

body.resizing {
  cursor: col-resize;
}

.chip.active {
  background: var(--primary-600);
  color: #fff;
  border-color: transparent;
}

.student-filters .chip {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: var(--primary-600);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.student-filters .chip:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(249, 115, 22, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.12);
}

.student-filters .chip.active {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.25);
  transition: none;
}

/* 이름 셀 내 출석 상태 점 (Slack 스타일) */
.name-with-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.status-dot.status-active {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot.status-inactive {
  background: transparent;
  border: 2px solid #10b981;
  opacity: 0.4;
}

#consult-visit-filter {
  transition: all 0.2s ease;
}

#consult-visit-filter.active {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
  box-shadow: 0 6px 14px rgba(234, 88, 12, 0.25);
}

.registration-dot {
  border: none;
}

.registration-dot-registered {
  background: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}

.registration-dot-unregistered {
  background: transparent;
  border: 2px solid #f97316;
  opacity: 0.5;
}

.consult-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.46rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.consult-status-badge.is-registered {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.18);
  color: #15803d;
}

.consult-status-badge.is-cancelled {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.18);
  color: #b91c1c;
}

.consult-status-badge.is-pending {
  background: rgba(202, 138, 4, 0.12);
  border-color: rgba(202, 138, 4, 0.2);
  color: #a16207;
}


.table-wrapper {
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 16px;
  overflow-x: auto;
  background: #fff;
  padding: 0;
  min-height: 400px;
  max-width: 100%;
  min-width: 0;
}

.table-top-scroll {
  display: none;
  height: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 0 0.35rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.7) rgba(249, 115, 22, 0.08);
}

.table-top-scroll::-webkit-scrollbar {
  height: 10px;
}

.table-top-scroll::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.62);
  border-radius: 999px;
}

.table-top-scroll::-webkit-scrollbar-track {
  background: rgba(249, 115, 22, 0.08);
  border-radius: 999px;
}

.table-top-scroll-inner {
  height: 1px;
}

.table-wrapper table {
  margin: 0;
  border-radius: 16px;
}

.table-wrapper > .muted {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 2rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: rgba(72, 36, 12, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(194, 65, 12, 0.24);
  width: min(600px, 95%);
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal.small {
  width: min(540px, 90%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(249, 115, 22, 0.12);
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.95) 0%, rgba(255, 237, 213, 0.95) 100%);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.modal-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--primary-700);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.modal-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 10px 18px rgba(194, 65, 12, 0.12);
}

.modal-icon-btn:focus-visible {
  outline: 2px solid rgba(249, 115, 22, 0.3);
  outline-offset: 2px;
}

.modal-icon-btn svg {
  width: 18px;
  height: 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-700);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
  overflow-y: auto;
}

.action-alimtalk {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(249, 115, 22, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-subtitle {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-strong);
}

.alimtalk-buttons {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-strong);
}

.modal-body label.student-profile-teacher-option {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.42rem;
  width: auto;
  margin: 0;
}

.modal-body label.student-profile-teacher-option > span {
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-body input[type="text"],
.modal-body input[type="tel"],
.modal-body input[type="email"],
.modal-body input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #fff;
}

.modal-body input[type="text"]:focus,
.modal-body input[type="tel"]:focus,
.modal-body input[type="email"]:focus,
.modal-body input[type="password"]:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.branch-fieldset {
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255, 247, 237, 0.5);
}

.branch-fieldset legend {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-700);
  padding: 0 0.5rem;
}

.branches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.branch-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 0.9rem;
}

.branch-option:hover {
  background: rgba(249, 115, 22, 0.08);
}

.branch-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-500);
}

.modal.wide {
  width: min(760px, 100%);
}

.modal--timetable-meta {
  width: min(860px, calc(100vw - 2rem));
}

#timetable-notice-preview-modal {
  padding: 1rem;
  box-sizing: border-box;
  width: 100vw;
}

.modal--timetable-notice-preview {
  width: min(980px, 100%);
  box-sizing: border-box;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(249, 115, 22, 0.12);
}

.modal-message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 0;
}

.modal-message:not(:empty) {
  background: rgba(249, 115, 22, 0.1);
  color: var(--primary-700);
}

.modal-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.modal-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(249, 115, 22, 0.1);
  color: var(--primary-600);
}



.payment-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.payment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 16px;
  padding: 1.5rem;
  background: rgba(255, 247, 237, 0.92);
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.08);
}

.payment-form-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--primary-700);
}

.payment-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.payment-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.payment-field input,
.payment-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  background: #fff;
  color: var(--primary-700);
  box-shadow: inset 0 1px 2px rgba(234, 88, 12, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.payment-field input:focus,
.payment-field textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

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


.payment-field select {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  background: #fff;
  font-size: 0.95rem;
  color: var(--primary-700);
  box-shadow: inset 0 1px 2px rgba(234, 88, 12, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.payment-field select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.payment-field select::-ms-expand {
  display: none;
}

.payment-field select {
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22 viewBox=%220 0 10 6%22%3E%3Cpath fill=%22%23ea580c%22 d=%22M5 6L0 0h10z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 10px 6px;
}
.payment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.payment-latest-lesson {
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.payment-latest-lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.payment-latest-lesson-title {
  margin: 0;
  font-size: 0.98rem;
  color: var(--primary-700);
}

.payment-latest-lesson-meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.payment-latest-lesson-progress {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--primary-700);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.payment-latest-lesson-fields {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 0.9rem;
}

.payment-latest-lesson-remark-field {
  min-width: 0;
}

@media (max-width: 760px) {
  .payment-latest-lesson-header {
    flex-direction: column;
  }

  .payment-latest-lesson-fields {
    grid-template-columns: 1fr;
  }
}

.payment-message {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.payment-message.error {
  color: #d14343;
}

.payment-message.success {
  color: #188038;
}

.payment-history {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}


.payment-history-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.payment-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-history h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary-700);
}

.payment-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.payment-history-card {
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  background: #fff;
  box-shadow: 0 10px 20px rgba(234, 88, 12, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.payment-history-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.payment-history-amount {
  margin: 0;
  font-weight: 700;
  color: var(--primary-700);
  font-size: 1rem;
}

.payment-history-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.payment-history-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.payment-history-details li strong {
  font-weight: 600;
  color: var(--primary-600);
}



.btn.small {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: none;
}

.btn.danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

button[hidden],
#timetable-add-event-btn[hidden],
#save-timetable-event-btn[hidden],
#delete-timetable-event-btn[hidden] {
  display: none !important;
}

.payment-history-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.counsel-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 70vh;
  overflow-y: auto;
}

.counsel-history h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--primary-700);
}

.counsel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem;
  background: rgba(255, 247, 237, 0.5);
  border-radius: 12px;
}

.counsel-card {
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.06);
}

.counsel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.counsel-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.counsel-card-content {
  font-size: 0.9rem;
  color: var(--text-strong);
  white-space: pre-wrap;
  margin: 0;
}

.counsel-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 16px;
  padding: 1.5rem;
  background: rgba(255, 247, 237, 0.92);
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.08);
}

.counsel-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: nowrap;
  width: 100%;
}

.counsel-form-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--primary-700);
  white-space: nowrap;
}

.counsel-method-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  justify-content: flex-end;
  text-align: right;
}

.counsel-method-inline select {
  appearance: none;
  border: 2px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: #fff;
  color: var(--primary-700);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.08);
  transition: all 0.2s ease;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22 viewBox=%220 0 10 6%22%3E%3Cpath fill=%22%23ea580c%22 d=%22M5 6L0 0h10z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px 6px;
  min-width: 100px;
}

.counsel-method-inline select:hover {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.12);
}

.counsel-method-inline select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.counsel-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-strong);
}

.counsel-field input,
.counsel-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  background: #fff;
  color: var(--primary-700);
  box-shadow: inset 0 1px 2px rgba(234, 88, 12, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.counsel-field input:focus,
.counsel-field textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.counsel-field textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

.auto-grow-textarea {
  overflow: hidden;
  resize: none;
}

.scrollable-modal-textarea {
  min-height: 14rem;
  height: 14rem;
  max-height: min(42vh, 28rem);
  overflow-y: auto;
  resize: vertical;
  scrollbar-gutter: stable;
}

.scrollable-modal-textarea::-webkit-scrollbar {
  width: 10px;
}

.scrollable-modal-textarea::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.38);
  border-radius: 999px;
}

.scrollable-modal-textarea::-webkit-scrollbar-track {
  background: rgba(249, 115, 22, 0.08);
  border-radius: 999px;
}

.counsel-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.counsel-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  min-height: 0;
}

.counsel-message.error {
  color: #d14343;
}

.counsel-message.success {
  color: #188038;
}
.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(249, 115, 22, 0.15);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  color: var(--text-muted);
}

.modal-message {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: #d14343;
}

.action-body {
  gap: 1.5rem;
}

.action-summary {
  margin: 0;
  font-weight: 600;
  color: var(--primary-700);
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.action-buttons .btn {
  width: 100%;
}

.student-state-button-row .btn {
  min-height: 2.55rem;
  white-space: normal;
  word-break: keep-all;
}

@media (max-width: 520px) {
  .student-state-button-row {
    grid-template-columns: 1fr;
  }
}

.withdrawal-risk-toggle-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(255, 255, 255, 0.92));
  box-shadow: 0 10px 24px rgba(194, 65, 12, 0.08);
}

.withdrawal-risk-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: flex-start;
  column-gap: 0.75rem;
  cursor: pointer;
  width: 100%;
}

.withdrawal-risk-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  margin: 0.12rem 0 0;
  padding: 0;
  box-sizing: border-box;
  display: block;
  line-height: 1;
  flex: 0 0 auto;
  border: 1.5px solid rgba(249, 115, 22, 0.42);
  border-radius: 6px;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.withdrawal-risk-toggle input[type="checkbox"]:hover {
  border-color: rgba(249, 115, 22, 0.72);
}

.withdrawal-risk-toggle input[type="checkbox"]:checked {
  border-color: var(--primary-500);
  background-color: var(--primary-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M3.5 8.5 6.6 11.4 12.5 4.8'/%3E%3C/svg%3E");
}

.withdrawal-risk-toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.withdrawal-risk-toggle input[type="checkbox"]:active {
  transform: scale(0.96);
}

.withdrawal-risk-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.withdrawal-risk-toggle-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.3;
}

.withdrawal-risk-toggle-description {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
}

.withdrawal-risk-toggle-status {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.withdrawal-risk-toggle-status:empty {
  display: none;
}

.withdrawal-risk-action-modal .modal-header {
  align-items: flex-start;
}

.modal-subtitle {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.withdrawal-risk-action-body {
  gap: 1rem;
}

.withdrawal-risk-reason-panel {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 12px;
  background: rgba(255, 247, 237, 0.78);
}

.withdrawal-risk-reason-label {
  color: var(--primary-700);
  font-size: 0.82rem;
  font-weight: 800;
}

.withdrawal-risk-reason-text {
  margin: 0;
  color: var(--text-strong);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.student-search {
  gap: 1.25rem;
}

.student-search-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-search-form input {
  flex: 1;
}

.student-search-submit {
  padding-inline: 1.1rem;
  flex-shrink: 0;
}

.student-search-results {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.student-search-results p {
  margin: 0;
}

.student-table {
  margin: 0;
  box-shadow: none;
  border: 1px solid rgba(249, 115, 22, 0.16);
}

.student-table th,
.student-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-table thead {
  background: var(--primary-50);
}

.student-table tbody tr:nth-child(odd) {
  background: rgba(254, 215, 170, 0.25);
}

.student-table tbody tr:hover {
  background: rgba(249, 115, 22, 0.12);
}

.student-table th.name-cell,
.student-table td.name-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 신규상담 탭의 이름 컬럼 */
#consults-container .student-table th:first-child,
#consults-container .student-table td:first-child {
  max-width: 6ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-table td.name-cell.interactive {
  color: var(--primary-600);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(249, 115, 22, 0.55);
  text-decoration-thickness: 2px;
}

.student-table td.name-cell.interactive:focus,
.student-table td.name-cell.interactive:hover {
  color: var(--primary-700);
  text-decoration-color: var(--primary-600);
}

.student-table th.grade-cell,
.student-table td.grade-cell {
  width: 4ch;
  max-width: 4ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.student-table th.branch-cell,
.student-table td.branch-cell,
.student-table th.state-cell,
.student-table td.state-cell,
.student-table th.counsel-cell,
.student-table td.counsel-cell {
  width: 6ch;
  max-width: 6ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-table th.counsel-cell,
.student-table td.counsel-cell {
  text-align: center;
}

/* 재원생 테이블 컬럼 폭 고정 */
#students-container .student-table {
  table-layout: fixed;
  width: 100%;
}

#students-container .student-table th,
#students-container .student-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

#students-container .student-table th {
  padding: 0.9rem 1rem;
}

#students-container .student-table td {
  padding: 0.6rem 0.6rem;
}

#students-container .student-grouping-notice {
  margin-bottom: 0.85rem;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(255, 237, 213, 0.92));
  color: var(--primary-700);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#students-container .student-table--teacher-grouped tbody tr:nth-child(odd) {
  background: transparent;
}

#students-container .student-table--teacher-grouped tbody tr:hover {
  background: transparent;
}

#students-container .student-group-row,
#students-container .student-group-row:hover {
  background: transparent !important;
}

#students-container .student-group-cell {
  padding: 0.58rem 0.72rem;
  border-top: 0;
  border-bottom: 0;
  background:
    linear-gradient(
      135deg,
      var(--teacher-group-surface-light, rgba(255, 247, 237, 0.96)),
      var(--teacher-group-surface-light-strong, rgba(255, 237, 213, 0.92))
    );
  border-left: 5px solid var(--teacher-group-accent, var(--primary-500));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

#students-container .student-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

#students-container .student-group-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

#students-container .student-group-title {
  color: var(--teacher-group-accent, var(--primary-700));
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#students-container .student-group-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

#students-container .student-group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 1.7rem;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--teacher-group-accent, var(--primary-700));
  border: 1px solid var(--teacher-group-accent-soft, rgba(249, 115, 22, 0.18));
  font-size: 0.76rem;
  font-weight: 700;
}

#students-container .student-group-badge--subtle {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.64);
}

#students-container .student-group-badge--schedule {
  justify-content: flex-start;
  padding-right: 0.22rem;
  background: var(--student-schedule-badge-bg, rgba(255, 255, 255, 0.82));
  color: var(--student-schedule-badge-text, var(--text-strong));
  border-color: var(--student-schedule-badge-border, rgba(148, 163, 184, 0.28));
}

#students-container .student-group-badge-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

#students-container .student-group-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  min-height: 1.25rem;
  padding: 0.02rem 0.42rem;
  border-radius: 999px;
  background: var(--student-schedule-count-bg, rgba(71, 85, 105, 0.92));
  color: var(--student-schedule-count-text, #fff);
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

#students-container .student-table--teacher-grouped tbody tr.student-schedule-row {
  background: linear-gradient(90deg, var(--student-schedule-row-bg, transparent) 0%, transparent 72%) !important;
}

#students-container .student-table--teacher-grouped tbody tr.student-schedule-row:hover {
  background: linear-gradient(90deg, var(--student-schedule-row-bg-strong, transparent) 0%, transparent 72%) !important;
}

#students-container .student-table--teacher-grouped tbody tr.student-schedule-row td:first-child {
  box-shadow: inset 4px 0 0 var(--student-schedule-accent, transparent);
}

#students-container .student-table--teacher-grouped td.lesson-schedule-cell {
  text-align: center;
}

#students-container .lesson-schedule-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0.22rem 0.68rem;
  border-radius: 999px;
  border: 1px solid var(--student-schedule-cell-border, rgba(148, 163, 184, 0.3));
  background: var(--student-schedule-cell-bg, rgba(255, 255, 255, 0.84));
  color: var(--student-schedule-cell-text, var(--text-strong));
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#consults-container .student-table th,
#consults-container .student-table td {
  text-align: center;
}

#consults-container .student-table th {
  padding: 0.9rem 1rem;
}

#consults-container .student-table td {
  padding: 0.6rem 0.6rem;
}

#teachers-container .student-table th {
  padding: 0.9rem 1rem;
}

#teachers-container .student-table td {
  padding: 0.6rem 0.6rem;
}

#teachers-container .student-table {
  table-layout: fixed;
  width: 100%;
}

#teachers-container .student-table th,
#teachers-container .student-table td {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-impersonate-link {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--primary-600);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.teacher-impersonate-link:hover {
  color: var(--primary-700);
}

#payments-container .student-table {
  table-layout: fixed;
  width: 100%;
}

#payments-container .student-table th,
#payments-container .student-table td {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#payments-container .student-table th {
  padding: 0.9rem 1rem;
}

#payments-container .student-table td {
  padding: 0.6rem 0.6rem;
}

.payment-filter-input,
.payment-filter-select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-strong);
  background: #fff;
}

.payment-filter-input:focus,
.payment-filter-select:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

#students-container .student-table td.name-cell .name-with-status,
#consults-container .student-table td.name-cell .name-with-status {
  justify-content: center;
}

#students-container .student-table th.name-cell,
#students-container .student-table td.name-cell {
  width: 7%;
  min-width: 70px;
  max-width: 110px;
  padding: 0.5rem 0.45rem;
}

#students-container .student-table th.grade-cell,
#students-container .student-table td.grade-cell {
  min-width: 55px;
  max-width: 80px;
  text-align: center;
}

#students-container .student-table th.school-cell,
#students-container .student-table td.school-cell {
  min-width: 100px;
  max-width: 140px;
}

#students-container .student-table th.branch-cell,
#students-container .student-table td.branch-cell {
  min-width: 70px;
  max-width: 90px;
}

#students-container .student-table th.counsel-cell,
#students-container .student-table td.counsel-cell {
  min-width: 80px;
  max-width: 110px;
  text-align: center;
}

#students-container .student-table th.resume-cell,
#students-container .student-table td.resume-cell {
  min-width: 90px;
  max-width: 120px;
  text-align: center;
}

#students-container .student-table th.duration-cell,
#students-container .student-table td.duration-cell {
  min-width: 70px;
  max-width: 90px;
  text-align: center;
}

#students-container .student-table th.payment-cell,
#students-container .student-table td.payment-cell {
  min-width: 140px;
  max-width: 200px;
}

.branches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin-top: 0.5rem;
}


.branch-fieldset .branches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 520px) {
  .branch-fieldset .branches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.branch-fieldset .branch-option {
  justify-self: start;
}
.branch-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.25);
  background: rgba(249, 115, 22, 0.12);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-700);
  box-sizing: border-box;
}

.branch-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary-600);
  margin: 0;
}

.branch-option span {
  white-space: nowrap;
}

.sms-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sms-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-strong);
}

.sms-field input,
.sms-field select,
.sms-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  background: #fff;
  color: var(--primary-700);
  box-shadow: inset 0 1px 2px rgba(234, 88, 12, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}


.sms-field input:focus,
.sms-field select:focus,
.sms-field textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.sms-field textarea {
  min-height: 180px;
  resize: vertical;
  font-family: inherit;
}

.sms-field select {
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22 viewBox=%220 0 10 6%22%3E%3Cpath fill=%22%23ea580c%22 d=%22M5 6L0 0h10z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 10px 6px;
  cursor: pointer;
}

.sms-byte-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: -0.2rem;
}

.sms-byte-count.warning {
  color: #ea580c;
  font-weight: 600;
}

.sms-byte-count.error {
  color: #dc2626;
  font-weight: 700;
}

.sms-message {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.sms-message.error {
  color: #d14343;
}

.sms-message.success {
  color: #188038;
}

.sms-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-700);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-200);
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.9rem;
}

.profile-field input,
.profile-field select,
.profile-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  background: #fff;
  color: var(--primary-700);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-field input:focus,
.profile-field select:focus,
.profile-field textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

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

#profile-phones-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.phone-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 12px;
  background: rgba(255, 247, 237, 0.5);
}

.phone-item label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.9rem;
}

.shortlink-table {
  width: 100%;
  table-layout: fixed;
}

.shortlink-name {
  max-width: 12ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortlink-last-click {
  max-width: 16ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortlink-created-at {
  max-width: 16ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortlink-count {
  text-align: right;
  font-weight: 600;
  color: var(--text-strong);
}

.shortlink-name-value {
  cursor: pointer;
  color: var(--primary-600);
  font-weight: 600;
}

.shortlink-name-value:hover,
.shortlink-name-value:focus-visible {
  text-decoration: underline;
}

.shortlink-url {
  max-width: 20ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortlink-url a {
  display: inline-block;
  max-width: 100%;
  white-space: inherit;
  overflow: inherit;
  text-overflow: inherit;
  color: var(--primary-600);
  text-decoration: none;
}

.shortlink-url a:hover {
  text-decoration: underline;
}

.shortlink-owner {
  max-width: 12ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shortlinks-container .shortlink-name-value,
#shortlinks-container .shortlink-owner,
#shortlinks-container .shortlink-created-at,
#shortlinks-container .shortlink-count,
#shortlinks-container .shortlink-last-click {
  text-align: center;
}

#shortlinks-container .student-table {
  table-layout: fixed;
  width: 100%;
}

#shortlinks-container .student-table th,
#shortlinks-container .student-table td {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shortlinks-container .student-table th {
  padding: 0.9rem 1rem;
}

#shortlinks-container .student-table td {
  padding: 0.6rem 0.6rem;
}

.phone-item input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  background: #fff;
  color: var(--primary-700);
}

.phone-item input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.phone-item .btn {
  padding: 0.6rem 1rem;
}

#profile-phones-list .phone-item,
#register-phones-list .phone-item {
  grid-template-columns: minmax(10rem, 1.1fr) minmax(8rem, 1fr) minmax(5.5rem, auto) minmax(5.5rem, auto) auto;
  align-items: center;
}

#profile-phones-list .phone-field,
#register-phones-list .phone-field {
  min-width: 0;
}

#profile-phones-list .phone-check,
#register-phones-list .phone-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.65rem;
  color: var(--text-strong);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

#profile-phones-list .phone-check input,
#register-phones-list .phone-check input {
  width: 1rem;
  height: 1rem;
  padding: 0;
  accent-color: var(--primary-600);
}

#student-profile-attend-num-field[hidden] {
  display: none !important;
}

.student-class-management-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.student-class-management-content {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.student-class-section {
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 12px;
  background: rgba(255, 247, 237, 0.52);
  padding: 1rem;
}

.student-class-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.student-class-title {
  margin: 0;
  color: var(--primary-700);
  font-size: 1.02rem;
  font-weight: 800;
}

.student-class-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.student-class-meta span,
.student-class-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
}

.student-class-move-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.student-class-move-panel[hidden] {
  display: none !important;
}

.student-class-move-panel select {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(249, 115, 22, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 237, 0.92));
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  padding: 0.62rem 2.15rem 0.62rem 0.85rem;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #c2410c 50%),
    linear-gradient(135deg, #c2410c 50%, transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 237, 0.92));
  background-position:
    calc(100% - 1.05rem) 50%,
    calc(100% - 0.72rem) 50%,
    0 0;
  background-size:
    0.34rem 0.34rem,
    0.34rem 0.34rem,
    100% 100%;
  background-repeat: no-repeat;
}

.student-class-move-panel select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

.student-class-upcoming {
  margin-top: 0.9rem;
}

.student-class-upcoming-title {
  margin: 0 0 0.45rem;
  color: var(--text-strong);
  font-size: 0.88rem;
  font-weight: 800;
}

.student-class-upcoming-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.student-class-upcoming-item {
  display: grid;
  grid-template-columns: 8.8rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid rgba(249, 115, 22, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.55rem 0.65rem;
  color: var(--text);
  font-size: 0.84rem;
}

button.student-class-upcoming-item {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

button.student-class-upcoming-item:hover {
  border-color: rgba(249, 115, 22, 0.36);
  background: rgba(255, 247, 237, 0.9);
  transform: translateY(-1px);
}

.student-class-upcoming-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .student-class-section-header,
  .student-class-move-panel,
  .student-class-upcoming-item {
    grid-template-columns: 1fr;
  }

  .student-class-section-header {
    display: grid;
  }
}

@media (max-width: 760px) {
  #profile-phones-list .phone-item,
  #register-phones-list .phone-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #profile-phones-list .phone-check,
  #register-phones-list .phone-check {
    justify-content: flex-start;
  }
}

/* Skeleton UI for loading state */
.skeleton-table {
  width: 100%;
  border-collapse: collapse;
}

.skeleton-table thead th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-strong);
  border-bottom: 2px solid var(--primary-100);
}

.skeleton-table tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--primary-50);
}

.skeleton-row {
  height: 45px;
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    var(--primary-50) 0%,
    var(--primary-100) 50%,
    var(--primary-50) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  height: 16px;
}

.skeleton-shimmer.short {
  width: 60%;
}

.skeleton-shimmer.medium {
  width: 80%;
}

.skeleton-shimmer.long {
  width: 100%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 신규상담 테이블 컬럼 폭 조정 */
#consults-container .student-table th:nth-child(2),
#consults-container .student-table td:nth-child(2) {
  /* 학년 컬럼 - 2글자 한줄 표시 */
  min-width: 3ch;
  max-width: 4ch;
  white-space: nowrap;
}

#consults-container .student-table th:nth-child(3),
#consults-container .student-table td:nth-child(3) {
  /* 학교 컬럼 - 70% 축소, ... 처리 */
  max-width: 8ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#consults-container .student-table th:nth-child(4),
#consults-container .student-table td:nth-child(4) {
  /* 상담일시 컬럼 - 넓게 */
  min-width: 9ch;
  white-space: nowrap;
}

#consults-container .student-table th:nth-child(5),
#consults-container .student-table td:nth-child(5) {
  /* 상담 방법 컬럼 */
  min-width: 5ch;
  max-width: 6ch;
  white-space: nowrap;
}

#consults-container .student-table th:nth-child(6),
#consults-container .student-table td:nth-child(6) {
  /* 상담자 컬럼 */
  min-width: 4ch;
  max-width: 6ch;
  white-space: nowrap;
}

#consults-container .student-table th:nth-child(8),
#consults-container .student-table td:nth-child(8) {
  /* 수강 목적 컬럼 */
  max-width: 10ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#consults-container .student-table th:nth-child(9),
#consults-container .student-table td:nth-child(9) {
  /* 상담 내용 컬럼 */
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 모달 내 상담 기록 테이블 스타일 */
#consult-detail-modal #consult-history-table th:nth-child(4),
#consult-detail-modal #consult-history-table td:nth-child(4) {
  /* 상담 내용 컬럼 */
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#consult-detail-modal .consult-history .table-wrapper {
  overflow-x: auto;
}

#consult-detail-modal #consult-history-table {
  width: 100%;
  table-layout: auto;
}

#manager-notes-container .student-table th {
  padding: 0.9rem 1rem;
}

#manager-notes-container .student-table td {
  padding: 0.6rem 0.6rem;
  text-align: center;
}

#manager-notes-container .student-table td.manager-note-cell {
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
  text-overflow: initial;
  text-align: left;
  min-width: 260px;
  max-width: 700px;
}

#manager-notes-container .student-table td.security-note-cell {
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
  text-overflow: initial;
  text-align: left;
  min-width: 220px;
  max-width: 560px;
}

/* Student filters */
.student-filters,
.teacher-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.payment-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.manager-note-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.manager-note-teacher-quick-filter {
  max-width: min(640px, 92vw);
}

.manager-note-teacher-quick-filter .filter-group-buttons {
  max-height: 4.4rem;
  overflow-y: auto;
}

.payment-detail-header .pagination {
  flex: initial;
}

.filter-group {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--primary-200);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.filter-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  padding-right: 0.5rem;
  border-right: 1.5px solid var(--primary-200);
}

.filter-group-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-group-buttons .chip {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

.branch-filter-list,
.state-filter-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  background: var(--primary-500);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-600);
}

.pagination-btn:disabled {
  background: var(--primary-100);
  color: var(--text-muted);
  cursor: not-allowed;
}

.pagination-info {
  font-weight: 600;
  color: var(--text-strong);
  min-width: 80px;
  text-align: center;
}

/* Column header filters */
.filterable-header {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px !important;
  overflow: visible !important;
}

.filterable-header::after {
  content: "▼";
  position: absolute;
  right: 8px;
  font-size: 0.7em;
  opacity: 0.5;
}

.filterable-header:hover {
  background: var(--primary-50);
}

.filterable-header.filtered::after {
  opacity: 1;
  color: var(--primary-600);
}

.column-filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: white;
  border: 1px solid var(--primary-200);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  z-index: 10000;
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.column-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.column-filter-option:hover {
  background: var(--primary-50);
}

.column-filter-option input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary-500);
}

/* Readonly input styling */
input[readonly],
textarea[readonly] {
  background-color: #f5f5f5 !important;
  color: #666 !important;
  cursor: not-allowed !important;
  border-color: #e0e0e0 !important;
}

input[readonly]:focus,
textarea[readonly]:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: #e0e0e0 !important;
}

/* Lessons tab */
.lesson-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.lesson-search-wrap,
.lesson-preset-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lesson-preset-wrap select {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.lesson-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

.lesson-search-column {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(251, 146, 60, 0.08));
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lesson-search-column input[type="search"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(249, 115, 22, 0.25);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
}

.lesson-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
}

.lesson-search-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lesson-search-item:hover {
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 8px 16px rgba(234, 88, 12, 0.15);
  transform: translateY(-1px);
}

.lesson-form-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lesson-form-card,
.lesson-history-card {
  background: #fff;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(234, 88, 12, 0.12);
  padding: 1.1rem 1.25rem;
}

.lesson-table-wrapper {
  width: 100%;
}

.lesson-table-scroll {
  overflow-x: auto;
}

.lesson-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  table-layout: fixed;
}

.lesson-table th,
.lesson-table td {
  border: 1px solid #f2f2f2;
  padding: 0.4rem;
  vertical-align: top;
}

.lesson-table th {
  background: #fff7ed;
  color: #7a4a24;
  font-weight: 800;
  font-size: 0.9rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.lesson-table input,
.lesson-table textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}

.lesson-table textarea {
  resize: vertical;
  min-height: 52px;
}

.lesson-name-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.lesson-name-label .muted {
  font-size: 0.85rem;
}

.lesson-weekday-display {
  margin-top: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lesson-date-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lesson-col-date { width: 12%; }
.lesson-col-absent { width: 7%; }
.lesson-col-progress { width: 20%; }
.lesson-col-remaining { width: 9%; }
.lesson-col-remark { width: 13%; }
.lesson-col-homework { width: 13%; }
.lesson-col-parent { width: 19%; }
.lesson-col-actions { width: 7%; }

.lesson-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lesson-row-actions .row-message {
  font-size: 0.8rem;
  min-height: 1.1rem;
  color: var(--text-muted);
}

.lesson-row-actions .row-message.success {
  color: #0f9d58;
}

.lesson-row-actions .row-message.error {
  color: #d14343;
}

.lesson-row-actions .row-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}

.lesson-history-card {
  margin-top: 1rem;
}

.lesson-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.lesson-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.lesson-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.lesson-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
}

.lesson-field-wide {
  grid-column: 1 / -1;
}

.lesson-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lesson-field input,
.lesson-field textarea,
.lesson-field select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.lesson-field textarea {
  resize: vertical;
}

.lesson-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.lesson-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.lesson-message {
  margin: 0;
  color: var(--text-muted);
  min-height: 1.2rem;
  font-weight: 600;
}

.lesson-message.success {
  color: #0f9d58;
}

.lesson-message.error {
  color: #d14343;
}

.lesson-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.lesson-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
  width: 100%;
  min-width: 0;
}

.lesson-history-item {
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: rgba(249, 115, 22, 0.03);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.lesson-history-item-head {
  min-width: 0;
}

.lesson-history-item-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.lesson-history-item h4 {
  margin: 0 0 0.25rem 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lesson-history-item p {
  margin: 0.2rem 0;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.record-embed {
  --bg: #f5f0e8;
  --ink: #1e1a16;
  --muted: #5a5148;
  --accent: #f4a259;
  --accent-dark: #d57d2a;
  --accent-cool: #3a6ea5;
  --card: #fff7ee;
  --border: rgba(30, 26, 22, 0.12);
  --shadow: 0 20px 60px rgba(32, 24, 18, 0.18);
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 1.8rem;
  background: #fff;
  color: var(--ink);
  font-family: "Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.record-embed * {
  box-sizing: border-box;
}

.record-embed header,
.record-embed .record-main,
.record-embed footer {
  width: 100%;
  margin: 0;
  position: relative;
  z-index: 1;
}

.record-embed .bg-orb {
  display: none;
}

.record-embed .bg-orb--one {
  background: radial-gradient(circle, #f4a259 0%, transparent 70%);
  top: -120px;
  right: -80px;
}

.record-embed .bg-orb--two {
  background: radial-gradient(circle, #3a6ea5 0%, transparent 70%);
  bottom: -160px;
  left: -120px;
  animation-delay: -3s;
}

@keyframes record-float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(20px);
  }
}

.record-embed .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 0.6rem 0 1.2rem;
  animation: record-reveal 0.8s ease-out both;
}

@keyframes record-reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.record-embed h1 {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.record-embed .subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.record-embed .status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  min-width: 220px;
  box-shadow: var(--shadow);
  text-align: left;
  position: relative;
}

.record-embed .brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.record-embed .status-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.record-embed .status-text {
  font-weight: 600;
  margin: 0;
}

.record-embed .spinner {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  opacity: 0;
  animation: record-spin 1s linear infinite;
}

.record-embed .spinner.is-active {
  opacity: 1;
}

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

.record-embed .control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.record-embed .card {
  background: var(--card);
  border-radius: 22px;
  padding: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: record-reveal 0.9s ease-out both;
}

.record-embed .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.record-embed .card h2 {
  margin: 0;
  font-size: 1.4rem;
}

.record-embed .card-text {
  margin: 0;
  color: var(--muted);
}

.record-embed .badge {
  font-size: 0.8rem;
  background: rgba(58, 110, 165, 0.12);
  color: var(--accent-cool);
  padding: 6px 12px;
  border-radius: 999px;
}

.record-embed .record-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.record-embed .timer {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.record-embed .audio-preview {
  width: 100%;
  border-radius: 12px;
}

.record-embed .file-input {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 162, 89, 0.14);
  border: 1px dashed rgba(213, 125, 42, 0.6);
  padding: 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.record-embed .file-input input {
  display: none;
}

.record-embed .file-input:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(213, 125, 42, 0.18);
}

.record-embed .file-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.record-embed .btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.record-embed .btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.record-embed .btn-primary {
  background: var(--accent);
  color: #1d130a;
  box-shadow: 0 12px 24px rgba(244, 162, 89, 0.4);
}

.record-embed .btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--accent-dark);
}

.record-embed .btn-dark {
  background: var(--ink);
  color: #fff5ea;
  box-shadow: 0 10px 24px rgba(30, 26, 22, 0.28);
}

.record-embed .btn-dark:hover:not(:disabled) {
  transform: translateY(-2px);
}

.record-embed .btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.record-embed .btn-ghost:hover:not(:disabled) {
  transform: translateY(-2px);
}

.record-embed .results {
  margin-bottom: 40px;
}

.record-embed .results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.record-embed .results-actions {
  display: flex;
  gap: 10px;
}

.record-embed .result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.record-embed .result-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 22px;
  min-height: 200px;
  box-shadow: var(--shadow);
}

.record-embed .result-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.record-embed .result-body {
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.6;
}

.record-embed .footer {
  padding: 18px 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .record-embed .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .record-embed .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .record-embed .status-card {
    width: 100%;
  }
}

@media (max-width: 960px) {
  .lesson-layout {
    flex-direction: column;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary-25: #0b121b;
  --primary-50: #1a2533;
  --primary-100: #223247;
  --primary-200: #2f4761;
  --primary-400: #fb923c;
  --primary-500: #f97316;
  --primary-600: #fb923c;
  --primary-700: #fdba74;
  --text-strong: #e5edf8;
  --text-muted: #97a8bf;
  --card-shadow: rgba(2, 6, 23, 0.6);
  --glow: rgba(249, 115, 22, 0.28);
  --surface-page: #0b121b;
  --surface-panel: #101a27;
  --surface-elevated: #162334;
  --surface-muted: #132031;
  --surface-soft: rgba(251, 146, 60, 0.14);
  --border-soft: rgba(148, 163, 184, 0.35);
  --border-strong: rgba(251, 146, 60, 0.35);
  --overlay-bg: rgba(2, 6, 23, 0.78);
  --table-head-bg: #182638;
  --table-row-odd: rgba(30, 45, 65, 0.62);
  --table-row-hover: rgba(251, 146, 60, 0.16);
  --success-strong: #34d399;
  --danger-strong: #f87171;
}

:root[data-theme="dark"] .container,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .table-wrapper,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .payment-form,
:root[data-theme="dark"] .counsel-form,
:root[data-theme="dark"] .counsel-list,
:root[data-theme="dark"] .student-column-menu,
:root[data-theme="dark"] .counsel-card,
:root[data-theme="dark"] .payment-history-card,
:root[data-theme="dark"] .payment-latest-lesson,
:root[data-theme="dark"] .lesson-form-card,
:root[data-theme="dark"] .lesson-history-card {
  background: var(--surface-panel);
  color: var(--text-strong);
  border-color: var(--border-soft);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.48);
}

:root[data-theme="dark"] .card p,
:root[data-theme="dark"] .card-text,
:root[data-theme="dark"] .stats-row-label,
:root[data-theme="dark"] .stats-row-delta,
:root[data-theme="dark"] .shortlink-stats-summary,
:root[data-theme="dark"] .payment-history-meta,
:root[data-theme="dark"] .counsel-card-meta {
  color: var(--text-muted);
}

:root[data-theme="dark"] .btn.secondary,
:root[data-theme="dark"] .tab-btn,
:root[data-theme="dark"] .student-state-chip,
:root[data-theme="dark"] .branch-filter-option {
  background: var(--surface-soft);
  color: var(--primary-700);
  border-color: var(--border-strong);
}

:root[data-theme="dark"] .btn.secondary:hover,
:root[data-theme="dark"] .tab-btn:hover,
:root[data-theme="dark"] .theme-toggle:hover {
  background: rgba(251, 146, 60, 0.2);
}

:root[data-theme="dark"] .hj-topbar {
  background: rgba(15, 23, 42, 0.94);
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

:root[data-theme="dark"] .hj-topbar-logo {
  color: #f8fafc;
  border-right-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .hj-topbar-identity strong {
  color: #f8fafc;
}

:root[data-theme="dark"] .hj-topbar-identity span,
:root[data-theme="dark"] .hj-topbar-meta-item {
  color: #b8c6d8;
}

:root[data-theme="dark"] .hj-topbar-affiliation {
  color: #fdba74;
}

:root[data-theme="dark"] .profile-recent-tab-btn {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fafc;
}

:root[data-theme="dark"] .profile-recent-tab-btn:hover {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.42);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.35);
}

:root[data-theme="dark"] .teacher-impersonate-link {
  color: #fdba74;
}

:root[data-theme="dark"] .teacher-impersonate-link:hover {
  color: #fed7aa;
}

:root[data-theme="dark"] .tab-btn.active {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  color: #ffffff;
  border-color: rgba(251, 146, 60, 0.82);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.35);
}

:root[data-theme="dark"] .tab-controls-sidebar,
:root[data-theme="dark"] .tab-control-group--sidebar {
  border-color: rgba(148, 163, 184, 0.24);
  background: #0f172a;
  box-shadow: none;
}

:root[data-theme="dark"] .tab-controls-sidebar-copy,
:root[data-theme="dark"] .tab-control-description,
:root[data-theme="dark"] .tab-btn-meta {
  color: #b8c6d8;
}

:root[data-theme="dark"] .hj-topbar-recents-title {
  color: #cbd5e1;
}

:root[data-theme="dark"] .hj-topbar-actions-divider {
  background: rgba(148, 163, 184, 0.26);
}

:root[data-theme="dark"] .tab-controls-sidebar-head h2,
:root[data-theme="dark"] .tab-btn--sidebar {
  color: #e5edf6;
}

:root[data-theme="dark"] .tab-control-group--sidebar .tab-control-title {
  color: #e5edf6;
  background: #334155;
}

:root[data-theme="dark"] .tab-btn--sidebar {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

:root[data-theme="dark"] .tab-btn--sidebar.active {
  background: #f97316;
  color: #fff;
}

:root[data-theme="dark"] .sidebar-toggle-btn {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-color: rgba(148, 163, 184, 0.4);
  color: #f8fafc;
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.34);
}

:root[data-theme="dark"] .sidebar-toggle-btn[aria-expanded="false"] {
  border-color: rgba(251, 146, 60, 0.62);
  background: linear-gradient(180deg, #fb923c 0%, #f97316 50%, #c2410c 100%);
  color: #fff7ed;
  box-shadow: 0 18px 34px rgba(124, 45, 18, 0.46);
}

:root[data-theme="dark"] .tab-control-group:not(.tab-control-group--sidebar),
:root[data-theme="dark"] .table-top-scroll,
:root[data-theme="dark"] .meeting-note-select-shell,
:root[data-theme="dark"] .meeting-note-search-wrap,
:root[data-theme="dark"] .meeting-note-week-nav {
  background: var(--surface-muted);
  border-color: var(--border-soft);
}

:root[data-theme="dark"] .filter-group {
  background: rgba(19, 32, 49, 0.78);
  border-color: rgba(148, 163, 184, 0.42);
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08);
}

:root[data-theme="dark"] .filter-group-label {
  color: #dbe6f5;
  border-right-color: rgba(148, 163, 184, 0.36);
}

:root[data-theme="dark"] .filter-group-buttons .chip,
:root[data-theme="dark"] .student-filters .chip {
  background: rgba(30, 45, 65, 0.72);
  border-color: rgba(148, 163, 184, 0.42);
  color: #d6e1f1;
  box-shadow: none;
}

:root[data-theme="dark"] .filter-group-buttons .chip:hover,
:root[data-theme="dark"] .student-filters .chip:hover {
  background: rgba(38, 58, 82, 0.92);
  border-color: rgba(251, 146, 60, 0.5);
  box-shadow: 0 8px 16px rgba(2, 6, 23, 0.34);
}

:root[data-theme="dark"] .filter-group-buttons .chip.active,
:root[data-theme="dark"] .student-filters .chip.active {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  color: #ffffff;
  border-color: rgba(251, 146, 60, 0.84);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.32);
}

:root[data-theme="dark"] thead,
:root[data-theme="dark"] .student-table thead,
:root[data-theme="dark"] .skeleton-table thead th {
  background: var(--table-head-bg);
}

:root[data-theme="dark"] tbody tr:nth-child(odd),
:root[data-theme="dark"] .student-table tbody tr:nth-child(odd) {
  background: var(--table-row-odd);
}

:root[data-theme="dark"] tbody tr:hover,
:root[data-theme="dark"] .student-table tbody tr:hover {
  background: var(--table-row-hover);
}

:root[data-theme="dark"] #students-container .student-grouping-notice {
  background: linear-gradient(135deg, rgba(60, 36, 15, 0.92), rgba(83, 47, 19, 0.88));
  border-color: rgba(249, 115, 22, 0.24);
  color: #fed7aa;
}

:root[data-theme="dark"] #students-container .student-group-cell {
  background:
    linear-gradient(
      135deg,
      var(--teacher-group-surface-dark, rgba(34, 26, 20, 0.96)),
      var(--teacher-group-surface-dark-strong, rgba(48, 34, 23, 0.94))
    );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] #students-container .student-group-badge {
  background: rgba(15, 23, 42, 0.48);
  color: #f8fafc;
}

:root[data-theme="dark"] #students-container .student-group-badge--subtle {
  color: rgba(226, 232, 240, 0.88);
  background: rgba(15, 23, 42, 0.34);
}

:root[data-theme="dark"] #students-container .student-group-badge--schedule {
  background: var(--student-schedule-badge-bg-dark, rgba(30, 41, 59, 0.72));
  color: var(--student-schedule-badge-text-dark, #f8fafc);
}

:root[data-theme="dark"] #students-container .student-table--teacher-grouped tbody tr.student-schedule-row {
  background: linear-gradient(90deg, var(--student-schedule-row-bg-dark, transparent) 0%, transparent 72%) !important;
}

:root[data-theme="dark"] #students-container .student-table--teacher-grouped tbody tr.student-schedule-row:hover {
  background: linear-gradient(90deg, var(--student-schedule-row-bg-strong-dark, transparent) 0%, transparent 72%) !important;
}

:root[data-theme="dark"] #students-container .lesson-schedule-chip {
  background: var(--student-schedule-cell-bg-dark, rgba(30, 41, 59, 0.78));
  border-color: var(--student-schedule-cell-border-dark, rgba(148, 163, 184, 0.28));
  color: var(--student-schedule-cell-text-dark, #e2e8f0);
}

:root[data-theme="dark"] .student-table th::after {
  background: rgba(148, 163, 184, 0.3);
}

:root[data-theme="dark"] .student-column-menu-btn {
  color: #d6deea;
}

:root[data-theme="dark"] .student-column-menu-btn:hover {
  background: rgba(251, 146, 60, 0.16);
}

:root[data-theme="dark"] .student-column-filter-option,
:root[data-theme="dark"] .meeting-note-select,
:root[data-theme="dark"] .meeting-note-search-input,
:root[data-theme="dark"] .phone-settings-input,
:root[data-theme="dark"] .phone-settings-textarea,
:root[data-theme="dark"] .contract-form-grid input,
:root[data-theme="dark"] .contract-form-grid select,
:root[data-theme="dark"] .contract-editor-grid textarea,
:root[data-theme="dark"] .contract-send input,
:root[data-theme="dark"] .contract-send select,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: var(--surface-elevated);
  color: var(--text-strong);
  border-color: var(--border-soft);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: rgba(151, 168, 191, 0.72);
}

:root[data-theme="dark"] .student-profile-teacher-checklist {
  background: rgba(20, 32, 49, 0.94);
  border-color: rgba(148, 163, 184, 0.45);
}

:root[data-theme="dark"] .student-profile-teacher-option {
  color: #e5edf8;
}

:root[data-theme="dark"] .student-class-section {
  background: rgba(19, 32, 49, 0.78);
  border-color: rgba(148, 163, 184, 0.22);
}

:root[data-theme="dark"] .student-class-title {
  color: #fed7aa;
}

:root[data-theme="dark"] .student-class-meta span,
:root[data-theme="dark"] .student-class-status {
  background: rgba(30, 41, 59, 0.92);
  color: #dbe6f5;
}

:root[data-theme="dark"] .student-class-move-panel select {
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  background-image:
    linear-gradient(45deg, transparent 50%, #fed7aa 50%),
    linear-gradient(135deg, #fed7aa 50%, transparent 50%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
}

:root[data-theme="dark"] .student-class-upcoming-item {
  background: rgba(15, 23, 42, 0.64);
  border-color: rgba(148, 163, 184, 0.18);
  color: #dbe6f5;
}

:root[data-theme="dark"] button.student-class-upcoming-item:hover {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(251, 146, 60, 0.38);
}

:root[data-theme="dark"] .modal-overlay {
  background: var(--overlay-bg);
}

:root[data-theme="dark"] .modal-header {
  background: linear-gradient(135deg, #132131 0%, #1b2b3f 100%);
  border-bottom-color: var(--border-soft);
}

:root[data-theme="dark"] .modal-icon-btn {
  background: var(--surface-elevated);
  color: var(--text-strong);
  border-color: var(--border-soft);
}

:root[data-theme="dark"] .modal-message:not(:empty) {
  background: rgba(251, 146, 60, 0.14);
  color: #ffd9b0;
  border-color: rgba(251, 146, 60, 0.35);
}

:root[data-theme="dark"] .modal-message.error {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

:root[data-theme="dark"] .modal-message.success {
  background: rgba(16, 185, 129, 0.14);
  color: #86efac;
}

:root[data-theme="dark"] .withdrawal-risk-toggle-card {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.12), rgba(22, 35, 52, 0.94));
  border-color: var(--border-soft);
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.32);
}

:root[data-theme="dark"] .withdrawal-risk-toggle input[type="checkbox"] {
  border-color: rgba(251, 146, 60, 0.55);
  background-color: rgba(15, 23, 42, 0.88);
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.44);
}

:root[data-theme="dark"] .modal-subtitle {
  color: var(--text-muted);
}

:root[data-theme="dark"] .withdrawal-risk-reason-panel {
  background: rgba(22, 35, 52, 0.9);
  border-color: var(--border-soft);
}

:root[data-theme="dark"] .withdrawal-risk-reason-label {
  color: #fed7aa;
}

:root[data-theme="dark"] .withdrawal-risk-reason-text {
  color: var(--text-strong);
}

:root[data-theme="dark"] .stats-up {
  color: var(--success-strong);
}

:root[data-theme="dark"] .stats-down {
  color: var(--danger-strong);
}

:root[data-theme="dark"] .record-embed {
  --bg: #0e1722;
  --ink: #e6edf9;
  --muted: #9db0c8;
  --accent: #f59f52;
  --accent-dark: #ee8e35;
  --accent-cool: #7db0f0;
  --card: #132131;
  --border: rgba(148, 163, 184, 0.34);
  --shadow: 0 20px 50px rgba(2, 6, 23, 0.55);
  background: #0f1b2a;
}

:root[data-theme="dark"] .record-embed .result-card {
  background: #162739;
}

.finance-header {
  align-items: flex-start;
  gap: 1rem;
}

.finance-editor-note {
  margin: 0.25rem 0 0;
}

.finance-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.finance-subtabs {
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
}

.finance-subtab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.finance-subtab-btn.active {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  color: #fff;
  box-shadow: 0 10px 20px rgba(234, 88, 12, 0.18);
}

.finance-owner-toggles {
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: var(--surface-panel);
  border: 1px solid var(--border-soft);
}

.finance-owner-toggle {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.finance-owner-toggle.active {
  background: rgba(15, 23, 42, 0.08);
  color: var(--primary-700);
}

.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.finance-summary-card {
  background: var(--surface-panel);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.finance-summary-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.finance-summary-balance {
  margin: 0.45rem 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-700);
}

.finance-summary-date {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

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

.finance-table th,
.finance-table td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

.finance-table th {
  background: var(--table-head-bg);
  color: var(--primary-700);
  font-size: 0.9rem;
}

.finance-table tr.finance-row-inflow {
  background: rgba(239, 68, 68, 0.08);
}

.finance-table tr.finance-row-outflow {
  background: rgba(37, 99, 235, 0.08);
}

.finance-table tr.finance-row-inflow td:nth-child(2) input {
  color: #b91c1c;
  font-weight: 700;
}

.finance-table tr.finance-row-outflow td:nth-child(2) input {
  color: #1d4ed8;
  font-weight: 700;
}

.finance-table input,
.finance-table select {
  width: 100%;
  min-width: 110px;
  box-sizing: border-box;
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  background: var(--surface-elevated);
  font-size: 0.95rem;
  color: var(--primary-700);
  box-shadow: inset 0 1px 2px rgba(234, 88, 12, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.finance-table input:focus,
.finance-table select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.finance-table select {
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22 viewBox=%220 0 10 6%22%3E%3Cpath fill=%22%23ea580c%22 d=%22M5 6L0 0h10z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 10px 6px;
  cursor: pointer;
  padding-right: 2rem;
}

.finance-table select::-ms-expand {
  display: none;
}

.finance-table col.finance-col-entry_date {
  width: 128px;
}

.finance-table col.finance-col-amount,
.finance-table col.finance-col-balance {
  width: 118px;
}

.finance-table col.finance-col-category {
  width: 92px;
}

.finance-table col.finance-col-note {
  width: 360px;
}

.finance-table td.finance-col-amount input,
.finance-table td.finance-col-balance input {
  min-width: 96px;
}

.finance-table td.finance-col-category input,
.finance-table td.finance-col-category select {
  min-width: 72px;
}

.finance-table td.finance-col-entry_date input {
  min-width: 108px;
}

.finance-table td.finance-col-note input {
  min-width: 280px;
}

.finance-table col.finance-col-action,
.finance-table td.finance-col-action,
.finance-table th.finance-col-action,
.finance-table td:last-child,
.finance-table th:last-child {
  width: 84px;
}

.finance-action-cell {
  text-align: center;
}

.timetable-header {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.timetable-header,
.timetable-toolbar,
.timetable-board {
  --surface: var(--surface-panel);
  --surface-alt: var(--table-head-bg);
  --text: var(--text-strong);
  --muted: var(--text-muted);
  --border: var(--border-soft);
}

.timetable-subtitle {
  margin: 0.2rem 0 0;
}

.timetable-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.timetable-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  justify-content: flex-start;
  width: 100%;
}

.timetable-select-wrap.timetable-select-wrap--weeks {
  flex: 0 0 auto;
  min-width: 0;
}

.timetable-select-wrap.timetable-select-wrap--date {
  flex: 0 0 10.5rem;
  min-width: 10.5rem;
}

.timetable-view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 92%, white 8%), var(--surface-muted));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.timetable-view-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.86rem;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.timetable-view-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 1rem;
  line-height: 1;
}

.timetable-view-btn-icon--joinable svg {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.timetable-view-btn.is-active {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.24);
}

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

.timetable-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 11rem;
}

.timetable-select-wrap[hidden] {
  display: none !important;
}

.timetable-select-wrap.is-disabled {
  opacity: 0.55;
}

.timetable-select-wrap span {
  color: var(--muted);
  font-size: 0.85rem;
}

.timetable-week-quick {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-bottom: 0;
}

.timetable-week-quick::-webkit-scrollbar {
  display: none;
}

.timetable-week-btn {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 94%, white 6%), var(--surface-muted));
  color: var(--text);
  padding: 0.4rem 0.72rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

#timetable-notice-preview-btn,
#timetable-add-event-btn {
  align-self: flex-end;
  margin-left: auto;
  min-height: 3rem;
  padding: 0.78rem 1.2rem;
  border-radius: 0.95rem;
  font-size: 0.96rem;
  font-weight: 800;
}

#timetable-notice-preview-btn {
  margin-left: auto;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

#timetable-add-event-btn {
  margin-left: 0;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.2);
}

.timetable-notice-preview-body {
  max-height: min(74vh, 780px);
  overflow-y: auto;
}

.timetable-notice-preview-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timetable-notice-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.timetable-notice-summary > div {
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
  padding: 0.78rem 0.9rem;
}

.timetable-notice-summary strong,
.timetable-notice-summary span {
  display: block;
}

.timetable-notice-summary strong {
  color: var(--primary-700);
  font-size: 0.95rem;
}

.timetable-notice-summary span {
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.timetable-notice-group {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface-panel);
  overflow: hidden;
}

.timetable-notice-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border-soft);
}

.timetable-notice-group-header strong,
.timetable-notice-group-header span {
  display: block;
}

.timetable-notice-group-header strong {
  color: var(--text-strong);
  font-size: 1rem;
}

.timetable-notice-group-header span {
  color: var(--text-muted);
  font-size: 0.83rem;
}

.timetable-notice-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem;
}

.timetable-notice-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: var(--surface-elevated);
  padding: 0.85rem;
}

.timetable-notice-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  gap: 0.75rem;
  align-items: start;
}

.timetable-notice-student strong,
.timetable-notice-recipient strong,
.timetable-notice-student span,
.timetable-notice-recipient span {
  display: block;
}

.timetable-notice-student strong,
.timetable-notice-recipient strong {
  color: var(--text-strong);
}

.timetable-notice-student span,
.timetable-notice-recipient span,
.timetable-notice-template {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.timetable-notice-recipient {
  text-align: right;
}

.timetable-notice-template {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.timetable-notice-message {
  margin: 0.7rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0.8rem;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.5;
}

.timetable-notice-message-extra {
  margin-top: 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(241, 245, 249, 0.78);
  color: var(--text-muted);
  padding: 0.68rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.timetable-notice-skipped {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: var(--surface-muted);
}

.timetable-notice-skipped summary {
  cursor: pointer;
  color: var(--text-strong);
  font-weight: 700;
}

.timetable-notice-skipped ul {
  margin: 0.65rem 0 0;
  padding-left: 1.2rem;
}

.timetable-week-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(249, 115, 22, 0.28);
}

.timetable-week-btn.is-active {
  border-color: rgba(249, 115, 22, 0.42);
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.96), rgba(255, 247, 237, 0.98));
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.14);
}

.timetable-week-btn-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--primary-700);
}

.timetable-week-btn-sub {
  display: none;
}

.timetable-select-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.7rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 92%, white 8%), var(--surface-muted));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.timetable-select-shell::after {
  content: "▾";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 0.82rem;
}

.timetable-select-wrap select {
  appearance: none;
  width: 100%;
  min-height: 2.4rem;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.55rem 2.2rem 0.55rem 0.85rem;
  font-weight: 600;
}

.timetable-date-shell::after {
  content: none;
}

.timetable-date-shell input[type="date"] {
  width: 100%;
  min-height: 2.4rem;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-family: inherit;
}

.timetable-date-shell input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
}

.timetable-board {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.timetable-day-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.65rem;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.95), rgba(255, 255, 255, 0.98));
  border-bottom: 1px solid rgba(249, 115, 22, 0.12);
}

.timetable-day-summary-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--primary-700);
}

.timetable-day-summary-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.timetable-day-summary--board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, max-content);
  align-items: center;
  gap: 1rem;
}

.timetable-day-summary-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 9rem;
  gap: 0.35rem;
}

.timetable-day-summary--board .timetable-day-summary-copy {
  min-width: 0;
}

.timetable-date-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  line-height: 1;
  white-space: nowrap;
}

.timetable-date-badge-main {
  font-size: 1.58rem;
  font-weight: 900;
  color: var(--primary-700);
}

.timetable-date-badge-weekday {
  font-size: 1.2rem;
  font-weight: 900;
  color: #9a3412;
}

.timetable-date-badge-year {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.78);
}

.timetable-date-badge--compact {
  gap: 0.6rem;
}

.timetable-date-badge--compact .timetable-date-badge-main {
  font-size: 2rem;
}

.timetable-date-badge--compact .timetable-date-badge-weekday {
  font-size: 1.62rem;
}

.timetable-board-selected-date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.38rem;
  min-width: 0;
  width: 100%;
}

.timetable-board-header-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.timetable-day-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
  width: 100%;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.timetable-day-tabs::-webkit-scrollbar {
  display: none;
}

.timetable-day-tab {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 5.8rem;
  min-height: 3.35rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.timetable-day-tab:hover {
  border-color: rgba(249, 115, 22, 0.28);
  color: var(--text);
}

.timetable-day-tab.is-active {
  background: linear-gradient(180deg, rgba(255, 237, 213, 0.98), rgba(255, 247, 237, 0.98));
  border-color: rgba(249, 115, 22, 0.34);
  color: var(--primary-700);
  box-shadow: 0 10px 18px rgba(249, 115, 22, 0.12);
}

.timetable-day-tab-label {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
}

.timetable-day-tab-date {
  margin-top: 0.16rem;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  color: rgba(15, 23, 42, 0.58);
}

.timetable-day-tab.is-active .timetable-day-tab-date {
  color: rgba(154, 52, 18, 0.82);
}

.timetable-board-meta {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.32rem;
  min-width: 0;
  overflow: visible;
}

.timetable-board-meta .timetable-day-meta-btn,
.timetable-board-meta .timetable-desk-summary-btn {
  max-width: 100%;
  min-width: 0;
  text-align: left;
  padding: 0.28rem 0.62rem;
  font-size: 0.84rem;
  line-height: 1.25;
}

.timetable-table-wrapper {
  margin: 0;
}

.timetable-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
}

.timetable-list-scroll {
  overflow-x: auto;
}

.timetable-empty-copy {
  padding: 1rem;
  margin: 0;
}

.timetable-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.timetable-table tbody tr {
  height: 1.18rem;
}

.timetable-table th,
.timetable-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.timetable-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
  color: var(--primary-700);
  font-size: 0.82rem;
  padding: 0.55rem 0.4rem;
  text-align: center;
}

.timetable-time-head,
.timetable-time-cell {
  width: 5.8rem;
  min-width: 5.8rem;
  height: 1.18rem;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.62rem;
  text-align: center;
  padding: 0.08rem 0.24rem;
  position: sticky;
  left: 0;
  z-index: 2;
}

.timetable-cell {
  height: 1.18rem;
  padding: 0.04rem;
  background: var(--surface-elevated);
  min-width: 3.5rem;
  width: 3.5rem;
  max-width: 3.5rem;
  white-space: normal;
  overflow: hidden;
}

.timetable-cell--empty {
  background: color-mix(in srgb, var(--surface-elevated) 92%, var(--text-muted) 8%);
}

.timetable-empty-cell-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 1.1rem;
  border: 1px dashed transparent;
  border-radius: 0.35rem;
  background: transparent;
  color: rgba(249, 115, 22, 0);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.timetable-cell--empty:hover .timetable-empty-cell-action,
.timetable-empty-cell-action:focus-visible {
  border-color: rgba(249, 115, 22, 0.34);
  background: rgba(255, 247, 237, 0.88);
  color: rgba(194, 65, 12, 0.92);
  outline: none;
}

.timetable-cell--alt {
  background: color-mix(in srgb, var(--surface-elevated) 78%, var(--surface-muted) 22%);
}

.timetable-cell--day-start {
  border-left: 3px solid rgba(234, 88, 12, 0.28);
}

.timetable-cell--day-end {
  border-right: 2px solid rgba(148, 163, 184, 0.26);
}

.timetable-day-head {
  min-width: 12rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 88%, white 12%), color-mix(in srgb, var(--surface-elevated) 94%, white 6%)) !important;
}

.timetable-day-head-main {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--primary-700);
}

.timetable-day-head-sub {
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.timetable-lane-head {
  min-width: 3.5rem;
  width: 3.5rem;
  max-width: 3.5rem;
  white-space: nowrap;
  padding: 0;
}

.timetable-lane-head-inner {
  display: block;
  padding: 0.55rem 0.35rem;
}

.timetable-lane-head-inner.is-alt {
  background: color-mix(in srgb, var(--surface-elevated) 78%, var(--surface-muted) 22%);
}

.timetable-lane-head-inner.is-day-start {
  border-left: 3px solid rgba(234, 88, 12, 0.28);
}

.timetable-lane-head-inner.is-day-end {
  border-right: 2px solid rgba(148, 163, 184, 0.26);
}

.timetable-event {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.14rem;
  width: 100%;
  min-height: 100%;
  height: auto;
  max-height: none;
  justify-content: flex-start;
  border-radius: 0.45rem;
  padding: 0.22rem 0.28rem;
  background: color-mix(in srgb, var(--surface-elevated) 70%, #60a5fa 30%);
  border: 1px solid rgba(96, 165, 250, 0.28);
  overflow: hidden;
  cursor: zoom-in;
  text-align: left;
  appearance: none;
}

.timetable-event--class {
  background: color-mix(in srgb, var(--surface-elevated) 68%, #67e8f9 32%);
  border-color: rgba(34, 211, 238, 0.28);
}

.timetable-event--counsel {
  background: color-mix(in srgb, var(--surface-elevated) 66%, #fcd34d 34%);
  border-color: rgba(251, 191, 36, 0.3);
}

.timetable-event--followup {
  background: color-mix(in srgb, var(--surface-elevated) 68%, #fca5a5 32%);
  border-color: rgba(248, 113, 113, 0.28);
}

.timetable-event--external {
  background: color-mix(in srgb, var(--surface-elevated) 68%, #c4b5fd 32%);
  border-color: rgba(167, 139, 250, 0.28);
}

.timetable-event--blocked {
  background: color-mix(in srgb, var(--surface-elevated) 72%, #94a3b8 28%);
  border-color: rgba(148, 163, 184, 0.26);
}

.timetable-event--joinable {
  box-shadow: inset 3px 0 0 rgba(22, 163, 74, 0.75);
}

.timetable-event--full {
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.98), rgba(255, 241, 242, 0.98));
  border-color: rgba(220, 38, 38, 0.42);
  box-shadow: inset 3px 0 0 rgba(220, 38, 38, 0.8), 0 6px 14px rgba(220, 38, 38, 0.12);
}

.timetable-event.timetable-event--class[class*="is-teacher-palette-"]:not(.timetable-event--cancelled) {
  background: linear-gradient(180deg, var(--teacher-event-bg-1), var(--teacher-event-bg-2));
  border-color: var(--teacher-event-border);
  box-shadow: inset 2.5px 0 0 var(--teacher-event-accent), 0 8px 18px var(--teacher-event-shadow);
}

.timetable-event.timetable-event--class.is-teacher-palette-0 { --teacher-event-bg-1: #fecaca; --teacher-event-bg-2: #fee2e2; --teacher-event-border: rgba(220, 38, 38, 0.48); --teacher-event-accent: #dc2626; --teacher-event-shadow: rgba(220, 38, 38, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-1 { --teacher-event-bg-1: #bfdbfe; --teacher-event-bg-2: #dbeafe; --teacher-event-border: rgba(37, 99, 235, 0.48); --teacher-event-accent: #2563eb; --teacher-event-shadow: rgba(37, 99, 235, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-2 { --teacher-event-bg-1: #bbf7d0; --teacher-event-bg-2: #dcfce7; --teacher-event-border: rgba(22, 163, 74, 0.48); --teacher-event-accent: #16a34a; --teacher-event-shadow: rgba(22, 163, 74, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-3 { --teacher-event-bg-1: #fde68a; --teacher-event-bg-2: #fef3c7; --teacher-event-border: rgba(217, 119, 6, 0.5); --teacher-event-accent: #d97706; --teacher-event-shadow: rgba(217, 119, 6, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-4 { --teacher-event-bg-1: #ddd6fe; --teacher-event-bg-2: #ede9fe; --teacher-event-border: rgba(124, 58, 237, 0.48); --teacher-event-accent: #7c3aed; --teacher-event-shadow: rgba(124, 58, 237, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-5 { --teacher-event-bg-1: #a5f3fc; --teacher-event-bg-2: #cffafe; --teacher-event-border: rgba(8, 145, 178, 0.5); --teacher-event-accent: #0891b2; --teacher-event-shadow: rgba(8, 145, 178, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-6 { --teacher-event-bg-1: #fbcfe8; --teacher-event-bg-2: #fce7f3; --teacher-event-border: rgba(219, 39, 119, 0.48); --teacher-event-accent: #db2777; --teacher-event-shadow: rgba(219, 39, 119, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-7 { --teacher-event-bg-1: #d9f99d; --teacher-event-bg-2: #ecfccb; --teacher-event-border: rgba(101, 163, 13, 0.5); --teacher-event-accent: #65a30d; --teacher-event-shadow: rgba(101, 163, 13, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-8 { --teacher-event-bg-1: #c7d2fe; --teacher-event-bg-2: #e0e7ff; --teacher-event-border: rgba(79, 70, 229, 0.5); --teacher-event-accent: #4f46e5; --teacher-event-shadow: rgba(79, 70, 229, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-9 { --teacher-event-bg-1: #99f6e4; --teacher-event-bg-2: #ccfbf1; --teacher-event-border: rgba(13, 148, 136, 0.5); --teacher-event-accent: #0d9488; --teacher-event-shadow: rgba(13, 148, 136, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-10 { --teacher-event-bg-1: #fed7aa; --teacher-event-bg-2: #ffedd5; --teacher-event-border: rgba(234, 88, 12, 0.5); --teacher-event-accent: #ea580c; --teacher-event-shadow: rgba(234, 88, 12, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-11 { --teacher-event-bg-1: #f5d0fe; --teacher-event-bg-2: #fae8ff; --teacher-event-border: rgba(192, 38, 211, 0.48); --teacher-event-accent: #c026d3; --teacher-event-shadow: rgba(192, 38, 211, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-12 { --teacher-event-bg-1: #bae6fd; --teacher-event-bg-2: #e0f2fe; --teacher-event-border: rgba(2, 132, 199, 0.5); --teacher-event-accent: #0284c7; --teacher-event-shadow: rgba(2, 132, 199, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-13 { --teacher-event-bg-1: #fecdd3; --teacher-event-bg-2: #ffe4e6; --teacher-event-border: rgba(225, 29, 72, 0.5); --teacher-event-accent: #e11d48; --teacher-event-shadow: rgba(225, 29, 72, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-14 { --teacher-event-bg-1: #a7f3d0; --teacher-event-bg-2: #d1fae5; --teacher-event-border: rgba(5, 150, 105, 0.5); --teacher-event-accent: #059669; --teacher-event-shadow: rgba(5, 150, 105, 0.16); }
.timetable-event.timetable-event--class.is-teacher-palette-15 { --teacher-event-bg-1: #e2e8f0; --teacher-event-bg-2: #f1f5f9; --teacher-event-border: rgba(71, 85, 105, 0.46); --teacher-event-accent: #475569; --teacher-event-shadow: rgba(71, 85, 105, 0.16); }

.timetable-event--cancelled {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.12) 0,
      rgba(220, 38, 38, 0.12) 6px,
      rgba(255, 255, 255, 0.92) 6px,
      rgba(255, 255, 255, 0.92) 12px
    );
  border: 2px solid rgba(185, 28, 28, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 8px 18px rgba(185, 28, 28, 0.14);
}

.timetable-event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  margin-bottom: 0.02rem;
}

.timetable-event-type,
.timetable-event-time {
  font-size: 0.56rem;
  color: rgba(15, 23, 42, 0.72);
  font-weight: 700;
  line-height: 1.15;
}

.timetable-event-title {
  font-size: 0.66rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 0 0 auto;
}

.timetable-event--cancelled .timetable-event-title {
  color: #991b1b;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.timetable-event-detail {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.14rem;
  font-size: 0.55rem;
  line-height: 1.2;
  color: rgba(15, 23, 42, 0.76);
}

.timetable-event-status-row,
.timetable-event-teacher-pills,
.timetable-event-student-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.16rem;
  min-width: 0;
}

.timetable-event-seat,
.timetable-event-cancelled-label,
.timetable-event-teacher-pill,
.timetable-event-student-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.15;
}

.timetable-event-seat,
.timetable-event-cancelled-label {
  padding: 0.1rem 0.26rem;
  font-size: 0.5rem;
}

.timetable-event-seat.is-open {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.24);
}

.timetable-event-seat.is-full {
  background: rgba(220, 38, 38, 0.16);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.28);
}

.timetable-event-seat.is-makeup {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.28);
}

.timetable-event-seat.is-cancelled,
.timetable-event-cancelled-label {
  background: rgba(185, 28, 28, 0.94);
  color: #fff;
  border: 1px solid rgba(127, 29, 29, 0.42);
}

.timetable-event-teacher-pill {
  padding: 0.12rem 0.35rem;
  font-size: 0.65rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #1f2937;
}

.timetable-event-teacher-pill.is-palette-0 { background: #dc2626; color: #fff; }
.timetable-event-teacher-pill.is-palette-1 { background: #2563eb; color: #fff; }
.timetable-event-teacher-pill.is-palette-2 { background: #16a34a; color: #fff; }
.timetable-event-teacher-pill.is-palette-3 { background: #d97706; color: #fff; }
.timetable-event-teacher-pill.is-palette-4 { background: #7c3aed; color: #fff; }
.timetable-event-teacher-pill.is-palette-5 { background: #0891b2; color: #fff; }
.timetable-event-teacher-pill.is-palette-6 { background: #db2777; color: #fff; }
.timetable-event-teacher-pill.is-palette-7 { background: #65a30d; color: #fff; }
.timetable-event-teacher-pill.is-palette-8 { background: #4f46e5; color: #fff; }
.timetable-event-teacher-pill.is-palette-9 { background: #0d9488; color: #fff; }
.timetable-event-teacher-pill.is-palette-10 { background: #ea580c; color: #fff; }
.timetable-event-teacher-pill.is-palette-11 { background: #c026d3; color: #fff; }
.timetable-event-teacher-pill.is-palette-12 { background: #0284c7; color: #fff; }
.timetable-event-teacher-pill.is-palette-13 { background: #e11d48; color: #fff; }
.timetable-event-teacher-pill.is-palette-14 { background: #059669; color: #fff; }
.timetable-event-teacher-pill.is-palette-15 { background: #475569; color: #fff; }

.timetable-event-student-list {
  align-content: flex-start;
}

.timetable-event-student-chip {
  padding: 0.13rem 0.3rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.86);
  font-size: 0.68rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.timetable-event-student-chip.has-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: start;
  row-gap: 0.04rem;
  min-width: 3.15rem;
  padding: 0.16rem 0.32rem 0.18rem;
  border-color: rgba(217, 119, 6, 0.22);
  background: rgba(255, 251, 235, 0.9);
}

.timetable-event-student-chip.has-note .timetable-event-student-name,
.timetable-event-student-chip.has-note .timetable-event-student-grade,
.timetable-event-student-chip.has-note .timetable-event-student-status,
.timetable-event-student-chip.has-note .timetable-event-student-note {
  margin-left: 0;
  max-width: 100%;
  line-height: 1.08;
}

.timetable-event-student-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timetable-event-student-chip:hover {
  background: rgba(255, 247, 237, 0.96);
  border-color: rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}

.timetable-event-student-chip.is-present {
  border-color: rgba(21, 128, 61, 0.95);
  background: rgba(220, 252, 231, 0.98);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.42), inset 0 0 0 1px rgba(21, 128, 61, 0.72);
}

.timetable-event-student-chip.status-absent,
.timetable-event-student-chip.status-paused,
.timetable-event-student-chip.status-exam_pause {
  background: rgba(254, 226, 226, 0.86);
  border-color: rgba(220, 38, 38, 0.18);
  color: #991b1b;
}

.timetable-event-student-chip.status-makeup {
  background: rgba(219, 234, 254, 0.86);
  border-color: rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
}

.timetable-event-student-chip.is-present.status-absent,
.timetable-event-student-chip.is-present.status-paused,
.timetable-event-student-chip.is-present.status-exam_pause,
.timetable-event-student-chip.is-present.status-makeup {
  border-color: rgba(21, 128, 61, 0.95);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.42), inset 0 0 0 1px rgba(21, 128, 61, 0.72);
}

.timetable-event-student-status {
  margin-left: 0.17rem;
  opacity: 0.76;
  font-size: 0.6rem;
}

.timetable-event-student-grade {
  margin-left: 0.17rem;
  opacity: 0.68;
  font-size: 0.6rem;
}

.timetable-event-student-note {
  width: 100%;
  min-width: 0;
  color: #92400e;
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timetable-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.08);
  color: var(--primary-700);
  font-size: 0.74rem;
  font-weight: 700;
}

.timetable-event:focus-visible {
  outline: 2px solid rgba(234, 88, 12, 0.35);
  outline-offset: 2px;
}

.timetable-event-modal-body {
  gap: 1rem;
}

.timetable-event-modal-teachers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.timetable-event-modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.timetable-event-modal-section h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--primary-700);
}

.timetable-event-modal-main {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
}

.timetable-event-modal-detail {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

#timetable-event-modal .modal.wide {
  width: min(920px, 100%);
}

.timetable-event-modal-body .profile-form {
  gap: 1.5rem;
}

.timetable-event-modal-body .profile-section {
  gap: 0.85rem;
}

.timetable-event-modal-body .profile-section-title {
  margin-bottom: 0;
}

.timetable-event-modal-body .profile-fields {
  gap: 0.9rem;
}

.timetable-event-student-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.timetable-event-students {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.timetable-event-teachers-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.timetable-event-teacher-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
  padding: 0.8rem 0.9rem;
}

.timetable-event-student-card {
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
  padding: 0.9rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.timetable-event-student-card.is-direct-edit-target {
  border-color: rgba(249, 115, 22, 0.62);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16), 0 14px 32px rgba(15, 23, 42, 0.08);
}

.timetable-event-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.timetable-student-online-field {
  justify-content: flex-end;
}

.timetable-student-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.9rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.86);
}

.timetable-event-cancel-toggle {
  box-sizing: border-box;
  width: 100%;
  height: 2.7rem;
  min-height: 0;
  padding: 0 1rem;
  border-radius: 10px;
}

.timetable-student-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #f97316;
}

.timetable-student-toggle-copy {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.timetable-student-match {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

[data-student-status-custom-wrap][hidden],
[data-student-search-results][hidden] {
  display: none !important;
}

.timetable-student-match.is-empty .timetable-student-match-copy {
  color: var(--muted);
}

.timetable-student-match-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.45rem;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.timetable-student-match-chip.is-linked {
  background: rgba(249, 115, 22, 0.14);
  color: var(--primary-700);
}

.timetable-student-match-copy {
  font-size: 0.76rem;
  color: var(--text);
  line-height: 1.35;
}

.timetable-student-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.timetable-student-search-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.timetable-student-search-select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 0.84rem;
}

.timetable-student-search-empty {
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.72);
}

.timetable-student-search-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

.timetable-student-search-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.14rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 0.8rem;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.timetable-student-search-result:hover {
  border-color: rgba(249, 115, 22, 0.32);
  background: rgba(255, 247, 237, 0.96);
  transform: translateY(-1px);
}

.timetable-student-search-result-main {
  font-size: 0.82rem;
  font-weight: 800;
}

.timetable-student-search-result-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.timetable-event-student-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.timetable-desk-rows {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.timetable-desk-row {
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) 128px 128px 72px;
  gap: 0.75rem;
  align-items: end;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
  padding: 0.9rem;
  box-sizing: border-box;
}

.timetable-day-task-rows {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.timetable-day-task-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
  padding: 0.9rem;
}

.timetable-desk-row .profile-field {
  min-width: 0;
}

.timetable-desk-field-label {
  display: inline-block;
  margin-bottom: 0.18rem;
  white-space: nowrap;
}

.timetable-desk-row-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.timetable-list-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.timetable-list-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timetable-list-scroll {
  min-height: 0;
  width: 100%;
}

.timetable-list-group {
  border: 1px solid rgba(251, 146, 60, 0.2);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  scroll-margin-top: 7.5rem;
}

.timetable-list-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.05rem;
  background:
    linear-gradient(135deg, rgba(251, 146, 60, 0.18), rgba(254, 215, 170, 0.4)),
    var(--surface-alt);
  border-bottom: 1px solid rgba(251, 146, 60, 0.16);
}

.timetable-list-group-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-700);
}

.timetable-list-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--primary-700);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.timetable-list-collapse-btn:hover .timetable-list-group-title {
  color: #c2410c;
}

.timetable-list-collapse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(251, 146, 60, 0.2);
  color: var(--primary-700);
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.timetable-list-group.is-collapsed .timetable-list-collapse-icon {
  transform: rotate(-90deg);
}

.timetable-list-group.is-collapsed .timetable-list-group-head {
  border-bottom: 0;
}

.timetable-list-group-title-btn {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.timetable-list-group-title-btn:hover {
  color: #c2410c;
}

.timetable-list-group-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.timetable-list-group-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.8rem;
  min-width: 0;
}

.timetable-list-group-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.timetable-day-meta-btn,
.timetable-desk-summary-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
  cursor: pointer;
  padding: 0.42rem 0.82rem;
  border-radius: 999px;
  max-width: min(52vw, 760px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(251, 146, 60, 0.18);
}

.timetable-day-meta-btn:hover,
.timetable-desk-summary-btn:hover {
  color: var(--primary-700);
  border-color: rgba(249, 115, 22, 0.26);
}

.timetable-day-meta-btn.is-note {
  background: rgba(255, 251, 235, 0.95);
}

.timetable-day-meta-btn.is-task {
  background: rgba(255, 255, 255, 0.95);
}

.timetable-day-meta-btn.is-empty {
  color: rgba(154, 52, 18, 0.72);
  background: rgba(255, 247, 237, 0.72);
  border-style: dashed;
}

.timetable-desk-summary-btn.is-empty {
  color: var(--muted);
  opacity: 0.72;
}

.timetable-list-table th,
.timetable-list-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.timetable-list-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
  color: var(--primary-700);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.timetable-list-empty-row {
  padding: 1rem 0.9rem;
  text-align: center;
  color: var(--muted);
}

.timetable-list-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.timetable-list-row:hover {
  background: color-mix(in srgb, var(--surface-elevated) 88%, #fdba74 12%);
}

.timetable-list-row:focus-visible {
  outline: 2px solid rgba(234, 88, 12, 0.35);
  outline-offset: -2px;
}

.timetable-list-col--overview {
  width: 18%;
}

.timetable-list-col--assignment {
  width: 12%;
}

.timetable-list-col--participants {
  width: 70%;
}

.timetable-list-overview-stack,
.timetable-list-assignment-stack {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.timetable-list-time-main {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.timetable-list-title-main {
  margin-top: 0.12rem;
  font-weight: 700;
  color: var(--text);
}

.timetable-list-title-sub,
.timetable-list-lane,
.timetable-list-teachers {
  color: var(--muted);
  font-size: 0.84rem;
}

.timetable-list-title-sub {
  margin-top: 0.12rem;
  white-space: normal;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.timetable-list-lane,
.timetable-list-teachers {
  white-space: normal;
  line-height: 1.4;
}

.timetable-list-lane {
  font-weight: 700;
  color: var(--text);
}

.timetable-list-participants {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.timetable-participant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem 0.5rem;
}

.timetable-participant-card {
  min-width: 0;
  border: 1px solid rgba(251, 146, 60, 0.16);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.42rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.timetable-participant-card:hover,
.timetable-participant-card:focus-visible {
  border-color: rgba(249, 115, 22, 0.34);
  background: rgba(255, 247, 237, 0.96);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  outline: none;
  transform: translateY(-1px);
}

.timetable-participant-card.is-present {
  border-color: rgba(21, 128, 61, 0.95);
  background: rgba(220, 252, 231, 0.98);
  box-shadow: inset 4px 0 0 rgba(21, 128, 61, 0.95), 0 0 0 2px rgba(22, 163, 74, 0.32), 0 8px 18px rgba(22, 163, 74, 0.12);
}

.timetable-participant-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  word-break: keep-all;
}

.timetable-participant-meta {
  margin-top: 0.16rem;
  font-size: 0.74rem;
  line-height: 1.42;
  color: var(--muted);
  word-break: keep-all;
  white-space: normal;
}

.timetable-participant-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
  margin-top: 0.24rem;
}

.timetable-participant-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.timetable-participant-badge.is-status {
  background: rgba(249, 115, 22, 0.14);
  color: var(--primary-700);
}

.timetable-participant-badge.is-online {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.timetable-participant-badge.is-offline {
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
}

.timetable-participant-time {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.timetable-participant-note {
  margin-top: 0.22rem;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--muted);
  white-space: normal;
}

.timetable-participant-empty {
  font-size: 0.84rem;
  color: var(--muted);
}

.timetable-joinable-table th,
.timetable-joinable-table td {
  vertical-align: middle;
}

.timetable-joinable-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0.65rem 0 0.75rem;
  padding: 0 0.9rem;
}

.timetable-joinable-filter-btn {
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 0.46rem 0.78rem;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.timetable-joinable-filter-btn.is-active {
  border-color: rgba(249, 115, 22, 0.82);
  background: #fff7ed;
  color: #c2410c;
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.14);
}

.timetable-joinable-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.95rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
}

.timetable-joinable-summary-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.9rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.86rem;
  line-height: 1.25;
}

.timetable-joinable-summary-day {
  color: var(--primary-700);
  font-weight: 900;
}

.timetable-joinable-summary-times {
  color: var(--text);
  font-weight: 800;
}

.timetable-joinable-weekday-title {
  cursor: default;
}

.timetable-joinable-col--count {
  width: 9%;
  min-width: 86px;
}

.timetable-joinable-count {
  text-align: center;
  white-space: nowrap;
}

.timetable-joinable-seat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 28px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-weight: 800;
  font-size: 0.78rem;
}

.timetable-joinable-seat.is-blocked {
  background: rgba(220, 38, 38, 0.14);
  color: #991b1b;
}

.timetable-joinable-seat.is-open {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.timetable-joinable-left {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
}

.timetable-joinable-left.is-makeup {
  color: #1d4ed8;
}

.timetable-joinable-registered {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.timetable-table--day .timetable-cell,
.timetable-table--day .timetable-lane-head {
  min-width: 7rem;
  width: 7rem;
  max-width: 7rem;
}

.timetable-table--day .timetable-cell--day-start {
  border-left: 0;
}

.timetable-table--day .timetable-cell--day-end {
  border-right: 1px solid var(--border);
}

.timetable-table--day .timetable-lane-head-inner.is-day-start,
.timetable-table--day .timetable-lane-head-inner.is-day-end {
  border-left: 0;
  border-right: 0;
}

.timetable-table--day .timetable-event {
  justify-content: flex-start;
  min-height: 100%;
}

.timetable-table--day .timetable-event-title {
  font-size: 0.76rem;
  -webkit-line-clamp: 2;
}

:root[data-theme="dark"] .timetable-select-shell {
  background: linear-gradient(180deg, rgba(19, 32, 49, 0.96), rgba(15, 23, 42, 0.98));
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.34);
}

:root[data-theme="dark"] .timetable-view-toggle {
  background: linear-gradient(180deg, rgba(19, 32, 49, 0.96), rgba(15, 23, 42, 0.98));
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.34);
}

:root[data-theme="dark"] .timetable-week-btn {
  background: linear-gradient(180deg, rgba(26, 38, 56, 0.98), rgba(19, 32, 49, 0.98));
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.2);
}

:root[data-theme="dark"] .timetable-week-btn.is-active {
  background: linear-gradient(180deg, rgba(84, 44, 14, 0.94), rgba(41, 29, 24, 0.98));
  border-color: rgba(251, 146, 60, 0.28);
}

:root[data-theme="dark"] .timetable-day-head {
  background: linear-gradient(180deg, rgba(26, 38, 56, 0.98), rgba(19, 32, 49, 0.98)) !important;
}

:root[data-theme="dark"] .timetable-day-summary {
  background: linear-gradient(180deg, rgba(26, 38, 56, 0.98), rgba(19, 32, 49, 0.98));
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme="dark"] .timetable-day-tab {
  background: rgba(23, 35, 52, 0.98);
  border-color: rgba(148, 163, 184, 0.14);
  color: var(--muted);
}

:root[data-theme="dark"] .timetable-day-tab.is-active {
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.98), rgba(34, 49, 70, 0.98));
  border-color: rgba(251, 146, 60, 0.24);
  color: #ffd4b0;
  box-shadow: 0 16px 26px rgba(2, 6, 23, 0.24);
}

:root[data-theme="dark"] .timetable-day-tab-date {
  color: rgba(226, 232, 240, 0.62);
}

:root[data-theme="dark"] .timetable-day-tab.is-active .timetable-day-tab-date {
  color: rgba(253, 186, 116, 0.92);
}

:root[data-theme="dark"] .timetable-date-badge-main {
  color: #fed7aa;
}

:root[data-theme="dark"] .timetable-date-badge-weekday {
  color: #fdba74;
}

:root[data-theme="dark"] .timetable-date-badge-year {
  color: rgba(203, 213, 225, 0.72);
}

:root[data-theme="dark"] .timetable-lane-head-inner.is-alt,
:root[data-theme="dark"] .timetable-cell--alt {
  background: rgba(24, 38, 56, 0.96);
}

:root[data-theme="dark"] .timetable-cell {
  background: #162334;
}

:root[data-theme="dark"] .timetable-cell--empty {
  background: rgba(22, 35, 52, 0.82);
}

:root[data-theme="dark"] .timetable-cell--empty:hover .timetable-empty-cell-action,
:root[data-theme="dark"] .timetable-empty-cell-action:focus-visible {
  border-color: rgba(251, 146, 60, 0.38);
  background: rgba(67, 56, 202, 0.16);
  color: #fed7aa;
}

:root[data-theme="dark"] .timetable-event {
  background: linear-gradient(180deg, rgba(41, 72, 105, 0.92), rgba(28, 55, 85, 0.96));
  border-color: rgba(125, 176, 240, 0.3);
  box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.08);
}

:root[data-theme="dark"] .timetable-event-type,
:root[data-theme="dark"] .timetable-event-time {
  color: rgba(241, 245, 249, 0.82);
}

:root[data-theme="dark"] .timetable-event-detail,
:root[data-theme="dark"] .timetable-event-teachers {
  color: rgba(226, 232, 240, 0.82);
}

:root[data-theme="dark"] .timetable-event--class {
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.88), rgba(21, 94, 117, 0.94));
  border-color: rgba(103, 232, 249, 0.26);
}

:root[data-theme="dark"] .timetable-event--counsel {
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.9), rgba(120, 53, 15, 0.95));
  border-color: rgba(251, 191, 36, 0.28);
}

:root[data-theme="dark"] .timetable-event--followup {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.9), rgba(96, 24, 27, 0.95));
  border-color: rgba(248, 113, 113, 0.28);
}

:root[data-theme="dark"] .timetable-event--external {
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.9), rgba(76, 29, 149, 0.95));
  border-color: rgba(196, 181, 253, 0.28);
}

:root[data-theme="dark"] .timetable-event--blocked {
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.92), rgba(30, 41, 59, 0.96));
  border-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme="dark"] .timetable-event--joinable {
  box-shadow: inset 3px 0 0 rgba(74, 222, 128, 0.78);
}

:root[data-theme="dark"] .timetable-event--full {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.92), rgba(69, 10, 10, 0.96));
  border-color: rgba(248, 113, 113, 0.42);
  box-shadow: inset 3px 0 0 rgba(248, 113, 113, 0.82), 0 10px 18px rgba(2, 6, 23, 0.24);
}

:root[data-theme="dark"] .timetable-event.timetable-event--class[class*="is-teacher-palette-"]:not(.timetable-event--cancelled) {
  background: linear-gradient(180deg, var(--teacher-event-dark-bg-1), var(--teacher-event-dark-bg-2));
  border-color: var(--teacher-event-dark-border);
  box-shadow: inset 2.5px 0 0 var(--teacher-event-dark-accent), 0 10px 18px rgba(2, 6, 23, 0.24);
}

:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-0 { --teacher-event-dark-bg-1: rgba(127, 29, 29, 0.94); --teacher-event-dark-bg-2: rgba(69, 10, 10, 0.98); --teacher-event-dark-border: rgba(248, 113, 113, 0.48); --teacher-event-dark-accent: #f87171; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-1 { --teacher-event-dark-bg-1: rgba(30, 64, 175, 0.94); --teacher-event-dark-bg-2: rgba(30, 58, 138, 0.98); --teacher-event-dark-border: rgba(96, 165, 250, 0.5); --teacher-event-dark-accent: #60a5fa; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-2 { --teacher-event-dark-bg-1: rgba(22, 101, 52, 0.94); --teacher-event-dark-bg-2: rgba(20, 83, 45, 0.98); --teacher-event-dark-border: rgba(74, 222, 128, 0.48); --teacher-event-dark-accent: #4ade80; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-3 { --teacher-event-dark-bg-1: rgba(146, 64, 14, 0.94); --teacher-event-dark-bg-2: rgba(120, 53, 15, 0.98); --teacher-event-dark-border: rgba(251, 191, 36, 0.48); --teacher-event-dark-accent: #fbbf24; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-4 { --teacher-event-dark-bg-1: rgba(91, 33, 182, 0.94); --teacher-event-dark-bg-2: rgba(76, 29, 149, 0.98); --teacher-event-dark-border: rgba(196, 181, 253, 0.48); --teacher-event-dark-accent: #c4b5fd; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-5 { --teacher-event-dark-bg-1: rgba(21, 94, 117, 0.94); --teacher-event-dark-bg-2: rgba(22, 78, 99, 0.98); --teacher-event-dark-border: rgba(103, 232, 249, 0.48); --teacher-event-dark-accent: #67e8f9; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-6 { --teacher-event-dark-bg-1: rgba(157, 23, 77, 0.94); --teacher-event-dark-bg-2: rgba(131, 24, 67, 0.98); --teacher-event-dark-border: rgba(244, 114, 182, 0.48); --teacher-event-dark-accent: #f472b6; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-7 { --teacher-event-dark-bg-1: rgba(77, 124, 15, 0.94); --teacher-event-dark-bg-2: rgba(63, 98, 18, 0.98); --teacher-event-dark-border: rgba(190, 242, 100, 0.48); --teacher-event-dark-accent: #bef264; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-8 { --teacher-event-dark-bg-1: rgba(67, 56, 202, 0.94); --teacher-event-dark-bg-2: rgba(55, 48, 163, 0.98); --teacher-event-dark-border: rgba(165, 180, 252, 0.48); --teacher-event-dark-accent: #a5b4fc; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-9 { --teacher-event-dark-bg-1: rgba(15, 118, 110, 0.94); --teacher-event-dark-bg-2: rgba(17, 94, 89, 0.98); --teacher-event-dark-border: rgba(94, 234, 212, 0.48); --teacher-event-dark-accent: #5eead4; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-10 { --teacher-event-dark-bg-1: rgba(194, 65, 12, 0.94); --teacher-event-dark-bg-2: rgba(154, 52, 18, 0.98); --teacher-event-dark-border: rgba(251, 146, 60, 0.5); --teacher-event-dark-accent: #fb923c; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-11 { --teacher-event-dark-bg-1: rgba(162, 28, 175, 0.94); --teacher-event-dark-bg-2: rgba(134, 25, 143, 0.98); --teacher-event-dark-border: rgba(240, 171, 252, 0.48); --teacher-event-dark-accent: #f0abfc; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-12 { --teacher-event-dark-bg-1: rgba(3, 105, 161, 0.94); --teacher-event-dark-bg-2: rgba(7, 89, 133, 0.98); --teacher-event-dark-border: rgba(125, 211, 252, 0.48); --teacher-event-dark-accent: #7dd3fc; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-13 { --teacher-event-dark-bg-1: rgba(190, 18, 60, 0.94); --teacher-event-dark-bg-2: rgba(159, 18, 57, 0.98); --teacher-event-dark-border: rgba(251, 113, 133, 0.48); --teacher-event-dark-accent: #fb7185; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-14 { --teacher-event-dark-bg-1: rgba(4, 120, 87, 0.94); --teacher-event-dark-bg-2: rgba(6, 95, 70, 0.98); --teacher-event-dark-border: rgba(110, 231, 183, 0.48); --teacher-event-dark-accent: #6ee7b7; }
:root[data-theme="dark"] .timetable-event.timetable-event--class.is-teacher-palette-15 { --teacher-event-dark-bg-1: rgba(51, 65, 85, 0.94); --teacher-event-dark-bg-2: rgba(30, 41, 59, 0.98); --teacher-event-dark-border: rgba(203, 213, 225, 0.42); --teacher-event-dark-accent: #cbd5e1; }

:root[data-theme="dark"] .timetable-event--cancelled {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(248, 113, 113, 0.18) 0,
      rgba(248, 113, 113, 0.18) 6px,
      rgba(69, 10, 10, 0.92) 6px,
      rgba(69, 10, 10, 0.92) 12px
    );
  border-color: rgba(248, 113, 113, 0.68);
  box-shadow: inset 0 0 0 1px rgba(254, 202, 202, 0.08), 0 10px 18px rgba(2, 6, 23, 0.28);
}

:root[data-theme="dark"] .timetable-event--cancelled .timetable-event-title {
  color: #fecaca;
}

:root[data-theme="dark"] .timetable-event-seat.is-open {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.24);
}

:root[data-theme="dark"] .timetable-event-seat.is-full {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.3);
}

:root[data-theme="dark"] .timetable-event-seat.is-makeup {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.3);
}

:root[data-theme="dark"] .timetable-event-seat.is-cancelled,
:root[data-theme="dark"] .timetable-event-cancelled-label {
  background: rgba(248, 113, 113, 0.9);
  color: #450a0a;
  border-color: rgba(254, 202, 202, 0.28);
}

:root[data-theme="dark"] .timetable-event-teacher-pill {
  border-color: rgba(226, 232, 240, 0.12);
  color: #0f172a;
}

:root[data-theme="dark"] .timetable-event-student-chip {
  background: rgba(15, 23, 42, 0.42);
  border-color: rgba(226, 232, 240, 0.12);
  color: rgba(248, 250, 252, 0.92);
}

:root[data-theme="dark"] .timetable-event-student-chip.has-note {
  background: rgba(120, 53, 15, 0.48);
  border-color: rgba(251, 191, 36, 0.28);
}

:root[data-theme="dark"] .timetable-event-student-chip:hover {
  background: rgba(51, 65, 85, 0.74);
  border-color: rgba(251, 146, 60, 0.36);
}

:root[data-theme="dark"] .timetable-event-student-chip.is-present {
  background: rgba(20, 83, 45, 0.82);
  border-color: rgba(134, 239, 172, 0.95);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.45), inset 0 0 0 1px rgba(134, 239, 172, 0.72);
}

:root[data-theme="dark"] .timetable-event-student-note {
  color: #fde68a;
}

:root[data-theme="dark"] .timetable-event-student-chip.status-absent,
:root[data-theme="dark"] .timetable-event-student-chip.status-paused,
:root[data-theme="dark"] .timetable-event-student-chip.status-exam_pause {
  background: rgba(127, 29, 29, 0.58);
  border-color: rgba(248, 113, 113, 0.24);
  color: #fecaca;
}

:root[data-theme="dark"] .timetable-event-student-chip.status-makeup {
  background: rgba(30, 64, 175, 0.52);
  border-color: rgba(96, 165, 250, 0.24);
  color: #dbeafe;
}

:root[data-theme="dark"] .timetable-event-student-chip.is-present.status-absent,
:root[data-theme="dark"] .timetable-event-student-chip.is-present.status-paused,
:root[data-theme="dark"] .timetable-event-student-chip.is-present.status-exam_pause,
:root[data-theme="dark"] .timetable-event-student-chip.is-present.status-makeup {
  border-color: rgba(134, 239, 172, 0.95);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.45), inset 0 0 0 1px rgba(134, 239, 172, 0.72);
}

:root[data-theme="dark"] .timetable-event-student-card {
  background: linear-gradient(180deg, rgba(26, 38, 56, 0.98), rgba(19, 32, 49, 0.98));
  border-color: rgba(249, 115, 22, 0.18);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
}

:root[data-theme="dark"] .timetable-event-student-card.is-direct-edit-target {
  border-color: rgba(251, 146, 60, 0.66);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.18), 0 16px 34px rgba(2, 6, 23, 0.32);
}

:root[data-theme="dark"] .timetable-event-teacher-row,
:root[data-theme="dark"] .timetable-desk-row,
:root[data-theme="dark"] .timetable-day-task-row {
  background: linear-gradient(180deg, rgba(26, 38, 56, 0.98), rgba(19, 32, 49, 0.98));
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.16);
}

:root[data-theme="dark"] .timetable-student-toggle {
  background: rgba(19, 32, 49, 0.96);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.04);
}

:root[data-theme="dark"] .timetable-student-toggle input[type="checkbox"] {
  accent-color: #fb923c;
}

:root[data-theme="dark"] .timetable-student-toggle-copy {
  color: #dbe6f5;
}

:root[data-theme="dark"] .timetable-student-match-chip {
  background: rgba(71, 85, 105, 0.34);
  color: #dbe4f0;
}

:root[data-theme="dark"] .timetable-student-match-chip.is-linked {
  background: rgba(249, 115, 22, 0.2);
  color: #ffd4b0;
}

:root[data-theme="dark"] .timetable-student-search-result {
  background: rgba(19, 32, 49, 0.96);
  border-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme="dark"] .timetable-student-search-select {
  background: rgba(19, 32, 49, 0.96);
  border-color: rgba(148, 163, 184, 0.16);
  color: #e5edf8;
}

:root[data-theme="dark"] .timetable-student-search-empty {
  background: rgba(19, 32, 49, 0.86);
  border-color: rgba(71, 85, 105, 0.42);
}

:root[data-theme="dark"] .timetable-participant-card {
  background: rgba(15, 23, 42, 0.44);
  border-color: rgba(251, 146, 60, 0.2);
}

:root[data-theme="dark"] .timetable-participant-card:hover,
:root[data-theme="dark"] .timetable-participant-card:focus-visible {
  background: rgba(28, 39, 57, 0.98);
  border-color: rgba(251, 146, 60, 0.38);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.24);
}

:root[data-theme="dark"] .timetable-participant-card.is-present {
  background: rgba(20, 83, 45, 0.78);
  border-color: rgba(134, 239, 172, 0.95);
  box-shadow: inset 4px 0 0 rgba(134, 239, 172, 0.95), 0 0 0 2px rgba(74, 222, 128, 0.42), 0 10px 20px rgba(2, 6, 23, 0.24);
}

:root[data-theme="dark"] .timetable-joinable-seat {
  background: rgba(16, 185, 129, 0.18);
  color: #86efac;
}

:root[data-theme="dark"] .timetable-joinable-filter-btn {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
}

:root[data-theme="dark"] .timetable-joinable-filter-btn.is-active {
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(251, 146, 60, 0.78);
  color: #fed7aa;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.26);
}

:root[data-theme="dark"] .timetable-joinable-summary {
  background: rgba(15, 23, 42, 0.84);
  border-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme="dark"] .timetable-joinable-summary-row {
  background: rgba(30, 41, 59, 0.86);
}

:root[data-theme="dark"] .timetable-joinable-summary-day {
  color: #fdba74;
}

:root[data-theme="dark"] .timetable-joinable-summary-times {
  color: #e2e8f0;
}

:root[data-theme="dark"] .timetable-joinable-seat.is-blocked {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

:root[data-theme="dark"] .timetable-joinable-seat.is-open {
  background: rgba(16, 185, 129, 0.2);
  color: #86efac;
}

:root[data-theme="dark"] .timetable-joinable-left {
  color: #cbd5e1;
}

:root[data-theme="dark"] .timetable-joinable-left.is-makeup {
  color: #93c5fd;
}

:root[data-theme="dark"] .timetable-joinable-registered {
  color: #94a3b8;
}

:root[data-theme="dark"] .timetable-student-search-result:hover {
  background: rgba(28, 39, 57, 0.98);
  border-color: rgba(251, 146, 60, 0.3);
}

:root[data-theme="dark"] .timetable-list-row:hover {
  background: rgba(30, 41, 59, 0.94);
}


:root[data-theme="dark"] .timetable-list-group {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
  border-color: rgba(251, 146, 60, 0.18);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.28);
}

:root[data-theme="dark"] .timetable-list-group-head {
  background:
    linear-gradient(135deg, rgba(251, 146, 60, 0.16), rgba(180, 83, 9, 0.22)),
    var(--surface-alt);
  border-bottom-color: rgba(251, 146, 60, 0.16);
}

:root[data-theme="dark"] .timetable-list-collapse-icon {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(251, 146, 60, 0.24);
}

:root[data-theme="dark"] .timetable-day-meta-btn,
:root[data-theme="dark"] .timetable-desk-summary-btn {
  background: rgba(19, 32, 49, 0.9);
  border-color: rgba(148, 163, 184, 0.2);
  color: #c7d5e6;
  box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.04);
}

:root[data-theme="dark"] .timetable-day-meta-btn.is-note {
  background: rgba(56, 44, 22, 0.82);
  border-color: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

:root[data-theme="dark"] .timetable-day-meta-btn.is-task {
  background: rgba(19, 32, 49, 0.94);
}

:root[data-theme="dark"] .timetable-day-meta-btn.is-empty {
  color: #fdba74;
  background: rgba(67, 40, 24, 0.7);
  border-color: rgba(251, 146, 60, 0.26);
}

:root[data-theme="dark"] .timetable-day-meta-btn:hover,
:root[data-theme="dark"] .timetable-desk-summary-btn:hover {
  border-color: rgba(251, 146, 60, 0.3);
  color: #ffd4b0;
}

:root[data-theme="dark"] .timetable-desk-summary-btn.is-empty {
  color: #94a3b8;
}

:root[data-theme="dark"] .record-embed .btn.btn-dark {
  background: linear-gradient(135deg, #f59f52 0%, #ee8e35 100%);
  border-color: rgba(245, 159, 82, 0.82);
  color: #0f172a;
  box-shadow: 0 10px 20px rgba(245, 159, 82, 0.22);
}

:root[data-theme="dark"] .record-embed .btn.btn-dark:hover:not(:disabled) {
  background: linear-gradient(135deg, #f8b46f 0%, #f59f52 100%);
}

:root[data-theme="dark"] .record-embed .btn.btn-dark:disabled {
  opacity: 1;
  color: #0f172a;
}

@media (max-width: 900px) {
  .timetable-toolbar {
    width: 100%;
  }

  .timetable-select-wrap {
    min-width: 0;
    flex: 1 1 10rem;
  }

  .timetable-select-wrap.timetable-select-wrap--weeks {
    flex: 0 0 auto;
  }

  .timetable-select-wrap.timetable-select-wrap--date {
    flex: 1 1 10rem;
    min-width: 10rem;
  }

  .timetable-week-btn {
    padding-inline: 0.62rem;
  }

  #timetable-notice-preview-btn,
  #timetable-add-event-btn {
    margin-left: 0;
  }

  .timetable-notice-summary {
    grid-template-columns: 1fr;
  }

  .timetable-notice-card-main {
    grid-template-columns: 1fr;
  }

  .timetable-notice-recipient {
    text-align: left;
  }

  .timetable-participant-grid {
    grid-template-columns: 1fr;
  }

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

  .timetable-event-teacher-row {
    grid-template-columns: 1fr;
  }

  .timetable-day-task-row {
    grid-template-columns: 1fr;
  }

  .timetable-list-group-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .timetable-list-collapse-btn {
    width: 100%;
  }

  .timetable-list-group-side {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .timetable-list-group-meta {
    justify-content: flex-start;
  }

  .timetable-day-meta-btn,
  .timetable-desk-summary-btn {
    max-width: 100%;
    text-align: left;
  }

  .timetable-day-summary--board {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .timetable-board-header-side {
    width: 100%;
    align-items: stretch;
  }

  .timetable-day-tabs,
  .timetable-board-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page-root--hj-sidebar > .dashboard-layout--sidebar,
  .dashboard-layout--sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .dashboard--sidebar {
    position: static;
    top: auto;
    align-self: auto;
  }

  .page-root--hj-sidebar {
    padding: 0 0 1rem;
  }

  .hj-topbar-logo {
    padding: 0.45rem 0.75rem;
  }

  .hj-topbar-main {
    gap: 0.65rem;
    padding: 0.65rem 0.8rem 0.75rem;
  }

  .hj-topbar-info {
    gap: 0.35rem;
  }

  .hj-topbar-identity {
    gap: 0.3rem 0.5rem;
  }

  .hj-topbar-identity strong {
    font-size: 0.95rem;
  }

  .hj-topbar-identity span {
    font-size: 0.83rem;
  }

  .hj-topbar-affiliation {
    width: 100%;
  }

  .hj-topbar-meta {
    width: 100%;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
  }

  .hj-topbar-meta::-webkit-scrollbar {
    display: none;
  }

  .hj-topbar-meta-item {
    flex: 0 0 auto;
    font-size: 0.78rem;
    white-space: normal;
  }

  .hj-topbar-recents {
    gap: 0.45rem;
  }

  .hj-topbar-recents-list {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .hj-topbar-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 0.45rem;
  }

  .hj-topbar-actions .btn,
  .hj-topbar-actions .theme-toggle {
    flex: 0 0 auto;
    min-height: 2.4rem;
    padding: 0.55rem 0.9rem;
  }

  .page-root--hj-sidebar #dashboard-tabs.dashboard--sidebar,
  .page-root--hj-sidebar .dashboard-panels--sidebar {
    width: min(1120px, calc(100% - 1rem));
  }

  .tab-controls-sidebar {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.75rem;
    min-height: 0;
    padding: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(191, 90, 12, 0.08);
  }

  .tab-controls-grouped {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
  }

  .tab-controls-grouped .tab-control-group--academic,
  .tab-controls-grouped .tab-control-group--admin,
  .tab-controls-grouped .tab-control-group--util {
    flex: auto;
  }

  .tab-control-group--sidebar {
    gap: 0.4rem;
    min-width: 0;
    padding: 0.6rem 0.7rem;
    border: 1px solid rgba(249, 115, 22, 0.14);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 250, 245, 0.96), rgba(255, 255, 255, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }

  .tab-control-group--sidebar.is-collapsed {
    padding-bottom: 0.6rem;
  }

  .tab-control-heading {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    cursor: pointer;
  }

  .tab-control-group--sidebar .tab-control-title {
    width: auto;
    margin-right: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary-700);
  }

  .tab-control-heading::after {
    content: "▾";
    flex: 0 0 auto;
    font-size: 0.9rem;
    color: var(--primary-500);
    transition: transform 0.18s ease;
  }

  .tab-control-group--sidebar.is-collapsed .tab-control-heading::after {
    transform: rotate(-90deg);
  }

  .tab-control-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .tab-control-column[hidden] {
    display: none !important;
  }

  .tab-control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .tab-btn--sidebar {
    width: 100%;
    min-height: 2.85rem;
    padding: 0.58rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(249, 115, 22, 0.24);
    background: rgba(249, 115, 22, 0.08);
    color: var(--primary-700);
    font-size: 0.88rem;
  }

  .tab-btn--sidebar.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
    color: #fff;
    box-shadow: 0 8px 18px rgba(234, 88, 12, 0.22);
  }

  .dashboard-panels--sidebar {
    border-radius: 14px;
  }

  .panel-header {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0.75rem;
  }

  .tab-panel[data-panel="students"] .student-filters,
  .panel-header .branch-filter-list,
  .payment-controls,
  .manager-note-header-right {
    margin-left: 0;
  }

  .student-search-inline {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .student-search-inline input {
    width: 100%;
  }

  .student-search-inline-count {
    margin-left: 0;
  }

  .student-filters,
  .teacher-filters,
  .payment-controls,
  .manager-note-header-right {
    grid-column: 1 / -1;
    width: 100%;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
    justify-content: space-between;
    gap: 0.6rem;
  }

  .filter-group-buttons {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.1rem;
  }

  .filter-group-buttons .chip {
    flex: 0 0 auto;
  }

  .pagination {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    justify-content: stretch;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
  }

  .pagination-btn {
    min-width: 0;
    width: 100%;
    padding: 0.55rem 0.8rem;
  }

  .pagination-info {
    min-width: 4.8rem;
    white-space: nowrap;
  }

  .panel-header > .btn.primary {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .table-top-scroll {
    margin: 0 0 0.5rem;
    height: 10px;
  }

  .table-wrapper {
    min-height: 0;
    border-radius: 14px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .table-wrapper > .muted {
    min-height: 180px;
  }

  .table-wrapper table {
    width: max-content;
    min-width: 100%;
    border-radius: 14px;
  }

  .student-table th,
  .student-table td {
    overflow: visible;
    text-overflow: clip;
  }

  #students-container .student-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100%;
  }

  #students-container .student-table th,
  #students-container .student-table td {
    padding: 0.72rem 0.85rem;
  }

  #students-container .student-table th.name-cell,
  #students-container .student-table td.name-cell {
    min-width: 8.5rem;
    max-width: none;
  }

  #students-container .student-table th.grade-cell,
  #students-container .student-table td.grade-cell {
    min-width: 4.5rem;
    max-width: none;
  }

  #students-container .student-table th.school-cell,
  #students-container .student-table td.school-cell {
    min-width: 10.5rem;
    max-width: none;
  }

  #students-container .student-table th.branch-cell,
  #students-container .student-table td.branch-cell,
  #students-container .student-table th.duration-cell,
  #students-container .student-table td.duration-cell {
    min-width: 6.25rem;
    max-width: none;
  }

  #students-container .student-table th.counsel-cell,
  #students-container .student-table td.counsel-cell,
  #students-container .student-table th.resume-cell,
  #students-container .student-table td.resume-cell,
  #students-container .student-table th.lesson-schedule-cell,
  #students-container .student-table td.lesson-schedule-cell {
    min-width: 7.5rem;
    max-width: none;
  }

  #students-container .student-table th.payment-cell,
  #students-container .student-table td.payment-cell {
    min-width: 8.75rem;
    max-width: none;
  }

  :root[data-theme="dark"] .tab-controls-sidebar {
    border-color: rgba(148, 163, 184, 0.26);
    background: #0f172a;
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.34);
  }

  :root[data-theme="dark"] .tab-control-group--sidebar {
    border-color: rgba(251, 146, 60, 0.2);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  :root[data-theme="dark"] .tab-control-group--sidebar .tab-control-title {
    background: transparent;
    color: #fdba74;
  }

  :root[data-theme="dark"] .tab-control-heading::after {
    color: #fb923c;
  }

  :root[data-theme="dark"] .tab-btn--sidebar {
    border-color: rgba(251, 146, 60, 0.3);
    background: rgba(251, 146, 60, 0.14);
    color: #f8fafc;
  }

  :root[data-theme="dark"] .tab-btn--sidebar.active {
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #fff;
  }
}
