@charset "UTF-8";

/* ============================================================
   관리자 콘솔
   ============================================================ */
body.admin {
  background: #F4F2F2;
}

/* --- 상단 바 ------------------------------------------------ */
/*
 * 글을 내려도 상단 바는 화면 맨 위에 붙어 있습니다.
 * 높이는 화면 폭에 따라 달라지므로 --ad-top-h 에 실제 높이를 적어 두고
 * (adminTop.jsp 가 재서 넣습니다) 왼쪽 메뉴가 그만큼 아래에서 시작하게 합니다.
 */
.ad-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--c-line);
}
.ad-top__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 12px 24px;
}
/* 세션 시계부터가 오른쪽 묶음입니다. '세션' 글자는 빼고 남은 시간과 [연장] 만 둡니다 */
.ad-top__in > .sess { margin-left: auto; }
.ad-top__in > .sess .sess__label { display: none; }
.ad-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--c-ink);
}
.ad-brand:hover { text-decoration: none; }
.ad-brand img { height: 34px; width: auto; }
.ad-brand__tag {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--c-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.ad-top__util { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-btn-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--c-ink);
  font-size: 15px;
  font-weight: 700;
}
.ad-btn-line:hover { border-color: var(--c-brand); color: var(--c-brand); text-decoration: none; }
.ad-me { display: inline-flex; align-items: center; gap: 10px; padding: 0 6px 0 10px; }
.ad-me__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-line-soft);
  color: var(--c-brand-strong);
  font-size: 15px;
  font-weight: 700;
}
.ad-me__txt { font-size: 15px; line-height: 1.35; }
.ad-me__txt strong { display: block; }
.ad-me__txt span { color: var(--c-muted); font-size: 14px; }
.ad-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--c-dark);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.ad-logout:hover { background: var(--c-ink); color: #fff; text-decoration: none; }

/* --- 본체 --------------------------------------------------- */
.ad-body {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  min-height: calc(100vh - var(--ad-top-h, 69px));
}

.ad-side {
  flex: 1 1 240px;
  max-width: 280px;
  background: #2F2A2A;
  padding: 22px 14px 40px;
  /* 본문이 길어도 왼쪽 메뉴는 화면에 붙어 있습니다 (상단 바 바로 아래부터) */
  position: sticky;
  top: var(--ad-top-h, 69px);
  align-self: flex-start;
  height: calc(100vh - var(--ad-top-h, 69px));
  overflow-y: auto;
}
.ad-side__group {
  margin: 22px 12px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #A39999;
  letter-spacing: 0.04em;
}
.ad-side ul { display: flex; flex-direction: column; gap: 2px; }
.ad-side a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  color: #DDD6D6;
  font-size: 16px;
  font-weight: 500;
}
.ad-side a:hover { background: #3C3535; color: #fff; text-decoration: none; }
.ad-side a.is-on { background: var(--c-brand-strong); color: #fff; font-weight: 700; }
.ad-side a svg { flex: none; }
.ad-badge {
  margin-left: auto;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--c-brand);
  color: #fff;
  font-family: "Archivo", sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.ad-main { flex: 999 1 640px; min-width: 0; padding: 32px 32px 72px; }

/* --- 페이지 헤더 -------------------------------------------- */
.ad-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.ad-head__meta { font-family: "Archivo", sans-serif; font-size: 14px; color: var(--c-muted); }
.ad-head h1 { margin-top: 6px; font-size: 30px; font-weight: 900; letter-spacing: -0.035em; }
.ad-head__desc { margin-top: 8px; font-size: 16px; color: var(--c-muted); }

/* --- 카드 / 패널 -------------------------------------------- */
.ad-card {
  padding: 22px 24px;
  border: 1px solid var(--c-line-2);
  border-radius: 16px;
  background: #fff;
}
.ad-card__label { font-size: 15px; font-weight: 700; color: var(--c-muted); }
.ad-card__num {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ad-card__num strong {
  font-family: "Archivo", sans-serif;
  font-size: 38px;
  font-weight: 800;
}
.ad-card__num strong.is-alert { color: var(--c-brand-strong); }
.ad-card__link { display: inline-block; margin-top: 8px; font-size: 15px; font-weight: 700; }

.ad-stats {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.ad-panel {
  margin-top: 24px;
  border: 1px solid var(--c-line-2);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.ad-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-line-2);
}
.ad-panel__head h2 { font-size: 19px; font-weight: 700; }
.ad-panel__body { padding: 24px; }

/* --- 표 ----------------------------------------------------- */
.ad-tbl { width: 100%; min-width: 760px; }
.ad-tbl thead tr { background: var(--c-surface); }
.ad-tbl th, .ad-tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-line-soft);
  font-size: 15px;
  text-align: left;
  vertical-align: middle;
}
.ad-tbl thead th { font-weight: 700; color: var(--c-ink); white-space: nowrap; }
.ad-tbl td { color: var(--c-body); }
.ad-tbl .tc { text-align: center; }
.ad-tbl .subject a { color: var(--c-ink); font-weight: 500; }
.ad-tbl .subject a:hover { color: var(--c-brand); }
.ad-tbl tbody tr:hover { background: var(--c-surface-2); }
/* 표 안에서 줄을 묶어 주는 작은 제목 */
.ad-tbl__sub th {
  padding: 10px 16px;
  background: var(--c-surface-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--c-muted);
}
.ad-tbl__sub:hover { background: var(--c-surface-2); }

/* --- 상태 태그 ---------------------------------------------- */
.tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.tag--on { background: #E4F1E9; color: #1F6F43; }
.tag--wait { background: var(--c-tint); color: var(--c-brand-strong); }
.tag--off { background: #ECE8E8; color: #666666; }
.tag--stop { background: #F7E2E0; color: #B3261E; }
.tag--draft { background: #F3EEE3; color: #8A6500; }

/* --- 폼 / 도구 줄 ------------------------------------------- */
.ad-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.ad-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-chip {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--c-body);
  font-size: 15px;
  font-weight: 700;
}
.ad-chip:hover { border-color: var(--c-brand); color: var(--c-brand); text-decoration: none; }
.ad-chip.is-on { border-color: var(--c-brand-strong); background: var(--c-brand-strong); color: #fff; }

.ad-input, .ad-select, .ad-textarea {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 15px;
}

/* 고르는 칸 — 화살표를 직접 그려 테두리에서 조금 띄웁니다 */
.ad-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.ad-select--sm { padding-right: 34px; background-position: right 10px center; }
.ad-textarea { height: auto; padding: 12px 14px; line-height: 1.7; }
.ad-input--block { width: 100%; }
.ad-btn {
  display: inline-flex;
  /*
   * 좁은 칸에서 단추가 눌려 글자가 세로로 갈라지지 않게 합니다.
   * (표 안에서 [변경] 이 "변 / 경" 으로 쪼개지던 일)
   */
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.ad-btn--primary { background: var(--c-brand-strong); color: #fff; }
.ad-btn--primary:hover { background: var(--c-brand-deep); color: #fff; text-decoration: none; }
.ad-btn--ghost { border-color: var(--c-line); background: #fff; color: var(--c-body); }
.ad-btn--ghost:hover { border-color: var(--c-brand); color: var(--c-brand); text-decoration: none; }
.ad-btn--danger { border-color: #E6C9C6; background: #fff; color: #B3261E; }
.ad-btn--danger:hover { background: #FBEFEE; color: #B3261E; text-decoration: none; }
.ad-btn--sm { height: 36px; padding: 0 12px; font-size: 14px; }

/*
 * hidden 을 붙이면 무조건 감춥니다.
 * .ad-btn 처럼 display 를 직접 정한 규칙이 브라우저 기본 [hidden] 을 눌러 버려서,
 * JS 로 el.hidden = true 를 줘도 그대로 보이는 일이 생깁니다.
 */
.ad-btn[hidden],
.ad-input[hidden],
.ad-select[hidden] { display: none; }
.ad-btn--lg { height: 48px; padding: 0 22px; font-size: 16px; }

.ad-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.ad-field { display: flex; flex-direction: column; gap: 8px; }
.ad-field > label { font-size: 15px; font-weight: 700; }
.ad-field--grow { flex: 999 1 220px; min-width: 0; }

.ad-msg {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  background: #E4F1E9;
  color: #1F6F43;
  font-size: 15px;
  font-weight: 700;
}

.ad-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--c-muted);
  font-size: 16px;
}

/* --- 에디터 ------------------------------------------------- */
.editor-wrap {
  position: relative;
  margin-top: 10px;
  border: 1px solid #D9D2D2;
  border-radius: 12px;
  background: #fff;
}
.editor-toolbar {
  /* 본문이 길어도 도구줄은 화면 위에 붙어 있습니다 */
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--c-line);
  border-radius: 11px 11px 0 0;
  background: var(--c-surface-2);
  box-shadow: 0 6px 12px -8px rgba(74, 27, 27, 0.35);
}
.editor-toolbar button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #444444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.editor-toolbar button:hover { background: var(--c-line-soft); }
.editor-toolbar button.is-on { background: var(--c-brand-strong); color: #fff; }
.editor-toolbar button.is-wide { width: auto; height: 40px; padding: 0 12px; border: 1px solid var(--c-line); background: #fff; font-size: 14px; font-weight: 700; }
.editor-toolbar select {
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
}
.editor-sep {
  width: 1px;
  height: 24px;
  margin: 0 6px;
  background: var(--c-line);
}
.editor-spacer { margin-left: auto; }
.editor-body {
  min-height: 460px;
  padding: 28px 32px;
  font-size: 18px;
  line-height: 1.9;
  color: var(--c-ink);
  outline: none;
  overflow-y: auto;
}
.editor-body:focus { outline: none; }
.editor-body p { margin: 0 0 14px; }
.editor-body h1 { font-size: 30px; font-weight: 900; margin: 24px 0 12px; }
.editor-body h2 { font-size: 26px; font-weight: 800; margin: 22px 0 12px; }
.editor-body h3 { font-size: 21px; font-weight: 700; margin: 20px 0 10px; }
.editor-body ul { list-style: disc; padding-left: 24px; margin: 0 0 14px; }
.editor-body ol { list-style: decimal; padding-left: 24px; margin: 0 0 14px; }
.editor-body blockquote {
  margin: 0 0 14px;
  padding: 12px 18px;
  border-left: 4px solid var(--c-brand);
  background: var(--c-surface);
  color: var(--c-body);
}
.editor-body table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 16px; }
.editor-body table th, .editor-body table td {
  border: 1px solid var(--c-table-line);
  padding: 10px 12px;
  text-align: left;
}
.editor-body table th {
  background: var(--c-surface);
  font-weight: 700;
  text-align: center;   /* 제목 칸은 가운데 */
}
.editor-body img,
.editor-body video { max-width: 100%; height: auto; border-radius: 6px; }
.editor-body hr { border: 0; border-top: 1px solid var(--c-line); margin: 22px 0; }
.editor-source {
  display: none;
  width: 100%;
  min-height: 460px;
  padding: 20px 24px;
  border: 0;
  font-family: "Archivo", ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.8;
  resize: vertical;
}
.editor-wrap.is-source .editor-body { display: none; }
.editor-wrap.is-source .editor-source { display: block; }

/* --- 본문 보기(게시글 상세) --------------------------------- */
.post-content { font-size: 18px; line-height: 1.9; color: var(--c-body); }
.post-content p { margin: 0 0 16px; }
.post-content h1, .post-content h2, .post-content h3 {
  margin: 26px 0 12px;
  color: var(--c-ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.post-content h1 { font-size: 28px; }
.post-content h2 { font-size: 24px; }
.post-content h3 { font-size: 21px; }
.post-content ul { list-style: disc; padding-left: 24px; margin: 0 0 16px; }
.post-content ol { list-style: decimal; padding-left: 24px; margin: 0 0 16px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote {
  margin: 0 0 16px;
  padding: 14px 20px;
  border-left: 4px solid var(--c-brand);
  background: var(--c-surface);
}
.post-content table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 16px; }
.post-content table th, .post-content table td {
  border: 1px solid var(--c-table-line);
  padding: 12px 14px;
  text-align: left;
}
.post-content table th {
  background: var(--c-surface);
  font-weight: 700;
  text-align: center;   /* 제목 칸은 가운데 */
}
.post-content img,
.post-content video { max-width: 100%; height: auto; border-radius: 6px; }
.post-content hr { border: 0; border-top: 1px solid var(--c-line); margin: 24px 0; }

/* --- 회원가입 단계 ------------------------------------------ */
.steps-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.steps-bar li {
  flex: 1 1 180px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-md);
  background: #fff;
}
.steps-bar li.is-on { border-color: var(--c-brand-strong); background: var(--c-brand-strong); color: #fff; }
.steps-bar .no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-line-soft);
  color: var(--c-brand-strong);
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 15px;
}
.steps-bar li.is-on .no { background: rgba(255, 255, 255, 0.22); color: #fff; }
.steps-bar strong { font-size: 17px; }

.terms-box {
  max-height: 180px;
  overflow-y: auto;
  padding: 18px 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  font-size: 15px;
  line-height: 1.9;
  color: var(--c-body);
}

/* --- 반응형 ------------------------------------------------- */
@media (max-width: 1024px) {
  .ad-side { max-width: none; flex: 1 1 100%; padding-bottom: 20px; }
  .ad-side ul { flex-direction: row; flex-wrap: wrap; }
  .ad-side a { min-height: 42px; }
  .ad-badge { margin-left: 6px; }
  .ad-main { padding: 24px 20px 56px; }
}
@media (max-width: 768px) {
  .ad-top__in { padding: 12px 16px; }
  .ad-me { display: none; }
  .ad-head h1 { font-size: 26px; }
  .editor-body { padding: 20px; font-size: 17px; }

  /*
   * 고르개(select)는 가장 긴 보기만큼 넓어집니다.
   * 좁은 화면에서는 그 때문에 쪽 전체가 옆으로 밀렸습니다.
   */
  .ad-toolbar { align-items: stretch; }
  .ad-toolbar form { flex-wrap: wrap; width: 100%; }
  .ad-toolbar .ad-select,
  .ad-toolbar .ad-input,
  .ad-toolbar .input,
  .ad-toolbar .select { flex: 1 1 140px; min-width: 0; max-width: 100%; }

  /* 위쪽 띠 : 첫 줄은 로고와 세션, 둘째 줄은 단추들 */
  .ad-top__in { gap: 10px 12px; }
  .ad-brand { gap: 8px; min-width: 0; }
  .ad-brand img { height: 28px; }
  .ad-brand__tag { padding: 3px 8px; font-size: 12px; }
  .ad-top__util { width: 100%; justify-content: flex-end; gap: 6px; }
  .ad-btn-line { height: 40px; padding: 0 12px; font-size: 14px; }
}

@media (max-width: 440px) {
  .ad-top__in { padding: 12px; }
  .ad-brand img { height: 24px; }
  .ad-brand__tag { padding: 2px 7px; font-size: 11.5px; }
}

/* --- 구별 지표 관리 ------------------------------------------ */
.ad-panel--pad { padding: 24px; }
.ad-panel__title { font-size: 19px; font-weight: 700; }
.ad-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.ad-check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.ad-check input { width: 18px; height: 18px; accent-color: var(--c-brand); }
/* 구 x 월 입력표 — 칸이 12개라 촘촘하게 */
.ad-tbl--grid th,
.ad-tbl--grid td { padding: 8px 5px; }
.ad-tbl--grid thead th { text-align: center; font-size: 14px; }
.ad-input--cell {
  width: 100%;
  height: 38px;
  padding: 0 7px;
  text-align: right;
  font-size: 14px;
}
@media (max-width: 1100px) {
  .ad-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .ad-form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 입력칸 아래에 붙이는 설명 한 줄 */
.ad-help {
  margin: 0;
  color: #777070;
  font-size: 13px;
  line-height: 1.5;
}
a.ad-help { text-decoration: underline; word-break: break-all; }

/* 글 등록 화면 안에 한 단 들어간 설정 상자 */
.ad-panel--inset { padding: 20px; background: #FAF7F7; }
.ad-select--sm { height: 36px; padding: 0 10px; font-size: 14px; }
.ad-pager__per .ad-select { min-width: 96px; }
/* 목록에서 순서를 바꾸는 위·아래 단추 */
.ad-move { display: inline-flex; gap: 2px; margin-right: 6px; }
.ad-move .ad-btn { min-width: 30px; padding: 0 8px; font-size: 12px; line-height: 30px; }

/* 글 등록 화면에서 바꿀 수 없는 값 */
.ad-fixed {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sm);
  background: #FAF7F7;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-ink);
}

/* 목록의 순서 바꾸기 단추 */
.ad-move { display: inline-flex; gap: 4px; }
.ad-move form { display: inline; }
.ad-move__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--c-line-2);
  border-radius: 7px;
  background: #fff;
  color: var(--c-body);
  cursor: pointer;
}
.ad-move__btn:hover:not(:disabled) { border-color: var(--c-brand); color: var(--c-brand); background: #FFF7F7; }
.ad-move__btn:disabled { opacity: 0.35; cursor: default; }

/* 목록의 관리 단추 묶음 */
.ad-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.ad-actions form { display: inline; }

/* 목록에서 줄바꿈하면 안 되는 칸 */
.ad-nowrap { white-space: nowrap; }

/*
 * 표 안에서 값 하나를 고쳐 쓰는 칸 (회원 관리의 [권한]).
 * 평소에는 글자로만 두고, [변경] 을 눌러야 고르개가 나옵니다.
 * 줄마다 고르개를 띄워 두면 칸이 비좁고 실수로 건드리기도 쉽습니다.
 */
/*
 * 고르개가 나왔을 때의 폭(128 + 8 + 52)을 보기 상태에서도 미리 잡아 둡니다.
 * 안 그러면 [변경] 을 누르는 순간 칸이 넓어지며 표가 출렁입니다.
 */
.cell-edit { display: flex; align-items: center; gap: 8px; min-width: 196px; }
.cell-edit__now { font-size: 14px; font-weight: 700; }

/* 처리 단추들을 한 줄에 늘어놓습니다 (줄이 갈라지면 어느 줄 것인지 헷갈립니다) */
.ad-act-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.ad-act-row form { display: flex; align-items: center; gap: 6px; }

/*
 * 표 안에 들어가는 권한 고르개.
 * 폭을 못박아 둡니다 — 자동으로 두면 좁은 칸에서 눌려,
 * 가장 긴 이름(운영행정요원)이 오른쪽 화살표와 겹쳐 그려집니다.
 * 128px = 글자 78 + 왼쪽 여백 12 + 화살표 자리 32 + 테두리 2 + 여유
 */
.cell-edit .ad-select,
.ad-act-row .ad-select {
  flex: none;
  width: 128px;
  height: 36px;
  padding: 0 32px 0 12px;
  background-position: right 10px center;
  font-size: 14px;
}

/* 아이콘만 있는 작은 단추 (수정 · 삭제) */
.ad-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--c-line-2);
  border-radius: 8px;
  background: #fff;
  color: var(--c-body);
  cursor: pointer;
}
.ad-icon-btn:hover { border-color: var(--c-brand); background: #FFF7F7; color: var(--c-brand); text-decoration: none; }
.ad-icon-btn--danger:hover { border-color: #C9372C; background: #FDF1F0; color: #C9372C; }

/* 도구 줄 — 한 페이지 건수 · 검색 */
.ad-searchbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-searchbar .ad-input { min-width: 180px; }

/* 첨부파일 */
.ad-files { margin-top: 20px; }
.ad-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px dashed var(--c-line-2);
  border-radius: var(--r-sm);
  background: #FAF7F7;
}
.ad-files__name { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.ad-files__x {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--c-line-2);
  border-radius: 6px;
  background: #fff;
  color: #B3261E;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.ad-files__x:hover { border-color: #C9372C; background: #FDF1F0; }
.ad-files__list { margin: 10px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.ad-files__list > li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sm);
  background: #fff;
}
.ad-files__ext {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--c-tint);
  color: var(--c-brand-strong);
  font-size: 12px;
  font-weight: 800;
}
.ad-files__del { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 14px; color: #B3261E; }

/* 표 크기 고르개 */
.table-picker {
  position: absolute;
  z-index: 30;
  flex: 0 0 auto;        /* 도구줄의 flex 영향을 받지 않게 */
  width: max-content;
  padding: 14px;
  border: 1px solid var(--c-line-2);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(74, 27, 27, 0.16);
}
.table-picker__label { font-size: 13px; font-weight: 700; color: var(--c-ink); margin-bottom: 8px; }
.table-picker__grid { display: grid; gap: 2px; }
.table-picker__grid span {
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid var(--c-line-2);
  background: #fff;
  cursor: pointer;
}
.table-picker__grid span.is-on { border-color: var(--c-brand); background: var(--c-tint); }
.table-picker__more {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--c-line-2);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;   /* 세로로 쪼개져 보이던 것을 막습니다 */
  color: var(--c-body);
  cursor: pointer;
}
.table-picker__more:hover { border-color: var(--c-brand); color: var(--c-brand); }

/* 파일을 올리는 동안 */
.editor-wrap.is-busy { opacity: 0.6; pointer-events: none; }

/*
 * hidden 속성이 클래스의 display 에 밀리지 않도록 합니다.
 * (.ad-field 등은 display:flex 라서 [hidden] 기본 규칙보다 우선합니다)
 */
.ad-field[hidden],
.ad-form-row[hidden],
.ad-panel[hidden],
.ad-files[hidden],
.ad-move[hidden],
.ad-actions[hidden] { display: none; }

/* 본문 표 — 칸 너비를 고정해야 끌어서 맞춘 크기가 유지됩니다 */
.editor-body table,
.post-content table { table-layout: fixed; width: 100%; }
.editor-body table th,
.editor-body table td { position: relative; overflow-wrap: anywhere; }
/* 경계에 가까이 가면 커서가 바뀌어 끌 수 있다는 것을 알려 줍니다 */
.editor-body table th::after,
.editor-body table td::after {
  content: "";
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
}

/* 표 고르개는 도구줄 안에 떠 있으므로, 도구줄 단추 규칙을 덮어씁니다 */
.editor-toolbar .table-picker { padding: 14px; }
.editor-toolbar .table-picker__more {
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 8px 10px;
  border: 1px solid var(--c-line-2);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
}
.editor-toolbar .table-picker__more:hover { background: #FFF7F7; }

/* 지울 예정으로 표시한 첨부파일 */
.ad-files__list > li.is-removing { opacity: 0.55; }
.ad-files__list > li.is-removing .ad-files__name { text-decoration: line-through; }
.ad-files__x--undo {
  width: auto;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-brand-strong);
}
.ad-files__list > li .tag { flex: 0 0 auto; }

/* --- 목록 : 표 머리글 고정 + 본문만 스크롤 ------------------- */
.ad-panel > .tbl-wrap {
  max-height: calc(100vh - 330px);
  min-height: 220px;
  overflow: auto;
}
.ad-tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--c-surface);
  box-shadow: inset 0 -1px 0 var(--c-line);
}

/* --- 좁은 화면 : 왼쪽 메뉴를 서랍으로 ------------------------ */
.ad-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--c-ink);
  cursor: pointer;
}
.ad-menu-btn:hover { background: var(--c-surface); }
.ad-side__head { display: none; }
.ad-side__logo img { height: 30px; width: auto; }
.ad-side__close {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid #6B6060;
  border-radius: 8px;
  background: #3A3232;
  color: #EDE4E4;
  cursor: pointer;
}
.ad-side__close:hover { background: #4A4040; border-color: #857878; color: #fff; }
.ad-side__dim { display: none; }

@media (max-width: 1024px) {
  .ad-menu-btn { display: inline-flex; }
  .ad-side__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }
  .ad-side__close { display: flex; }

  .ad-side {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    bottom: 0;
    /* 서랍일 때는 화면 높이를 꽉 채웁니다 (넘치면 안에서 굴립니다) */
    height: 100vh;
    width: 280px;
    max-width: 86vw;
    padding: 22px 14px 40px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .ad-side ul { flex-direction: column; }
  body.is-ad-side-open .ad-side { transform: none; }

  .ad-side__dim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(26, 16, 16, 0.45);
  }
  .ad-side__dim[hidden] { display: none; }

  body.is-ad-side-open { overflow: hidden; }
  .ad-panel > .tbl-wrap { max-height: none; }

  /*
   * 넓은 표(회원 관리 등)가 좁은 화면에서 쪽 전체를 옆으로 밀어내던 것을 막습니다.
   * overflow:auto 만으로는 표가 바깥 쪽 폭까지 늘려 놓아, 그리기 범위를 상자 안으로 묶어 둡니다.
   * 표는 상자 안에서 그대로 좌우로 밀어 볼 수 있습니다.
   */
  .tbl-wrap { contain: paint; }
}

/* 알림 목록 */
.ad-noti { position: relative; }
.ad-noti__pop {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  padding: 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: 0 14px 30px rgba(74, 27, 27, 0.16);
}
.ad-noti__pop[hidden] { display: none; }
.ad-noti__head { font-size: 14px; color: var(--c-muted); }
.ad-noti__head strong { color: var(--c-brand-strong); }
.ad-noti__pop ul { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.ad-noti__pop a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-ink);
}
.ad-noti__pop a:hover { background: var(--c-surface); color: var(--c-brand-strong); text-decoration: none; }

/* --- 목록 화면 : 한 화면에 담고 표만 스크롤 ------------------- */
.ad-body.is-fit { height: calc(100vh - 69px); min-height: 0; flex-wrap: nowrap; overflow: hidden; }
.ad-body.is-fit .ad-side { height: 100%; overflow-y: auto; }   /* 가둔 화면은 이미 꽉 찹니다 */

.ad-main--fit {
  /* 화면 안에 가두는 기준 상자 — 안쪽의 숨은 라벨이 밖으로 빠져나가지 않게 합니다 */
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 24px;
  overflow: hidden;
}
.ad-main--fit > .ad-panel--list { flex: 1 1 auto; min-height: 260px; }

.ad-panel--list {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ad-panel--list > .tbl-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

/* 페이지 막대 */
.ad-pager {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--c-line-2);
  background: #fff;
}
.ad-pager__per {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--c-muted);
}
.ad-pager__per label { font-weight: 500; }
.ad-pager__range {
  flex: 1 1 auto;
  text-align: center;
  font-size: 14px;
  color: var(--c-muted);
}
.ad-pager__range .num { font-family: "Archivo", sans-serif; font-weight: 600; color: var(--c-ink); }
.ad-pager__nav { display: flex; align-items: center; gap: 4px; }
.ad-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--c-ink);
  font-family: "Archivo", sans-serif;
  font-size: 14px;
  font-weight: 600;
}
.ad-pager__btn:hover { background: var(--c-surface); color: var(--c-brand); text-decoration: none; }
.ad-pager__btn.is-on {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: #fff;
}
.ad-pager__btn.is-on:hover { background: var(--c-brand); color: #fff; }
.ad-pager__btn.is-off { color: var(--c-line); cursor: default; }

@media (max-width: 1024px) {
  .ad-body.is-fit { height: auto; flex-wrap: wrap; overflow: visible; }
  .ad-main--fit { height: auto; overflow: visible; }
  .ad-main--fit > .ad-panel--list { min-height: 0; }
  .ad-panel--list > .tbl-wrap { max-height: 70vh; }
  /* 페이지 막대 : 쪽 고르기를 위로, 그 아래 왼쪽에 페이지당 · 오른쪽에 범위 */
  .ad-pager { gap: 10px 12px; }
  .ad-pager__nav { order: 1; width: 100%; justify-content: center; }
  .ad-pager__per { order: 2; }
  .ad-pager__range { order: 3; flex: 0 0 auto; margin-left: auto; text-align: right; }
}

/* 처리를 기다리는 줄 — 알림에서 타고 들어왔을 때 바로 눈에 띄게 */
.ad-tbl tbody tr.is-todo { background: #FFF9F2; }
.ad-tbl tbody tr.is-todo:hover { background: #FFF3E6; }
.ad-tbl tbody tr.is-todo > td:first-child { box-shadow: inset 3px 0 0 var(--c-brand); }

/* 처리 대기 칩 — 알림에서 타고 들어오는 묶음 */
.ad-chip--todo { border-color: var(--c-bar-soft); color: var(--c-brand-strong); font-weight: 700; }

/* 제목 칸 — 제목은 왼쪽, 딸린 링크는 같은 줄 오른쪽 */
.ad-subject {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ad-subject__main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;   /* 제목 줄은 한 줄로 */
}
.ad-subject__side {
  flex: none;
  margin-left: auto;
  font-size: 14px;
  color: var(--c-muted);
  white-space: nowrap;
}
.ad-subject__side:hover { color: var(--c-brand); }
.ad-subject__side--url {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 본문 사진 크기 조정 */
.editor-body img.is-sel,
.editor-body video.is-sel { outline: 2px solid var(--c-brand); outline-offset: 2px; }

.img-frame {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}
.img-frame[hidden] { display: none; }
.img-frame__bar {
  position: absolute;
  left: 6px;
  top: 6px;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 16px rgba(74, 27, 27, 0.18);
  pointer-events: auto;
}
.img-frame__bar button {
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--c-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.img-frame__bar button:hover { background: var(--c-surface); color: var(--c-brand-strong); }
.img-frame__grip {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: var(--c-brand);
  box-shadow: 0 2px 6px rgba(74, 27, 27, 0.3);
  cursor: nwse-resize;
  pointer-events: auto;
}

/* 갤러리 — 올려 둔 사진과 대표 사진 고르기 */
.ad-files__thumb {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--c-surface);
}
.ad-files__cover {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-muted);
  cursor: pointer;
}
.ad-files__cover input:checked + * ,
.ad-files__cover:has(input:checked) { color: var(--c-brand-strong); }

/* 표 — 고른 칸과 칸 도구줄 */
.editor-body th.is-pick,
.editor-body td.is-pick { box-shadow: inset 0 0 0 2px var(--c-brand); }

.cell-bar {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 20px rgba(74, 27, 27, 0.18);
}
.cell-bar[hidden] { display: none; }
.cell-bar button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--c-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cell-bar button svg { width: 19px; height: 19px; }
.cell-bar button:hover { background: var(--c-surface); color: var(--c-brand-strong); }
/* 묶음 이름 — 어떤 단추들인지 한 마디로 적어 둡니다 */
.cell-bar__grp {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--c-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-dim);
  white-space: nowrap;
}
.cell-bar__grp:first-child { margin-left: 0; padding-left: 0; border-left: 0; }

/* 칸 색 · 테두리 · 세로 맞춤을 펼치는 쪽지 */
.cell-pop {
  position: absolute;
  z-index: 7;
  width: 216px;
  padding: 12px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(74, 27, 27, 0.2);
}
.cell-pop[hidden] { display: none; }
.cell-pop__label {
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c-muted);
}
.cell-pop__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.cell-pop__chip {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  cursor: pointer;
}
.cell-pop__chip:hover { outline: 2px solid var(--c-brand); outline-offset: 1px; }
.cell-pop__wide {
  flex: 1 1 60px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--c-line);
  border-radius: 7px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: var(--c-ink);
  cursor: pointer;
}
.cell-pop > .cell-pop__wide { width: 100%; margin-top: 6px; }
.cell-pop__wide:hover { border-color: var(--c-brand); color: var(--c-brand-strong); }

