@charset "UTF-8";
        body {
            font-family: 'Inter', 'Noto Sans KR', sans-serif;
        }
        /* Excel style table input controls */
        /* 스플릿 주(27-1/27-2) 표기에서 26주차와 동일한 '진짜' 네이티브 달력 아이콘만 노출시키는 date input */
        .icon-only-date-picker {
            width: 18px;
            height: 18px;
            -webkit-appearance: none;
            appearance: none;
            border: none;
            outline: none;
            background: transparent;
            padding: 0;
            margin: 0 0 0 4px;
            color: transparent;
            cursor: pointer;
            vertical-align: middle;
        }
        .icon-only-date-picker::-webkit-datetime-edit,
        .icon-only-date-picker::-webkit-inner-spin-button,
        .icon-only-date-picker::-webkit-clear-button {
            display: none;
        }
        .icon-only-date-picker::-webkit-calendar-picker-indicator {
            opacity: 1;
            padding: 0;
            margin: 0;
            cursor: pointer;
        }
        .grid-input {
            width: 100%;
            height: 100%;
            border: none;
            outline: none;
            padding: 4px;
            font-size: 13px;
            text-align: center;
            background-color: transparent;
            transition: all 0.2s;
        }
        .grid-input:focus {
            background-color: #f0fdf4; /* Light green on focus */
            box-shadow: inset 0 0 0 2px #22c55e;
        }
        .remark-input {
            width: 100%;
            height: 100%;
            border: none;
            outline: none;
            padding: 6px 8px;
            font-size: 13px;
            background-color: transparent;
            word-break: break-all;
            white-space: pre-wrap;
        }
        .remark-input:focus {
            background-color: #f8fafc;
            box-shadow: inset 0 0 0 1px #cbd5e1;
        }
        /* Remove number input spin buttons */
        input[type="number"]::-webkit-outer-spin-button,
        input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        input[type="number"] {
            -moz-appearance: textfield;
        }
        /* Scrollbar customization */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: #f1f5f9;
        }
        ::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }
        /* Print utilities */
        @media print {
            .print-hide {
                display: none !important;
            }
            /* 주간 타임시트 'PDF로 출력' 인쇄 모드: 인쇄 대상 컨테이너만 남기고 나머지는 모두 숨긴다. */
            body.weekly-pdf-print-mode > *:not(#weekly-pdf-print-root) {
                display: none !important;
            }
            body.weekly-pdf-print-mode #weekly-pdf-print-root {
                display: block !important;
            }
            /* 배경색·테두리색이 인쇄 시 브라우저에 의해 지워지지 않도록 강제 유지 */
            #weekly-pdf-print-root, #weekly-pdf-print-root * {
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
                color-adjust: exact !important;
            }
            /* 화면용 옅은 테두리(border-slate-200) 대신, 인쇄에서 뚜렷하게 보이도록 재지정 */
            #weekly-pdf-print-root table {
                border-collapse: collapse !important;
            }
            #weekly-pdf-print-root th,
            #weekly-pdf-print-root td {
                border: 1px solid #475569 !important;
            }
            /* 좁아진 인쇄 열 폭에서 내용이 옆 칸과 겹치지 않도록 자동 줄바꿈 강제
               (헤더 라벨의 whitespace-nowrap, PROJECT NO 칸의 인라인 nowrap/ellipsis 무력화) */
            #weekly-pdf-print-root th,
            #weekly-pdf-print-root td {
                white-space: normal !important;
                overflow: visible !important;
                text-overflow: clip !important;
                word-break: break-all !important;
            }
            #weekly-pdf-print-root th span {
                white-space: normal !important;
            }
            #weekly-pdf-print-root tbody td:nth-child(2),
            #weekly-pdf-print-root tbody td:nth-child(2) * {
                max-width: none !important;
                width: auto !important;
                white-space: normal !important;
                overflow: visible !important;
                text-overflow: clip !important;
                word-break: break-all !important;
            }
            /* 표 폭: 화면용 min-w(가로 스크롤 대비 최소폭)를 인쇄에서는 해제하고 페이지 폭에 맞춤 */
            #weekly-pdf-print-root .overflow-x-auto {
                overflow: visible !important;
            }
            #weekly-pdf-print-root table {
                table-layout: fixed !important;
                width: 100% !important;
                min-width: 0 !important;
            }
            /* 열 가로폭: 엑셀 출력(exportWeeklyOriginalExcel ws.columns) 비율과 동일하게 재분배
               NO(5) : PROJECT NO(9) : WORK CODE(7) : PLAN M/H(7) : 요일×7(7씩) : WEEK TOTAL(8) : REMARK(35) = 합 120 */
            #weekly-pdf-print-root thead tr:first-child th:nth-child(1) { width: 4.17% !important; }
            #weekly-pdf-print-root thead tr:first-child th:nth-child(2) { width: 7.5%  !important; }
            #weekly-pdf-print-root thead tr:first-child th:nth-child(3) { width: 5.83% !important; }
            #weekly-pdf-print-root thead tr:first-child th:nth-child(4) { width: 5.83% !important; }
            #weekly-pdf-print-root thead tr:first-child th:nth-child(n+5):nth-child(-n+11) { width: 5.83% !important; }
            #weekly-pdf-print-root thead tr:first-child th:nth-child(12) { width: 6.67%  !important; }
            #weekly-pdf-print-root thead tr:first-child th:nth-child(13) {
                width: 29.17% !important;
                max-width: none !important;
                min-width: 0 !important;
            }
            /* 다크 모드로 보고 있어도 PDF 출력은 항상 화이트(라이트) 모드 기준 색상으로 고정.
               body.theme-dark [class~="..."] 규칙보다 specificity가 높도록 #weekly-pdf-print-root를 포함시켜 무력화 */
            body.theme-dark #weekly-pdf-print-root [class~="bg-slate-100"]  { background-color:#f1f5f9 !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-slate-50"]   { background-color:#f8fafc !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-slate-50/40"]{ background-color:rgba(248,250,252,0.4) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-slate-50/60"]{ background-color:rgba(248,250,252,0.6) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-cyan-50/70"] { background-color:rgba(236,254,255,0.7) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-cyan-50/40"] { background-color:rgba(236,254,255,0.4) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-cyan-100"]   { background-color:#cffafe !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-cyan-200"]   { background-color:#a5f3fc !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-sky-100/50"] { background-color:rgba(224,242,254,0.5) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-sky-50/10"]  { background-color:rgba(240,249,255,0.1) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-rose-100/70"]{ background-color:rgba(255,228,230,0.7) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-rose-50/20"] { background-color:rgba(255,241,242,0.2) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-indigo-50/10"]{ background-color:rgba(238,242,255,0.1) !important; }
            body.theme-dark #weekly-pdf-print-root [class~="bg-white"]      { background-color:#ffffff !important; }

            body.theme-dark #weekly-pdf-print-root div[class~="border-slate-200"]{ border-color:#e2e8f0 !important; }
            body.theme-dark #weekly-pdf-print-root div[class~="border-slate-300"]{ border-color:#cbd5e1 !important; }

            body.theme-dark #weekly-pdf-print-root [class~="text-slate-300"]{ color:#cbd5e1 !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-slate-400"]{ color:#94a3b8 !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-slate-500"]{ color:#64748b !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-slate-600"]{ color:#475569 !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-slate-700"]{ color:#334155 !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-slate-800"]{ color:#1e293b !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-slate-900"]{ color:#0f172a !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-indigo-950"]{ color:#1e1b4b !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-rose-400"] { color:#fb7185 !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-rose-500"] { color:#f43f5e !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-rose-600"] { color:#e11d48 !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-sky-500"]  { color:#0ea5e9 !important; }
            body.theme-dark #weekly-pdf-print-root [class~="text-sky-600"]  { color:#0284c7 !important; }
            /* 인쇄 시 콘텐츠 상단 여백: 하단에 남는 여백과 균형이 맞도록 위쪽 padding을 넉넉히 확보
               (exportWeeklySheetPDF가 만드는 printRoot 최상단 div의 인라인 padding:12px를 덮어씀) */
            #weekly-pdf-print-root > div {
                padding-top: 25mm !important;
            }
            /* 다중 선택 PDF 출력(exportSelectedHeadSheetsToPDF): 시트마다 새 페이지로 분리하되
               마지막 시트 뒤에는 불필요한 빈 페이지가 추가되지 않도록 함 */
            #weekly-pdf-print-root > div.pdf-export-page {
                page-break-after: always;
                break-after: page;
            }
            #weekly-pdf-print-root > div.pdf-export-page:last-child {
                page-break-after: auto;
                break-after: auto;
            }
            /* 인쇄 영역 자체의 바탕도 항상 흰색으로 고정 */
            #weekly-pdf-print-root {
                background:#ffffff !important;
                color:#0f172a !important;
            }
        }
        @page {
            size: A4 landscape;
            margin: 10mm;
        }
        /* 화면에서는 항상 숨김. 인쇄 모드(body.weekly-pdf-print-mode)일 때만 노출된다. */
        #weekly-pdf-print-root {
            display: none;
        }

        /* ══════════════════════════════════════════════════════════
           관리자 탭: 상단(요약 위젯 + 탭 내비게이션) 고정 영역
           - 전역 헤더(sticky, --header-h) 바로 아래에 고정되고
           - 그 아래 탭 콘텐츠 박스만 스크롤됩니다.
           ══════════════════════════════════════════════════════════ */
        .admin-sticky-top{
            position: sticky;
            top: var(--header-h, 64px);
            z-index: 30;
            background-color: #f1f5f9; /* Tailwind bg-slate-100 과 동일 (body 배경과 일치) */
        }
        body.theme-dark .admin-sticky-top{
            background-color: #262626; /* 다크모드 bg-slate-100 대응 값과 일치 */
        }

        /* ══════════════════════════════════════════════════════════
           공통 좌측 사이드바 (외출현황 index.php 와 동일 컴포넌트)
           ══════════════════════════════════════════════════════════ */
        :root{
          --accent:#c17f3a;--accent2:#a86a28;
          --bg2:#212121;--card:#2f2f2f;--card2:#383838;
          --border:rgba(255,255,255,0.08);--border2:rgba(255,255,255,0.13);
          --text:#ececec;--sub:#8e8ea0;--hint:#555;
          --radius:12px;--radius-sm:8px;
        }
        /* 사이드바 테마 토글(화이트 모드) — index.php 라이트 팔레트와 동일 값 */
        body.theme-light{
          --accent:#1C3F6E;--accent2:#15305a;
          --bg2:#fff;--card:#fff;--card2:#f0f0ee;
          --border:#e5e5e5;--border2:#d0d0d0;
          --text:#1a1a1a;--sub:#888;--hint:#bbb;
        }

        .mobile-sidebar-overlay{
          display:none;
          position:fixed;top:0;left:0;right:0;bottom:0;
          background:rgba(0,0,0,0.55);
          z-index:1800;
        }
        .mobile-sidebar-overlay.open{ display:block; }

        /* 실시간 알림 토스트 위치: 기본(모바일)은 좌측 하단 */
        .toast-position{ bottom:24px; left:24px; }

        @media (min-width: 1024px){
          /* PC: 사이드바(폭 220px) 바로 우측에 표시 */
          .toast-position{ left:calc(220px + 24px); }
        }

        .pc-sidebar{display:none}
        #mobileLogoBtn{ cursor:pointer; }

        /* 토큰이 만료/누락돼도 사이드바 사용자 항목을 완전히 숨기지 않고
           "로그아웃됨" 상태로 표시한다 (외출현황 index.php와 동일한 스타일). */
        .pc-sidebar-footer.logged-out{ opacity:0.6; }
        .pc-sidebar-footer.logged-out:hover{ opacity:1; background:var(--card2); }
        .pc-sidebar-footer.logged-out .pc-sidebar-user small{ color:#f87171; }

        @media (min-width: 1024px){
          .pc-sidebar{
            display:flex;flex-direction:column;
            position:fixed;top:0;left:0;bottom:0;width:220px;
            background:var(--bg2);border-right:1px solid var(--border);
            padding:0;gap:0;z-index:900;box-sizing:border-box;overflow:hidden;
          }
          .pc-sidebar-header{
            display:flex;align-items:center;justify-content:center;
            padding:10px 6px 16px 6px;border-bottom:1px solid var(--border);flex-shrink:0;
          }
          .pc-sidebar-header .sidebar-logo-img{
            width:100%;max-width:180px;height:auto;max-height:52px;object-fit:contain;
          }
          .pc-sidebar-nav{
            flex:1;display:flex;flex-direction:column;gap:10px;
            padding:20px 14px 0 14px;overflow-y:auto;
          }
          .pc-side-btn{
            display:flex;align-items:center;gap:10px;padding:11px 14px;
            border-radius:var(--radius-sm);border:1px solid var(--border);
            background:var(--card);color:var(--text);font-size:14px;font-weight:600;
            cursor:pointer;text-decoration:none;font-family:inherit;
            transition:all 0.15s;text-align:left;
          }
          .pc-side-btn:hover{ background:var(--accent);color:#fff;border-color:var(--accent); }
          .pc-side-btn svg{
            width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;
            stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;
          }
          .pc-side-btn.active{ background:var(--accent);color:#fff;border-color:var(--accent); }
          .pc-side-btn.pc-side-btn-sejong-ai:hover{
            background:linear-gradient(90deg,#7B6CF6,#4DC8C8);color:#fff;border-color:transparent;
          }
          .pc-side-btn.pc-side-btn-timesheet:hover,
          .pc-side-btn.pc-side-btn-timesheet.active{
            background:linear-gradient(90deg,#1E1B4B,#4F46E5) !important;color:#fff !important;border-color:transparent !important;
          }
          .pc-side-btn.pc-side-btn-overtime:hover,
          .pc-side-btn.pc-side-btn-overtime.active{
            background:linear-gradient(90deg,#4F46E5,#1E1B4B) !important;color:#fff !important;border-color:transparent !important;   /* 타임시트 버튼 그라데이션의 반대 방향 */
          }
          .pc-side-btn.pc-side-btn-car:hover{
            background:#2563eb !important;color:#fff !important;border-color:#2563eb !important;
          }
          .pc-side-btn.pc-side-btn-leave:hover{
            background:#2AAFC2 !important;color:#fff !important;border-color:#2AAFC2 !important;
          }
          .pc-sidebar-footer{
            padding:12px 16px;border-top:1px solid var(--border);
            display:flex;align-items:center;gap:8px;flex-shrink:0;
            position:relative;cursor:pointer;
          }
          .pc-sidebar-footer:hover{ background:var(--card2); }
          .pc-sidebar-user{flex:1;overflow:hidden;}
          .pc-sidebar-user span{
            display:block;color:var(--text);font-weight:600;font-size:13px;
            white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
          }
          .pc-sidebar-user small{ color:var(--sub);font-size:11px; }
          .pc-sidebar-logout{
            background:none !important;border:none !important;color:var(--sub) !important;
            font-size:18px;padding:4px;border-radius:4px;flex-shrink:0;cursor:pointer;
            transition:color 0.15s;text-decoration:none;line-height:1;
          }
          .pc-sidebar-logout:hover{ background:none !important;border:none !important;color:#ef4444 !important; }
          /* 본문을 사이드바 폭만큼 오른쪽으로 이동 */
          body{ padding-left:220px; }
        }

        @media (max-width:1023px){
          .pc-sidebar{
            display:flex !important;flex-direction:column;
            position:fixed;top:0;left:0;bottom:0;width:240px;
            background:var(--bg2);border-right:1px solid var(--border);
            z-index:1900;box-sizing:border-box;overflow:hidden;
            transform:translateX(-100%);
            transition:transform 0.25s cubic-bezier(0.4,0,0.2,1);
          }
          .pc-sidebar.mobile-open{ transform:translateX(0); }
          .pc-sidebar-header{
            display:flex !important;align-items:center;justify-content:center;
            padding:20px 16px 16px;border-bottom:1px solid var(--border);flex-shrink:0;
          }
          .pc-sidebar-header .sidebar-logo-img{
            width:100%;max-width:180px;height:auto;max-height:52px;object-fit:contain;
          }
          .pc-sidebar-nav{
            flex:1;display:flex !important;flex-direction:column;gap:10px;
            padding:20px 14px 0 14px;overflow-y:auto;
          }
          .pc-side-btn{
            display:flex !important;align-items:center;gap:10px;padding:13px 14px;
            border-radius:var(--radius-sm);border:1px solid var(--border);
            background:var(--card);color:var(--text);font-size:14px;font-weight:600;
            cursor:pointer;text-decoration:none;font-family:inherit;
            transition:all 0.15s;text-align:left;
          }
          .pc-side-btn svg{
            width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;
            stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;
          }
          .pc-sidebar-footer{
            padding:12px 16px;border-top:1px solid var(--border);
            display:flex !important;align-items:center;gap:8px;flex-shrink:0;
            position:relative;cursor:pointer;
          }
          .pc-sidebar-user{flex:1;overflow:hidden;}
          .pc-sidebar-user span{
            display:block;color:var(--text);font-weight:600;font-size:13px;
            white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
          }
          .pc-sidebar-user small{ color:var(--sub);font-size:11px; }
          .pc-sidebar-logout{
            background:none !important;border:none !important;color:var(--sub) !important;
            font-size:18px;padding:4px;border-radius:4px;flex-shrink:0;cursor:pointer;
            transition:color 0.15s;text-decoration:none;line-height:1;
          }
        }

        .sidebar-user-popup{
          position:absolute;bottom:calc(100% + 8px);left:12px;right:12px;
          background:var(--card);border:1px solid var(--border2);border-radius:var(--radius);
          box-shadow:0 -4px 24px rgba(0,0,0,0.45);z-index:9100;overflow:hidden;
          animation:popupSlideUp .18s ease both;
        }
        @keyframes popupSlideUp{
          from{opacity:0;transform:translateY(8px)}
          to{opacity:1;transform:translateY(0)}
        }
        .sidebar-user-popup-item{
          display:flex;align-items:center;gap:10px;padding:13px 16px;
          font-size:14px;font-weight:600;color:var(--text);cursor:pointer;
          border-bottom:1px solid var(--border);transition:background 0.12s;user-select:none;
        }
        .sidebar-user-popup-item:last-child{ border-bottom:none; }
        .sidebar-user-popup-item:hover{ background:var(--card2); }
        .sidebar-user-popup-item svg{
          width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;
          stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;color:var(--sub);
        }
        .sidebar-user-popup-item.danger{ color:#f87171; }
        .sidebar-user-popup-item.danger svg{ color:#f87171; }
        .hidden{ display:none !important; }
/* ═══════════ 타임시트 다크 모드 (body.theme-dark) ═══════════ */
body.theme-dark{ background:#1a1a1a !important; color:#ececec !important; }

/* 타임시트 입력 그리드: 라이트 모드는 td의 옅은 배경색(bg-indigo-50/10 등)과 테두리로
   "입력 가능 칸"과 "잠긴 칸"이 뚜렷이 구분되지만, 다크 모드에서는 그 배경색들이 거의
   보이지 않고 grid-input/remark-input 자체는 transparent라 셀 구분이 흐려진다.
   따라서 다크 모드에서는 input/textarea 자체에 옅은 배경 대비를 직접 부여한다. */
/* 입력 가능한 셀: 검은 배경과 확실히 구별되도록 순색조 없는 밝기 차이만 사용 */
body.theme-dark .grid-input{
  background-color: rgba(255,255,255,0.055);
}
/* 잠긴(입력 불가) 셀: 완전 투명으로 낮춰서 '입력가능 vs 잠김' 대비를 명확히 */
body.theme-dark .grid-input[data-permanent-lock="true"]{
  background-color: transparent;
}
body.theme-dark .remark-input{
  background-color: rgba(255,255,255,0.055);
}
/* WED/THU/FRI 강조 열(bg-indigo-50/10): 인풋 배경 통일 */
body.theme-dark td[class~="bg-indigo-50/10"] .grid-input{
  background-color: rgba(255,255,255,0.055);
}
/* WED/THU/FRI td 자체에 남아있던 인디고 틴트(0.08)를 완전히 제거해
   MON/TUE/SAT과 셀 여백까지 완벽히 동일한 톤이 되도록 함 */
body.theme-dark td[class~="bg-indigo-50/10"]{
  background-color: transparent !important;
}

/* 배경색 */
body.theme-dark [class~="bg-amber-100"]{ background-color:rgba(245,158,11,0.22) !important; }
body.theme-dark [class~="bg-amber-50"]{ background-color:rgba(245,158,11,0.15) !important; }
body.theme-dark [class~="bg-cyan-100"]{ background-color:rgba(6,182,212,0.22) !important; }
body.theme-dark [class~="bg-cyan-200"]{ background-color:rgba(6,182,212,0.28) !important; }
body.theme-dark [class~="bg-cyan-50/40"]{ background-color:rgba(6,182,212,0.15) !important; }
body.theme-dark [class~="bg-cyan-50/60"]{ background-color:rgba(6,182,212,0.18) !important; }
body.theme-dark [class~="bg-cyan-50/70"]{ background-color:rgba(6,182,212,0.20) !important; }
body.theme-dark [class~="bg-emerald-100"]{ background-color:rgba(16,185,129,0.22) !important; }
body.theme-dark [class~="bg-emerald-50"]{ background-color:rgba(16,185,129,0.15) !important; }
body.theme-dark [class~="bg-indigo-100"]{ background-color:rgba(99,102,241,0.22) !important; }
body.theme-dark [class~="bg-indigo-50"]{ background-color:rgba(99,102,241,0.15) !important; }
body.theme-dark [class~="bg-indigo-50/10"]{ background-color:rgba(99,102,241,0.08) !important; }
body.theme-dark [class~="bg-indigo-50/20"]{ background-color:rgba(99,102,241,0.12) !important; }
body.theme-dark [class~="bg-indigo-50/30"]{ background-color:rgba(99,102,241,0.15) !important; }
body.theme-dark [class~="bg-indigo-50/50"]{ background-color:rgba(99,102,241,0.18) !important; }
body.theme-dark [class~="bg-rose-100"]{ background-color:rgba(244,63,94,0.22) !important; }
body.theme-dark [class~="bg-rose-100/70"]{ background-color:rgba(244,63,94,0.20) !important; }
body.theme-dark [class~="bg-rose-200"]{ background-color:rgba(244,63,94,0.28) !important; }
body.theme-dark [class~="bg-rose-50"]{ background-color:rgba(244,63,94,0.15) !important; }
body.theme-dark [class~="bg-rose-50/20"]{ background-color:rgba(244,63,94,0.10) !important; }
body.theme-dark [class~="bg-rose-50/30"]{ background-color:rgba(244,63,94,0.13) !important; }
body.theme-dark [class~="bg-rose-50/50"]{ background-color:rgba(244,63,94,0.17) !important; }
body.theme-dark [class~="bg-sky-100/50"]{ background-color:rgba(14,165,233,0.20) !important; }
body.theme-dark [class~="bg-sky-50/10"]{ background-color:rgba(14,165,233,0.08) !important; }
body.theme-dark [class~="bg-sky-50/30"]{ background-color:rgba(14,165,233,0.13) !important; }
body.theme-dark [class~="bg-sky-50/50"]{ background-color:rgba(14,165,233,0.17) !important; }
body.theme-dark [class~="bg-slate-100"]{ background-color:#262626 !important; }
body.theme-dark [class~="bg-slate-100/75"]{ background-color:rgba(38,38,38,0.85) !important; }
body.theme-dark [class~="bg-slate-100/80"]{ background-color:rgba(38,38,38,0.9) !important; }
body.theme-dark [class~="bg-slate-200"]{ background-color:#333333 !important; }
body.theme-dark [class~="bg-slate-200/60"]{ background-color:rgba(51,51,51,0.7) !important; }
body.theme-dark [class~="bg-slate-200/70"]{ background-color:rgba(51,51,51,0.8) !important; }
body.theme-dark [class~="bg-slate-300"]{ background-color:#404040 !important; }
body.theme-dark [class~="bg-slate-50"]{ background-color:#202020 !important; }
body.theme-dark [class~="bg-slate-50/40"]{ background-color:rgba(32,32,32,0.6) !important; }
body.theme-dark [class~="bg-slate-50/50"]{ background-color:rgba(32,32,32,0.65) !important; }
body.theme-dark [class~="bg-slate-50/60"]{ background-color:rgba(32,32,32,0.7) !important; }
body.theme-dark [class~="bg-slate-50/70"]{ background-color:rgba(32,32,32,0.8) !important; }
body.theme-dark [class~="bg-white"]{ background-color:#2b2b2b !important; }

/* 테두리 색 */
body.theme-dark [class~="border-amber-300"]{ border-color:rgba(245,158,11,0.35) !important; }
body.theme-dark [class~="border-emerald-200"]{ border-color:rgba(16,185,129,0.3) !important; }
body.theme-dark [class~="border-emerald-300"]{ border-color:rgba(16,185,129,0.35) !important; }
body.theme-dark [class~="border-indigo-100"]{ border-color:rgba(99,102,241,0.25) !important; }
body.theme-dark [class~="border-indigo-200"]{ border-color:rgba(99,102,241,0.3) !important; }
body.theme-dark [class~="border-indigo-300"]{ border-color:rgba(99,102,241,0.35) !important; }
body.theme-dark [class~="border-slate-100"]{ border-color:rgba(255,255,255,0.07) !important; }
body.theme-dark [class~="border-slate-200"]{ border-color:rgba(255,255,255,0.10) !important; }
body.theme-dark [class~="border-slate-300"]{ border-color:rgba(255,255,255,0.16) !important; }
body.theme-dark [class~="border-slate-700"]{ border-color:rgba(255,255,255,0.25) !important; }

/* 텍스트 색 */
body.theme-dark [class~="text-amber-500"]{ color:#fbbf24 !important; }
body.theme-dark [class~="text-amber-800"]{ color:#fcd34d !important; }
body.theme-dark [class~="text-amber-900"]{ color:#fde68a !important; }
body.theme-dark [class~="text-emerald-600"]{ color:#6ee7b7 !important; }
body.theme-dark [class~="text-emerald-800"]{ color:#6ee7b7 !important; }
body.theme-dark [class~="text-emerald-900"]{ color:#a7f3d0 !important; }
body.theme-dark [class~="text-indigo-500"]{ color:#a5b4fc !important; }
body.theme-dark [class~="text-indigo-600"]{ color:#a5b4fc !important; }
body.theme-dark [class~="text-indigo-700"]{ color:#a5b4fc !important; }
body.theme-dark [class~="text-indigo-800"]{ color:#c7d2fe !important; }
body.theme-dark [class~="text-indigo-900"]{ color:#c7d2fe !important; }
body.theme-dark [class~="text-indigo-950"]{ color:#e0e7ff !important; }
body.theme-dark [class~="text-rose-400"]{ color:#fda4af !important; }
body.theme-dark [class~="text-rose-500"]{ color:#fda4af !important; }
body.theme-dark [class~="text-rose-600"]{ color:#fca5a5 !important; }
body.theme-dark [class~="text-rose-700"]{ color:#fecaca !important; }
body.theme-dark [class~="text-rose-800"]{ color:#fecdd3 !important; }
body.theme-dark [class~="text-sky-500"]{ color:#7dd3fc !important; }
body.theme-dark [class~="text-sky-600"]{ color:#7dd3fc !important; }
body.theme-dark [class~="text-slate-300"]{ color:#64748b !important; }
body.theme-dark [class~="text-slate-400"]{ color:#7c8797 !important; }
body.theme-dark [class~="text-slate-500"]{ color:#94a3b8 !important; }
body.theme-dark [class~="text-slate-600"]{ color:#b0b8c1 !important; }
body.theme-dark [class~="text-slate-700"]{ color:#cbd5e1 !important; }
body.theme-dark [class~="text-slate-800"]{ color:#e2e8f0 !important; }
body.theme-dark [class~="text-slate-900"]{ color:#f1f5f9 !important; }

/* 구분선 (divide) */
body.theme-dark [class~="divide-slate-100"] > :not([hidden]) ~ :not([hidden]){
  border-color:rgba(255,255,255,0.07) !important;
}

/* 폼 요소: 네이티브 다크 컨트롤 + placeholder */
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea{
  color-scheme:dark;
}
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder{
  color:#6b7280 !important;
}

/* 인풋 포커스 하이라이트 (라이트 전용 배경색 재정의) */
body.theme-dark .grid-input:focus{
  background-color:rgba(34,197,94,0.15) !important;
  box-shadow: inset 0 0 0 2px #22c55e;
}
body.theme-dark .remark-input:focus{
  background-color:rgba(148,163,184,0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

/* 스크롤바 (다크) */
body.theme-dark ::-webkit-scrollbar-track{ background:#262626; }
body.theme-dark ::-webkit-scrollbar-thumb{ background:#4b4b4b; }
body.theme-dark ::-webkit-scrollbar-thumb:hover{ background:#5f5f5f; }

/* 그림자 완화 */
body.theme-dark .shadow-sm,
body.theme-dark .shadow-md,
body.theme-dark .shadow-2xl{
  box-shadow:0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4) !important;
}

/* ═══ hover:/focus: variant 다크 모드 보정 (Tailwind는 DOM class에 'hover:bg-x' 원문 토큰을 그대로 남기므로 별도 매칭 필요) ═══ */
body.theme-dark [class~="hover:bg-slate-300"]:hover{ background-color:#404040 !important; }
body.theme-dark [class~="hover:bg-slate-50"]:hover{ background-color:#202020 !important; }
body.theme-dark [class~="hover:bg-slate-100"]:hover{ background-color:#262626 !important; }
body.theme-dark [class~="hover:bg-slate-200/70"]:hover{ background-color:rgba(51,51,51,0.8) !important; }
body.theme-dark [class~="hover:bg-slate-200"]:hover{ background-color:#333333 !important; }
body.theme-dark [class~="hover:bg-white"]:hover{ background-color:#2b2b2b !important; }
body.theme-dark [class~="hover:bg-slate-50/50"]:hover{ background-color:rgba(32,32,32,0.65) !important; }
body.theme-dark [class~="hover:bg-indigo-100"]:hover{ background-color:rgba(99,102,241,0.22) !important; }
body.theme-dark [class~="hover:bg-indigo-50/10"]:hover{ background-color:rgba(99,102,241,0.08) !important; }
body.theme-dark [class~="hover:bg-emerald-100"]:hover{ background-color:rgba(16,185,129,0.22) !important; }
body.theme-dark [class~="hover:bg-emerald-50"]:hover{ background-color:rgba(16,185,129,0.15) !important; }
body.theme-dark [class~="hover:bg-rose-100"]:hover{ background-color:rgba(244,63,94,0.22) !important; }
body.theme-dark [class~="hover:bg-amber-100"]:hover{ background-color:rgba(245,158,11,0.22) !important; }
body.theme-dark [class~="hover:text-slate-800"]:hover{ color:#e2e8f0 !important; }
body.theme-dark [class~="hover:text-slate-700"]:hover{ color:#cbd5e1 !important; }
body.theme-dark [class~="hover:text-slate-600"]:hover{ color:#b0b8c1 !important; }
body.theme-dark [class~="hover:border-indigo-300"]:hover{ border-color:rgba(99,102,241,0.35) !important; }

/* PROJECT NO / WORK CODE 헤더의 "목록"·"테이블" 버튼: 기존 bg-indigo-50 조합이 다크 배경에서
   대비가 낮아 잘 안 보이는 문제 보정 — 배경/테두리를 더 진하고 밝게, 글자는 더 밝게 처리 */
body.theme-dark .ts-helper-btn{
  background-color:rgba(99,102,241,0.32) !important;
  border-color:rgba(165,180,252,0.55) !important;
  color:#eef1ff !important;
}
body.theme-dark .ts-helper-btn:hover{
  background-color:rgba(99,102,241,0.48) !important;
  border-color:rgba(165,180,252,0.75) !important;
}

/* ═══ 검색창 X(지우기) 버튼 ═══ */
.ts-search-input-padded{
  padding-right: 2rem !important;
}
.ts-search-clear-btn{
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.ts-search-clear-btn:hover{
  background-color: #e2e8f0;
  color: #475569;
}
body.theme-dark .ts-search-clear-btn{
  color: #cbd5e1;
  background-color: rgba(255,255,255,0.08);
}
body.theme-dark .ts-search-clear-btn:hover{
  background-color: rgba(255,255,255,0.18);
  color: #ffffff;
}

/* ── 타임시트 행 드래그 순서변경 ────────────────────────────── */
.ts-row-drag-handle{
  cursor: grab;
}
.ts-row-drag-handle:active{
  cursor: grabbing;
}
tr.ts-row-dragging{
  opacity: 0.55;
  background-color: #e0f2fe !important;
  box-shadow: inset 0 0 0 1px #38bdf8;
}
body.ts-row-drag-active{
  cursor: grabbing !important;
  user-select: none !important;
}
body.ts-row-drag-active *{
  user-select: none !important;
}


/* 직책 드롭업 버튼: 직급 등 다른 입력 칸(select/input)과 동일한 바탕색 (네이티브 입력 칸 색상 사용) */
.pos-dd-btn{ background-color:Field; color:FieldText; }
body.theme-dark .pos-dd-btn{ color-scheme:dark; }

/* 직책 선택 칩 (X 버튼으로 드롭업 없이 개별 제거) */
.pos-dd-btn{ min-height:42px; }
.pos-chip-wrap{ display:flex; flex-wrap:wrap; align-items:center; gap:4px; min-width:0; flex:1 1 auto; }
.pos-chip{
  display:inline-flex; align-items:center; gap:4px; max-width:100%;
  padding:2px 4px 2px 8px; border-radius:9999px;
  background:rgba(99,102,241,0.14); border:1px solid rgba(99,102,241,0.35);
  color:#4338ca; font-size:12px; font-weight:600; line-height:1.4;
}
body.theme-dark .pos-chip{ color:#c7d2fe; background:rgba(99,102,241,0.22); border-color:rgba(129,140,248,0.45); }
.pos-chip-x{
  display:inline-flex; align-items:center; justify-content:center;
  width:16px; height:16px; border-radius:9999px; cursor:pointer;
  font-size:14px; line-height:1; opacity:.75; transition:background-color .15s, opacity .15s;
}
.pos-chip-x:hover{ opacity:1; background:rgba(244,63,94,0.25); color:#e11d48; }


/* ══ 모바일 보강 (시간외 근무 화면과 동일한 방식) ═══════════════════ */
@media (max-width: 1023px) {
  /* 역할 탭 2개 이하: 헤더 우측 상단 + 글자 2줄 */
  #ts-hdr-inner.ts-hdr-few { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 8px; }
  #ts-hdr-inner.ts-hdr-few .ts-hdr-left { flex: 1 1 auto; min-width: 0; }
  #ts-hdr-inner.ts-hdr-few #ts-role-wrap { flex: 0 0 auto; }
  #ts-role-bar.ts-role-few { flex-wrap: nowrap; }
  #ts-role-bar.ts-role-few .role-btn { padding: 5px 8px; font-size: 11px; line-height: 1.2; text-align: center; }
  #ts-role-bar.ts-role-few .rl-a, #ts-role-bar.ts-role-few .rl-b { display: block; }
}
.ts-br { display: none; }
@media (max-width: 720px) {
  /* 제목 / 사용자 배지: 각각 1줄, 넘치면 폰트 자동 축소 (JS: tsFitText) */
  .ts-hdr-left > div:last-child { min-width: 0; flex: 1 1 auto; }
  .ts-title-row { flex-direction: column !important; align-items: flex-start !important; gap: 4px !important; min-width: 0; width: 100%; }   /* Tailwind items-center 보다 우선 */
  .ts-title-row > * { align-self: flex-start; }
  #ts-hdr-inner h1, #user-badge { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; }
  #user-badge { padding: 3px 8px; }

  /* 본부명 · 사원번호 · 성명 한 줄 (항목명은 말줄임) / 주차는 아래 줄 */
  #ts-meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 12px; }
  #ts-meta-grid > div { min-width: 0; }
  #ts-meta-grid > div:nth-child(4) { grid-column: 1 / -1; }
  #ts-meta-grid > div:nth-child(-n+3) > label { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #ts-meta-grid > div:nth-child(-n+3) select, #ts-meta-grid > div:nth-child(-n+3) input { font-size: 12px; padding: 6px; min-width: 0; text-overflow: ellipsis; }

  /* 하단 버튼 4개: 2줄 글자 + 아이콘 제거 + 폰트 축소 */
  .ts-act-bar { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .ts-act-btn { flex: 1 1 0; min-width: 0; padding: 7px 4px !important; font-size: 11px; line-height: 1.25; text-align: center; justify-content: center; white-space: nowrap; }
  .ts-act-btn svg { display: none; }
  .ts-br { display: inline; }

  /* 목록 표(내 현황 / 본부장 결재대기·결재완료): 시간외 근무와 동일 — 12px, 한 줄, 가로 스크롤 */
  .ts-list-tbl { font-size: 12px; }
  .ts-list-tbl th, .ts-list-tbl td { padding: 8px 7px !important; white-space: nowrap !important; font-size: 12px; line-height: 1.3; }
  .ts-list-tbl td button { white-space: nowrap; }
}

/* 모바일: 조회창 소속·사번·성명 한 줄 (항목명/값 말줄임), 주차는 아래 줄 */
@media (max-width: 720px) {
  .ts-detail-meta.grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; padding: 12px !important; }
  .ts-detail-meta > div { min-width: 0; }
  .ts-detail-meta.grid > div:nth-child(4) { grid-column: 1 / -1 !important; }
  .ts-detail-meta > div > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ts-detail-meta > div > span:first-child { font-size: 10px; }
  .ts-detail-meta > div > span:last-child { font-size: 12px; }
}
