body { font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", Arial, sans-serif; margin:0; background:#f6f7fb; color:#111; }
header { background:#111827; color:#fff; padding:14px 18px; }
header a { color:#fff; text-decoration:none; }
.wrap { max-width: 980px; margin: 0 auto; padding: 18px; }
nav { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
nav .spacer { flex:1; }
.card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:16px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.grid { display:grid; gap:12px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ✅ 모바일에서 패딩/글자 조금 줄여서 더 보기 좋게 */
@media (max-width: 640px) {
  .table th, .table td {
    padding: 8px 6px;
    font-size: 13px;
  }
}

.btn { display:inline-block; padding:10px 12px; border-radius:10px; border:1px solid #d1d5db; background:#fff; text-decoration:none; color:#111; font-size:14px; }
.btn-primary { background:#2563eb; border-color:#2563eb; color:#fff; }
.btn-danger { background:#dc2626; border-color:#dc2626; color:#fff; }
.btn + .btn { margin-left: 6px; }
.muted { color:#6b7280; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* ✅ 테이블: 열 폭 고정 + 줄바꿈 방지 + 말줄임 */
.table {
  table-layout: fixed;
  width: 100%;
}
.table th, .table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* ⭐ 추가: 4열 전부 가운데 정렬 */
  text-align: center;
}

/* 제목 열 내용(td)만 왼쪽 */
.table td:nth-child(2) {
  text-align: left;
}

/* 제목 헤더(th)는 가운데 유지 */
.table th:nth-child(2) {
  text-align: center;
}

/* ✅ 모바일에서 테이블 깨짐 방지: 가로 스크롤 허용 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.badge { display:inline-block; padding:4px 8px; border-radius:999px; font-size:12px; border:1px solid #e5e7eb; background:#f9fafb; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.field { margin: 10px 0; }
label { display:block; font-weight:600; margin-bottom:6px; }

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  width: 100%;
  box-sizing:border-box;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #d1d5db;
  background:#fff;
}
select[multiple] { min-height: 140px; }
.help { font-size:12px; color:#6b7280; margin-top:6px; }

.msg { padding:10px 12px; border-radius:10px; margin: 0 0 12px 0; border:1px solid #e5e7eb; background:#fff; }
.msg.success { border-color:#86efac; background:#f0fdf4; }
.msg.error { border-color:#fecaca; background:#fef2f2; }

footer { padding: 20px 0; color:#6b7280; font-size:12px; }

/* ===== 프로필 팝오버 ===== */
.profile-wrap { display:flex; align-items:center; gap:10px; position:relative; }

.profile-btn {
  border:0;
  background:transparent;
  cursor:pointer;
  padding:0;
  line-height:0;
}

.profile-avatar{
  width:34px; height:34px;
  border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  background:#ffffff1a;
  border:1px solid rgba(255,255,255,0.25);
  color:#fff;
  font-weight:800;
}

.profile-row{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap:10px;
  padding:8px 0;
  border-top:1px solid #f1f5f9;
}

.profile-row:first-of-type{ border-top:0; }

.profile-label{ color:#6b7280; font-size:12px; }
.profile-value{ color:#111; font-size:13px; word-break:break-word; }

/* =======================================================
📱MOBILE CARD LAYOUT (doc list)
PC = 기존 테이블 유지
MOBILE = 카드형 자동 변환
======================================================= */
@media (max-width: 768px){

  .doc-table,
  .doc-table thead,
  .doc-table tbody,
  .doc-table th,
  .doc-table td,
  .doc-table tr{
    display:block;
    width:100%;
  }

  .doc-table thead{
    display:none;
  }

  .doc-table tr{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:10px 12px;
    margin-bottom:10px;
    box-shadow:0 1px 3px rgba(0,0,0,0.04);
  }

  .doc-table td{
    border:none;
    padding:4px 0;
    text-align:left !important;
    white-space:normal;
  }

  .doc-table td:nth-child(1){
    font-size:12px;
    font-weight:600;
    color:#2563eb;
    margin-bottom:4px;
  }

  .doc-table td:nth-child(2){
    font-size:15px;
    font-weight:700;
    margin-bottom:8px;
    line-height:1.4;
  }

  .doc-table td:nth-child(3),
  .doc-table td:nth-child(4){
    display:inline-block;
    font-size:12px;
    color:#6b7280;
    margin-right:12px;
  }

  .doc-table td:nth-child(3)::before{
    content:"작성자 ";
    font-weight:600;
    color:#374151;
  }

  .doc-table td:nth-child(4)::before{
    content:"수정 ";
    font-weight:600;
    color:#374151;
  }
}

/* ==========================
✅ Dashboard (Mobile polish)
========================== */

.dash-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}

.dash-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display:flex;
  flex-direction:column;
  gap:10px;

  align-items:center;
  text-align:center;
}

.dash-label{
  color:#6b7280;
  font-size:13px;
  font-weight:600;
}

.dash-num{
  font-size:30px;
  font-weight:900;
  line-height:1;
}

.dash-btn{
  width:auto;
  text-align:center;
  margin-top:auto;
  align-self:center;
}

.dash-create-btn{
  width:auto;
  text-align:center;
}

@media (max-width: 768px){
  .wrap{ padding:14px; }
  .dash-grid{
    grid-template-columns: 1fr;
    gap:10px;
  }
  .dash-card{
    padding:14px;
    align-items:center;
    text-align:center;
  }
  .dash-label{
    font-size:13px;
  }
  .dash-num{
    font-size:34px;
  }
  .dash-btn, .dash-create-btn{
    padding:12px 12px;
    border-radius:12px;
  }
}

/* ===== 내 프로필 상세 전용 ===== */
.profile-detail-card .profile-row{
  grid-template-columns: 120px 1fr;   /* 왼쪽 열 확장 */
  gap: 16px;
  padding: 12px 0;
}

.profile-detail-card .profile-label{
  font-size: 15px;   /* 기존 12px -> 확대 */
  font-weight: 700;
  color: #374151;
}

.profile-detail-card .profile-value{
  font-size: 16px;   /* 기존 13px -> 확대 */
  line-height: 1.6;
  color: #111827;
  word-break: break-word;
}

/* 모바일에서도 너무 작지 않게 */
@media (max-width: 768px){
  .profile-detail-card{
    padding: 18px;
  }

  .profile-detail-card .profile-row{
    grid-template-columns: 96px 1fr;   /* 모바일에서도 왼쪽 열 확보 */
    gap: 12px;
    padding: 10px 0;
  }

  .profile-detail-card .profile-label{
    font-size: 14px;
  }

  .profile-detail-card .profile-value{
    font-size: 15px;
    line-height: 1.55;
  }
}