/* =========================================================
   하늘휴 상조 관리 시스템 - 글로벌 스타일
   ========================================================= */
:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
  --muted-2: #94a3b8;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --indigo: #6366f1;
  --purple: #9333ea;
  --amber: #f59e0b;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 6px 24px -8px rgba(15,23,42,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", "맑은 고딕", Pretendard, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.boot { padding: 40px; text-align: center; color: var(--muted-2); }

/* 토스트 */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--dark); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700; z-index: 9999; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }

/* ===== 인증 화면 ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#0f172a, #1e293b 60%, #1e3a8a); padding: 16px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; padding: 36px;
  border-radius: 22px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.auth-card.wide { max-width: 540px; }
.auth-title { text-align: center; font-size: 22px; font-weight: 900; margin: 0 0 6px; }
.auth-sub { text-align: center; color: var(--muted-2); font-size: 12px; margin-bottom: 26px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.auth-logo i { background: var(--brand-soft); color: var(--brand);
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 800; color: #334155;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; font-size: 13px; background: #f8fafc;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: none; padding: 11px 18px;
  border-radius: 12px; font-weight: 800; cursor: pointer; font-size: 13px;
  transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost { background: #f1f5f9; color: #334155; }
.btn-ghost:hover { background: #e2e8f0; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-dark { background: var(--dark); }
.btn-dark:hover { background: var(--dark-2); }
.btn-sm { padding: 6px 10px; font-size: 11px; border-radius: 9px; }
.btn-amber { background: var(--amber); color: var(--dark); }
.btn-amber:hover { background: #d97706; color: #fff; }
.btn-emerald { background: #059669; }
.btn-emerald:hover { background: #047857; }
.btn-yellow { background: #facc15; color: var(--dark); }
.btn-yellow:hover { background: #eab308; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.text-link { color: var(--brand); font-weight: 800; cursor: pointer; background: none; border: none; padding: 0; font-size: inherit; }
.text-link:hover { text-decoration: underline; }

.muted { color: var(--muted-2); font-size: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; }

/* ===== 대시보드 레이아웃 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--dark); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar .brand { padding: 18px 20px; border-bottom: 1px solid #1f2937;
  display: flex; align-items: center; gap: 10px; background: #020617; }
.sidebar .brand i { background: var(--brand); padding: 6px; border-radius: 8px; }
.sidebar .brand b { font-size: 14px; font-weight: 900; }
.sidebar nav { padding: 14px; flex: 1; overflow-y: auto; }
.sidebar nav h6 { color: #94a3b8; font-size: 10px; font-weight: 900;
  letter-spacing: .07em; text-transform: uppercase; margin: 14px 8px 6px; }
.sidebar nav h6:first-child { margin-top: 0; }
.sidebar .nav-item { padding: 9px 12px; border-radius: 10px; font-size: 12px;
  font-weight: 800; color: #cbd5e1; cursor: pointer; display: flex; align-items: center;
  gap: 8px; transition: background .15s; }
.sidebar .nav-item:hover { background: var(--dark-2); color: #fff; }
.sidebar .nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 10px 20px -10px rgba(37,99,235,.4); }
.sidebar .nav-item.featured { background: #0b1224; color: #60a5fa; border: 1px solid #1f2937; }
.sidebar .nav-item.featured:hover { background: var(--brand); color: #fff; }
.sidebar .me { padding: 14px; background: #020617; border-top: 1px solid #1f2937; }
.sidebar .me-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sidebar .me-row .avatar { background: var(--brand); width: 36px; height: 36px; border-radius: 999px;
  display: grid; place-items: center; font-weight: 900; font-size: 12px; }
.sidebar .me-row .info { font-size: 11px; line-height: 1.4; overflow: hidden; }
.sidebar .me-row .info b { display: block; color: #f1f5f9; font-size: 12px; }
.sidebar .me-row .info span { color: #94a3b8; }
.sidebar .me .logout { width: 100%; padding: 7px; background: transparent; border: 1px solid #1f2937;
  color: #94a3b8; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.sidebar .me .logout:hover { background: var(--dark-2); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; gap: 14px; }
.topbar h1 { margin: 0; font-size: 17px; font-weight: 900; }
.topbar .who { font-size: 12px; color: var(--muted); font-weight: 600; }
.topbar .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { display: none; background: var(--dark); color: #fff; border: none;
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 18px;
  align-items: center; justify-content: center; flex-shrink: 0; }
.menu-toggle:hover { background: var(--dark-2); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 40; backdrop-filter: blur(2px); }
.sidebar-backdrop.show { display: block; }
.content { flex: 1; overflow-y: auto; padding: 28px; }

/* ===== 카드 / 테이블 ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.section-title { font-size: 13px; font-weight: 900; color: var(--brand); text-transform: uppercase;
  letter-spacing: .04em; margin: 0 0 14px; padding-bottom: 6px; border-bottom: 2px solid var(--brand);
  display: flex; align-items: center; gap: 8px; }
.section-title .num { background: var(--brand); color: #fff; width: 22px; height: 22px;
  border-radius: 999px; display: grid; place-items: center; font-size: 11px; }
.dash-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 24px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; }
.stat .icon.blue { background: #eff6ff; color: var(--brand); }
.stat .icon.indigo { background: #eef2ff; color: var(--indigo); }
.stat .icon.purple { background: #faf5ff; color: var(--purple); }
.stat b { font-size: 22px; font-weight: 900; display: block; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 700; }

.quick-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px;
  background: var(--dark); padding: 22px; border-radius: var(--radius); margin-bottom: 22px; }
.quick-grid > h3 { grid-column: 1/-1; margin: 0 0 4px; color: #60a5fa; font-size: 12px;
  text-transform: uppercase; letter-spacing: .07em; }
.quick-card { background: var(--dark-2); border: 1px solid var(--dark-3); padding: 16px;
  border-radius: 12px; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.quick-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.quick-card.primary { background: var(--brand); border-color: transparent; }
.quick-card.primary:hover { background: var(--brand-dark); }
.quick-card small { color: #94a3b8; font-size: 11px; }
.quick-card.primary small { color: #dbeafe; }
.quick-card strong { display: block; margin-top: 6px; color: #fff; font-size: 13px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; padding: 12px 18px; background: #f8fafc; color: var(--muted);
  font-weight: 800; text-transform: uppercase; font-size: 11px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 18px; border-bottom: 1px solid #f1f5f9; }
.tbl tr:hover td { background: #f8fafc; }
.tbl .right { text-align: right; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 800; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-gray  { background: #f1f5f9; color: #334155; }

.empty { padding: 50px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* ===== 상품 카탈로그 ===== */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.product-card:hover { box-shadow: var(--shadow); }
.product-card img { width: 100%; height: 160px; object-fit: cover; background: #e2e8f0; }
.product-card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.product-card h4 { margin: 4px 0; font-size: 14px; font-weight: 900; }
.product-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.product-card .foot { display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid #f1f5f9; padding-top: 12px; }
.product-card .price { font-weight: 900; color: var(--brand); font-size: 14px; }

/* ===== 신청서 폼 ===== */
.form-shell { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  max-width: 1100px; margin: 0 auto; box-shadow: var(--shadow-sm); }
.form-head { background: var(--dark); color: #fff; padding: 16px 24px; display: flex;
  align-items: center; justify-content: space-between; }
.form-head .left { display: flex; align-items: center; gap: 12px; }
.form-head .badge { background: rgba(37,99,235,.2); color: #93c5fd; }
.form-head .iconbtn { background: var(--dark-2); border: 1px solid var(--dark-3); color: #cbd5e1;
  padding: 6px 10px; border-radius: 9px; font-size: 11px; font-weight: 700; cursor: pointer; }
.form-head .iconbtn:hover { background: var(--dark-3); color: #fff; }
.form-body { padding: 28px; }
.form-section { margin-bottom: 28px; }
.brand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  background: #f1f5f9; border-radius: 16px; border: 1px solid var(--line); padding: 20px; }
.brand-grid h3 { grid-column: 1/-1; margin: 0 0 4px; font-size: 13px; }
.brand-choice { display: flex; align-items: center; gap: 10px; padding: 14px;
  border-radius: 12px; border: 2px solid var(--line); background: #fff;
  cursor: pointer; transition: all .15s; }
.brand-choice:hover { background: #f8fafc; }
.brand-choice.active.haneulhyu { background: #eff6ff; border-color: var(--brand); color: var(--brand); font-weight: 900; }
.brand-choice.active.dangsin   { background: #faf5ff; border-color: var(--purple); color: var(--purple); font-weight: 900; }
.brand-choice.active.custom    { background: #fefce8; border-color: var(--amber); color: #92400e; font-weight: 900; }
.brand-choice span { display: block; }
.brand-choice small { display: block; color: var(--muted-2); font-size: 10px; font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-9 { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-full { grid-column: 1 / -1; }

.box { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 16px; }
.box.tint-blue { background: #eff6ff; border-color: #bfdbfe; }
.box.tint-slate { background: #f8fafc; border-color: var(--line); }
/* 유족 동적 카드 */
.family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px;
  align-items: start; /* 카드 높이가 컨텐츠에 맞춰 자율 (다인 카드와 1명 카드 혼재 시 빈공간 X) */ }
.family-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s, transform .12s; }
.family-card .family-head { display: flex; align-items: center; gap: 6px; }
.family-card .family-grip { color: var(--muted-2); cursor: grab; user-select: none; font-size: 13px;
  padding: 0 2px; letter-spacing: -2px; }
.family-card .family-grip:active { cursor: grabbing; }
.family-card .family-head b { font-size: 12px; color: var(--text); font-weight: 900; }
.family-card .family-count { font-size: 10px; font-weight: 800; color: var(--brand);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; margin-left: auto; margin-right: 0; }
.family-card .family-del { background: none; border: none; color: var(--muted-2); font-size: 16px;
  cursor: pointer; padding: 0 6px; line-height: 1; border-radius: 6px; }
.family-card .family-del:hover { color: var(--danger); background: #fef2f2; }
.family-card textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px;
  font-size: 12px; background: #f8fafc; line-height: 1.5; overflow: hidden; min-height: 56px; }
.family-card.dragging { opacity: 0.4; transform: scale(0.97); }
.family-card.drop-target { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }

/* Person 행 (이름/삭제만 — 연락처·계좌는 개별부고 모달에서) */
.person-list { display: flex; flex-direction: column; gap: 5px; }
.person-row { display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: center; }
.person-row input { padding: 6px 10px; font-size: 12px; border: 1px solid var(--line);
  border-radius: 7px; background: #f8fafc; min-width: 0; text-align: center; }
.person-row input:focus { outline: none; border-color: var(--brand); background: #fff; }
.person-row .person-del { background: none; border: none; color: var(--muted-2); font-size: 14px;
  cursor: pointer; padding: 0 4px; border-radius: 5px; line-height: 1; }
.person-row .person-del:hover { color: var(--danger); background: #fef2f2; }
.person-add-btn { background: var(--brand-soft); border: 1px dashed var(--brand); color: var(--brand);
  font-size: 11px; font-weight: 800; padding: 6px; border-radius: 7px; cursor: pointer; }
.person-add-btn:hover { background: var(--brand); color: #fff; }

/* 장례식장 자동완성 */
.funeral-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-top: 2px;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,.18); max-height: 220px; overflow-y: auto; }
.funeral-suggest-item { padding: 8px 12px; font-size: 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.funeral-suggest-item:hover { background: var(--brand-soft); }
.funeral-suggest-item:last-child { border-bottom: none; }

/* 개별부고 모달 - 연락처 인라인 입력 */
.obit-phone-input { width: 130px; padding: 5px 8px; font-size: 12px; font-family: ui-monospace, monospace;
  border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.obit-phone-input:focus { outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.family-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
.family-chip { background: #fff; border: 1px solid var(--line); color: var(--text);
  font-size: 11px; font-weight: 800; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  transition: all .15s; }
.family-chip:hover:not(:disabled) { background: var(--brand); color: #fff; border-color: var(--brand); }
.family-chip:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.family-chip.family-custom { background: var(--amber); color: var(--dark); border-color: var(--amber); }
.family-chip.family-custom:hover { background: #d97706; color: #fff; }

.helper-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.helper-card h4 { margin: 0 0 10px; font-size: 12px; font-weight: 900; }
.helper-grid { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.time-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.time-range span { color: var(--muted-2); font-weight: 700; font-size: 11px; }

.dt-row { display: flex; gap: 4px; }
.dt-row input[type="date"] { flex: 1; }
.dt-row select { padding: 6px 4px; }

.checkbox-bar { background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 800; }
.checkbox-bar input { width: 16px; height: 16px; }

.required { color: var(--danger); }

.signature-zone { background: var(--dark); color: #fff; padding: 24px; border-radius: 18px;
  display: flex; flex-direction: column; gap: 20px; }
.signature-zone ul { font-size: 11px; color: #cbd5e1; line-height: 1.7; padding-left: 18px; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-top: 14px; border-top: 1px solid var(--dark-2); }
.sig-card { background: #1c2435; border: 1px solid var(--dark-3); padding: 14px; border-radius: 12px; }
.sig-card label { font-size: 11px; color: #cbd5e1; font-weight: 800; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sig-card label .clear { background: none; border: none; color: #f87171; font-size: 10px; font-weight: 800; cursor: pointer; }
.sig-card input { width: 100%; padding: 6px 8px; background: var(--dark-2); border: 1px solid var(--dark-3);
  color: #fff; border-radius: 6px; font-size: 11px; margin-bottom: 8px; }
.sig-card input[readonly] { background: rgba(30,41,59,.5); color: #cbd5e1; cursor: not-allowed; }
.sig-canvas-wrap { background: #fff; border-radius: 8px; overflow: hidden; position: relative; }
.sig-canvas-wrap canvas { display: block; width: 100%; height: 120px; cursor: crosshair; background: #fff; }
.sig-canvas-wrap .preview { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: rgba(255,255,255,.95); }
.sig-canvas-wrap .preview img { max-height: 100px; }
.sig-canvas-wrap .preview button { background: none; border: none; color: var(--brand); font-weight: 800; font-size: 10px; cursor: pointer; margin-top: 4px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ===== 모달 ===== */
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.8);
  backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 22px; max-width: 540px; width: 100%; padding: 24px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.modal.wide { max-width: 900px; }
.modal.xlwide { max-width: 1080px; padding: 0; display: flex; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.modal-head button.close { background: none; border: none; color: var(--muted-2); font-size: 18px; cursor: pointer; }
.modal-head button.close:hover { color: var(--text); }

.preview-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: 12px; color: #334155; white-space: pre-wrap; font-family: ui-monospace, monospace; line-height: 1.6; max-height: 320px; overflow-y: auto; }

.obit-panel { width: 50%; padding: 28px; overflow-y: auto; max-height: 90vh; }
.obit-panel.left { background: #f8fafc; border-right: 1px solid var(--line); }
.obit-panel.right { background: var(--dark); color: #cbd5e1; }
.obit-panel.right pre { background: #020617; border: 1px solid var(--dark-2); padding: 14px;
  border-radius: 12px; font-size: 11px; line-height: 1.6; white-space: pre-wrap; max-height: 360px; overflow-y: auto; }

.switch { width: 44px; height: 24px; background: #cbd5e1; border-radius: 999px; padding: 3px;
  cursor: pointer; border: none; transition: background .15s; }
.switch.on { background: var(--brand); }
.switch .knob { width: 18px; height: 18px; background: #fff; border-radius: 999px;
  transition: transform .15s; }
.switch.on .knob { transform: translateX(20px); }

/* ===== A4 인쇄 ===== */
.pdf-back { position: fixed; inset: 0; background: rgba(15,23,42,.95); overflow-y: auto;
  padding: 24px; display: flex; flex-direction: column; align-items: center; z-index: 200; }
.pdf-toolbar { width: 100%; max-width: 880px; background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.1); padding: 12px 20px; border-radius: 12px;
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.pdf-toolbar button { font-size: 12px; font-weight: 800; padding: 8px 14px; border-radius: 8px;
  border: none; cursor: pointer; }
#printable-pdf-area { width: 100%; max-width: 800px; background: #fff; color: #000; padding: 30px;
  border: 2px solid #cbd5e1; font-size: 11px; line-height: 1.4; }
.pdf-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.pdf-table th, .pdf-table td { border: 1px solid #000; padding: 5px 6px; font-size: 11px; text-align: left; }
.pdf-table th { background: #f1f5f9 !important; font-weight: 800; text-align: center; width: 14%; }
.pdf-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
  border-bottom: 2px solid #0f172a; padding-bottom: 8px; }
.pdf-title h1 { margin: 0; font-size: 20px; font-weight: 900; }
.pdf-title small { display: block; font-size: 10px; letter-spacing: .15em; color: #475569; font-weight: 800; }
.pdf-section-title { font-size: 11px; font-weight: 900; margin: 0 0 4px; color: #0f172a; }
.pdf-notice { border: 1px solid #000; padding: 10px; font-size: 9.5px; line-height: 1.6; margin-bottom: 12px; background: #f8fafc; }
.pdf-sign { display: flex; justify-content: space-between; align-items: center; padding: 16px;
  border: 1px solid #000; background: #f8fafc; }
.pdf-sign .slot { position: relative; min-width: 140px; border-bottom: 1px solid #000; padding-bottom: 4px; }
.pdf-sign .slot img { position: absolute; left: 24px; bottom: -8px; max-height: 36px; mix-blend-mode: multiply; pointer-events: none; }
.pdf-sign .slot .stamp { position: absolute; right: 0; bottom: 2px; color: #94a3b8; font-size: 10px; font-weight: 800; }
.pdf-sign .row-item { display: flex; align-items: center; gap: 18px; }
.pdf-sign b { font-size: 12px; }

@media print {
  body * { visibility: hidden !important; }
  #printable-pdf-area, #printable-pdf-area * { visibility: visible !important; }
  #printable-pdf-area { position: absolute; left: 0; top: 0; padding: 0 !important; border: 0 !important; }
}

/* ===== 게스트 (스마트폰 모드) ===== */
.phone-wrap { min-height: 100vh; background: var(--dark); display: flex; align-items: center; justify-content: center; padding: 16px; }
.phone { width: 100%; max-width: 380px; background: #fff; border: 10px solid #020617;
  border-radius: 40px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); }
.phone .status { height: 22px; background: #020617; color: #fff; font-size: 10px;
  display: flex; justify-content: space-between; align-items: center; padding: 0 24px; }
.phone .body { background: #f8fafc; padding: 28px; min-height: 540px; display: flex; flex-direction: column; justify-content: space-between; }
.phone .tag { display: inline-block; background: #fef3c7; color: #92400e; padding: 3px 12px;
  border-radius: 999px; font-size: 10px; font-weight: 800; }

/* 시스템 설정 탭 */
.settings-tabs { display: flex; gap: 8px; flex-wrap: wrap; background: #fff;
  padding: 12px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 18px;
  box-shadow: var(--shadow-sm); }
.settings-tab { padding: 10px 18px; border: 1px solid var(--line); background: #f8fafc;
  border-radius: 10px; font-weight: 800; font-size: 12px; cursor: pointer; color: var(--muted);
  transition: all .15s; }
.settings-tab:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.settings-tab.active { background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 4px 12px -2px rgba(37,99,235,.3); }
.settings-content { min-height: 200px; }

/* ===== 옵션 설정 ===== */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.opt-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.opt-card h4 { font-size: 14px; font-weight: 900; margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.opt-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.opt-item { display: flex; justify-content: space-between; align-items: center;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
.opt-item input { flex: 1; padding: 6px 8px; border: 1px solid #93c5fd; border-radius: 8px; font-size: 12px; }
.opt-item .iconbtn { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--muted); }
.opt-item .iconbtn:hover { background: #f1f5f9; }
.opt-item .iconbtn.del:hover { color: var(--danger); background: #fef2f2; }
.opt-item .iconbtn.edit:hover { color: var(--warn); background: #fff7ed; }

/* ===== 상조 상품 안내 (표시 화면) ===== */
/* 회사 선택 버튼 */
.sjp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.sjp-tab { display: inline-flex; align-items: center; gap: 7px; padding: 11px 18px; border-radius: 11px;
  border: 1.5px solid var(--line); background: #fff; color: #475569; font-size: 14px; font-weight: 800;
  cursor: pointer; transition: all .15s; }
.sjp-tab:hover { border-color: var(--sjp-c, #94a3b8); color: #0f172a; }
.sjp-tab.active { background: var(--sjp-c, #2563eb); border-color: var(--sjp-c, #2563eb); color: #fff;
  box-shadow: 0 6px 16px -6px var(--sjp-c, #2563eb); }
.sjp-tab-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: rgba(15,23,42,.08); color: inherit; font-size: 11px; font-weight: 800; }
.sjp-tab.active .sjp-tab-n { background: rgba(255,255,255,.25); }
.sjp-section { margin-bottom: 28px; }
.sjp-section-title { font-size: 15px; font-weight: 900; color: #0f172a; margin: 0 0 14px;
  display: flex; align-items: center; gap: 9px; }
.sjp-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.sjp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sjp-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.sjp-card:hover { box-shadow: 0 10px 24px -10px rgba(15,23,42,.25); transform: translateY(-2px); }
/* 상품 안내 이미지 (표시 카드 / 모달 미리보기) */
.sjp-card-img { margin: 0 0 12px; }
.sjp-card-img img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); }
.sjp-img-prev { margin-bottom: 8px; }
.sjp-img-prev img { max-width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; }
/* 회사 선택 버튼 (큰 카드) → 클릭 시 전체화면 */
.sjp-co-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.sjp-co-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 22px 22px 18px;
  border-radius: 16px; border: 1.5px solid var(--line); border-left: 5px solid var(--sjp-c, #2563eb);
  background: #fff; cursor: pointer; text-align: left; transition: box-shadow .15s, transform .15s; }
.sjp-co-btn:hover:not(:disabled) { box-shadow: 0 14px 30px -14px var(--sjp-c, #2563eb); transform: translateY(-2px); }
.sjp-co-btn:disabled { opacity: .5; cursor: default; }
.sjp-co-label { font-size: 18px; font-weight: 900; color: #0f172a; }
.sjp-co-n { font-size: 12px; color: #64748b; }
.sjp-co-go { font-size: 12px; font-weight: 800; color: var(--sjp-c, #2563eb); margin-top: 6px; }
/* 전체화면 상품 표시 (이미지 중심) */
.sjp-fs { position: fixed; inset: 0; z-index: 1000; background: #0f172a; display: flex; flex-direction: column; }
.sjp-fs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 20px; background: var(--sjp-c, #1e293b); color: #fff; flex-shrink: 0; }
.sjp-fs-title { font-size: 16px; font-weight: 900; }
.sjp-fs-close { background: rgba(255,255,255,.18); border: 0; color: #fff; padding: 9px 16px;
  border-radius: 9px; font-size: 14px; font-weight: 800; cursor: pointer; }
.sjp-fs-close:hover { background: rgba(255,255,255,.3); }
.sjp-fs-body { flex: 1; overflow-y: auto; padding: 20px; width: 100%; max-width: 880px; margin: 0 auto; }
.sjp-fs-item { background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.sjp-fs-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sjp-fs-name { font-size: 19px; font-weight: 900; color: #0f172a; }
.sjp-fs-price { font-size: 19px; font-weight: 900; color: var(--sjp-c, #2563eb); white-space: nowrap; }
.sjp-fs-img img { width: 100%; height: auto; display: block; border-radius: 10px; }
.sjp-fs-tagline { color: #475569; font-size: 14px; margin: 12px 0 4px; }
/* 전체화면 상단 상품 선택 버튼 */
.sjp-pd-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.sjp-pd-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 18px; min-width: 148px;
  border: 2px solid rgba(255,255,255,.22); border-radius: 12px; background: rgba(255,255,255,.07); color: #e2e8f0; cursor: pointer; transition: .15s; }
.sjp-pd-btn:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.4); }
.sjp-pd-btn.on { background: #fff; border-color: var(--sjp-c, #2563eb); color: #0f172a; box-shadow: 0 12px 26px -12px var(--sjp-c, #2563eb); }
.sjp-pd-name { font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.sjp-pd-price { font-size: 13px; font-weight: 800; opacity: .85; }
.sjp-pd-btn.on .sjp-pd-price { color: var(--sjp-c, #2563eb); opacity: 1; }
/* 상세 하단 — 상조 사용 신청서 작성 CTA */
.sjp-fs-cta { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); text-align: center; }
.sjp-fs-cta-h { font-size: 13px; color: #64748b; margin-bottom: 10px; }
.sjp-apply-btn { display: inline-flex; align-items: center; gap: 8px; padding: 15px 30px; border: 0; border-radius: 12px;
  background: var(--sjp-c, #2563eb); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 14px 28px -12px var(--sjp-c, #2563eb); transition: .15s; }
.sjp-apply-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
@media (max-width: 720px) {
  .sjp-apply-btn { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }
}
/* 구성/내용 표 + 안내사항 (카드/전체화면 공용) */
.sjp-spec { width: 100%; border-collapse: collapse; margin: 4px 0 2px; }
.sjp-spec th, .sjp-spec td { border: 1px solid var(--line); padding: 9px 12px; font-size: 13px; vertical-align: top; text-align: left; }
.sjp-spec th { width: 32%; background: #f8fafc; color: #334155; font-weight: 800; }
.sjp-spec td { color: #475569; }
/* 아이콘·구분 그룹 표 (참고 페이지 스타일) */
.sjp-spec2 { width: 100%; border-collapse: collapse; margin: 6px 0 2px; }
.sjp-spec2 thead th { background: #eef2ff; color: #1e293b; font-weight: 900; font-size: 13px; padding: 10px; border: 1px solid #c7d2fe; text-align: center; letter-spacing: 3px; }
.sjp-spec2 td { border: 1px solid var(--line); padding: 10px 12px; font-size: 13px; vertical-align: middle; }
.sjp-spec2 .sjp-cat { width: 14%; background: #f8fafc; font-weight: 800; color: #334155; text-align: center; white-space: nowrap; }
.sjp-spec2 .sjp-ico { width: 56px; text-align: center; }
.sjp-ico-b { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #eef2ff; font-size: 21px; line-height: 1; }
.sjp-ico-img { display: inline-block; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #fff; vertical-align: middle; box-shadow: 0 0 0 1px #eef2ff inset; }
.sjp-spec2 .sjp-comp { width: 27%; font-weight: 700; color: #0f172a; text-align: center; }
.sjp-spec2 .sjp-desc { color: #475569; line-height: 1.5; }
@media (max-width: 720px) {
  .sjp-spec2 .sjp-cat { width: auto; font-size: 12px; padding: 8px 6px; }
  .sjp-spec2 td { padding: 8px; font-size: 12px; }
  .sjp-ico-b { width: 32px; height: 32px; font-size: 17px; }
  .sjp-ico-img { width: 34px; height: 34px; }
}
/* 모달 구성/내용 행 편집기 */
.sjp-rowed-head { display: grid; grid-template-columns: 1fr 0.95fr 1.2fr 1.85fr 26px; gap: 6px; font-size: 11px; font-weight: 700; color: #94a3b8; padding: 0 2px 4px; }
.sjp-rowed { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; padding: 2px; }
.sjp-row { display: grid; grid-template-columns: 1fr 0.95fr 1.2fr 1.85fr 26px; gap: 6px; align-items: center; }
.sjp-row input { padding: 7px 8px; font-size: 12px; border: 1px solid var(--line); border-radius: 7px; width: 100%; }
.sjp-row .sjp-r-icon { text-align: center; }
.sjp-r-iconwrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sjp-r-prev { flex: none; width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 50%; background: #eef2ff; font-size: 15px; line-height: 1; overflow: hidden; }
.sjp-r-prev img { width: 100%; height: 100%; object-fit: cover; }
.sjp-r-iconwrap .sjp-r-icon { flex: 1; min-width: 0; }
.sjp-r-del { width: 26px; height: 26px; border: 0; border-radius: 6px; background: #fee2e2; color: #b91c1c; cursor: pointer; font-weight: 800; line-height: 1; }
.sjp-emoji-pick { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; margin: 2px 0; }
.sjp-emoji { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.sjp-emoji:hover { background: #eef2ff; border-color: #c7d2fe; }
.sjp-icobtn { height: 26px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid #c7d2fe; border-radius: 6px; background: #f5f7ff; cursor: pointer; font-size: 11px; font-weight: 700; color: #4338ca; line-height: 1; vertical-align: middle; }
.sjp-icobtn img { width: 16px; height: 16px; }
.sjp-icobtn:hover { background: #eef2ff; }
/* 등록 아이콘(라이브러리) */
.sjp-reg-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 5px 0; }
.sjp-reg-label { font-size: 11px; font-weight: 800; color: #64748b; }
.sjp-reg { display: inline-flex; flex-wrap: wrap; gap: 11px; padding: 6px 3px 3px; }
.sjp-regico { position: relative; width: 34px; height: 34px; border: 1px solid #c7d2fe; border-radius: 7px; background: #fff; cursor: pointer; display: inline-grid; place-items: center; }
.sjp-regico img { width: 24px; height: 24px; object-fit: contain; }
.sjp-regico:hover { background: #eef2ff; border-color: #818cf8; }
/* ✕(등록 해제) — 항상 표시(터치/태블릿에서도 삭제 가능) */
.sjp-regico-del { position: absolute; top: -9px; right: -9px; z-index: 3; width: 21px; height: 21px; border: 1.5px solid #fff; border-radius: 50%; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; padding: 0; cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.sjp-regico-del:hover, .sjp-regico-del:active { background: #dc2626; }
.sjp-notes-wrap { margin-top: 14px; }
.sjp-notes-h { font-size: 12px; font-weight: 800; color: #334155; margin-bottom: 6px; }
.sjp-notes { list-style: none; margin: 0; padding: 0; }
.sjp-notes li { position: relative; padding-left: 22px; margin-bottom: 5px; font-size: 12px; color: #475569; line-height: 1.5; }
.sjp-notes li::before { content: '✔'; position: absolute; left: 0; top: 0; color: #2563eb; font-weight: 900; font-size: 11px; }
@media (max-width: 720px) {
  .sjp-co-grid { grid-template-columns: 1fr; }
  .sjp-fs-name, .sjp-fs-price { font-size: 16px; }
  .sjp-fs-body { padding: 14px; }
  .sjp-pd-btn { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 10px 12px; }
  .sjp-pd-name { font-size: 13px; }
}
.sjp-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.sjp-name { font-size: 16px; font-weight: 900; color: #0f172a; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sjp-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 10.5px;
  font-weight: 900; background: #fef3c7; color: #92400e; }
.sjp-price { font-size: 17px; font-weight: 900; color: var(--brand); white-space: nowrap; }
.sjp-tagline { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }
.sjp-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.sjp-items li { font-size: 12.5px; color: #334155; line-height: 1.5; padding-left: 20px; position: relative; }
.sjp-items li::before { content: '✓'; position: absolute; left: 0; top: 0; color: #16a34a; font-weight: 900; }

/* ===== 헤더 / 정보 라벨 ===== */
.search-bar { position: relative; flex: 1; max-width: 320px; }
.search-bar input { width: 100%; padding: 8px 14px 8px 36px; background: #f8fafc;
  border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.search-bar .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }

.dark-header { background: var(--dark-2); color: #fff; padding: 22px; border-radius: 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.dark-header h3 { margin: 0; color: #60a5fa; font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.dark-header p { margin: 4px 0 0; font-size: 11px; color: #cbd5e1; }

/* 반응형 */
@media (max-width: 1024px) {
  .grid-4, .grid-9 { grid-template-columns: repeat(2, 1fr); }
  .opt-grid { grid-template-columns: 1fr; }
  .sjp-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cards { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .modal.xlwide { flex-direction: column; }
  .obit-panel { width: 100%; }

  /* 사이드바 오버레이 모드 */
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 8px 0 24px -8px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar .who { display: none; }

  /* 넓은 표는 가로 스크롤(컬럼 유지) */
  .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .modal.wide, .modal.xlwide { max-width: 100%; }
  .helper-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4, .grid-9 { grid-template-columns: 1fr; }
  .brand-grid, .product-grid { grid-template-columns: 1fr; }
  .sjp-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .sig-grid { grid-template-columns: 1fr; }
  .family-grid { grid-template-columns: 1fr 1fr; }
  .form-body { padding: 18px; }
  .content { padding: 14px; }

  /* 표 밀도 ↓ + 셀/버튼 축소 */
  .tbl { font-size: 11px; }
  .tbl th, .tbl td { padding: 8px 10px; }
  .tbl .btn-sm, .tbl .btn { padding: 5px 8px; font-size: 11px; }

  /* 헤더/타이틀 */
  .topbar { height: auto; min-height: 56px; padding: 10px 12px; }
  .topbar h1 { font-size: 15px; }
  .dark-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dark-header .btn { width: 100%; }

  /* 모달 — 작은 화면에 맞춤 */
  .modal-back { padding: 10px; align-items: flex-start; }
  .modal { padding: 18px; border-radius: 16px; max-height: 94vh; overflow-y: auto; }
  .modal-head h3 { font-size: 14px; }

  /* 카드/검색바 */
  .card { padding: 14px; }
  .search-bar { width: 100%; }
}

/* 작은 휴대폰 */
@media (max-width: 420px) {
  .family-grid { grid-template-columns: 1fr; }
  .content { padding: 10px; }
  .tbl th, .tbl td { padding: 7px 8px; }
}

/* ───── 화환 상품 이미지 업로더 ───── */
.img-uploader { border: 1.5px dashed #cbd5e1; border-radius: 12px; padding: 12px; background: #f8fafc; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }
.img-empty { grid-column: 1 / -1; padding: 24px 12px; text-align: center; color: #64748b; font-size: 13px;
  background: #fff; border: 1px dashed #e2e8f0; border-radius: 10px; line-height: 1.6; }
.img-thumb { position: relative; aspect-ratio: 1/1; background: #fff; border: 2px solid #e2e8f0;
  border-radius: 10px; overflow: hidden; }
.img-thumb.is-main { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .badge-main { position: absolute; top: 6px; left: 6px; background: #f59e0b; color: #fff;
  font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.img-thumb .img-actions { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.img-thumb .btn-mini { background: rgba(15,23,42,.85); color: #fff; border: none;
  width: 26px; height: 26px; border-radius: 6px; font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: transform .12s; }
.img-thumb .btn-mini:hover { transform: scale(1.1); }
.img-thumb .btn-mini.star { background: rgba(245,158,11,.95); }
.img-thumb .btn-mini.del  { background: rgba(220,38,38,.92); }
.img-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-toolbar label.btn { display: inline-flex; align-items: center; gap: 4px; }

/* ───── 신청서 작성: 전체폭 모드 (사이드바를 오버레이로, ☰로 열기) ───── */
.layout.form-fullscreen .sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transform: translateX(-100%);
  transition: transform .2s ease;
  box-shadow: 8px 0 24px -8px rgba(0,0,0,.4);
}
.layout.form-fullscreen .sidebar.open { transform: translateX(0); }
.layout.form-fullscreen .menu-toggle { display: inline-flex; }
