/* ══════════════════════════════════════════
   리셋 & 기본
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: #F3F4F6;
  color: #111827;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
img { max-width: 100%; }

/* ══════════════════════════════════════════
   전체 레이아웃
══════════════════════════════════════════ */

/* 사이드바: 데스크탑에서만 표시 */
#sidebar {
  display: none; /* 기본 숨김 - JS에서 로그인 후 데스크탑만 표시 */
  position: fixed;
  top: 0; left: 0;
  width: 260px; height: 100%;
  background: #111827;
  color: #fff;
  z-index: 100;
  flex-direction: column;
  overflow: hidden;
}

/* 메인 래퍼 */
#mainWrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin-left: 0;
}

/* 하단 탭바: 모바일 기본 표시 */
#bottomNav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  z-index: 50;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.07);
}

/* 데스크탑(768px+): 사이드바 표시, 탭바 숨김 */
@media (min-width: 768px) {
  #sidebar { display: flex !important; }
  #mainWrap { margin-left: 260px; }
  #bottomNav { display: none !important; }
  #morePanel { display: none !important; }
  .hd-logo-m { display: none !important; }
  #mainHeader { padding: 12px 24px; }
  #pageContent { padding: 24px; padding-bottom: 24px; }
}

/* 로그인 화면: 사이드바/탭바 완전 숨김 (모든 해상도) */
body.login-mode #sidebar { display: none !important; }
body.login-mode #mainWrap { margin-left: 0 !important; }
body.login-mode #bottomNav { display: none !important; }
body.login-mode #mainHeader { display: none !important; }
body.login-mode #morePanel { display: none !important; }
body.login-mode #pageContent { padding: 0 !important; }

/* 모바일(767px-): 탭바 표시 */
@media (max-width: 767px) {
  #sidebar { display: none !important; }
  #mainWrap { margin-left: 0; }
  .hd-title-wrap { display: none; }
  #headerActionBtn { display: flex !important; }
  #pageContent {
    padding: 12px;
    padding-bottom: 80px; /* 하단 탭바 높이만큼 여백 */
  }
}

