/* ============================================
   Admin Impersonation Banner (Teacher Impersonation Mode)
   ============================================ */
#impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #065F46 0%, #059669 50%, #10B981 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(16,185,129,0.45), 0 0 0 2px rgba(16,185,129,0.3);
  border-bottom: 2px solid #047857;
  animation: impBannerPulseTeacher 3s ease-in-out infinite;
}
@keyframes impBannerPulseTeacher {
  0%, 100% { box-shadow: 0 4px 20px rgba(16,185,129,0.45), 0 0 0 2px rgba(16,185,129,0.3); }
  50% { box-shadow: 0 4px 28px rgba(16,185,129,0.65), 0 0 0 3px rgba(16,185,129,0.5); }
}
.imp-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 24px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.imp-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.imp-banner-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.2px;
  line-height: 1.5;
}
.imp-banner-text strong {
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 1px 8px;
  border-radius: 4px;
}
.imp-banner-host-id {
  display: inline-block;
  background: rgba(0,0,0,0.2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  font-family: monospace;
}
.imp-exit-btn {
  background: #fff;
  color: #059669;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.imp-exit-btn:hover {
  background: #D1FAE5;
  border-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
@media (max-width: 768px) {
  .imp-banner-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 10px 16px;
  }
  .imp-banner-text { font-size: 12px; }
  .imp-exit-btn { width: 100%; text-align: center; }
}

.dashboard-page {
    background: #F8F8FA;
    min-height: 100vh;
}

.dashboard-page .app {
    padding: 0;
    max-width: 520px;
}

/* ===== Profile Completion Banner ===== */
.profile-banner {
    background: linear-gradient(135deg, #E1E8F0, #E8EDF4);
    padding: 12px 20px;
    border-bottom: 1px solid #C8D6E5;
}

.banner-content {
    max-width: 520px;
    margin: 0 auto;
}

.banner-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.banner-label {
    font-size: 13px;
    font-weight: 600;
    color: #152238;
}

.banner-label strong {
    color: #1A2B4C;
    font-weight: 800;
}

.banner-hint {
    font-size: 11px;
    color: #2C3E50;
}

.banner-bar {
    height: 6px;
    background: rgba(26,43,76,0.15);
    border-radius: 10px;
    overflow: hidden;
}

.banner-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #1A2B4C, #34495E);
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Header */
.dashboard-header {
    background: linear-gradient(to right, #1A2B4C, #34495E);
    padding: calc(24px + env(safe-area-inset-top)) 16px 32px;
    color: #fff;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.dashboard-header .back-btn {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    border: none;
    padding: 0;
}

.dashboard-header .back-btn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    background: rgba(255,255,255,0.25);
}

.header-action-btn svg {
    width: 20px;
    height: 20px;
}

/* 대시보드 헤더 프로필 사진 */
.dashboard-avatar-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
    cursor: pointer;
}

.dashboard-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
    border: 2.5px solid rgba(255,255,255,0.5);
}

.dashboard-avatar-placeholder {
    font-size: 28px;
    line-height: 1;
}

.dashboard-avatar-edit {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #5B2D8E;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.dashboard-avatar-edit svg {
    stroke: #fff;
}

.welcome-message {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.dashboard-header .teacher-name {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.teacher-category {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 16px;
    margin-top: -24px;
    position: relative;
    z-index: 10;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
}

.stat-icon.students {
    background: #E8EDF4;
    color: #1A2B4C;
}

.stat-icon.messages {
    background: #FEF3C7;
    color: #F59E0B;
}

.stat-icon.views {
    background: #E1E8F0;
    color: #2C3E50;
}

.stat-icon.views svg,
.stat-icon.messages svg,
.stat-icon.payout svg {
    width: 20px;
    height: 20px;
}

.stat-icon.payout {
    background: #D1FAE5;
    color: #10B981;
}

.stat-sub {
    font-size: 10px;
    color: #999999;
    margin-top: 2px;
}

/* Payout card enhanced */
.payout-card {
    position: relative;
}

.stat-value.payout-available {
    color: #1A2B4C;
    font-weight: 800;
}

.stat-sub.payout-pending {
    color: #999999;
}

.withdraw-btn {
    margin-top: 8px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #1A2B4C, #34495E);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.withdraw-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(26,43,76,0.3);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #2D1B4E;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #999999;
    font-weight: 500;
}

/* Content Section */
.dashboard-content {
    padding: 24px 16px;
}

.section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #2D1B4E;
}

.section-action {
    font-size: 13px;
    color: #1A2B4C;
    font-weight: 600;
    cursor: pointer;
}

/* Menu Cards */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.menu-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26,43,76, 0.12);
}

