/* 공통 스타일 */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 모든 링크의 기본 스타일 */
a {
    color: #333;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

/* 헤더 - 기본 디자인 */
header {
    padding: 15px 0;
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    margin: 0;
    color: #333;
    font-size: 28px;
    letter-spacing: -0.03em;
    font-weight: 600;
}

/* 네비게이션 */
nav {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    background-color: white;
}

nav ul li {
    flex: 1;
    text-align: center;
    border-right: 1px solid #eee;
}

nav ul li:last-child {
    border-right: none;
}

nav ul li a {
    display: block;
    padding: 12px 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* 활성화된 메뉴 스타일 */
nav ul li.active a {
    background-color: #f0f8ff;
    color: #4dabf7;
    font-weight: 600;
    border-bottom: 2px solid #4dabf7;
}

nav ul li:hover a {
    background-color: #f9f9f9;
}


/* 본문 */
main {
    padding: 20px 0;
}

/* 푸터 */
footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    text-align: center;
    color: #7f8c8d;
}

/* 버튼 스타일 - 심플 디자인 */
.btn, button[type="submit"], input[type="submit"], a.btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 1px;
    border: 1px solid #ddd;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    text-align: center;
    background-color: #f9f9f9;
    color: #333;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', sans-serif;
    font-weight: 500;
    line-height: 1.5;
    height: auto;
    box-sizing: border-box;
}

.btn-sm, button.btn-sm, input.btn-sm, a.btn-sm {
    font-size: 12px;
    padding: 4px 8px;
}

.btn-primary, button.btn-primary, input.btn-primary, a.btn-primary {
    background-color: #487fff;
    border-color: #487fff;
    color: #ffffff;
}

.btn-primary:hover, button.btn-primary:hover, input.btn-primary:hover, a.btn-primary:hover {
    background-color: #3a6fe8;
    border-color: #3a6fe8;
    color: #ffffff;
}

.btn-info, button.btn-info, input.btn-info, a.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #ffffff;
}

.btn-info:hover, button.btn-info:hover, input.btn-info:hover, a.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
    color: #ffffff;
}

.btn-success, button.btn-success, input.btn-success, a.btn-success {
    background-color: #f0fff0;
    border-color: #c3e6cb;
    color: #28a745;
}

.btn-warning, button.btn-warning, input.btn-warning, a.btn-warning {
    background-color: #fffcf5;
    border-color: #ffeeba;
    color: #d39e00;
}

.btn-danger, button.btn-danger, input.btn-danger, a.btn-danger {
    background-color: #fff5f5;
    border-color: #f5c6cb;
    color: #dc3545;
}


/* 폼 스타일 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.role-description {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #4dabf7;
    font-size: 13px;
}

.role-description ul {
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 20px;
}

.role-description li {
    margin-bottom: 5px;
}

.mt-2 {
    margin-top: 10px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 테이블 스타일 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th,
.table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: left;
}

/* 규정 내용 테이블 스타일 */
.regulation-content table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000;
    margin: 15px 0;
}

.regulation-content th {
    border: 2px solid #000;
    border-bottom: 3px solid #000;
    padding: 8px;
    background-color: #f5f5f5;
    font-weight: bold;
    text-align: center;
}

.regulation-content td {
    border: 1px solid #000;
    padding: 8px;
}

/* TinyMCE 에디터에서 사용하는 테이블 클래스들 */
.regulation-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
    margin-bottom: 15px;
}

.regulation-table th,
.regulation-table td {
    border: 1px solid #000;
    padding: 8px;
    text-align: left;
}

.regulation-table th {
    background-color: #f2f2f2;
    text-align: center;
    font-weight: bold;
}

.annex-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000;
    margin-bottom: 15px;
}

.annex-table th,
.annex-table td {
    border: 1px solid #000;
    padding: 8px;
    text-align: left;
}

.annex-table th {
    background-color: #f2f2f2;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #000;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
    margin-bottom: 15px;
}

.comparison-table th,
.comparison-table td {
    border: 1px solid #000;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.comparison-table th {
    background-color: #f2f2f2;
    text-align: center;
    font-weight: bold;
}

/* 표 내 셀 하이라이트 스타일 */
.cell-highlight {
    background-color: #ffffcc;
}

.cell-deleted {
    background-color: #ffcccc;
    text-decoration: line-through;
}

