/* 통합 포털 공통 스타일 (포털 홈 · 관리자 화면) */
@font-face {
  font-family: 'Pretendard Variable';
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/PretendardVariable.woff2') format('woff2-variations'), url('/assets/fonts/PretendardVariable.woff2') format('woff2');
}

:root {
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --ink: #0b0f19;
  --ink-2: #2b3140;
  --muted: #4a5161;
  --muted-2: #6a7181;
  --line: #e7e9ee;
  --line-2: #d3d7df;
  --bg: #f5f6f8;
  --card: #ffffff;
  --radius: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 15px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select { font: inherit; letter-spacing: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }

/* ---------- 상단 바 ---------- */
.topbar { background: rgba(255, 255, 255, 0.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); }
.topbar .wrap { min-height: 68px; padding-block: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }

/* 업무 화면 공통 상단: 포털 홈 버튼 + 메뉴 줄을 화면 위에 고정 */
.app-head { position: sticky; top: 0; z-index: 30; }
.app-head .topbar { position: static; background: rgba(255, 255, 255, 0.96); }
.app-top .wrap { max-width: none; min-height: 64px; padding: 12px 24px; flex-wrap: nowrap; }
.app-top .lead { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-top .vsep { width: 1px; height: 24px; background: var(--line); flex: none; }
.subbar { background: #fff; border-bottom: 1px solid var(--line); }
.subbar .wrap { padding-block: 10px; }
.subbar .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.subbar .tab { white-space: nowrap; }
@media (max-width: 639px) {
  .app-top .wrap { padding: 12px; gap: 8px; }
  .app-top .brand-sub, .app-top .user-name, .app-top .vsep { display: none; }
  .app-top .user-pill { padding: 0 4px; }
  .app-top .actions { flex-wrap: nowrap; gap: 6px; }
  .app-top .actions .btn { padding: 0 12px; }
  .app-top .lead { gap: 10px; }
}
.brand-badge { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: #fff; font-weight: 750; font-size: 13px; letter-spacing: 0; }
.brand-name { font-weight: 750; font-size: 16px; letter-spacing: -0.02em; }
.brand-sub { font-size: 13px; font-weight: 500; color: var(--muted-2); margin-left: 8px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.btn:focus-visible, .card:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1f2533; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: #fff; border-color: #e1e4ea; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); border-color: var(--line-2); }
.btn-danger { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.btn-lg { height: 48px; border-radius: 14px; font-size: 15px; font-weight: 650; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid #e1e4ea; background: #fff; color: var(--ink); cursor: pointer; }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.user-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 4px; border-radius: 999px; background: #f1f2f5; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }

/* ---------- 홈 ---------- */
main.wrap { flex: 1 1 auto; padding-top: clamp(28px, 6vw, 64px); padding-bottom: 40px; display: flex; flex-direction: column; gap: clamp(20px, 3vw, 32px); }
.hero { display: flex; flex-direction: column; gap: 14px; }
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); flex: none; }
.dot.ext { background: #d97706; }
.dot.gray { background: #8a90a0; }
.dot.green { background: #059669; }
h1.title { margin: 0; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.18; font-weight: 750; letter-spacing: -0.035em; }
p.lead { margin: 0; font-size: clamp(15px, 1.6vw, 17px); line-height: 1.6; color: var(--muted); }

.section-head { display: flex; align-items: baseline; gap: 8px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.section-head span { font-size: 13px; font-weight: 600; color: var(--muted-2); }

.editbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.editbar .msg { display: flex; align-items: center; gap: 14px; flex: 1 1 280px; }
.editbar .ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.editbar strong { display: block; font-size: 15px; }
.editbar small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.card-groups { display: flex; flex-direction: column; gap: clamp(22px, 3vw, 34px); }
.card-group { display: flex; flex-direction: column; gap: 12px; }
.card-group .section-head h2 { font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 25vw, 250px), 1fr)); gap: clamp(10px, 1.6vw, 16px); }
.slot { display: flex; border-radius: 22px; outline: 2px solid transparent; outline-offset: 3px; }
.slot.over { outline-color: var(--accent); }
.card { flex: 1 1 auto; display: flex; flex-direction: column; gap: 14px; min-height: clamp(170px, 17vw, 210px); padding: clamp(14px, 1.6vw, 20px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); text-align: left; cursor: pointer; color: var(--ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 18px 36px -18px rgba(16, 24, 40, .22); }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .ic { display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; border-radius: 24px; background: var(--cc-soft, var(--accent-soft)); color: var(--cc, var(--accent)); flex: none; overflow: hidden; }
.card .ic svg { width: 42px; height: 42px; }
.card .ic.img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; display: block; }
.card .row { align-items: flex-start; }
/* 카드 색: 카드 전체 칠하기 (글자색은 바탕 밝기에 맞춰 --cc-ink) */
.card.c-fill { background: var(--cc); border-color: transparent; color: var(--cc-ink); }
.card.c-fill:hover { border-color: transparent; box-shadow: 0 18px 36px -16px var(--cc); }
.card.c-fill .desc, .card.c-fill .tag { color: var(--cc-ink); opacity: .82; }
.card.c-fill .dot { background: var(--cc-ink); }
.card.c-fill .ic { background: rgba(255, 255, 255, .2); color: var(--cc-ink); }
.card.c-fill.c-light .ic { background: rgba(255, 255, 255, .55); }
.card.c-fill .ic.img { background: #fff; }
.card.c-fill .arrow { background: transparent; border-color: rgba(255, 255, 255, .45); color: var(--cc-ink); }
.card.c-fill.c-light .arrow { border-color: rgba(17, 24, 39, .25); }
.card.c-fill:hover .arrow { background: var(--cc-ink); border-color: var(--cc-ink); color: var(--cc); }
.card .meta { display: inline-flex; align-items: center; gap: 10px; }
.card .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted-2); white-space: nowrap; }
.card .arrow { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
.card:hover .arrow { background: var(--ink); border-color: var(--ink); color: #fff; transform: translateX(2px); }
.card .txt { margin-top: auto; display: flex; flex-direction: column; gap: 3px; }
.card .name { font-size: clamp(16px, 1.5vw, 18px); font-weight: 700; letter-spacing: -0.025em; }
.card .desc { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.card.denied { cursor: default; }
.card.denied .ic { background: #f1f2f5; color: #8a90a0; }
.card.denied:hover { transform: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); border-color: var(--line); }
.card.denied:hover .arrow { background: #fff; color: var(--ink); border-color: var(--line); transform: none; }
.card.editing { min-height: 120px; cursor: grab; border: 1.5px dashed #c5cbd6; background: #fafbfc; box-shadow: none; }
.card.editing:hover { transform: none; box-shadow: none; }
.card .num { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 9px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .moves { margin-top: auto; display: flex; gap: 8px; }
.empty { padding: 48px 16px; border: 1px dashed var(--line-2); border-radius: 20px; text-align: center; color: var(--muted); }

footer.foot { padding: 24px 16px 32px; text-align: center; font-size: 12.5px; color: var(--muted-2); }

/* ---------- 모달 ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(11, 15, 25, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog { position: relative; width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: clamp(24px, 4vw, 32px); background: #fff; border-radius: 24px; box-shadow: 0 32px 72px -20px rgba(11, 15, 25, .4); }
.dialog.wide { max-width: 560px; }
.dialog .close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 999px; }
.dialog h2 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.03em; }
.dialog p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.dialog .head { display: flex; flex-direction: column; gap: 14px; }
.dialog .note { font-size: 12.5px; color: var(--muted-2); text-align: center; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid #dadde3; background: #fff; font-size: 15px; transition: border-color .15s ease, box-shadow .15s ease; width: 100%; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
select.input { padding-right: 32px; }
.fields { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff1f2; color: #be123c; font-size: 13.5px; font-weight: 600; }
.info { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: 13.5px; font-weight: 600; }

/* ---------- 알림 ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 16px 40px -16px rgba(11, 15, 25, .5); }
.toast .ok { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; background: #22c55e; color: var(--ink); flex: none; }
.toast.err .ok { background: #f87171; }

/* ---------- 관리자 화면 ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(16px, 2.4vw, 24px); display: flex; flex-direction: column; gap: 16px; }
.panel h2 { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.panel .sub { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #eceef2; border-radius: 14px; align-self: flex-start; }
.tab { height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 650; cursor: pointer; }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; contain: inline-size paint; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted-2); background: #fafbfc; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 12px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.inactive td { color: #9aa0ad; }
.uname { font-weight: 700; }
.nowrap { white-space: nowrap; }
.small { font-size: 12.5px; color: var(--muted-2); }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; }
.perm { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.perm.admin { background: var(--ink); color: #fff; }
.perm.none { background: #f1f2f5; color: var(--muted-2); }
.check-group { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.check-group h3 { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check.strong { font-weight: 700; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.temp-pw { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; font-weight: 700; letter-spacing: .04em; padding: 12px 14px; border-radius: 12px; background: #f5f6f8; border: 1px solid var(--line); text-align: center; user-select: all; }
.search { max-width: 280px; height: 40px; }
.audit-scroll { max-height: 560px; overflow: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) {
  .card, .card .arrow, .btn { transition: none; }
  .card:hover { transform: none; }
  .card:hover .arrow { transform: none; }
}

/* 관리자 > AI 자동 조회 */
.ai-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; font-size: 14px; color: var(--ink-2); }
.ai-status .pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.ai-status .pill.on { background: #ecfdf5; color: #047857; }
.ai-status .pill.off { background: #f1f2f5; color: var(--muted); }
.ai-form { max-width: 640px; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 홈: 인사말 + 공지사항 최근 5건 */
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: end; }
@media (min-width: 960px) { .hero-row:has(.home-notice:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(400px, 500px); } }
.home-notice { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hn-head { display: flex; align-items: center; gap: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.hn-head h2 { margin: 0 auto 0 0; font-size: 15px; font-weight: 750; }
.hn-head h2 a { color: var(--ink); text-decoration: none; }
.hn-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.hn-link:hover { color: var(--accent); }
.hn-list { list-style: none; margin: 0; padding: 0; }
.hn-list li + li { border-top: 1px solid #f0f1f4; }
.hn-list a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 2px; color: var(--ink); text-decoration: none; font-size: 14px; }
.hn-list a:hover .tx { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.hn-d { color: var(--muted-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hn-t { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
.hn-t .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hn-a { color: var(--muted); font-size: 12.5px; max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hn-pin { flex: none; padding: 1px 6px; border-radius: 6px; background: #fef3f2; color: #b42318; font-size: 11px; font-weight: 750; }
.hn-new { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 750; }
.hn-empty { padding: 18px 2px; color: var(--muted); font-size: 13.5px; }

/* 회사 로고 (관리자 화면 > 회사 정보에서 올린 이미지가 배지 자리에 들어감) */
.brand-badge.has-logo { width: auto; min-width: 0; max-width: 180px; height: 36px; padding: 0; border-radius: 0; background: transparent; }
.brand-badge.has-logo img { display: block; height: 36px; width: auto; max-width: 180px; object-fit: contain; }
@media (max-width: 639px) { .brand-badge.has-logo, .brand-badge.has-logo img { max-width: 120px; height: 30px; } }

/* 관리자 > 회사 정보 */
.co-preview { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 14px; background: #fafbfc; }
.co-form { max-width: 720px; }
.co-color { display: flex; gap: 8px; }
.co-color input[type=color] { width: 48px; height: 48px; padding: 4px; border: 1px solid #dadde3; border-radius: 12px; background: #fff; cursor: pointer; flex: none; }
.co-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.co-logo-box { display: flex; align-items: center; justify-content: center; min-width: 180px; height: 64px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 14px 14px; }
.co-logo-box img { max-height: 44px; max-width: 260px; display: block; }
.co-logo-btns { display: flex; gap: 8px; }
.co-logo-btns label.btn { cursor: pointer; }
.label-like { font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* 관리자 > 포털 카드 */
.card-admin { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card-admin li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.card-admin li.off { background: #fafbfc; }
.card-admin li.off .ca-ic, .card-admin li.off .ca-txt { opacity: .5; }
.ca-ic.img { background: #fff; border: 1px solid var(--line); overflow: hidden; }
.ca-ic.img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ca-ic.c-fill { background: var(--cc); color: var(--cc-ink); }
.ca-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--cc-soft, var(--accent-soft)); color: var(--cc, var(--accent)); }
.ca-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ca-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.ca-desc { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: #f1f2f5; color: var(--muted); }
.ca-tag.on { background: #ecfdf5; color: #047857; }
.ca-tag.link { background: #fff7ed; color: #c2410c; }
.ca-tag.pub { background: #eff6ff; color: #1d4ed8; }
.ca-btns { display: flex; align-items: center; gap: 6px; }
.ca-btns .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.ca-btns .icon-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 639px) {
  .card { min-height: 150px; }
  /* 폭이 좁아 아이콘 아래에 표시(포털·바로가기 등)를 두고, 화살표는 숨김 (카드 전체를 누르면 열림) */
  .card .row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card .arrow { display: none; }
  .card .tag { font-size: 12px; white-space: normal; }
  .card .ic { width: 64px; height: 64px; border-radius: 19px; }
  .card .ic svg { width: 32px; height: 32px; }
  .card .ic.img img { padding: 7px; }
}
@media (max-width: 639px) { .card-admin li { grid-template-columns: 40px minmax(0, 1fr); } .ca-btns { grid-column: 1 / -1; justify-content: flex-end; } }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.icon-pick label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 11.5px; color: var(--muted); }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.icon-pick label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.cd-preview { display: flex; flex-direction: column; gap: 8px; margin-top: -6px; }
.cd-prev-wrap { display: flex; padding: 16px; border-radius: 18px; background: var(--bg, #f4f5f7); }
.cd-prev-wrap .card { max-width: 300px; cursor: default; pointer-events: none; }
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick label { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; cursor: pointer; border: 1px solid rgba(0, 0, 0, .08); }
.color-pick label.def { width: auto; padding: 0 12px; background: #fff; border-color: var(--line-2); font-size: 12.5px; font-weight: 650; color: var(--ink-2); gap: 6px; }
.color-pick label.def i { width: 14px; height: 14px; border-radius: 999px; background: var(--accent); }
.color-pick label.custom { width: auto; padding: 0 10px 0 6px; gap: 6px; background: #fff; border-color: var(--line-2); font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.color-pick label.custom input[type=color] { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 999px; background: none; cursor: pointer; }
.color-pick input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.color-pick label:has(input[type=radio]:checked) { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.color-pick label:has(input[type=radio]:focus-visible) { outline: 2.5px dashed var(--ink); outline-offset: 2px; }
.seg { display: inline-flex; width: max-content; max-width: 100%; padding: 4px; border-radius: 999px; background: #f1f2f5; gap: 2px; margin-top: 4px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); }
.icon-up { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.icon-pick label.mine img { width: 26px; height: 26px; object-fit: contain; }
.sec-admin { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fafbfc; }
.sec-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.sec-top > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14.5px; }
.sec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sec-list:empty { display: none; }
.sec-list li { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-size: 13.5px; font-weight: 650; }
.sec-list li em { font-style: normal; color: var(--muted-2); font-weight: 600; margin: 0 4px 0 6px; font-size: 12.5px; }
.sec-list .icon-btn { width: 28px; height: 28px; }
.card-admin li.grp { display: flex; padding: 14px 4px 2px; border: 0; background: none; font-size: 13px; font-weight: 750; color: var(--muted); gap: 8px; }
.card-admin li.grp:first-child { padding-top: 0; }
.card-actions { display: flex; justify-content: space-between; gap: 8px; }
.card-actions .btn-lg { margin-left: auto; }

/* ---------- 분기 인센티브 카드 (인센티브 화면 · 포털 홈 공용) ---------- */
.ic-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; min-width: 0; }
.ic-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ic-top b { font-size: 15px; font-weight: 800; }
.ic-state { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 750; white-space: nowrap; }
.ic-state.ok { background: #ecfdf3; color: #067647; }
.ic-state.warn { background: #fef0c7; color: #b45309; }
.ic-state.bad { background: #fee4e2; color: #b42318; }
.ic-state.none { background: #f2f4f7; color: var(--muted); }
.ic-pct { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ic-card.ok .ic-pct { color: #067647; } .ic-card.warn .ic-pct { color: #b45309; } .ic-card.bad .ic-pct { color: #b42318; }
.ic-bar { position: relative; height: 10px; border-radius: 99px; background: #eef0f3; margin: 4px 0 6px; }
.ic-bar .fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 99px; background: #98a2b3; }
.ic-bar.ok .fill { background: #12b76a; } .ic-bar.warn .fill { background: #f79009; } .ic-bar.bad .fill { background: #f04438; }
.ic-bar .tick { position: absolute; top: -2px; width: 2px; height: 14px; background: #fff; margin-left: -1px; text-decoration: none; }
.ic-bar .tick::before { content: ''; position: absolute; left: 0; top: 0; width: 2px; height: 14px; background: rgba(16, 24, 40, .28); }
.ic-bar .tick em { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.ic-bar .pace { position: absolute; top: -5px; width: 2.5px; height: 20px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.ic-tiers { margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted-2); }
.ic-tiers span { padding: 1px 6px; border-radius: 6px; background: #f2f4f7; color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.ic-tiers span.past { background: #d1fadf; color: #067647; }
.ic-tiers span.on { background: #067647; color: #fff; }
.ic-line { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
.ic-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ic-line.sub { font-size: 12.5px; color: var(--muted); }
/* 포털 홈 현황판 */
.ic-home { display: flex; flex-direction: column; gap: 12px; }
.ic-home-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.ic-home-head h2 { margin: 0; font-size: 16px; }
.ic-home-head .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.ic-home-head .meta b { color: var(--ink); }
.ic-home-head a { font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; }
.ic-home-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ic-home .ic-card { padding: 14px 16px; }
.ic-home .ic-pct { font-size: 26px; }
/* 인센티브 없는 카테고리 (작게) · 확인 필요 링크 */
.ic-others { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 14px; border-radius: 14px; background: #f7f8fa; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ic-others[hidden] { display: none; }
.ic-others .lbl { font-weight: 700; color: var(--muted-2); }
.ic-others b { color: var(--ink-2); font-weight: 700; }
.ic-others .un, .ic-others .un b { color: #b54708; }
.ic-pend { align-self: flex-start; font-size: 13px; color: #93370d; background: #fffaeb; border: 1px solid #fedf89; padding: 6px 12px; border-radius: 999px; text-decoration: none; }
.ic-date { margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: #f2f4f7; color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.ic-gap, .ic-at100 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; padding: 8px 10px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.ic-gap { background: #fef3f2; color: #b42318; }
.ic-gap span, .ic-at100 span { font-size: 12.5px; font-weight: 650; }
.ic-gap b, .ic-at100 b { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.ic-gap.done { background: #ecfdf3; color: #067647; }
.ic-at100 { background: #f0f5ff; color: #1d4ed8; }
.ic-at100 em { flex-basis: 100%; text-align: right; font-style: normal; font-size: 11.5px; color: #6172a8; margin-top: -2px; }
.ic-at100.none { background: #f7f8fa; color: var(--muted-2); }
.ic-others i { font-style: normal; margin-left: 4px; font-size: 11.5px; color: var(--muted-2); }
.ic-legend { font-size: 12px; color: var(--muted-2); }
@media (max-width: 1100px) { .ic-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .ic-home-grid { gap: 8px; }
  .ic-home .ic-card { padding: 12px; gap: 4px; border-radius: 16px; }
  .ic-home .ic-pct { font-size: 22px; }
  .ic-home .ic-top b { font-size: 14px; }
  .ic-home .ic-state { font-size: 10.5px; padding: 0 6px; }
  .ic-home .ic-line { font-size: 12px; }
  .ic-home .ic-line.sub { display: none; }
  .ic-home .ic-gap, .ic-home .ic-at100 { padding: 6px 8px; flex-direction: column; align-items: flex-start; gap: 0; }
  .ic-home .ic-gap span, .ic-home .ic-at100 span { font-size: 11px; }
  .ic-home .ic-gap b, .ic-home .ic-at100 b { font-size: 15px; }
  .ic-home .ic-at100 em { flex-basis: auto; text-align: left; margin: 0; font-size: 10.5px; }
  .ic-home .ic-date { margin-left: 0; display: inline-block; margin-top: 2px; }
}
