/**
 * 스케줄/식단표 게시판 스타일
 * hayan_total - schedule mode
 */

/* ========================================
   공통 변수
======================================== */
:root {
    --schedule-primary: #2196f3;
    --schedule-primary-rgb: 33, 150, 243;
    --schedule-secondary: #4caf50;
    --schedule-border: #e5e7eb;
    --schedule-bg: #f9fafb;
    --schedule-text: #1f2937;
    --schedule-text-muted: #6b7280;
    --schedule-today-bg: #dbeafe;
    --schedule-selected-bg: #bfdbfe;
}

/* ========================================
   메인 컨테이너
======================================== */
.schedule-container {
    width: 100%;
    display: flex;
    gap: 20px;
    min-height: 600px;
    align-items: flex-start;
}

.schedule-container.weekly-mode {
    flex-direction: column;
    min-height: auto;
}

/* ========================================
   월간 달력 (좌측 80%)
======================================== */
.schedule-calendar-wrapper {
    flex: 0 0 80%;
    max-width: 80%;
}

.schedule-detail-wrapper {
    flex: 1 1 auto;
    width: calc(20% - 20px);
    max-width: calc(20% - 20px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 140px;
    align-self: flex-start;
    max-height: calc(100vh - 180px);
    overflow: hidden;
    min-height: 450px;
}

/* 달력 헤더 */
.schedule-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--schedule-bg);
    border-radius: 12px 12px 0 0;
    border: 1px solid var(--schedule-border);
    border-bottom: none;
}

.schedule-calendar-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--schedule-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.schedule-calendar-title .year {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.schedule-calendar-title .year:hover {
    background: #fff;
}

.schedule-calendar-title .month {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    color: var(--primary, #2196f3);
}

.schedule-calendar-title .month:hover {
    background: #fff;
}

.schedule-nav-btns {
    display: flex;
    gap: 8px;
}

.schedule-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--schedule-border);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--schedule-text);
    transition: all 0.2s;
}

.schedule-nav-btn:hover {
    background: var(--schedule-primary);
    border-color: var(--schedule-primary);
    color: #fff;
}

.schedule-week-info {
    font-size: 13px;
    color: var(--schedule-text-muted);
    background: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--schedule-border);
}

/* 달력 그리드 */
.schedule-calendar-grid {
    border: 1px solid var(--schedule-border);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: #fff;
}

.schedule-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--schedule-bg);
    border-bottom: 1px solid var(--schedule-border);
}

.schedule-weekday {
    padding: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--schedule-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-weekday:first-child {
    color: #ef4444;
}

.schedule-weekday:last-child {
    color: var(--schedule-primary);
}

.schedule-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* 날짜 셀 - 정사각형 비율 */
.schedule-day {
    aspect-ratio: 1 / 1;
    border-right: 1px solid var(--schedule-border);
    border-bottom: 1px solid var(--schedule-border);
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.schedule-day:nth-child(7n) {
    border-right: none;
}

.schedule-day:hover {
    background: #f3f4f6;
}

.schedule-day.other-month {
    background: #fafafa;
}

.schedule-day.other-month .schedule-day-number {
    color: #d1d5db;
}

.schedule-day.today {
    background: transparent;
}

.schedule-day.today .schedule-day-number {
    background: var(--secondary);
    color: #fff;
}

.schedule-day.selected {
    background: var(--primary-op10);
    overflow: visible;
    z-index: 5;
}

/* 선택된 날짜 테두리 효과 (before 사용) */
.schedule-day.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--primary);
    border-radius: 4px;
    pointer-events: none;
    z-index: 3;
}

.schedule-day.selected .schedule-day-number {
    background: var(--primary);
    color: #fff !important;
    position: relative;
    z-index: 2;
}

.schedule-day.today.selected {
    background: var(--secondary-op10);
}

.schedule-day.today.selected::before {
    border-color: var(--secondary);
}

.schedule-day.today.selected .schedule-day-number {
    background: var(--secondary);
    color: #fff !important;
}

/* 날짜 헤더 (날짜 숫자 + 총 N개) */
.schedule-day-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.schedule-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 14px;
    font-weight: 600;
    color: var(--schedule-text);
    border-radius: 50%;
    flex-shrink: 0;
}

.schedule-day-count {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.schedule-day:nth-child(7n+1) .schedule-day-number {
    color: #ef4444;
}

.schedule-day:nth-child(7n) .schedule-day-number {
    color: var(--schedule-primary);
}

/* 선택된 일요일/토요일 날짜 색상 (배경이 파란색이므로 흰색으로) */
.schedule-day.selected:nth-child(7n+1) .schedule-day-number,
.schedule-day.selected:nth-child(7n) .schedule-day-number {
    color: #fff !important;
}

/* 일정 아이템 (달력 내) - 스크롤 가능 */
.schedule-day-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* 스크롤바 스타일 */
.schedule-day-items::-webkit-scrollbar {
    width: 3px;
}

.schedule-day-items::-webkit-scrollbar-track {
    background: transparent;
}

.schedule-day-items::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.schedule-day-item {
    font-size: 13px;
    padding: 4px 8px 4px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    background: #f5f5f5;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 컬러 동그라미 표시 */
.schedule-day-item::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--item-color, var(--schedule-primary));
    flex-shrink: 0;
}

.schedule-day-item.has-color {
    /* 동적으로 색상 적용 - inline style로 --item-color 변수 설정 */
}