.cell-added {
    background-color: #ccffcc;
}

/* 규정 내용 컨테이너 스타일 */
#regulationContent {
    border-left: 1px solid #e0e0e0;
    padding-left: 20px;
}

/* 규정 내용 리스트 스타일 */
.regulation-content ol,
.regulation-content ul,
#regulationContent ol,
#regulationContent ul {
    margin: 10px 0;
    padding-left: 40px;
}

.regulation-content ol,
#regulationContent ol {
    list-style-type: decimal;
}

.regulation-content ul,
#regulationContent ul {
    list-style-type: disc;
}

/* 중첩된 리스트 들여쓰기 및 스타일 */
.regulation-content ol ol,
#regulationContent ol ol {
    list-style-type: lower-alpha; /* a, b, c... */
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 30px;
}

.regulation-content ol ol ol,
#regulationContent ol ol ol {
    list-style-type: lower-roman; /* i, ii, iii... */
}

.regulation-content ul ul,
#regulationContent ul ul {
    list-style-type: circle;
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 30px;
}

.regulation-content ul ul ul,
#regulationContent ul ul ul {
    list-style-type: square;
}

/* 혼합된 리스트 */
.regulation-content ol ul,
.regulation-content ul ol,
#regulationContent ol ul,
#regulationContent ul ol {
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 30px;
}

/* 리스트 아이템 간격 */
.regulation-content li,
#regulationContent li {
    margin-bottom: 5px;
    line-height: 1.6;
}

/* 한글 순서 리스트 (가, 나, 다...) */
.regulation-content ol[style*="hangul"],
.regulation-content ol.hangul-list,
#regulationContent ol[style*="hangul"],
#regulationContent ol.hangul-list {
    list-style-type: hangul;
}

/* 서브 리스트 (목 스타일) */
.regulation-content .sub-list,
.regulation-content ol.sub-list,
#regulationContent .sub-list,
#regulationContent ol.sub-list {
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* 항 스타일 (① ② ③) - 기본 p 태그 내에서 사용 */
.regulation-content p,
#regulationContent p {
    line-height: 1.8;
    margin-bottom: 10px;
}

/* 규정 내용 헤딩 스타일 */
.regulation-content h1,
.regulation-content h2,
.regulation-content h3,
.regulation-content h4,
.regulation-content h5,
.regulation-content h6,
#regulationContent h1,
#regulationContent h2,
#regulationContent h3,
#regulationContent h4,
#regulationContent h5,
#regulationContent h6 {
    margin-top: 20px;
    margin-bottom: 15px;
    font-weight: bold;
    line-height: 1.4;
}

.regulation-content h1,
#regulationContent h1 {
    font-size: 2em;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.regulation-content h2,
#regulationContent h2 {
    font-size: 1.75em;
    margin-top: 30px;
    color: #222;
}

.regulation-content h3,
#regulationContent h3 {
    font-size: 1.5em;
    margin-top: 25px;
    color: #333;
}

.regulation-content h4,
#regulationContent h4 {
    font-size: 1.25em;
    margin-top: 20px;
    color: #444;
}

.regulation-content h5,
#regulationContent h5 {
    font-size: 1.1em;
    margin-top: 18px;
    color: #555;
}

.regulation-content h6,
#regulationContent h6 {
    font-size: 1em;
    margin-top: 15px;
    color: #666;
}

/* 첫 번째 헤딩은 여백 없음 */
.regulation-content > h1:first-child,
.regulation-content > h2:first-child,
.regulation-content > h3:first-child,
#regulationContent > h1:first-child,
#regulationContent > h2:first-child,
#regulationContent > h3:first-child {
    margin-top: 0;
}

/* 목차 스타일 */
.regulation-toc,
#regulationToc {
    flex: 0 0 250px;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 0;
    border: none;
}

.regulation-toc h3,
#regulationToc h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

#tocContent {
    font-size: 14px;
}

#tocContent ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#tocContent ul ul {
    padding-left: 20px;
    margin-top: 5px;
}

#tocContent li {
    margin-bottom: 8px;
}

#tocContent a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.2s;
}

#tocContent a:hover {
    color: #007bff;
}

/* 로딩 메시지 스타일 */
.loading-toc {
    color: #666;
    font-style: italic;
}

