/* ============================================================
   서포트리 영업 및 업무관리 - 밝은 연두색 테마
   ============================================================ */

:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;
  --lime-300:  #bef264;
  --lime-400:  #a3e635;
  --lime-500:  #84cc16;
  /* 남색(Navy) 텍스트 팔레트 */
  --navy-900:  #0f172a;
  --navy-800:  #1e293b;
  --navy-700:  #1d3461;
  --navy-600:  #264e86;
  --navy-500:  #2563eb;
  --text-dark:  #1e293b;   /* 남색 기본 텍스트 */
  --text-mid:   #334155;   /* 남색 중간 */
  --text-light: #64748b;   /* 남색 연한 */
  --border-color: #bbf7d0;
  --bg-page:   #ffffff;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 64px;
  --primary:   #22c55e;
  --primary-dark: #16a34a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);  /* 남색 텍스트 기본 */
  font-size: 14px;
  line-height: 1.6;
}

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0fdf4; }
::-webkit-scrollbar-thumb { background: #86efac; border-radius: 3px; }

/* ── 알림 토스트 ── */
.notification {
  animation: slideIn .3s ease;
  min-width: 240px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ── 그라디언트 배경 (로그인) ── */
.gradient-bg {
  background: #f0fdf4;
  min-height: 100vh;
}

/* ── 사이드바 레이아웃 ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  /* 흰색 계열 밝은 사이드바 */
  background: linear-gradient(180deg, #ffffff 0%, #f8fffe 40%, #f0fdf4 100%);
  color: #1e293b;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(34,197,94,.12);
  overflow-y: auto;
  transition: transform .3s ease, width .3s ease;
  border-right: 1.5px solid #bbf7d0;
}

/* ── 사이드바 접힌 상태 ── */
.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .user-info-text {
  display: none;
}

.sidebar.collapsed .sidebar-logo {
  padding: 16px 12px;
  justify-content: center;
  border-bottom: 1px solid #dcfce7;
}

.sidebar.collapsed .sidebar-logo-icon {
  width: 36px;
  height: 36px;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 8px;
}

.sidebar.collapsed .nav-item .nav-icon {
  margin: 0;
}

.sidebar.collapsed .sidebar-bottom .nav-item {
  justify-content: center;
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-w-collapsed);
}

.sidebar-toggle-btn.collapsed {
  left: calc(var(--sidebar-w-collapsed) - 14px);
}

.sidebar-logo {
  padding: 20px 16px 18px;
  border-bottom: 1px solid #dcfce7;
  display: flex;
  align-items: center;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: #f0fdf4;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid #86efac;
  box-shadow: 0 2px 8px rgba(101,163,13,.15);
}

.sidebar-logo-text {
  margin-left: 10px;
}

.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.3;
  letter-spacing: -.3px;
}

.sidebar-logo p {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
}

.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  transition: all .2s ease;
  margin-bottom: 2px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: #f0fdf4;
  color: #15803d;
}

.nav-item.active {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(101,163,13,.15);
}

.nav-item .nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: #f0fdf4;
  flex-shrink: 0;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.nav-item.active .nav-icon {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.sidebar-bottom {
  padding: 12px 10px 16px;
  border-top: 1px solid #dcfce7;
}

.user-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1.5px solid #e2e8f0;
}

.user-card .user-name {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.user-card .user-role {
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
  font-weight: 500;
}

.user-position-badge {
  font-size: 10px;
  background: #dcfce7;
  color: #15803d;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 600;
}

/* 접혔을 때 user-card 숨기고 축소된 아이콘 표시 */
.sidebar.collapsed .user-card {
  display: none;
}

/* 접혔을 때 sidebar-bottom: 아이콘 중앙 정렬, 짤림 방지 */
.sidebar.collapsed .sidebar-bottom {
  padding: 10px 4px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow: visible;
  min-width: 0;
}

.sidebar.collapsed .sidebar-bottom .nav-item {
  width: 44px;
  min-width: 44px;
  justify-content: center;
  padding: 10px 0;
  margin: 0;
  overflow: visible;
}
.sidebar-toggle-btn {
  position: fixed;
  top: 18px;
  left: calc(var(--sidebar-w) - 14px);
  width: 28px;
  height: 28px;
  background: #fff;
  border: 2px solid #86efac;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  color: #16a34a;
  font-size: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: left .3s ease;
}

.sidebar-toggle-btn:hover {
  background: #dcfce7;
  color: #15803d;
}

/* ── 모바일 메뉴 버튼 ── */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 8px;
  cursor: pointer;
  color: #15803d;
  font-size: 15px;
  flex-shrink: 0;
}