/* 선택된 날짜의 아이템 - 배경만 흰색 */
.schedule-day.selected .schedule-day-item {
    background: #fff;
}

/* ========================================
   상세 패널 (우측 20%)
======================================== */
.schedule-detail-panel {
    background: #fff;
    border: 1px solid var(--schedule-border);
    border-radius: 12px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    height: 100%;
    min-height: 0;
}

.schedule-detail-header {
    padding: 15px 20px;
    background: var(--schedule-bg);
    border-bottom: 1px solid var(--schedule-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.schedule-detail-header-info {
    flex: 1;
}

.schedule-detail-icon {
    font-size: 32px;
    order: 2;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-detail-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.schedule-detail-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--schedule-text);
    margin-bottom: 2px;
}

.schedule-detail-date {
    font-size: 12px;
    color: var(--schedule-text-muted);
}

.schedule-detail-content {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.schedule-detail-item {
    padding: 15px;
    background: var(--schedule-bg);
    border-radius: 8px;
    margin-bottom: 10px;
}

.schedule-detail-item:last-child {
    margin-bottom: 0;
}

.schedule-detail-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.schedule-detail-item-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.schedule-detail-item-label {
    font-size: 12px;
    color: var(--schedule-primary);
    font-weight: 600;
}

.schedule-detail-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--schedule-text);
    margin-bottom: 6px;
}

.schedule-detail-item-content {
    display: none; /* 내용은 표시하지 않음 - 메뉴명만 표시 */
    font-size: 13px;
    color: var(--schedule-text-muted);
    line-height: 1.6;
    white-space: pre-line;
}

.schedule-detail-item-calorie {
    margin-top: 8px;
    font-size: 12px;
    color: var(--schedule-text-muted);
    padding-top: 8px;
    border-top: 1px dashed var(--schedule-border);
}

/* 상세 패널 - 메뉴별 개별 컬러 표시 */
.schedule-detail-item-menus {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.schedule-detail-menu-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--schedule-text);
}

.schedule-detail-menu-tag .menu-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 시간대별 그룹 스타일 */
.schedule-detail-group {
    background: #fff;
    border: 1px solid var(--schedule-border);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.schedule-detail-group:last-child {
    margin-bottom: 0;
}

.schedule-detail-group-header {
    background: #f8fafc;
    padding: 8px 10px;
    border-bottom: 1px solid var(--schedule-border);
}

.schedule-detail-group-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--schedule-primary);
}

.schedule-detail-group-items {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-detail-group-calorie {
    padding: 6px 10px;
    background: #f5f5f5;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-align: right;
    border-top: 1px dashed #e5e7eb;
}

/* 개별 메뉴 아이템 (세로 정렬) */
.schedule-detail-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.schedule-detail-menu-item .menu-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.schedule-detail-menu-item .menu-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--schedule-text);
}

.schedule-detail-menu-item .menu-calorie {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
}

/* 라벨 미사용 시 단순 리스트 */
.schedule-detail-simple-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-detail-simple-list .schedule-detail-menu-item {
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid transparent;
}

.schedule-detail-simple-list .schedule-detail-menu-item:hover {
    background: #f3f4f6;
}

.schedule-detail-item-image {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 16px;
    color: var(--schedule-primary);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.schedule-detail-item-image:hover {
    opacity: 1;
}

.schedule-detail-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--schedule-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.schedule-detail-empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-detail-empty-icon img {
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}

.schedule-detail-empty-icon i {
    font-size: 48px;
    color: var(--schedule-text-muted, #999);
}

/* 상세 패널 하루 총 열량 */
.schedule-detail-total-calorie {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.schedule-detail-total-calorie-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.schedule-detail-total-calorie-value {
    text-align: right;
}

.schedule-detail-total-calorie-value .calorie-value {
    font-size: 18px;
    font-weight: 700;
    color: #374151;
}

.schedule-detail-total-calorie-value .calorie-unit {
    font-size: 11px;
    font-weight: 500;
    margin-left: 2px;
    color: #6b7280;
}

/* ========================================
   주간 달력 (식단표 스타일) - 컬럼 기반 심플 디자인
======================================== */
.schedule-weekly-wrapper {
    width: 100%;
    padding: 10px 0;
}

.schedule-weekly-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--schedule-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.schedule-weekly-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--schedule-text);
    text-align: center;
}

/* 컬럼 기반 레이아웃 */
.schedule-weekly-grid {
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid var(--schedule-border);
    border-radius: 0 0 12px 12px;
}

/* 왼쪽 라벨 컬럼 */
.schedule-weekly-labels {
    flex-shrink: 0;
    width: 70px;
    min-width: 70px;
    background: #f8fafc;
    border-right: 1px solid var(--schedule-border);
}

.schedule-weekly-label-header {
    height: auto;
    padding: 15px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--schedule-border);
    background: #f1f5f9;
}

.schedule-weekly-label-item {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 5px;
    border-bottom: 1px solid var(--schedule-border);
    background: #f8fafc;
    color: #64748b;
    font-size: 17px;
    font-weight: 600;
}

.schedule-weekly-label-item:last-child {
    border-bottom: none;
}

.schedule-weekly-label-icon {
    font-size: 28px;
    line-height: 1;
}

.schedule-weekly-label-text {
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
}

/* 날짜 컬럼들 컨테이너 */
.schedule-weekly-columns {
    display: flex;
    flex: 1;
}