/* 오른쪽 단추를 눌렀을 때 나오는 차림표 */
.cell-menu {
  position: absolute;
  z-index: 8;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(74, 27, 27, 0.22);
}
.cell-menu[hidden] { display: none; }
.cell-menu button {
  display: block;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--c-ink);
  cursor: pointer;
}
.cell-menu button:hover { background: var(--c-surface); color: var(--c-brand-strong); }
.cell-menu__line {
  display: block;
  height: 1px;
  margin: 5px 6px;
  background: var(--c-line);
}

/* 편집기 아래쪽 모서리 — 테두리를 깎지 않으므로 직접 둥글립니다 */
.editor-body,
.editor-source { border-radius: 0 0 11px 11px; }

/* 글 쓰기 판 — 안쪽 도구줄이 화면 위에 붙을 수 있게 넘침을 자르지 않습니다 */
.ad-panel--form { overflow: visible; }

/* 배너 — 올려 둔 팝업 그림 */
.banner-thumb {
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--c-line-2);
  border-radius: 10px;
  background: var(--c-surface-2);
}
.banner-thumb img {
  max-width: 260px;
  max-height: 180px;
  border-radius: 6px;
  background: #fff;
}

/* 목록에서 차례 바꾸기 — 위 · 아래 화살표 */
.ad-order { display: inline-flex; gap: 2px; align-items: center; justify-content: center; }
.ad-order form { display: inline; }
.ad-icon-btn--sm { width: 28px; height: 28px; }

