/* 기본 설정 및 초기화 */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  -webkit-tap-highlight-color: transparent; 
}

body { 
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; 
  background: #f8fafc; 
  color: #1e293b; 
  line-height: 1.5; 
  overflow-x: hidden; 
}

/* 배경 오버레이 */
.overlay { 
  display:none; 
  position:fixed; 
  inset:0; 
  background:rgba(15, 23, 42, 0.4); 
  z-index:150; 
  backdrop-filter: blur(4px); 
}
.overlay.show { 
  display:block; 
}

/* 사이드바 디자인: 화면 전체 확장 */
.sidebar {
  position:fixed; 
  top:0; 
  left:-100%; 
  width:100%; 
  height:100%;
  background:#0f172a; 
  color:#fff; 
  transition: transform 0.3s ease-in-out; 
  z-index:200; 
  padding-top:60px;
  overflow-y: auto;
}
.sidebar.open { 
  transform: translateX(100%); 
}

/* 사이드바 메뉴 리스트 */
.sidebar ul { 
  list-style:none; 
  padding-top: 10px;
}
.sidebar ul li { 
  padding:18px 24px; 
  cursor:pointer; 
  border-bottom:1px solid rgba(255,255,255,0.05); 
  font-weight: 600;
  font-size: 1rem; 
  display: flex;
  align-items: center;
  justify-content: space-between; 
  white-space: nowrap; 
}
.sidebar ul li:active {
  background: rgba(255,255,255,0.1);
}

.m-date {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: 15px;
}