/* 날짜별 컬럼 (하나의 박스) */
.schedule-weekly-column {
    flex: 1;
    min-width: 120px;
    border-right: 1px solid var(--schedule-border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f5f5f5;
}

.schedule-weekly-column:last-child {
    border-right: none;
}

/* 컬럼 호버 - 전체 컬럼이 반응 (흰색 배경) */
.schedule-weekly-column:hover {
    background: #fff;
}

.schedule-weekly-column:hover .schedule-weekly-col-header {
    background: #fff;
}

.schedule-weekly-column:hover .schedule-weekly-col-cell {
    background: #fff;
}

/* 오늘 날짜 컬럼 - 기본으로 확대 (다른 날짜 선택 안됐을 때) */
.schedule-weekly-column.today {
    background: #fff;
    border: 2px solid var(--primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: scale(1.03);
    z-index: 10;
    position: relative;
    border-radius: 8px;
    margin: -1px;
}

.schedule-weekly-column.today .schedule-weekly-col-header {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    border-radius: 6px 6px 0 0;
}

.schedule-weekly-column.today .schedule-weekly-col-cell {
    background: #fff;
}

.schedule-weekly-column.today .schedule-weekly-col-cell:last-child {
    border-radius: 0 0 6px 6px;
}

/* 다른 날짜가 선택되었을 때 오늘 날짜는 기본 크기로 */
.schedule-weekly-grid.has-other-selection .schedule-weekly-column.today:not(.selected) {
    background: #f5f5f5;
    border: none;
    box-shadow: none;
    transform: none;
    z-index: 1;
    border-radius: 0;
    margin: 0;
    border-right: 1px solid var(--schedule-border);
}

.schedule-weekly-grid.has-other-selection .schedule-weekly-column.today:not(.selected) .schedule-weekly-col-header {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    border-radius: 0;
}

.schedule-weekly-grid.has-other-selection .schedule-weekly-column.today:not(.selected) .schedule-weekly-col-cell {
    background: #fff;
}

.schedule-weekly-grid.has-other-selection .schedule-weekly-column.today:not(.selected) .schedule-weekly-col-cell:last-child {
    border-radius: 0;
}

/* 선택된 날짜 컬럼 (오늘 제외) */
.schedule-weekly-column.selected {
    background: #fff;
    border: 2px dashed #666;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: scale(1.03);
    z-index: 10;
    position: relative;
    border-radius: 8px;
    margin: -1px;
}

.schedule-weekly-column.selected .schedule-weekly-col-header {
    background: #fff;
    border-radius: 6px 6px 0 0;
}

.schedule-weekly-column.selected .schedule-weekly-col-cell {
    background: #fff;
}

.schedule-weekly-column.selected .schedule-weekly-col-cell:last-child {
    border-radius: 0 0 6px 6px;
}

.schedule-weekly-column.selected .schedule-weekly-col-day {
    color: #666;
}

/* 오늘이 선택되었을 때는 primary 테두리 */
.schedule-weekly-column.today.selected {
    border: 2px solid var(--primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.schedule-weekly-column.today.selected .schedule-weekly-col-header {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.schedule-weekly-column.today.selected .schedule-weekly-col-day {
    color: var(--primary);
}

/* 컬럼 헤더 (날짜) */
.schedule-weekly-col-header {
    height: auto;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-bottom: 1px solid var(--schedule-border);
    background: #f5f5f5;
    transition: background 0.2s ease;
}

.schedule-weekly-col-weekday {
    font-size: 16px;
    font-weight: 500;
    color: #94a3b8;
}

.schedule-weekly-col-day {
    font-size: 28px;
    font-weight: 700;
    color: var(--schedule-text);
    line-height: 1;
}

/* 일요일/토요일 색상 */
.schedule-weekly-column.sunday .schedule-weekly-col-weekday,
.schedule-weekly-column.sunday .schedule-weekly-col-day {
    color: #ef4444;
}

.schedule-weekly-column.saturday .schedule-weekly-col-weekday,
.schedule-weekly-column.saturday .schedule-weekly-col-day {
    color: #3b82f6;
}

/* 오늘 날짜 강조 */
.schedule-weekly-column.today .schedule-weekly-col-day {
    color: var(--primary);
}

/* 컬럼 내 셀 (식사 시간대별) */
.schedule-weekly-col-cell {
    min-height: 80px;
    padding: 12px;
    border-bottom: 1px solid var(--schedule-border);
    background: #f5f5f5;
    transition: background 0.2s ease;
    position: relative;
}

.schedule-weekly-col-cell:last-child {
    border-bottom: none;
}

/* 셀 내용 - 음식명 리스트 + 총 칼로리 */
.schedule-weekly-cell-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-weekly-cell-item {
    font-size: 15px;
    font-weight: 500;
    color: var(--schedule-text);
    line-height: 1.4;
}

.schedule-weekly-cell-total-calorie {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    font-size: 13px;
    color: #f59e0b;
    font-weight: 600;
}

/* 기존 호환성 유지 */
.schedule-weekly-cell {
    position: relative;
}

.schedule-weekly-cell-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--schedule-text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.schedule-weekly-cell-content {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    white-space: pre-line;
}

.schedule-weekly-cell-calorie {
    margin-top: 4px;
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
}

.schedule-weekly-cell-image {
    display: inline-block;
    font-size: 14px;
    color: var(--schedule-primary);
    cursor: pointer;
    opacity: 0.8;
    margin-left: 6px;
    vertical-align: middle;
}

.schedule-weekly-cell-image:hover {
    opacity: 1;
}

/* 빈 셀 표시 */
.schedule-weekly-cell-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 12px;
}

/* ========================================
   주간 달력 - 기존 테이블 방식 (호환성 유지)
======================================== */
.schedule-weekly-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
    border: none;
    background: transparent;
    table-layout: fixed;
}

.schedule-weekly-table th,
.schedule-weekly-table td {
    border: none;
    padding: 0;
    vertical-align: top;
    text-align: left;
}

/* 날짜 헤더 (요일) */
.schedule-weekly-table thead th {
    background: transparent;
    font-weight: 700;
    font-size: 15px;
    color: var(--schedule-text);
    text-align: center;
    padding: 0;
    position: relative;
}

.schedule-weekly-table thead th.date-header {
    min-width: 140px;
    padding: 15px 10px;
    background: #fff;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 날짜 헤더 호버 효과 */
.schedule-weekly-table thead th.date-header:hover {
    transform: scale(1.05);
    border: 2px dashed var(--schedule-primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    z-index: 10;
}

/* 오늘 날짜 헤더 - 강조 */
.schedule-weekly-table thead th.date-header.today {
    background: #fff;
    border: 2px solid var(--schedule-primary);
    box-shadow: 0 8px 30px rgba(33, 150, 243, 0.25);
    transform: scale(1.08);
    z-index: 20;
}

.schedule-weekly-table thead th.date-header.today:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(33, 150, 243, 0.35);
}

/* 선택된 날짜 헤더 */
.schedule-weekly-table thead th.date-header.selected {
    background: var(--schedule-primary);
    color: #fff;
    border: 2px solid var(--schedule-primary);
    box-shadow: 0 8px 30px rgba(33, 150, 243, 0.3);
    transform: scale(1.08);
    z-index: 20;
}

.schedule-weekly-table thead th.date-header.selected .date-weekday,
.schedule-weekly-table thead th.date-header.selected .date-day {
    color: #fff;
}

/* 날짜 헤더 내부 구조 */
.date-header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.date-weekday {
    font-size: 14px;
    font-weight: 600;
    color: var(--schedule-text-muted);
}

.date-day {
    font-size: 28px;
    font-weight: 800;
    color: var(--schedule-text);
    line-height: 1;
}

/* 오늘 날짜 숫자 색상 */
.schedule-weekly-table thead th.date-header.today .date-day {
    color: var(--schedule-primary);
}

/* 일요일 빨강, 토요일 파랑 */
.schedule-weekly-table thead th.date-header.sunday .date-weekday,
.schedule-weekly-table thead th.date-header.sunday .date-day {
    color: #ef4444;
}

.schedule-weekly-table thead th.date-header.saturday .date-weekday,
.schedule-weekly-table thead th.date-header.saturday .date-day {
    color: var(--schedule-primary);
}

/* 선택 시 흰색으로 */
.schedule-weekly-table thead th.date-header.selected.sunday .date-weekday,
.schedule-weekly-table thead th.date-header.selected.sunday .date-day,
.schedule-weekly-table thead th.date-header.selected.saturday .date-weekday,
.schedule-weekly-table thead th.date-header.selected.saturday .date-day {
    color: #fff;
}

.schedule-weekly-table thead th.time-label-header {
    width: 100px;
    min-width: 100px;
    background: transparent;
    vertical-align: bottom;
    padding-bottom: 15px;
}

/* 시간대 라벨 (좌측) */
.schedule-weekly-table tbody th {
    background: linear-gradient(135deg, var(--schedule-primary) 0%, #1976d2 100%);
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    text-align: center;
    width: 100px;
    vertical-align: middle;
    padding: 20px 10px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.schedule-weekly-table tbody th .time-label-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.schedule-weekly-table tbody th .time-label-text {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
}

/* 식단 셀 */
.schedule-weekly-table tbody td {
    min-width: 140px;
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 셀 호버 효과 */
.schedule-weekly-table tbody td:hover {
    transform: scale(1.03);
    border: 2px dashed var(--schedule-primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    z-index: 5;
}

/* 오늘 셀 */
.schedule-weekly-table tbody td.today {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid var(--schedule-primary);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
}

/* 선택된 날짜 셀 */
.schedule-weekly-table tbody td.selected {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

/* 오늘 식단 패널 - 가로 레이아웃 */
.schedule-today-panel {
    display: flex;
    background: #f8fafc;
    border: 1px solid var(--schedule-border);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
}

.schedule-today-panel-left {
    flex-shrink: 0;
    width: 200px;
    padding: 25px 20px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.schedule-today-panel-icon {
    font-size: 60px;
    margin-bottom: 10px;
    line-height: 1;
}

.schedule-today-panel-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--schedule-text);
    margin-bottom: 5px;
}

.schedule-today-panel-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.schedule-today-panel-columns {
    flex: 1;
    display: flex;
    gap: 10px;
}

.schedule-today-panel-column {
    flex: 1;
    padding: 15px;
    background: #fff;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
}

.schedule-today-panel-column:last-child {
    /* 마지막 컬럼 */
}

.schedule-today-panel-column-header {
    font-size: calc(var(--tx-sm-size) * 1.2);
    font-weight: 700;
    color: var(--schedule-text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--schedule-border);
}

.schedule-today-panel-column-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-today-panel-column-item {
    font-size: calc(var(--tx-sm-size) * 0.9);
    color: var(--schedule-text);
    line-height: 1.5;
}

.schedule-today-panel-column-item.empty {
    color: #cbd5e1;
}

.schedule-today-panel-column-calorie {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--schedule-border);
    font-size: calc(var(--tx-sm-size) * 0.9);
    font-weight: 600;
    color: #64748b;
}

/* 기존 호환성 - 오늘 식단 요약 (구버전) */
.schedule-today-summary {
    background: #fff;
    border: 1px solid var(--schedule-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.schedule-today-summary-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--schedule-border);
}

.schedule-today-total-calorie {
    margin-left: auto;
    text-align: right;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.schedule-today-total-calorie .calorie-value {
    font-size: 22px;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.schedule-today-total-calorie .calorie-unit {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
}

.schedule-today-summary-icon {
    font-size: 40px;
}

.schedule-today-summary-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--schedule-text);
    margin: 0 0 5px 0;
}

.schedule-today-summary-info p {
    font-size: 14px;
    color: var(--schedule-text-muted);
    margin: 0;
}

.schedule-today-summary-items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.schedule-today-summary-item {
    background: var(--schedule-bg);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    position: relative;
}

.schedule-today-summary-item-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    position: relative;
}

.schedule-today-summary-item-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--schedule-primary);
}

.schedule-today-more-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.schedule-today-more-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.schedule-today-more-btn .more-dots {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    line-height: 1;
}

.schedule-today-summary-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--schedule-text);
    margin-bottom: 5px;
}

.schedule-today-summary-item-content {
    font-size: 11px;
    color: var(--schedule-text-muted);
    line-height: 1.4;
}

.schedule-today-summary-item-calorie {
    font-size: 11px;
    color: var(--schedule-text-muted);
    margin-top: 8px;
}

/* ========================================
   관리자 업로드 영역
======================================== */
.schedule-admin-upload {
    background: #fff;
    border: 1px solid var(--schedule-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.schedule-admin-upload h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--schedule-text);
    margin: 0 0 15px 0;
}

.schedule-admin-upload-info {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.schedule-admin-upload-info ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.8;
}

.schedule-admin-upload-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.schedule-admin-upload-actions input[type="file"] {
    flex: 1;
}

.schedule-admin-upload-actions .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.schedule-admin-upload-actions .btn-primary {
    background: var(--schedule-primary);
    color: #fff;
}

.schedule-admin-upload-actions .btn-primary:hover {
    background: #1976d2;
}

.schedule-admin-upload-actions .btn-secondary {
    background: #fff;
    border: 1px solid var(--schedule-border);
    color: var(--schedule-text);
}

.schedule-admin-upload-actions .btn-secondary:hover {
    background: var(--schedule-bg);
}

/* ========================================
   글쓰기 폼 - 컬러 입력
======================================== */
.form-color-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-color-picker {
    width: 50px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--schedule-border);
    border-radius: 8px;
    cursor: pointer;
}

.form-color-text {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--schedule-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
}

.form-color-preview {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--schedule-border);
}