.menu-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.menu-icon.purple { background: #E8EDF4; }
.menu-icon.yellow { background: #FEF3C7; }
.menu-icon.green { background: #D1FAE5; }
.menu-icon.blue { background: #DBEAFE; }

.menu-label {
    font-size: 14px;
    font-weight: 600;
    color: #2D1B4E;
}

/* Student List */
.student-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.student-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.2s ease;
}

.student-card:hover {
    background: #F8F8FA;
}

.student-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A2B4C, #34495E);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

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

.student-name {
    font-size: 14px;
    font-weight: 600;
    color: #2D1B4E;
    margin-bottom: 2px;
}

.student-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.student-status.consulting {
    background: #FEF3C7;
    color: #B45309;
}

.student-status.active {
    background: #D1FAE5;
    color: #059669;
}

.chat-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #E8EDF4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1A2B4C;
    flex-shrink: 0;
}

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

/* Schedule List */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.schedule-date {
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.schedule-day {
    font-size: 22px;
    font-weight: 700;
    color: #1A2B4C;
}

.schedule-month {
    font-size: 11px;
    color: #999999;
    font-weight: 500;
}

.schedule-divider {
    width: 1px;
    height: 40px;
    background: #EDEDF0;
}

.schedule-info {
    flex: 1;
}

.schedule-time {
    font-size: 14px;
    font-weight: 600;
    color: #2D1B4E;
    margin-bottom: 2px;
}

.schedule-student {
    font-size: 12px;
    color: #999999;
}

/* Empty State */
.dashboard-page .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #F8F8FA;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.empty-icon svg {
    width: 28px;
    height: 28px;
    stroke: #C0C0C8;
    margin-bottom: 0;
}

.empty-text {
    font-size: 14px;
    color: #999999;
}

/* Login Required */
.login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.login-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #E8EDF4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-icon svg {
    width: 40px;
    height: 40px;
    stroke: #1A2B4C;
}

.login-title {
    font-size: 18px;
    font-weight: 700;
    color: #2D1B4E;
    margin-bottom: 8px;
}

.login-text {
    font-size: 14px;
    color: #999999;
    margin-bottom: 20px;
}

.login-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #1A2B4C;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: #152238;
}

/* No Teacher Profile */
.no-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.profile-select {
    width: 100%;
    max-width: 300px;
    margin-bottom: 16px;
}

.profile-select select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #EDEDF0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Pretendard', sans-serif;
    background: #fff;
}

.link-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #1A2B4C;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.link-btn:hover {
    background: #152238;
}

/* Loading (전환 시 흰색 배경) */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    background: #FFFFFF;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E8EDF4;
    border-top-color: #1A2B4C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast */
.dashboard-page .toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2D1B4E;
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.dashboard-page .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Settlement List ===== */
.settlement-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settlement-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.settlement-info {
    flex: 1;
    min-width: 0;
}

.settlement-student {
    font-size: 14px;
    font-weight: 600;
    color: #2D1B4E;
    margin-bottom: 2px;
}

.settlement-meta {
    font-size: 12px;
    color: #999999;
}

.settlement-right {
    text-align: right;
    flex-shrink: 0;
}

.settlement-amount {
    font-size: 14px;
    font-weight: 700;
    color: #2D1B4E;
    margin-bottom: 4px;
}

.settlement-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.settlement-badge.pending {
    background: #FEF3C7;
    color: #B45309;
}

.settlement-badge.available {
    background: #D1FAE5;
    color: #059669;
}

.settlement-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px 6px;
    margin-top: 4px;
}

.settlement-week-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.settlement-week-total {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.settlement-view-all {
    display: block;
    text-align: center;
    padding: 10px 0 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.settlement-view-all:hover {
    text-decoration: underline;
}

/* ===== Review List ===== */
.review-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.review-author {
    font-size: 14px;
    font-weight: 600;
    color: #2D1B4E;
}

.review-stars {
    color: #F59E0B;
    font-size: 13px;
    letter-spacing: 1px;
}

.review-comment {
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
}

.review-date {
    font-size: 11px;
    color: #999999;
    margin-top: 6px;
}

/* ===== Middle Grid (Analytics + Reviews) ===== */
.mid-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.mid-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.mid-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #2D1B4E;
    margin-bottom: 12px;
}

/* Analytics Card */
.analytics-stat-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.analytics-item {
    text-align: center;
}

.analytics-num {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #1A2B4C;
}

.analytics-label {
    font-size: 11px;
    color: #999999;
    font-weight: 500;
}

.analytics-divider {
    width: 1px;
    height: 32px;
    background: #EDEDF0;
}

.analytics-msg {
    font-size: 12px;
    color: #2C3E50;
    background: #EBF0F5;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: center;
    line-height: 1.4;
}

/* Reviews Mini Card */
.review-list-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-mini {
    border-bottom: 1px solid #F3F3F5;
    padding-bottom: 8px;
}

.review-mini:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.review-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.review-mini-name {
    font-size: 13px;
    font-weight: 600;
    color: #2D1B4E;
}

.review-mini-stars {
    font-size: 11px;
    color: #F59E0B;
}

.review-mini-text {
    font-size: 13px;
    color: #666666;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.empty-mini {
    font-size: 13px;
    color: #999999;
    text-align: center;
    padding: 20px 0;
}


/* ===== Messenger-Style Inquiry List ===== */
.inquiry-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.inquiry-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #F5F5F7;
}

