/* ============================================================
   나라장터 모니터링 - 웹 관리 UI 스타일
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif; background: #f0f2f5; }

/* ── 사이드바 ── */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; background: #1a1a2e; color: #fff; padding: 24px 0; z-index: 10; }
.sidebar .logo { padding: 0 24px; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.sidebar .logo-sub { padding: 0 24px; font-size: 12px; color: #888; margin-bottom: 32px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 12px 24px; color: #aaa; text-decoration: none; font-size: 14px; transition: all 0.2s; }
.sidebar nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar nav a.active { background: rgba(74,108,247,0.2); color: #4a6cf7; border-right: 3px solid #4a6cf7; }
.sidebar .user-info { position: absolute; bottom: 24px; left: 0; right: 0; padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar .user-info .name { font-size: 13px; font-weight: 600; }
.sidebar .user-info .role { font-size: 11px; color: #888; }
.sidebar .user-info .links { margin-top: 6px; display: flex; gap: 12px; }
.sidebar .user-info .links a { font-size: 12px; color: #4a6cf7; text-decoration: none; }
.sidebar .user-info .links a:hover { text-decoration: underline; }

/* ���─ 메인 ── */
.main { margin-left: 240px; padding: 32px; }
.main h2 { font-size: 22px; color: #1a1a2e; margin-bottom: 24px; }

/* ── 플래시 메시지 ── */
.flash { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.flash.success { background: #e8f5e9; color: #2e7d32; }
.flash.error { background: #fce4ec; color: #c62828; }

/* ── 상태 카드 ── */
.status-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.card { background: #fff; border-radius: 10px; padding: 20px 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.card .label { font-size: 12px; color: #888; margin-bottom: 8px; font-weight: 500; }
.card .value { font-size: 28px; font-weight: 700; color: #1a1a2e; }
.card .value.success { color: #2e7d32; }
.card .value.fail { color: #c62828; }
.card .value.info { color: #4a6cf7; }
.card .value.sm { font-size: 18px; }
.card .sub { font-size: 12px; color: #aaa; margin-top: 4px; }

/* ── 액션 바 ── */
.action-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }

/* ── 버튼 ── */
.btn { display: inline-block; padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 0.2s; }
.btn-primary { background: #4a6cf7; color: #fff; }
.btn-primary:hover { background: #3a5ce5; }
.btn-danger { background: #ef5350; color: #fff; }
.btn-danger:hover { background: #d32f2f; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }

/* ── 테이블 ── */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
th { background: #f8f9fa; padding: 12px 16px; text-align: left; font-size: 12px; color: #888; font-weight: 600; }
td { padding: 12px 16px; border-top: 1px solid #f0f0f0; font-size: 13px; color: #333; }
.download-link { color: #4a6cf7; text-decoration: none; font-weight: 500; }
.download-link:hover { text-decoration: underline; }

/* ── 뱃지 ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge.success { background: #e8f5e9; color: #2e7d32; }
.badge.fail { background: #fce4ec; color: #c62828; }
.badge.admin { background: #eef2ff; color: #4a6cf7; }
.badge.user { background: #f5f5f5; color: #888; }

/* ── 패널 ── */
.panel { background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.panel h3 { font-size: 16px; color: #1a1a2e; margin-bottom: 4px; }
.panel .desc { font-size: 12px; color: #888; margin-bottom: 16px; }
.panel .count { font-size: 12px; color: #4a6cf7; font-weight: 600; margin-bottom: 16px; }

/* ── 폼 ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74,108,247,0.1); }

.add-form { display: flex; gap: 8px; margin-bottom: 16px; }
.add-form input, .add-form select { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.add-form input:focus, .add-form select:focus { outline: none; border-color: #4a6cf7; }

/* ── 키워드/수신자 그리드 ── */
.keyword-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.keyword-list { max-height: 480px; overflow-y: auto; }
.keyword-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 6px; margin-bottom: 4px; transition: background 0.15s; }
.keyword-item:hover { background: #f5f5f5; }
.keyword-item .text { font-size: 14px; color: #333; }
.keyword-item form button { background: none; border: none; color: #bbb; cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 4px; transition: all 0.15s; }
.keyword-item form button:hover { color: #d32f2f; background: #fce4ec; }

.recipient-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 8px; transition: border-color 0.15s; }
.recipient-item:hover { border-color: #ddd; }
.recipient-item .email { font-size: 14px; color: #333; }
.recipient-item form button { background: none; border: 1px solid #eee; color: #999; cursor: pointer; font-size: 12px; padding: 4px 12px; border-radius: 4px; }
.recipient-item form button:hover { color: #d32f2f; border-color: #ffcdd2; background: #fff5f5; }

/* ── 설정 ── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 900px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.checkbox-item:hover { border-color: #4a6cf7; }
.checkbox-item.checked { background: #eef2ff; border-color: #4a6cf7; color: #4a6cf7; font-weight: 600; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #eef2ff; color: #4a6cf7; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag form button { background: none; border: none; cursor: pointer; color: #999; font-size: 14px; }
.tag form button:hover { color: #d32f2f; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.toggle-row span { font-size: 14px; color: #333; }

/* ── 계정 관리 ── */
.add-user-form { display: flex; gap: 8px; margin-bottom: 24px; align-items: end; }
.add-user-form .field { flex: 1; }
.add-user-form .field label { display: block; font-size: 11px; font-weight: 600; color: #888; margin-bottom: 4px; }
.add-user-form .field input, .add-user-form .field select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.btn-action { display: inline-block; background: none; border: 1px solid #ddd; color: #666; cursor: pointer; font-size: 11px; padding: 4px 10px; border-radius: 4px; margin-right: 4px; transition: all 0.15s; text-decoration: none; }
.btn-action:hover { border-color: #4a6cf7; color: #4a6cf7; }
.btn-action.danger:hover { border-color: #ef5350; color: #ef5350; }

/* ── 로그인 ── */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); padding: 48px 40px; width: 400px; }
.login-card h1 { font-size: 22px; color: #1a1a2e; margin-bottom: 8px; text-align: center; }
.login-card .subtitle { font-size: 14px; color: #888; margin-bottom: 32px; text-align: center; }
.btn-login { width: 100%; padding: 12px; background: #4a6cf7; color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-login:hover { background: #3a5ce5; }

/* ── empty state ── */
.empty-state { text-align: center; color: #ccc; padding: 40px 0; }
.empty-state .icon { font-size: 32px; margin-bottom: 8px; }
.empty-state .text { font-size: 13px; }

/* ── 비밀번호 변경 ── */
.password-card { background: #fff; border-radius: 10px; padding: 32px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); max-width: 440px; }
.password-card h3 { font-size: 18px; margin-bottom: 20px; }

/* ── 모달 ── */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); justify-content: center; align-items: center; z-index: 100; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 32px; width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; }