/* 날짜 범위 입력 */
.form-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-date-range input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--schedule-border);
    border-radius: 8px;
    font-size: 14px;
}

.form-date-range .separator {
    color: var(--schedule-text-muted);
    font-size: 14px;
}

/* ========================================
   반응형
======================================== */
@media (max-width: 1200px) {
    .schedule-container {
        flex-direction: column;
    }

    .schedule-calendar-wrapper,
    .schedule-detail-wrapper {
        flex: none;
        max-width: 100%;
    }

    .schedule-detail-wrapper {
        position: static;
        max-height: none;
    }

    .schedule-detail-panel {
        max-height: 400px;
    }

    .schedule-today-summary-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* 모바일 - 상세 패널 100% */
    .schedule-detail-wrapper {
        flex: none;
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }

    /* 모바일 - 달력 헤더 년월 줄이기 */
    .schedule-calendar-title {
        font-size: 20px;
        gap: 6px;
    }

    .schedule-calendar-title .year,
    .schedule-calendar-title .month {
        padding: 4px 8px;
    }

    /* 모바일 - 요일 헤더 글씨 줄이기 */
    .schedule-weekday {
        padding: 8px 4px;
        font-size: 12px;
    }

    /* 모바일 - 날짜 셀 균등 분배 */
    .schedule-day {
        min-height: 60px;
        max-height: 80px;
        padding: 5px;
        align-items: center;
    }

    /* 모바일 - 날짜 헤더 중앙 정렬 */
    .schedule-day-header {
        justify-content: center;
        width: 100%;
    }

    .schedule-day-number {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    /* 모바일에서 상세 리스트 숨기기 */
    .schedule-day-items {
        display: none;
    }

    /* 모바일에서 컨텐츠 있음 표시 (점) */
    .schedule-day.has-schedule::after {
        content: '';
        position: absolute;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 6px;
        height: 6px;
        background: var(--schedule-primary);
        border-radius: 50%;
        z-index: 2;
    }

    .schedule-day-count {
        display: none;
    }

    .schedule-weekly-table th,
    .schedule-weekly-table td {
        padding: 8px 5px;
        font-size: 11px;
    }

    .schedule-today-summary-items {
        grid-template-columns: repeat(2, 1fr);
    }

    .schedule-today-summary-item {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .schedule-calendar-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .schedule-calendar-title {
        font-size: 16px;
    }

    /* 480px - 요일 헤더 더 작게 */
    .schedule-weekday {
        padding: 6px 2px;
        font-size: 11px;
    }

    .schedule-day {
        min-height: 50px;
        max-height: 70px;
    }

    .schedule-day-number {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .schedule-day-items {
        display: none;
    }

    .schedule-day.has-schedule::after {
        content: '';
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: 5px;
        height: 5px;
        background: var(--schedule-primary);
        border-radius: 50%;
    }

    .schedule-today-summary-items {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   이미지 팝업
======================================== */
.schedule-image-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.schedule-image-popup.active {
    opacity: 1;
    visibility: visible;
}

.schedule-image-popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.schedule-image-popup-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.schedule-image-popup-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-image-popup img {
    max-width: 80vw;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain;
}

.schedule-image-popup-close {
    position: absolute;
    top: -50px;
    right: -20px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
    z-index: 10;
}

.schedule-image-popup-close:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.1);
}

/* 이미지 네비게이션 버튼 */
.schedule-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.schedule-image-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.schedule-image-nav.prev {
    left: -70px;
}

.schedule-image-nav.next {
    right: -70px;
}

/* 이미지 캡션 */
.schedule-image-popup-caption {
    color: #fff;
    font-size: 15px;
    margin-top: 15px;
    text-align: center;
    max-width: 80%;
}

/* 이미지 카운터 */
.schedule-image-counter {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* 셀 내 이미지 버튼 - 우측 상단 고정 */
.schedule-cell-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(33, 150, 243, 0.15);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    z-index: 5;
}

.schedule-cell-image-btn:hover {
    background: rgba(33, 150, 243, 0.3);
    transform: scale(1.1);
}

/* 칼로리 텍스트와 아이콘 정렬 */
.schedule-weekly-cell-total-calorie {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    font-size: 13px;
    color: #f59e0b;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.schedule-weekly-cell-total-calorie .calorie-text {
    flex: 1;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .schedule-image-popup-content {
        max-width: 95%;
        max-height: 95%;
    }

    .schedule-image-popup img {
        max-width: 90vw;
        max-height: 60vh;
    }

    .schedule-image-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .schedule-image-nav.prev {
        left: 10px;
    }

    .schedule-image-nav.next {
        right: 10px;
    }

    .schedule-image-popup-close {
        top: -45px;
        right: 0;
    }
}

/* ========================================
   년/월 선택 팝업
======================================== */
.schedule-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

.schedule-picker-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
}

.schedule-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--schedule-border);
}

