:root {
  --primary: #0284c7;
  --primary-light: #e0f2fe;
  --secondary: #475569;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  font-family: 'Pretendard', sans-serif;
}

body {
  margin: 0;
  padding: 24px 80px 24px 24px;
  background: var(--bg-main);
  color: var(--text-dark);
}

.dashboard-modern {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.03);
  padding: 20px;
}

/* ==========================================
    콕핏 2단 레이아웃 (좌: 캘린더 / 우: 포털 & 배너)
   ========================================== */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: start;
}

.dashboard-side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-widget-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.03);
}

.widget-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.side-promo-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.promo-box {
  border-radius: 12px;
  border: 1.5px dashed #cbd5e1;
  background: #f8fafc;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 120px;
  justify-content: center;
}

.promo-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.promo-title {
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  display: block;
}

.promo-desc {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.3;
  display: block;
}

/* ==========================================
   스마트 캘린더 헤더 & 뷰 전환 컨트롤
   ========================================== */
.scheduler-card {
  padding: 0 !important;
  overflow: hidden;
}

.cal-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-wrap: wrap;
  gap: 10px;
}

.cal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-period-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #bae6fd;
}

.cal-nav-buttons {
  display: flex;
  align-items: center;
  gap: 3px;
}

.cal-nav-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-nav-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.cal-nav-btn.today-btn {
  padding: 5px 10px;
  font-weight: 800;
  color: var(--primary);
  border-color: #bae6fd;
  background: #f0f9ff;
}

/* 뷰 전환 토글 (세로 타임라인 ↔ 가로 달력) */
.cal-view-switcher {
  display: flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 6px;
  gap: 2px;
}

.cal-view-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cal-view-btn:hover {
  color: #0f172a;
}

.cal-view-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.cal-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.google-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.google-sync-btn.linked {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.google-sync-btn.linked:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.google-sync-btn.unlinked {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

.google-sync-btn.unlinked:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-add-schedule {
  background: var(--primary);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.2);
}

.btn-add-schedule:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

/* ==========================================
   캘린더 이벤트 필터 토글 바
   ========================================= */
.cal-filter-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-right: 2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.cal-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.cal-filter-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.cal-filter-chip.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.cal-filter-chip.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  background: #e2e8f0;
  color: #475569;
  padding: 0 4px;
}

.dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-indicator.google { background: #10b981; }
.dot-indicator.bday { background: #f43f5e; }
.dot-indicator.sang { background: #8b5cf6; }
.dot-indicator.expiry { background: #f59e0b; }
.dot-indicator.pay { background: #0284c7; }

/* ==========================================
   세로형 타임라인 (좌측 컬럼 최적화)
   ========================================== */
.cal-vertical-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: #f8fafc;
}

.cal-timeline-day-card {
  display: grid;
  grid-template-columns: 115px 1fr;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.cal-timeline-day-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.cal-timeline-day-card.is-today {
  border: 2px solid var(--primary);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12);
  background: #ffffff;
}

.cal-day-left-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  gap: 2px;
}

.cal-timeline-day-card.is-today .cal-day-left-badge {
  background: #e0f2fe;
  border-right-color: #bae6fd;
}

.cal-day-date-number {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.cal-timeline-day-card.is-today .cal-day-date-number {
  color: var(--primary);
}

.cal-day-weekday-text {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.cal-today-pill {
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  background: var(--primary);
  padding: 1px 7px;
  border-radius: 10px;
  margin-top: 2px;
}

.cal-day-right-content {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-height: 64px;
}

.cal-v-event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
  gap: 8px;
}

.cal-v-event-item:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.cal-v-event-item.google { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.cal-v-event-item.bday { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.cal-v-event-item.sang { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.cal-v-event-item.expiry { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.cal-v-event-item.pay { background: #f0f9ff; border-color: #bae6fd; color: #075985; }

.cal-v-event-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.cal-v-event-badge {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.cal-v-event-badge.google { background: #dcfce7; color: #15803d; }
.cal-v-event-badge.bday { background: #ffe4e6; color: #be123c; }
.cal-v-event-badge.sang { background: #ede9fe; color: #6d28d9; }
.cal-v-event-badge.expiry { background: #fef3c7; color: #b45309; }
.cal-v-event-badge.pay { background: #e0f2fe; color: #0369a1; }

.cal-v-event-title {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-v-event-sub {
  font-size: 11px;
  color: #64748b;
  margin-left: 4px;
  font-weight: 500;
}

.cal-v-event-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cal-v-action-btn {
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cal-v-action-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.cal-v-empty-day {
  color: #94a3b8;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-v-quick-add-btn {
  background: transparent;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-v-quick-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f9ff;
}

/* ==========================================
   가로형 7일 주간 그리드
   ========================================== */
.cal-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 8px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-card);
  min-height: 220px;
}

.cal-cell-day {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  min-height: 180px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  transition: background 0.15s;
}

.cal-cell-day:nth-child(7n) {
  border-right: none;
}

.cal-cell-day:hover {
  background: #fcfdfe;
}

.cal-cell-day.is-today {
  background: #f0f9ff;
}

.cal-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 3px;
  border-bottom: 1px dashed #f1f5f9;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.cal-day-num.today {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.35);
}

.cal-day-weekday {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.cal-events-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
  max-height: 220px;
}

.cal-event-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  border-left: 3px solid transparent;
}

.cal-event-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  filter: brightness(0.97);
}

.cal-event-google { background: rgba(16, 185, 129, 0.12); color: #047857; border: 1px solid rgba(16, 185, 129, 0.25); border-left-color: #10b981; }
.cal-event-bday { background: rgba(244, 63, 94, 0.1); color: #be123c; border: 1px solid rgba(244, 63, 94, 0.25); border-left-color: #f43f5e; }
.cal-event-sang { background: rgba(139, 92, 246, 0.12); color: #6d28d9; border: 1px solid rgba(139, 92, 246, 0.25); border-left-color: #8b5cf6; }
.cal-event-expiry { background: rgba(245, 158, 11, 0.12); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.25); border-left-color: #f59e0b; }
.cal-event-pay { background: rgba(2, 132, 199, 0.12); color: #0369a1; border: 1px solid rgba(2, 132, 199, 0.25); border-left-color: #0284c7; }

.cal-event-more {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  padding: 2px 0;
  cursor: pointer;
}

/* ==========================================
   편의서비스 퀵 버튼
   ========================================== */
.modern-quick-grid {
  display: grid;
  gap: 8px;
}

.m-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.m-quick-btn i {
  font-size: 16px;
  color: #0284c7;
}

.m-quick-btn:hover {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
  transform: translateY(-2px);
}

/* ==========================================
   우측 원클릭 보험사 사이드바
   ========================================== */
.ins-sidebar-container {
  position: fixed;
  top: 50%;
  right: 0;
  left: auto;
  transform: translateY(-50%);
  background: #ffffff;
  box-shadow: -2px 0 15px rgba(0, 0, 0, 0.08);
  border-radius: 16px 0 0 16px;
  z-index: 9999;
  width: 55px;
  height: 80vh;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-right: none;
  display: flex;
  flex-direction: column;
}

.ins-sidebar-container:hover {
  width: 170px;
}

.ins-sidebar-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ins-sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}

.ins-sidebar-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.ins-sidebar-item {
  display: flex;
  align-items: center;
  padding: 2px 0 2px 4px;
  margin: 0 0 0 4px;
  cursor: pointer;
  text-decoration: none;
  border-radius: 8px 0 0 8px;
  transition: background 0.2s;
  color: #1e293b;
  white-space: nowrap;
}

.ins-sidebar-item:hover {
  background: #f1f5f9;
}

.ins-sidebar-logo {
  width: 45px;
  height: 45px;
  min-width: 45px;
  object-fit: contain;
  background: transparent;
  border-radius: 8px;
  padding: 0;
}

.ins-sidebar-text {
  margin-left: 12px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ins-sidebar-container:hover .ins-sidebar-text {
  opacity: 1;
  transform: translateX(0);
}

@keyframes slideDownFade {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.ins-group-title {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  background: var(--primary, #1e3a8a);
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: -0.3px;
  text-align: center;
  line-height: 20px;
  display: none;
}

.ins-sidebar-container:hover .ins-group-title { 
  display: block;
  padding: 6px 12px;
  margin: 12px 10px 6px 10px;
  animation: slideDownFade 0.3s ease forwards;
}

/* ==========================================
   모달 공통 스타일
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.45);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-content-card {
  background: #ffffff;
  border-radius: 14px;
  width: 420px;
  max-width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  animation: modalScaleIn 0.2s ease-out;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.modal-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.modal-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.modal-btn.secondary { background: #f1f5f9; color: #475569; }
.modal-btn.secondary:hover { background: #e2e8f0; }
.modal-btn.primary { background: var(--primary); color: #ffffff; }
.modal-btn.primary:hover { background: #0369a1; }
.modal-btn.danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.modal-btn.danger:hover { background: #fecaca; color: #b91c1c; }

/* ==========================================
   반응형 미디어 쿼리
   ========================================== */
@media (max-width: 1080px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
  .side-promo-wrap {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 16px;
  }
  .cal-timeline-day-card {
    grid-template-columns: 90px 1fr;
  }
  .side-promo-wrap {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   홈페이지 필수 사업자 정보 푸터 (하단 고정 정보)
   ========================================== */
.dash-footer-section {
  margin-top: 30px;
  padding: 28px 0 20px 0;
  border-top: 1px solid #e2e8f0;
  color: var(--text-muted);
}
.dash-footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 700;
}
.dash-footer-links a {
  color: var(--primary);
  text-decoration: none;
  transition: color 150ms ease;
}
.dash-footer-links a:hover {
  text-decoration: underline;
  color: #0369a1;
}
.dash-footer-links .divider {
  color: #cbd5e1;
  font-size: 11px;
}
.dash-footer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.6;
}
.dash-footer-info .info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.dash-footer-info strong {
  color: var(--text-dark);
  font-weight: 600;
  margin-right: 4px;
}
.dash-footer-copy {
  margin-top: 14px;
  font-size: 12px;
  color: #94a3b8;
}