/* 인쇄 시 테이블 스타일 */
@media print {
    .regulation-content table {
        border: 2px solid #000 !important;
    }
    
    .regulation-content th {
        border: 2px solid #000 !important;
        border-bottom: 3px solid #000 !important;
        background-color: transparent !important;
    }
    
    .regulation-content td {
        border: 1px solid #000 !important;
    }
}


/* 알림 메시지 */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.success-message {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.error-message {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.info-message {
    background-color: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info-message p {
    margin: 0;
    padding: 0;
    font-style: normal;
}

/* 모달 대화상자 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -250px; /* Half of height */
    margin-left: -250px; /* Half of width */
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-title {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}


/* 로그인 폼 */
.login-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 25px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #4facfe;
}

.login-info {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
}

/* 규정 목록 스타일 */
.regulations-list {
    list-style: none;
    padding: 0;
}

.regulation-item {
    padding: 10px;
    margin-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.regulation-title {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #4facfe;
}

.regulation-meta {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
}

.regulation-actions {
    margin-top: 10px;
}

/* 카테고리 트리 구조 */
.categories-tree {
    list-style: none;
    padding: 0;
}

.category-item {
    margin-bottom: 8px;
}

.mobile-only-note{font-size:12px; color:#7f8c8d;}
.category-header {
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    }


.category-header .toggle-icon {
    margin-right: 8px;
    font-size: 12px;
    color: #4facfe;
}

.category-header .toggle-icon.open {
    display: inline-block;
}

.category-name {
    flex-grow: 1;
    font-weight: 500;
}

.category-actions {
    margin-left: auto;
}

.subcategories {
    list-style: none;
    padding-left: 25px;
    display: none;
}

/* 규정 상세 보기 */
.regulation-header {
    margin-bottom: 25px;
}

.regulation-header h2 {
    margin: 0 0 10px 0;
    color: #4facfe;
}

.regulation-details {
    margin-bottom: 20px;
    color: #7f8c8d;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    display:flex;
    gap: 15px;
}
.regulation-details p{margin: 0; padding:0;}

.regulation-detail {
    margin-bottom: 8px;
}

.regulation-detail span {
    font-weight: bold;
    color: #555;
}

.regulation-content {
    line-height: 1.8;
}

/* 문서 버전 목록 */
.version-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.version-item {
    padding: 8px;
    border-radius: 0;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    font-size:12px;
}



.version-number {
    font-weight: bold;
    margin-right: 15px;
    color: #4facfe;
}

.version-date {
    color: #7f8c8d;
    margin-right: 15px;
}

.version-actions {
    margin-left: auto;
}

/* 규정 목록 컨테이너 스타일 */
.regulation-list-container {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    padding-right: 15px;
}

.regulation-list-header {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    padding: 6px 5px;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
    min-height: 28px;
}

.regulation-header-item {
    padding: 0 5px;
}

.regulation-header-item.title {
    flex: 1.7;
    min-width: 120px;
}

.regulation-header-item.category {
    flex: 0.8;
    min-width: 100px;
}

.regulation-header-item.version,
.regulation-header-item.status {
    width: 70px;
}

.regulation-header-item.date {
    width: 100px;
}

.regulation-header-item.actions {
    width: 150px !important;
    text-align: left;
}

.regulation-list-items {
    overflow: visible;
}

.regulation-item {
    display: flex;
    align-items: center;
    padding: 6px 5px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 30px;
}

.regulation-item:hover {
    background-color: #f8f9fa;
}

.regulation-item-title {
    flex: 1.7;
    min-width: 120px;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.regulation-item-category {
    flex: 0.8;
    min-width: 100px;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.regulation-item-version,
.regulation-item-status {
    width: 70px;
    padding: 0 5px;
    text-align: center;
}

.regulation-item-date {
    width: 100px;
    padding: 0 5px;
    text-align: center;
}

.regulation-item-actions {
    width: 150px !important;
    padding: 0 5px;
    text-align: left;
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 3px;
}

.regulation-item-actions .btn {
    padding: 4px 5px;
    font-size: 11px;
    line-height: 1.2;
    margin-right: 0;
    white-space: nowrap;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px 0;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin-right: 0;
        margin-bottom: 1px;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    nav ul li:last-child {
        border-bottom: none;
    }
    
    .regulation-item {
        padding: 10px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .table th, 
    .table td {
        padding: 8px;
        font-size: 14px;
    }
}

/* Top 버튼 */
.top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
        z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.top-button::after {
    content: "↑";
    font-size: 20px;
}

.top-button.visible {
    opacity: 1;
}


/* 애니메이션 비활성화 */

/* 트리 구조와 내용 구역 레이아웃 */
.regulations-container {
    display: flex;
    gap: 20px;
}

.regulations-container > .categories-tree {
    flex: 0 0 300px; order: -1;
    padding-right: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

.regulation-content-area {
    flex: 1;
    padding: 15px;
    min-height: 400px;
    overflow-y: auto; /* 컨텐츠 영역에 스크롤 추가 */
    max-height: calc(100vh - 200px); /* 최대 높이 제한 */
}

.regulation-content-area p {
    color: #7f8c8d;
    font-style: italic;
}

/* 트리구조 개선 */
/* 하위 카테고리는 자바스크립트에서 제어 (display: block !important 제거) */

.category-header .toggle-icon.open {
    display: inline-block;
}

.regulations-list {
    border-left: 3px solid #4facfe;
    margin-left: 10px;
    padding-left: 15px;
}

/* 선택된 규정 항목 스타일 */
.regulation-item.selected {
    background-color: #eaf7ff;
    border-left: 3px solid #4facfe;
}

/* 로딩 메시지 스타일 */
.loading-message {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-style: italic;
}

/* 카테고리 구조 수정 */
.categories-tree {
    margin-bottom: 20px;
}

/* .subcategories 표시 설정 제거 - 자바스크립트로 제어 */

.toggle-icon {
    display: inline-block;
}

.toggle-icon.open {
    display: inline-block;
}

/* 액션 버튼 컨테이너 */
.action-buttons, .action-row {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 정렬 옵션 스타일 */
.sorting-options {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sorting-options span {
    font-weight: 500;
    color: #6c757d;
}

.sorting-options a {
    color: #495057;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s;
}

.sorting-options a:hover {
    background-color: #e9ecef;
    color: #212529;
}

.sorting-options a.current-sort {
    background-color: #007bff;
    color: white;
    font-weight: 500;
}

.action-row {
    margin-bottom: 0;
}

/* window_tree.css에서 관리 */

/* 사용자 목록 컨테이너 */
.users-list-container {
    width: 100%;
    background-color: #fff;
    margin-top: 5px;
}

/* 사용자 목록 헤더 스타일 */
.users-list-header {
    display: flex;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
    font-weight: 500;
    color: #666;
    font-size: 12px;
    height: 32px;
    align-items: center;
}

.users-header-item {
    padding: 0 6px;
    text-align: center;
}

/* 사용자 목록 아이템 행 스타일 */
.users-list-items {
    display: flex;
    flex-direction: column;
}

.user-item {
    display: flex;
    border-bottom: 1px solid #f5f5f5;
}

/* 각 열의 스타일 */
.user-item > div,
.users-header-item {
    padding: 0 6px;
    text-align: center;
    display: flex;
    align-items: center;
    height: 32px;
}

/* 각 열의 너비 조정 */
.users-header-item.username,
.user-item-username {
    flex: 1;
    min-width: 120px;
    font-size: 12px;
    text-align: left;
    padding-left: 10px;
}

.users-header-item.email,
.user-item-email {
    flex: 2;
    min-width: 0;
    font-size: 12px;
    text-align: left;
    padding-left: 10px;
}

.users-header-item.role,
.user-item-role {
    width: 90px;
    text-align: center;
    font-size: 12px;
}

.users-header-item.date,
.user-item-date {
    width: 100px;
    font-size: 12px;
}

.users-header-item.actions,
.user-item-actions {
    width: 120px;
    white-space: nowrap;
    font-size: 12px;
}

.user-item-actions .btn {
    margin-right: 2px;
    padding: 3px 6px;
    font-size: 11px;
}

/* 텍스트 오버플로우 처리 */
.user-item-username, 
.user-item-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 행 호버 효과 */
.user-item:hover {
    background-color: #f9f9f9;
}

/* 모바일 반응형 스타일 */
@media (max-width: 768px) {
    /* 목록 컨테이너 스크롤 처리 */
    .users-list-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 모바일에서 날짜 숨김 */
    .users-list-header .date,
    .user-item-date {
        display: none;
    }
    
    /* 컬럼 너비 조정 */
    .users-header-item.role,
    .user-item-role {
        width: 70px;
        min-width: 70px;
    }
    
    .users-header-item.actions,
    .user-item-actions {
        width: 110px;
        min-width: 110px;
    }
    
    .users-header-item.username,
    .user-item-username {
        min-width: 100px;
    }
    
    .users-header-item.email,
    .user-item-email {
        min-width: 120px;
    }
    
    /* 글꼴 크기 조정 */
    .user-item {
        font-size: 12px;
    }
    
    /* 전체 너비 보장 */
    .users-list-items {
        min-width: 100%;
    }
    
    /* 행 높이 늘림 */
    .user-item > div,
    .users-header-item {
        height: 38px;
    }
    
    /* 버튼 터치 영역 확대 */
    .user-item-actions .btn {
        padding: 4px 8px;
        margin-bottom: 4px;
    }
}

/* 새로운 페이지 제목 스타일 */
main h2 {
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* 카테고리 접근 권한 스타일 */
.categories-access-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    margin-top: 5px;
    border-radius: 4px;
    background-color: #fff;
}

/* 체크박스 카테고리 트리 스타일 */
.categories-access-container .categories-tree {
    padding-left: 5px;
}

.categories-access-container .category-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-grow: 1;
    width: calc(100% - 50px); /* 아이콘 공간 제외하고 너비 제한 */
    overflow: hidden;
}

.categories-access-container .category-checkbox input[type="checkbox"] {
    margin-right: 6px;
    min-width: 13px;
    flex-shrink: 0;
}

.categories-access-container .category-checkbox .category-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 하위 카테고리 선택 시 체크됨 표시용 */
.categories-access-container .category-checkbox.has-selected {
    color: #4dabf7;
    font-weight: 600;
}

.form-help {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* 입력 필드 스타일 */
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="password"]:focus, 
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #4dabf7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 171, 247, 0.1);
}

/* 폼 그룹 스타일 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

/* 폼 액션 스타일 */
.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.access-denied-container {
    text-align: center;
    padding: 50px 20px;
    margin: 30px auto;
    max-width: 600px;
    background-color: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.access-denied-icon {
    font-size: 60px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.access-denied-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.access-denied-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 30px;
}

.btn-return {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-return:hover {
    background-color: #2980b9;
}

/* 인쇄 스타일 (인쇄 시에만 적용) */
@media print {
    /* 인쇄 시 네비게이션, 버튼 등 불필요한 요소 숨김 */
    header, nav, footer, .action-buttons, 
    .btn, .btn-primary, .btn-success, .btn-warning, .btn-danger,
    #amendmentModal, .mobile-tree-toggle, .category-path {
        display: none !important;
    }
    
    /* 인쇄 시 레이아웃 조정 */
    body, .container {
        background: white;
        color: black;
        margin: 0;
        padding: 0;
        width: 100%;
        box-shadow: none;
    }
    
    main, .regulation-content {
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* 트리 구조 숨기고 컨텐츠 영역 전체 너비 사용 */
    .regulations-container {
        display: block;
    }
    
    .categories-tree-container {
        display: none !important;
    }
    
    .regulation-content-area {
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* 테이블 인쇄 시 헤더와 내용 분리 방지 */
    table {
        page-break-inside: avoid;
    }
    
    /* 테이블 헤더 반복 (멀티 페이지에서 헤더 반복) */
    thead {
        display: table-header-group;
    }
    
    /* 테이블 푸터 반복 */
    tfoot {
        display: table-footer-group;
    }
    
    /* 표 내부의 row들이 분리되지 않도록 설정 */
    tr {
        page-break-inside: avoid;
    }
    
    /* 규정의 각 장/절이 분리되지 않도록 설정 */
    h1, h2, h3, h4, h5 {
        page-break-after: avoid;
    }
    
    /* 모든 이미지 크기 제한 및 분리 방지 */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    /* 규정 내용의 테이블 특화 스타일 */
    .regulation-table, .comparison-table, .annex-table {
        page-break-inside: avoid;
        border-collapse: collapse;
    }
    
    /* 페이지 수 표시 */
    @page {
        margin: 2cm;
    }
}