.schedule-picker-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--schedule-text);
}

.schedule-picker-close {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--schedule-text-muted);
}

.schedule-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px;
}

.schedule-picker-item {
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--schedule-text);
    transition: all 0.2s;
}

.schedule-picker-item:hover {
    background: var(--schedule-bg);
}

.schedule-picker-item.selected {
    background: var(--schedule-primary);
    color: #fff;
}

.schedule-picker-buttons {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--schedule-border);
}

.schedule-picker-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.schedule-picker-btn.secondary {
    background: var(--schedule-bg);
    color: var(--schedule-text);
}

.schedule-picker-btn.primary {
    background: var(--schedule-primary);
    color: #fff;
}

/* ========================================
   원산지/비고 패널
======================================== */
.schedule-content-panel {
    background: #fff;
    border: 1px solid var(--schedule-border);
    border-radius: 12px;
    margin-top: 20px;
    overflow: hidden;
}

.schedule-content-panel-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--schedule-border);
}

.schedule-content-panel-title {
    font-size: calc(var(--tx-sm-size) * 1.2);
    font-weight: 700;
    color: var(--schedule-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-content-panel-body {
    padding: 20px;
    min-height: 80px;
}

.schedule-content-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
}

.schedule-content-item:last-child {
    margin-bottom: 0;
}

.schedule-content-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.schedule-content-item-label {
    font-size: calc(var(--tx-sm-size) * 0.85);
    font-weight: 600;
    color: var(--schedule-primary);
    background: rgba(33, 150, 243, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

.schedule-content-item-title {
    font-size: calc(var(--tx-sm-size) * 0.9);
    font-weight: 600;
    color: var(--schedule-text);
    flex: 1;
    margin-left: 10px;
}

.schedule-content-item-body {
    font-size: calc(var(--tx-sm-size) * 0.9);
    color: #4b5563;
    line-height: 1.7;
    white-space: pre-line;
}

.schedule-content-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--tx-sm-size) * 0.85);
    font-weight: 600;
    color: var(--schedule-primary);
    background: rgba(33, 150, 243, 0.1);
    padding: 5px 12px;
    border-radius: 12px;
    flex-shrink: 0;
    min-width: 70px;
    text-align: center;
}