.inquiry-item:last-child {
    border-bottom: none;
}

.inquiry-item:hover {
    background: #FAFAFE;
}

.inquiry-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A2B4C, #34495E);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.inquiry-body {
    flex: 1;
    min-width: 0;
}

.inquiry-name {
    font-size: 14px;
    font-weight: 600;
    color: #2D1B4E;
    margin-bottom: 2px;
}

.inquiry-msg {
    font-size: 12px;
    color: #999999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inquiry-time {
    font-size: 11px;
    color: #C0C0C8;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ===== Share Widget ===== */
.share-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #EBF0F5, #E1E8F0);
    border: 1px solid #C8D6E5;
    border-radius: 16px;
    padding: 16px;
    margin-top: 8px;
}

.share-widget-text {
    flex: 1;
}

.share-widget-title {
    font-size: 14px;
    font-weight: 700;
    color: #152238;
    margin-bottom: 2px;
}

.share-widget-desc {
    font-size: 12px;
    color: #2C3E50;
}

.share-widget-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #1A2B4C;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.2s;
}

.share-widget-btn:hover {
    background: #152238;
    transform: scale(1.03);
}

.share-widget-btn svg {
    stroke: #fff;
}

/* ===== Pro Template Recommend Styles ===== */
.pro-template-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(135deg, #F3EEFF, #E8E0FF);
    border: 1.5px solid #D4C4F7;
    border-radius: 10px;
    color: #5B2D8E;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.pro-template-btn:hover {
    background: linear-gradient(135deg, #E8DEFF, #D8D3C80FF);
    border-color: #B8A0E8;
}

.pro-template-arrow {
    margin-left: auto;
    transition: transform 0.2s;
}

.pro-template-arrow.open {
    transform: rotate(180deg);
}

.pro-template-dropdown {
    margin-top: 8px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #E2DDD4;
    border-radius: 12px;
    background: #fff;
}

.pro-template-list {
    display: flex;
    flex-direction: column;
}

.pro-template-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #EEEAE2;
}

.pro-template-item:last-child {
    border-bottom: none;
}

.pro-template-item:hover {
    background: #F8F6FF;
}

.pro-template-item.selected {
    background: #F3EEFF;
}

.pro-template-item .pro-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #D0D0DC;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.15s;
}

.pro-template-item.selected .pro-check {
    background: #5B2D8E;
    border-color: #5B2D8E;
}

.pro-template-item-text {
    flex: 1;
    min-width: 0;
}

.pro-template-item-main {
    font-size: 13px;
    font-weight: 600;
    color: #2D1B4E;
    line-height: 1.4;
}

.pro-template-item-sub {
    font-size: 11px;
    font-weight: 400;
    color: #999999;
    line-height: 1.4;
    margin-top: 2px;
}

.pro-template-selected-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pro-selected-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #F8F6FF;
    border: 1px solid #E8DEFF;
    border-radius: 10px;
}

.pro-selected-card-text {
    flex: 1;
    min-width: 0;
}

.pro-selected-card-main {
    font-size: 13px;
    font-weight: 600;
    color: #2D1B4E;
    line-height: 1.3;
}

.pro-selected-card-sub {
    font-size: 11px;
    color: #7C7C8A;
    line-height: 1.3;
    margin-top: 2px;
}

.pro-selected-card-remove {
    background: none;
    border: none;
    color: #C0C0C8;
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.pro-selected-card-remove:hover {
    color: #E53E3E;
}

/* Custom Recommend Cards (same style as pro-selected-card) */
.custom-recommend-selected-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-recommend-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #F5F5F7;
    border: 1px solid #E2E2E8;
    border-radius: 10px;
}

.custom-recommend-card-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #2D1B4E;
    line-height: 1.3;
}

