/* ============================================================
   Airflow OMS — Mobile Responsive Styles v10.0
   AGI-level Premium Mobile UX Innovation
   - 글래스모피즘 헤더 + 다이나믹 블러
   - 플로팅 네비게이션 바 (Pill 스타일)
   - 마이크로인터랙션 & 스프링 애니메이션
   - iOS/Android 네이티브 느낌의 UX
   - 카드 그라데이션 & 호버 리플 이펙트
   ============================================================ */

/* ─── CSS Variables ─── */
:root {
  --bottom-nav-h: 68px;
  --mobile-header-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --m-radius: 16px;
  --m-radius-sm: 12px;
  --m-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --m-shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --m-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --m-shadow-float: 0 8px 40px rgba(37,99,235,0.18);
  --m-blue: #2563eb;
  --m-blue-light: #dbeafe;
  --m-blue-glow: rgba(37,99,235,0.25);
  --m-transition: cubic-bezier(0.34, 1.56, 0.64, 1);
  --m-transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── 모바일 (768px 이하) ─── */
@media (max-width: 768px) {
  /* 사이드바 숨김 */
  .desktop-sidebar { display: none !important; }

  /* 메인 레이아웃 전환 */
  .layout-root {
    flex-direction: column !important;
    height: 100vh;
    height: 100dvh;
    background: #f8fafc;
  }

  /* ╔══════════════════════════════════════════╗
     ║  글래스모피즘 모바일 헤더                    ║
     ╚══════════════════════════════════════════╝ */
  .mobile-header {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--mobile-header-h);
    background: rgba(255,255,255,0.82);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(229,231,235,0.6);
    padding: 0 16px;
    padding-top: var(--safe-top);
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
  }
  .mobile-header.scrolled {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 1px 12px rgba(0,0,0,0.06);
  }
  .mobile-header .logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
    transition: transform 0.3s var(--m-transition);
  }
  .mobile-header .logo:active { transform: scale(0.9); }
  .mobile-header .logo i { color: white; font-size: 15px; }
  .mobile-header .title {
    font-weight: 800;
    font-size: 17px;
    color: #0f172a;
    flex: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-header .header-actions {
    display: flex; gap: 2px; align-items: center;
  }
  .mobile-header .header-btn {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #64748b;
    background: transparent;
    border: none; cursor: pointer;
    position: relative;
    transition: all 0.2s var(--m-transition-smooth);
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-header .header-btn i { font-size: 16px; }
  .mobile-header .header-btn:active {
    background: rgba(37,99,235,0.08);
    transform: scale(0.9);
    color: var(--m-blue);
  }

  /* 알림 도트 - 펄스 애니메이션 */
  .mobile-header .notif-dot {
    position: absolute; top: 6px; right: 6px;
    width: 9px; height: 9px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    animation: notifPulse 2s ease-in-out infinite;
  }

  /* 메인 컨텐츠 영역 */
  .main-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
    scroll-behavior: smooth;
  }
  .main-content #content {
    padding: 16px !important;
    padding-top: 12px !important;
  }

  /* ╔══════════════════════════════════════════╗
     ║  플로팅 Pill 바텀 네비게이션                ║
     ╚══════════════════════════════════════════╝ */
  .bottom-nav {
    display: block !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    padding: 0 12px calc(var(--safe-bottom) + 8px) 12px;
    background: transparent;
    pointer-events: none;
    border-top: none;
    box-shadow: none;
    height: auto;
  }
  .bottom-nav-inner {
    display: flex;
    width: 100%;
    height: 60px;
    align-items: center;
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
    pointer-events: auto;
    padding: 0 4px;
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #94a3b8;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px 0;
    position: relative;
    transition: all 0.25s var(--m-transition);
    -webkit-tap-highlight-color: transparent;
    border-radius: 14px;
  }
  .bottom-nav-item i {
    font-size: 19px;
    transition: all 0.25s var(--m-transition);
  }
  .bottom-nav-item span {
    font-size: 10px; font-weight: 600;
    line-height: 1;
    transition: all 0.25s var(--m-transition);
    letter-spacing: -0.01em;
  }
  .bottom-nav-item:active {
    transform: scale(0.88);
  }

  /* 활성 아이템 - 글로잉 필(Pill) 인디케이터 */
  .bottom-nav-item.active {
    color: var(--m-blue);
    background: var(--m-blue-light);
  }
  .bottom-nav-item.active i {
    transform: translateY(-1px);
    filter: drop-shadow(0 2px 4px var(--m-blue-glow));
  }
  .bottom-nav-item.active span {
    font-weight: 700;
    color: var(--m-blue);
  }
  .bottom-nav-item.active::before {
    content: none;
  }
  .bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px; height: 4px;
    background: var(--m-blue);
    border-radius: 50%;
    opacity: 0;
  }

  /* 뱃지 */
  .bottom-nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    min-width: 18px; height: 18px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 10px;
    font-weight: 800;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(239,68,68,0.35);
    animation: badgeBounce 0.4s var(--m-transition);
  }

  /* ╔══════════════════════════════════════════╗
     ║  더보기 메뉴 — 프리미엄 바텀시트               ║
     ╚══════════════════════════════════════════╝ */
  .mobile-more-menu {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15,23,42,0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.2s var(--m-transition-smooth);
  }
  .mobile-more-panel {
    width: 100%;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    padding: 0 0 calc(var(--safe-bottom) + 16px);
    overflow-y: auto;
    animation: sheetSlideUp 0.35s var(--m-transition);
    overscroll-behavior: contain;
  }
  .mobile-more-panel .drag-handle {
    width: 40px; height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    margin: 10px auto 6px;
  }
  .mobile-more-panel .menu-group-label {
    padding: 16px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .mobile-more-panel .more-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #334155;
    font-size: 15px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
    border-radius: 0;
  }
  .mobile-more-panel .more-menu-item:active {
    background: #f1f5f9;
  }
  .mobile-more-panel .more-menu-item i {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
  }
  .mobile-more-panel .more-menu-item.active {
    color: var(--m-blue);
    font-weight: 700;
  }
  .mobile-more-panel .more-menu-item.active i {
    background: var(--m-blue-light);
    color: var(--m-blue);
  }

  /* 사용자 프로필 (더보기 상단) */
  .mobile-more-panel .user-section {
    margin: 0;
    padding: 20px 20px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
  }
  .mobile-more-panel .user-section .avatar {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
  }
  .mobile-more-panel .user-section .avatar i { color: white; font-size: 16px; }
  .mobile-more-panel .user-actions {
    display: flex; gap: 8px; padding: 12px 20px 4px;
  }
  .mobile-more-panel .user-actions button {
    flex: 1; padding: 10px; border-radius: 12px;
    font-size: 13px; font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #f8fafc; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.15s;
    color: #475569;
  }
  .mobile-more-panel .user-actions button:active {
    background: #e2e8f0;
    transform: scale(0.97);
  }
  .mobile-more-panel .user-actions .logout-btn {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
  }

  /* ╔══════════════════════════════════════════╗
     ║  컨텐츠 반응형 — 프리미엄 카드 디자인         ║
     ╚══════════════════════════════════════════╝ */

  /* 대시보드 카드 그리드 */
  .grid.grid-cols-4,
  .grid.grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .grid.grid-cols-2.md\:grid-cols-4 {
    gap: 10px !important;
  }

  /* 대시보드 요약 카드 - 프리미엄 스타일 */
  .ix-card {
    border-radius: var(--m-radius) !important;
    border: none !important;
    box-shadow: var(--m-shadow-sm);
    padding: 16px !important;
    transition: transform 0.2s var(--m-transition), box-shadow 0.2s;
    position: relative;
    overflow: hidden;
  }
  .ix-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--m-blue), #7c3aed, #ec4899);
    opacity: 0;
    transition: opacity 0.3s;
  }
  .ix-card:active {
    transform: scale(0.97);
    box-shadow: var(--m-shadow-md);
  }
  .ix-card:active::before { opacity: 1; }

  /* 대시보드 제목 */
  .fade-in > h2.text-2xl {
    font-size: 20px !important;
    margin-bottom: 16px !important;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* 차트 카드 */
  .grid.grid-cols-1.lg\:grid-cols-3 {
    gap: 12px !important;
  }
  .grid.grid-cols-1.lg\:grid-cols-3 > div {
    border-radius: var(--m-radius) !important;
    border: none !important;
    box-shadow: var(--m-shadow-sm);
    padding: 16px !important;
  }
  .chart-container canvas { max-height: 200px; }

  /* 테이블 → 카드 전환 */
  .oms-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--m-radius-sm);
    box-shadow: var(--m-shadow-sm);
  }
  .oms-table-wrap table { min-width: 600px; }

  /* 드로어 풀스크린 */
  .ix-drawer {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }
  .ix-drawer .drawer-header { padding: 16px !important; }
  .ix-drawer .drawer-body { padding: 16px !important; }

  /* 모달 풀스크린 */
  .modal-content,
  .ix-modal-content {
    width: 94% !important;
    max-width: 94% !important;
    max-height: 85vh !important;
    margin: auto !important;
    border-radius: 20px !important;
    box-shadow: var(--m-shadow-lg) !important;
  }

  /* 배치바 */
  .batch-bar, .ix-batch-bar {
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px) !important;
    left: 12px !important;
    right: 12px !important;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow-lg) !important;
  }

  /* 팝오버/컨텍스트메뉴 */
  .ix-popover, .context-menu {
    max-width: calc(100vw - 32px) !important;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow-lg) !important;
  }

  /* 필터/액션바 — 가로 스크롤 칩 스타일 */
  .filter-bar, .action-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar, .action-bar::-webkit-scrollbar { display: none; }
  .filter-bar > *, .action-bar > * { flex-shrink: 0; }
  .filter-bar select, .filter-bar input,
  .action-bar button {
    border-radius: 10px !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
  }

  /* 페이지 제목 */
  .page-title { font-size: 18px !important; font-weight: 700 !important; }
  .stat-card .stat-value { font-size: 20px !important; }

  /* ─── 주문 테이블 모바일 최적화 ─── */
  table thead th:nth-child(3),
  table thead th:nth-child(5),
  table thead th:nth-child(7),
  table thead th:nth-child(8),
  table thead th:nth-child(10),
  table thead th:nth-child(11),
  table tbody td:nth-child(3),
  table tbody td:nth-child(5),
  table tbody td:nth-child(7),
  table tbody td:nth-child(8),
  table tbody td:nth-child(10),
  table tbody td:nth-child(11) {
    display: none !important;
  }
  table { min-width: unset !important; font-size: 12px; }
  table th, table td { padding: 8px 6px !important; }
  table th { 
    font-weight: 700 !important;
    font-size: 11px !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  table tr { transition: background 0.15s; }
  table tbody tr:active { background: #f1f5f9; }

  /* ─── 칸반 모바일 최적화 ─── */
  .kanban-board {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .kanban-column {
    width: 100% !important;
    min-width: 100% !important;
    min-height: auto !important;
    max-height: none !important;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow-sm);
  }
  .kanban-column.kanban-collapsed {
    min-height: 48px !important;
  }
  .kanban-column .kanban-body {
    max-height: 300px;
    overflow-y: auto;
  }
  .kanban-card {
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
    border-radius: var(--m-radius-sm) !important;
    transition: transform 0.15s;
  }
  .kanban-card:active { transform: scale(0.98); }

  /* ─── 필터 영역 가로 스크롤 ─── */
  .flex.gap-3.items-center.flex-wrap {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .flex.gap-3.items-center.flex-wrap::-webkit-scrollbar { display: none; }

  /* ─── 버튼 터치 영역 확대 ─── */
  button, [onclick], a[href] {
    min-height: 36px;
  }

  /* ─── 검수 / 정산 카드 ─── */
  .review-card, .settlement-card {
    margin-bottom: 10px;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow-sm);
  }

  /* ─── 통계 페이지 ─── */
  .stat-grid { grid-template-columns: 1fr !important; }

  /* ─── 가입 위자드 ─── */
  .wizard-steps { font-size: 10px; gap: 4px !important; }
  .wizard-steps .step-label { display: none; }

  /* ─── 모바일에서 데스크탑 헤더 숨김 ─── */
  .desktop-content-header { display: none !important; }

  /* ─── 알림센터 풀스크린 ─── */
  #notif-center-panel { max-width: 100% !important; width: 100% !important; }

  /* ─── 로그인 페이지 모바일 최적화 ─── */
  .login-page-wrapper {
    padding: 16px !important;
    min-height: 100dvh;
  }
  .login-page-wrapper .login-card {
    border-radius: 20px !important;
    padding: 28px 24px !important;
  }

  /* ─── 빈 상태(Empty State) ─── */
  .empty-state {
    padding: 40px 20px;
    text-align: center;
  }
  .empty-state i { font-size: 40px; margin-bottom: 12px; }

  /* ─── 토스트 위치 조정 ─── */
  .oms-toast {
    left: 16px !important;
    right: 16px !important;
    max-width: none !important;
    border-radius: var(--m-radius) !important;
  }

  /* ─── 배너/광고 영역 ─── */
  .ad-placeholder {
    border-radius: var(--m-radius) !important;
    margin: 8px 0 !important;
  }

  /* ─── 매출추이/정산 섹션 ─── */
  .grid.grid-cols-1.lg\:grid-cols-2 {
    gap: 12px !important;
  }
  .grid.grid-cols-1.lg\:grid-cols-2 > div {
    border-radius: var(--m-radius) !important;
    border: none !important;
    box-shadow: var(--m-shadow-sm);
  }
}

/* ─── 태블릿 (769px ~ 1024px) ─── */
@media (min-width: 769px) and (max-width: 1024px) {
  .desktop-sidebar { width: 200px !important; }
  .desktop-sidebar .sidebar-item span { font-size: 13px; }
  .grid.grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .ix-drawer { max-width: 400px !important; }
}

/* ─── 데스크탑 (769px 이상): 모바일 요소 숨김 ─── */
@media (min-width: 769px) {
  .mobile-header { display: none !important; }
  .bottom-nav { display: none !important; }
}

/* ╔══════════════════════════════════════════╗
   ║  애니메이션 & 키프레임                      ║
   ╚══════════════════════════════════════════╝ */

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}

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