.schedule-content-text {
    flex: 1;
    font-size: calc(var(--tx-sm-size) * 0.9);
    color: #4b5563;
    line-height: 1.7;
}

.schedule-content-empty {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
    font-size: calc(var(--tx-sm-size) * 0.9);
}

.schedule-content-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* 반응형 */
@media (max-width: 768px) {
    .schedule-content-panel-header {
        padding: 12px 15px;
    }

    .schedule-content-panel-body {
        padding: 15px;
    }

    .schedule-content-item {
        padding: 12px;
    }
}

/* ========================================
   관리자 수정/삭제 버튼
======================================== */
.admin-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    background: transparent;
}

.admin-btn.edit-btn {
    color: #3b82f6;
}

.admin-btn.edit-btn:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.admin-btn.delete-btn {
    color: #ef4444;
}

.admin-btn.delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 주간 달력 패널 아이템 내 관리자 버튼 */
.schedule-today-panel-column-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.schedule-today-panel-column-item .menu-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.schedule-today-panel-column-item .menu-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-today-panel-column-item .admin-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.schedule-today-panel-column-item:hover .admin-actions {
    opacity: 1;
}

/* 월간 달력 상세 패널 내 관리자 버튼 */
.schedule-detail-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.schedule-detail-menu-item .menu-name {
    flex: 1;
    min-width: 0;
}

