/* 대시보드 — 메인 사이트 디자인과 일관된 스타일
   폰트는 head.php 가 Pretendard 를 CDN 으로 로드함 (Poppins 는 시스템폰트 의존, 메인과 동일 정책) */
* { box-sizing: border-box; }
body, html {
    margin:0;
    font-family: "Poppins", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
    color:#0f172a;
    background:#f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color:#1e40af; text-decoration:none; }
a:hover { text-decoration:underline; color:#0b2545; }

/* 코드/모노스페이스만 예외 (body 폰트 상속 차단) */
code, pre, kbd, samp, .nowrap-mono,
.adm-table .nowrap, .dash-board-table .bd-no, .dash-board-table .bd-views {
    font-family: "Consolas", "SF Mono", "Menlo", monospace;
    letter-spacing: 0;
}

/* 헤더 */
.dash-header { background:#fff; border-bottom:1px solid #e5e5e5; }
.dash-header-inner { max-width:1100px; margin:0 auto; padding:14px 20px;
  display:flex; align-items:center; gap:24px; flex-wrap:wrap; }
.dash-brand { font-weight:700; font-size:18px; color:#222; }
.dash-nav { display:flex; gap:14px; flex:1; }
.dash-userbox { display:flex; gap:10px; font-size:14px; color:#666; }

/* 본문 — WSC 메인 사이트 헤더(position:absolute, ~150px) 회피용 상단 여백 */
.dash-main { max-width:1100px; margin:0 auto; padding:180px 20px 40px; }
@media (max-width: 768px) {
  .dash-main { padding:140px 14px 30px; }
}
.dash-footer { text-align:center; padding:24px; color:#999; font-size:12px; }

/* WSC 테마 wrapping 시 — 실제 라이브 대시보드 컨텐츠 영역 */
.dash-page-area {
  max-width: 1500px;
  margin: 0 auto;
  padding: 200px 24px 60px;
  box-sizing: border-box;
}
.dash-page-inner {
  width: 100%;
}
.dash-page-inner h2:first-of-type {
  margin-top: 0;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 24px;
}
.dash-page-inner h3 {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.01em;
  margin: 28px 0 14px;
}

/* 게시판 표 — 단일 정의 (모던 톤: 둥근 모서리 + 그림자 + slate 컬러) */
.dash-board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px -6px rgba(15,23,42,0.08);
}
.dash-board-table thead th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  padding: 14px 12px;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
}
.dash-board-table tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}
.dash-board-table tbody tr:hover { background: #f8fafc; }
.dash-board-table tbody tr:last-child td { border-bottom: none; }
.dash-board-table a { color: #1e293b; font-weight: 600; }
.dash-board-table a:hover { color: #1e40af; }

/* 행/내용 보조 스타일 */
.dash-board-table .row-notice    { background: #fffae6; }
.dash-board-table .row-reply     { background: #fbfbfb; }
.dash-board-table .reply-prefix  { color: #aaa; margin-right: 4px; }
.dash-board-table .secret        { color: #999; }
.dash-board-table .has-files::after { content: " 📎"; color: #888; }

/* 상태 뱃지 — 단일 정의 */
.status-badge, .state {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #e9ecef;
  color: #444;
}
.status-badge.status-접수, .state.state--warn {
  background: #fef3c7; color: #92400e;
}
.status-badge.status-작업중, .state.state--info {
  background: #dbeafe; color: #1e40af;
}
.status-badge.status-작업완료, .state.state--ok {
  background: #d1fae5; color: #065f46;
}
.state.state--err {
  background: #fee2e2; color: #991b1b;
}

/* 상태 카드 — 통계 박스 */
.status-card {
  display: block;
  padding: 22px 24px !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  text-decoration: none !important;
  color: #1e293b !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: 0 4px 14px -6px rgba(15,23,42,0.06);
}
.status-card:hover {
  transform: translateY(-2px);
  border-color: #1e40af !important;
  box-shadow: 0 16px 32px -12px rgba(30,64,175,0.18);
  text-decoration: none !important;
}

/* 버튼 통일 — 메인 사이트 톤 */
.dash-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
  letter-spacing: -0.01em;
}
.dash-btn:hover {
  border-color: #1e40af;
  color: #1e40af;
  text-decoration: none;
}
.dash-btn-primary {
  background: linear-gradient(135deg, #1e40af, #06b6d4) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 8px 20px -6px rgba(30,64,175,0.4);
}
.dash-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -6px rgba(30,64,175,0.55);
  color: #fff !important;
}

/* 폼 입력 통일 */
.dash-form input[type=text],
.dash-form input[type=email],
.dash-form input[type=password],
.dash-form input[type=tel],
.dash-form input[type=url],
.dash-form input[type=number],
.dash-form select,
.dash-form textarea {
  padding: 10px 14px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  color: #0f172a !important;
  background: #fff !important;
  transition: border-color .2s, box-shadow .2s;
}
.dash-form input:focus,
.dash-form select:focus,
.dash-form textarea:focus {
  outline: none !important;
  border-color: #1e40af !important;
  box-shadow: 0 0 0 3px rgba(30,64,175,0.1) !important;
}
@media (max-width: 768px) {
  .dash-page-area { padding: 150px 14px 40px; }
  .dash-page-inner h2:first-of-type { font-size: 22px; }

  /* 게시판 표 — 좁은 화면에서 번호/조회 컬럼 숨기고 패딩 축소 */
  .dash-board-table { font-size: 14px; }
  .dash-board-table thead th,
  .dash-board-table tbody td { padding: 10px 6px; }
  .dash-board-table .bd-no,
  .dash-board-table .bd-views { display: none; }
  /* 답글 들여쓰기 줄이기 */
  .dash-board-table .row-reply td:nth-of-type(3) { padding-left: 6px; }
}
@media (max-width: 480px) {
  /* 더 좁아지면 작성자도 숨김 — 상태/제목/날짜만 */
  .dash-board-table .bd-name { display: none; }
  .dash-board-table .bd-date { white-space: nowrap; font-size: 12px; }
}

/* 폼 */
.dash-form label { display:block; margin-bottom:12px; }
.dash-form .row { display:flex; gap:12px; flex-wrap:wrap; }
.dash-form .row > label { flex:1 1 200px; }
.dash-form input[type=text], .dash-form input[type=email], .dash-form input[type=password],
.dash-form input[type=tel], .dash-form input[type=url], .dash-form select, .dash-form textarea {
  width:100%; padding:8px 10px; border:1px solid #ccc; border-radius:4px; font:inherit; }
.dash-form textarea { min-height:200px; resize:vertical; }
.dash-form .actions { display:flex; gap:8px; margin-top:16px; }
.dash-btn { display:inline-block; padding:8px 16px; border:1px solid #ccc; border-radius:4px;
  background:#fff; color:#222; cursor:pointer; font:inherit; text-decoration:none; }
.dash-btn:hover { background:#f0f0f0; text-decoration:none; }
.dash-btn-primary { background:#06c; color:#fff; border-color:#06c; }
.dash-btn-primary:hover { background:#05a; }
.dash-btn-danger { background:#c33; color:#fff; border-color:#c33; }

/* 게시판 */
.dash-board-toolbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:12px; }
.dash-board-toolbar form { display:flex; gap:6px; }
.dash-board-toolbar select, .dash-board-toolbar input { padding:6px 8px; border:1px solid #ccc; border-radius:4px; }

/* 관리자 일괄 작업 바 */
.dash-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.dash-bulk-bar strong { font-weight: 700; color: #334155; }
.dash-bulk-bar select {
  padding: 8px 32px 8px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  min-width: 140px;
}
.dash-bulk-bar select:hover { border-color: #94a3b8; }
.dash-bulk-bar select:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}
/* 드롭다운 열림 — JS 가 .is-open 클래스 토글 */
.dash-bulk-bar select.is-open {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%231e40af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 7.5l3-3 3 3'/></svg>");
  border-color: #1e40af;
}
.dash-bulk-count { color: #64748b; font-size: 14px; }

.pagination { display:flex; gap:4px; justify-content:center; margin:20px 0; }
.pagination .page { padding:6px 10px; border:1px solid #ddd; border-radius:4px;
  background:#fff; color:#444; }
.pagination .page.active, .pagination strong.page { background:#06c; color:#fff; border-color:#06c; }

/* 글쓰기 폼 — 표 스타일 (그누보드식) */
.dash-write-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-top: 2px solid #334155;
  margin-bottom: 16px;
}
.dash-write-table th,
.dash-write-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
  font-size: 15px;
  text-align: left;
}
.dash-write-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  width: 110px;
  border-left: 1px solid #e2e8f0;
}
.dash-write-table td {
  color: #1e293b;
  border-right: 1px solid #e2e8f0;
  position: relative;
}
.dash-write-table .req {
  color: #e11d48;
  font-weight: 700;
  margin-left: 2px;
}
.dash-write-table input[type=text],
.dash-write-table input[type=email],
.dash-write-table input[type=password],
.dash-write-table input[type=tel],
.dash-write-table input[type=url] {
  width: 100%;
  max-width: 420px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.dash-write-table input[type=text]:focus,
.dash-write-table input[type=email]:focus,
.dash-write-table input[type=password]:focus,
.dash-write-table input[type=tel]:focus,
.dash-write-table input[type=url]:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}
.dash-write-table input[type=file] {
  font-size: 14px;
}
.dash-write-table input[type=checkbox],
.dash-write-table input[type=radio] {
  margin-right: 4px;
  vertical-align: middle;
}
.dash-write-table label {
  display: inline-flex;
  align-items: center;
  margin-right: 16px;
  font-size: 15px;
  cursor: pointer;
}
/* 에디터 셀 — 패딩만 조정 (Quill 자체 스타일 유지) */
.dash-write-table td:has(#dash-editor) { padding: 14px; }
.dash-write-table .ql-container,
.dash-write-table .ql-editor { font-family: inherit; }
.dash-write-table .ql-editor { min-height: 280px; font-size: 16px; }

/* Quill 2 는 기본 인라인 포맷 스타일을 빼서 (B/I/U/S) 직접 명시 필요 */
.dash-write-table .ql-editor strong,
.dash-view-content strong,
.dash-view-content b { font-weight: 700; }

.dash-write-table .ql-editor em,
.dash-view-content em,
.dash-view-content i { font-style: italic; }

.dash-write-table .ql-editor u,
.dash-view-content u { text-decoration: underline; }

.dash-write-table .ql-editor s,
.dash-write-table .ql-editor strike,
.dash-view-content s,
.dash-view-content strike { text-decoration: line-through; }

/* 폼 하단 버튼 영역 */
.dash-write-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

/* 글 보기 */
.dash-view-header { padding:14px 0; border-bottom:1px solid #e5e5e5; }
.dash-view-header h1 { font-size:20px; margin:0 0 8px; }
.dash-view-meta { color:#777; font-size:15px; display:flex; gap:14px; flex-wrap:wrap; }
.dash-view-content { padding:20px 0; min-height:200px; line-height:1.6; word-break:break-word; }
.dash-view-content p  { margin:0 0 0.4em; }
.dash-view-content br { line-height:1.4; }
.dash-view-content p:has(br:only-child) { min-height:0.6em; margin:0; }
.dash-view-content img { max-width:100%; height:auto; }
.dash-view-content table { border-collapse:collapse; max-width:100%; }
.dash-view-content table td, .dash-view-content table th { padding:4px 8px; border:1px solid #ddd; }
.dash-view-files { padding:14px 0; border-top:1px dashed #ddd; }
.dash-view-files li { margin-bottom:4px; }
.dash-view-actions { display:flex; gap:6px; padding:14px 0; border-top:1px solid #e5e5e5; flex-wrap:wrap; }

/* 알림/에러 */
.dash-alert { padding:10px 14px; border-radius:4px; margin-bottom:12px; }
.dash-alert-err  { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }
.dash-alert-ok   { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.dash-alert-info { background:#e2e3e5; color:#383d41; border:1px solid #d6d8db; }

/* 캡차 */
.dash-captcha { display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; background:#f5f5f5; border-radius:4px; font-weight:500; }
.dash-captcha input { width:80px; }