@keyframes notifPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.3); }
}

@keyframes badgeBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

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

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ─── 풀투리프레시 ─── */
.ptr-indicator {
  position: fixed;
  top: var(--mobile-header-h);
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  width: 40px; height: 40px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  transition: transform 0.3s var(--m-transition);
  pointer-events: none;
}
.ptr-indicator.active {
  transform: translateX(-50%) translateY(10px);
}
.ptr-indicator i { color: var(--m-blue); font-size: 16px; }
.ptr-indicator.refreshing i { animation: spin 0.6s linear infinite; }

/* ─── 스와이프 액션 ─── */
.swipe-container {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  border-radius: var(--m-radius-sm);
}
.swipe-content {
  transition: transform 0.2s ease-out;
}
.swipe-actions {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: stretch;
}
.swipe-actions-right { right: 0; transform: translateX(100%); }
.swipe-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  flex-direction: column;
  gap: 3px;
  border: none;
  cursor: pointer;
}
.swipe-action-btn.approve { background: linear-gradient(135deg, #22c55e, #16a34a); }
.swipe-action-btn.reject { background: linear-gradient(135deg, #ef4444, #dc2626); }
.swipe-action-btn.assign { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.swipe-action-btn i { font-size: 16px; }

/* ─── 알림센터 슬라이드 패널 ─── */
#notif-center-overlay { overscroll-behavior: contain; }
#notif-center-panel {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.notif-center-item .line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-center-item:hover .group-hover\:opacity-100 { opacity: 1; }

/* ╔══════════════════════════════════════════╗
   ║  모바일 전용 유틸리티 클래스                   ║
   ╚══════════════════════════════════════════╝ */

/* 모바일 카드 입장 애니메이션 */
@media (max-width: 768px) {
  .fade-in .ix-card:nth-child(1) { animation: cardFadeIn 0.3s 0.0s both; }
  .fade-in .ix-card:nth-child(2) { animation: cardFadeIn 0.3s 0.05s both; }
  .fade-in .ix-card:nth-child(3) { animation: cardFadeIn 0.3s 0.10s both; }
  .fade-in .ix-card:nth-child(4) { animation: cardFadeIn 0.3s 0.15s both; }
  .fade-in .ix-card:nth-child(5) { animation: cardFadeIn 0.3s 0.20s both; }
  .fade-in .ix-card:nth-child(6) { animation: cardFadeIn 0.3s 0.25s both; }
  .fade-in .ix-card:nth-child(7) { animation: cardFadeIn 0.3s 0.30s both; }
  .fade-in .ix-card:nth-child(8) { animation: cardFadeIn 0.3s 0.35s both; }

  /* 섹션 페이드인 */
  .fade-in > div { animation: cardFadeIn 0.4s 0.1s both; }
  .fade-in > div:nth-child(2) { animation-delay: 0.15s; }
  .fade-in > div:nth-child(3) { animation-delay: 0.2s; }
  .fade-in > div:nth-child(4) { animation-delay: 0.25s; }
  .fade-in > div:nth-child(5) { animation-delay: 0.3s; }

  /* 타이포그래피 세분화 */
  h2 { font-size: 20px !important; }
  h3 { font-size: 15px !important; }
  .text-sm { font-size: 13px; }

  /* 스크롤바 숨김 */
  .main-content::-webkit-scrollbar { display: none; }
  .main-content { scrollbar-width: none; }

  /* 롱프레스 방지 (이미지 저장 팝업 방지) */
  img { -webkit-touch-callout: none; }

  /* 부드러운 포커스 */
  input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--m-blue-glow) !important;
    border-color: var(--m-blue) !important;
  }
}

/* ─── 고해상도 디스플레이 최적화 ─── */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
  .mobile-header { border-bottom-width: 0.5px; }
  .bottom-nav-inner { box-shadow: 0 4px 30px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.06); }
}

/* ─── 작은 화면 (375px 이하) 추가 조정 ─── */
@media (max-width: 375px) {
  .mobile-header { padding: 0 12px; }
  .mobile-header .title { font-size: 15px; }
  .main-content #content { padding: 12px !important; }
  .bottom-nav { padding: 0 8px calc(var(--safe-bottom) + 6px) 8px; }
  .bottom-nav-inner { height: 56px; border-radius: 18px; }
  .bottom-nav-item i { font-size: 17px; }
  .bottom-nav-item span { font-size: 9px; }
  .grid.grid-cols-4, .grid.grid-cols-3 { gap: 8px !important; }
  .ix-card { padding: 14px !important; }
}

/* ─── 다크모드 지원 (OS 설정 기반) ─── */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  /* 추후 다크모드 지원 시 여기에 추가 */
}