/* ── 모바일 오버레이 ── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

/* ── 메인 콘텐츠 ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 2px solid #dcfce7;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(22,163,74,.08);
}

.topbar h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-800);
  white-space: nowrap;
}

/* ── 유입경로 루트 배지 ── */
.inflow-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ecfccb, #d9f99d);
  border: 1.5px solid #a3e635;
  border-radius: 20px;
  padding: 5px 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.inflow-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #65a30d;
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.85); }
}

.page-content {
  padding: 28px;
  flex: 1;
}

/* ── 카드 ── */
.card {
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid #dcfce7;
  box-shadow: 0 2px 14px rgba(22,163,74,.07);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1.5px solid #f0fdf4;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f7fef9 0%, #f0fdf4 100%);
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-800);
  flex: 1;
}

.card-body {
  padding: 20px 22px;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 4px 14px rgba(34,197,94,.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f0fdf4;
  color: #15803d;
  border: 1.5px solid #86efac;
}

.btn-secondary:hover {
  background: #dcfce7;
  border-color: #4ade80;
}

.btn-danger {
  background: #fff5f5;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 10px;
}

/* ── 입력 폼 ── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text-dark);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

/* ── 테이블 ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: var(--navy-700);
  font-weight: 700;
  font-size: 12px;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 2px solid #bbf7d0;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid #f0fdf4;
  transition: background .15s;
}

tbody tr:hover {
  background: #f7fef9;
}

tbody td {
  padding: 10px 14px;
  color: var(--navy-800);  /* 남색 텍스트 */
  vertical-align: middle;
}

/* ── 배지/태그 ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-converted {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-processing {
  background: #fff7ed;
  color: #c2410c;
}

.badge-paid-yes {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #93c5fd;
}

.badge-paid-no {
  background: #fee2e2;
  color: #dc2626;
  font-size: 14px;
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fca5a5;
}

.badge-paid-pending {
  background: #fff7ed;
  color: #c2410c;
  font-size: 14px;
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fed7aa;
}

/* ── 모달 ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
  width: 100%;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1.5px solid #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1.5px solid #f0fdf4;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── 탭 ── */
.tab-bar {
  display: flex;
  gap: 4px;
  background: #f0fdf4;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--navy-600);
  transition: all .2s ease;
}

.tab-item.active {
  background: #fff;
  color: #16a34a;
  box-shadow: 0 2px 8px rgba(22,163,74,.18);
}

/* ── 통계 카드 ── */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  border: 1.5px solid #dcfce7;
  box-shadow: 0 2px 10px rgba(22,163,74,.08);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy-800);   /* 남색 */
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--navy-600);
  margin-top: 4px;
  font-weight: 600;
}

/* ── 인라인 시트 (가맹점/문의) ── */
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: fixed;
}

.sheet-table thead th {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #1a3a00;
  font-weight: 700;
  font-size: 11.5px;
  padding: 9px 8px;
  text-align: left;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.sheet-table tbody td {
  padding: 3px 4px;
  border: 1px solid #e2fce8;
  vertical-align: middle;
  color: #1a3a00;
}

.sheet-table tbody tr:hover td {
  background: #f0fdf4;
}

.sheet-table .new-row td {
  background: #f7fff2;
  border-color: #86efac;
}

.sheet-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #1a3a00;
  padding: 4px 6px;
  outline: none;
  min-height: 28px;
}

.sheet-input:focus {
  background: #fff;
  outline: 2px solid #22c55e;
  border-radius: 4px;
}

.sheet-select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 12px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #1a3a00;
  padding: 4px 4px;
  outline: none;
  min-height: 28px;
  cursor: pointer;
}

.sheet-select:focus {
  background: #fff;
  outline: 2px solid #22c55e;
  border-radius: 4px;
}

.sheet-textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 12px;
  font-family: 'Noto Sans KR', sans-serif;
  color: #1a3a00;
  padding: 4px 6px;
  outline: none;
  resize: none;
  min-height: 28px;
  overflow: hidden;
}

.sheet-textarea:focus {
  background: #fff;
  outline: 2px solid #22c55e;
  border-radius: 4px;
  min-height: 52px;
}

.sheet-table .memo-col {
  min-width: 200px;
}

.sheet-table .date-col { width: 90px; }
.sheet-table .name-col { width: 90px; }
.sheet-table .phone-col { width: 120px; }
.sheet-table .inflow-col { width: 80px; }
.sheet-table .counselor-col { width: 75px; }
.sheet-table .industry-col { width: 70px; }
.sheet-table .region-col { width: 65px; }
.sheet-table .sales-col { width: 80px; }
.sheet-table .paid-col { width: 55px; text-align: center; }
.sheet-table .action-col { width: 45px; text-align: center; }
.sheet-table .memo-col { min-width: 180px; }

