/* 기업회원 관리 전용 스타일 - 모든 클래스에 company- 접두사 추가 */
.company-container {
    width: 85%;
    margin: 0px 0px 100px 290px;
    padding: 50px;
    background-color: #ffffff;
    border: 1px solid #ebebeb;
}

.company-header-box {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.company-header-box h1 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.company-page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.company-page-title span {
    font-size: 18px;
    font-weight: bold;
    color: #555;
}

.company-search-box {
    display: flex;
    align-items: center;
}

.company-search-box select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 0;
    margin-right: 5px;
    height: 36px;
}

.company-search-box input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 0;
    width: 200px;
    height: 36px;
    margin-right: 5px;
}

.company-search-box button {
    padding: 8px 15px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    height: 36px;
}

.company-search-box button:hover {
    background-color: #555;
}

.company-table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.company-high-end-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-top: 2px solid rgb(251, 105, 0) !important;
}

.company-container .company-high-end-table th,
.company-container .company-high-end-table td {
    padding: 12px 15px;
    text-align: center; /* 리스트 내용을 중앙 정렬 */
    border-bottom: 1px solid #eee;
}

.company-container .company-high-end-table th {
    background-color: #f8f9fa;
    font-weight: 700 !important;
    color: #333;
    white-space: nowrap;
}

.company-container .company-high-end-table tr:hover {
    background-color: #f5f5f5;
}

/* 체크박스 스타일 */
.company-high-end-table td input[type="checkbox"],
.company-high-end-table th input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    vertical-align: middle !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #fff !important;
    border: 1px solid #666 !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.company-high-end-table td input[type="checkbox"]:checked,
.company-high-end-table th input[type="checkbox"]:checked {
    border: 1px solid #666 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2L9 13.113 3.714 7.828 2.299 9.242 9 16 21.7 3.313 20.285 2z' fill='%23000'/%3E%3C/svg%3E") !important;
    background-size: 100% 100% !important;
    background-position: 50% !important;
    background-repeat: no-repeat !important;
    background-color: #fff !important;
}

/* --- 버튼 스타일 시작 --- */
/* '기업회원 추가' 버튼 (company-btn 클래스 사용) */
.company-btn {
    padding: 9px 18px;
    background-color: #FF6B00; /* 오렌지색 배경 */
    color: #ffffff; /* 흰색 텍스트 */
    border: 1px solid #FF6B00; /* 오렌지색 테두리 */
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
    height: 38px;
    border-radius: 0;
}

.company-btn:hover {
    background-color: #e65c00; /* 호버 시 약간 어두운 오렌지 */
    border-color: #e65c00;
    color: #ffffff;
}

/* '선택 삭제' 버튼 (company-delete-btn 클래스 사용) */
.company-delete-btn {
    background-color: #dc3545 !important; /* 빨간색 배경 */
    color: #fff !important; /* 흰색 텍스트 */
    border-color: #dc3545 !important; /* 빨간색 테두리 */
    height: 38px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
}

.company-delete-btn:hover {
    background-color: #c82333 !important; /* 호버 시 약간 어두운 빨간색 */
    border-color: #bd2130 !important;
    color: #fff !important;
}

/* 테이블 내부의 보기/수정 버튼 */
.company-high-end-table .company-btn {
    background-color: transparent !important;
    color: #FF6B00 !important;
    border: 1px solid #FF6B00 !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    height: auto !important;
    text-decoration: none !important; /* 밑줄 제거 */
}

.company-high-end-table .company-btn:hover {
    background-color: #FF6B00 !important;
    color: #ffffff !important;
    border-color: #FF6B00 !important;
}
/* --- 버튼 스타일 끝 --- */


/* --- Form Styles for Add/Edit Page (company- 접두사 추가) --- */
.company-form-container {
    max-width: 1000px;
    margin: 0 auto; /* .company-container 내에서 중앙 정렬 */
    padding: 40px;
    border: 1px solid #e0e0e0; /* 옅은 회색 테두리 */
    background: #fff;
    box-sizing: border-box;
    margin-top: 30px; /* 상단 여백 추가 */
}

.company-form-title {
    font-size: 28px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 40px;
    color: #222222;
}

.company-form-group {
    margin-bottom: 25px; /* 그룹 간 간격 조정 */
}

.company-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500; /* 레이블 폰트 굵기 추가 */
}

.company-form-input {
    width: 100%;
    height: 45px;
    padding: 0 15px;
    border: 1px solid #cccccc; /* 옅은 회색 테두리 */
    font-size: 14px;
    box-sizing: border-box; /* 패딩이 너비에 포함되도록 */
}

