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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 로그인 화면 */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.5s ease;
}

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

.login-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    border-radius: 20px;
    object-fit: contain;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 30px;
    line-height: 1.4;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
}

.login-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-button {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-button:active {
    transform: scale(0.98);
}

.login-button:hover {
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.login-error {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

/* 메인 앱 */
.main-app {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* 헤더 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    background: white;
    padding: 5px;
    transition: transform 0.2s;
}

.logo:active {
    transform: scale(0.95);
}

.header-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.company-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.logout-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-button:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.98);
}

/* 탭 메뉴 */
.tabs {
    display: flex;
    overflow-x: auto;
    background: #f8f9fa;
    padding: 10px 5px;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 2px;
}

.tab-button {
    flex: 0 0 auto;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    line-height: 1.3;
    text-align: center;
}

.tab-button:active,
.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(0.98);
}

/* 탭 콘텐츠 */
.tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.tab-content h2 {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 700;
}

.tab-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.tip {
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
}

.notice {
    font-size: 13px;
    color: #e53e3e;
    margin-bottom: 5px;
}

/* 홈 화면 */
.home-intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

.home-intro p {
    line-height: 1.6;
    margin-bottom: 5px;
}

.menu-table {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s;
}

.menu-item:active {
    transform: scale(0.98);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.15);
}

.menu-title {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.menu-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

.menu-desc a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.menu-desc a:active {
    color: #764ba2;
}

/* 아이콘 그리드 */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 15px;
    border-radius: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.icon-link:active {
    transform: scale(0.95);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.icon-link img {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.icon-link:active img {
    transform: scale(1.1);
}

.icon-link span {
    font-size: 12px;
    color: #333;
    text-align: center;
    font-weight: 600;
    line-height: 1.3;
}

/* iframe 컨테이너 */
.iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.iframe-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.back-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-button:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.98);
}

.content-frame {
    flex: 1;
    border: none;
    width: 100%;
    background: white;
}

.content-area {
    position: relative;
}

/* 푸터 */
.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.footer p {
    font-size: 12px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 5px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
    }
    
    .company-name {
        font-size: 16px;
    }
    
    .logout-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .tab-content h2 {
        font-size: 20px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .menu-item {
        padding: 15px;
    }
    
    .menu-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 사용자 확인요청 모달 */
.verify-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.verify-modal {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
    text-align: center;
}

.verify-modal h3 {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.verify-modal p {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 18px;
}

.verify-modal input {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.3s;
}

.verify-modal input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.verify-modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.verify-submit-btn {
    flex: 1;
    padding: 13px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.verify-submit-btn:hover {
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.verify-cancel-btn {
    flex: 1;
    padding: 13px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.verify-cancel-btn:hover {
    background: #e0e0e0;
}

.verify-success {
    display: none;
    padding: 10px 0;
}

.verify-success p {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 18px;
}

.verify-success .check-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.verify-msg {
    font-size: 13px;
    min-height: 18px;
    margin-bottom: 5px;
}