: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;
}

.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);
}

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%;
  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 .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);
}

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

@media (max-width: 980px) {
  .profile {
    flex-wrap: wrap;
  }

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

.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;
}

.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-control-group {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
}

.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-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@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%;
  }
}

.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.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-panels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.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 {
  position: relative;
}

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

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

.student-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 {
  display: none;
}

.student-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 {
  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;
}


.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-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-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-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);
}

.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;
}

.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-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;
}

#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;
}

#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-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;
}

/* 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;
}

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

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  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 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;
}

.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);
}

.lesson-history-item h4 {
  margin: 0 0 0.25rem 0;
}

.lesson-history-item p {
  margin: 0.2rem 0;
}

.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"] .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"] .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-control-group,
: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"] 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"] .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"] .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-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"] .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;
}
