/* CWG Access - 공통 스타일 (BSMS manage 페이지 기반) */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: #f8f9fa;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

/* ── 컨테이너 ────────────────────────────────────── */
.go_content { background: white; margin: 0 auto; padding: 0; max-width: 1400px; }

/* ── 헤더 ────────────────────────────────────────── */
.content_top {
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 30px;
    background: white;
}

.works_tit h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

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

.page-subtitle { font-size: 13px; font-weight: 400; color: #666; }

.btn_wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── 네비게이션 ──────────────────────────────────── */
.nav-btn {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.nav-btn:hover { background: #f8f9fa; border-color: #bbb; color: #333; }
.nav-btn.active { background: #000; color: #fff; border-color: #000; }

.logout-btn {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    transition: all 0.15s;
    white-space: nowrap;
}
.logout-btn:hover { background: #f8d7da; border-color: #dc3545; color: #dc3545; }

/* ── 메인 컨텐츠 ─────────────────────────────────── */
.content_page { padding: 20px 30px; background: white; }

/* ── 페이지 액션바 ──────────────────────────────── */
.page-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── 필터 바 ─────────────────────────────────────── */
.filter-bar {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

.filter-item { display: flex; flex-direction: column; gap: 4px; }
.filter-item label { font-size: 12px; color: #666; font-weight: 500; }

.filter-input, .filter-select {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    min-width: 120px;
}
.filter-input:focus, .filter-select:focus { outline: none; border-color: #999; }

.filter-btns { display: flex; gap: 8px; }

/* ── 건수 표시 ───────────────────────────────────── */
.record-info { font-size: 13px; color: #666; margin-bottom: 10px; }

/* ── 버튼 ────────────────────────────────────────── */
.btn-black {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 8px 18px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
}
.btn-black:hover { background: #fff; color: #000; }

.btn-outline {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 18px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-outline:hover { background: #f8f9fa; border-color: #bbb; }

.btn-sm {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-sm:hover { background: #f8f9fa; }

.btn-del {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-del:hover { background: #dc3545; color: #fff; }

/* ── 테이블 ──────────────────────────────────────── */
.data-table-container {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    background: white;
    overflow-x: auto;
}

.rg-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.rg-table thead { background: #f8f9fa; border-bottom: 2px solid #e0e0e0; }

.rg-header-cell {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-right: 1px solid #e0e0e0;
    white-space: nowrap;
}
.rg-header-cell:last-child { border-right: none; }

.rg-data-row { border-bottom: 1px solid #f0f0f0; transition: background 0.1s; }
.rg-data-row:hover { background: #fafafa; }
.rg-data-row:last-child { border-bottom: none; }

.rg-data-cell {
    padding: 9px 8px;
    border-right: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}
.rg-data-cell:last-child { border-right: none; }

.empty-cell {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 13px;
}

/* ── 배지 ────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
}
.badge-inside { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.badge-exited { background: #f5f5f5; color: #666; border-color: #ddd; }

/* ── 페이지네이션 ─────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pg-btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    background: white;
    min-width: 32px;
    transition: all 0.1s;
}
.pg-btn:hover { background: #f8f9fa; }
.pg-btn.active { background: #000; color: #fff; border-color: #000; }

/* ── 알림 ────────────────────────────────────────── */
.alert {
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 4px;
    font-size: 13px;
    border-left: 4px solid;
}
.alert-success { background: #d4edda; color: #155724; border-left-color: #28a745; }
.alert-error   { background: #f8d7da; color: #721c24; border-left-color: #dc3545; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left-color: #17a2b8; }

/* ── 폼 ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: #333; }
.form-input, .form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}
.form-input:focus, .form-select:focus { outline: none; border-color: #999; }

/* ── 모달 ────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}
.modal-box {
    position: relative;
    background: white;
    border-radius: 6px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e0e0e0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none; border: none; font-size: 18px;
    cursor: pointer; color: #666; line-height: 1;
}
.modal-body  { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── 로그인 페이지 ──────────────────────────────── */
.login-page {
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    width: 100%;
    max-width: 400px;
    margin: 20px;
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-header h1 { font-size: 20px; color: #333; margin-bottom: 6px; }
.login-header p  { color: #666; font-size: 14px; }
.login-footer    { text-align: center; margin-top: 20px; color: #999; font-size: 12px; }
.btn-primary {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-primary:hover { background: #fff; color: #000; }

/* ── 섹션 제목 ──────────────────────────────────── */
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── 반응형 ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .content_top { padding: 14px 16px; }
    .content_page { padding: 16px; }
    .works_tit_inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .btn_wrap { flex-wrap: wrap; }
}

@media (max-width: 768px) {
    .nav-btn, .logout-btn { font-size: 12px; padding: 5px 10px; }
    .filter-row { gap: 8px; }
    .filter-input, .filter-select { min-width: 100px; }
    .rg-table { min-width: 800px; }
}