/* --- 신청서 미리보기 ---------------------------------------- */
.apv-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.apv-list { display: flex; flex-direction: column; gap: 8px; }
.apv-list__item {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.apv-list__item:hover { border-color: var(--c-brand-pale); }
.apv-list__item.is-on { border-color: var(--c-brand); background: var(--c-tint); }
.apv-list__item input { margin-top: 4px; accent-color: var(--c-brand); }
.apv-list__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.apv-list__name { font-size: 15px; font-weight: 700; color: var(--c-ink); }
.apv-list__desc { font-size: 13px; line-height: 1.6; color: var(--c-muted); }
.apv-list__fields { font-size: 12px; line-height: 1.6; color: var(--c-dim); }

.apv-pane { min-width: 0; }
.apv[hidden] { display: none; }
.apv__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--c-muted);
}
.apv__box {
  margin-top: 10px;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(74, 27, 27, 0.10);
  overflow: hidden;
}
.apv__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-line-2);
  background: var(--c-surface-2);
  font-size: 16px;
}
.apv__x { color: var(--c-muted); font-size: 18px; }
.apv__body { padding: 18px; }
.apv__desc { font-size: 13px; line-height: 1.7; color: var(--c-muted); }
.apv__grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.apv__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.apv__field.is-wide { grid-column: 1 / -1; }
.apv__label { font-size: 13px; font-weight: 700; color: var(--c-ink); }
.apv__input {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #A79B9B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apv__input--area { min-height: 56px; white-space: normal; }
.apv__row { display: flex; align-items: center; gap: 8px; }
.apv__row .apv__input { flex: 1 1 auto; }
.apv__btn {
  flex: none;
  padding: 9px 14px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-body);
  white-space: nowrap;
}
.apv__btn--on { border-color: var(--c-brand); background: var(--c-brand); color: #fff; }
.apv__note { font-size: 12px; color: var(--c-brand); }
.apv__submit {
  display: block;
  margin-top: 16px;
  padding: 11px;
  border-radius: var(--r-pill);
  background: var(--c-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/* 주최 · 주관처럼 줄을 더해 가며 적는 칸 */
.ad-rows { display: flex; flex-direction: column; gap: 8px; }
.ad-rows__row { display: flex; align-items: center; gap: 8px; }
.ad-rows__row .ad-input { flex: 1 1 auto; }
.ad-rows + .ad-btn { align-self: flex-start; width: auto; }

/* 교육 · 행사 목록의 홈 노출 칸 */
.ad-home { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; }
.ad-home__when { font-size: 12px; color: var(--c-muted); }
.apv-wrap { max-width: 1000px; }

@media (max-width: 1200px) {
  .apv-wrap { grid-template-columns: 1fr; }
}
.ad-icon-btn--on { border-color: var(--c-brand); color: var(--c-brand); background: var(--c-tint); }

/* 목록의 연결 주소 칸 */
.ad-url {
  display: block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--c-muted);
}
.ad-url:hover { color: var(--c-brand); }

/* 구별 지표 — 월별 수치 머리줄의 엑셀 단추 */
.rg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.rg-head__tools { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* 저장 단추를 오른쪽에 모읍니다 */
.ad-actions--end { display: flex; justify-content: flex-end; }


/* --- 권한 설정 ---------------------------------------------- */
.perm {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* 왼쪽 — 등급 고르기 */
.perm__side {
  position: sticky;
  top: calc(var(--ad-top-h, 69px) + 16px);
  padding: 16px;
  border: 1px solid var(--c-line-2);
  border-radius: 14px;
  background: #fff;
}
.perm__side-head {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-muted);
}
.perm-roles { display: flex; flex-direction: column; gap: 2px; }
.perm-roles__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--c-ink);
  font-size: 15px;
}
.perm-roles__item:hover { background: var(--c-surface-2); text-decoration: none; }
.perm-roles__item.is-on { background: var(--c-brand-strong); color: #fff; font-weight: 700; }
.perm-roles__name { flex: 999 1 auto; min-width: 0; }
.perm-roles__cnt { flex: none; font-size: 13px; color: var(--c-dim); }
.perm-roles__item.is-on .perm-roles__cnt { color: var(--c-on-deep-dim); }
.perm-roles__tag {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--c-tint);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-brand-strong);
}
.perm-roles__item.is-on .perm-roles__tag { background: rgba(255, 255, 255, 0.22); color: #fff; }
.perm__side-note {
  margin-top: 14px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-dim);
}

