/* 사내 신고 센터 — 반응형 기본 스타일 (빌드 도구 없음, CSP 'self' 호환) */
:root {
    --bg: #f5f6f8; --surface: #fff; --text: #1d2330; --muted: #5d6676; --line: #dde1e7;
    --primary: #1f5eff; --primary-ink: #fff; --ok: #1d7a45; --warn: #9a5b00; --error: #b42318;
    --info: #2257a8; --radius: 10px;
    --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; }
a { color: var(--primary); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; line-height: 1.3; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }
.topbar { background: #12233f; color: #fff; }
.topbar-staff { background: #22262e; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; }
.tag { font-size: .75rem; background: #ffffff22; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.nav { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.nav a, .nav .linklike { color: #dfe6f3; text-decoration: none; font-size: .95rem; }
.nav a:hover { color: #fff; text-decoration: underline; }
.whoami { color: #aab3c2; font-size: .8rem; padding-bottom: 8px; }
.footer { color: var(--muted); font-size: .85rem; padding: 24px 0; border-top: 1px solid var(--line); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.narrow { max-width: 520px; }
.hero { padding: 16px 0 8px; }
.hero p { max-width: 720px; color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; word-break: break-all; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.inline { display: inline; }

/* 폼 */
.form label, .form-grid label, .filters label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 12px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=date],
input[type=datetime-local], select, textarea {
    display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid #c4cad4; border-radius: 8px;
    font: inherit; font-weight: 400; background: #fff; color: var(--text);
}
input[type=file] { display: block; margin-top: 6px; font-weight: 400; max-width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db8ff; border-color: var(--primary); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 4px; }
label.radio, label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 6px 0; }
.contact-fields[hidden] { display: none; }
.field-error { color: var(--error); font-size: .875rem; margin: -6px 0 10px; }
.form-inline { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.form-inline select { width: auto; flex: 1 1 180px; margin: 0; }
.wrap-inline label.check { margin: 0 4px; font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; align-items: end; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; align-items: end; }
.filters .grow { grid-column: span 2; }

/* 버튼 */
.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid #c4cad4; background: #fff; color: var(--text);
    text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f0f2f5; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #164bd1; }
.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-small { padding: 5px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }

/* 알림 */
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-ok { background: #eaf6ef; border-color: #b6e0c6; color: var(--ok); }
.alert-info { background: #eaf1fb; border-color: #bcd2f0; color: var(--info); }
.alert-warn { background: #fff6e5; border-color: #f2d49b; color: var(--warn); }
.alert-error { background: #fdecea; border-color: #f5c2bd; color: var(--error); }

/* 배지 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: #e7eaf0; color: #364154; white-space: nowrap; }
.badge-received { background: #e8eefc; color: #2343a0; }
.badge-reviewing { background: #f0e9fd; color: #5b2ca5; }
.badge-in_progress { background: #fff1d6; color: #8a5300; }
.badge-info_requested { background: #fde7e4; color: #a12b1c; }
.badge-closed { background: #e2f4e9; color: #1d6b3e; }
.pill { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 99px; background: #eef0f3; color: #4a5363; margin-left: 4px; }
.pill-warn { background: #fff1d6; color: #8a5300; }
.pill-ok { background: #e2f4e9; color: #1d6b3e; }

/* 키 표시 */
.keybox .big { font-size: 1.15rem; background: #f3f5f9; padding: 6px 10px; border-radius: 6px; display: inline-block; word-break: break-all; }
.keybox .key { letter-spacing: .04em; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* 사건 */
.case-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.case-head h1 { margin-bottom: .2rem; }
.case-head-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline { margin: 0; padding-left: 18px; }
.timeline li { margin-bottom: 8px; }
.msg, .note { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.msg header, .note header { font-size: .85rem; }
.msg p, .note p { margin: 6px 0 0; }
.msg-staff { background: #f2f6ff; border-color: #cddbff; }
.msg-reporter { background: #fafafa; }
.public-zone { border-top: 4px solid var(--primary); }
.internal-zone { border-top: 4px solid #6b7280; background: #fbfbfc; }
.zone-label { font-size: .8rem; font-weight: 700; color: var(--muted); margin-top: -6px; }
.note { background: #f4f4f6; }
.file-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.files { padding-left: 18px; margin: 6px 0; }
li.revoked { color: var(--muted); text-decoration: line-through; text-decoration-color: #c4cad4; }
li.revoked .pill, li.revoked .tiny { text-decoration: none; }
.recuse { margin-top: 10px; }
.recuse summary { cursor: pointer; color: var(--error); font-weight: 600; font-size: .9rem; }

/* 대시보드 */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--text); }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat strong { font-size: 1.7rem; }
.stat:hover { border-color: var(--primary); }

/* 표 */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #f7f8fa; font-weight: 700; white-space: nowrap; }
.card .table-wrap { border: 0; }
.pagination { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 16px 0; }
.pagination .disabled { color: #aab0ba; }
.notice ul { padding-left: 20px; margin: 0; }
.notice li { margin-bottom: 6px; }

@media (max-width: 900px) {
    .cols, .grid-3 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    h1 { font-size: 1.35rem; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .filters .grow { grid-column: auto; }
    .kv { grid-template-columns: 1fr; }
    .table th, .table td { padding: 8px; }
}