/* 시트 컨테이너 (가로스크롤) */
.sheet-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 0 0 12px 12px;
}

/* 유입경로 추가 팝업 */
.dropdown-add-popup {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 500;
  min-width: 200px;
  display: none;
}

.dropdown-add-popup.show { display: block; }

/* ── 달력 ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid #e8f0ea;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 0;
}

.cal-day-label {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  padding: 8px 0;
}

.cal-cell {
  min-height: 96px;
  padding: 6px 6px 4px;
  border-right: 1px solid #e8f0ea;
  border-top: 1px solid #e8f0ea;
  cursor: pointer;
  transition: background .15s;
  background: #fff;
  position: relative;
}

.cal-cell:hover {
  background: #f8fafc;
}

.cal-cell.today {
  background: #f0fdf4;
}

.cal-cell.other-month {
  background: #fafafa;
}

.cal-cell .cell-date {
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 4px;
  text-align: right;
}

.cal-cell.today .cell-date {
  background: transparent;
  color: inherit;
  width: auto;
  height: auto;
  border-radius: 0;
  display: block;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
  margin: 0 0 4px;
}

.cal-event {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  line-height: 1.5;
}

/* ── 섹션 구분선 ── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #bbf7d0, transparent);
  margin: 20px 0;
}

/* ── 검색/필터 바 ── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #4ade80;
  font-size: 13px;
}

.search-input-wrap input {
  padding-left: 34px;
}

/* ── 공지사항 카드 ── */
.notice-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef9e7 100%);
  border: 1.5px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(245,158,11,.10);
}

.notice-card .notice-title {
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}

.notice-card .notice-meta {
  font-size: 11px;
  color: #b45309;
}

/* ── 오늘 일정 카드 ── */
.today-event {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  border: 1.5px solid #bae6fd;
  border-left: 4px solid #0ea5e9;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(14,165,233,.10);
}

.today-event .event-time {
  font-size: 12px;
  font-weight: 700;
  color: #0369a1;
  white-space: nowrap;
  min-width: 80px;
}

.today-event .event-title {
  font-size: 13px;
  font-weight: 600;
  color: #0c4a6e;
}

.today-event .event-desc {
  font-size: 12px;
  color: #0369a1;
  margin-top: 2px;
}

/* ── 반응형 ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 150;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-overlay.active {
    display: block;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .sidebar-toggle-btn {
    display: none;  /* PC 토글 숨김 */
  }
  .main-content {
    margin-left: 0 !important;
  }
  .topbar {
    padding: 0 16px;
    height: 56px;
    gap: 10px;
  }
  .topbar h2 {
    font-size: 15px;
  }
  .page-content {
    padding: 16px;
  }
  .inflow-badge {
    display: none;  /* 모바일에서 숨김 */
  }
  /* 대시보드 그리드: 모바일에서도 4개 한 줄 유지 */
  .stat-grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 12px 10px !important;
  }
  .stat-card .stat-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }
  .stat-card .stat-value {
    font-size: 22px !important;
  }
  .stat-card .stat-label {
    font-size: 10px !important;
  }
  .dashboard-2col {
    grid-template-columns: 1fr !important;
  }
  /* 일정/업무 그리드 */
  .schedule-2col {
    grid-template-columns: 1fr !important;
  }
}

/* ── 로딩 스피너 ── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #dcfce7;
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ── 빈 상태 ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #86efac;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.empty-state p {
  font-size: 14px;
  color: #3d7a3d;
  font-weight: 500;
}

/* ── 드롭다운 new tag ── */
select option.new-option {
  font-style: italic;
  color: #15803d;
}

/* ── 태그 추가 버튼 ── */
.add-tag-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.add-tag-wrap input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px dashed #86efac;
  border-radius: 6px;
  font-size: 12px;
  background: #f0fdf4;
}

.add-tag-wrap button {
  padding: 6px 10px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

/* ── 인라인 라디오 ── */
.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}

.radio-item input[type="radio"] {
  accent-color: #22c55e;
}

/* ── 페이지네이션 ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #dcfce7;
  background: #fff;
  color: #16a34a;
  transition: all .2s;
}

.page-btn:hover, .page-btn.active {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border-color: #22c55e;
}

/* ── 업무기록 카드 ── */
.worklog-card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #dcfce7;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(22,163,74,.06);
  transition: all .2s;
}