/* ================================================================
   팀장 현장 모바일 최적화 v2.0
   - 칸반 카드 터치 친화적 크기
   - 사진 업로드 영역 확대
   - 모달 전체화면 모드
   - 상태 카드 모바일 가독성
   ================================================================ */
@media (max-width: 768px) {
  /* 칸반 칼럼: 320px → 화면 맞춤 (좌우 패딩 제외) */
  .kanban-column {
    width: calc(100vw - 40px) !important;
    min-width: calc(100vw - 40px) !important;
    flex-shrink: 0 !important;
  }
  .kanban-board {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-column {
    scroll-snap-align: center;
  }

  /* 칸반 카드 터치 영역 확대 */
  .kanban-card {
    padding: 14px !important;
    min-height: 72px;
  }
  .kanban-card .text-xs {
    font-size: 13px !important;
    line-height: 1.4;
  }

  /* 모달: 모바일 전체화면 */
  .modal-overlay > div {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .modal-overlay > div > .flex-1 {
    max-height: calc(100dvh - 120px) !important;
  }

  /* 사진 업로드 버튼: 터치 친화적 */
  .photo-upload-btn,
  input[type="file"] + label,
  [onclick*="attachPhoto"] {
    min-height: 48px !important;
    min-width: 48px !important;
    font-size: 14px !important;
  }

  /* 사진 미리보기 크기 확대 */
  img[class*="w-20"][class*="h-20"] {
    width: 88px !important;
    height: 88px !important;
  }

  /* 상태 뱃지 모바일 가독성 */
  .status-badge {
    font-size: 11px !important;
    padding: 3px 10px !important;
    border-radius: 12px !important;
  }

  /* 버튼 터치 영역 최소 44px */
  button, [role="button"], .ix-clickable {
    min-height: 44px;
  }

  /* 작업 상세 드로어: 모바일 전체화면 */
  .drawer-overlay > div {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* 테이블 → 카드형 변환 지원 */
  .mobile-table-card {
    display: block !important;
  }
  .mobile-table-card thead { display: none; }
  .mobile-table-card tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: white;
  }
  .mobile-table-card tbody td {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border: none !important;
  }
  .mobile-table-card tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
  }

  /* 숫자 입력 필드 터치 친화적 */
  input[type="number"], input[type="date"], input[type="time"] {
    min-height: 44px !important;
    font-size: 16px !important; /* iOS 줌 방지 */
  }

  /* select 터치 친화적 */
  select {
    min-height: 44px !important;
    font-size: 16px !important;
  }

  /* 체크리스트 체크박스 확대 */
  input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    margin-right: 8px !important;
  }

  /* 주문 카드 내 액션 버튼 */
  .order-action-btn {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
  }

  /* 플로팅 액션 버튼 (작업 빠른 실행) */
  .fab-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
    right: 16px;
    z-index: 35;
  }

  /* 풀 투 리프레시 텍스트 */
  .pull-indicator { font-size: 13px !important; }
}