/* 오른쪽 — 고른 등급의 권한 */
.perm__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid var(--c-line-2);
  border-radius: 14px;
  background: #fff;
}
.perm__head h2 { font-size: 21px; font-weight: 800; color: var(--c-ink); }
.perm__head p { margin-top: 4px; font-size: 14px; color: var(--c-muted); }
.perm__head-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.perm__count { margin-right: 6px; font-size: 14px; color: var(--c-muted); }
.perm__count strong { font-size: 17px; color: var(--c-brand-strong); }
.perm__lock {
  margin-top: 12px;
  padding: 13px 18px;
  border-radius: 10px;
  background: var(--c-tint);
  font-size: 14px;
  color: var(--c-brand-deep);
}

.perm__group { margin-top: 24px; }
.perm__group:first-of-type { margin-top: 16px; }
.perm__group > .perm__group-name,
.perm__group > .perm__group-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}
.perm__group-name {
  margin: 0 10px 10px 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--c-ink);
}
.perm__group-tools { margin-bottom: 10px; }

.perm-card {
  margin-bottom: 10px;
  border: 1px solid var(--c-line-2);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.perm-card.is-off { background: var(--c-surface-2); }
.perm-card.is-na { opacity: 0.55; }
.perm-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-line-soft);
  background: var(--c-surface-2);
}
.perm-card.is-off .perm-card__head { background: transparent; }
.perm-card__title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.perm-card__title strong { font-size: 16px; color: var(--c-ink); }
.perm-card__code { font-family: "Archivo", sans-serif; font-size: 12.5px; color: var(--c-dim); }
.perm-card__tools { display: flex; align-items: center; gap: 6px; }
.perm-card__mini {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--c-body);
  cursor: pointer;
}
.perm-card__mini:hover { border-color: var(--c-brand); color: var(--c-brand-strong); }
.perm-card__na { font-size: 13px; color: var(--c-dim); }
.perm-card__num { min-width: 42px; text-align: right; font-size: 13px; color: var(--c-muted); }

.perm-card__body {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 10px;
  padding: 12px 16px 14px;
}
.perm-act {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.perm-act:hover { background: var(--c-surface-2); }
.perm-act.is-locked { cursor: default; opacity: 0.6; }
.perm-act.is-locked:hover { background: transparent; }
.perm-act__kind {
  flex: none;
  min-width: 38px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: #fff;
}
.perm-act__kind--VIEW { background: #5A7CA8; }
.perm-act__kind--CREATE { background: #2F7D55; }
.perm-act__kind--UPDATE { background: #B07000; }
.perm-act__kind--DELETE { background: #B3261E; }
.perm-act__kind--DOWNLOAD { background: #6B5BA8; }
.perm-act__name {
  min-width: 0;
  font-size: 14px;
  color: var(--c-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .perm-card__body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .perm { grid-template-columns: minmax(0, 1fr); }
  .perm__side { position: static; }
  .perm-roles { flex-direction: row; flex-wrap: wrap; }
  .perm-roles__item { background: var(--c-surface-2); }
}
@media (max-width: 768px) {
  .perm-card__body { grid-template-columns: minmax(0, 1fr); }
}