.schedule-detail-menu-item .admin-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.schedule-detail-menu-item:hover .admin-actions {
    opacity: 1;
}

/* 모바일에서는 항상 표시 */
@media (max-width: 768px) {
    .schedule-today-panel-column-item .admin-actions,
    .schedule-detail-menu-item .admin-actions {
        opacity: 1;
    }

    .admin-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* ========================================
   주간 달력 모바일 반응형
======================================== */
@media (max-width: 768px) {
    /* 주간 달력 헤더 */
    .schedule-weekly-header {
        padding: 12px 50px;
    }

    .schedule-weekly-title {
        font-size: 18px;
    }

    .schedule-weekly-header .schedule-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* 주간 달력 그리드 - 가로 스크롤 래퍼 */
    .schedule-weekly-grid {
        position: relative;
    }

    /* 스크롤 가능한 컬럼 영역 */
    .schedule-weekly-columns {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .schedule-weekly-columns::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    /* 각 컬럼 최소 너비 고정 */
    .schedule-weekly-column {
        min-width: 140px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    /* 컬럼 헤더 폰트 조정 */
    .schedule-weekly-col-header {
        padding: 10px 5px;
    }

    .schedule-weekly-col-weekday {
        font-size: 12px;
    }

    .schedule-weekly-col-day {
        font-size: 20px;
    }

    /* 셀 폰트 조정 */
    .schedule-weekly-col-cell {
        min-height: 60px;
        padding: 8px;
    }

    .schedule-weekly-cell-item {
        font-size: 12px;
    }

    .schedule-weekly-cell-total-calorie {
        font-size: 11px;
    }

    /* 라벨 영역 */
    .schedule-weekly-labels {
        width: 50px;
        min-width: 50px;
    }

    .schedule-weekly-label-header {
        padding: 10px 5px;
    }

    .schedule-weekly-label-item {
        min-height: 60px;
        padding: 6px 3px;
        font-size: 11px;
    }

    .schedule-weekly-label-icon {
        font-size: 16px;
    }

    .schedule-weekly-label-text {
        font-size: 10px;
    }
}

/* 좌우 스크롤 화살표 버튼 */
.schedule-weekly-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--schedule-border);
    border-radius: 50%;
    display: none; /* 기본 숨김 - 모바일에서만 표시 */
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--schedule-text);
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.schedule-weekly-scroll-btn:hover {
    background: var(--primary, #2196f3);
    color: #fff;
    border-color: var(--primary, #2196f3);
}

.schedule-weekly-scroll-btn.prev {
    left: 55px; /* 라벨 영역 옆 */
}

.schedule-weekly-scroll-btn.next {
    right: 5px;
}

.schedule-weekly-scroll-btn.hidden {
    opacity: 0.3;
    pointer-events: none;
}

@media (max-width: 768px) {
    .schedule-weekly-scroll-btn {
        display: flex;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .schedule-weekly-scroll-btn.prev {
        left: 52px;
    }
}

@media (max-width: 480px) {
    .schedule-weekly-title {
        font-size: 16px;
    }

    .schedule-weekly-header {
        padding: 10px 45px;
    }

    .schedule-weekly-header .schedule-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .schedule-weekly-column {
        min-width: 120px;
    }

    .schedule-weekly-col-weekday {
        font-size: 11px;
    }

    .schedule-weekly-col-day {
        font-size: 18px;
    }

    .schedule-weekly-cell-item {
        font-size: 11px;
    }

    .schedule-weekly-labels {
        width: 45px;
        min-width: 45px;
    }

    .schedule-weekly-label-text {
        font-size: 9px;
    }

    .schedule-weekly-scroll-btn {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .schedule-weekly-scroll-btn.prev {
        left: 48px;
    }
}

/* ========================================
   주간 달력 - 라벨 미사용 시 스타일
======================================== */
/* 라벨 미사용 시 라벨 컬럼 숨김 */
.schedule-weekly-grid.no-labels .schedule-weekly-labels {
    display: none;
}

/* 라벨 미사용 시 그리드 레이아웃 조정 */
.schedule-weekly-grid.no-labels {
    flex-direction: column;
}

.schedule-weekly-grid.no-labels .schedule-weekly-columns {
    width: 100%;
}

/* 통합 셀 스타일 (라벨 미사용 시) */
.schedule-weekly-col-cell-unified {
    padding: 12px;
    border-bottom: 1px solid var(--schedule-border);
    background: #f5f5f5;
    transition: background 0.2s ease;
    position: relative;
}

.schedule-weekly-col-cell-unified:last-child {
    border-bottom: none;
}

/* 컬럼 호버 시 통합 셀도 반응 */
.schedule-weekly-column:hover .schedule-weekly-col-cell-unified {
    background: #fff;
}

/* 오늘 날짜 컬럼의 통합 셀 */
.schedule-weekly-column.today .schedule-weekly-col-cell-unified {
    background: #fff;
}

/* 선택된 컬럼의 통합 셀 */
.schedule-weekly-column.selected .schedule-weekly-col-cell-unified {
    background: #fff;
}

/* 통합 셀 내 메뉴 아이템 스타일 */
.schedule-weekly-col-cell-unified .schedule-weekly-cell-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schedule-weekly-col-cell-unified .schedule-weekly-cell-item {
    font-size: 14px;
    font-weight: 500;
    color: var(--schedule-text);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 메뉴별 컬러 동그라미 */
.schedule-weekly-col-cell-unified .menu-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 통합 셀 내 총 칼로리 */
.schedule-weekly-col-cell-unified .schedule-weekly-cell-total-calorie {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    font-size: 13px;
    color: #f59e0b;
    font-weight: 600;
}

/* 통합 셀 빈 상태 */
.schedule-weekly-col-cell-unified .schedule-weekly-cell-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 13px;
}

/* 모바일 반응형 - 라벨 미사용 시 */
@media (max-width: 768px) {
    .schedule-weekly-col-cell-unified {
        padding: 8px;
    }

    .schedule-weekly-col-cell-unified .schedule-weekly-cell-item {
        font-size: 12px;
    }

    .schedule-weekly-col-cell-unified .menu-color-dot {
        width: 8px;
        height: 8px;
    }

    .schedule-weekly-col-cell-unified .schedule-weekly-cell-total-calorie {
        font-size: 11px;
    }

    /* 라벨 미사용 시 스크롤 버튼 위치 조정 */
    .schedule-weekly-grid.no-labels .schedule-weekly-scroll-btn.prev {
        left: 5px;
    }
}

@media (max-width: 480px) {
    .schedule-weekly-col-cell-unified {
        padding: 6px;
    }

    .schedule-weekly-col-cell-unified .schedule-weekly-cell-item {
        font-size: 11px;
        gap: 6px;
    }

    .schedule-weekly-col-cell-unified .menu-color-dot {
        width: 6px;
        height: 6px;
    }
}

/* ========================================
   일반 일정표 - 아코디언 스타일
======================================== */
.schedule-event-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-event-item {
    background: #fff;
    border: 1px solid var(--schedule-border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.schedule-event-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.schedule-event-item .event-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.2s ease;
}

.schedule-event-item .event-header:hover {
    background: #f5f5f5;
}

.schedule-event-item .event-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.schedule-event-item .event-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--schedule-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-event-item .event-toggle {
    flex-shrink: 0;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.schedule-event-item .event-toggle i {
    font-size: 18px;
}

.schedule-event-item.open .event-toggle {
    transform: rotate(180deg);
}

.schedule-event-item .event-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 14px;
    background: #fff;
}

.schedule-event-item.open .event-body {
    max-height: 500px;
    padding: 12px 14px;
    border-top: 1px solid var(--schedule-border);
}

.schedule-event-item .event-period {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--schedule-text-muted);
    margin-bottom: 8px;
}

.schedule-event-item .event-period i {
    font-size: 14px;
    color: var(--schedule-primary);
}

.schedule-event-item .event-content {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 8px;
}

.schedule-event-item .event-admin-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.schedule-event-item .event-admin-actions .admin-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s ease;
}

.schedule-event-item .event-admin-actions .edit-btn {
    background: #e0f2fe;
    color: #0284c7;
}

.schedule-event-item .event-admin-actions .edit-btn:hover {
    background: #bae6fd;
}

.schedule-event-item .event-admin-actions .delete-btn {
    background: #fee2e2;
    color: #dc2626;
}

.schedule-event-item .event-admin-actions .delete-btn:hover {
    background: #fecaca;
}

/* 일정 아코디언 - 반응형 */
@media (max-width: 768px) {
    .schedule-event-item .event-header {
        padding: 10px 12px;
    }

    .schedule-event-item .event-title {
        font-size: 13px;
    }

    .schedule-event-item.open .event-body {
        padding: 10px 12px;
    }
}

/* ========================================
   간략메모 스타일
======================================== */
.event-memo {
    background: #f5f5f5;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #333;
    line-height: 1.6;
    /* border-left는 인라인 스타일로 동적 컬러 적용 */
}

/* ========================================
   상세보기 버튼
======================================== */
.event-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-detail-view {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-detail-view:hover {
    background: var(--primary);
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-detail-view i {
    font-size: 14px;
}

/* ========================================
   상세보기 모달
======================================== */
.schedule-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.schedule-detail-modal.show {
    display: flex;
}

.schedule-detail-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.schedule-detail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.schedule-modal-header-info {
    flex: 1;
}

.schedule-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.schedule-modal-period {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.schedule-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.schedule-detail-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #fff;
}

/* 모달 로딩 */
.schedule-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    font-size: 15px;
    color: #6b7280;
}

.schedule-modal-loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 모달 빈 내용 */
.schedule-modal-empty,
.schedule-modal-error {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 15px;
}

/* 모달 본문 HTML 컨텐츠 */
.schedule-modal-content-html {
    line-height: 1.8;
    font-size: 15px;
    color: #374151;
}

.schedule-modal-content-html img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.schedule-modal-content-html table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.schedule-modal-content-html table th,
.schedule-modal-content-html table td {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: left;
}

.schedule-modal-content-html table th {
    background: #f9fafb;
    font-weight: 600;
}

/* 모달 반응형 */
@media (max-width: 768px) {
    .schedule-detail-modal {
        padding: 10px;
    }

    .schedule-detail-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .schedule-detail-modal-header {
        padding: 15px 20px;
    }

    .schedule-modal-title {
        font-size: 16px;
    }

    .schedule-detail-modal-body {
        padding: 20px;
    }

    .schedule-modal-content-html {
        font-size: 14px;
    }
}