.company-form-input:focus {
    outline: none;
    border-color: #FF6B00; /* 포커스 시 오렌지 테두리 */
    box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.2); /* 포커스 시 옅은 오렌지 그림자 */
}

.company-input-helper {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

/* 에러 메시지 스타일 */
.company-error-message {
    color: #ff8c00; /* 주황색으로 변경 */
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
    min-height: 1.2em; /* Ensure space even when empty */
}

.company-form-input.company-error-border {
    border-color: #dc3545; /* 에러 시 빨간색 테두리 */
}

.company-form-row {
    display: flex;
    gap: 20px;
}

.company-form-row .half {
    flex: 1;
}

textarea.company-form-input {
    resize: vertical;
    min-height: 100px;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
}

.company-button-group {
    margin-top: 40px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.company-cancel-btn,
.company-submit-btn,
.company-action-button { /* 우편번호 찾기 버튼에 사용 */
    width: 200px; /* 기본 버튼 너비 */
    height: 50px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
    display: flex; /* 버튼 내부 텍스트 중앙 정렬용 */
    align-items: center;
    justify-content: center;
}

.company-submit-btn {
    background: #FF6B00 !important; /* 오렌지색 배경 */
    color: #fff !important;
    border-color: #FF6B00 !important;
}

.company-submit-btn:hover {
    background: #e65c00 !important; /* 호버 시 약간 어두운 오렌지 */
    border-color: #e65c00 !important;
}

.company-cancel-btn {
    background: #6c757d !important; /* 회색 배경 */
    color: #fff !important;
    border-color: #6c757d !important;
}

.company-cancel-btn:hover {
    background: #5a6268 !important; /* 호버 시 약간 어두운 회색 */
    color: #fff !important;
    border-color: #5a6268 !important;
}

/* 우편번호 찾기 버튼 (빨간색 톤으로 변경) */
.company-action-button {
    background-color: #dc3545 !important; /* 빨간색 */
    color: white !important;
    border: 1px solid #dc3545 !important;
    width: auto !important;
    padding: 8px 15px !important;
    height: auto !important;
    font-size: 14px !important;
    margin-top: 10px;
    display: block;
}
.company-action-button:hover {
    background-color: #c82333 !important; /* 호버 시 약간 어두운 빨간색 */
    border-color: #bd2130 !important;
}
/* --- Form Styles End --- */

.company-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.company-pagination a {
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
}

.company-pagination a:hover {
    background-color: #f1f1f1;
}

.company-pagination a.active {
    background-color: rgb(251, 105, 0);
    color: white;
    border-color: rgb(251, 105, 0);
}

.company-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.company-modal-overlay.active {
    display: flex;
}

.company-modal-content {
    background-color: white;
    padding: 20px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.company-modal-content h3 {
    margin-top: 0;
    color: #333;
}

.company-modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    gap: 10px;
}

.company-confirm-btn {
    background-color: #dc3545;
    color: white;
}

.company-cancel-modal-btn {
    background-color: #6c757d;
    color: white;
}

.company-message-box {
    margin: 20px auto;
    padding: 15px;
    border: 1px solid;
    text-align: center;
    font-weight: bold;
    max-width: 600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
}

.company-message-box.success {
    background-color: #ffffff;
    border-color: #cdcdcd;
    color: #e65100;
}

.company-message-box.error {
    background-color: #ffebee;
    border-color: #ef5350;
    color: #d32f2f;
}

.company-message-box button {
    background-color: rgb(251, 105, 0);
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    border-radius: 0;
}

.company-message-box button:hover {
    background-color: rgb(8, 0, 230);
}

/* ===== 🧑‍💻 모바일 반응형 디자인 (이 코드로 전체 교체) 🧑‍💻 ===== */
@media (max-width: 768px) {
    /* --- 전체 레이아웃 조정 --- */
    .company-container {
        width: 100%;
        margin: 0;
        padding: 20px 15px; /* 모바일용 여백 */
        border: none;
    }
    .company-header-box h1 {
        font-size: 22px;
    }
    .company-page-title {
        flex-direction: column; /* 제목과 검색창을 세로로 쌓음 */
        align-items: flex-start;
        gap: 15px;
    }
    .company-search-box {
        width: 100%;
        display: flex;
    }
    .company-search-box select {
        width: 100px; /* 검색 타입 선택창 너비 고정 */
    }
    .company-search-box input[type="text"] {
        flex-grow: 1; /* 검색어가 남은 공간을 모두 차지하도록 */
        width: auto;
    }

    /* 상단 버튼 영역 (총 기업수, 선택삭제 등) */
    .company-container > div:nth-of-type(2) {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    /* --- 반응형 테이블 (카드 뷰) 스타일 시작 --- */
    .company-table-responsive {
        overflow-x: hidden; /* 가로 스크롤바 제거 */
    }
    .company-high-end-table, 
    .company-high-end-table thead, 
    .company-high-end-table tbody, 
    .company-high-end-table th, 
    .company-high-end-table td, 
    .company-high-end-table tr {
        display: block; /* 테이블의 모든 요소를 블록으로 변경 */
    }
    
    /* 데스크톱용 테이블 헤더 숨기기 */
    .company-high-end-table thead tr {
        display: none;
    }
    
    /* 각 행(tr)을 카드 형태로 만듦 */
    .company-high-end-table tr {
        border: 1px solid #e0e0e0;
        margin-bottom: 15px;
        padding: 15px;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    
    /* 각 셀(td)의 스타일 재정의 */
    .company-high-end-table td {
        display: flex; /* 라벨과 내용을 양쪽으로 정렬 */
        justify-content: space-between;
        align-items: center;
        padding: 10px 5px;
        text-align: right; /* 내용을 오른쪽으로 정렬 */
        border-bottom: 1px solid #f0f0f0;
    }

    /* 각 셀의 마지막에는 구분선 제거 */
    .company-high-end-table td:last-child {
        border-bottom: none;
        padding-bottom: 5px;
    }
    
    /* 가상요소(::before)를 사용해 각 셀에 라벨(제목) 추가 */
    .company-high-end-table td::before {
        content: attr(data-label); /* data-label 속성값을 가져와 표시 */
        font-weight: bold;
        text-align: left;
        color: #333;
        margin-right: 15px;
    }

    /* --- 각 셀(td)에 라벨 내용 지정 --- */
    .company-high-end-table td:nth-of-type(1)::before { content: "선택"; }
    .company-high-end-table td:nth-of-type(2)::before { content: "일련번호"; }
    .company-high-end-table td:nth-of-type(3)::before { content: "기업명"; }
    .company-high-end-table td:nth-of-type(4)::before { content: "기업코드"; }
    .company-high-end-table td:nth-of-type(5)::before { content: "대표 이메일"; }
    .company-high-end-table td:nth-of-type(6)::before { content: "대표번호"; }
    .company-high-end-table td:nth-of-type(7)::before { content: "회원등급"; }
    .company-high-end-table td:nth-of-type(8)::before { content: "가입상태"; }
    .company-high-end-table td:nth-of-type(9)::before { content: "가입일"; }
    .company-high-end-table td:nth-of-type(10)::before { content: "소속영업자"; }
    .company-high-end-table td:nth-of-type(11)::before { content: "발행쿠폰"; }
    .company-high-end-table td:nth-of-type(12)::before { content: "작업"; }
    
    /* '조회된 기업이 없습니다' 메시지 스타일 */
    .company-high-end-table td[colspan="12"] {
        display: block;
        text-align: center;
        padding: 40px 10px;
        font-size: 16px;
        color: #888;
    }
    .company-high-end-table td[colspan="12"]::before {
        display: none; /* 내용이 없는 셀에는 라벨 숨기기 */
    }

    /* 체크박스 셀은 라벨/내용 정렬이 아닌 중앙 정렬로 변경 */
    .company-high-end-table td:nth-of-type(1) {
        justify-content: center;
    }

    /* 버튼이 들어가는 셀은 버튼 크기에 맞게 조정 */
    .company-high-end-table td:nth-of-type(10),
    .company-high-end-table td:nth-of-type(11),
    .company-high-end-table td:nth-of-type(12) {
        padding-top: 5px;
        padding-bottom: 5px;
    }
    /* --- 반응형 테이블 (카드 뷰) 스타일 끝 --- */

    /* --- Form 페이지 모바일 스타일 (Add/Edit) --- */
    .company-form-container {
        padding: 20px;
        margin-top: 0;
    }
    .company-form-row {
        flex-direction: column;
        gap: 0;
    }
    .company-form-row .half {
        width: 100%;
    }
    .company-form-row .half:not(:last-child) {
        margin-bottom: 20px;
    }
    .company-button-group {
        flex-direction: column;
        gap: 10px;
    }
    .company-cancel-btn,
    .company-submit-btn,
    .company-action-button {
        width: 100%;
    }
}