/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* 전체 */

.tab-wrap {
    width: 100%;
}

/* 탭 메뉴 */
.tabs {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tab a {
    border: none;
    color: #666;
    padding: 14px 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.25s ease;
}


/* 활성 탭 */
.tab.active a {
    background: #ffffff;
    color: #3f51b5;
    position: relative;
}



/* 이미지 속 섹션 헤더 느낌 */
.section-title {
    background: #eef1fb;
    color: #3f51b5;
    font-size: 18px;
    font-weight: 700;
    padding: 14px 20px;
    border-radius: 6px;
    position: relative;
    margin-bottom: 20px;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: #4b5cff;
    border-radius: 6px 0 0 6px;
}

.content-box {
    min-height: 250px;
    border: 1px solid #e3e7ef;
    border-radius: 6px;
    padding: 20px;
}



/* ── 카드 래퍼 ── */
.wrap {
  max-width: 1020px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 10px 36px rgba(0,0,0,.08);
  padding: 44px 52px 56px;
}

/* ── 섹션 제목 ── */
.sec-title {
  margin: 38px 0 14px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #3730a3;
  background: linear-gradient(90deg, #eef2ff 0%, #f5f7ff 100%);
  border-left: 4px solid #4f46e5;
  border-radius: 0 8px 8px 0;
  letter-spacing: -.3px;
}

/* ── 테이블 공통 ── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2px;
}
th, td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 11px 14px;
  vertical-align: middle;
  font-size: 13.5px;
}
th:last-child, td:last-child { border-right: none; }
tr:last-child th, tr:last-child td { border-bottom: none; }
th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 12.5px;
  color: #475569;
  white-space: nowrap;
}
td { background: #fff; }

/* ── 입력 공통 ── */
input[type=text],
input[type=number],
select {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
input[type=text]:focus,
input[type=number]:focus,
select:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}
input[type=file] { display: none; }

/* ── 사진 영역 ── */
.photo-cell {
  width: 218px;
  text-align: center;
  background: #f8fafc;
  padding: 18px !important;
  vertical-align: middle;
}
.photo-box {
  width: 182px;
  height: 132px;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #f1f5f9;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.photo-box:hover { border-color: #4f46e5; background: #eef2ff; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: none; border-radius: 10px; }
#photoPlaceholder::before {
  content: '🖼';
  display: block;
  font-size: 30px;
  line-height: 1;
  margin-bottom: 3px;
  text-align: center;
}
#photoPlaceholder { font-size: 12px; color: #94a3b8; }

/* 파일 버튼 행 */
.file-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-filepick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 14px;
  background: #fff;
  color: #64748b;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-filepick:hover { border-color: #4f46e5; color: #4f46e5; background: #eef2ff; }
.file-label { font-size: 12.5px; color: #94a3b8; }

.note { font-size: 12px; color: #ef4444; margin-top: 6px; }
.sub-note { font-size: 12px; color: #ef4444; margin-top: 10px; }
.hint { font-size: 13px; color: #64748b; margin: 0 5px; }

/* ── 리치텍스트 에디터 ── */
.editor-wrap {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.editor-wrap:focus-within {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

/* 툴바 */
.editor-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 5px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  row-gap: 3px;
}
.tb-select {
  height: 26px;
  padding: 0 6px;
  padding-right: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  color: #475569;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 5px center;
  width: auto;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: border-color .12s;
}
.tb-select:focus { border-color: #4f46e5; }

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 26px;
  padding: 0 5px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  color: #475569;
  font-family: inherit;
  transition: all .12s;
  line-height: 1;
}
.tb-btn:hover { background: #eef2ff; border-color: #c7d2fe; color: #4f46e5; }
.tb-btn.tb-bold   { font-weight: 700; }
.tb-btn.tb-italic { font-style: italic; }
.tb-btn.tb-under  { text-decoration: underline; }
.tb-btn.tb-strike { text-decoration: line-through; }
.tb-btn.active    { background: #eef2ff; border-color: #818cf8; color: #4338ca; }

.tb-sep { width: 1px; height: 18px; background: #e2e8f0; margin: 0 4px; flex-shrink: 0; align-self: center; }

.tb-color-wrap { position: relative; display: inline-flex; }
.tb-color-inp {
  position: absolute; width: 28px; height: 28px;
  top: 0; left: 0; opacity: 0; cursor: pointer; border: none; padding: 0;
}
.tb-color-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 26px;
  padding: 0 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: none;
  line-height: 1;
  gap: 2px;
  color: #475569;
}
.tb-color-bar { width: 14px; height: 3px; display: block; border-radius: 2px; }

.editor-area {
  min-height: 100px;
  padding: 10px 14px;
  outline: none;
  font-size: 14px;
  line-height: 1.75;
  overflow-y: auto;
  background: #fff;
  color: #1e293b;
}
.editor-area-lg { min-height: 180px; }

.editor-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 4px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
}
.editor-footer button {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  color: #64748b;
  transition: all .12s;
  margin-left: 4px;
}
.editor-footer button:hover { background: #f1f5f9; border-color: #cbd5e1; }

.editor-source {
  display: none;
  width: 100%;
  min-height: 100px;
  border: none;
  outline: none;
  font-size: 12.5px;
  font-family: 'Fira Code', Consolas, monospace;
  padding: 10px 14px;
  resize: vertical;
  background: #0f172a;
  color: #94a3b8;
  line-height: 1.6;
}

/* ── 동적 서브테이블 ── */
.sub-table thead th {
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
  text-align: center;
  font-size: 13px;
}
.sub-table td { text-align: center; padding: 7px 6px; }
.sub-table td.td-content { text-align: left; }
.sub-table textarea {
  width: 100%;
  height: 44px;
  padding: 7px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  color: #1e293b;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}
.sub-table textarea:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.sub-table input[type=text] { text-align: center; }

.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 7px 18px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(79,70,229,.25);
  transition: all .15s;
}
.btn-add-row::before { content: '+'; font-size: 16px; font-weight: 300; line-height: 1; }
.btn-add-row:hover { background: #4338ca; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.3); }

.btn-del-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  background: #fff;
  color: #ef4444;
  border: 1.5px solid #fca5a5;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all .12s;
}
.btn-del-row:hover { background: #fef2f2; border-color: #ef4444; }

/* ── 파일올리기 ── */
.file-table th { text-align: center; width: 100px; color: #475569; font-weight: 600; font-size: 12.5px; }
.file-table td { padding: 7px 14px; }
.file-table tr:hover td { background: #fafbff; transition: background .12s; }

/* ── 하단 버튼 ── */
.btn-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid #f1f5f9;
}
.btn-ok {
  display: inline-flex;
  align-items: center;
  padding: 12px 48px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
  letter-spacing: -.2px;
  transition: all .18s;
}
.btn-ok:hover { background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,70,229,.38); }
.btn-cancel {
  display: inline-flex;
  align-items: center;
  padding: 12px 48px;
  background: #f8fafc;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -.2px;
  transition: all .15s;
}
.btn-cancel:hover { background: #f1f5f9; color: #1e293b; border-color: #cbd5e1; transform: translateY(-1px); }