.custom-recommend-card-remove {
    background: none;
    border: none;
    color: #C0C0C8;
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.custom-recommend-card-remove:hover {
    color: #E53E3E;
}

/* ===== Description Auto-fill Template Buttons ===== */
.desc-template-section {
    margin-bottom: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #FEFCE8, #FEF9C3);
    border: 1px solid #E8D5A0;
    border-radius: 12px;
}

.desc-template-label {
    font-size: 12px;
    font-weight: 600;
    color: #92400E;
    margin-bottom: 10px;
    line-height: 1.4;
}

.desc-template-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.desc-template-btn {
    padding: 8px 16px;
    border: 1.5px solid #F59E0B;
    border-radius: 20px;
    background: #fff;
    color: #B45309;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.desc-template-btn:hover {
    background: #F59E0B;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.desc-template-btn:active {
    transform: translateY(0);
}

/* ============================================
   Calendar Section
   ============================================ */
.cal-section {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.cal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.cal-month-title {
    font-size: 16px;
    font-weight: 700;
    color: #1F1F1F;
}

.cal-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.cal-nav-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #5B2D8E;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    line-height: 1;
    transition: background 0.15s;
}
.cal-nav-btn:hover { background: #F5F3FF; }

.cal-sync-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 20px;
    background: #F3F4F6;
    border: 1.5px solid #E5E7EB;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    transition: all 0.2s;
    margin-left: 4px;
    user-select: none;
    white-space: nowrap;
}
.cal-sync-chip input { display: none; }
.cal-sync-chip:has(input:checked) {
    background: #EAE1F5;
    border-color: #5B2D8E;
    color: #5B2D8E;
}
.cal-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #CFC9BE;
    flex-shrink: 0;
    transition: background 0.2s;
}
.cal-sync-chip:has(input:checked) .cal-sync-dot {
    background: #5B2D8E;
}