/* ══════════════════════════════════════════
   사이드바 내부
══════════════════════════════════════════ */
.sb-header {
  padding: 14px 16px;
  border-bottom: 1px solid #374151;
  flex-shrink: 0;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.sb-icon {
  width: 36px; height: 36px;
  background: #F59E0B; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #1F2937; font-size: 16px; flex-shrink: 0;
}
.sb-name { font-weight: 700; font-size: 14px; }
.sb-sub  { color: #9CA3AF; font-size: 11px; }

.sb-drawer-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: #1F2937; border-radius: 8px;
  color: #D1D5DB; font-size: 12px; font-weight: 600;
  transition: background .15s;
}
.sb-drawer-btn:hover { background: #374151; }
.sb-drawer-btn i { color: #FBBF24; margin-right: 4px; }
#drawerChev { color: #6B7280; font-size: 10px; }

.sb-nav {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 10px 0;
}
.sb-projects-wrap { padding: 0 12px; flex: 1; }
.sb-menu { padding: 8px 12px; border-top: 1px solid #1F2937; margin-top: 8px; }
.sb-sec-title {
  font-size: 10px; font-weight: 700; color: #6B7280;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 0 8px; margin-bottom: 6px;
}
.sb-user {
  border-top: 1px solid #374151;
  flex-shrink: 0;
}
.sb-footer {
  padding: 8px 20px; font-size: 11px; color: #4B5563; flex-shrink: 0;
}

/* 사이드바 네비 아이템 */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px; margin-bottom: 2px;
  color: #9CA3AF; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.nav-item:hover  { background: #374151; color: #F9FAFB; }
.nav-item.active { background: #F59E0B; color: #1F2937; font-weight: 600; }
.nav-item i { width: 18px; text-align: center; }
.appr-badge {
  margin-left: auto;
  background: #EF4444; color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 99px; min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* 사이드바 공사 아이템 */
.nav-project-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 7px; margin-bottom: 2px;
  color: #9CA3AF; font-size: 13px; cursor: pointer; transition: all .15s;
  position: relative;
}
.nav-project-item a { color: inherit; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.nav-project-item:hover  { background: #374151; color: #F9FAFB; }
.nav-project-item.active { background: #1D4ED8; color: #fff; }

/* ══════════════════════════════════════════
   헤더
══════════════════════════════════════════ */
#mainHeader {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.hd-left { display: flex; align-items: center; gap: 12px; }
.hd-right { display: flex; align-items: center; gap: 8px; }

/* 모바일 로고 */
.hd-logo-m {
  display: flex; align-items: center; gap: 8px;
}
.hd-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
  box-shadow: 0 2px 8px rgba(30,58,95,0.25);
}
.hd-logo-text { font-weight: 800; font-size: 15px; color: #1e293b; letter-spacing: -0.3px; }

/* 데스크탑 타이틀 */
.hd-title-wrap h1 { font-size: 16px; font-weight: 700; color: #111827; line-height: 1.3; }
.hd-title-wrap p  { font-size: 12px; color: #9CA3AF; }

/* 액션 버튼 */
.hd-action-btn {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
  color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px;
  transition: opacity .15s;
  box-shadow: 0 2px 8px rgba(30,58,95,0.25);
}
.hd-action-btn:hover { opacity: 0.85; }
.hd-action-btn i { font-size: 11px; }

/* 페이지 컨텐츠 */
#pageContent { flex: 1; }

/* ══════════════════════════════════════════
   하단 탭바 (모바일)
══════════════════════════════════════════ */
.bn-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  color: #94a3b8;
  font-size: 10px; font-weight: 500;
  transition: color .2s;
  position: relative;
  padding: 8px 0 6px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.bn-item i {
  font-size: 20px;
  transition: transform .2s;
}
.bn-item.active { color: #1e3a5f; }
.bn-item.active i {
  color: #1e3a5f;
  transform: translateY(-2px) scale(1.1);
}
.bn-item.active span:last-child { font-weight: 700; }
.bn-item:active { opacity: 0.7; }
.bn-badge {
  position: absolute; top: 5px;
  background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 700;
  border-radius: 99px; min-width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 3px;
  right: calc(50% - 22px);
}

/* ══════════════════════════════════════════
   더보기 패널 (모바일)
══════════════════════════════════════════ */
#morePanelBox {
  position: fixed;
  bottom: 64px; left: 0; right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 50;
  max-height: 75vh;
  overflow-y: auto;
  padding-bottom: 16px;
  box-shadow: 0 -8px 30px rgba(0,0,0,.12);
}
.mp-section {
  padding: 12px 16px 4px;
  border-top: 1px solid #F3F4F6;
}
.mp-section:first-child { border-top: none; }
.mp-sec-title {
  font-size: 11px; font-weight: 700; color: #9CA3AF;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 8px;
}
.mp-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 8px;
  color: #374151; font-size: 14px; font-weight: 500;
  transition: background .15s;
}
.mp-item:hover { background: #F9FAFB; }
.mp-item i { width: 20px; text-align: center; color: #6B7280; }
.mp-item.active { color: #F59E0B; }
.mp-item.active i { color: #F59E0B; }
.mp-logout {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 8px; border-radius: 8px;
  color: #EF4444; font-size: 14px; font-weight: 500;
  transition: background .15s;
}
.mp-logout:hover { background: #FEF2F2; }
.mp-logout i { width: 20px; text-align: center; }
.mp-proj-list { max-height: 200px; overflow-y: auto; }
.mp-proj-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 8px;
  color: #374151; font-size: 14px;
  transition: background .15s; cursor: pointer;
}
.mp-proj-item:hover { background: #F3F4F6; }
.mp-proj-item.active { background: #EFF6FF; color: #1D4ED8; font-weight: 600; }
.mp-proj-item i { color: #9CA3AF; font-size: 13px; }

/* ══════════════════════════════════════════
   모달
══════════════════════════════════════════ */
#modalOverlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 60;
  align-items: flex-end;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
}
#modalOverlay.visible {
  display: flex;
}
#modalBox {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
  #modalOverlay { align-items: center; padding: 16px; }
  #modalBox { border-radius: 16px; max-width: 680px; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #E5E7EB;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: #111827; }
.modal-header button {
  color: #9CA3AF; font-size: 20px; padding: 6px;
  min-width: 36px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.modal-header button:hover { color: #374151; background: #F3F4F6; }
.modal-body { padding: 16px 20px; }

/* ══════════════════════════════════════════
   토스트
══════════════════════════════════════════ */
#toast {
  display: none;
  position: fixed;
  bottom: 72px; left: 12px; right: 12px;
  z-index: 70;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  color: #fff; font-size: 14px; font-weight: 600;
  align-items: center; gap: 8px;
  justify-content: center;
  text-align: center;
}
#toast.show { display: flex !important; }
@media (min-width: 480px) {
  #toast { bottom: 20px; left: auto; right: 20px; max-width: 320px; text-align: left; }
}

/* ══════════════════════════════════════════
   카드 & 컴포넌트
══════════════════════════════════════════ */
.stat-card {
  background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.project-card {
  background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07); cursor: pointer;
  transition: transform .15s, box-shadow .15s; border: 2px solid transparent;
}
.project-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.12); border-color: #F59E0B; }
.project-card:active { transform: scale(0.98); }

.doc-row {
  display: grid; align-items: center;
  border-bottom: 1px solid #F3F4F6; transition: background .1s;
}
.doc-row:hover { background: #F9FAFB; }

/* ══════════════════════════════════════════
   뱃지
══════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-draft    { background:#F3F4F6; color:#6B7280; }
.badge-review   { background:#FEF3C7; color:#D97706; }
.badge-approved { background:#D1FAE5; color:#065F46; }
.badge-rejected { background:#FEE2E2; color:#B91C1C; }
.badge-archived { background:#EDE9FE; color:#5B21B6; }
.badge-planning   { background:#DBEAFE; color:#1D4ED8; }
.badge-active     { background:#D1FAE5; color:#065F46; }
.badge-completed  { background:#F3F4F6; color:#374151; }
.badge-suspended  { background:#FEE2E2; color:#B91C1C; }
.badge-etc        { background:#EDE9FE; color:#5B21B6; }

/* ══════════════════════════════════════════
   폼
══════════════════════════════════════════ */
.form-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.form-input {
  width: 100%; padding: 9px 13px; border: 1.5px solid #E5E7EB;
  border-radius: 8px; font-size: 14px; color: #111; outline: none; transition: border-color .15s;
}
.form-input:focus { border-color: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.table-header {
  display: grid; background: #F9FAFB;
  border-bottom: 2px solid #E5E7EB;
  padding: 10px 16px; font-size: 12px; font-weight: 700;
  color: #6B7280; text-transform: uppercase; letter-spacing: .05em;
}

/* ══════════════════════════════════════════
   유틸리티
══════════════════════════════════════════ */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.col-span-2 { grid-column: span 2; }
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.min-w-0 { min-width: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg   { font-size: 17px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 24px; }
.text-3xl  { font-size: 30px; }
.text-4xl  { font-size: 36px; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: .08em; }
.leading-tight { line-height: 1.3; }
.whitespace-nowrap { white-space: nowrap; }
.text-white    { color: #fff; }
.text-gray-300 { color: #D1D5DB; }
.text-gray-400 { color: #9CA3AF; }
.text-gray-500 { color: #6B7280; }
.text-gray-600 { color: #4B5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1F2937; }
.text-gray-900 { color: #111827; }
.text-yellow-400 { color: #FBBF24; }
.text-yellow-500 { color: #F59E0B; }
.text-yellow-600 { color: #D97706; }
.text-blue-500   { color: #3B82F6; }
.text-blue-600   { color: #2563EB; }
.text-blue-700   { color: #1D4ED8; }
.text-green-600  { color: #16A34A; }
.text-red-500    { color: #EF4444; }
.text-red-600    { color: #DC2626; }
.text-red-700    { color: #B91C1C; }
.text-orange-500 { color: #F97316; }
.text-indigo-600 { color: #4F46E5; }
.text-purple-600 { color: #9333EA; }
.bg-white      { background: #fff; }
.bg-gray-50    { background: #F9FAFB; }
.bg-gray-100   { background: #F3F4F6; }
.bg-gray-200   { background: #E5E7EB; }
.bg-gray-700   { background: #374151; }
.bg-gray-800   { background: #1F2937; }
.bg-gray-900   { background: #111827; }
.bg-yellow-50  { background: #FFFBEB; }
.bg-yellow-100 { background: #FEF3C7; }
.bg-yellow-400 { background: #FBBF24; }
.bg-yellow-500 { background: #F59E0B; }
.bg-blue-50    { background: #EFF6FF; }
.bg-blue-100   { background: #DBEAFE; }
.bg-blue-500   { background: #3B82F6; }
.bg-blue-600   { background: #2563EB; }
.bg-green-50   { background: #F0FDF4; }
.bg-green-100  { background: #DCFCE7; }
.bg-green-500  { background: #22C55E; }
.bg-green-600  { background: #16A34A; }
.bg-red-50     { background: #FEF2F2; }
.bg-red-100    { background: #FEE2E2; }
.bg-red-500    { background: #EF4444; }
.bg-red-600    { background: #DC2626; }
.bg-orange-100 { background: #FFEDD5; }
.bg-purple-100 { background: #F3E8FF; }
.bg-indigo-100 { background: #E0E7FF; }
.border        { border: 1px solid #E5E7EB; }
.border-t      { border-top: 1px solid #E5E7EB; }
.border-b      { border-bottom: 1px solid #E5E7EB; }
.border-2      { border-width: 2px; }
.border-gray-100 { border-color: #F3F4F6; }
.border-gray-200 { border-color: #E5E7EB; }
.border-gray-300 { border-color: #D1D5DB; }
.border-transparent { border-color: transparent; }
.rounded    { border-radius: 4px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl{ border-radius: 16px; }
.rounded-full{ border-radius: 9999px; }
.shadow    { box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,.1); }
.shadow-lg { box-shadow: 0 8px 16px rgba(0,0,0,.12); }
.shadow-xl { box-shadow: 0 16px 32px rgba(0,0,0,.15); }
.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: 8px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.pt-2 { padding-top: 8px; }
.pt-4 { padding-top: 16px; }
.pb-2 { padding-bottom: 8px; }
.pb-4 { padding-bottom: 16px; }
.w-4  { width: 16px; }
.w-5  { width: 20px; }
.w-6  { width: 24px; }
.w-8  { width: 32px; }
.w-9  { width: 36px; }
.w-10 { width: 40px; }
.w-12 { width: 48px; }
.h-4  { height: 16px; }
.h-5  { height: 20px; }
.h-6  { height: 24px; }
.h-8  { height: 32px; }
.h-9  { height: 36px; }
.h-10 { height: 40px; }
.h-12 { height: 48px; }
.max-w-sm  { max-width: 384px; }
.max-w-md  { max-width: 448px; }
.max-w-lg  { max-width: 512px; }
.max-w-xl  { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-4xl { max-width: 896px; }
.max-h-56  { max-height: 224px; }
.flex-shrink-0 { flex-shrink: 0; }
.opacity-40 { opacity: 0.4; }
.cursor-pointer { cursor: pointer; }
.transition { transition: all .15s; }
.divide-y > * + * { border-top: 1px solid #E5E7EB; }
.hover\:bg-gray-50:hover  { background: #F9FAFB; }
.hover\:bg-gray-100:hover { background: #F3F4F6; }
.hover\:text-gray-600:hover { color: #4B5563; }
.hover\:text-red-600:hover  { color: #DC2626; }
.hover\:text-blue-600:hover { color: #2563EB; }
.hover\:bg-yellow-600:hover { background: #D97706; }
.hover\:underline:hover     { text-decoration: underline; }

/* ══════════════════════════════════════════
   스피너 / 빈 상태 / 기타
══════════════════════════════════════════ */
.spinner {
  border: 3px solid #E5E7EB; border-top-color: #F59E0B;
  border-radius: 50%; width: 32px; height: 32px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 24px; color: #9CA3AF; }
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: .4; display: block; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.color-swatch { width: 28px; height: 28px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.color-swatch:hover, .color-swatch.selected { border-color: #111; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 99px; }

/* ══════════════════════════════════════════
   반응형
══════════════════════════════════════════ */
@media (max-width: 767px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 { grid-template-columns: 1fr !important; }
  .col-span-2 { grid-column: span 1 !important; }
  .keep-2-col { grid-template-columns: 1fr 1fr !important; }
  .stat-card, .project-card { padding: 14px; }
  .px-5 { padding-left: 14px !important; padding-right: 14px !important; }
  .px-6 { padding-left: 16px !important; padding-right: 16px !important; }

  /* ── 모바일 폼 입력 최적화 ── */
  .form-input, .form-select, select, textarea {
    font-size: 16px !important; /* iOS 자동 줌 방지 */
    padding: 11px 13px;
    min-height: 44px;
  }
  input[type="text"], input[type="number"], input[type="email"],
  input[type="password"], input[type="date"], input[type="tel"] {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* ── 모바일 버튼 터치 영역 확대 ── */
  button, .btn, [role="button"] {
    min-height: 40px;
  }
  .hd-action-btn {
    padding: 10px 16px;
    min-height: 44px;
    font-size: 14px;
  }

  /* ── 모바일 테이블/리스트 행 터치 영역 ── */
  .doc-row { min-height: 52px; }
  .nav-project-item { min-height: 44px; padding: 10px 12px; }
  .mp-item { min-height: 48px; padding: 12px 8px; font-size: 15px; }
  .mp-item i { font-size: 16px; }
  .mp-logout { min-height: 48px; padding: 12px 8px; font-size: 15px; }

  /* ── 모바일 카드 간격 최적화 ── */
  .stat-card { border-radius: 12px; }
  .project-card { border-radius: 12px; }

  /* ── 모바일 모달 ── */
  .modal-header h2 { font-size: 15px; }
  .modal-body { padding: 14px 16px; }

  /* ── 모바일 배지 크기 ── */
  .badge { font-size: 11px; padding: 3px 8px; }

  /* ── 모바일 텍스트 가독성 ── */
  .text-xs { font-size: 12px; }
  .text-sm { font-size: 13px; }

  /* ── 테이블 헤더 ── */
  .table-header { padding: 8px 12px; font-size: 11px; }

  /* ── 하단 탭바 개선 ── */
  #bottomNav { height: 60px; }
  #pageContent { padding-bottom: 76px !important; }
  .bn-item { font-size: 9px; padding: 6px 0 4px; }
  .bn-item i { font-size: 20px; }
}
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: 1fr 1fr; }
  .sm\:grid-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: 1fr 1fr; }
  .md\:grid-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .lg\:grid-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* ── 현장원(field_worker) 전용 모드: 사이드바 완전 제거 ── */
body.field-worker-mode #sidebar {
  display: none !important;
}
body.field-worker-mode #mainWrap {
  margin-left: 0 !important;
}

/* ── 업종 말풍선 팝오버 애니메이션 ── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