/* 상단바: 사이드바보다 위에 위치하도록 z-index 상향 */
.topbar {
  position:fixed; 
  top:0; 
  left:0; 
  right:0; 
  height:60px;
  background:#0f172a; 
  color:#fff; 
  display:flex; 
  align-items:center; 
  padding:0 20px; 
  z-index:300; 
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.hamburger { background:none; border:none; color:#fff; font-size:1.8rem; cursor:pointer; margin-right:16px; }

.topbar-title { 
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
}
.t-icon { font-size: 1.2rem; }
.t-dept { font-weight: 900; letter-spacing: -0.5px; }
.t-date { font-size: 0.85rem; font-weight: 700; color: #94a3b8; margin-left: 2px; }

/* 메인 영역 */
.main { 
  margin-top:60px; 
  padding:15px; 
  max-width:600px; 
  margin-left:auto; 
  margin-right:auto; 
}

/* 요일 필터 */
.day-btns { 
  display:flex; 
  gap:6px; 
  margin-bottom: 15px; 
  overflow-x: auto; 
  padding-bottom: 5px; 
  scrollbar-width: none;
}
.day-btns::-webkit-scrollbar { display: none; }
.day-btn {
  flex: 1; 
  min-width:50px; 
  padding:10px 0; 
  border:none;
  background:#fff; 
  border-radius:12px; 
  font-size:0.9rem; 
  font-weight:800;
  color:#64748b; 
  cursor:pointer; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.day-btn.active.mon { background: #3b82f6; color: #fff; transform: translateY(-2px); }
.day-btn.active.tue { background: #10b981; color: #fff; transform: translateY(-2px); }
.day-btn.active.wed { background: #8b5cf6; color: #fff; transform: translateY(-2px); }
.day-btn.active.thu { background: #f43f5e; color: #fff; transform: translateY(-2px); }
.day-btn.active.fri { background: #f59e0b; color: #fff; transform: translateY(-2px); }
.day-btn.active.sat { background: #06b6d4; color: #fff; transform: translateY(-2px); }
.day-btn.active.sun { background: #ec4899; color: #fff; transform: translateY(-2px); }

/* 액션 버튼 */
.action-btns { 
  display:flex; 
  gap:10px; 
  margin-bottom: 15px; 
}
.btn-schedule, .btn-notice {
  flex:1; 
  padding:12px; 
  border:none; 
  border-radius:14px; 
  font-weight:900; 
  cursor:pointer; 
  color:#fff;
  font-size: 0.9rem;
  transition: transform 0.2s;
}
.btn-schedule { background: #3b82f6; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2); }
.btn-notice { background: #f59e0b; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }

/* 섹션 타이틀 */
.section-title { 
  font-size:0.95rem; 
  font-weight:900; 
  padding:8px 4px; 
  margin-top: 5px; 
  display: flex; 
  align-items: center; 
  gap: 6px; 
}
.section-title.blue { color: #3b82f6; }
.section-title.yellow { color: #f59e0b; }

/* 일정 카드 디자인 */
.item-card {
  background:#fff; 
  border-radius:12px; 
  padding:10px 14px; 
  margin-bottom:6px; 
  display:flex; 
  justify-content:space-between; 
  align-items:center; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.02); 
  transition: 0.3s;
}
.item-card.schedule-card { border-left: 4px solid #3b82f6; }
.item-card.notice-card { border-left: 4px solid #f59e0b; }

.item-card.expired, .item-card.expired-manual { opacity: 0.3 !important; }
.item-card.expired .info-row, .item-card.expired-manual .info-row { 
  text-decoration: line-through !important; 
  text-decoration-color: #ef4444 !important; 
  text-decoration-thickness: 2px !important; 
  color: #94a3b8 !important; 
}

.item-info { flex: 1; min-width: 0; }
.info-row { display: flex; align-items: center; gap: 10px; }

.compact-day-chip {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.day-월 { background: #eff6ff; color: #3b82f6; }
.day-화 { background: #ecfdf5; color: #10b981; }
.day-수 { background: #f5f3ff; color: #8b5cf6; }
.day-목 { background: #fff1f2; color: #f43f5e; }
.day-금 { background: #fffbeb; color: #f59e0b; }
.day-토 { background: #ecfeff; color: #06b6d4; }
.day-일 { background: #fdf2f8; color: #ec4899; }

.info-time { 
  color: #1e293b; 
  background: #f1f5f9; 
  padding: 1px 6px; 
  border-radius: 5px; 
  font-size: 0.85rem; 
  font-weight: 800;
  white-space: nowrap;
}
.info-content {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 관리자용 버튼 디자인 */
.btn-order { background: none; border: none; font-size: 0.7rem; color: #94a3b8; cursor: pointer; padding: 4px; }
.btn-order:active { color: #0f172a; transform: scale(1.2); }

.btn-check {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.2s;
}
.btn-check:active { transform: scale(1.3); }

/* 관리자용 버튼 그룹 */
.admin-controls { display: flex; gap: 4px; align-items: center; }
.btn-edit { background: none; border: none; font-size: 0.9rem; cursor: pointer; padding: 4px; opacity: 0.6; }
.btn-del { background:none; border:none; color:#cbd5e1; font-size:1.1rem; cursor:pointer; padding: 4px; }

.empty-msg { text-align:center; color:#94a3b8; padding:20px 0; font-size:0.9rem; font-weight: 900; }

/* 연락처 표 디자인 */
.contact-table-wrap { 
  background: #fff; 
  border-radius: 16px; 
  overflow: hidden; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
  border: 1px solid #f1f5f9; 
}
.contact-table { 
  width: 100%; 
  border-collapse: collapse; 
  table-layout: fixed; 
}
.contact-table td { 
  padding: 12px; 
  border-bottom: 1px solid #f1f5f9; 
  font-size: 0.9rem; 
  vertical-align: middle; 
  color: #1e293b; 
}

.c-no { 
  width: 40px; 
  background: #f8fafc; 
  color: #94a3b8; 
  font-weight: 900; 
  text-align: center; 
  border-right: 1px solid #f1f5f9; 
}

.row-main { background: #fff; }
.c-name-sid { display: flex; align-items: center; gap: 6px; }
.c-name { font-weight: 800; font-size: 0.9rem; }
.c-sid { color: #64748b; font-size: 0.9rem; }

.row-sub { background: #fafbfc; }
.c-contact-info { display: flex; flex-direction: column; gap: 4px; }
.c-line a { color: #3b82f6; font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.c-email-row { display: flex; justify-content: space-between; align-items: center; }
.c-email { color: #64748b; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.table-admin-btns { display: flex; gap: 8px; margin-left: 10px; }
.btn-edit-s, .btn-del-s { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: 0.7; }

/* 모달 디자인 */
.modal-bg { display:none; position:fixed; inset:0; background:rgba(15, 23, 42, 0.6); z-index:400; align-items:center; justify-content:center; backdrop-filter: blur(8px); }
.modal-bg.show { display:flex; }
.modal { background:#fff; border-radius:24px; padding:25px; width:90%; max-width:380px; display:flex; flex-direction:column; gap:12px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.modal h3 { font-size:1.2rem; color:#0f172a; font-weight: 900; text-align: center; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 800; color: #475569; }

/* 체크박스 라벨 */
.check-label { font-size: 0.85rem; font-weight: 700; color: #64748b; display: flex; align-items: center; gap: 8px; cursor: pointer; margin-top: 5px; }
.check-label input { width: 18px; height: 18px; cursor: pointer; }

/* 요일 동적 추가 UI */
.day-select-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.day-select-row select { flex: 2; }

/* 버튼 공통 */
.btn-add-day-inline { flex: 1; background: #0f172a; color: #fff; border: none; height: 48px; border-radius: 14px; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; min-width: 60px; }
.btn-remove-day { flex: 1; background: #fee2e2; color: #ef4444; border: none; height: 48px; border-radius: 14px; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; min-width: 60px; }

.modal select, .modal textarea, .modal input { padding:12px; border:2px solid #f1f5f9; border-radius:14px; font-size:1rem; font-weight: 700; background:#f8fafc; font-family: inherit; }
.modal select:focus, .modal textarea:focus, .modal input:focus { outline: none; border-color: #3b82f6; }

.modal-btns { display:flex; gap:10px; margin-top:5px; }
.btn-cancel { flex:1; padding:14px; border:none; background:#f1f5f9; color:#64748b; border-radius:14px; font-weight:800; }
.btn-save { flex:2; padding:14px; border:none; background:#0f172a; color:#fff; border-radius:14px; font-weight:900; }

.login-modal input { text-align: center; letter-spacing: 5px; }
/* 요일 체크박스 버튼 */
.day-check-btn {
  flex: 1;
  min-width: 44px;
  padding: 10px 0;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 0.9rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.day-check-btn input { display: none; }
.day-check-btn.checked-월 { background: #3b82f6; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.day-check-btn.checked-화 { background: #10b981; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.day-check-btn.checked-수 { background: #8b5cf6; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(139,92,246,0.3); }
.day-check-btn.checked-목 { background: #f43f5e; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(244,63,94,0.3); }
.day-check-btn.checked-금 { background: #f59e0b; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }
.day-check-btn.checked-토 { background: #06b6d4; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(6,182,212,0.3); }
.day-check-btn.checked-일 { background: #ec4899; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(236,72,153,0.3); }