/* Naver Calendar Sync Button */
.cal-naver-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 20px;
    background: #F3F4F6;
    border: 1.5px solid #E5E7EB;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    transition: all 0.2s;
    margin-left: 4px;
    white-space: nowrap;
    font-family: inherit;
}
.cal-naver-btn:hover { background: #E8F9EE; border-color: #03C75A; color: #019B45; }
.cal-naver-btn.synced { background: #E8F9EE; border-color: #03C75A; color: #019B45; }
.cal-naver-btn.syncing { opacity: 0.65; cursor: default; pointer-events: none; }

.cal-personal-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 20px;
    background: #EDE9FF;
    border: 1.5px solid #C4B5FD;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #5B2D8E;
    transition: all 0.2s;
    margin-left: 4px;
    white-space: nowrap;
    font-family: inherit;
}
.cal-personal-btn:hover { background: #D8D3C86FE; border-color: #A78BFA; }

.cal-naver-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #03C75A;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.cal-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 2px;
}
.cal-day-headers span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    padding: 4px 0;
}
.cal-day-headers span:first-child { color: #EF4444; }
.cal-day-headers span:last-child { color: #3B82F6; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.cal-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 0 5px;
    min-height: 46px;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s;
}
.cal-cell:hover:not(.cal-empty) { background: #F5F3FF; }
.cal-cell.cal-empty { cursor: default; }

.cal-date-num {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 3px;
}

.cal-cell.cal-sun .cal-date-num { color: #EF4444; }
.cal-cell.cal-sat .cal-date-num { color: #3B82F6; }

/* Today: light purple bg */
.cal-cell.cal-today .cal-date-num {
    background: #EAE1F5;
    color: #5B2D8E;
    font-weight: 700;
}

/* Selected: deep purple bg, white text */
.cal-cell.cal-selected .cal-date-num {
    background: #5B2D8E;
    color: #fff !important;
    font-weight: 700;
}

/* Dots row */
.cal-dots {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 7px;
}

/* MUNIT Lesson: solid purple circle */
.cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-dot.dot-lesson { background: #5B2D8E; }
.cal-dot.dot-naver  { background: #03C75A; }

/* Manual Schedule: mint triangle */
.cal-dot-manual {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 7px solid #10B981;
    flex-shrink: 0;
}

/* Day Detail Panel */
.cal-detail-panel {
    margin-top: 14px;
    border-top: 1px solid #F3F4F6;
    padding-top: 12px;
}

.cal-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cal-detail-date {
    font-size: 14px;
    font-weight: 700;
    color: #1F1F1F;
}

.cal-add-btn {
    background: #5B2D8E;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.cal-add-btn:hover { background: #4A2474; }

.cal-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cal-event-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #FAFAFA;
    border-left: 4px solid #5B2D8E;
}
.cal-event-card.type-manual { border-left-color: #10B981; }
.cal-event-card.type-naver  { border-left-color: #03C75A; }

.cal-event-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.cal-event-body { flex: 1; min-width: 0; }

.cal-event-title {
    font-size: 13px;
    font-weight: 600;
    color: #1F1F1F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-event-time {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 2px;
}

.cal-event-note {
    font-size: 12px;
    color: #6B7280;
    margin-top: 3px;
}

.cal-event-delete {
    background: none;
    border: none;
    color: #CFC9BE;
    font-size: 15px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
    align-self: center;
}
.cal-event-delete:hover { color: #EF4444; }

.cal-detail-empty {
    text-align: center;
    color: #9CA3AF;
    font-size: 13px;
    padding: 16px 0;
}

/* Calendar Add Modal */
.cal-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
}
.cal-modal-overlay.active { display: flex; }

.cal-modal {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.cal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cal-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0;
}

.cal-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.cal-modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.cal-input {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1F1F1F;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.cal-input:focus { border-color: #5B2D8E; }

.cal-textarea { resize: none; min-height: 72px; }

.cal-time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cal-time-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-time-group label {
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    padding-left: 2px;
}

.cal-modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cal-modal-cancel {
    padding: 13px;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    background: #fff;
    color: #6B7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.cal-modal-cancel:hover { background: #F9FAFB; }

.cal-modal-save {
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: #5B2D8E;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.cal-modal-save:hover { background: #4A2474; }

/* ===== 학생 관리 CRM — 수업 내용 & 자료실 ===== */

/* 날짜 + 회차 한 줄 */
.crm-history-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.crm-hdate { flex: 1; }
.crm-session-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.crm-hsession {
    width: 60px;
    text-align: center;
}
.crm-session-unit {
    font-size: 12px;
    color: var(--text-muted, #999999);
    white-space: nowrap;
}

/* 회차 뱃지 */
.crm-session-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    background: #EDE9FF;
    color: #5B2D8E;
    margin-left: 4px;
    vertical-align: middle;
}

/* 수업 내용 아이템 */
.crm-history-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.crm-history-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.crm-history-edit {
    font-size: 11px;
    font-weight: 600;
    color: #5B2D8E;
    background: #F5F3FF;
    border: 1px solid #D8D3C86FE;
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
}
.crm-history-edit:hover { background: #EDE9FF; }

/* 수업 내용 인라인 수정 폼 */
.crm-history-edit-form {
    background: #FDFCFF;
    border: 1px solid #D8D3C86FE;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 4px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 자료실 — 파일 첨부 */
.crm-file-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #5B2D8E;
    background: #F5F3FF;
    border: 1.5px dashed #C4B5FD;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.crm-file-label:hover { background: #EDE9FF; }
.crm-file-label svg { flex-shrink: 0; }

.crm-file-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.crm-file-preview-img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #EDE9FF;
}
.crm-file-preview-video {
    width: 100%;
    max-height: 180px;
    border-radius: 8px;
}
.crm-file-name {
    font-size: 11px;
    color: #6B7280;
}

/* 자료실 아이템 (rich) */
.crm-material-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
}
.crm-material-content {
    font-size: 12px;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 4px 0;
}
.crm-mat-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #EDE9FF;
}
.crm-mat-preview-video {
    width: 100%;
    max-height: 200px;
    border-radius: 8px;
}
.crm-mat-preview-audio {
    width: 100%;
}

/* ===== Mini Upload Progress Bar (fixed bottom) ===== */
.mini-upload-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(30, 30, 40, 0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 10px 16px max(10px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}
.mini-upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mini-upload-name {
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    flex-shrink: 0;
}
.mini-upload-track {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    overflow: hidden;
}
.mini-upload-fill {
    height: 100%;
    background: linear-gradient(90deg, #6c63ff, #a78bfa);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.mini-upload-pct {
    font-size: 11px;
    color: #a78bfa;
    min-width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* ===== Optimistic Upload Item in Material List ===== */
.crm-material-uploading {
    opacity: 0.85;
    background: rgba(108, 99, 255, 0.05);
    border: 1px dashed rgba(108, 99, 255, 0.3) !important;
}
.crm-material-upload-error {
    border-color: rgba(255, 80, 80, 0.4) !important;
    background: rgba(255, 80, 80, 0.05);
}
.crm-upload-progress-wrap {
    margin: 6px 0 2px;
    height: 4px;
    background: rgba(108, 99, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}
.crm-upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6c63ff, #a78bfa);
    border-radius: 3px;
    transition: width 0.25s ease;
}
.crm-upload-status {
    font-size: 11px;
    color: var(--text-muted, #888);
    margin-top: 2px;
}
