/* 글렌텍 관리자 공통 */
* { box-sizing: border-box; }
body { margin: 0; font-family: sans-serif; font-size: 14px; color: #333; }
a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 로그인 페이지 */
.page_login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f5f5f5; }
.login_wrap { width: 100%; max-width: 400px; padding: 20px; }
.login_box { background: #fff; padding: 32px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.login_title { margin: 0 0 24px; font-size: 18px; text-align: center; }
.form_login .form_group { margin-bottom: 16px; }
.form_label { display: block; margin-bottom: 4px; font-weight: 600; }
.form_control { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.btn_login { width: 100%; padding: 12px; margin-top: 8px; background: #0066cc; color: #fff; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; }
.btn_login:hover { background: #0052a3; }
.login_error { margin: 0 0 12px; padding: 8px; background: #fee; color: #c00; border-radius: 4px; font-size: 13px; }

/* 레이아웃: 헤더 + 사이드바 + 메인 */
.admin_header { position: fixed; top: 0; left: 0; right: 0; height: 50px; background: #2c3e50; color: #fff; z-index: 100; }
.admin_header_inner { display: flex; align-items: center; justify-content: space-between; height: 100%; padding: 0 20px; }
.admin_logo { margin: 0; font-size: 18px; font-weight: 600; }
.admin_user { display: flex; align-items: center; gap: 12px; }
.admin_user_name { font-size: 13px; }
.btn_logout { color: #ecf0f1; font-size: 13px; }
.btn_logout:hover { color: #fff; text-decoration: underline; }

.admin_sidebar { position: fixed; top: 50px; left: 0; width: 220px; bottom: 0; background: #34495e; color: #ecf0f1; overflow-y: auto; z-index: 99; }
.admin_nav { padding: 16px 0; }
.admin_menu { list-style: none; margin: 0; padding: 0; }
.admin_menu_item { margin-bottom: 4px; }
.admin_menu_title { display: block; padding: 8px 16px; font-size: 12px; font-weight: 600; color: #bdc3c7; text-transform: uppercase; }
.admin_menu_link { display: block; padding: 8px 16px; color: #ecf0f1; font-size: 13px; }
.admin_menu_link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.admin_menu_link.is_active { background: rgba(255,255,255,0.15); color: #fff; }
.admin_submenu { list-style: none; margin: 0; padding: 0 0 0 8px; }
.admin_submenu_link { display: block; padding: 6px 12px; color: #bdc3c7; font-size: 12px; }
.admin_submenu_link:hover { color: #fff; }
.admin_submenu_link.is_active { color: #3498db; }

.admin_main { margin-left: 220px; margin-top: 50px; padding: 24px; min-height: calc(100vh - 50px); background: #ecf0f1; }

/* 공통: 페이지 타이틀, 테이블, 버튼 */
.page_title { margin: 0 0 20px; font-size: 20px; }
.table_wrap { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); overflow: hidden; }
.admin_table { width: 100%; border-collapse: collapse; }
.admin_table th, .admin_table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #eee; }
.admin_table th { background: #f8f9fa; font-weight: 600; font-size: 13px; }
.admin_table .col_check { width: 44px; text-align: center; vertical-align: middle; }
.admin_table .col_check .form_check_label { margin: 0; justify-content: center; }
.admin_table tbody tr:hover { background: #f8f9fa; }
.form_actions_list { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eee; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; border: none; }
.btn_primary { background: #0066cc; color: #fff; }
.btn_primary:hover { background: #0052a3; color: #fff; }
.btn_secondary { background: #6c757d; color: #fff; }
.btn_danger { background: #dc3545; color: #fff; }
.btn_small { padding: 4px 10px; font-size: 12px; }
.badge_notice { display: inline-block; padding: 2px 6px; margin-right: 6px; font-size: 11px; font-weight: 600; color: #fff; background: #dc3545; border-radius: 4px; }
.form_actions { margin-top: 20px; }
.form_actions .btn_order { background: #17a2b8; color: #fff; }
.form_actions .btn_order:hover { background: #138496; color: #fff; }
.flash_success { padding: 10px; background: #d4edda; color: #155724; border-radius: 4px; margin-bottom: 16px; }
.flash_error { padding: 10px; background: #f8d7da; color: #721c24; border-radius: 4px; margin-bottom: 16px; }
.form_wrap .form_group { margin-bottom: 16px; }
.form_check_label { display: inline-flex; align-items: center; gap: 6px; font-weight: normal; cursor: pointer; }
.form_check { width: auto; margin: 0; }
.form_editor { width: 100%; min-height: 200px; }
.ck-editor .ck-editor__editable { min-height: 200px; }
.paging a { margin-right: 8px; }
.paging a.is_current { font-weight: bold; }
.inquiry_content { white-space: pre-wrap; }
.profile_section { margin-bottom: 32px; }
.section_title { margin: 0 0 12px; font-size: 16px; }

/* 순서변경 모달 */
.modal_overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal_overlay.is_hidden { display: none; }
.modal_order { background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; }
.modal_order_header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal_order_title { margin: 0; font-size: 18px; }
.modal_order_close { background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; color: #666; padding: 0 4px; }
.modal_order_close:hover { color: #333; }
.modal_order_body { padding: 20px; overflow-y: auto; flex: 1; }
.modal_order_toolbar { margin-bottom: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modal_order_toolbar .form_label { margin-right: 4px; margin-bottom: 0; }
.modal_order_toolbar select.form_control { width: auto; min-width: 80px; }
.order_list { list-style: none; margin: 0; padding: 0; }
.order_list_item { padding: 12px 14px; margin-bottom: 6px; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px; cursor: grab; display: flex; align-items: center; gap: 10px; }
.order_list_item:active { cursor: grabbing; }
.order_list_item.dragging { opacity: 0.5; background: #e9ecef; }
.order_list_item.drag_over { border-color: #0066cc; background: #e7f1ff; }
.order_list_item_handle { color: #999; font-size: 18px; user-select: none; }
.order_list_item_title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal_order_footer { padding: 16px 20px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; }
.order_list_empty { padding: 24px; text-align: center; color: #666; }
.order_list_empty.is_hidden { display: none; }

/* 첨부파일: input 1개 = 파일 1개, +/- 행 추가/제거 */
.form_group_attach .form_label { margin-bottom: 8px; }
.form_attach_list { margin-bottom: 8px; }
.form_attach_row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.form_attach_row .form_attach_input { flex: 1; margin: 0; }
.form_attach_row .btn_attach_remove { flex-shrink: 0; width: 36px; min-width: 36px; padding: 8px; font-size: 18px; line-height: 1; background: #6c757d; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.form_attach_row .btn_attach_remove:hover { background: #5a6268; color: #fff; }
.btn_attach_add { padding: 8px 14px; font-size: 13px; background: #17a2b8; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.btn_attach_add:hover { background: #138496; color: #fff; }
.btn_attach_add:disabled { opacity: 0.6; cursor: not-allowed; }
.form_attach_add_wrap.is_hidden { display: none; }
.form_attach_max_msg { margin: 8px 0 0; font-size: 13px; color: #666; }
.form_attach_max_msg.is_hidden { display: none; }

/* 기존 첨부: 다운로드 안내 + 삭제 */
.form_attach_guide { margin: 0 0 10px; font-size: 13px; color: #555; }
.table_attach_existing { width: 100%; max-width: 640px; border-collapse: collapse; margin-bottom: 12px; background: #fff; border: 1px solid #e9ecef; border-radius: 6px; overflow: hidden; }
.table_attach_existing th, .table_attach_existing td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
.table_attach_existing th { background: #f8f9fa; font-size: 12px; font-weight: 600; }
.table_attach_existing tbody tr:last-child td { border-bottom: none; }
.table_attach_existing .attach_file_name { word-break: break-all; }
.table_attach_existing .link_download { display: inline-block; padding: 4px 10px; font-size: 12px; background: #0066cc; color: #fff; border-radius: 4px; }
.table_attach_existing .link_download:hover { background: #0052a3; color: #fff; text-decoration: none; }
.table_attach_existing .form_check_delete_file { margin: 0; }
.form_attach_empty { margin: 0 0 12px; font-size: 13px; color: #666; }