.worklog-card:hover {
  box-shadow: 0 4px 16px rgba(34,197,94,.12);
  border-color: #86efac;
}

.worklog-card .wl-date {
  font-size: 12px;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 6px;
}

.worklog-card .wl-tasks {
  font-size: 13.5px;
  color: var(--text-dark);
  line-height: 1.6;
}

/* ── 사용자 아바타 ── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── 수평 폼 그리드 ── */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  /* form-grid-3: 날짜 1열 + 시간들 → 개별로 처리 */
  .form-grid-3 { grid-template-columns: 1fr; }
  /* form-grid-2: 기본 2열 유지 (시작/종료 나란히) */
  /* .form-grid-2: 유지 */
  .page-content { padding: 12px; }
  .topbar { padding: 0 16px; }

  /* iOS date/time input overflow 방지 */
  input[type="date"],
  input[type="time"] {
    min-width: 0 !important;
    width: 100% !important;
    font-size: 13px !important;
  }

  /* 모달 모바일 최적화 */
  .modal {
    border-radius: 16px;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-body {
    padding: 12px 14px;
  }
  .modal-header {
    padding: 12px 14px 10px;
  }
  .modal-footer {
    padding: 10px 14px 14px;
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
  }
  .modal-backdrop {
    padding: 12px;
    align-items: center;
  }

  /* 모바일 달력 최적화 */
  .cal-cell-wrap {
    min-height: 56px !important;
    padding: 3px 2px 2px !important;
  }
  .cal-nav h3, .cal-nav > div > div {
    font-size: 17px !important;
  }

  /* 모바일 탭 버튼 */
  #sched-tab-shared, #sched-tab-personal {
    padding: 6px 14px !important;
    font-size: 12px !important;
  }
}

/* ── 인쿼리 테이블 특수 스타일 ── */
.inquiry-content-cell {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-wrap table td, .table-wrap table th {
  white-space: nowrap;
}

.table-wrap table td.content-col {
  min-width: 200px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 상태 선택 탭 ── */
.status-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.status-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #86efac;
  background: #fff;
  color: #3d7a3d;
  transition: all .2s;
}

.status-tab:hover {
  background: #f0fdf4;
  border-color: #4ade80;
}

.status-tab.active-all   { background: linear-gradient(135deg,#22c55e,#16a34a); color:#fff; border-color:#16a34a; }
.status-tab.active-conv  { background: #1d4ed8; color:#fff; border-color:#1d4ed8; }
.status-tab.active-pend  { background: #92400e; color:#fff; border-color:#92400e; }
.status-tab.active-proc  { background: #c2410c; color:#fff; border-color:#c2410c; }

/* ── 인라인 편집 (엑셀 스타일) ── */
.fv {
  display: inline-block;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background .15s;
  cursor: default;
}

.fv:hover {
  background: #f0fdf4;
  outline: 1px dashed #4ade80;
}

.fe-input {
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1.5px solid #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

/* 신규 입력행 스타일 */
#new-franchisee-row td {
  padding: 8px 8px;
  background: #f0fdf4;
}

#new-franchisee-row input,
#new-franchisee-row select {
  background: #fff;
  border: 1.5px solid #86efac;
  font-size: 12.5px;
  padding: 6px 8px;
}

#new-franchisee-row input:focus,
#new-franchisee-row select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,.15);
}

/* 편집 중인 행 강조 */
tbody tr:has(.fe-input:not([style*="display:none"])) {
  background: #f0fdf4 !important;
  outline: 2px solid #86efac;
}

/* ── 고품질 달력 내비게이션 ── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 2px;
}

.cal-nav h3 {
  font-size: 22px;
  font-weight: 800;
  color: #1a3f25;
  letter-spacing: -.5px;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  cursor: pointer;
  color: #16a34a;
  font-size: 13px;
  transition: all .2s;
}

.cal-nav-btn:hover {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
  box-shadow: 0 2px 6px rgba(34,197,94,.2);
}

/* ── 알림 컨테이너 ── */
#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

/* ── 캘린더 호버 팝업 ── */
#cal-hover-popup {
  animation: popupFadeIn .15s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}
@keyframes popupFadeIn {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0); }
}
#cal-hover-popup .popup-item:last-child {
  border-bottom: none !important;
}
#cal-hover-popup * {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  box-sizing: border-box;
}

/* 셀 호버 배경 (768px 초과 PC에서만) */
@media (min-width: 769px) {
  .cal-cell-wrap:hover {
    background: #f0fdf4 !important;
  }
}

/* 모바일: 터치 피드백 */
.cal-cell-wrap:active {
  background: #f0fdf4 !important;
}
