/* timeplanner 관리시스템 공통 스타일 */

/* 색상 변수 */
:root {
    --primary-green: #74bd43;
    --primary-dark: #003b3b;
    --primary-yellow: #fff202;
    --text-primary: #333333;
    --text-secondary: #999999;
    --border-color: #cccccc;
    --border-light: #dddddd;
    --background-light: #f2f2f2;
    --white: #ffffff;
    --blue-link: #3a8afd;
    
    /* Figma 디자인 시스템 변수 (figma-design-system.css 대체용) */
    --gradient-blue: linear-gradient(135deg, #2b7fff 0%, #155dfc 100%);
    --gradient-blue-header: linear-gradient(90deg, #314158 0%, #45556c 100%);
    --gradient-orange: linear-gradient(135deg, #ff8904 0%, #ff6900 100%);
    --gradient-orange-dark: linear-gradient(135deg, #fe9a00 0%, #e17100 100%);
    --gradient-green: linear-gradient(135deg, #00bc7d 0%, #009966 100%);
    --gradient-pink: linear-gradient(135deg, #ff637e 0%, #ff2056 100%);
    --gradient-yellow: linear-gradient(135deg, #fdc700 0%, #f0b100 100%);
    --bg-main: linear-gradient(135deg, #f8fafc 0%, #eff6ff 50%, #eef2ff 100%);
    --bg-white: #ffffff;
    --nav-active-bg: #eff6ff;
    --nav-active-text: #155dfc;
    --nav-inactive-text: #6a7282;
    --text-white: #ffffff;
    --font-size-heading: 16px;
    --font-weight-heading: 400;
    --line-height-heading: 24px;
    --font-size-subtitle: 12px;
    --font-weight-subtitle: 400;
    --line-height-subtitle: 16px;
    --opacity-subtitle: 0.8;
    --font-size-nav: 12px;
    --font-weight-nav: 400;
    --menu-button-radius: 16px;
    --nav-button-radius: 14px;
    --header-height: 60px;
    --nav-bar-height: 85px;
}

/* =========================================================
 * Card action buttons (lists)
 * - "근무자 보기" 등: 카드 전체 클릭 대신 명시적 CTA만 이동시키는 UX
 * - JSP에서 사용하는 .tp-card-actions / .tp-action-btn 공통 스타일
 * ========================================================= */
.tp-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tp-action-btn {
    /* "상세보기" 버튼과 높이/라운드감을 맞추되, 역할이 다른 보조 CTA로 보이도록 neutral outline + 아이콘 */
    background: #ffffff;
    border: 1px solid rgba(107, 114, 128, 0.45);
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    padding: 0 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
}

.tp-action-btn::after {
    content: "›";
    font-size: 18px;
    line-height: 1;
    opacity: 0.9;
    margin-top: -1px;
}

.tp-action-btn:hover {
    background: #f9fafb;
    border-color: rgba(107, 114, 128, 0.65);
}

.tp-action-btn:active {
    transform: translateY(0.5px);
}

/* =========================================================
 * Pagination (Image-aligned UI)
 * - Use: .tp-pagination, .tp-page-btn
 * ========================================================= */
.tp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.tp-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tp-page-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.tp-page-btn.is-active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.tp-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.tp-page-ellipsis {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: default;
    min-width: auto;
    padding: 0 2px;
    height: auto;
}

@media (max-width: 980px) {
    .tp-pagination {
        gap: 6px;
        padding: 0 6px;
    }
    .tp-page-btn {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .tp-page-btn {
        min-width: 28px;
        height: 28px;
        font-size: 11px;
        padding: 0 6px;
    }
}

@media (max-width: 360px) {
    .tp-page-btn {
        min-width: 26px;
        height: 26px;
        font-size: 10.5px;
        padding: 0 6px;
    }
}

/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: 'Noto Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background-color: var(--white);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Figma 디자인 배경 (선택적 적용) */
body.figma-design {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 50%, #eef2ff 100%);
    font-family: 'Arial', 'Noto Sans KR', sans-serif;
}

/* 헤더 */
.header {
    background-color: var(--primary-green);
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

/* Figma 디자인 헤더 (선택적 적용) */
.header.figma-header {
    background: var(--gradient-blue-header);
    height: var(--header-height);
    padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

.header-title {
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
}

/* Figma 디자인 헤더 타이틀 */
.header.figma-header .header-title {
    font-size: 20px;
    font-weight: 400;
    line-height: 60px;
    letter-spacing: -0.5px;
}

/* 헤더 왼쪽 영역 (뒤로가기 + 현재페이지명) */
.header-left-with-page {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* 헤더 현재 페이지명 (뒤로가기 옆, 작은 폰트) */
.header-page-name {
    color: var(--white);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.3px;
    line-height: 1.2;
    white-space: nowrap;
}

/* 헤더 중앙 타이틀 (타임플래너) - 정중앙 위치 */
.header-title-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -0.5px;
    line-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}

/* 사업체/에이전시 페이지 back-btn과 호환 */
.header-left-with-page .back-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.header-left-with-page .back-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.back-button {
    background: none;
    border: none;
    padding: 0;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    flex-shrink: 0;
}

.back-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.menu-button {
    background: none;
    border: none;
    padding: 0;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.menu-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* 사이드 메뉴 오버레이 */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* 홈 화면에서 menu-bar z-index 오버라이드 등과 충돌 방지: 사이드메뉴는 항상 최상위 레이어 */
    z-index: 5000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.side-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 사이드 메뉴 */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85%;
    height: 100%;
    background: var(--white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translate3d(100%, 0, 0);
    transition: transform 0.3s ease;
    z-index: 5001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    will-change: transform;
}

.side-menu.active {
    transform: translate3d(0, 0, 0);
}

/* 모바일 잠금/해제 시점(visibilitychange/pageshow)에서 합성 재시작으로 인한 화면 떨림 방지 */
.prms-no-transitions,
.prms-no-transitions * {
    transition: none !important;
}

/* 홈 화면 로고/글로우 애니메이션은 잠금/복원 시점에 잠깐 멈춰 합성 떨림을 막는다 */
.prms-page-hidden .timeplanner-logo-image *,
.prms-resuming .timeplanner-logo-image * {
    animation-play-state: paused !important;
}

.prms-page-hidden .timeplanner-logo-glow-1,
.prms-page-hidden .timeplanner-logo-glow-2,
.prms-resuming .timeplanner-logo-glow-1,
.prms-resuming .timeplanner-logo-glow-2 {
    animation-play-state: paused !important;
    /* iOS에서 blur 재합성 시 깜빡임이 커지는 경우가 있어 복원 구간에는 blur를 잠깐 제거 */
    filter: none !important;
}

/* "더 강력한" 저진동 모드: 모바일 홈에서는 고빈도 애니메이션/필터/장식 배경을 전면 비활성화 */
.prms-mobile-low-motion body.page-worker-main::after {
    display: none !important;
}

.prms-mobile-low-motion .timeplanner-logo-image * {
    animation: none !important;
}

.prms-mobile-low-motion .timeplanner-logo-glow-1,
.prms-mobile-low-motion .timeplanner-logo-glow-2 {
    display: none !important;
    animation: none !important;
    filter: none !important;
}

/* 홈 카드의 shimmer/gradient 애니메이션도 중지 */
.prms-mobile-low-motion body.page-worker-main * {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
}

/* 사이드 메뉴 헤더 */
.side-menu-header {
    background: linear-gradient(90deg, #155dfc 0%, #4f39f6 100%);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    background: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar svg {
    width: 32px;
    height: 32px;
    fill: #9ca3af;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    color: var(--white);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0;
}

.profile-phone {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    letter-spacing: 0;
    font-weight: 400;
}

.profile-affiliation {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    letter-spacing: 0;
    font-weight: 400;
}

.close-button {
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: opacity 0.2s;
}

.close-button:hover {
    opacity: 0.8;
}

/* 사이드 메뉴 컨텐츠 */
.side-menu-content {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #1e2939;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f3f4f6;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
}

.side-menu-item:hover {
    background-color: #f9fafb;
}

.side-menu-item svg {
    width: 22px;
    height: 22px;
    fill: #6a7282;
}

.side-menu-item span {
    font-size: 15px;
    letter-spacing: 0;
    color: #1e2939;
}

.side-menu-item.logout {
    color: #dc3545;
}

.side-menu-item.logout svg {
    fill: #dc3545;
}

/* 컨테이너 */
.container {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
    padding: 68px 20px 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* 폼 요소 */
.form-group {
    margin-bottom: 26px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 7px;
    letter-spacing: -0.5px;
}

.form-input {
    width: 100%;
    height: 55px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    letter-spacing: -0.5px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-input-icon {
    position: relative;
}

.form-input-icon input {
    padding-left: 56px;
}

.form-input-icon .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

/* 버튼 */
.btn {
    width: 100%;
    height: 55px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.5px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--blue-link);
    border: 1px solid var(--blue-link);
}

.btn-file {
    background-color: var(--background-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    height: 55px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 400;
}

/* 체크박스 */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
}

.checkbox-input {
    width: 15px;
    height: 15px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    cursor: pointer;
}

/* 링크 */
.link-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 14px;
    margin-top: 18px;
}

.link {
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.link:hover {
    text-decoration: underline;
}

.link-divider {
    color: var(--text-primary);
}

/* 페이지 타이틀 */
.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

/* 입력 그룹 (버튼 포함) */
.input-group {
    display: flex;
    gap: 10px;
}

.input-group .form-input {
    flex: 1;
}

.input-group .btn {
    width: 76px;
    flex-shrink: 0;
}

/* 파일 업로드 */
.file-upload-group {
    display: flex;
    gap: 0;
}

.file-upload-input {
    flex: 1;
    height: 55px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 0;
    background-color: var(--white);
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.file-upload-button {
    width: 90px;
    height: 55px;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 성공 메시지 */
.success-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.success-icon {
    width: 67px;
    height: 67px;
    background-color: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.success-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.success-message {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

/* 하단 메뉴바 - 2024-10-31 업데이트 */
.menu-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 70px !important;
    background-color: var(--white) !important;
    border-top: 1px solid var(--border-light) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    z-index: 1000 !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Figma 디자인 네비게이션 바 */
.menu-bar.figma-nav {
    height: 85px !important;
    border-top: 1px solid #e5e7eb !important;
}

.menu-bar.figma-nav .menu-item {
    color: #6a7282 !important;
    border-radius: 14px !important;
    margin: 0 4px !important;
    transition: all 0.2s !important;
}

.menu-bar.figma-nav .menu-item.active {
    background-color: #eff6ff !important;
    color: #155dfc !important;
}

.menu-bar.figma-nav .menu-item:hover {
    opacity: 0.7 !important;
}

.menu-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    text-decoration: none !important;
    color: var(--text-primary) !important;
    font-size: 12px !important;
    flex: 1 !important;
    padding: 8px 4px !important;
    transition: opacity 0.2s !important;
    min-width: 0 !important;
}

.menu-item:hover {
    opacity: 0.7 !important;
}

.menu-item .icon {
    width: 24px !important;
    height: 24px !important;
}

.menu-item span {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ========================================
   모바일 반응형 최적화
   ======================================== */

/* 기본 모바일 설정 */
body {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 모바일 우선 (기본) */
@media screen and (max-width: 767px) {
    .container {
        max-width: 100% !important;
        padding: 60px 16px 90px !important;
    }

    .header {
        height: 56px !important;
        padding: 0 4px !important;
    }

    .header-title {
        font-size: 15px !important;
        padding: 0 4px !important;
    }

    .back-button,
    .menu-button {
        width: 44px !important;
        height: 44px !important;
    }

    .back-button svg,
    .menu-button svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* 하단 메뉴바 최적화 */
    .menu-bar {
        height: 60px !important;
        padding: 0 !important;
    }

    .menu-item {
        font-size: 11px !important;
        padding: 6px 2px !important;
    }

    .menu-item .icon {
        width: 22px !important;
        height: 22px !important;
    }

    /* 버튼 터치 최적화 */
    .btn {
        min-height: 48px !important;
        height: 48px !important;
        font-size: 15px !important;
        touch-action: manipulation;
    }

    /* 입력 필드 */
    .form-input {
        height: 48px !important;
        font-size: 16px !important; /* iOS 자동 줌 방지 */
    }

    /* 링크 터치 영역 확대 */
    .link,
    .side-menu-item {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* 사이드 메뉴 전체 화면 */
    .side-menu {
        width: 85% !important;
        max-width: 320px !important;
    }
}

/* 초소형 모바일 (320px ~ 374px) */
@media screen and (max-width: 374px) {
    .container {
        padding: 60px 12px 80px !important;
    }

    .header {
        padding: 0 2px !important;
    }

    .header-title {
        font-size: 14px !important;
        padding: 0 2px !important;
    }

    .back-button,
    .menu-button {
        width: 40px !important;
        height: 40px !important;
    }

    .back-button svg,
    .menu-button svg {
        width: 20px !important;
        height: 20px !important;
    }

    .menu-bar {
        height: 55px !important;
    }

    .menu-item {
        font-size: 10px !important;
        padding: 4px 2px !important;
    }

    .menu-item .icon {
        width: 20px !important;
        height: 20px !important;
    }

    .btn {
        height: 44px !important;
        font-size: 14px !important;
    }

    .form-input {
        height: 44px !important;
    }
}

/* 태블릿 및 데스크탑 */
@media (min-width: 768px) {
    .container {
        max-width: 480px !important;
        padding: 88px 40px 90px !important;
    }

    .header {
        height: 60px !important;
    }

    .header-title {
        font-size: 18px !important;
    }

    .btn {
        height: 50px !important;
    }

    .form-input {
        height: 55px !important;
    }

    /* 하단 메뉴바 - 데스크탑에서는 전체 너비 유지 */
    .menu-bar {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* 호버 효과 */
    .btn:hover {
        transform: translateY(-1px);
        transition: transform 0.2s;
    }
    
    .menu-item:hover {
        opacity: 0.8;
        transition: opacity 0.2s;
    }
}

/* iOS 안전 영역 대응 */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .container {
        padding-bottom: max(90px, calc(90px + env(safe-area-inset-bottom))) !important;
    }

    .menu-bar {
        padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
        height: max(60px, calc(60px + env(safe-area-inset-bottom))) !important;
    }
}

/* 가로 모드 최적화 */
@media screen and (orientation: landscape) and (max-height: 428px) {
    .container {
        padding-top: 50px !important;
        padding-bottom: 70px !important;
    }

    .header {
        height: 48px !important;
    }

    .menu-bar {
        height: 50px !important;
    }

    .side-menu {
        width: 280px !important;
    }
}

/* 프린트 최적화 */
@media print {
    .header,
    .menu-bar,
    .side-menu,
    .side-menu-overlay,
    .btn {
        display: none !important;
    }

    .container {
        max-width: 100% !important;
        padding: 20px !important;
    }
}

/* ========================================
   Figma 디자인 시스템 추가 스타일
   (figma-design-system.css 대체)
   ======================================== */

/* 헤더 back-button 및 menu-button 스타일 */
.header.figma-header .back-button,
.header.figma-header .menu-button {
    background: none;
    border: none;
    padding: 0;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    text-decoration: none;
    flex-shrink: 0;
}

.header.figma-header .back-button svg,
.header.figma-header .menu-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* 네비게이션 배지 스타일 */
.menu-bar.figma-nav .menu-item {
    position: relative;
}

.menu-bar.figma-nav .menu-item .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background-color: #fb2c36;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* 근무자 하단 메뉴 배지(.menu-badge) 공통 스타일 */
.menu-bar.figma-nav .menu-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background-color: #ef4444;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 0 4px;
    box-sizing: border-box;
    border: 2px solid #ffffff;
}

/* 메뉴 버튼 그라데이션 스타일 */
.menu-card.figma-gradient {
    border-radius: var(--menu-button-radius);
    padding: 20px 15px;
    text-decoration: none;
    color: var(--text-white);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 128px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
}

.menu-card.figma-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 버튼별 그라데이션 색상 */
.menu-card.figma-gradient.attendance {
    background: var(--gradient-blue);
}

.menu-card.figma-gradient.photo {
    background: var(--gradient-orange);
}

.menu-card.figma-gradient.sales {
    background: var(--gradient-green);
}

.menu-card.figma-gradient.competitor {
    background: var(--gradient-pink);
}

.menu-card.figma-gradient.education {
    background: var(--gradient-orange-dark);
}

.menu-card.figma-gradient.notice {
    background: var(--gradient-yellow);
}

.menu-card.figma-gradient .menu-title {
    font-size: var(--font-size-heading);
    font-weight: var(--font-weight-heading);
    margin-bottom: 2px;
    letter-spacing: 0;
    line-height: var(--line-height-heading);
    color: var(--text-white);
}

.menu-card.figma-gradient .menu-subtitle {
    font-size: var(--font-size-subtitle);
    opacity: var(--opacity-subtitle);
    letter-spacing: 0;
    line-height: var(--line-height-subtitle);
    color: var(--text-white);
}

/* 유틸리티 클래스 */
.bg-gradient-main {
    background: var(--bg-main);
}

.bg-gradient-blue {
    background: var(--gradient-blue);
}

.bg-gradient-orange {
    background: var(--gradient-orange);
}

.bg-gradient-green {
    background: var(--gradient-green);
}

.bg-gradient-pink {
    background: var(--gradient-pink);
}

.bg-gradient-yellow {
    background: var(--gradient-yellow);
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-white {
    color: var(--text-white);
}

.text-nav-active {
    color: var(--nav-active-text);
}

.text-nav-inactive {
    color: var(--nav-inactive-text);
}

/* Figma 디자인 반응형 추가 */
@media screen and (max-width: 767px) {
    .header.figma-header {
        height: var(--header-height);
        padding: 0 8px;
    }

    .header.figma-header .header-title {
        font-size: 18px;
    }

    .menu-bar.figma-nav {
        height: var(--nav-bar-height);
    }

    .menu-bar.figma-nav .menu-item {
        font-size: 11px;
        padding: 6px 2px;
    }
}

/* iOS 안전 영역 대응 - figma-nav */
@supports (padding: max(0px)) {
    .menu-bar.figma-nav {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        height: max(85px, calc(85px + env(safe-area-inset-bottom)));
    }
}

/* =========================================================
 * Phase 1 - 공통 UX 인프라
 * - 전역 포커스 스타일
 * - 전역 로딩 인디케이터
 * ========================================================= */
*:focus-visible {
    outline: 2px solid #155dfc;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #155dfc;
    outline-offset: 2px;
}

/* 전역 로딩 인디케이터 */
.prms-global-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prms-global-loader-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.prms-global-loader-content {
    position: relative;
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
    min-width: 200px;
}

.prms-global-loader-text {
    color: #333333;
    font-size: 14px;
    margin: 0;
}

.prms-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #155dfc;
    border-radius: 50%;
    animation: prms-spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes prms-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========================================================
 * 운영/개발 렌더링 차이 방지 - 하단 메뉴 강제 스코프
 * ========================================================= */
.page-worker .menu-bar.figma-nav {
    height: max(85px, calc(85px + env(safe-area-inset-bottom))) !important;
    padding: 4px 8px max(8px, env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

.page-worker .menu-bar.figma-nav .menu-item {
    padding: 6px 2px !important;
    height: auto !important;
}

.page-worker .menu-bar.figma-nav .menu-item .icon {
    width: 22px !important;
    height: 22px !important;
}

.page-worker .container {
    padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important;
}

.page-company .menu-bar.figma-nav {
    height: max(85px, calc(85px + env(safe-area-inset-bottom))) !important;
    padding: 4px 8px max(8px, env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    gap: 0 !important;
    z-index: 1001 !important;
    border-top: 1px solid #e5e7eb !important;
    box-sizing: border-box !important;
}

.page-company .menu-bar.figma-nav .menu-item {
    color: #6a7282 !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 6px 2px !important;
    height: auto !important;
    font-size: 11px !important;
    gap: 3px !important;
}

.page-company .menu-bar.figma-nav .menu-item.active {
    color: #155dfc !important;
}

.page-company .menu-bar.figma-nav .menu-item .icon {
    width: 20px !important;
    height: 20px !important;
}

.page-company .menu-bar.figma-nav .menu-item-separator {
    display: none !important;
}

.page-company .container,
.page-company .main-container {
    padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important;
}

/* 잔여 더보기 FAB/시트가 노출되지 않도록 공통 차단 */
#tpWorkerMoreFab,
#tpWorkerMoreSheet,
#tpWorkerMoreBackdrop,
.tp-worker-more-fab,
.tp-worker-more-sheet,
.tp-worker-more-backdrop {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
